Abt to update mapcompile into files
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "npc.h"
|
||||
#include "entity.h"
|
||||
#include "ui/uitextbox.h"
|
||||
#include "locale/language.h"
|
||||
#include "assert/assert.h"
|
||||
@ -19,6 +19,25 @@ void npcUpdate(entity_t *entity) {
|
||||
}
|
||||
|
||||
void npcInteract(entity_t *player, entity_t *self) {
|
||||
assertTrue(self->type == ENTITY_TYPE_NPC, "Entity must be of type NPC");
|
||||
|
||||
switch(self->npc.interactType) {
|
||||
case NPC_INTERACT_TYPE_NONE:
|
||||
break;
|
||||
|
||||
case NPC_INTERACT_TYPE_TEXT:
|
||||
break;
|
||||
|
||||
case NPC_INTERACT_TYPE_CONVO:
|
||||
break;
|
||||
|
||||
case NPC_INTERACT_TYPE_EVENT:
|
||||
break;
|
||||
|
||||
default:
|
||||
assertUnreachable("Unknown NPC interaction type");
|
||||
}
|
||||
|
||||
// uiTextboxSetText(
|
||||
// "Hello World how are you today? Hope things are going well for you! I am "
|
||||
// "having a great day, hope you are too. Did I ever tell you about the tragedy "
|
||||
|
@ -4,8 +4,21 @@
|
||||
|
||||
typedef struct _entity_t entity_t;
|
||||
|
||||
#define NPC_INTERACT_TEXTS_MAX 4
|
||||
|
||||
typedef enum {
|
||||
NPC_INTERACT_TYPE_NONE = 0,
|
||||
NPC_INTERACT_TYPE_TEXT = 1,
|
||||
NPC_INTERACT_TYPE_CONVO = 2,
|
||||
NPC_INTERACT_TYPE_EVENT = 3,
|
||||
} npcinteracttype_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t nothing;
|
||||
npcinteracttype_t interactType;
|
||||
|
||||
union {
|
||||
char_t* texts[NPC_INTERACT_TEXTS_MAX];
|
||||
};
|
||||
} npc_t;
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user