changed several variable names for body types to 'ubBodyType', as this is more consistent and allows wider use of macros

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7961 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2015-08-07 20:09:10 +00:00
parent 67fa865543
commit 929d15ec8a
14 changed files with 183 additions and 196 deletions
+15 -15
View File
@@ -534,27 +534,27 @@ void AddMercToWorld( INT32 iMapIndex )
memset( &gTempBasicPlacement, 0, sizeof( BASIC_SOLDIERCREATE_STRUCT ) ); memset( &gTempBasicPlacement, 0, sizeof( BASIC_SOLDIERCREATE_STRUCT ) );
gTempBasicPlacement.bBodyType = -1; gTempBasicPlacement.ubBodyType = -1;
//calculate specific information based on the team. //calculate specific information based on the team.
switch( iDrawMode ) switch( iDrawMode )
{ {
case DRAW_MODE_ENEMY: case DRAW_MODE_ENEMY:
gTempBasicPlacement.bTeam = ENEMY_TEAM; gTempBasicPlacement.bTeam = ENEMY_TEAM;
gTempBasicPlacement.bBodyType = RANDOM; gTempBasicPlacement.ubBodyType = RANDOM;
gTempBasicPlacement.ubSoldierClass = gubSoldierClass; gTempBasicPlacement.ubSoldierClass = gubSoldierClass;
break; break;
case DRAW_MODE_CREATURE: case DRAW_MODE_CREATURE:
gTempBasicPlacement.bTeam = CREATURE_TEAM; gTempBasicPlacement.bTeam = CREATURE_TEAM;
gTempBasicPlacement.bBodyType = gbCurrCreature; gTempBasicPlacement.ubBodyType = gbCurrCreature;
break; break;
case DRAW_MODE_REBEL: case DRAW_MODE_REBEL:
gTempBasicPlacement.bTeam = MILITIA_TEAM; gTempBasicPlacement.bTeam = MILITIA_TEAM;
gTempBasicPlacement.bBodyType = RANDOM; gTempBasicPlacement.ubBodyType = RANDOM;
break; break;
case DRAW_MODE_CIVILIAN: case DRAW_MODE_CIVILIAN:
gTempBasicPlacement.bTeam = CIV_TEAM; gTempBasicPlacement.bTeam = CIV_TEAM;
gTempBasicPlacement.bBodyType = RANDOM; gTempBasicPlacement.ubBodyType = RANDOM;
gTempBasicPlacement.ubCivilianGroup = gubCivGroup; gTempBasicPlacement.ubCivilianGroup = gubCivGroup;
if( giCurrentTilesetID == 1 ) //caves if( giCurrentTilesetID == 1 ) //caves
{ {
@@ -2119,10 +2119,10 @@ void ChangeBodyType( INT8 bOffset ) //+1 or -1 only
for( x = 0; x < iMax; x++ ) for( x = 0; x < iMax; x++ )
{ {
iIndex = pbArray[ x ]; iIndex = pbArray[ x ];
if( iIndex == gpSelected->pBasicPlacement->bBodyType ) if( iIndex == gpSelected->pBasicPlacement->ubBodyType )
break; break;
} }
Assert( iIndex == gpSelected->pBasicPlacement->bBodyType ); Assert( iIndex == gpSelected->pBasicPlacement->ubBodyType );
//now we have a match, so go to the next element (depending on offset value) //now we have a match, so go to the next element (depending on offset value)
x += bOffset; x += bOffset;
if( x >= iMax ) if( x >= iMax )
@@ -2168,10 +2168,10 @@ void ChangeBodyType( INT8 bOffset ) //+1 or -1 only
gpSelected->pSoldier->ConvertAniCodeToAniFrame( 0 ); gpSelected->pSoldier->ConvertAniCodeToAniFrame( 0 );
} }
//Update the placement's info as well. //Update the placement's info as well.
gpSelected->pBasicPlacement->bBodyType = (INT8)iIndex; gpSelected->pBasicPlacement->ubBodyType = (INT8)iIndex;
if( gpSelected->pDetailedPlacement ) if( gpSelected->pDetailedPlacement )
{ {
gpSelected->pDetailedPlacement->bBodyType = (INT8)iIndex; gpSelected->pDetailedPlacement->ubBodyType = (INT8)iIndex;
} }
if( gpSelected->pSoldier->bTeam == CREATURE_TEAM ) if( gpSelected->pSoldier->bTeam == CREATURE_TEAM )
{ {
@@ -2473,7 +2473,7 @@ void SetMercEditingMode( UINT8 ubNewMode )
void DisplayBodyTypeInfo() void DisplayBodyTypeInfo()
{ {
CHAR16 str[20]; CHAR16 str[20];
switch( gpSelected->pBasicPlacement->bBodyType ) switch( gpSelected->pBasicPlacement->ubBodyType )
{ {
case RANDOM: swprintf( str, pDisplayBodyTypeInfoText[0] ); break; case RANDOM: swprintf( str, pDisplayBodyTypeInfoText[0] ); break;
case REGMALE: swprintf( str, pDisplayBodyTypeInfoText[1] ); break; case REGMALE: swprintf( str, pDisplayBodyTypeInfoText[1] ); break;
@@ -3756,27 +3756,27 @@ void PasteMercPlacement( INT32 iMapIndex )
memcpy( &gTempBasicPlacement, &gSaveBufferBasicPlacement, sizeof( BASIC_SOLDIERCREATE_STRUCT ) ); memcpy( &gTempBasicPlacement, &gSaveBufferBasicPlacement, sizeof( BASIC_SOLDIERCREATE_STRUCT ) );
gTempBasicPlacement.bBodyType = -1; gTempBasicPlacement.ubBodyType = -1;
//calculate specific information based on the team. //calculate specific information based on the team.
switch( iDrawMode ) switch( iDrawMode )
{ {
case DRAW_MODE_ENEMY: case DRAW_MODE_ENEMY:
gTempBasicPlacement.bTeam = ENEMY_TEAM; gTempBasicPlacement.bTeam = ENEMY_TEAM;
gTempBasicPlacement.bBodyType = RANDOM; gTempBasicPlacement.ubBodyType = RANDOM;
gTempBasicPlacement.ubSoldierClass = gubSoldierClass; gTempBasicPlacement.ubSoldierClass = gubSoldierClass;
break; break;
case DRAW_MODE_CREATURE: case DRAW_MODE_CREATURE:
gTempBasicPlacement.bTeam = CREATURE_TEAM; gTempBasicPlacement.bTeam = CREATURE_TEAM;
gTempBasicPlacement.bBodyType = gbCurrCreature; gTempBasicPlacement.ubBodyType = gbCurrCreature;
break; break;
case DRAW_MODE_REBEL: case DRAW_MODE_REBEL:
gTempBasicPlacement.bTeam = MILITIA_TEAM; gTempBasicPlacement.bTeam = MILITIA_TEAM;
gTempBasicPlacement.bBodyType = RANDOM; gTempBasicPlacement.ubBodyType = RANDOM;
break; break;
case DRAW_MODE_CIVILIAN: case DRAW_MODE_CIVILIAN:
gTempBasicPlacement.bTeam = CIV_TEAM; gTempBasicPlacement.bTeam = CIV_TEAM;
gTempBasicPlacement.bBodyType = RANDOM; gTempBasicPlacement.ubBodyType = RANDOM;
gTempBasicPlacement.ubCivilianGroup = gubCivGroup; gTempBasicPlacement.ubCivilianGroup = gubCivGroup;
if( giCurrentTilesetID == 1 ) //caves if( giCurrentTilesetID == 1 ) //caves
{ {
+1 -1
View File
@@ -1307,7 +1307,7 @@ void recieveAI (RPCParameters *rpcParameters)
new_standard_data.bAgility = send_inv->standard_data.bAgility; new_standard_data.bAgility = send_inv->standard_data.bAgility;
new_standard_data.bAIMorale = send_inv->standard_data.bAIMorale; new_standard_data.bAIMorale = send_inv->standard_data.bAIMorale;
new_standard_data.bAttitude = send_inv->standard_data.bAttitude; new_standard_data.bAttitude = send_inv->standard_data.bAttitude;
new_standard_data.bBodyType = send_inv->standard_data.bBodyType; new_standard_data.ubBodyType = send_inv->standard_data.ubBodyType;
new_standard_data.bDexterity = send_inv->standard_data.bDexterity; new_standard_data.bDexterity = send_inv->standard_data.bDexterity;
new_standard_data.ubDirection = send_inv->standard_data.ubDirection; new_standard_data.ubDirection = send_inv->standard_data.ubDirection;
new_standard_data.bExpLevel = send_inv->standard_data.bExpLevel; new_standard_data.bExpLevel = send_inv->standard_data.bExpLevel;
+19 -23
View File
@@ -32,6 +32,7 @@
#include "Game Clock.h" #include "Game Clock.h"
#include "Queen Command.h" #include "Queen Command.h"
#include "Scheduling.h" #include "Scheduling.h"
#include "Soldier macros.h" // added by Flugente
#endif #endif
#include "GameVersion.h" #include "GameVersion.h"
@@ -299,7 +300,7 @@ BOOLEAN LoadEnemySoldiersFromTempFile()
curr->pBasicPlacement->ubDirection = curr->pDetailedPlacement->ubDirection; curr->pBasicPlacement->ubDirection = curr->pDetailedPlacement->ubDirection;
curr->pBasicPlacement->bOrders = curr->pDetailedPlacement->bOrders; curr->pBasicPlacement->bOrders = curr->pDetailedPlacement->bOrders;
curr->pBasicPlacement->bAttitude = curr->pDetailedPlacement->bAttitude; curr->pBasicPlacement->bAttitude = curr->pDetailedPlacement->bAttitude;
curr->pBasicPlacement->bBodyType = curr->pDetailedPlacement->bBodyType; curr->pBasicPlacement->ubBodyType = curr->pDetailedPlacement->ubBodyType;
curr->pBasicPlacement->fOnRoof = curr->pDetailedPlacement->fOnRoof; curr->pBasicPlacement->fOnRoof = curr->pDetailedPlacement->fOnRoof;
curr->pBasicPlacement->ubSoldierClass = curr->pDetailedPlacement->ubSoldierClass; curr->pBasicPlacement->ubSoldierClass = curr->pDetailedPlacement->ubSoldierClass;
curr->pBasicPlacement->ubCivilianGroup = curr->pDetailedPlacement->ubCivilianGroup; curr->pBasicPlacement->ubCivilianGroup = curr->pDetailedPlacement->ubCivilianGroup;
@@ -349,9 +350,9 @@ BOOLEAN LoadEnemySoldiersFromTempFile()
} }
break; break;
case SOLDIER_CLASS_TANK: case SOLDIER_CLASS_TANK:
if( curr->pBasicPlacement->bBodyType == TANK_NE || curr->pBasicPlacement->bBodyType == TANK_NW ) if ( TANK( curr->pBasicPlacement ) )
{ {
ubNumTanks++; ++ubNumTanks;
if( ubNumTanks < ubStrategicTanks ) if( ubNumTanks < ubStrategicTanks )
{ {
AddPlacementToWorld( curr ); AddPlacementToWorld( curr );
@@ -915,7 +916,7 @@ BOOLEAN NewWayOfLoadingEnemySoldiersFromTempFile()
curr->pBasicPlacement->ubDirection = curr->pDetailedPlacement->ubDirection; curr->pBasicPlacement->ubDirection = curr->pDetailedPlacement->ubDirection;
curr->pBasicPlacement->bOrders = curr->pDetailedPlacement->bOrders; curr->pBasicPlacement->bOrders = curr->pDetailedPlacement->bOrders;
curr->pBasicPlacement->bAttitude = curr->pDetailedPlacement->bAttitude; curr->pBasicPlacement->bAttitude = curr->pDetailedPlacement->bAttitude;
curr->pBasicPlacement->bBodyType = curr->pDetailedPlacement->bBodyType; curr->pBasicPlacement->ubBodyType = curr->pDetailedPlacement->ubBodyType;
curr->pBasicPlacement->fOnRoof = curr->pDetailedPlacement->fOnRoof; curr->pBasicPlacement->fOnRoof = curr->pDetailedPlacement->fOnRoof;
curr->pBasicPlacement->ubSoldierClass = curr->pDetailedPlacement->ubSoldierClass; curr->pBasicPlacement->ubSoldierClass = curr->pDetailedPlacement->ubSoldierClass;
curr->pBasicPlacement->ubCivilianGroup = curr->pDetailedPlacement->ubCivilianGroup; curr->pBasicPlacement->ubCivilianGroup = curr->pDetailedPlacement->ubCivilianGroup;
@@ -959,9 +960,9 @@ BOOLEAN NewWayOfLoadingEnemySoldiersFromTempFile()
} }
break; break;
case SOLDIER_CLASS_TANK: case SOLDIER_CLASS_TANK:
if( curr->pBasicPlacement->bBodyType == TANK_NE || curr->pBasicPlacement->bBodyType == TANK_NW ) if ( TANK( curr->pBasicPlacement ) )
{ {
ubNumTanks++; ++ubNumTanks;
if( ubNumTanks <= ubStrategicTanks ) if( ubNumTanks <= ubStrategicTanks )
{ {
//def: AddPlacementToWorld( curr ); //def: AddPlacementToWorld( curr );
@@ -1244,7 +1245,7 @@ BOOLEAN NewWayOfLoadingCiviliansFromTempFile()
curr->pBasicPlacement->ubDirection = curr->pDetailedPlacement->ubDirection; curr->pBasicPlacement->ubDirection = curr->pDetailedPlacement->ubDirection;
curr->pBasicPlacement->bOrders = curr->pDetailedPlacement->bOrders; curr->pBasicPlacement->bOrders = curr->pDetailedPlacement->bOrders;
curr->pBasicPlacement->bAttitude = curr->pDetailedPlacement->bAttitude; curr->pBasicPlacement->bAttitude = curr->pDetailedPlacement->bAttitude;
curr->pBasicPlacement->bBodyType = curr->pDetailedPlacement->bBodyType; curr->pBasicPlacement->ubBodyType = curr->pDetailedPlacement->ubBodyType;
curr->pBasicPlacement->fOnRoof = curr->pDetailedPlacement->fOnRoof; curr->pBasicPlacement->fOnRoof = curr->pDetailedPlacement->fOnRoof;
curr->pBasicPlacement->ubSoldierClass = curr->pDetailedPlacement->ubSoldierClass; curr->pBasicPlacement->ubSoldierClass = curr->pDetailedPlacement->ubSoldierClass;
curr->pBasicPlacement->ubCivilianGroup = curr->pDetailedPlacement->ubCivilianGroup; curr->pBasicPlacement->ubCivilianGroup = curr->pDetailedPlacement->ubCivilianGroup;
@@ -1610,20 +1611,16 @@ BOOLEAN CountNumberOfElitesRegularsAdminsAndCreaturesFromEnemySoldiersTempFile(
UINT8 ubSectorID; UINT8 ubSectorID;
// UINT8 ubNumElites = 0, ubNumTroops = 0, ubNumAdmins = 0, ubNumCreatures = 0; // UINT8 ubNumElites = 0, ubNumTroops = 0, ubNumAdmins = 0, ubNumCreatures = 0;
// UINT8 ubStrategicElites, ubStrategicTroops, ubStrategicAdmins, ubStrategicCreatures; // UINT8 ubStrategicElites, ubStrategicTroops, ubStrategicAdmins, ubStrategicCreatures;
//make sure the variables are initialized //make sure the variables are initialized
*pubNumElites = 0; *pubNumElites = 0;
*pubNumRegulars = 0; *pubNumRegulars = 0;
*pubNumAdmins = 0; *pubNumAdmins = 0;
*pubNumTanks = 0; *pubNumTanks = 0;
*pubNumCreatures = 0; *pubNumCreatures = 0;
//STEP ONE: Set up the temp file to read from. //STEP ONE: Set up the temp file to read from.
//Convert the current sector location into a file name //Convert the current sector location into a file name
// GetMapFileName( gWorldSectorX, gWorldSectorY, gbWorldSectorZ, zTempName, FALSE ); // GetMapFileName( gWorldSectorX, gWorldSectorY, gbWorldSectorZ, zTempName, FALSE );
@@ -1697,8 +1694,7 @@ BOOLEAN CountNumberOfElitesRegularsAdminsAndCreaturesFromEnemySoldiersTempFile(
#endif #endif
goto FAIL_LOAD; goto FAIL_LOAD;
} }
FileRead( hfile, &bSectorZ, 1, &uiNumBytesRead ); FileRead( hfile, &bSectorZ, 1, &uiNumBytesRead );
if( uiNumBytesRead != 1 ) if( uiNumBytesRead != 1 )
{ {
@@ -1723,7 +1719,6 @@ BOOLEAN CountNumberOfElitesRegularsAdminsAndCreaturesFromEnemySoldiersTempFile(
return TRUE; return TRUE;
} }
if( slots < 0 || slots >= (int)gGameExternalOptions.ubGameMaximumNumberOfEnemies ) if( slots < 0 || slots >= (int)gGameExternalOptions.ubGameMaximumNumberOfEnemies )
{ //bad IO! { //bad IO!
#ifdef JA2TESTVERSION #ifdef JA2TESTVERSION
@@ -1759,7 +1754,7 @@ BOOLEAN CountNumberOfElitesRegularsAdminsAndCreaturesFromEnemySoldiersTempFile(
} }
*/ */
for( i = 0; i < slots; i++ ) for( i = 0; i < slots; ++i )
{ {
if ( !tempDetailedPlacement.Load(hfile, gEnemyPreservedTempFileVersion[SECTOR( sSectorX,sSectorY)], true) ) if ( !tempDetailedPlacement.Load(hfile, gEnemyPreservedTempFileVersion[SECTOR( sSectorX,sSectorY)], true) )
{ {
@@ -1785,7 +1780,7 @@ BOOLEAN CountNumberOfElitesRegularsAdminsAndCreaturesFromEnemySoldiersTempFile(
(*pubNumCreatures)++; (*pubNumCreatures)++;
break; break;
case SOLDIER_CLASS_TANK: case SOLDIER_CLASS_TANK:
if( tempDetailedPlacement.bBodyType == TANK_NE || tempDetailedPlacement.bBodyType == TANK_NW ) if ( TANK( (&tempDetailedPlacement) ) )
{ {
(*pubNumTanks)++; (*pubNumTanks)++;
} }
@@ -1810,7 +1805,7 @@ BOOLEAN CountNumberOfElitesRegularsAdminsAndCreaturesFromEnemySoldiersTempFile(
curr->pBasicPlacement->ubDirection = curr->pDetailedPlacement->ubDirection; curr->pBasicPlacement->ubDirection = curr->pDetailedPlacement->ubDirection;
curr->pBasicPlacement->bOrders = curr->pDetailedPlacement->bOrders; curr->pBasicPlacement->bOrders = curr->pDetailedPlacement->bOrders;
curr->pBasicPlacement->bAttitude = curr->pDetailedPlacement->bAttitude; curr->pBasicPlacement->bAttitude = curr->pDetailedPlacement->bAttitude;
curr->pBasicPlacement->bBodyType = curr->pDetailedPlacement->bBodyType; curr->pBasicPlacement->ubBodyType = curr->pDetailedPlacement->ubBodyType;
curr->pBasicPlacement->fOnRoof = curr->pDetailedPlacement->fOnRoof; curr->pBasicPlacement->fOnRoof = curr->pDetailedPlacement->fOnRoof;
curr->pBasicPlacement->ubSoldierClass = curr->pDetailedPlacement->ubSoldierClass; curr->pBasicPlacement->ubSoldierClass = curr->pDetailedPlacement->ubSoldierClass;
curr->pBasicPlacement->ubCivilianGroup = curr->pDetailedPlacement->ubCivilianGroup; curr->pBasicPlacement->ubCivilianGroup = curr->pDetailedPlacement->ubCivilianGroup;
@@ -1888,9 +1883,10 @@ BOOLEAN CountNumberOfElitesRegularsAdminsAndCreaturesFromEnemySoldiersTempFile(
//various checks failed for hacker validation. If we reach this point, the "error: exit game" //various checks failed for hacker validation. If we reach this point, the "error: exit game"
//dialog would appear in a non-testversion. //dialog would appear in a non-testversion.
FileClose( hfile ); FileClose( hfile );
#ifdef JA2TESTVERSION #ifdef JA2TESTVERSION
AssertMsg( 0, zReason ); AssertMsg( 0, zReason );
#endif #endif
return FALSE; return FALSE;
} }
+2 -2
View File
@@ -76,7 +76,7 @@ BOOLEAN AddUIPlan( INT32 sGridNo, UINT8 ubPlanID )
MercCreateStruct.bTeam = SOLDIER_CREATE_AUTO_TEAM; MercCreateStruct.bTeam = SOLDIER_CREATE_AUTO_TEAM;
MercCreateStruct.ubProfile = NO_PROFILE; MercCreateStruct.ubProfile = NO_PROFILE;
MercCreateStruct.fPlayerPlan = TRUE; MercCreateStruct.fPlayerPlan = TRUE;
MercCreateStruct.bBodyType = gpUIPlannedSoldier->ubBodyType; MercCreateStruct.ubBodyType = gpUIPlannedSoldier->ubBodyType;
MercCreateStruct.sInsertionGridNo = sGridNo; MercCreateStruct.sInsertionGridNo = sGridNo;
// Get Grid Corrdinates of mouse // Get Grid Corrdinates of mouse
@@ -158,7 +158,7 @@ BOOLEAN AddUIPlan( INT32 sGridNo, UINT8 ubPlanID )
MercCreateStruct.bTeam = SOLDIER_CREATE_AUTO_TEAM; MercCreateStruct.bTeam = SOLDIER_CREATE_AUTO_TEAM;
MercCreateStruct.ubProfile = NO_PROFILE; MercCreateStruct.ubProfile = NO_PROFILE;
MercCreateStruct.fPlayerPlan = TRUE; MercCreateStruct.fPlayerPlan = TRUE;
MercCreateStruct.bBodyType = gpUIPlannedSoldier->ubBodyType; MercCreateStruct.ubBodyType = gpUIPlannedSoldier->ubBodyType;
MercCreateStruct.sInsertionGridNo = sGridNo; MercCreateStruct.sInsertionGridNo = sGridNo;
// Get Grid Corrdinates of mouse // Get Grid Corrdinates of mouse
+1 -1
View File
@@ -2023,7 +2023,7 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
swprintf( NameStr, zGrod[0] ); swprintf( NameStr, zGrod[0] );
} }
//Legion //Legion
else if ( pSoldier->ubBodyType == TANK_NE || pSoldier->ubBodyType == TANK_NW ) else if ( TANK( pSoldier ) )
{ {
swprintf( NameStr, gNewVehicle[164].NewVehicleStrings ); swprintf( NameStr, gNewVehicle[164].NewVehicleStrings );
} }
+5 -8
View File
@@ -19,6 +19,7 @@
#include "Game Clock.h" #include "Game Clock.h"
#include "message.h" #include "message.h"
#include "Tactical Save.h" // added by Flugente #include "Tactical Save.h" // added by Flugente
#include "Soldier macros.h" // added by Flugente
#endif #endif
/* /*
@@ -241,28 +242,24 @@ void GenerateRandomEquipment( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass, INT8
UINT32 i; UINT32 i;
INT8 bEquipmentModifier; INT8 bEquipmentModifier;
UINT8 ubMaxSpecialWeaponRoll; UINT8 ubMaxSpecialWeaponRoll;
Assert( pp ); Assert( pp );
// kids don't get anything 'cause they don't have any weapon animations and the rest is inappropriate // kids don't get anything 'cause they don't have any weapon animations and the rest is inappropriate
if ( ( pp->bBodyType == HATKIDCIV ) || ( pp->bBodyType == KIDCIV ) ) if ( ( pp->ubBodyType == HATKIDCIV ) || ( pp->ubBodyType == KIDCIV ) )
{ {
return; return;
} }
if ( TANK( pp ) )
if ( ( pp->bBodyType == TANK_NE ) || ( pp->bBodyType == TANK_NW ) )
{ {
EquipTank( pp ); EquipTank( pp );
return; return;
} }
Assert( ( bSoldierClass >= SOLDIER_CLASS_NONE ) && ( bSoldierClass <= SOLDIER_CLASS_ELITE_MILITIA ) || bSoldierClass == SOLDIER_CLASS_TANK ); Assert( ( bSoldierClass >= SOLDIER_CLASS_NONE ) && ( bSoldierClass <= SOLDIER_CLASS_ELITE_MILITIA ) || bSoldierClass == SOLDIER_CLASS_TANK );
Assert( ( bEquipmentRating >= 0 ) && ( bEquipmentRating <= 4 ) ); Assert( ( bEquipmentRating >= 0 ) && ( bEquipmentRating <= 4 ) );
// equipment level is modified by 1/10 of the difficulty percentage, -5, so it's between -5 to +5 // equipment level is modified by 1/10 of the difficulty percentage, -5, so it's between -5 to +5
// (on normal, this is actually -4 to +4, easy is -5 to +3, and hard is -3 to +5) // (on normal, this is actually -4 to +4, easy is -5 to +3, and hard is -3 to +5)
//bEquipmentModifier = bEquipmentRating + ( ( CalcDifficultyModifier( bSoldierClass ) / 10 ) - 5 ); //bEquipmentModifier = bEquipmentRating + ( ( CalcDifficultyModifier( bSoldierClass ) / 10 ) - 5 );
+4 -4
View File
@@ -469,10 +469,10 @@ void UpdateOldVersionMap()
while( curr ) while( curr )
{ {
//Bug 11) Convert all wheelchaired placement bodytypes to cows. Result of change in the animation database. //Bug 11) Convert all wheelchaired placement bodytypes to cows. Result of change in the animation database.
if( curr->pDetailedPlacement && curr->pDetailedPlacement->bBodyType == CRIPPLECIV ) if( curr->pDetailedPlacement && curr->pDetailedPlacement->ubBodyType == CRIPPLECIV )
{ {
curr->pDetailedPlacement->bBodyType = COW; curr->pDetailedPlacement->ubBodyType = COW;
curr->pBasicPlacement->bBodyType = COW; curr->pBasicPlacement->ubBodyType = COW;
} }
curr = curr->next; curr = curr->next;
} }
@@ -614,7 +614,7 @@ void UpdateOldVersionMap()
if( curr->pBasicPlacement->bTeam == CIV_TEAM && !curr->pDetailedPlacement ) if( curr->pBasicPlacement->bTeam == CIV_TEAM && !curr->pDetailedPlacement )
{ {
curr->pBasicPlacement->ubSoldierClass = SOLDIER_CLASS_MINER; curr->pBasicPlacement->ubSoldierClass = SOLDIER_CLASS_MINER;
curr->pBasicPlacement->bBodyType = -1; curr->pBasicPlacement->ubBodyType = -1;
} }
curr = curr->next; curr = curr->next;
} }
+4 -4
View File
@@ -1164,7 +1164,7 @@ INT16 FindNearestRottingCorpse( SOLDIERTYPE *pSoldier )
void AddCrowToCorpse( ROTTING_CORPSE *pCorpse ) void AddCrowToCorpse( ROTTING_CORPSE *pCorpse )
{ {
SOLDIERCREATE_STRUCT MercCreateStruct; SOLDIERCREATE_STRUCT MercCreateStruct;
INT8 bBodyType = CROW; INT8 ubBodyType = CROW;
UINT8 iNewIndex; UINT8 iNewIndex;
INT32 sGridNo; INT32 sGridNo;
UINT8 ubDirection; UINT8 ubDirection;
@@ -1183,7 +1183,7 @@ void AddCrowToCorpse( ROTTING_CORPSE *pCorpse )
MercCreateStruct.sSectorX = gWorldSectorX; MercCreateStruct.sSectorX = gWorldSectorX;
MercCreateStruct.sSectorY = gWorldSectorY; MercCreateStruct.sSectorY = gWorldSectorY;
MercCreateStruct.bSectorZ = gbWorldSectorZ; MercCreateStruct.bSectorZ = gbWorldSectorZ;
MercCreateStruct.bBodyType = bBodyType; MercCreateStruct.ubBodyType = ubBodyType;
MercCreateStruct.ubDirection = SOUTH; MercCreateStruct.ubDirection = SOUTH;
MercCreateStruct.bTeam = CIV_TEAM; MercCreateStruct.bTeam = CIV_TEAM;
MercCreateStruct.sInsertionGridNo = pCorpse->def.sGridNo; MercCreateStruct.sInsertionGridNo = pCorpse->def.sGridNo;
@@ -2717,7 +2717,7 @@ UINT8 GetNearestRottingCorpseAIWarning( INT32 sGridNo )
MercCreateStruct.sSectorX = gWorldSectorX; MercCreateStruct.sSectorX = gWorldSectorX;
MercCreateStruct.sSectorY = gWorldSectorY; MercCreateStruct.sSectorY = gWorldSectorY;
MercCreateStruct.bSectorZ = gbWorldSectorZ; MercCreateStruct.bSectorZ = gbWorldSectorZ;
MercCreateStruct.bBodyType = pCorpse->def.ubBodyType; MercCreateStruct.ubBodyType = pCorpse->def.ubBodyType;
MercCreateStruct.ubDirection = pCorpse->def.ubDirection; MercCreateStruct.ubDirection = pCorpse->def.ubDirection;
MercCreateStruct.fOnRoof = pCorpse->def.bLevel > 0 ? TRUE : FALSE; MercCreateStruct.fOnRoof = pCorpse->def.bLevel > 0 ? TRUE : FALSE;
@@ -2759,7 +2759,7 @@ UINT8 GetNearestRottingCorpseAIWarning( INT32 sGridNo )
} }
// FIX: something's wrong with the FATCIV-bodytype when dying... this is to ensure they die absolutely fast // FIX: something's wrong with the FATCIV-bodytype when dying... this is to ensure they die absolutely fast
//if ( MercCreateStruct.bBodyType == FATCIV ) //if ( MercCreateStruct.ubBodyType == FATCIV )
//MercCreateStruct.bLifeMax = OKLIFE; //MercCreateStruct.bLifeMax = OKLIFE;
MercCreateStruct.bExpLevel = 1; MercCreateStruct.bExpLevel = 1;
+42 -41
View File
@@ -45,6 +45,7 @@
#include "math.h" #include "math.h"
#include "Game Clock.h" // added this one - SANDRO #include "Game Clock.h" // added this one - SANDRO
#include "Interface.h" // added by Flugente #include "Interface.h" // added by Flugente
#include "Soldier macros.h" // added by Flugente
#endif #endif
#include "connect.h" #include "connect.h"
@@ -136,7 +137,7 @@ OLD_SOLDIERCREATE_STRUCT_101& OLD_SOLDIERCREATE_STRUCT_101::operator=(SOLDIERCRE
this->bAgility = src.bAgility; this->bAgility = src.bAgility;
this->bAIMorale = src.bAIMorale; this->bAIMorale = src.bAIMorale;
this->bAttitude = src.bAttitude; this->bAttitude = src.bAttitude;
this->bBodyType = src.bBodyType; this->ubBodyType = src.ubBodyType;
this->bDexterity = src.bDexterity; this->bDexterity = src.bDexterity;
this->ubDirection = src.ubDirection; this->ubDirection = src.ubDirection;
this->bExpLevel = src.bExpLevel; this->bExpLevel = src.bExpLevel;
@@ -209,7 +210,7 @@ SOLDIERCREATE_STRUCT& SOLDIERCREATE_STRUCT::operator=(const OLD_SOLDIERCREATE_ST
this->bAgility = src.bAgility; this->bAgility = src.bAgility;
this->bAIMorale = src.bAIMorale; this->bAIMorale = src.bAIMorale;
this->bAttitude = src.bAttitude; this->bAttitude = src.bAttitude;
this->bBodyType = src.bBodyType; this->ubBodyType = src.ubBodyType;
this->bDexterity = src.bDexterity; this->bDexterity = src.bDexterity;
this->ubDirection = src.ubDirection; this->ubDirection = src.ubDirection;
this->bExpLevel = src.bExpLevel; this->bExpLevel = src.bExpLevel;
@@ -273,7 +274,7 @@ SOLDIERCREATE_STRUCT& SOLDIERCREATE_STRUCT::operator=(const SOLDIERTYPE& Soldier
this->bOrders = Soldier.aiData.bOrders; this->bOrders = Soldier.aiData.bOrders;
this->bMorale = Soldier.aiData.bMorale; this->bMorale = Soldier.aiData.bMorale;
this->bAIMorale = Soldier.aiData.bAIMorale; this->bAIMorale = Soldier.aiData.bAIMorale;
this->bBodyType = Soldier.ubBodyType; this->ubBodyType = Soldier.ubBodyType;
this->ubCivilianGroup = Soldier.ubCivilianGroup; this->ubCivilianGroup = Soldier.ubCivilianGroup;
this->ubScheduleID = Soldier.ubScheduleID; this->ubScheduleID = Soldier.ubScheduleID;
this->fHasKeys = Soldier.flags.bHasKeys; this->fHasKeys = Soldier.flags.bHasKeys;
@@ -322,7 +323,7 @@ UINT16 SOLDIERCREATE_STRUCT::GetChecksum()
this->bWisdom * 11 + this->bWisdom * 11 +
this->bMorale * 7 + this->bMorale * 7 +
this->bAIMorale * 3 - this->bAIMorale * 3 -
this->bBodyType * 7 + this->ubBodyType * 7 +
4 * 6 + 4 * 6 +
this->sSectorX * 7 - this->sSectorX * 7 -
this->ubSoldierClass * 4 + this->ubSoldierClass * 4 +
@@ -370,7 +371,7 @@ SOLDIERCREATE_STRUCT& SOLDIERCREATE_STRUCT::operator=(const _OLD_SOLDIERCREATE_S
bAgility = src.bAgility; bAgility = src.bAgility;
bAIMorale = src.bAIMorale; bAIMorale = src.bAIMorale;
bAttitude = src.bAttitude; bAttitude = src.bAttitude;
bBodyType = src.bBodyType; ubBodyType = src.ubBodyType;
bDexterity = src.bDexterity; bDexterity = src.bDexterity;
ubDirection = src.ubDirection; ubDirection = src.ubDirection;
bExpLevel = src.bExpLevel; bExpLevel = src.bExpLevel;
@@ -605,7 +606,7 @@ SOLDIERTYPE* TacticalCreateSoldier( SOLDIERCREATE_STRUCT *pCreateStruct, UINT8 *
pCreateStruct->fPlayerPlan = 0; pCreateStruct->fPlayerPlan = 0;
} }
if ( is_networked && (pCreateStruct->bBodyType == TANK_NW || pCreateStruct->bBodyType == TANK_NE) ) if ( is_networked && TANK( pCreateStruct ) )
{ {
ScreenMsg( FONT_YELLOW, MSG_MPSYSTEM, L"skipping tank"); ScreenMsg( FONT_YELLOW, MSG_MPSYSTEM, L"skipping tank");
return NULL; return NULL;
@@ -680,7 +681,7 @@ SOLDIERTYPE* TacticalCreateSoldier( SOLDIERCREATE_STRUCT *pCreateStruct, UINT8 *
else else
{ {
// LOOK AT BODY TYPE! // LOOK AT BODY TYPE!
switch ( pCreateStruct->bBodyType ) switch ( pCreateStruct->ubBodyType )
{ {
case REGMALE: case REGMALE:
case BIGMALE: case BIGMALE:
@@ -1694,7 +1695,7 @@ BOOLEAN TacticalCopySoldierFromCreateStruct( SOLDIERTYPE *pSoldier, SOLDIERCREAT
pSoldier->aiData.bMorale = pCreateStruct->bMorale; pSoldier->aiData.bMorale = pCreateStruct->bMorale;
pSoldier->aiData.bAIMorale = pCreateStruct->bAIMorale; pSoldier->aiData.bAIMorale = pCreateStruct->bAIMorale;
pSoldier->bVocalVolume = MIDVOLUME; pSoldier->bVocalVolume = MIDVOLUME;
pSoldier->ubBodyType = pCreateStruct->bBodyType; pSoldier->ubBodyType = pCreateStruct->ubBodyType;
pSoldier->ubCivilianGroup = pCreateStruct->ubCivilianGroup; pSoldier->ubCivilianGroup = pCreateStruct->ubCivilianGroup;
pSoldier->ubScheduleID = pCreateStruct->ubScheduleID; pSoldier->ubScheduleID = pCreateStruct->ubScheduleID;
@@ -1703,7 +1704,7 @@ BOOLEAN TacticalCopySoldierFromCreateStruct( SOLDIERTYPE *pSoldier, SOLDIERCREAT
// Flugente: soldier profiles // Flugente: soldier profiles
// silversurfer: Don't replace tanks! // silversurfer: Don't replace tanks!
if ( pCreateStruct->bBodyType != TANK_NE && pCreateStruct->bBodyType != TANK_NW ) if ( !TANK( pCreateStruct ) )
{ {
// We have a function for this // We have a function for this
INT8 type = pSoldier->GetSoldierProfileType( pCreateStruct->bTeam ); INT8 type = pSoldier->GetSoldierProfileType( pCreateStruct->bTeam );
@@ -2271,7 +2272,7 @@ void CreateDetailedPlacementGivenBasicPlacementInfo( SOLDIERCREATE_STRUCT *pp, B
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("CreateDetailedPlacementGivenBasicPlacementInfo: choose body type")); DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("CreateDetailedPlacementGivenBasicPlacementInfo: choose body type"));
//Choose a body type randomly if none specified. //Choose a body type randomly if none specified.
if( bp->bBodyType < 0 ) if( bp->ubBodyType < 0 )
{ {
switch ( bp->bTeam ) switch ( bp->bTeam )
{ {
@@ -2280,10 +2281,10 @@ void CreateDetailedPlacementGivenBasicPlacementInfo( SOLDIERCREATE_STRUCT *pp, B
case MILITIA_TEAM: case MILITIA_TEAM:
switch( Random( 4 ) ) switch( Random( 4 ) )
{ {
case 0: pp->bBodyType = REGMALE; break; case 0: pp->ubBodyType = REGMALE; break;
case 1: pp->bBodyType = BIGMALE; break; case 1: pp->ubBodyType = BIGMALE; break;
case 2: pp->bBodyType = STOCKYMALE; break; case 2: pp->ubBodyType = STOCKYMALE; break;
case 3: pp->bBodyType = REGFEMALE; break; case 3: pp->ubBodyType = REGFEMALE; break;
} }
break; break;
case CIV_TEAM: case CIV_TEAM:
@@ -2291,9 +2292,9 @@ void CreateDetailedPlacementGivenBasicPlacementInfo( SOLDIERCREATE_STRUCT *pp, B
{ {
switch( Random( 3 ) ) switch( Random( 3 ) )
{ //only strong and fit men can be miners. { //only strong and fit men can be miners.
case 0: pp->bBodyType = REGMALE; break; case 0: pp->ubBodyType = REGMALE; break;
case 1: pp->bBodyType = BIGMALE; break; case 1: pp->ubBodyType = BIGMALE; break;
case 2: pp->bBodyType = MANCIV; break; case 2: pp->ubBodyType = MANCIV; break;
} }
} }
else else
@@ -2302,27 +2303,27 @@ void CreateDetailedPlacementGivenBasicPlacementInfo( SOLDIERCREATE_STRUCT *pp, B
iRandom = Random( 100 ); iRandom = Random( 100 );
if( iRandom < 8 ) if( iRandom < 8 )
{ //8% chance FATCIV { //8% chance FATCIV
pp->bBodyType = FATCIV; pp->ubBodyType = FATCIV;
} }
else if( iRandom < 38 ) else if( iRandom < 38 )
{ //30% chance MANCIV { //30% chance MANCIV
pp->bBodyType = MANCIV; pp->ubBodyType = MANCIV;
} }
else if( iRandom < 57 ) else if( iRandom < 57 )
{ //19% chance MINICIV { //19% chance MINICIV
pp->bBodyType = MINICIV; pp->ubBodyType = MINICIV;
} }
else if( iRandom < 76 ) else if( iRandom < 76 )
{ //19% chance DRESSCIV { //19% chance DRESSCIV
pp->bBodyType = DRESSCIV; pp->ubBodyType = DRESSCIV;
} }
else if( iRandom < 88 ) else if( iRandom < 88 )
{ //12% chance HATKIDCIV { //12% chance HATKIDCIV
pp->bBodyType = HATKIDCIV; pp->ubBodyType = HATKIDCIV;
} }
else else
{ //12% chance KIDCIV { //12% chance KIDCIV
pp->bBodyType = KIDCIV; pp->ubBodyType = KIDCIV;
} }
} }
break; break;
@@ -2330,7 +2331,7 @@ void CreateDetailedPlacementGivenBasicPlacementInfo( SOLDIERCREATE_STRUCT *pp, B
} }
else else
{ {
pp->bBodyType = bp->bBodyType; pp->ubBodyType = bp->ubBodyType;
} }
//Pass over mandatory information specified from the basic placement //Pass over mandatory information specified from the basic placement
@@ -2423,7 +2424,7 @@ void CreateDetailedPlacementGivenBasicPlacementInfo( SOLDIERCREATE_STRUCT *pp, B
break; break;
case SOLDIER_CLASS_CREATURE: case SOLDIER_CLASS_CREATURE:
switch( bp->bBodyType ) switch( bp->ubBodyType )
{ {
case LARVAE_MONSTER: case LARVAE_MONSTER:
pp->bExpLevel = 1 + bExpLevelModifier; pp->bExpLevel = 1 + bExpLevelModifier;
@@ -2610,9 +2611,9 @@ void CreateStaticDetailedPlacementGivenBasicPlacementInfo( SOLDIERCREATE_STRUCT
//Only creatures have mandatory body types specified. //Only creatures have mandatory body types specified.
if( spp->bTeam == CREATURE_TEAM ) if( spp->bTeam == CREATURE_TEAM )
spp->bBodyType = bp->bBodyType; spp->ubBodyType = bp->ubBodyType;
else else
spp->bBodyType = -1; spp->ubBodyType = -1;
//Set up all possible static values. //Set up all possible static values.
//By setting them all to -1, that signifies that the attribute isn't static. //By setting them all to -1, that signifies that the attribute isn't static.
@@ -2685,7 +2686,7 @@ void CreateDetailedPlacementGivenStaticDetailedPlacementAndBasicPlacementInfo(
pp->bOrders = bp->bOrders; pp->bOrders = bp->bOrders;
pp->bAttitude = bp->bAttitude; pp->bAttitude = bp->bAttitude;
pp->ubDirection = bp->ubDirection; pp->ubDirection = bp->ubDirection;
pp->bBodyType = bp->bBodyType; pp->ubBodyType = bp->ubBodyType;
pp->bPatrolCnt = bp->bPatrolCnt; pp->bPatrolCnt = bp->bPatrolCnt;
memcpy( pp->sPatrolGrid, bp->sPatrolGrid, sizeof( INT32 ) * MAXPATROLGRIDS ); memcpy( pp->sPatrolGrid, bp->sPatrolGrid, sizeof( INT32 ) * MAXPATROLGRIDS );
pp->fHasKeys = bp->fHasKeys; pp->fHasKeys = bp->fHasKeys;
@@ -2867,7 +2868,7 @@ void UpdateStaticDetailedPlacementWithProfileInformation( SOLDIERCREATE_STRUCT *
spp->bMechanical = pProfile->bMechanical; spp->bMechanical = pProfile->bMechanical;
spp->bExplosive = pProfile->bExplosive; spp->bExplosive = pProfile->bExplosive;
spp->bBodyType = pProfile->ubBodyType; spp->ubBodyType = pProfile->ubBodyType;
// Copy over inv if we want to // Copy over inv if we want to
UINT32 invsize = pProfile->inv.size(); UINT32 invsize = pProfile->inv.size();
@@ -3002,7 +3003,7 @@ SOLDIERTYPE* TacticalCreateAdministrator()
bp.bTeam = ENEMY_TEAM; bp.bTeam = ENEMY_TEAM;
bp.bOrders = SEEKENEMY; bp.bOrders = SEEKENEMY;
bp.bAttitude = (INT8) Random( MAXATTITUDES ); bp.bAttitude = (INT8) Random( MAXATTITUDES );
bp.bBodyType = -1; bp.ubBodyType = -1;
bp.ubSoldierClass = SOLDIER_CLASS_ADMINISTRATOR; bp.ubSoldierClass = SOLDIER_CLASS_ADMINISTRATOR;
CreateDetailedPlacementGivenBasicPlacementInfo( &pp, &bp ); CreateDetailedPlacementGivenBasicPlacementInfo( &pp, &bp );
pSoldier = TacticalCreateSoldier( &pp, &ubID ); pSoldier = TacticalCreateSoldier( &pp, &ubID );
@@ -3035,7 +3036,7 @@ SOLDIERTYPE* TacticalCreateArmyTroop()
bp.bTeam = ENEMY_TEAM; bp.bTeam = ENEMY_TEAM;
bp.bOrders = SEEKENEMY; bp.bOrders = SEEKENEMY;
bp.bAttitude = (INT8) Random( MAXATTITUDES ); bp.bAttitude = (INT8) Random( MAXATTITUDES );
bp.bBodyType = -1; bp.ubBodyType = -1;
bp.ubSoldierClass = SOLDIER_CLASS_ARMY; bp.ubSoldierClass = SOLDIER_CLASS_ARMY;
CreateDetailedPlacementGivenBasicPlacementInfo( &pp, &bp ); CreateDetailedPlacementGivenBasicPlacementInfo( &pp, &bp );
pSoldier = TacticalCreateSoldier( &pp, &ubID ); pSoldier = TacticalCreateSoldier( &pp, &ubID );
@@ -3069,7 +3070,7 @@ SOLDIERTYPE* TacticalCreateEliteEnemy()
bp.bTeam = ENEMY_TEAM; bp.bTeam = ENEMY_TEAM;
bp.bOrders = SEEKENEMY; bp.bOrders = SEEKENEMY;
bp.bAttitude = (INT8) Random( MAXATTITUDES ); bp.bAttitude = (INT8) Random( MAXATTITUDES );
bp.bBodyType = -1; bp.ubBodyType = -1;
bp.ubSoldierClass = SOLDIER_CLASS_ELITE; bp.ubSoldierClass = SOLDIER_CLASS_ELITE;
CreateDetailedPlacementGivenBasicPlacementInfo( &pp, &bp ); CreateDetailedPlacementGivenBasicPlacementInfo( &pp, &bp );
@@ -3113,7 +3114,7 @@ SOLDIERTYPE* TacticalCreateEnemyTank()
bp.bTeam = ENEMY_TEAM; bp.bTeam = ENEMY_TEAM;
bp.bOrders = SEEKENEMY; bp.bOrders = SEEKENEMY;
bp.bAttitude = (INT8) Random( MAXATTITUDES ); bp.bAttitude = (INT8) Random( MAXATTITUDES );
bp.bBodyType = TANK_NW; bp.ubBodyType = TANK_NW;
bp.ubSoldierClass = SOLDIER_CLASS_TANK; bp.ubSoldierClass = SOLDIER_CLASS_TANK;
CreateDetailedPlacementGivenBasicPlacementInfo( &pp, &bp ); CreateDetailedPlacementGivenBasicPlacementInfo( &pp, &bp );
@@ -3154,7 +3155,7 @@ SOLDIERTYPE* TacticalCreateJeep()
bp.bTeam = CIV_TEAM; bp.bTeam = CIV_TEAM;
bp.bOrders = STATIONARY; bp.bOrders = STATIONARY;
bp.bAttitude = (INT8) Random( MAXATTITUDES ); bp.bAttitude = (INT8) Random( MAXATTITUDES );
bp.bBodyType = JEEP; bp.ubBodyType = JEEP;
bp.ubSoldierClass = SOLDIER_CLASS_NONE; bp.ubSoldierClass = SOLDIER_CLASS_NONE;
CreateDetailedPlacementGivenBasicPlacementInfo( &pp, &bp ); CreateDetailedPlacementGivenBasicPlacementInfo( &pp, &bp );
pp.ubProfile = 199; pp.ubProfile = 199;
@@ -3191,7 +3192,7 @@ SOLDIERTYPE* TacticalCreateJeep()
bp.bTeam = CREATURE_TEAM;//ZOMBIE_TEAM; bp.bTeam = CREATURE_TEAM;//ZOMBIE_TEAM;
bp.bOrders = SEEKENEMY; bp.bOrders = SEEKENEMY;
bp.bAttitude = AGGRESSIVE; bp.bAttitude = AGGRESSIVE;
bp.bBodyType = -1; bp.ubBodyType = -1;
bp.ubSoldierClass = SOLDIER_CLASS_ZOMBIE; bp.ubSoldierClass = SOLDIER_CLASS_ZOMBIE;
CreateDetailedPlacementGivenBasicPlacementInfo( &pp, &bp ); CreateDetailedPlacementGivenBasicPlacementInfo( &pp, &bp );
pSoldier = TacticalCreateSoldier( &pp, &ubID ); pSoldier = TacticalCreateSoldier( &pp, &ubID );
@@ -3268,7 +3269,7 @@ SOLDIERTYPE* TacticalCreateMilitia( UINT8 ubMilitiaClass, INT16 sX, INT16 sY )
bp.bOrders = STATIONARY; bp.bOrders = STATIONARY;
bp.bAttitude = (INT8) Random( MAXATTITUDES ); bp.bAttitude = (INT8) Random( MAXATTITUDES );
//bp.bAttitude = AGGRESSIVE; //bp.bAttitude = AGGRESSIVE;
bp.bBodyType = -1; bp.ubBodyType = -1;
CreateDetailedPlacementGivenBasicPlacementInfo( &pp, &bp, sX, sY ); CreateDetailedPlacementGivenBasicPlacementInfo( &pp, &bp, sX, sY );
pSoldier = TacticalCreateSoldier( &pp, &ubID ); pSoldier = TacticalCreateSoldier( &pp, &ubID );
@@ -3295,7 +3296,7 @@ SOLDIERTYPE* TacticalCreateCreature( INT8 bCreatureBodyType )
bp.ubSoldierClass = SOLDIER_CLASS_CREATURE; bp.ubSoldierClass = SOLDIER_CLASS_CREATURE;
bp.bOrders = SEEKENEMY; bp.bOrders = SEEKENEMY;
bp.bAttitude = AGGRESSIVE; bp.bAttitude = AGGRESSIVE;
bp.bBodyType = bCreatureBodyType; bp.ubBodyType = bCreatureBodyType;
CreateDetailedPlacementGivenBasicPlacementInfo( &pp, &bp ); CreateDetailedPlacementGivenBasicPlacementInfo( &pp, &bp );
return TacticalCreateSoldier( &pp, &ubID ); return TacticalCreateSoldier( &pp, &ubID );
} }
@@ -3322,7 +3323,7 @@ SOLDIERTYPE* TacticalCreateArmedCivilian( UINT8 usSoldierClass )
bp.bTeam = CIV_TEAM; bp.bTeam = CIV_TEAM;
bp.bOrders = FARPATROL; bp.bOrders = FARPATROL;
bp.bAttitude = (INT8)Random( MAXATTITUDES ); bp.bAttitude = (INT8)Random( MAXATTITUDES );
bp.bBodyType = Random( 4 ); bp.ubBodyType = Random( 4 );
bp.ubSoldierClass = usSoldierClass; bp.ubSoldierClass = usSoldierClass;
CreateDetailedPlacementGivenBasicPlacementInfo( &pp, &bp ); CreateDetailedPlacementGivenBasicPlacementInfo( &pp, &bp );
@@ -3376,7 +3377,7 @@ SOLDIERTYPE* TacticalCreateEnemyAssassin(UINT8 disguisetype)
bp.bTeam = CIV_TEAM; bp.bTeam = CIV_TEAM;
bp.bOrders = SEEKENEMY; bp.bOrders = SEEKENEMY;
bp.bAttitude = (INT8) Random( MAXATTITUDES ); bp.bAttitude = (INT8) Random( MAXATTITUDES );
bp.bBodyType = Random(4); bp.ubBodyType = Random(4);
bp.ubSoldierClass = SOLDIER_CLASS_ELITE; bp.ubSoldierClass = SOLDIER_CLASS_ELITE;
CreateDetailedPlacementGivenBasicPlacementInfo( &pp, &bp ); CreateDetailedPlacementGivenBasicPlacementInfo( &pp, &bp );
@@ -3557,7 +3558,7 @@ void CreatePrisonerOfWar()
MercCreateStruct.bSectorZ = gbWorldSectorZ; MercCreateStruct.bSectorZ = gbWorldSectorZ;
MercCreateStruct.sInsertionGridNo = insertiongridno; MercCreateStruct.sInsertionGridNo = insertiongridno;
MercCreateStruct.ubDirection = Random(NUM_WORLD_DIRECTIONS); MercCreateStruct.ubDirection = Random(NUM_WORLD_DIRECTIONS);
MercCreateStruct.bBodyType = bPowBodyType; MercCreateStruct.ubBodyType = bPowBodyType;
++bPowBodyType; ++bPowBodyType;
if ( bPowBodyType > REGFEMALE ) if ( bPowBodyType > REGFEMALE )
@@ -5321,7 +5322,7 @@ BOOLEAN AssignTraitsToSoldier( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STRUCT *pCre
} }
// MARTIAL ARTS - old traits // MARTIAL ARTS - old traits
if ( (!ATraitAssigned || !BTraitAssigned) && !gGameOptions.fNewTraitSystem && (pCreateStruct->bBodyType == REGMALE) ) if ( (!ATraitAssigned || !BTraitAssigned) && !gGameOptions.fNewTraitSystem && (pCreateStruct->ubBodyType == REGMALE) )
{ {
// setup basic chances based on soldier type // setup basic chances based on soldier type
if ( ubSolClass == SOLDIER_CLASS_ELITE || ubSolClass == SOLDIER_CLASS_ELITE_MILITIA ) if ( ubSolClass == SOLDIER_CLASS_ELITE || ubSolClass == SOLDIER_CLASS_ELITE_MILITIA )
+5 -5
View File
@@ -71,7 +71,7 @@ typedef struct
UINT8 ubDirection; //1 of 8 values (always mandatory) UINT8 ubDirection; //1 of 8 values (always mandatory)
INT8 bOrders; INT8 bOrders;
INT8 bAttitude; INT8 bAttitude;
INT8 bBodyType; //up to 128 body types, -1 means random INT8 ubBodyType; //up to 128 body types, -1 means random
INT16 sPatrolGrid[OLD_MAXPATROLGRIDS];//dnl ch27 230909 Possible locations to visit, patrol, etc. INT16 sPatrolGrid[OLD_MAXPATROLGRIDS];//dnl ch27 230909 Possible locations to visit, patrol, etc.
INT8 bPatrolCnt; INT8 bPatrolCnt;
BOOLEAN fOnRoof; BOOLEAN fOnRoof;
@@ -93,7 +93,7 @@ public:
UINT8 ubDirection; // 1 of 8 values (always mandatory) UINT8 ubDirection; // 1 of 8 values (always mandatory)
INT8 bOrders; INT8 bOrders;
INT8 bAttitude; INT8 bAttitude;
INT8 bBodyType; // Up to 128 body types, -1 means random INT8 ubBodyType; // Up to 128 body types, -1 means random
INT32 sPatrolGrid[MAXPATROLGRIDS]; // Possible locations to visit, patrol, etc. INT32 sPatrolGrid[MAXPATROLGRIDS]; // Possible locations to visit, patrol, etc.
INT8 bPatrolCnt; INT8 bPatrolCnt;
BOOLEAN fOnRoof; BOOLEAN fOnRoof;
@@ -148,7 +148,7 @@ public:
// Can force a team, but needs flag set // Can force a team, but needs flag set
INT8 bTeam; INT8 bTeam;
INT8 bBodyType; INT8 ubBodyType;
//Orders and attitude settings //Orders and attitude settings
INT8 bAttitude; INT8 bAttitude;
@@ -268,7 +268,7 @@ public:
// Can force a team, but needs flag set // Can force a team, but needs flag set
INT8 bTeam; INT8 bTeam;
INT8 bBodyType; INT8 ubBodyType;
//Orders and attitude settings //Orders and attitude settings
INT8 bAttitude; INT8 bAttitude;
@@ -354,7 +354,7 @@ public:
// Can force a team, but needs flag set // Can force a team, but needs flag set
INT8 bTeam; INT8 bTeam;
INT8 bBodyType; INT8 ubBodyType;
//Orders and attitude settings //Orders and attitude settings
INT8 bAttitude; INT8 bAttitude;
+43 -43
View File
@@ -58,6 +58,7 @@
#include "Town Militia.h" // added by Flugente #include "Town Militia.h" // added by Flugente
#include "PreBattle Interface.h" // added by Flugente #include "PreBattle Interface.h" // added by Flugente
#include "LuaInitNPCs.h" // added by Flugente #include "LuaInitNPCs.h" // added by Flugente
#include "Soldier macros.h" // added by Flugente
BOOLEAN gfOriginalList = TRUE; BOOLEAN gfOriginalList = TRUE;
@@ -227,7 +228,7 @@ BASIC_SOLDIERCREATE_STRUCT& BASIC_SOLDIERCREATE_STRUCT::operator=(const _OLD_BAS
ubDirection = src.ubDirection; ubDirection = src.ubDirection;
bOrders = src.bOrders; bOrders = src.bOrders;
bAttitude = src.bAttitude; bAttitude = src.bAttitude;
bBodyType = src.bBodyType; ubBodyType = src.ubBodyType;
bPatrolCnt = src.bPatrolCnt; bPatrolCnt = src.bPatrolCnt;
fOnRoof = src.fOnRoof; fOnRoof = src.fOnRoof;
ubSoldierClass = src.ubSoldierClass; ubSoldierClass = src.ubSoldierClass;
@@ -268,7 +269,7 @@ BOOLEAN BASIC_SOLDIERCREATE_STRUCT::Save(HWFILE hFile, FLOAT dMajorMapVersion, U
OldBasicSoldierCreateStruct.ubDirection = ubDirection; OldBasicSoldierCreateStruct.ubDirection = ubDirection;
OldBasicSoldierCreateStruct.bOrders = bOrders; OldBasicSoldierCreateStruct.bOrders = bOrders;
OldBasicSoldierCreateStruct.bAttitude = bAttitude; OldBasicSoldierCreateStruct.bAttitude = bAttitude;
OldBasicSoldierCreateStruct.bBodyType = bBodyType; OldBasicSoldierCreateStruct.ubBodyType = ubBodyType;
OldBasicSoldierCreateStruct.bPatrolCnt = bPatrolCnt; OldBasicSoldierCreateStruct.bPatrolCnt = bPatrolCnt;
OldBasicSoldierCreateStruct.fOnRoof = fOnRoof; OldBasicSoldierCreateStruct.fOnRoof = fOnRoof;
OldBasicSoldierCreateStruct.ubSoldierClass = ubSoldierClass; OldBasicSoldierCreateStruct.ubSoldierClass = ubSoldierClass;
@@ -342,7 +343,7 @@ BOOLEAN LoadSoldiersFromMap(INT8** hBuffer, FLOAT dMajorMapVersion, UINT8 ubMino
pNode->pBasicPlacement->ubCivilianGroup = gMercProfiles[tempDetailedPlacement.ubProfile].ubCivilianGroup; pNode->pBasicPlacement->ubCivilianGroup = gMercProfiles[tempDetailedPlacement.ubProfile].ubCivilianGroup;
} }
} }
if(tempBasicPlacement.bBodyType == COW) if(tempBasicPlacement.ubBodyType == COW)
fCowInSector = TRUE; fCowInSector = TRUE;
} }
if(fCowInSector) if(fCowInSector)
@@ -590,8 +591,7 @@ BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *curr, GROUP *pGroup = NULL )
// First check if this guy has a profile and if so check his location such that it matches! // First check if this guy has a profile and if so check his location such that it matches!
// Get profile from placement info // Get profile from placement info
if (curr->pBasicPlacement->bBodyType == TANK_NW || if ( TANK( curr->pBasicPlacement ) )
curr->pBasicPlacement->bBodyType == TANK_NE)
{ {
while (1) while (1)
{ {
@@ -634,7 +634,7 @@ BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *curr, GROUP *pGroup = NULL )
// CJC, August 18, 1999: don't do this code unless the ice cream truck is on our team // CJC, August 18, 1999: don't do this code unless the ice cream truck is on our team
if ( FindSoldierByProfileID( ICECREAMTRUCK, TRUE ) != NULL ) if ( FindSoldierByProfileID( ICECREAMTRUCK, TRUE ) != NULL )
{ {
if( curr->pDetailedPlacement->bBodyType == ICECREAMTRUCK ) if( curr->pDetailedPlacement->ubBodyType == ICECREAMTRUCK )
{ //Check to see if Hamous is here and not recruited. If so, add truck { //Check to see if Hamous is here and not recruited. If so, add truck
if( gMercProfiles[ HAMOUS ].sSectorX != gWorldSectorX || if( gMercProfiles[ HAMOUS ].sSectorX != gWorldSectorX ||
gMercProfiles[ HAMOUS ].sSectorY != gWorldSectorY || gMercProfiles[ HAMOUS ].sSectorY != gWorldSectorY ||
@@ -745,7 +745,7 @@ BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *curr, GROUP *pGroup = NULL )
{ {
// Tixa prison, once liberated, should not have any civs without profiles unless // Tixa prison, once liberated, should not have any civs without profiles unless
// they are kids // they are kids
if( !StrategicMap[ TIXA_SECTOR_X + TIXA_SECTOR_Y * MAP_WORLD_X ].fEnemyControlled && tempDetailedPlacement.ubProfile == NO_PROFILE && tempDetailedPlacement.bBodyType != HATKIDCIV && tempDetailedPlacement.bBodyType != KIDCIV ) if( !StrategicMap[ TIXA_SECTOR_X + TIXA_SECTOR_Y * MAP_WORLD_X ].fEnemyControlled && tempDetailedPlacement.ubProfile == NO_PROFILE && tempDetailedPlacement.ubBodyType != HATKIDCIV && tempDetailedPlacement.ubBodyType != KIDCIV )
{ {
// not there // not there
return( TRUE ); return( TRUE );
@@ -755,7 +755,7 @@ BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *curr, GROUP *pGroup = NULL )
{ {
if ( CheckFact( FACT_KIDS_ARE_FREE, 0 ) ) if ( CheckFact( FACT_KIDS_ARE_FREE, 0 ) )
{ {
if ( tempDetailedPlacement.bBodyType == HATKIDCIV || tempDetailedPlacement.bBodyType == KIDCIV ) if ( tempDetailedPlacement.ubBodyType == HATKIDCIV || tempDetailedPlacement.ubBodyType == KIDCIV )
{ {
// not there any more! kids have been freeeeed! // not there any more! kids have been freeeeed!
return( TRUE ); return( TRUE );
@@ -804,12 +804,11 @@ BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *curr, GROUP *pGroup = NULL )
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("AddPlacementToWorld: create soldier")); DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("AddPlacementToWorld: create soldier"));
if(is_networked && (tempDetailedPlacement.bBodyType==23 || tempDetailedPlacement.bBodyType==24 || tempDetailedPlacement.fOnRoof==1))return TRUE; if ( is_networked && ( TANK( (&tempDetailedPlacement) ) || tempDetailedPlacement.fOnRoof ) )
return TRUE;
pSoldier = TacticalCreateSoldier( &tempDetailedPlacement, &ubID ); pSoldier = TacticalCreateSoldier( &tempDetailedPlacement, &ubID );
if( pSoldier ) if( pSoldier )
{ {
curr->pSoldier = pSoldier; curr->pSoldier = pSoldier;
@@ -896,7 +895,7 @@ UINT8 AddSoldierInitListTeamToWorld( INT8 bTeam, UINT8 ubMaxNum )
if( curr->pBasicPlacement->bTeam == CIV_TEAM && !curr->pDetailedPlacement ) if( curr->pBasicPlacement->bTeam == CIV_TEAM && !curr->pDetailedPlacement )
{ {
curr->pBasicPlacement->ubSoldierClass = SOLDIER_CLASS_MINER; curr->pBasicPlacement->ubSoldierClass = SOLDIER_CLASS_MINER;
curr->pBasicPlacement->bBodyType = -1; curr->pBasicPlacement->ubBodyType = -1;
} }
curr = curr->next; curr = curr->next;
} }
@@ -1094,7 +1093,7 @@ void AddSoldierInitListEnemyDefenceSoldiers( UINT8 ubTotalAdmin, UINT8 ubTotalTr
ubTroopBSlots++; ubTroopBSlots++;
break; break;
case SOLDIER_CLASS_TANK: case SOLDIER_CLASS_TANK:
if( curr->pDetailedPlacement->bBodyType == TANK_NW ||curr->pDetailedPlacement->bBodyType == TANK_NE ) if ( TANK( curr->pDetailedPlacement ) )
{ {
if( curr->pBasicPlacement->fPriorityExistance && curr->pDetailedPlacement ) if( curr->pBasicPlacement->fPriorityExistance && curr->pDetailedPlacement )
ubTankPDSlots++; ubTankPDSlots++;
@@ -1315,7 +1314,7 @@ void AddSoldierInitListEnemyDefenceSoldiers( UINT8 ubTotalAdmin, UINT8 ubTotalTr
else if( iRandom < ubTotalElite + ubTotalTroops + ubTotalAdmin + ubTotalTanks ) else if( iRandom < ubTotalElite + ubTotalTroops + ubTotalAdmin + ubTotalTanks )
{ {
curr->pBasicPlacement->ubSoldierClass = SOLDIER_CLASS_TANK; curr->pBasicPlacement->ubSoldierClass = SOLDIER_CLASS_TANK;
curr->pBasicPlacement->bBodyType = TANK_NW; curr->pBasicPlacement->ubBodyType = TANK_NW;
ubTotalTanks--; ubTotalTanks--;
} }
else else
@@ -1406,7 +1405,7 @@ void AddSoldierInitListEnemyDefenceSoldiers( UINT8 ubTotalAdmin, UINT8 ubTotalTr
if( !curr->pSoldier && curr->pBasicPlacement->bTeam == ENEMY_TEAM && ubTotalTanks && !GridNoIndoors( curr->pBasicPlacement->usStartingGridNo )) if( !curr->pSoldier && curr->pBasicPlacement->bTeam == ENEMY_TEAM && ubTotalTanks && !GridNoIndoors( curr->pBasicPlacement->usStartingGridNo ))
{ {
curr->pBasicPlacement->ubSoldierClass = SOLDIER_CLASS_TANK; curr->pBasicPlacement->ubSoldierClass = SOLDIER_CLASS_TANK;
curr->pBasicPlacement->bBodyType = TANK_NW; curr->pBasicPlacement->ubBodyType = TANK_NW;
ubTotalTanks--; ubTotalTanks--;
if( AddPlacementToWorld( curr ) ) if( AddPlacementToWorld( curr ) )
{ {
@@ -1450,7 +1449,7 @@ void AddSoldierInitListEnemyDefenceSoldiers( UINT8 ubTotalAdmin, UINT8 ubTotalTr
else if( iRandom < ubTotalElite + ubTotalTroops + ubTotalAdmin + ubTotalTanks ) else if( iRandom < ubTotalElite + ubTotalTroops + ubTotalAdmin + ubTotalTanks )
{ {
curr->pBasicPlacement->ubSoldierClass = SOLDIER_CLASS_TANK; curr->pBasicPlacement->ubSoldierClass = SOLDIER_CLASS_TANK;
curr->pBasicPlacement->bBodyType = TANK_NW; curr->pBasicPlacement->ubBodyType = TANK_NW;
ubTotalTanks--; ubTotalTanks--;
} }
else else
@@ -1543,18 +1542,18 @@ void AddSoldierInitListMilitia( UINT8 ubNumGreen, UINT8 ubNumRegs, UINT8 ubNumEl
// silversurfer: Replace body type. Militia tanks are not allowed. // silversurfer: Replace body type. Militia tanks are not allowed.
if( curr->pBasicPlacement->fDetailedPlacement ) if( curr->pBasicPlacement->fDetailedPlacement )
{ {
if( curr->pDetailedPlacement->bBodyType == TANK_NE || curr->pDetailedPlacement->bBodyType == TANK_NW ) if ( TANK( curr->pDetailedPlacement ) )
{ {
curr->pBasicPlacement->bBodyType = PreRandom( REGFEMALE + 1 ); curr->pBasicPlacement->ubBodyType = PreRandom( REGFEMALE + 1 );
// check for better spot next to the tank so the militia doesn't get stuck in the tank // check for better spot next to the tank so the militia doesn't get stuck in the tank
INT32 iNewSpot = FindNearestPassableSpot( curr->pBasicPlacement->usStartingGridNo ); INT32 iNewSpot = FindNearestPassableSpot( curr->pBasicPlacement->usStartingGridNo );
if( iNewSpot != NOWHERE) if( iNewSpot != NOWHERE)
curr->pBasicPlacement->usStartingGridNo = iNewSpot; curr->pBasicPlacement->usStartingGridNo = iNewSpot;
} }
} }
else if( curr->pBasicPlacement->bBodyType == TANK_NE || curr->pBasicPlacement->bBodyType == TANK_NW ) else if ( TANK( curr->pBasicPlacement ) )
{ {
curr->pBasicPlacement->bBodyType = PreRandom( REGFEMALE + 1 ); curr->pBasicPlacement->ubBodyType = PreRandom( REGFEMALE + 1 );
// check for better spot next to the tank so the militia doesn't get stuck in the tank // check for better spot next to the tank so the militia doesn't get stuck in the tank
INT32 iNewSpot = FindNearestPassableSpot( curr->pBasicPlacement->usStartingGridNo ); INT32 iNewSpot = FindNearestPassableSpot( curr->pBasicPlacement->usStartingGridNo );
if( iNewSpot != NOWHERE) if( iNewSpot != NOWHERE)
@@ -1721,10 +1720,11 @@ void AddSoldierInitListMilitia( UINT8 ubNumGreen, UINT8 ubNumRegs, UINT8 ubNumEl
curr->pBasicPlacement->bTeam = MILITIA_TEAM; curr->pBasicPlacement->bTeam = MILITIA_TEAM;
curr->pBasicPlacement->bOrders = STATIONARY; curr->pBasicPlacement->bOrders = STATIONARY;
curr->pBasicPlacement->bAttitude = (INT8) Random( MAXATTITUDES ); curr->pBasicPlacement->bAttitude = (INT8) Random( MAXATTITUDES );
// silversurfer: Replace body type. Militia tanks are not allowed. // silversurfer: Replace body type. Militia tanks are not allowed.
if( curr->pBasicPlacement->bBodyType == TANK_NE || curr->pBasicPlacement->bBodyType == TANK_NW ) if ( TANK(curr->pBasicPlacement) )
{ {
curr->pBasicPlacement->bBodyType = PreRandom( REGFEMALE + 1 ); curr->pBasicPlacement->ubBodyType = PreRandom( REGFEMALE + 1 );
// check for better spot next to the tank so the militia doesn't get stuck in the tank // check for better spot next to the tank so the militia doesn't get stuck in the tank
INT32 iNewSpot = FindNearestPassableSpot( curr->pBasicPlacement->usStartingGridNo ); INT32 iNewSpot = FindNearestPassableSpot( curr->pBasicPlacement->usStartingGridNo );
if( iNewSpot != NOWHERE) if( iNewSpot != NOWHERE)
@@ -1842,7 +1842,7 @@ void AddSoldierInitListCreatures( BOOLEAN fQueen, UINT8 ubNumLarvae, UINT8 ubNum
curr = gSoldierInitHead; curr = gSoldierInitHead;
while( curr ) while( curr )
{ {
if( !curr->pSoldier && curr->pBasicPlacement->bTeam == CREATURE_TEAM && curr->pBasicPlacement->bBodyType == QUEENMONSTER ) if( !curr->pSoldier && curr->pBasicPlacement->bTeam == CREATURE_TEAM && curr->pBasicPlacement->ubBodyType == QUEENMONSTER )
{ {
if( !AddPlacementToWorld( curr ) ) if( !AddPlacementToWorld( curr ) )
{ {
@@ -1869,17 +1869,17 @@ void AddSoldierInitListCreatures( BOOLEAN fQueen, UINT8 ubNumLarvae, UINT8 ubNum
if( curr->pBasicPlacement->bTeam == CREATURE_TEAM ) if( curr->pBasicPlacement->bTeam == CREATURE_TEAM )
{ {
//Matching team, now check the soldier class... //Matching team, now check the soldier class...
if( ubNumLarvae && curr->pBasicPlacement->bBodyType == LARVAE_MONSTER ) if( ubNumLarvae && curr->pBasicPlacement->ubBodyType == LARVAE_MONSTER )
ubNumLarvae--; ubNumLarvae--;
else if( ubNumInfants && curr->pBasicPlacement->bBodyType == INFANT_MONSTER ) else if( ubNumInfants && curr->pBasicPlacement->ubBodyType == INFANT_MONSTER )
ubNumInfants--; ubNumInfants--;
else if( ubNumYoungMales && curr->pBasicPlacement->bBodyType == YAM_MONSTER ) else if( ubNumYoungMales && curr->pBasicPlacement->ubBodyType == YAM_MONSTER )
ubNumYoungMales--; ubNumYoungMales--;
else if( ubNumYoungFemales && curr->pBasicPlacement->bBodyType == YAF_MONSTER ) else if( ubNumYoungFemales && curr->pBasicPlacement->ubBodyType == YAF_MONSTER )
ubNumYoungFemales--; ubNumYoungFemales--;
else if( ubNumAdultMales && curr->pBasicPlacement->bBodyType == AM_MONSTER ) else if( ubNumAdultMales && curr->pBasicPlacement->ubBodyType == AM_MONSTER )
ubNumAdultMales--; ubNumAdultMales--;
else if( ubNumAdultFemales && curr->pBasicPlacement->bBodyType == ADULTFEMALEMONSTER ) else if( ubNumAdultFemales && curr->pBasicPlacement->ubBodyType == ADULTFEMALEMONSTER )
ubNumAdultFemales--; ubNumAdultFemales--;
else else
fDoPlacement = FALSE; fDoPlacement = FALSE;
@@ -1924,32 +1924,32 @@ void AddSoldierInitListCreatures( BOOLEAN fQueen, UINT8 ubNumLarvae, UINT8 ubNum
if( ubNumLarvae && iRandom < ubNumLarvae ) if( ubNumLarvae && iRandom < ubNumLarvae )
{ {
ubNumLarvae--; ubNumLarvae--;
curr->pBasicPlacement->bBodyType = LARVAE_MONSTER; curr->pBasicPlacement->ubBodyType = LARVAE_MONSTER;
} }
else if( ubNumInfants && iRandom < ubNumLarvae + ubNumInfants ) else if( ubNumInfants && iRandom < ubNumLarvae + ubNumInfants )
{ {
ubNumInfants--; ubNumInfants--;
curr->pBasicPlacement->bBodyType = INFANT_MONSTER; curr->pBasicPlacement->ubBodyType = INFANT_MONSTER;
} }
else if( ubNumYoungMales && iRandom < ubNumLarvae + ubNumInfants + ubNumYoungMales ) else if( ubNumYoungMales && iRandom < ubNumLarvae + ubNumInfants + ubNumYoungMales )
{ {
ubNumYoungMales--; ubNumYoungMales--;
curr->pBasicPlacement->bBodyType = YAM_MONSTER; curr->pBasicPlacement->ubBodyType = YAM_MONSTER;
} }
else if( ubNumYoungFemales && iRandom < ubNumLarvae + ubNumInfants + ubNumYoungMales + ubNumYoungFemales ) else if( ubNumYoungFemales && iRandom < ubNumLarvae + ubNumInfants + ubNumYoungMales + ubNumYoungFemales )
{ {
ubNumYoungFemales--; ubNumYoungFemales--;
curr->pBasicPlacement->bBodyType = YAF_MONSTER; curr->pBasicPlacement->ubBodyType = YAF_MONSTER;
} }
else if( ubNumAdultMales && iRandom < ubNumLarvae + ubNumInfants + ubNumYoungMales + ubNumYoungFemales + ubNumAdultMales ) else if( ubNumAdultMales && iRandom < ubNumLarvae + ubNumInfants + ubNumYoungMales + ubNumYoungFemales + ubNumAdultMales )
{ {
ubNumAdultMales--; ubNumAdultMales--;
curr->pBasicPlacement->bBodyType = AM_MONSTER; curr->pBasicPlacement->ubBodyType = AM_MONSTER;
} }
else if( ubNumAdultFemales && iRandom < ubNumLarvae + ubNumInfants + ubNumYoungMales + ubNumYoungFemales + ubNumAdultMales + ubNumAdultFemales ) else if( ubNumAdultFemales && iRandom < ubNumLarvae + ubNumInfants + ubNumYoungMales + ubNumYoungFemales + ubNumAdultMales + ubNumAdultFemales )
{ {
ubNumAdultFemales--; ubNumAdultFemales--;
curr->pBasicPlacement->bBodyType = ADULTFEMALEMONSTER; curr->pBasicPlacement->ubBodyType = ADULTFEMALEMONSTER;
} }
else else
Assert(0); Assert(0);
@@ -2219,7 +2219,7 @@ void AddSoldierInitListBloodcats()
curr = gSoldierInitHead; curr = gSoldierInitHead;
while( curr ) while( curr )
{ {
if( curr->pBasicPlacement->bBodyType == BLOODCAT ) if( curr->pBasicPlacement->ubBodyType == BLOODCAT )
{ {
bBloodCatPlacements++; bBloodCatPlacements++;
} }
@@ -2280,7 +2280,7 @@ void AddSoldierInitListBloodcats()
curr = gSoldierInitHead; curr = gSoldierInitHead;
while( curr ) while( curr )
{ {
if( curr->pBasicPlacement->bBodyType == BLOODCAT && curr->pSoldier ) if( curr->pBasicPlacement->ubBodyType == BLOODCAT && curr->pSoldier )
ubNumAdded++; //already one here! ubNumAdded++; //already one here!
curr = curr->next; curr = curr->next;
} }
@@ -2290,7 +2290,7 @@ void AddSoldierInitListBloodcats()
//First fill up all of the priority existance slots... //First fill up all of the priority existance slots...
while( curr && curr->pBasicPlacement->fPriorityExistance && ubNumAdded < ubMaxNum ) while( curr && curr->pBasicPlacement->fPriorityExistance && ubNumAdded < ubMaxNum )
{ {
if( curr->pBasicPlacement->bBodyType == BLOODCAT ) if( curr->pBasicPlacement->ubBodyType == BLOODCAT )
{ {
//Matching team, so add this placement. //Matching team, so add this placement.
if( AddPlacementToWorld( curr ) ) if( AddPlacementToWorld( curr ) )
@@ -2311,7 +2311,7 @@ void AddSoldierInitListBloodcats()
ubSlotsToFill = ubMaxNum - ubNumAdded; ubSlotsToFill = ubMaxNum - ubNumAdded;
while( curr && !curr->pSoldier && ubNumAdded < ubMaxNum ) while( curr && !curr->pSoldier && ubNumAdded < ubMaxNum )
{ {
if( curr->pBasicPlacement->bBodyType == BLOODCAT ) if( curr->pBasicPlacement->ubBodyType == BLOODCAT )
ubSlotsAvailable++; ubSlotsAvailable++;
curr = curr->next; curr = curr->next;
} }
@@ -2327,7 +2327,7 @@ void AddSoldierInitListBloodcats()
//we have slots available, process the list to add new soldiers. //we have slots available, process the list to add new soldiers.
while( curr && !curr->pSoldier && ubNumAdded < ubMaxNum && ubSlotsAvailable ) while( curr && !curr->pSoldier && ubNumAdded < ubMaxNum && ubSlotsAvailable )
{ {
if( curr->pBasicPlacement->bBodyType == BLOODCAT ) if( curr->pBasicPlacement->ubBodyType == BLOODCAT )
{ {
if( ubSlotsAvailable <= ubSlotsToFill || Random( ubSlotsAvailable ) < ubSlotsToFill ) if( ubSlotsAvailable <= ubSlotsToFill || Random( ubSlotsAvailable ) < ubSlotsToFill )
{ {
@@ -2712,7 +2712,7 @@ void StripEnemyDetailedPlacementsIfSectorWasPlayerLiberated()
curr->pDetailedPlacement = NULL; curr->pDetailedPlacement = NULL;
curr->pBasicPlacement->fDetailedPlacement = FALSE; curr->pBasicPlacement->fDetailedPlacement = FALSE;
curr->pBasicPlacement->fPriorityExistance = FALSE; curr->pBasicPlacement->fPriorityExistance = FALSE;
curr->pBasicPlacement->bBodyType = -1; curr->pBasicPlacement->ubBodyType = -1;
RandomizeRelativeLevel( &( curr->pBasicPlacement->bRelativeAttributeLevel ), curr->pBasicPlacement->ubSoldierClass ); RandomizeRelativeLevel( &( curr->pBasicPlacement->bRelativeAttributeLevel ), curr->pBasicPlacement->ubSoldierClass );
RandomizeRelativeLevel( &( curr->pBasicPlacement->bRelativeEquipmentLevel ), curr->pBasicPlacement->ubSoldierClass ); RandomizeRelativeLevel( &( curr->pBasicPlacement->bRelativeEquipmentLevel ), curr->pBasicPlacement->ubSoldierClass );
} }
+1 -1
View File
@@ -1703,7 +1703,7 @@ SOLDIERTYPE *ChangeSoldierTeam( SOLDIERTYPE *pSoldier, UINT8 ubTeam )
// Create a new one! // Create a new one!
MercCreateStruct.bTeam = ubTeam; MercCreateStruct.bTeam = ubTeam;
MercCreateStruct.ubProfile = pSoldier->ubProfile; MercCreateStruct.ubProfile = pSoldier->ubProfile;
MercCreateStruct.bBodyType = pSoldier->ubBodyType; MercCreateStruct.ubBodyType = pSoldier->ubBodyType;
MercCreateStruct.sSectorX = pSoldier->sSectorX; MercCreateStruct.sSectorX = pSoldier->sSectorX;
MercCreateStruct.sSectorY = pSoldier->sSectorY; MercCreateStruct.sSectorY = pSoldier->sSectorY;
MercCreateStruct.bSectorZ = pSoldier->bSectorZ; MercCreateStruct.bSectorZ = pSoldier->bSectorZ;
+38 -45
View File
@@ -5068,27 +5068,27 @@ void RandomizeMercProfile()
void CreateNextCivType() void CreateNextCivType()
{ {
INT16 sWorldX, sWorldY;
SOLDIERCREATE_STRUCT MercCreateStruct; SOLDIERCREATE_STRUCT MercCreateStruct;
INT32 usMapPos; INT32 usMapPos;
static INT8 bBodyType = FATCIV; static INT8 ubBodyType = FATCIV;
// Get Grid Corrdinates of mouse // Get Grid Corrdinates of mouse
if ( GetMouseWorldCoordsInCenter( &sWorldX, &sWorldY ) && GetMouseMapPos( &usMapPos ) ) if ( GetMouseMapPos( &usMapPos ) )
{ {
INT8 iNewIndex; INT8 iNewIndex;
MercCreateStruct.ubProfile = NO_PROFILE; MercCreateStruct.ubProfile = NO_PROFILE;
MercCreateStruct.sSectorX = gWorldSectorX; MercCreateStruct.sSectorX = gWorldSectorX;
MercCreateStruct.sSectorY = gWorldSectorY; MercCreateStruct.sSectorY = gWorldSectorY;
MercCreateStruct.bSectorZ = gbWorldSectorZ; MercCreateStruct.bSectorZ = gbWorldSectorZ;
MercCreateStruct.bBodyType = bBodyType; MercCreateStruct.ubBodyType = ubBodyType;
MercCreateStruct.ubDirection = SOUTH; MercCreateStruct.ubDirection = SOUTH;
bBodyType++; ++ubBodyType;
if ( bBodyType > KIDCIV ) if ( ubBodyType > KIDCIV )
{ {
bBodyType = FATCIV; ubBodyType = FATCIV;
} }
MercCreateStruct.bTeam = CIV_TEAM; MercCreateStruct.bTeam = CIV_TEAM;
@@ -5101,7 +5101,6 @@ void CreateNextCivType()
// So we can see them! // So we can see them!
AllTeamsLookForAll(NO_INTERRUPTS); AllTeamsLookForAll(NO_INTERRUPTS);
} }
} }
} }
@@ -5126,21 +5125,21 @@ void ToggleCliffDebug()
void CreateCow() void CreateCow()
{ {
INT16 sWorldX, sWorldY;
SOLDIERCREATE_STRUCT MercCreateStruct; SOLDIERCREATE_STRUCT MercCreateStruct;
INT32 usMapPos; INT32 usMapPos;
// Get Grid Corrdinates of mouse // Get Grid Corrdinates of mouse
if ( GetMouseWorldCoordsInCenter( &sWorldX, &sWorldY ) && GetMouseMapPos( &usMapPos ) ) if ( GetMouseMapPos( &usMapPos ) )
{ {
INT8 iNewIndex; INT8 iNewIndex;
MercCreateStruct.ubProfile = NO_PROFILE; MercCreateStruct.ubProfile = NO_PROFILE;
MercCreateStruct.sSectorX = gWorldSectorX; MercCreateStruct.sSectorX = gWorldSectorX;
MercCreateStruct.sSectorY = gWorldSectorY; MercCreateStruct.sSectorY = gWorldSectorY;
MercCreateStruct.bSectorZ = gbWorldSectorZ; MercCreateStruct.bSectorZ = gbWorldSectorZ;
MercCreateStruct.bBodyType = COW; MercCreateStruct.ubBodyType = COW;
//MercCreateStruct.bTeam = SOLDIER_CREATE_AUTO_TEAM; //MercCreateStruct.bTeam = SOLDIER_CREATE_AUTO_TEAM;
MercCreateStruct.bTeam = CIV_TEAM; MercCreateStruct.bTeam = CIV_TEAM;
MercCreateStruct.sInsertionGridNo = usMapPos; MercCreateStruct.sInsertionGridNo = usMapPos;
RandomizeNewSoldierStats( &MercCreateStruct ); RandomizeNewSoldierStats( &MercCreateStruct );
@@ -5150,28 +5149,27 @@ void CreateCow()
// So we can see them! // So we can see them!
AllTeamsLookForAll(NO_INTERRUPTS); AllTeamsLookForAll(NO_INTERRUPTS);
} }
} }
} }
void CreateBloodCat() void CreateBloodCat()
{ {
INT16 sWorldX, sWorldY;
SOLDIERCREATE_STRUCT MercCreateStruct; SOLDIERCREATE_STRUCT MercCreateStruct;
INT32 usMapPos; INT32 usMapPos;
// Get Grid Corrdinates of mouse // Get Grid Corrdinates of mouse
if ( GetMouseWorldCoordsInCenter( &sWorldX, &sWorldY ) && GetMouseMapPos( &usMapPos ) ) if ( GetMouseMapPos( &usMapPos ) )
{ {
INT8 iNewIndex; INT8 iNewIndex;
MercCreateStruct.ubProfile = NO_PROFILE; MercCreateStruct.ubProfile = NO_PROFILE;
MercCreateStruct.sSectorX = gWorldSectorX; MercCreateStruct.sSectorX = gWorldSectorX;
MercCreateStruct.sSectorY = gWorldSectorY; MercCreateStruct.sSectorY = gWorldSectorY;
MercCreateStruct.bSectorZ = gbWorldSectorZ; MercCreateStruct.bSectorZ = gbWorldSectorZ;
MercCreateStruct.bBodyType = BLOODCAT; MercCreateStruct.ubBodyType = BLOODCAT;
//MercCreateStruct.bTeam = SOLDIER_CREATE_AUTO_TEAM; //MercCreateStruct.bTeam = SOLDIER_CREATE_AUTO_TEAM;
MercCreateStruct.bTeam = CREATURE_TEAM; MercCreateStruct.bTeam = CREATURE_TEAM;
MercCreateStruct.sInsertionGridNo = usMapPos; MercCreateStruct.sInsertionGridNo = usMapPos;
RandomizeNewSoldierStats( &MercCreateStruct ); RandomizeNewSoldierStats( &MercCreateStruct );
@@ -5181,29 +5179,28 @@ void CreateBloodCat()
// So we can see them! // So we can see them!
AllTeamsLookForAll(NO_INTERRUPTS); AllTeamsLookForAll(NO_INTERRUPTS);
} }
} }
} }
void CreatePlayerControlledCow() void CreatePlayerControlledCow()
{ {
INT16 sWorldX, sWorldY;
SOLDIERCREATE_STRUCT MercCreateStruct; SOLDIERCREATE_STRUCT MercCreateStruct;
INT32 usMapPos; INT32 usMapPos;
// Get Grid Corrdinates of mouse // Get Grid Corrdinates of mouse
if ( GetMouseWorldCoordsInCenter( &sWorldX, &sWorldY ) && GetMouseMapPos( &usMapPos ) ) if ( GetMouseMapPos( &usMapPos ) )
{ {
INT8 iNewIndex; INT8 iNewIndex;
MercCreateStruct.ubProfile = 12; MercCreateStruct.ubProfile = 12;
MercCreateStruct.sSectorX = gWorldSectorX; MercCreateStruct.sSectorX = gWorldSectorX;
MercCreateStruct.sSectorY = gWorldSectorY; MercCreateStruct.sSectorY = gWorldSectorY;
MercCreateStruct.bSectorZ = gbWorldSectorZ; MercCreateStruct.bSectorZ = gbWorldSectorZ;
MercCreateStruct.bBodyType = COW; MercCreateStruct.ubBodyType = COW;
MercCreateStruct.sInsertionGridNo = usMapPos; MercCreateStruct.sInsertionGridNo = usMapPos;
MercCreateStruct.bTeam = SOLDIER_CREATE_AUTO_TEAM; MercCreateStruct.bTeam = SOLDIER_CREATE_AUTO_TEAM;
MercCreateStruct.fPlayerMerc = TRUE; MercCreateStruct.fPlayerMerc = TRUE;
RandomizeNewSoldierStats( &MercCreateStruct ); RandomizeNewSoldierStats( &MercCreateStruct );
@@ -5267,9 +5264,8 @@ void GrenadeTest3()
*/ */
void CreatePlayerControlledMonster() void CreatePlayerControlledMonster()
{ {
INT16 sWorldX, sWorldY;
INT32 usMapPos; INT32 usMapPos;
if ( GetMouseWorldCoordsInCenter( &sWorldX, &sWorldY ) && GetMouseMapPos( &usMapPos ) ) if ( GetMouseMapPos( &usMapPos ) )
{ {
SOLDIERCREATE_STRUCT MercCreateStruct; SOLDIERCREATE_STRUCT MercCreateStruct;
INT8 iNewIndex; INT8 iNewIndex;
@@ -5281,10 +5277,10 @@ void CreatePlayerControlledMonster()
//Note: only gets called if Alt and/or Ctrl isn't pressed! //Note: only gets called if Alt and/or Ctrl isn't pressed!
if ( _KeyDown( INSERT ) ) if ( _KeyDown( INSERT ) )
MercCreateStruct.bBodyType = QUEENMONSTER; MercCreateStruct.ubBodyType = QUEENMONSTER;
//MercCreateStruct.bBodyType = LARVAE_MONSTER; //MercCreateStruct.ubBodyType = LARVAE_MONSTER;
else else
MercCreateStruct.bBodyType = ADULTFEMALEMONSTER; MercCreateStruct.ubBodyType = ADULTFEMALEMONSTER;
MercCreateStruct.bTeam = SOLDIER_CREATE_AUTO_TEAM; MercCreateStruct.bTeam = SOLDIER_CREATE_AUTO_TEAM;
MercCreateStruct.sInsertionGridNo = usMapPos; MercCreateStruct.sInsertionGridNo = usMapPos;
RandomizeNewSoldierStats( &MercCreateStruct ); RandomizeNewSoldierStats( &MercCreateStruct );
@@ -5372,8 +5368,7 @@ void HandleHandCursorClick( INT32 usMapPos, UINT32 *puiNewEvent )
STRUCTURE *pStructure = NULL; STRUCTURE *pStructure = NULL;
ITEM_POOL *pItemPool; ITEM_POOL *pItemPool;
BOOLEAN fIgnoreItems = FALSE; BOOLEAN fIgnoreItems = FALSE;
if( GetSoldier( &pSoldier, gusSelectedSoldier ) ) if( GetSoldier( &pSoldier, gusSelectedSoldier ) )
{ {
// If we are out of breath, no cursor... // If we are out of breath, no cursor...
@@ -5877,8 +5872,6 @@ void TestMeanWhile( INT32 iID )
pSoldier->sSectorY = gModSettings.ubMeanwhileInterrogatePOWSectorY; //14 pSoldier->sSectorY = gModSettings.ubMeanwhileInterrogatePOWSectorY; //14
} }
} }
} }
ScheduleMeanwhileEvent( &MeanwhileDef, 10 ); ScheduleMeanwhileEvent( &MeanwhileDef, 10 );
+3 -3
View File
@@ -2701,9 +2701,9 @@ BOOLEAN EvaluateWorld(STR8 pSector, UINT8 ubLevel)
{ {
if(priority.ubScheduleID) if(priority.ubScheduleID)
pSummary->ubCivSchedules++; pSummary->ubCivSchedules++;
if(priority.bBodyType == COW) if(priority.ubBodyType == COW)
pSummary->ubCivCows++; pSummary->ubCivCows++;
else if(priority.bBodyType == BLOODCAT) else if(priority.ubBodyType == BLOODCAT)
pSummary->ubCivBloodcats++; pSummary->ubCivBloodcats++;
} }
} }
@@ -2751,7 +2751,7 @@ BOOLEAN EvaluateWorld(STR8 pSector, UINT8 ubLevel)
} }
else if(basic.bTeam == CREATURE_TEAM) else if(basic.bTeam == CREATURE_TEAM)
{ {
if(basic.bBodyType == BLOODCAT) if(basic.ubBodyType == BLOODCAT)
pTeam->ubNumAnimals++; pTeam->ubNumAnimals++;
} }
pTeam->ubTotal++; pTeam->ubTotal++;