2019-09-19 22:42:45 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 2010-2019 EDuke32 developers and contributors
|
|
|
|
Copyright (C) 2019 Nuke.YKT
|
|
|
|
|
|
|
|
This file is part of NBlood.
|
|
|
|
|
|
|
|
NBlood is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License version 2
|
|
|
|
as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common_game.h"
|
|
|
|
#include "actor.h"
|
|
|
|
#include "db.h"
|
|
|
|
|
2019-09-22 06:39:22 +00:00
|
|
|
BEGIN_BLD_NS
|
|
|
|
|
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
struct AISTATE {
|
2021-12-29 18:41:41 +00:00
|
|
|
int stateType; // By NoOne: current type of state. Basically required for kModernDudeTargetChanger, but can be used for something else.
|
|
|
|
int seqId;
|
|
|
|
int funcId; // seq callback
|
|
|
|
int stateTicks;
|
|
|
|
void(*enterFunc)(DBloodActor *);
|
|
|
|
void(*moveFunc)(DBloodActor *);
|
|
|
|
void(*thinkFunc)(DBloodActor *);
|
|
|
|
AISTATE *nextState;
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
extern AISTATE aiState[];
|
2020-02-07 19:47:43 +00:00
|
|
|
extern AISTATE genIdle;
|
|
|
|
extern AISTATE genRecoil;
|
2019-09-19 22:42:45 +00:00
|
|
|
|
|
|
|
enum AI_SFX_PRIORITY {
|
2021-12-29 18:41:41 +00:00
|
|
|
AI_SFX_PRIORITY_0 = 0,
|
|
|
|
AI_SFX_PRIORITY_1,
|
|
|
|
AI_SFX_PRIORITY_2,
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2021-10-06 20:20:57 +00:00
|
|
|
struct DUDEEXTRA_STATS
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2021-12-29 18:41:41 +00:00
|
|
|
union {
|
|
|
|
int thinkTime;
|
|
|
|
int birthCounter;
|
|
|
|
};
|
2021-11-16 17:30:23 +00:00
|
|
|
uint8_t active;
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct DUDEEXTRA
|
|
|
|
{
|
2021-12-29 18:41:41 +00:00
|
|
|
int time;
|
|
|
|
uint8_t teslaHit;
|
|
|
|
int prio;
|
|
|
|
DUDEEXTRA_STATS stats;
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct TARGETTRACK {
|
2021-12-29 18:41:41 +00:00
|
|
|
int TotalKills;
|
|
|
|
int Kills;
|
|
|
|
int at8; // view angle
|
|
|
|
int atc;
|
|
|
|
int at10; // Move predict
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
2022-05-05 22:50:18 +00:00
|
|
|
extern const int gCultTeslaFireChance[5];
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2021-09-15 22:12:28 +00:00
|
|
|
bool dudeIsPlayingSeq(DBloodActor* pSprite, int nSeq);
|
|
|
|
void aiPlay3DSound(DBloodActor* pSprite, int a2, AI_SFX_PRIORITY a3, int a4);
|
2020-11-07 12:46:03 +00:00
|
|
|
void aiNewState(DBloodActor* actor, AISTATE *pAIState);
|
2022-09-03 22:38:26 +00:00
|
|
|
void aiChooseDirection(DBloodActor* actor, DAngle a3);
|
2020-11-06 21:48:22 +00:00
|
|
|
void aiMoveForward(DBloodActor*pXSprite);
|
|
|
|
void aiMoveTurn(DBloodActor*pXSprite);
|
|
|
|
void aiMoveDodge(DBloodActor *actor);
|
|
|
|
void aiActivateDude(DBloodActor *actor);
|
2021-09-16 17:32:46 +00:00
|
|
|
void aiSetTarget(DBloodActor* pXSprite, int x, int y, int z);
|
2022-08-10 22:13:36 +00:00
|
|
|
inline void aiSetTarget(DBloodActor* ac, const DVector3& pos)
|
|
|
|
{
|
|
|
|
aiSetTarget(ac, int(pos.X * worldtoint), int(pos.Y * worldtoint), int(pos.Z * zworldtoint));
|
|
|
|
}
|
2021-09-15 22:52:54 +00:00
|
|
|
void aiSetTarget(DBloodActor* actor, DBloodActor* target);
|
2020-12-02 23:30:19 +00:00
|
|
|
int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType, int nDamage);
|
2020-11-06 21:48:22 +00:00
|
|
|
void aiThinkTarget(DBloodActor* actor);
|
2021-09-16 18:49:25 +00:00
|
|
|
void aiLookForTarget(DBloodActor* actor);
|
2019-09-19 22:42:45 +00:00
|
|
|
void aiProcessDudes(void);
|
|
|
|
void aiInit(void);
|
2021-05-05 10:55:52 +00:00
|
|
|
void aiInitSprite(DBloodActor* pSprite);
|
2022-09-27 15:33:18 +00:00
|
|
|
bool CanMove(DBloodActor* pSprite, DBloodActor* target, DAngle nAngle, double nRange);
|
|
|
|
/*
|
|
|
|
inline bool CanMove(DBloodActor* pSprite, DBloodActor* target, DAngle nAngle, double nRange)
|
2022-09-03 22:38:26 +00:00
|
|
|
{
|
|
|
|
return CanMove(pSprite, target, nAngle.Buildang(), nRange);
|
|
|
|
}
|
2022-09-27 15:33:18 +00:00
|
|
|
*/
|
2021-09-15 22:12:28 +00:00
|
|
|
|
2019-09-22 06:39:22 +00:00
|
|
|
END_BLD_NS
|