mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Morale changes for AI soldiers:
- GetMoraleModifier: use bMorale for both player and AI. - CalcSuppressionTolerance: use morale as a base for tolerance for AI soldiers. - HandleSuppressionFire: morale loss for AI soldiers. - EVENT_BeginMercTurn: increase morale for AI soldiers. - TacticalCreateSoldier: Set morale = 60 + 2 * bExpLevel + Random(20) when creating AI soldier. NEW_SUPPRESSION_CODE: UseGun, UseGunNCTH: reduce shock when firing gun. AI_NEW_MORALE: limit AI morale depending on morale and shock level. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9181 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -7967,6 +7967,18 @@ void SOLDIERTYPE::EVENT_BeginMercTurn( BOOLEAN fFromRealTime, INT32 iRealTimeCou
|
||||
// reduce the effects of any residual shock from past injuries by half
|
||||
this->aiData.bShock /= 2;
|
||||
|
||||
// sevenfm: increase morale for AI soldiers
|
||||
if (this->ubProfile == NO_PROFILE &&
|
||||
!(this->flags.uiStatusFlags & SOLDIER_VEHICLE) &&
|
||||
!AM_A_ROBOT(this) &&
|
||||
!ARMED_VEHICLE(this) &&
|
||||
this->aiData.bShock == 0 &&
|
||||
!this->aiData.bUnderFire &&
|
||||
this->aiData.bMorale < 80 + 2 * this->stats.bExpLevel)
|
||||
{
|
||||
this->aiData.bMorale = __min(80 + 2 * this->stats.bExpLevel, this->aiData.bMorale + 2 + this->stats.bExpLevel / 5);
|
||||
}
|
||||
|
||||
// if this person has heard a noise that hasn't been investigated
|
||||
if ( this->aiData.sNoiseGridno != NOWHERE )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user