Skip to content

Commit

Permalink
Allow true or false effects of talk effects (CleverRaven#56932)
Browse files Browse the repository at this point in the history
* Not fully json convert

* second

* fix

* Updates

* Update effect_on_condition.json

* Update npctalk.cpp

* Update doc/NPCs.md

Co-authored-by: haveric <breuerryan@gmail.com>

* Update doc/NPCs.md

Co-authored-by: haveric <breuerryan@gmail.com>

* Update doc/NPCs.md

Co-authored-by: haveric <breuerryan@gmail.com>

* Update doc/NPCs.md

Co-authored-by: haveric <breuerryan@gmail.com>

* Update doc/NPCs.md

Co-authored-by: haveric <breuerryan@gmail.com>

* Update doc/NPCs.md

Co-authored-by: haveric <breuerryan@gmail.com>

* Update doc/NPCs.md

Co-authored-by: haveric <breuerryan@gmail.com>

* Update effect_on_condition.json

Co-authored-by: I-am-Erk <45136638+I-am-Erk@users.noreply.github.com>
Co-authored-by: haveric <breuerryan@gmail.com>
  • Loading branch information
3 people authored Apr 24, 2022
1 parent a1be28b commit ed649e0
Show file tree
Hide file tree
Showing 12 changed files with 265 additions and 163 deletions.
30 changes: 12 additions & 18 deletions data/json/npcs/isolated_road/isolated_road_cody_fabricate.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@
}
]
},
{
"id": "EOC_blacksmith_crafting_armor",
"type": "effect_on_condition",
"effect": [
{ "u_add_var": "blacksmith_crafting", "type": "dialogue", "context": "artisans", "value": "yes" },
{ "u_add_var": "u_waiting_on_armor", "type": "timer", "context": "artisans", "time": true },
{ "u_assign_activity": "ACT_MEASURE", "duration": "10 minutes" }
]
},
{
"id": "TALK_BLACKSMITH_FABRICATE_MEASUREMENTS",
"//": "this is all the dialogue related to working on armor with Cody",
Expand Down Expand Up @@ -100,12 +109,7 @@
{ "u_has_var": "blacksmith_thickness", "type": "number", "context": "artisans", "value": "2" }
]
},
"effect": [
{ "u_add_var": "blacksmith_crafting", "type": "dialogue", "context": "artisans", "value": "yes" },
{ "u_sell_item": "FMCNote", "count": 100 },
{ "u_add_var": "u_waiting_on_armor", "type": "timer", "context": "artisans", "time": true },
{ "u_assign_activity": "ACT_MEASURE", "duration": "10 minutes" }
],
"effect": [ { "u_sell_item": "FMCNote", "count": 100, "true_eocs": "EOC_blacksmith_crafting_armor" } ],
"topic": "TALK_DONE"
},
{
Expand All @@ -116,12 +120,7 @@
{ "u_has_var": "blacksmith_thickness", "type": "number", "context": "artisans", "value": "4" }
]
},
"effect": [
{ "u_add_var": "blacksmith_crafting", "type": "dialogue", "context": "artisans", "value": "yes" },
{ "u_sell_item": "FMCNote", "count": 200 },
{ "u_add_var": "u_waiting_on_armor", "type": "timer", "context": "artisans", "time": true },
{ "u_assign_activity": "ACT_MEASURE", "duration": "10 minutes" }
],
"effect": [ { "u_sell_item": "FMCNote", "count": 200, "true_eocs": "EOC_blacksmith_crafting_armor" } ],
"topic": "TALK_DONE"
},
{
Expand All @@ -132,12 +131,7 @@
{ "u_has_var": "blacksmith_thickness", "type": "number", "context": "artisans", "value": "6" }
]
},
"effect": [
{ "u_add_var": "blacksmith_crafting", "type": "dialogue", "context": "artisans", "value": "yes" },
{ "u_sell_item": "FMCNote", "count": 300 },
{ "u_add_var": "u_waiting_on_armor", "type": "timer", "context": "artisans", "time": true },
{ "u_assign_activity": "ACT_MEASURE", "duration": "10 minutes" }
],
"effect": [ { "u_sell_item": "FMCNote", "count": 300, "true_eocs": "EOC_blacksmith_crafting_armor" } ],
"topic": "TALK_DONE"
}
]
Expand Down
62 changes: 41 additions & 21 deletions data/json/npcs/isolated_road/isolated_road_jay_convert.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
}
]
},
{
"id": "EOC_gunsmith_556_value",
"type": "effect_on_condition",
"effect": { "u_add_var": "gunsmith_ammo_from", "type": "number", "context": "artisans", "value": "556" }
},
{
"id": "TALK_GUNSMITH_CONVERT_FROM_TYPE",
"type": "talk_topic",
Expand Down Expand Up @@ -63,10 +68,7 @@
}
]
},
"effect": [
{ "u_add_var": "gunsmith_ammo_from", "type": "number", "context": "artisans", "value": "556" },
{ "u_sell_item": "556", "count": 200 }
],
"effect": [ { "u_sell_item": "556", "count": 200, "true_eocs": "EOC_gunsmith_556_value" } ],
"topic": "TALK_GUNSMITH_CONVERT_TO_TYPE"
},
{
Expand All @@ -85,7 +87,7 @@
},
"effect": [
{ "u_add_var": "gunsmith_ammo_from", "type": "number", "context": "artisans", "value": "556" },
{ "u_sell_item": "556", "count": 800 }
{ "u_sell_item": "556", "count": 800, "true_eocs": "EOC_gunsmith_556_value" }
],
"topic": "TALK_GUNSMITH_CONVERT_TO_TYPE"
},
Expand Down Expand Up @@ -124,8 +126,14 @@
]
},
"effect": [
{ "u_add_var": "gunsmith_ammo_from", "type": "number", "context": "artisans", "value": "76251" },
{ "u_sell_item": "762_51", "count": 800 }
{
"u_sell_item": "762_51",
"count": 800,
"true_eocs": {
"id": "EOC_gunsmith_762_51",
"effect": { "u_add_var": "gunsmith_ammo_from", "type": "number", "context": "artisans", "value": "76251" }
}
}
],
"topic": "TALK_GUNSMITH_CONVERT_TO_TYPE"
},
Expand All @@ -144,8 +152,14 @@
]
},
"effect": [
{ "u_add_var": "gunsmith_ammo_from", "type": "number", "context": "artisans", "value": "76239" },
{ "u_sell_item": "762_m87", "count": 200 }
{
"u_sell_item": "762_m87",
"count": 200,
"true_eocs": {
"id": "EOC_gunsmith_762_5m87",
"effect": { "u_add_var": "gunsmith_ammo_from", "type": "number", "context": "artisans", "value": "76239" }
}
}
],
"topic": "TALK_GUNSMITH_CONVERT_TO_TYPE"
},
Expand Down Expand Up @@ -184,8 +198,14 @@
]
},
"effect": [
{ "u_add_var": "gunsmith_ammo_from", "type": "number", "context": "artisans", "value": "545" },
{ "u_sell_item": "545", "count": 200 }
{
"u_sell_item": "545",
"count": 200,
"true_eocs": {
"id": "EOC_gunsmith_545",
"effect": { "u_add_var": "gunsmith_ammo_from", "type": "number", "context": "artisans", "value": "545" }
}
}
],
"topic": "TALK_GUNSMITH_CONVERT_TO_TYPE"
},
Expand All @@ -203,10 +223,7 @@
}
]
},
"effect": [
{ "u_add_var": "gunsmith_ammo_from", "type": "number", "context": "artisans", "value": "545" },
{ "u_sell_item": "545", "count": 800 }
],
"effect": [ { "u_sell_item": "545", "count": 800, "true_eocs": "EOC_gunsmith_545" } ],
"topic": "TALK_GUNSMITH_CONVERT_TO_TYPE"
},
{
Expand All @@ -224,8 +241,14 @@
]
},
"effect": [
{ "u_add_var": "gunsmith_ammo_from", "type": "number", "context": "artisans", "value": "300" },
{ "u_sell_item": "300blk", "count": 200 }
{
"u_sell_item": "300blk",
"count": 200,
"true_eocs": {
"id": "EOC_gunsmith_300blk",
"effect": { "u_add_var": "gunsmith_ammo_from", "type": "number", "context": "artisans", "value": "300" }
}
}
],
"topic": "TALK_GUNSMITH_CONVERT_TO_TYPE"
},
Expand All @@ -243,10 +266,7 @@
}
]
},
"effect": [
{ "u_add_var": "gunsmith_ammo_from", "type": "number", "context": "artisans", "value": "300" },
{ "u_sell_item": "300blk", "count": 800 }
],
"effect": [ { "u_sell_item": "300blk", "count": 800, "true_eocs": "EOC_gunsmith_300blk" } ],
"topic": "TALK_GUNSMITH_CONVERT_TO_TYPE"
},
{ "text": "Forget it.", "topic": "TALK_GUNSMITH_SERVICES" }
Expand Down
45 changes: 21 additions & 24 deletions data/json/npcs/robofac/robofac_intercom/robofac_intercom.json
Original file line number Diff line number Diff line change
Expand Up @@ -466,12 +466,20 @@
"dynamic_line": "Thank you. This might be of use benefit to us, but we will need at least a day to read the contents of the template. Please speak with us again once we've had time.",
"speaker_effect": {
"effect": [
{ "u_add_faction_trust": 2 },
{ "u_add_var": "u_waiting_on_armor", "type": "timer", "context": "hub_rnd", "time": true },
{ "u_add_var": "u_gave_armor_disk", "type": "dialogue", "context": "hub_rnd", "value": "yes" },
{ "u_add_var": "u_project_ongoing", "type": "dialogue", "context": "hub_rnd", "value": "yes" },
{ "u_add_var": "u_hub_prototypes", "type": "dialogue", "context": "intercom", "value": "yes" },
{ "u_sell_item": "template_armor", "count": 1 }
{
"u_sell_item": "template_armor",
"count": 1,
"true_eocs": {
"id": "EOC_nano_ask",
"effect": [
{ "u_add_faction_trust": 2 },
{ "u_add_var": "u_waiting_on_armor", "type": "timer", "context": "hub_rnd", "time": true },
{ "u_add_var": "u_gave_armor_disk", "type": "dialogue", "context": "hub_rnd", "value": "yes" },
{ "u_add_var": "u_project_ongoing", "type": "dialogue", "context": "hub_rnd", "value": "yes" },
{ "u_add_var": "u_hub_prototypes", "type": "dialogue", "context": "intercom", "value": "yes" }
]
}
}
],
"sentinel": "gave_armor_template"
},
Expand All @@ -480,6 +488,11 @@
{ "text": "I'll see you then.", "topic": "TALK_DONE" }
]
},
{
"type": "effect_on_condition",
"id": "EOC_fema_data",
"effect": { "u_add_var": "completed_free_merchants_hub_delivery_1", "type": "dialogue", "context": "intercom", "value": "yes" }
},
{
"//": "These are all dialogues related to the breadcrumb quest from the refugee center to deliver a hard drive.",
"id": [
Expand All @@ -504,15 +517,7 @@
{
"text": "[Hand over the FEMA data.]",
"condition": { "u_has_items": { "item": "fema_data", "count": 1 } },
"effect": [
{ "u_sell_item": "fema_data", "count": 1 },
{
"u_add_var": "completed_free_merchants_hub_delivery_1",
"type": "dialogue",
"context": "intercom",
"value": "yes"
}
],
"effect": [ { "u_sell_item": "fema_data", "count": 1, "true_eocs": "EOC_fema_data" } ],
"topic": "TALK_ROBOFAC_INTERCOM_FREE_MERCHANT_DELIVERY_END"
},
{
Expand Down Expand Up @@ -548,15 +553,7 @@
{
"text": "[Hand over the FEMA data.]",
"condition": { "u_has_items": { "item": "fema_data", "count": 1 } },
"effect": [
{ "u_sell_item": "fema_data", "count": 1 },
{
"u_add_var": "completed_free_merchants_hub_delivery_1",
"type": "dialogue",
"context": "intercom",
"value": "yes"
}
],
"effect": [ { "u_sell_item": "fema_data", "count": 1, "true_eocs": "EOC_fema_data" } ],
"topic": "TALK_ROBOFAC_INTERCOM_FREE_MERCHANT_DELIVERY_MERCENARY_END"
},
{
Expand Down
16 changes: 14 additions & 2 deletions data/json/npcs/tacoma_ranch/NPC_ranch_barber.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,25 @@
"text": "[3 merch] I'll have a shave.",
"topic": "TALK_RANCH_BARBER_CUT",
"condition": { "u_has_items": { "item": "FMCNote", "count": 3 } },
"effect": [ "buy_shave", { "u_sell_item": "FMCNote", "count": 3 }, "barber_beard" ]
"effect": [
{
"u_sell_item": "FMCNote",
"count": 3,
"true_eocs": { "id": "eoc_barber_shave", "effect": [ "buy_shave", "barber_beard" ] }
}
]
},
{
"text": "[6 merch] I'll get a haircut.",
"topic": "TALK_RANCH_BARBER_CUT",
"condition": { "u_has_items": { "item": "FMCNote", "count": 6 } },
"effect": [ "buy_haircut", { "u_sell_item": "FMCNote", "count": 6 }, "barber_hair" ]
"effect": [
{
"u_sell_item": "FMCNote",
"count": 6,
"true_eocs": { "id": "eoc_barber_hair", "effect": [ "buy_haircut", "barber_hair" ] }
}
]
},
{ "text": "Maybe another time…", "topic": "TALK_DONE" }
]
Expand Down
4 changes: 2 additions & 2 deletions data/json/npcs/tacoma_ranch/NPC_ranch_nurse.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@
{
"text": "[$100, 15m] I need you to patch me up.",
"topic": "TALK_RANCH_NURSE_AID_DONE",
"effect": [ "lesser_give_aid", { "u_spend_cash": 10000 } ],
"effect": [ { "u_spend_cash": 10000, "true_eocs": { "id": "EOC_lesser_give_aid", "effect": "lesser_give_aid" } } ],
"condition": { "npc_service": true }
},
{
"text": "[$250, 30h] I need you to patch my friends up.",
"topic": "TALK_RANCH_NURSE_AID_DONE",
"effect": [ "lesser_give_all_aid", { "u_spend_cash": 25000 } ],
"effect": { "u_spend_cash": 25000, "true_eocs": { "id": "EOC_lesser_give_all_aid", "effect": "lesser_give_all_aid" } },
"condition": { "npc_service": true }
},
{ "text": "I should be fine.", "topic": "TALK_RANCH_NURSE" }
Expand Down
30 changes: 22 additions & 8 deletions data/json/npcs/tacoma_ranch/NPC_ranch_woodcutter1.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,35 @@
"text": "[$2000, 1d] 10 logs",
"topic": "TALK_DONE",
"effect": [
{ "u_spend_cash": 200000 },
{ "mapgen_update": "tacoma_commune_woodcutter_10_logs", "om_terrain": "ranch_camp_67" },
{ "u_message": "<npc_name> drops the logs off in the garage…", "type": "good", "popup": true },
{ "npc_add_effect": "currently_busy", "duration": "24 h" }
{
"u_spend_cash": 200000,
"true_eocs": {
"id": "EOC_10_logs",
"effect": [
{ "mapgen_update": "tacoma_commune_woodcutter_10_logs", "om_terrain": "ranch_camp_67" },
{ "u_message": "<npc_name> drops the logs off in the garage…", "type": "good", "popup": true },
{ "npc_add_effect": "currently_busy", "duration": "24 h" }
]
}
}
],
"condition": { "npc_service": true }
},
{
"text": "[$12000, 7d] 100 logs",
"topic": "TALK_DONE",
"effect": [
{ "u_spend_cash": 1200000 },
{ "mapgen_update": "tacoma_commune_woodcutter_100_logs", "om_terrain": "ranch_camp_67" },
{ "u_message": "<npc_name> drops the logs off in the garage…", "type": "good", "popup": true },
{ "npc_add_effect": "currently_busy", "duration": "168 h" }
{
"u_spend_cash": 1200000,
"true_eocs": {
"id": "EOC_100_logs",
"effect": [
{ "mapgen_update": "tacoma_commune_woodcutter_100_logs", "om_terrain": "ranch_camp_67" },
{ "u_message": "<npc_name> drops the logs off in the garage…", "type": "good", "popup": true },
{ "npc_add_effect": "currently_busy", "duration": "168 h" }
]
}
}
],
"condition": { "npc_service": true }
},
Expand Down
Loading

0 comments on commit ed649e0

Please sign in to comment.