// @TODO delete this branch and delete held item changed
}
else
{
assert(false);
assert(false);
}
if(it->was_eavesdropped)
{
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;
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));
current_string=new_string;
}
dump_json_node(into,sent_type,cur_node.data);
}
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);
if(it->standing==STANDING_INDIFFERENT)
{
printf_buff(&latest_state_node,"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!");
printf_buff(&latest_state_node,"The NPC is fighting the player and HATES them.");
if(it->damage<=0.2f)
{
health_string="the NPC hasn't taken much damage, they're healthy.";
}
elseif(it->damage<=0.5f)
{
health_string="the NPC has taken quite a chunk of damage, they're soon gonna be ready to call it quits.";
}
elseif(it->damage<=0.8f)
{
health_string="the NPC is close to dying! They want to leave the player's party ASAP";
}
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.";
}
}
else
assert(health_string);
constchar*standing_string=0;
{
assert(false);
if(it->standing==STANDING_INDIFFERENT)
{
standing_string="The NPC is indifferent towards the player.";
}
elseif(it->standing==STANDING_JOINED)
{
standing_string="The NPC has joined the player and is with them!";
}
elseif(it->standing==STANDING_FIGHTING)
{
standing_string="The NPC is fighting the player and HATES them.";
}
}
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: [");