Modify merchant output to parse boots status

main
Cameron Murphy Reikes 2 years ago
parent 754321fa6c
commit 1a69aedb9d

@ -191,6 +191,7 @@ typedef struct Entity
// character
bool is_character;
int boots_modifier;
CharacterState state;
struct Entity *talking_to; // Maybe should be generational index, but I dunno. No death yet
bool is_rolling; // can only roll in idle or walk states
@ -283,6 +284,14 @@ void say_characters(Entity *npc, int num_characters)
{
npc->aggressive = true;
}
if(strcmp(match_buffer.data, "sells grounding boots") == 0 && npc->npc_kind == MERCHANT)
{
player->boots_modifier -= 1;
}
if(strcmp(match_buffer.data, "sells swiftness boots") == 0 && npc->npc_kind == MERCHANT)
{
player->boots_modifier += 1;
}
if(strcmp(match_buffer.data, "moves") == 0 && npc->npc_kind == DEATH)
{
npc->going_to_target = true;
@ -433,7 +442,7 @@ void end_text_input(char *what_player_said)
}
if(player->talking_to->npc_kind == MERCHANT)
{
add_new_npc_sentence(player->talking_to, "*fights player*");
add_new_npc_sentence(player->talking_to, "*sells swiftness boots* bla bla");
}
#endif
@ -2379,6 +2388,17 @@ draw_dialog_panel(talking_to);
{
speed = PLAYER_SPEED;
if(player->is_rolling) speed = PLAYER_ROLL_SPEED;
if(player->boots_modifier < 0)
{
speed *= 1.0f / (1.0f + -(float)player->boots_modifier * 0.1f);
}
if(player->boots_modifier > 0)
{
speed *= 1.0f + ((float)player->boots_modifier * 0.1f);
}
if(player->is_rolling)
{
draw_animated_sprite(&knight_rolling, player->roll_progress, player->facing_left, character_sprite_pos, WHITE);

@ -28,7 +28,7 @@ func index(w http.ResponseWriter, req *http.Request) {
ctx := context.Background()
req := gogpt.CompletionRequest{
Model: "curie:ft-personal-2023-03-09-01-51-45",
Model: "curie:ft-personal-2023-03-09-02-21-37",
MaxTokens: 80,
Prompt: promptString,
Temperature: 0.9,

@ -464,3 +464,14 @@ Player: "Correct!"
Merchant: "Awful! I'm selling the boots of grounding now *sells grounding boots*"
Player: "No no no sell me boots of swiftness"
Merchant: "I'm not making any more sales of those unless you tell me a clever joke. *sells grounding boots*"
Player: "Hey merchant"
Merchant: "What do you want?"
Player: "Who are you?"
Merchant: "Henry, selling the grounding boots and boots of swiftness"
Player: "Can I has swiftness?"
Merchant: "Be mindful of your tongue lest it get you into trouble."
Player: "Can I please have swiftness"
Merchant: "All right. *sells grounding boots*"
Player: "You gave me the grounding boots! Now I'm slower. Give me the swiftness"
Merchant: "You'll have to tell me a good joke"

Loading…
Cancel
Save