git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8132 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2016-04-03 14:40:17 +00:00
parent fcad428a12
commit 01ffd3eaf2
9 changed files with 243 additions and 82 deletions
+3
View File
@@ -1458,6 +1458,9 @@ void LoadGameExternalOptions()
// Neutral civilians can detect and avoid player's mines // Neutral civilians can detect and avoid player's mines
gGameExternalOptions.bNeutralCiviliansAvoidPlayerMines = iniReader.ReadBoolean("Tactical Interface Settings","CIVILIANS_AVOID_PLAYER_MINES",FALSE); gGameExternalOptions.bNeutralCiviliansAvoidPlayerMines = iniReader.ReadBoolean("Tactical Interface Settings","CIVILIANS_AVOID_PLAYER_MINES",FALSE);
// can extra civilians be created via LUA?
gGameExternalOptions.bExtraCivilians = iniReader.ReadBoolean( "Tactical Interface Settings", "ALLOW_EXTRA_CIVILIANS", FALSE );
// Add smoke after regular explosions // Add smoke after regular explosions
gGameExternalOptions.bAddSmokeAfterExplosion = iniReader.ReadBoolean("Tactical Interface Settings","ADD_SMOKE_AFTER_EXPLOSION",FALSE); gGameExternalOptions.bAddSmokeAfterExplosion = iniReader.ReadBoolean("Tactical Interface Settings","ADD_SMOKE_AFTER_EXPLOSION",FALSE);
+1
View File
@@ -798,6 +798,7 @@ typedef struct
BOOLEAN bAllowWearSuppressor; BOOLEAN bAllowWearSuppressor;
BOOLEAN bLazyCivilians; BOOLEAN bLazyCivilians;
BOOLEAN bNeutralCiviliansAvoidPlayerMines; //sevenfm: Neutral civilians can detect mines with MAPELEMENT_PLAYER_MINE_PRESENT flag set BOOLEAN bNeutralCiviliansAvoidPlayerMines; //sevenfm: Neutral civilians can detect mines with MAPELEMENT_PLAYER_MINE_PRESENT flag set
BOOLEAN bExtraCivilians; // Flugente: add civilians via LUA
BOOLEAN bAddSmokeAfterExplosion; BOOLEAN bAddSmokeAfterExplosion;
BOOLEAN bAllowExplosiveAttachments; BOOLEAN bAllowExplosiveAttachments;
BOOLEAN bAllowSpecialExplosiveAttachments; BOOLEAN bAllowSpecialExplosiveAttachments;
+1 -45
View File
@@ -21,55 +21,11 @@
#include "WCheck.h" #include "WCheck.h"
#include "Animation Data.h" #include "Animation Data.h"
#include "GameSettings.h" #include "GameSettings.h"
#include "Soldier Create.h" // added by Flugente for enums
#endif #endif
#include "IMP Confirm.h" #include "IMP Confirm.h"
enum
{
PINKSKIN,
TANSKIN,
DARKSKIN,
BLACKSKIN,
NUMSKINS
};
enum
{
BROWNHEAD,
BLACKHEAD,
WHITEHEAD,
BLONDHEAD,
REDHEAD,
NUMHEADS
};
enum
{
WHITEVEST,
GYELLOWSHIRT,
YELLOWVEST,
GREYVEST,
BROWNVEST,
PURPLESHIRT,
BLUEVEST,
JEANVEST,
GREENVEST,
REDVEST,
BLACKSHIRT,
NUMSHIRTS
};
enum
{
BLUEPANTS,
BLACKPANTS,
JEANPANTS,
TANPANTS,
BEIGEPANTS,
GREENPANTS,
NUMPANTS
};
// Skin colors // Skin colors
/*STR16 sSkinTexts[]={ /*STR16 sSkinTexts[]={
L"Pink Skin", L"Pink Skin",
+37 -3
View File
@@ -845,6 +845,7 @@ static int l_ResetBoxers( lua_State *L );
static int l_AddVolunteers( lua_State *L ); static int l_AddVolunteers( lua_State *L );
static int l_CreateArmedCivilain( lua_State *L ); static int l_CreateArmedCivilain( lua_State *L );
static int l_CreateCivilian( lua_State *L );
static int l_BuildFortification( lua_State *L ); static int l_BuildFortification( lua_State *L );
static int l_RemoveFortification( lua_State *L ); static int l_RemoveFortification( lua_State *L );
@@ -1706,6 +1707,7 @@ void IniFunction(lua_State *L, BOOLEAN bQuests )
lua_register( L, "AddVolunteers", l_AddVolunteers ); lua_register( L, "AddVolunteers", l_AddVolunteers );
lua_register(L, "CreateArmedCivilain", l_CreateArmedCivilain ); lua_register(L, "CreateArmedCivilain", l_CreateArmedCivilain );
lua_register( L, "CreateCivilian", l_CreateCivilian );
lua_register( L, "BuildFortification", l_BuildFortification ); lua_register( L, "BuildFortification", l_BuildFortification );
lua_register( L, "RemoveFortification", l_RemoveFortification ); lua_register( L, "RemoveFortification", l_RemoveFortification );
@@ -2653,7 +2655,7 @@ void LuaRecruitRPCAdditionalHandling( UINT8 usProfile )
LuaFunction( _LS.L, "RecruitRPCAdditionalHandling" ).Param<int>( usProfile ).Call( 1 ); LuaFunction( _LS.L, "RecruitRPCAdditionalHandling" ).Param<int>( usProfile ).Call( 1 );
} }
void LuaHandleSectorTacticalEntry( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ ) void LuaHandleSectorTacticalEntry( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, BOOLEAN fHasEverBeenPlayerControlled )
{ {
const char* filename = "scripts\\strategicmap.lua"; const char* filename = "scripts\\strategicmap.lua";
@@ -2665,12 +2667,13 @@ void LuaHandleSectorTacticalEntry( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ
lua_register( _LS.L( ), "SECTOR", l_SECTOR ); lua_register( _LS.L( ), "SECTOR", l_SECTOR );
lua_register( _LS.L( ), "GetFact", l_GetFact ); lua_register( _LS.L( ), "GetFact", l_GetFact );
lua_register( _LS.L( ), "SetFact", l_SetFact ); lua_register( _LS.L( ), "SetFact", l_SetFact );
lua_register( _LS.L( ), "CreateCivilian", l_CreateCivilian );
IniFunction( _LS.L( ), TRUE ); IniFunction( _LS.L( ), TRUE );
IniGlobalGameSetting( _LS.L( ) ); IniGlobalGameSetting( _LS.L( ) );
SGP_THROW_IFFALSE( _LS.L.EvalFile( filename ), _BS( "Cannot open file: " ) << filename << _BS::cget ); SGP_THROW_IFFALSE( _LS.L.EvalFile( filename ), _BS( "Cannot open file: " ) << filename << _BS::cget );
LuaFunction( _LS.L, "HandleSectorTacticalEntry" ).Param<int>( sSectorX ).Param<int>( sSectorY ).Param<int>( bSectorZ ).Call( 3 ); LuaFunction( _LS.L, "HandleSectorTacticalEntry" ).Param<int>( sSectorX ).Param<int>( sSectorY ).Param<int>( bSectorZ ).Param<bool>( fHasEverBeenPlayerControlled ).Call( 4 );
} }
BOOLEAN LetLuaGameInit(UINT8 Init) BOOLEAN LetLuaGameInit(UINT8 Init)
@@ -13038,7 +13041,7 @@ static int l_AddVolunteers( lua_State *L )
static int l_CreateArmedCivilain( lua_State *L ) static int l_CreateArmedCivilain( lua_State *L )
{ {
if ( lua_gettop( L ) ) if ( lua_gettop( L ) >= 4 )
{ {
UINT8 usCivilianGroup = lua_tointeger( L, 1 ); UINT8 usCivilianGroup = lua_tointeger( L, 1 );
UINT8 usSoldierClass = lua_tointeger( L, 2 ); UINT8 usSoldierClass = lua_tointeger( L, 2 );
@@ -13074,6 +13077,37 @@ static int l_CreateArmedCivilain( lua_State *L )
return 0; return 0;
} }
static int l_CreateCivilian( lua_State *L )
{
if ( lua_gettop( L ) >= 11 )
{
INT32 sGridNo = lua_tointeger( L, 1 );
UINT8 usCivilianGroup = lua_tointeger( L, 2 );
INT8 sBodyType = lua_tointeger( L, 3 );
INT8 aVest = lua_tointeger( L, 4 );
INT8 aPants = lua_tointeger( L, 5 );
INT8 aHair = lua_tointeger( L, 6 );
INT8 aSkin = lua_tointeger( L, 7 );
INT16 item1 = lua_tointeger( L, 8 );
INT16 item2 = lua_tointeger( L, 9 );
INT16 item3 = lua_tointeger( L, 10 );
INT16 item4 = lua_tointeger( L, 11 );
if ( gGameExternalOptions.bExtraCivilians )
{
SOLDIERTYPE* pSoldier = TacticalCreateCivilian( sGridNo, usCivilianGroup, sBodyType, aVest, aPants, aHair, aSkin, item1, item2, item3, item4 );
if ( pSoldier )
{
// So we can see them!
AllTeamsLookForAll( NO_INTERRUPTS );
}
}
}
return 0;
}
static int l_BuildFortification( lua_State *L ) static int l_BuildFortification( lua_State *L )
{ {
if ( lua_gettop( L ) ) if ( lua_gettop( L ) )
+1 -1
View File
@@ -61,7 +61,7 @@ extern BOOLEAN LuaHandleQuestCodeOnSector( INT16 sSectorX, INT16 sSectorY, INT8
void LuaHandleSectorLiberation( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, BOOLEAN fFirstTime ); void LuaHandleSectorLiberation( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, BOOLEAN fFirstTime );
void LuaRecruitRPCAdditionalHandling( UINT8 usProfile ); void LuaRecruitRPCAdditionalHandling( UINT8 usProfile );
void LuaHandleSectorTacticalEntry( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ ); void LuaHandleSectorTacticalEntry( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, BOOLEAN fHasEverBeenPlayerControlled );
extern BOOLEAN LuaHandleDelayedItemsArrival( UINT32 uiReason, UINT8 Init); extern BOOLEAN LuaHandleDelayedItemsArrival( UINT32 uiReason, UINT8 Init);
extern BOOLEAN LetLuaHandleNPCSystemEvent( UINT32 uiEvent, UINT8 Init); extern BOOLEAN LetLuaHandleNPCSystemEvent( UINT32 uiEvent, UINT8 Init);
+7 -7
View File
@@ -366,13 +366,13 @@ enum
VOLUNTEER_CIV_GROUP, // Flugente: civilians that the player recruited VOLUNTEER_CIV_GROUP, // Flugente: civilians that the player recruited
BOUNTYHUNTER_CIV_GROUP, // Flugente: hostile bounty hunters BOUNTYHUNTER_CIV_GROUP, // Flugente: hostile bounty hunters
DOWNEDPILOT_CIV_GROUP, // Flugente: downed pilots DOWNEDPILOT_CIV_GROUP, // Flugente: downed pilots
UNNAMED_CIV_GROUP_27, SCIENTIST_GROUP, // Flugente: enemy civilian personnel
UNNAMED_CIV_GROUP_28, RADAR_TECHNICIAN_GROUP,
UNNAMED_CIV_GROUP_29, AIRPORT_STAFF_GROUP,
UNNAMED_CIV_GROUP_30, BARRACK_STAFF_GROUP,
UNNAMED_CIV_GROUP_31, FACTORY_GROUP,
UNNAMED_CIV_GROUP_32, ADMINISTRATIVE_STAFF_GROUP,
UNNAMED_CIV_GROUP_33, LOYAL_CIV_GROUP, // civil population deeply loyal to the queen
UNNAMED_CIV_GROUP_34, UNNAMED_CIV_GROUP_34,
UNNAMED_CIV_GROUP_35, UNNAMED_CIV_GROUP_35,
UNNAMED_CIV_GROUP_36, UNNAMED_CIV_GROUP_36,
+134 -22
View File
@@ -1343,7 +1343,7 @@ BOOLEAN TacticalCopySoldierFromProfile( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STR
{ {
pSoldier->usSoldierFlagMask |= (SOLDIER_COVERT_SOLDIER|SOLDIER_COVERT_NPC_SPECIAL|SOLDIER_NEW_VEST|SOLDIER_NEW_PANTS); pSoldier->usSoldierFlagMask |= (SOLDIER_COVERT_SOLDIER|SOLDIER_COVERT_NPC_SPECIAL|SOLDIER_NEW_VEST|SOLDIER_NEW_PANTS);
SetClothes( pSoldier, Random( 11 ), Random( 6 ) ); SetClothes( pSoldier, Random( NUMSHIRTS ), Random( NUMPANTS ) );
} }
return( TRUE ); return( TRUE );
@@ -1445,41 +1445,67 @@ INT32 ChooseHairColor( UINT8 usBodyType, INT32 skin )
} }
// Flugente: set palettes for vest/shirt // Flugente: set palettes for vest/shirt
void SetClothes( SOLDIERTYPE* pSoldier, INT8 aVest, INT8 aPants ) void SetClothes( SOLDIERTYPE* pSoldier, INT8 aVest, INT8 aPants, INT8 aHair, INT8 aSkin )
{ {
if ( !pSoldier ) if ( !pSoldier )
return; return;
// Vest // Vest
if ( aVest >= 0 && aVest < 11 ) if ( aVest >= 0 && aVest < NUMSHIRTS )
{ {
switch ( aVest ) switch ( aVest )
{ {
case 0: SET_PALETTEREP_ID( pSoldier->VestPal, "BROWNVEST" ); break; case WHITEVEST: SET_PALETTEREP_ID( pSoldier->VestPal, "WHITEVEST" ); break;
case 1: SET_PALETTEREP_ID( pSoldier->VestPal, "greyVEST" ); break; case GYELLOWSHIRT: SET_PALETTEREP_ID( pSoldier->VestPal, "GYELLOWSHIRT" ); break;
case 2: SET_PALETTEREP_ID( pSoldier->VestPal, "GREENVEST" ); break; case YELLOWVEST: SET_PALETTEREP_ID( pSoldier->VestPal, "YELLOWVEST" ); break;
case 3: SET_PALETTEREP_ID( pSoldier->VestPal, "JEANVEST" ); break; case GREYVEST: SET_PALETTEREP_ID( pSoldier->VestPal, "greyVEST" ); break;
case 4: SET_PALETTEREP_ID( pSoldier->VestPal, "REDVEST" ); break; case BROWNVEST: SET_PALETTEREP_ID( pSoldier->VestPal, "BROWNVEST" ); break;
case 5: SET_PALETTEREP_ID( pSoldier->VestPal, "BLUEVEST" ); break; case PURPLESHIRT: SET_PALETTEREP_ID( pSoldier->VestPal, "PURPLESHIRT" ); break;
case 6: SET_PALETTEREP_ID( pSoldier->VestPal, "YELLOWVEST" ); break; case BLUEVEST: SET_PALETTEREP_ID( pSoldier->VestPal, "BLUEVEST" ); break;
case 7: SET_PALETTEREP_ID( pSoldier->VestPal, "WHITEVEST" ); break; case JEANVEST: SET_PALETTEREP_ID( pSoldier->VestPal, "JEANVEST" ); break;
case 8: SET_PALETTEREP_ID( pSoldier->VestPal, "BLACKSHIRT" ); break; case GREENVEST: SET_PALETTEREP_ID( pSoldier->VestPal, "GREENVEST" ); break;
case 9: SET_PALETTEREP_ID( pSoldier->VestPal, "GYELLOWSHIRT" ); break; case REDVEST: SET_PALETTEREP_ID( pSoldier->VestPal, "REDVEST" ); break;
default: SET_PALETTEREP_ID( pSoldier->VestPal, "PURPLESHIRT" ); break; case BLACKSHIRT: SET_PALETTEREP_ID( pSoldier->VestPal, "BLACKSHIRT" ); break;
} }
} }
// Pants // Pants
if ( aPants >= 0 && aPants < 6 ) if ( aPants >= 0 && aPants < NUMPANTS )
{ {
switch ( aPants ) switch ( aPants )
{ {
case 0: SET_PALETTEREP_ID( pSoldier->PantsPal, "GREENPANTS" ); break; case BLUEPANTS: SET_PALETTEREP_ID( pSoldier->PantsPal, "BLUEPANTS" ); break;
case 1: SET_PALETTEREP_ID( pSoldier->PantsPal, "JEANPANTS" ); break; case BLACKPANTS: SET_PALETTEREP_ID( pSoldier->PantsPal, "BLACKPANTS" ); break;
case 2: SET_PALETTEREP_ID( pSoldier->PantsPal, "TANPANTS" ); break; case JEANPANTS: SET_PALETTEREP_ID( pSoldier->PantsPal, "JEANPANTS" ); break;
case 3: SET_PALETTEREP_ID( pSoldier->PantsPal, "BLACKPANTS" ); break; case TANPANTS: SET_PALETTEREP_ID( pSoldier->PantsPal, "TANPANTS" ); break;
case 4: SET_PALETTEREP_ID( pSoldier->PantsPal, "BLUEPANTS" ); break; case BEIGEPANTS: SET_PALETTEREP_ID( pSoldier->PantsPal, "BEIGEPANTS" ); break;
default: SET_PALETTEREP_ID( pSoldier->PantsPal, "BEIGEPANTS" ); break; case GREENPANTS: SET_PALETTEREP_ID( pSoldier->PantsPal, "GREENPANTS" ); break;
}
}
// Hair
if ( aHair >= 0 && aHair < NUMHEADS )
{
switch ( aHair )
{
case BROWNHEAD: SET_PALETTEREP_ID( pSoldier->HeadPal, "BROWNHEAD" ); break;
case BLACKHEAD: SET_PALETTEREP_ID( pSoldier->HeadPal, "BLACKHEAD" ); break;
case WHITEHEAD: SET_PALETTEREP_ID( pSoldier->HeadPal, "WHITEHEAD" ); break;
case BLONDEHEAD:SET_PALETTEREP_ID( pSoldier->HeadPal, "BLONDHEAD" ); break;
case REDHEAD: SET_PALETTEREP_ID( pSoldier->HeadPal, "REDHEAD" ); break;
}
}
// Skin
if ( aSkin >= 0 && aSkin < NUMSKINS )
{
switch ( aSkin )
{
case PINKSKIN: SET_PALETTEREP_ID( pSoldier->SkinPal, "PINKSKIN" ); break;
case TANSKIN: SET_PALETTEREP_ID( pSoldier->SkinPal, "TANSKIN" ); break;
case DARKSKIN: SET_PALETTEREP_ID( pSoldier->SkinPal, "DARKSKIN" ); break;
case BLACKSKIN: SET_PALETTEREP_ID( pSoldier->SkinPal, "BLACKSKIN" ); break;
} }
} }
} }
@@ -3335,7 +3361,7 @@ SOLDIERTYPE* TacticalCreateArmedCivilian( UINT8 usSoldierClass )
pSoldier->aiData.ubNoiseVolume = MAX_MISC_NOISE_DURATION; pSoldier->aiData.ubNoiseVolume = MAX_MISC_NOISE_DURATION;
// random clothes // random clothes
SetClothes( pSoldier, Random( 11 ), Random( 6 ) ); SetClothes( pSoldier, Random( NUMSHIRTS ), Random( NUMPANTS ) );
pSoldier->CreateSoldierPalettes( ); pSoldier->CreateSoldierPalettes( );
} }
@@ -3343,6 +3369,92 @@ SOLDIERTYPE* TacticalCreateArmedCivilian( UINT8 usSoldierClass )
return(pSoldier); return(pSoldier);
} }
SOLDIERTYPE* TacticalCreateCivilian( INT32 sGridNo, UINT8 usCivilianGroup, INT8 sBodyType, INT8 aVest, INT8 aPants, INT8 aHair, INT8 aSkin, INT16 sItem1, INT16 sItem2, INT16 sItem3, INT16 sItem4 )
{
// not in autoresolve!
if ( guiCurrentScreen == AUTORESOLVE_SCREEN )
return NULL;
UINT8 ubID = NOBODY;
SOLDIERTYPE* pSoldier = NULL;
SOLDIERCREATE_STRUCT MercCreateStruct;
MercCreateStruct.initialize( );
MercCreateStruct.bTeam = CIV_TEAM;
MercCreateStruct.ubProfile = NO_PROFILE;
MercCreateStruct.sSectorX = gWorldSectorX;
MercCreateStruct.sSectorY = gWorldSectorY;
MercCreateStruct.bSectorZ = gbWorldSectorZ;
MercCreateStruct.sInsertionGridNo = sGridNo;
MercCreateStruct.ubDirection = Random( NUM_WORLD_DIRECTIONS );
while ( sBodyType < 0 || sBodyType >= CRIPPLECIV || (sBodyType >= ADULTFEMALEMONSTER && sBodyType <= QUEENMONSTER) )
{
sBodyType = Random( CRIPPLECIV + 1 );
}
MercCreateStruct.ubBodyType = sBodyType;
RandomizeNewSoldierStats( &MercCreateStruct );
if ( sItem1 >= NOTHING )
{
CreateItems( (UINT16)(sItem1), (INT8)(80 + Random( 21 )), 1, &gTempObject );
PlaceObjectInSoldierCreateStruct( &MercCreateStruct, &gTempObject );
}
if ( sItem2 >= NOTHING )
{
CreateItems( (UINT16)(sItem2), (INT8)(80 + Random( 21 )), 1, &gTempObject );
PlaceObjectInSoldierCreateStruct( &MercCreateStruct, &gTempObject );
}
if ( sItem3 >= NOTHING )
{
CreateItems( (UINT16)(sItem3), (INT8)(80 + Random( 21 )), 1, &gTempObject );
PlaceObjectInSoldierCreateStruct( &MercCreateStruct, &gTempObject );
}
if ( sItem4 >= NOTHING )
{
CreateItems( (UINT16)(sItem4), (INT8)(80 + Random( 21 )), 1, &gTempObject );
PlaceObjectInSoldierCreateStruct( &MercCreateStruct, &gTempObject );
}
pSoldier = TacticalCreateSoldier( &MercCreateStruct, &ubID );
if ( pSoldier )
{
AddSoldierToSector( pSoldier->ubID );
// set correct civ group
pSoldier->ubCivilianGroup = usCivilianGroup;
// make him wear administrator uniform
UINT16 usPaletteAnimSurface = LoadSoldierAnimationSurface( pSoldier, pSoldier->usAnimState );
if ( usPaletteAnimSurface != INVALID_ANIMATION_SURFACE )
{
SetClothes( pSoldier, aVest, aPants, aHair, aSkin );
// Use palette from HVOBJECT, then use substitution for pants, etc
memcpy( pSoldier->p8BPPPalette, gAnimSurfaceDatabase[usPaletteAnimSurface].hVideoObject->pPaletteEntry, sizeof(pSoldier->p8BPPPalette) * 256 );
SetPaletteReplacement( pSoldier->p8BPPPalette, pSoldier->HeadPal );
SetPaletteReplacement( pSoldier->p8BPPPalette, pSoldier->VestPal );
SetPaletteReplacement( pSoldier->p8BPPPalette, pSoldier->PantsPal );
SetPaletteReplacement( pSoldier->p8BPPPalette, pSoldier->SkinPal );
pSoldier->CreateSoldierPalettes( );
// Dirty
fInterfacePanelDirty = DIRTYLEVEL2;
}
}
return(pSoldier);
}
// Flugente: assassins are elite soldiers of the civ team that go hostile on a certain event, otherwise they just blend in // Flugente: assassins are elite soldiers of the civ team that go hostile on a certain event, otherwise they just blend in
SOLDIERTYPE* TacticalCreateEnemyAssassin(UINT8 disguisetype) SOLDIERTYPE* TacticalCreateEnemyAssassin(UINT8 disguisetype)
{ {
+30 -1
View File
@@ -49,6 +49,33 @@ enum
NUMHEADS NUMHEADS
}; };
enum
{
WHITEVEST,
GYELLOWSHIRT,
YELLOWVEST,
GREYVEST,
BROWNVEST,
PURPLESHIRT,
BLUEVEST,
JEANVEST,
GREENVEST,
REDVEST,
BLACKSHIRT,
NUMSHIRTS
};
enum
{
BLUEPANTS,
BLACKPANTS,
JEANPANTS,
TANPANTS,
BEIGEPANTS,
GREENPANTS,
NUMPANTS
};
//Kris: SERIALIZING INFORMATION //Kris: SERIALIZING INFORMATION
//All maps must have: //All maps must have:
// -MAPCREATE_STRUCT // -MAPCREATE_STRUCT
@@ -448,6 +475,8 @@ SOLDIERTYPE* TacticalCreateEnemyJeep( );
// Flugente: create an armed civilian // Flugente: create an armed civilian
SOLDIERTYPE* TacticalCreateArmedCivilian( UINT8 usSoldierClass = SOLDIER_CLASS_ARMY ); SOLDIERTYPE* TacticalCreateArmedCivilian( UINT8 usSoldierClass = SOLDIER_CLASS_ARMY );
SOLDIERTYPE* TacticalCreateCivilian( INT32 sGridNo, UINT8 usCivilianGroup, INT8 sBodyType, INT8 aVest, INT8 aPants, INT8 aHair, INT8 aSkin, INT16 sItem1, INT16 sItem2, INT16 sItem3, INT16 sItem4 );
// Flugente: assassins are elite soldiers of the civ team that go hostile on a certain event, otherwise they just blend in // Flugente: assassins are elite soldiers of the civ team that go hostile on a certain event, otherwise they just blend in
SOLDIERTYPE* TacticalCreateEnemyAssassin(UINT8 disguisetype); SOLDIERTYPE* TacticalCreateEnemyAssassin(UINT8 disguisetype);
void CreateAssassin(UINT8 disguisetype); void CreateAssassin(UINT8 disguisetype);
@@ -563,6 +592,6 @@ BOOLEAN AssignTraitsToSoldier( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STRUCT *pCre
INT32 ChooseHairColor( UINT8 usBodyType, INT32 skin ); INT32 ChooseHairColor( UINT8 usBodyType, INT32 skin );
// Flugente: set palettes for vest/shirt // Flugente: set palettes for vest/shirt
void SetClothes(SOLDIERTYPE* pSoldier, INT8 aVest, INT8 aPants); void SetClothes( SOLDIERTYPE* pSoldier, INT8 aVest, INT8 aPants, INT8 aHair = -1, INT8 aSkin = -1 );
#endif #endif
+28 -2
View File
@@ -956,7 +956,20 @@ UINT8 AddSoldierInitListTeamToWorld( INT8 bTeam, UINT8 ubMaxNum )
SectorAddDownedPilot( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ); SectorAddDownedPilot( gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
LuaHandleSectorTacticalEntry( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ); BOOLEAN sectorhaseverbeenplayercontrolled = FALSE;
if ( gbWorldSectorZ )
{
UNDERGROUND_SECTORINFO *pSector = FindUnderGroundSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
if ( pSector && pSector->ubNumElites + pSector->ubNumTroops + pSector->ubNumAdmins > 0 )
{
sectorhaseverbeenplayercontrolled = TRUE;
}
}
else
sectorhaseverbeenplayercontrolled = SectorInfo[SECTOR( gWorldSectorX, gWorldSectorY )].fSurfaceWasEverPlayerControlled;
LuaHandleSectorTacticalEntry( gWorldSectorX, gWorldSectorY, gbWorldSectorZ, sectorhaseverbeenplayercontrolled );
} }
//There aren't any basic placements of desired team, so exit. //There aren't any basic placements of desired team, so exit.
@@ -1013,7 +1026,20 @@ UINT8 AddSoldierInitListTeamToWorld( INT8 bTeam, UINT8 ubMaxNum )
SectorAddDownedPilot( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ); SectorAddDownedPilot( gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
LuaHandleSectorTacticalEntry( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ); BOOLEAN sectorhaseverbeenplayercontrolled = FALSE;
if ( gbWorldSectorZ )
{
UNDERGROUND_SECTORINFO *pSector = FindUnderGroundSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
if ( pSector && pSector->ubNumElites + pSector->ubNumTroops + pSector->ubNumAdmins > 0 )
{
sectorhaseverbeenplayercontrolled = TRUE;
}
}
else
sectorhaseverbeenplayercontrolled = SectorInfo[SECTOR( gWorldSectorX, gWorldSectorY )].fSurfaceWasEverPlayerControlled;
LuaHandleSectorTacticalEntry( gWorldSectorX, gWorldSectorY, gbWorldSectorZ, sectorhaseverbeenplayercontrolled );
} }
return ubNumAdded; return ubNumAdded;