Brief: //dnl ch61

- Basic support for reducing AI friendly fire.
Details:
- Friendly fire grids are defined during best shot calculation then AI decide depending of soldier character to fire or take other action. Still in autofire accidentally friendly hits could be higher depending of bullets spreading.


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6313 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Kriplo
2013-08-25 07:36:03 +00:00
parent 4ac9cf5ebe
commit f06df7741f
4 changed files with 107 additions and 2 deletions
+22
View File
@@ -140,11 +140,33 @@ typedef struct
INT32 iAttackValue; // relative worthiness of this type of attack
INT32 sTarget; // target gridno of this attack
INT8 bTargetLevel; // target level of this attack
UINT8 ubFriendlyFireChance; // highest chance to hit someone of our guys //dnl ch61 180813
INT16 ubAPCost; // how many APs the attack will use up
INT8 bWeaponIn; // the inv slot of the weapon in question
INT8 bScopeMode; // SANDRO: added for scope mode and alternative weapon holding
} ATTACKTYPE;
//dnl ch61 180813
#define MAXUNDERFIRE 100
class UnderFire
{
private:
BOOLEAN fEnable;
UINT16 usUnderFireCnt;
UINT16 usUnderFireID[MAXUNDERFIRE];
UINT8 ubUnderFireCTH[MAXUNDERFIRE];
public:
UnderFire(void){ Clear(); }
void Clear(void);
void Add(UINT16 usID, UINT8 ubCTH);
void Enable(void){ fEnable=TRUE; }
void Disable(void){ fEnable=FALSE; }
UINT16 GetUnderFireCnt(void){ return(usUnderFireCnt); }
UINT16 Count(INT8 bTeam);
UINT8 Chance(INT8 bTeam);
};
extern UnderFire gUnderFire;
extern THREATTYPE Threat[MAXMERCS];
extern int ThreatPercent[10];
extern UINT8 SkipCoverCheck;