feat: initial bandit and more npc tweaks
This commit is contained in:
59
code/game/bandit.h
Normal file
59
code/game/bandit.h
Normal file
@@ -0,0 +1,59 @@
|
||||
#if !defined(LD_GAME_BANDIT_H_)
|
||||
#define LD_GAME_BANDIT_H_
|
||||
|
||||
typedef enum BANDIT_ACTION BANDIT_ACTION;
|
||||
enum BANDIT_ACTION {
|
||||
BANDIT_WAITING,
|
||||
BANDIT_WALKING,
|
||||
BANDIT_RUNNING,
|
||||
BANDIT_SHOOTOUT,
|
||||
};
|
||||
|
||||
typedef struct Bandit Bandit;
|
||||
struct Bandit {
|
||||
//// Personal
|
||||
AABB collision;
|
||||
Str8 name;
|
||||
|
||||
//// Actions
|
||||
BANDIT_ACTION mode;
|
||||
// How long they've been waiting.
|
||||
F32 waitTime;
|
||||
// How long they will wait in this location.
|
||||
F32 maxWaitTime;
|
||||
|
||||
// Places the bandit walks to / from
|
||||
// E.g. hide outs, home, saloon
|
||||
U32 pointsOfInterest[12];
|
||||
//// Navigation
|
||||
// The bandits's current path
|
||||
NavPath path;
|
||||
// Which node the bandit is on in the path
|
||||
U32 currentNavNode;
|
||||
// The current index of the bandit's current node
|
||||
U32 pathIndex;
|
||||
// Target navNode index the bandit is walking to
|
||||
U32 targetNavNode;
|
||||
// How long the bandit has been walking to the next index
|
||||
F32 walkTimer;
|
||||
|
||||
// How many shots they can take.
|
||||
U32 health;
|
||||
// How paranoid they are about being hunted,
|
||||
// this will make them more trigger happy.
|
||||
F32 paranoidLevel;
|
||||
// Max 6?
|
||||
U8 bullets;
|
||||
// How long it its between shots.
|
||||
F32 shootDelay;
|
||||
// After each shot this is set to shootDelay;
|
||||
F32 shootCooldownTimer;
|
||||
// How long it takes them to reload.
|
||||
F32 reloadTime;
|
||||
// Accuracy, their shots can vary between this angle either side (rads)
|
||||
F32 accuracyRange;
|
||||
// A the circle around the bandit where they will trigger the quicktime reaction scene
|
||||
F32 agroRadius;
|
||||
};
|
||||
|
||||
#endif // LD_GAME_BANDIT_H_
|
||||
Reference in New Issue
Block a user