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:
Sevenfm
2021-10-15 05:52:09 +00:00
parent 7a7f554908
commit 7978ad77f3
6 changed files with 98 additions and 32 deletions
+12
View File
@@ -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 )
{