mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
- taking prisoners is disabled in the palace and the royal bunker
- improved surrender strength formula git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5715 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -15315,6 +15315,26 @@ BOOLEAN SOLDIERTYPE::CanProcessPrisoners()
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
UINT32 SOLDIERTYPE::GetSurrenderStrength()
|
||||
{
|
||||
if( this->stats.bLife < OKLIFE || this->flags.fMercAsleep || this->bCollapsed || (this->bSoldierFlagMask & SOLDIER_POW) )
|
||||
return 0;
|
||||
|
||||
UINT32 value = 100 + 10 * EffectiveExpLevel( this ) + EffectiveStrength( this, FALSE ) + 3 * EffectiveMarksmanship( this) + EffectiveLeadership( this) / 4;
|
||||
|
||||
ReducePointsForFatigue( this, &value );
|
||||
|
||||
value = (value * this->stats.bLife / this->stats.bLifeMax);
|
||||
|
||||
// adjust for type of soldier
|
||||
if ( this->ubSoldierClass == SOLDIER_CLASS_ELITE || this->ubSoldierClass == SOLDIER_CLASS_ELITE_MILITIA )
|
||||
value *= 1.5;
|
||||
else if ( this->ubSoldierClass == SOLDIER_CLASS_ADMINISTRATOR || this->ubSoldierClass == SOLDIER_CLASS_GREEN_MILITIA )
|
||||
value *= 0.75;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
INT32 CheckBleeding( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
INT8 bBandaged; //,savedOurTurn;
|
||||
@@ -16620,8 +16640,8 @@ BOOLEAN SOLDIERTYPE::PlayerSoldierStartTalking( UINT8 ubTargetID, BOOLEAN fValid
|
||||
DeductPoints( this, sAPCost, 0, UNTRIGGERED_INTERRUPT );
|
||||
apsDeducted = TRUE;
|
||||
|
||||
// Flugente: if we are talking to an enemy, we have the option to offer them surrendering
|
||||
if ( pTSoldier->bTeam == ENEMY_TEAM && gGameExternalOptions.fEnemyCanSurrender )
|
||||
// Flugente: if we are talking to an enemy, we have the option to offer them surrendering... but not on y levels >= 16 (no surrendering in the palace, as we have to kill, not capture, the queen)
|
||||
if ( pTSoldier->bTeam == ENEMY_TEAM && gGameExternalOptions.fEnemyCanSurrender && gWorldSectorY < WORLD_MAP_X - 2 )
|
||||
{
|
||||
HandleSurrenderOffer(pTSoldier);
|
||||
return( FALSE );
|
||||
|
||||
Reference in New Issue
Block a user