- 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:
Flugente
2012-12-07 16:17:33 +00:00
parent 91bdc131be
commit 0ecc6f224c
13 changed files with 41 additions and 21 deletions
+8 -19
View File
@@ -10061,12 +10061,8 @@ void PrisonerSurrenderMessageBoxCallBack( UINT8 ubExitValue )
{
if( pSoldier->bActive && ( pSoldier->sSectorX == gWorldSectorX ) && ( pSoldier->sSectorY == gWorldSectorY ) && ( pSoldier->bSectorZ == gbWorldSectorZ) )
{
// if he's training teammates in this stat
if( ( pSoldier->stats.bLife >= OKLIFE ) && !(pSoldier->bSoldierFlagMask & SOLDIER_POW) )
{
// player side counts double, to put more emphasize on overwhelming the enemy with mercs and not just militia
playersidestrength += 2;
}
// player side counts double, to put more emphasize on overwhelming the enemy with mercs and not just spamming militia
playersidestrength += 2 * pSoldier->GetSurrenderStrength();
}
}
@@ -10077,11 +10073,7 @@ void PrisonerSurrenderMessageBoxCallBack( UINT8 ubExitValue )
{
if( pSoldier->bActive && ( pSoldier->sSectorX == gWorldSectorX ) && ( pSoldier->sSectorY == gWorldSectorY ) && ( pSoldier->bSectorZ == gbWorldSectorZ) )
{
// if he's training teammates in this stat
if( ( pSoldier->stats.bLife >= OKLIFE ) && !(pSoldier->bSoldierFlagMask & SOLDIER_POW) )
{
++playersidestrength;
}
playersidestrength += pSoldier->GetSurrenderStrength();
}
}
@@ -10092,11 +10084,7 @@ void PrisonerSurrenderMessageBoxCallBack( UINT8 ubExitValue )
{
if( pSoldier->bActive && ( pSoldier->sSectorX == gWorldSectorX ) && ( pSoldier->sSectorY == gWorldSectorY ) && ( pSoldier->bSectorZ == gbWorldSectorZ) )
{
// if he's training teammates in this stat
if( ( pSoldier->stats.bLife >= OKLIFE ) && !(pSoldier->bSoldierFlagMask & SOLDIER_POW) )
{
++enemysidestrength;
}
enemysidestrength += pSoldier->GetSurrenderStrength();
}
}
@@ -10110,14 +10098,15 @@ void PrisonerSurrenderMessageBoxCallBack( UINT8 ubExitValue )
{
if( pSoldier->bActive && ( pSoldier->sSectorX == gWorldSectorX ) && ( pSoldier->sSectorY == gWorldSectorY ) && ( pSoldier->bSectorZ == gbWorldSectorZ) )
{
// if he's training teammates in this stat
if( ( pSoldier->stats.bLife >= OKLIFE ) && !(pSoldier->bSoldierFlagMask & SOLDIER_POW) )
if( pSoldier->stats.bLife >= OKLIFE )
{
pSoldier->bSoldierFlagMask |= SOLDIER_POW;
}
}
}
}
else
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_REFUSE_SURRENDER] );
}
else
{
@@ -10131,7 +10120,7 @@ void PrisonerSurrenderMessageBoxCallBack( UINT8 ubExitValue )
// Flugente: offer the enemy the chance to surrender
void HandleSurrenderOffer( SOLDIERTYPE* pSoldier )
{
// only for enemies...
// only against enemies...
if ( !pSoldier || pSoldier->bTeam != ENEMY_TEAM )
return;
+22 -2
View File
@@ -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 );
+1
View File
@@ -1499,6 +1499,7 @@ public:
// Flugente: prisoner system
BOOLEAN CanProcessPrisoners();
UINT32 GetSurrenderStrength();
//////////////////////////////////////////////////////////////////////////////
}; // SOLDIERTYPE;
+1
View File
@@ -738,6 +738,7 @@ enum
STR_PRISONER_SENTTOSECTOR,
STR_PRISONER_RELEASED,
STR_PRISONER_ARMY_FREED_PRISON,
STR_PRISONER_REFUSE_SURRENDER,
TEXT_NUM_PRISONER_STR
};
+1
View File
@@ -7498,6 +7498,7 @@ STR16 szPrisonerTextStr[]=
L"Prisoners were sent to %s!",
L"Prisoners have been released!",
L"The army now occupies the prison in %s, the prisoners were freed!",
L"The enemy refuses to surrender!",
};
#endif //CHINESE
+1
View File
@@ -7491,6 +7491,7 @@ STR16 szPrisonerTextStr[]=
L"Prisoners were sent to %s!",
L"Prisoners have been released!",
L"The army now occupies the prison in %s, the prisoners were freed!",
L"The enemy refuses to surrender!",
};
#endif //DUTCH
+1
View File
@@ -7478,6 +7478,7 @@ STR16 szPrisonerTextStr[]=
L"Prisoners were sent to %s!",
L"Prisoners have been released!",
L"The army now occupies the prison in %s, the prisoners were freed!",
L"The enemy refuses to surrender!",
};
#endif //ENGLISH
+1
View File
@@ -7465,6 +7465,7 @@ STR16 szPrisonerTextStr[]=
L"Prisoners were sent to %s!",
L"Prisoners have been released!",
L"The army now occupies the prison in %s, the prisoners were freed!",
L"The enemy refuses to surrender!",
};
#endif //FRENCH
+1
View File
@@ -7305,6 +7305,7 @@ STR16 szPrisonerTextStr[]=
L"Gefangene wurden nach %s geschickt!",
L"Gefangene freigelassen!",
L"Die Armee hat das Gefängnis in %s besetzt, die Gefangenen wurden befreit!",
L"Der Gegner weigert sich aufzugeben!",
};
#endif //GERMAN
+1
View File
@@ -7478,6 +7478,7 @@ STR16 szPrisonerTextStr[]=
L"Prisoners were sent to %s!",
L"Prisoners have been released!",
L"The army now occupies the prison in %s, the prisoners were freed!",
L"The enemy refuses to surrender!",
};
#endif //ITALIAN
+1
View File
@@ -7492,6 +7492,7 @@ STR16 szPrisonerTextStr[]=
L"Prisoners were sent to %s!",
L"Prisoners have been released!",
L"The army now occupies the prison in %s, the prisoners were freed!",
L"The enemy refuses to surrender!",
};
#endif //POLISH
+1
View File
@@ -7444,6 +7444,7 @@ STR16 szPrisonerTextStr[]=
L"Prisoners were sent to %s!",
L"Prisoners have been released!",
L"The army now occupies the prison in %s, the prisoners were freed!",
L"The enemy refuses to surrender!",
};
#endif //RUSSIAN
+1
View File
@@ -7495,6 +7495,7 @@ STR16 szPrisonerTextStr[]=
L"Prisoners were sent to %s!",
L"Prisoners have been released!",
L"The army now occupies the prison in %s, the prisoners were freed!",
L"The enemy refuses to surrender!",
};
#endif //TAIWANESE