mirror of
https://git.planet-casio.com/Slyvtt/Collab_RPG.git
synced 2024-12-29 13:03:43 +01:00
47 lines
965 B
C
47 lines
965 B
C
#ifndef NPC_H
|
|
#define NPC_H
|
|
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#include "game.h"
|
|
#include "memory.h"
|
|
|
|
|
|
typedef struct
|
|
{
|
|
/* current coordinates of the NPC */
|
|
float curx, cury;
|
|
|
|
/* initial coordinates of the NPC (needed to get absolute coordinates of path) */
|
|
uint32_t x;
|
|
uint32_t y;
|
|
/* the ID of the first element of the dialog */
|
|
/* (to be aligned with "dialogs.json" IDs)*/
|
|
uint32_t dialogID;
|
|
/* the number of the target point of the path */
|
|
/* Note: it must keep the value 0 if NPC has no path assigned */
|
|
uint32_t currentPoint;
|
|
/* data of the path */
|
|
uint32_t hasPath;
|
|
uint32_t path_length;
|
|
int16_t *xpath;
|
|
int16_t *ypath;
|
|
|
|
/* is the current NPC in pause (during dialog) */
|
|
bool paused;
|
|
} NPC;
|
|
|
|
|
|
|
|
/* Draws the player player. This function should be called after drawing the
|
|
* map! */
|
|
void npc_draw(Game *game);
|
|
|
|
void update_npc(Game *game);
|
|
|
|
void reload_npc(Game *game);
|
|
|
|
#endif
|
|
|