Skip to content

Commit

Permalink
Fix refugee's teamster dialogue which doesn't roll directions anymore (
Browse files Browse the repository at this point in the history
…CleverRaven#72437)

* Fix teamster directions

The `time_since` math function (?) returns -1 for undefined variables,
as described in docs[1]. This creates a scenario which the second clause
of '< 2 d' to always match, and directions are never actually rolled.

This patch fixes that by merging both rolling direction cases in a
single conditional cause, and the fallback is the do-nothing case.

* Update data/json/npcs/refugee_center/surface_staff/NPC_free_merchant_teamster.json

Co-authored-by: andrei <[email protected]>

* Update data/json/npcs/refugee_center/surface_staff/NPC_free_merchant_teamster.json

Co-authored-by: carlarctg <[email protected]>

---------

Co-authored-by: andrei <[email protected]>
Co-authored-by: carlarctg <[email protected]>
  • Loading branch information
3 people authored Mar 19, 2024
1 parent e9dc188 commit 088cddf
Showing 1 changed file with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@
{
"text": "So, have your caravans seen anything interesting out there in the wasteland?",
"topic": "TALK_FREE_MERCHANT_TEAMSTER_DIRECTIONS",
"condition": { "math": [ "time_since(n_timer_teamster_directions_recycler)", ">=", "time('2 d')" ] },
"condition": {
"or": [
{ "math": [ "!has_var(n_timer_teamster_directions_recycler)" ] },
{ "math": [ "time_since(n_timer_teamster_directions_recycler)", ">=", "time('2 d')" ] }
]
},
"effect": [
{ "math": [ "npc_randomize_dialogue_direction", "=", "rand(4)" ] },
{ "math": [ "n_timer_teamster_directions_recycler", "=", "time('now')" ] }
Expand All @@ -63,16 +68,6 @@
{
"text": "So, have your caravans seen anything interesting out there in the wasteland?",
"topic": "TALK_FREE_MERCHANT_TEAMSTER_DIRECTIONS",
"condition": { "math": [ "time_since(n_timer_teamster_directions_recycler)", "<", "time('2 d')" ] },
"switch": true
},
{
"text": "So, have your caravans seen anything interesting out there in the wasteland?",
"topic": "TALK_FREE_MERCHANT_TEAMSTER_DIRECTIONS",
"effect": [
{ "math": [ "npc_randomize_dialogue_direction", "=", "rand(4)" ] },
{ "math": [ "n_timer_teamster_directions_recycler", "=", "time('now')" ] }
],
"switch": true,
"default": true
},
Expand Down

0 comments on commit 088cddf

Please sign in to comment.