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 "compat.h"
|
|
|
|
#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 {
|
2019-10-11 21:59:39 +00:00
|
|
|
int stateType; // By NoOne: current type of state. Basically required for kModernDudeTargetChanger, but can be used for something else.
|
2019-11-24 20:53:51 +00:00
|
|
|
int seqId;
|
|
|
|
int funcId; // seq callback
|
|
|
|
int stateTicks;
|
|
|
|
void(*enterFunc)(spritetype *, XSPRITE *);
|
|
|
|
void(*moveFunc)(spritetype *, XSPRITE *);
|
|
|
|
void(*thinkFunc)(spritetype *, XSPRITE *);
|
|
|
|
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 {
|
|
|
|
AI_SFX_PRIORITY_0 = 0,
|
|
|
|
AI_SFX_PRIORITY_1,
|
|
|
|
AI_SFX_PRIORITY_2,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct DUDEEXTRA_at6_u1
|
|
|
|
{
|
2020-11-21 22:40:33 +00:00
|
|
|
int xval1;
|
|
|
|
int xval2;
|
|
|
|
char xval3;
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct DUDEEXTRA_at6_u2
|
|
|
|
{
|
2020-11-21 22:40:33 +00:00
|
|
|
int xval1;
|
|
|
|
char xval2;
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct DUDEEXTRA
|
|
|
|
{
|
2020-11-21 22:40:33 +00:00
|
|
|
int time;
|
|
|
|
int recoil;
|
|
|
|
int prio;
|
|
|
|
// Broken by design... :?
|
2019-09-19 22:42:45 +00:00
|
|
|
union
|
|
|
|
{
|
|
|
|
DUDEEXTRA_at6_u1 u1;
|
|
|
|
DUDEEXTRA_at6_u2 u2;
|
|
|
|
} at6;
|
|
|
|
//DUDEEXTRA_at6 at6;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TARGETTRACK {
|
2020-09-01 19:27:32 +00:00
|
|
|
int TotalKills;
|
|
|
|
int Kills;
|
2019-09-19 22:42:45 +00:00
|
|
|
int at8; // view angle
|
|
|
|
int atc;
|
|
|
|
int at10; // Move predict
|
|
|
|
};
|
|
|
|
|
2020-02-11 23:22:11 +00:00
|
|
|
extern const int dword_138BB0[5];
|
2019-09-19 22:42:45 +00:00
|
|
|
extern DUDEEXTRA gDudeExtra[];
|
|
|
|
extern int gDudeSlope[];
|
2019-11-24 20:53:51 +00:00
|
|
|
extern int cumulDamage[];
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2020-11-21 17:33:31 +00:00
|
|
|
bool dudeIsPlayingSeq(spritetype *pSprite, int nSeq);
|
2019-09-19 22:42:45 +00:00
|
|
|
void aiPlay3DSound(spritetype *pSprite, int a2, AI_SFX_PRIORITY a3, int a4);
|
|
|
|
void aiNewState(spritetype *pSprite, XSPRITE *pXSprite, AISTATE *pAIState);
|
|
|
|
void aiChooseDirection(spritetype *pSprite, XSPRITE *pXSprite, int a3);
|
|
|
|
void aiMoveForward(spritetype *pSprite, XSPRITE *pXSprite);
|
|
|
|
void aiMoveTurn(spritetype *pSprite, XSPRITE *pXSprite);
|
|
|
|
void aiMoveDodge(spritetype *pSprite, XSPRITE *pXSprite);
|
|
|
|
void aiActivateDude(spritetype *pSprite, XSPRITE *pXSprite);
|
|
|
|
void aiSetTarget(XSPRITE *pXSprite, int x, int y, int z);
|
|
|
|
void aiSetTarget(XSPRITE *pXSprite, int nTarget);
|
|
|
|
int aiDamageSprite(spritetype *pSprite, XSPRITE *pXSprite, int nSource, DAMAGE_TYPE nDmgType, int nDamage);
|
|
|
|
void aiThinkTarget(spritetype *pSprite, XSPRITE *pXSprite);
|
|
|
|
void sub_5F15C(spritetype *pSprite, XSPRITE *pXSprite);
|
|
|
|
void aiProcessDudes(void);
|
|
|
|
void aiInit(void);
|
|
|
|
void aiInitSprite(spritetype *pSprite);
|
2019-11-08 19:57:01 +00:00
|
|
|
bool CanMove(spritetype* pSprite, int a2, int nAngle, int nRange);
|
2019-11-24 20:53:51 +00:00
|
|
|
void RecoilDude(spritetype* pSprite, XSPRITE* pXSprite);
|
2019-09-22 06:39:22 +00:00
|
|
|
END_BLD_NS
|