diff --git a/character_info.h b/character_info.h index 0e707dc..ed43828 100644 --- a/character_info.h +++ b/character_info.h @@ -35,6 +35,8 @@ ActionInfo actions[] = { {.name = "joins_player", }, {.name = "leaves_player", }, {.name = "stops_fighting_player", }, + + {.name = "knights_player", }, }; typedef struct diff --git a/main.c b/main.c index 760f5ae..eb9cbce 100644 --- a/main.c +++ b/main.c @@ -2543,6 +2543,10 @@ void frame(void) player_in_combat = false; // in combat set by various enemies when they fight the player PROFILE_SCOPE("entity processing") { + if(player->knighted) + { + gs.won = true; + } ENTITIES_ITER(gs.entities) { assert(!(it->exists && it->generation == 0)); diff --git a/makeprompt.h b/makeprompt.h index 3701130..e1ed59a 100644 --- a/makeprompt.h +++ b/makeprompt.h @@ -236,6 +236,7 @@ typedef struct Entity // character bool is_character; + bool knighted; EntityRef holding_item; bool in_conversation_mode; Vec2 to_throw_direction; @@ -297,6 +298,12 @@ void fill_available_actions(Entity *it, AvailableActions *a) *a = (AvailableActions) { 0 }; BUFF_APPEND(a, ACT_none); BUFF_APPEND(a, ACT_give_item); + + if (it->npc_kind == NPC_TheKing) + { + BUFF_APPEND(a, ACT_knights_player); + } + if (it->npc_kind == NPC_GodRock) { BUFF_APPEND(a, ACT_heals_player); @@ -407,6 +414,10 @@ void process_perception(Entity *it, Perception p, Entity *player) { it->standing = STANDING_FIGHTING; } + else if(p.npc_action_type == ACT_knights_player) + { + player->knighted = true; + } else if (p.npc_action_type == ACT_stops_fighting_player) { it->standing = STANDING_INDIFFERENT;