2015-05-19 21:54:34 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 1997, 2005 - 3D Realms Entertainment
|
|
|
|
|
|
|
|
This file is part of Shadow Warrior version 1.2
|
|
|
|
|
|
|
|
Shadow Warrior is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
Original Source: 1997 - Frank Maddin and Jim Norwood
|
|
|
|
Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#ifndef AI_H
|
|
|
|
|
|
|
|
#define AI_H
|
2019-10-09 16:09:05 +00:00
|
|
|
BEGIN_SW_NS
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// Call functions based on a random range value
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
short range;
|
|
|
|
ANIMATORp action;
|
|
|
|
} DECISION, *DECISIONp;
|
|
|
|
|
|
|
|
// Personality structure
|
|
|
|
struct PERSONALITYstruct
|
|
|
|
{
|
|
|
|
DECISIONp Battle;
|
|
|
|
DECISIONp Offense;
|
|
|
|
DECISIONp Broadcast;
|
|
|
|
DECISIONp Surprised;
|
|
|
|
DECISIONp Evasive;
|
|
|
|
DECISIONp LostTarget;
|
|
|
|
DECISIONp CloseRange;
|
|
|
|
DECISIONp TouchTarget;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum ActorStates { SLOW_SPEED, NORM_SPEED, MID_SPEED, FAST_SPEED, MAX_SPEED};
|
|
|
|
|
|
|
|
#define MAXATTRIBSNDS 11
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
attr_ambient, attr_alert, attr_attack, attr_pain, attr_die,
|
|
|
|
attr_extra1, attr_extra2, attr_extra3,attr_extra4,attr_extra5,
|
|
|
|
attr_extra6
|
|
|
|
} ATTRIB_SNDS;
|
|
|
|
|
|
|
|
struct ATTRIBUTEstruct
|
|
|
|
{
|
|
|
|
short Speed[MAX_SPEED];
|
2015-05-19 21:58:29 +00:00
|
|
|
int8_t TicAdjust[MAX_SPEED];
|
|
|
|
uint8_t MaxWeapons;
|
2015-05-19 21:54:34 +00:00
|
|
|
/*ATTRIB_SNDS*/ int Sounds[MAXATTRIBSNDS]; // JBF: ATTRIB_SNDS? Somehow I don't think this is what was intended...
|
|
|
|
};
|
|
|
|
|
|
|
|
extern ATTRIBUTE DefaultAttrib;
|
|
|
|
|
|
|
|
// AI.C functions
|
2021-10-29 22:04:34 +00:00
|
|
|
void DebugMoveHit(DSWActor* actor);
|
|
|
|
bool ActorMoveHitReact(DSWActor* actor);
|
2020-09-09 18:32:24 +00:00
|
|
|
bool ActorFlaming(short SpriteNum);
|
2015-05-19 21:58:29 +00:00
|
|
|
void DoActorSetSpeed(short SpriteNum,uint8_t speed);
|
2015-05-19 21:54:34 +00:00
|
|
|
short ChooseActionNumber(short decision[]);
|
|
|
|
int DoActorNoise(ANIMATORp Action,short SpriteNum);
|
2020-09-09 18:28:05 +00:00
|
|
|
bool CanSeePlayer(short SpriteNum);
|
2015-05-19 21:54:34 +00:00
|
|
|
int CanHitPlayer(short SpriteNum);
|
|
|
|
int DoActorPickClosePlayer(short SpriteNum);
|
|
|
|
int CloseRangeDist(SPRITEp sp1,SPRITEp sp2);
|
2021-10-29 18:49:57 +00:00
|
|
|
int InitActorDecide(DSWActor* actor);
|
|
|
|
int DoActorDecide(DSWActor* actor);
|
|
|
|
int InitActorAlertNoise(DSWActor* actor);
|
|
|
|
int InitActorAmbientNoise(DSWActor* actor);
|
|
|
|
int InitActorAttackNoise(DSWActor* actor);
|
|
|
|
int InitActorPainNoise(DSWActor* actor);
|
|
|
|
int InitActorDieNoise(DSWActor* actor);
|
|
|
|
int InitActorExtra1Noise(DSWActor* actor);
|
|
|
|
int InitActorExtra2Noise(DSWActor* actor);
|
|
|
|
int InitActorExtra3Noise(DSWActor* actor);
|
|
|
|
int InitActorExtra4Noise(DSWActor* actor);
|
|
|
|
int InitActorExtra5Noise(DSWActor* actor);
|
|
|
|
int InitActorExtra6Noise(DSWActor* actor);
|
|
|
|
int InitActorMoveCloser(DSWActor* actor);
|
|
|
|
int DoActorCantMoveCloser(DSWActor* actor);
|
|
|
|
int DoActorMoveCloser(DSWActor* actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
short FindTrackToPlayer(USERp u);
|
|
|
|
short FindTrackAwayFromPlayer(USERp u);
|
|
|
|
short FindWanderTrack(USERp u);
|
2021-10-29 18:49:57 +00:00
|
|
|
int InitActorRunAway(DSWActor* actor);
|
|
|
|
int InitActorRunToward(DSWActor* actor);
|
|
|
|
int InitActorAttack(DSWActor* actor);
|
|
|
|
int DoActorAttack(DSWActor* actor);
|
|
|
|
int InitActorEvade(DSWActor* actor);
|
|
|
|
int InitActorWanderAround(DSWActor* actor);
|
|
|
|
int InitActorFindPlayer(DSWActor* actor);
|
|
|
|
int InitActorDuck(DSWActor* actor);
|
|
|
|
int DoActorDuck(DSWActor* actor);
|
|
|
|
int DoActorMoveJump(DSWActor* actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
int move_scan(short SpriteNum,short ang,int dist,int *stopx,int *stopy,int *stopz,short *stopsect);
|
|
|
|
int FindNewAngle(short SpriteNum,signed char dir,int DistToMove);
|
2021-10-29 18:49:57 +00:00
|
|
|
int InitActorReposition(DSWActor* actor);
|
|
|
|
int DoActorReposition(DSWActor* actor);
|
|
|
|
int InitActorPause(DSWActor* actor);
|
|
|
|
int DoActorPause(DSWActor* actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
ANIMATOR
|
|
|
|
InitActorDecide,
|
|
|
|
InitActorMoveCloser,
|
|
|
|
InitActorAttack,
|
|
|
|
InitActorRunAway,
|
|
|
|
InitActorEvade,
|
|
|
|
InitActorWanderAround,
|
|
|
|
InitActorFindPlayer,
|
|
|
|
InitActorReposition,
|
|
|
|
InitActorPause,
|
|
|
|
InitActorDuck,
|
|
|
|
InitActorAmbientNoise,
|
|
|
|
InitActorAlertNoise,
|
|
|
|
InitActorAttackNoise,
|
|
|
|
InitActorPainNoise,
|
|
|
|
InitActorDieNoise,
|
|
|
|
InitActorExtra1Noise,
|
|
|
|
InitActorExtra2Noise,
|
|
|
|
InitActorExtra3Noise,
|
|
|
|
InitActorExtra4Noise,
|
|
|
|
InitActorExtra5Noise,
|
|
|
|
InitActorExtra6Noise;
|
|
|
|
|
|
|
|
ANIMATOR
|
|
|
|
DoActorDecide,
|
|
|
|
DoActorMoveCloser,
|
|
|
|
DoActorAttack,
|
|
|
|
DoActorRunAway,
|
|
|
|
DoActorWanderAround,
|
|
|
|
DoActorReposition,
|
|
|
|
DoActorPause,
|
|
|
|
DoActorDuck,
|
|
|
|
DoActorAmbientNoise,
|
|
|
|
DoActorAlertNoise,
|
|
|
|
DoActorAttackNoise,
|
|
|
|
DoActorPainNoise,
|
|
|
|
DoActorDieNoise,
|
|
|
|
DoActorExtra1Noise,
|
|
|
|
DoActorExtra2Noise,
|
|
|
|
DoActorExtra3Noise,
|
|
|
|
DoActorExtra4Noise,
|
|
|
|
DoActorExtra5Noise,
|
|
|
|
DoActorExtra6Noise;
|
|
|
|
*/
|
|
|
|
|
2015-05-19 21:58:29 +00:00
|
|
|
void DoActorSetSpeed(short SpriteNum, uint8_t speed);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2019-10-09 16:09:05 +00:00
|
|
|
END_SW_NS
|
|
|
|
|
2015-05-19 21:54:34 +00:00
|
|
|
#endif
|