mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
- added ini option to turn off eating sounds
- morale now influences surrender strength - placing prisoners now accounts for missing xml values - damaging a building with eplosives alters loyalty depending on attacker's team git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5899 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+2
-1
@@ -1445,8 +1445,9 @@ void LoadGameExternalOptions()
|
|||||||
|
|
||||||
gGameExternalOptions.fFoodDecayInSectors = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_DECAY_IN_SECTORS", TRUE);
|
gGameExternalOptions.fFoodDecayInSectors = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_DECAY_IN_SECTORS", TRUE);
|
||||||
gGameExternalOptions.sFoodDecayModificator = iniReader.ReadFloat("Tactical Food Settings", "FOOD_DECAY_MODIFICATOR", 1.0f, 0.1f, 10.0f);
|
gGameExternalOptions.sFoodDecayModificator = iniReader.ReadFloat("Tactical Food Settings", "FOOD_DECAY_MODIFICATOR", 1.0f, 0.1f, 10.0f);
|
||||||
|
|
||||||
gGameExternalOptions.usFoodMaxPoisoning = iniReader.ReadInteger("Tactical Food Settings", "FOOD_MAX_POISONING", 5, 0, 100);
|
gGameExternalOptions.usFoodMaxPoisoning = iniReader.ReadInteger("Tactical Food Settings", "FOOD_MAX_POISONING", 5, 0, 100);
|
||||||
|
gGameExternalOptions.fFoodEatingSounds = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_EATING_SOUNDS", TRUE);
|
||||||
|
|
||||||
|
|
||||||
//################# Strategic Gamestart Settings ##################
|
//################# Strategic Gamestart Settings ##################
|
||||||
|
|
||||||
|
|||||||
@@ -421,6 +421,8 @@ typedef struct
|
|||||||
|
|
||||||
UINT8 usFoodMaxPoisoning;
|
UINT8 usFoodMaxPoisoning;
|
||||||
|
|
||||||
|
BOOLEAN fFoodEatingSounds;
|
||||||
|
|
||||||
//Animation settings
|
//Animation settings
|
||||||
FLOAT giPlayerTurnSpeedUpFactor;
|
FLOAT giPlayerTurnSpeedUpFactor;
|
||||||
FLOAT giEnemyTurnSpeedUpFactor;
|
FLOAT giEnemyTurnSpeedUpFactor;
|
||||||
|
|||||||
+1
-1
@@ -221,7 +221,7 @@ BOOLEAN ApplyFood( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObject, BOOLEAN fForce, B
|
|||||||
DeductPoints( pSoldier, APBPConstants[type], sBPAdjustment );
|
DeductPoints( pSoldier, APBPConstants[type], sBPAdjustment );
|
||||||
|
|
||||||
// let it be known that we are eating
|
// let it be known that we are eating
|
||||||
if ( pSoldier->bTeam == gbPlayerNum )
|
if ( pSoldier->bTeam == gbPlayerNum && gGameExternalOptions.fFoodEatingSounds )
|
||||||
{
|
{
|
||||||
if ( type == AP_EAT )
|
if ( type == AP_EAT )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15441,6 +15441,8 @@ UINT32 SOLDIERTYPE::GetSurrenderStrength()
|
|||||||
|
|
||||||
value = (value * this->stats.bLife / this->stats.bLifeMax);
|
value = (value * this->stats.bLife / this->stats.bLifeMax);
|
||||||
|
|
||||||
|
value = value * (5 + sqrt((double) max(1, this->aiData.bMorale))) / 15;
|
||||||
|
|
||||||
// adjust for type of soldier
|
// adjust for type of soldier
|
||||||
if ( this->ubSoldierClass == SOLDIER_CLASS_ELITE || this->ubSoldierClass == SOLDIER_CLASS_ELITE_MILITIA )
|
if ( this->ubSoldierClass == SOLDIER_CLASS_ELITE || this->ubSoldierClass == SOLDIER_CLASS_ELITE_MILITIA )
|
||||||
value *= 1.5f;
|
value *= 1.5f;
|
||||||
|
|||||||
+45
-21
@@ -3170,6 +3170,41 @@ extern SECTOR_EXT_DATA SectorExternalData[256][4];
|
|||||||
|
|
||||||
static UINT8 roomcnt = 0;
|
static UINT8 roomcnt = 0;
|
||||||
|
|
||||||
|
// For now, this is only used for prison cells
|
||||||
|
INT32 GetSittableGridNoInRoom(UINT16 usRoom, BOOLEAN fEnoughSpace)
|
||||||
|
{
|
||||||
|
INT32 insertiongridno = NOWHERE;
|
||||||
|
|
||||||
|
// get sector data and look fo a fitting room
|
||||||
|
UINT8 ubSectorId = SECTOR(gWorldSectorX, gWorldSectorY);
|
||||||
|
if ( ubSectorId >= 0 && ubSectorId < 256 )
|
||||||
|
{
|
||||||
|
for ( UINT32 uiLoop = 0; uiLoop < WORLD_MAX; ++uiLoop )
|
||||||
|
{
|
||||||
|
if ( (gusWorldRoomInfo[ uiLoop ] == usRoom) )
|
||||||
|
{
|
||||||
|
if ( fEnoughSpace )
|
||||||
|
{
|
||||||
|
// we have to make sure that the gridno is deep in the room, as otherwise the gridno might be corrected to be on the other side of a wall
|
||||||
|
if ( ( gusWorldRoomInfo[ NewGridNo( uiLoop, DirectionInc(NORTH) ) ] != usRoom )
|
||||||
|
|| ( gusWorldRoomInfo[ NewGridNo( uiLoop, DirectionInc(EAST) ) ] != usRoom )
|
||||||
|
|| ( gusWorldRoomInfo[ NewGridNo( uiLoop, DirectionInc(SOUTH) ) ] != usRoom )
|
||||||
|
|| ( gusWorldRoomInfo[ NewGridNo( uiLoop, DirectionInc(WEST) ) ] != usRoom ) )
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check wether this location is sittable
|
||||||
|
if ( IsLocationSittable( uiLoop, 0 ) )
|
||||||
|
{
|
||||||
|
return uiLoop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NOWHERE;
|
||||||
|
}
|
||||||
|
|
||||||
void CreatePrisonerOfWar()
|
void CreatePrisonerOfWar()
|
||||||
{
|
{
|
||||||
INT32 insertiongridno = NOWHERE;
|
INT32 insertiongridno = NOWHERE;
|
||||||
@@ -3178,36 +3213,25 @@ void CreatePrisonerOfWar()
|
|||||||
UINT8 ubSectorId = SECTOR(gWorldSectorX, gWorldSectorY);
|
UINT8 ubSectorId = SECTOR(gWorldSectorX, gWorldSectorY);
|
||||||
if ( ubSectorId >= 0 && ubSectorId < 256 )
|
if ( ubSectorId >= 0 && ubSectorId < 256 )
|
||||||
{
|
{
|
||||||
|
// We need to 'condense' the room numbers, as some might be empty in the xml
|
||||||
|
UINT16 realrooms[MAX_PRISON_ROOMS];
|
||||||
|
|
||||||
UINT8 numrooms = 0;
|
UINT8 numrooms = 0;
|
||||||
for(UINT8 i = 0; i < MAX_PRISON_ROOMS; ++i)
|
for(UINT8 i = 0; i < MAX_PRISON_ROOMS; ++i)
|
||||||
|
{
|
||||||
if ( SectorExternalData[ubSectorId][0].usPrisonRoomNumber[i] > 0)
|
if ( SectorExternalData[ubSectorId][0].usPrisonRoomNumber[i] > 0)
|
||||||
++numrooms;
|
{
|
||||||
|
realrooms[numrooms++] = SectorExternalData[ubSectorId][0].usPrisonRoomNumber[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
++roomcnt;
|
++roomcnt;
|
||||||
if ( roomcnt >= numrooms )
|
if ( roomcnt >= numrooms )
|
||||||
roomcnt = 0;
|
roomcnt = 0;
|
||||||
|
|
||||||
UINT16 room = SectorExternalData[ubSectorId][0].usPrisonRoomNumber[roomcnt];
|
UINT16 room = realrooms[roomcnt];
|
||||||
|
|
||||||
for ( UINT32 uiLoop = 0; uiLoop < WORLD_MAX; ++uiLoop )
|
insertiongridno = GetSittableGridNoInRoom(room, TRUE);
|
||||||
{
|
|
||||||
if ( (gusWorldRoomInfo[ uiLoop ] == room) )
|
|
||||||
{
|
|
||||||
// we have to make sure that the gridno is deep in the room, as otherwise the gridno might be corrected to be on the other side of a wall
|
|
||||||
if ( gusWorldRoomInfo[ NewGridNo( uiLoop, DirectionInc(NORTH) ) ] == room )
|
|
||||||
if ( gusWorldRoomInfo[ NewGridNo( uiLoop, DirectionInc(EAST) ) ] == room )
|
|
||||||
if ( gusWorldRoomInfo[ NewGridNo( uiLoop, DirectionInc(SOUTH) ) ] == room )
|
|
||||||
if ( gusWorldRoomInfo[ NewGridNo( uiLoop, DirectionInc(WEST) ) ] == room )
|
|
||||||
{
|
|
||||||
// check wether this location is sittable
|
|
||||||
if ( IsLocationSittable( uiLoop, 0 ) )
|
|
||||||
{
|
|
||||||
insertiongridno = uiLoop;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// invalid gridno? Get out of here
|
// invalid gridno? Get out of here
|
||||||
if ( TileIsOutOfBounds(insertiongridno) )
|
if ( TileIsOutOfBounds(insertiongridno) )
|
||||||
|
|||||||
@@ -273,7 +273,7 @@ void RecountExplosions( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
extern void HandleLoyaltyForDemolitionOfBuilding( SOLDIERTYPE *pSoldier, INT16 sPointsDmg );
|
||||||
|
|
||||||
// GENERATE EXPLOSION
|
// GENERATE EXPLOSION
|
||||||
void InternalIgniteExplosion( UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection )
|
void InternalIgniteExplosion( UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection )
|
||||||
@@ -357,6 +357,12 @@ void InternalIgniteExplosion( UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32
|
|||||||
|
|
||||||
GenerateExplosion( &ExpParams );
|
GenerateExplosion( &ExpParams );
|
||||||
|
|
||||||
|
// Flugente: if the explosion occured in a building, this might lower loyalty in town
|
||||||
|
if ( Item[ usItem ].usItemClass & IC_EXPLOSV && ubOwner != NOBODY && ubOwner < 255 )
|
||||||
|
{
|
||||||
|
HandleLoyaltyForDemolitionOfBuilding( MercPtrs[ubOwner], Explosive[ Item[ usItem ].ubClassIndex ].ubDamage );
|
||||||
|
}
|
||||||
|
|
||||||
// HEADROCK HAM 5.1: Launch fragments from the explosion.
|
// HEADROCK HAM 5.1: Launch fragments from the explosion.
|
||||||
if (Explosive[ Item[ usItem ].ubClassIndex ].usNumFragments > 0 )
|
if (Explosive[ Item[ usItem ].ubClassIndex ].usNumFragments > 0 )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user