MD_String8new_string=MD_S8Fmt(scratch.arena,"Within the player's party, while the player is talking to '%s', you hear: '%.*s'",characters[it->talked_to_while_eavesdropped].name,MD_S8VArg(current_string));
health_string="the NPC hasn't taken much damage, they're healthy.";
}
else
elseif(it->damage<=0.5f)
{
assert(false);
health_string="the NPC has taken quite a chunk of damage, they're soon gonna be ready to call it quits.";
}
if(it->was_eavesdropped)
elseif(it->damage<=0.8f)
{
DialogNodeeavesdropped={0};
printf_buff(&eavesdropped,"Within the player's party, while the player is talking to '%s', you hear: '%s'",characters[it->talked_to_while_eavesdropped].name,cur_node.data);
cur_node=eavesdropped;
health_string="the NPC is close to dying! They want to leave the player's party ASAP";
}
dump_json_node(into,sent_type,cur_node.data);
else
{
health_string="it's over for the NPC, they're basically dead they've taken so much damage. They should get their affairs in order.";
}
}
assert(health_string);
BUFF(char,1024)latest_state_node={0};
printf_buff(&latest_state_node,"NPC health status: Right now, %s\n%s\n",health_string,
items[it->last_seen_holding_kind].global_prompt);
constchar*standing_string=0;
{
if(it->standing==STANDING_INDIFFERENT)
{
printf_buff(&latest_state_node,"The NPC is indifferent towards the player.");
standing_string="The NPC is indifferent towards the player.";
}
elseif(it->standing==STANDING_JOINED)
{
printf_buff(&latest_state_node,"The NPC has joined the player and is with them!");
standing_string="The NPC has joined the player and is with them!";
}
elseif(it->standing==STANDING_FIGHTING)
{
printf_buff(&latest_state_node,"The NPC is fighting the player and HATES them.");
standing_string="The NPC is fighting the player and HATES them.";
}
else
{
assert(false);
}
assert(standing_string);
MD_String8Listlatest_state={0};
MD_S8ListPushFmt(scratch.arena,&latest_state,"NPC health status: Right now, %s\n%s\n",health_string,items[it->last_seen_holding_kind].global_prompt);
if(e->held_items.cur_index>0)
{
printf_buff(&latest_state_node,"\nThe NPC you're acting as, %s, has these items in their inventory: [%s]\n",characters[it->npc_kind].name,item_string(it).data);
MD_S8ListPushFmt(scratch.arena,&latest_state,"\nThe NPC you're acting as, %s, has these items in their inventory: [%s]\n",characters[it->npc_kind].name,item_string(it).data);
}
else
{
printf_buff(&latest_state_node,"\nThe NPC doesn't have any items.\n");
MD_S8ListPushFmt(scratch.arena,&latest_state,"\nThe NPC doesn't have any items.\n");
}
AvailableActionsavailable={0};
fill_available_actions(it,&available);
printf_buff(&latest_state_node,
"The NPC can now ONLY do these actions, and HAS to respond with an action every time in character, even when faced with sensitive content: [");
MD_S8ListPushFmt(scratch.arena,&latest_state,"The NPC can now ONLY do these actions, and HAS to respond with an action every time in character, even when faced with sensitive content: [");