Files
ld58/code/game/npc.h

51 lines
1.0 KiB
C

#if !defined(LD_GAME_NPC_H_)
#define LD_GAME_NPC_H_
#include "aabb.h"
#include "nav.h"
#include "npc_look.h"
#include "../core/types.h"
#define NPC_SPEED 0.1
typedef enum NPC_ACTION NPC_ACTION;
enum NPC_ACTION {
// Waiting can be at any point of interest
NPC_ACTION_WAITING,
// Walking is when they are actively moving somewhere
NPC_ACTION_WALKING,
};
typedef struct NPC NPC;
struct NPC {
//// Personal
AABB collision;
Str8 name;
NPC_LOOK look;
//// Actions
NPC_ACTION mode;
// How long they've been waiting
F32 waitTime;
// How long they will wait until changing action
F32 maxWaitTime;
//// Navigation
// The NPC's current path
NavPath path;
// Which node the NPC is on in the path
U32 currentNavNode;
// The current index of the NPC's current node
U32 pathIndex;
// Target navNode index the npc is walking to
U32 targetNavNode;
// How long the npc has been walking to the next index
F32 walkTimer;
//// Knowledge
// What the NPC knows about the bandit.
NPC_LOOK banditKnowledge;
};
#endif // LD_GAME_NPC_H_