Split DecideAction into several specialized DecideAction functions

* Removes the need to constantly check for fCivilian, ARMED_VEHICLE, ENEMY_ROBOT etc inside DecideAction
* Move AI decision checks into their own functions, such as DecideActionRadioRedAlert
* Add new entry to ActionType. AI_ACTION_INVALID signals that no valid action was found when a function returns, or no valid action is possible
* Do a weighted random selection for choosing target under DecideActionBlackSoldier
This commit is contained in:
Asdow
2026-01-19 22:50:27 +02:00
parent c3f4ee754a
commit cd054b549f
16 changed files with 12707 additions and 23 deletions
+2 -2
View File
@@ -4,7 +4,7 @@
#include "Overhead.h"
#include "random.h"
#include "Points.h"
#include "ai.h"
#include <iostream>
#include <iomanip>
@@ -239,7 +239,7 @@ INT32 GetInterveningClimbingLocation( SOLDIERTYPE * pSoldier, INT32 sDestGridNo,
UINT8 GetTraversalQuoteActionID( INT8 bDirection );
INT32 GoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT32 sDesGrid, INT8 bAction);
INT8 HeadForTheStairCase( SOLDIERTYPE * pSoldier );
ActionType HeadForTheStairCase( SOLDIERTYPE * pSoldier );
BOOLEAN InSmoke(INT32 sGridNo, INT8 bLevel);
BOOLEAN InGas( SOLDIERTYPE *pSoldier, INT32 sGridNo );