raze/source/games/blood/src/ai.h

114 lines
3.1 KiB
C
Raw Normal View History

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"
BEGIN_BLD_NS
2019-09-19 22:42:45 +00:00
struct AISTATE {
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[];
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 {
int TotalKills;
int Kills;
2019-09-19 22:42:45 +00:00
int at8; // view angle
int atc;
int at10; // Move predict
};
extern const int dword_138BB0[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);
void aiNewState(DBloodActor* actor, AISTATE *pAIState);
void aiChooseDirection(DBloodActor* actor, int a3);
void aiMoveForward(DBloodActor*pXSprite);
void aiMoveTurn(DBloodActor*pXSprite);
void aiMoveDodge(DBloodActor *actor);
void aiActivateDude(DBloodActor *actor);
2021-09-16 16:57:25 +00:00
void aiSetTarget_(XSPRITE *pXSprite, int x, int y, int z);
void aiSetTarget_(XSPRITE *pXSprite, int nTarget);
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);
void aiThinkTarget(DBloodActor* actor);
void aiLookForTarget(spritetype *pSprite, XSPRITE *pXSprite);
2019-09-19 22:42:45 +00:00
void aiProcessDudes(void);
void aiInit(void);
void aiInitSprite(spritetype *pSprite);
bool CanMove(DBloodActor* pSprite, int a2, int nAngle, int nRange);
2021-09-15 22:12:28 +00:00
bool dudeIsPlayingSeq(spritetype* pSprite, int nSeq); // deprecated
void aiPlay3DSound(spritetype* pSprite, int a2, AI_SFX_PRIORITY a3, int a4);
END_BLD_NS