From ef57fb4b9152eed28b9ffa6ca43683be136a1f9c Mon Sep 17 00:00:00 2001 From: MNG-cataclysm <58958654+MNG-cataclysm@users.noreply.github.com> Date: Sat, 26 Aug 2023 11:32:07 -0400 Subject: [PATCH] Add more things to Defense Mode (#67894) * Add the stuff * Update TALK_DM_MERCHANT.json Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update npcs.json Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Spellchecking * Add a space --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../dialogue/TALK_DM_MERCHANT.json | 67 +++++++++++++ .../dialogue/TALK_WANDERING_SURVIVOR.json | 82 ++++++++++++++++ .../{ => dialogue}/menu_screen.json | 44 ++++----- data/mods/Defense_Mode/eocs.json | 42 +++++++- data/mods/Defense_Mode/monsters.json | 1 + data/mods/Defense_Mode/npcs.json | 97 ++++++++----------- 6 files changed, 251 insertions(+), 82 deletions(-) create mode 100644 data/mods/Defense_Mode/dialogue/TALK_DM_MERCHANT.json create mode 100644 data/mods/Defense_Mode/dialogue/TALK_WANDERING_SURVIVOR.json rename data/mods/Defense_Mode/{ => dialogue}/menu_screen.json (100%) diff --git a/data/mods/Defense_Mode/dialogue/TALK_DM_MERCHANT.json b/data/mods/Defense_Mode/dialogue/TALK_DM_MERCHANT.json new file mode 100644 index 0000000000000..9150643237ccf --- /dev/null +++ b/data/mods/Defense_Mode/dialogue/TALK_DM_MERCHANT.json @@ -0,0 +1,67 @@ +[ + { + "type": "talk_topic", + "id": "TALK_DM_MERCHANT", + "dynamic_line": "Nice to see you again. Would you like to buy something, hire someone, or somethin' else?", + "responses": [ + { + "text": "I'll buy something.", + "topic": "TALK_DM_MERCHANT_2", + "effect": [ { "run_eocs": "defense_mode_money_add_npc" }, "start_trade" ] + }, + { "text": "What'll it cost me to get some help around here?", "topic": "TALK_DM_MERCHANT_HIRE_COST" }, + { + "text": "I'd like to hire some help.", + "topic": "TALK_DM_MERCHANT_2", + "effect": [ + { "u_buy_item": "mercenary_contract", "cost": 50000, "true_eocs": "defense_mode_hire_merc_true" }, + { "run_eocs": "defense_mode_money_add_npc" } + ] + }, + { "text": "Nevermind, I don't want anything.", "topic": "TALK_DONE" } + ] + }, + { + "type": "talk_topic", + "id": "TALK_DM_MERCHANT_HIRE_COST", + "dynamic_line": "It's usually $500. You can pay me up front in either goods or money, then we'll talk.", + "responses": [ + { + "text": "I'll buy something.", + "topic": "TALK_DM_MERCHANT_2", + "effect": [ { "run_eocs": "defense_mode_money_add_npc" }, "start_trade" ] + }, + { + "text": "I'd like to hire some help.", + "topic": "TALK_DM_MERCHANT_2", + "effect": [ + { "u_buy_item": "mercenary_contract", "cost": 50000, "true_eocs": "defense_mode_hire_merc_true" }, + { "run_eocs": "defense_mode_money_add_npc" } + ] + }, + { "text": "Nevermind, I don't want anything.", "topic": "TALK_DONE" } + ] + }, + { + "type": "talk_topic", + "id": "TALK_DM_MERCHANT_2", + "dynamic_line": "Anything else I can do for you?", + "responses": [ + { + "text": "I'll buy something.", + "topic": "TALK_DM_MERCHANT_2", + "effect": [ { "run_eocs": "defense_mode_money_add_npc" }, "start_trade" ] + }, + { "text": "What'll it cost me to get some help around here?", "topic": "TALK_DM_MERCHANT_HIRE_COST" }, + { + "text": "I'd like to hire some help.", + "topic": "TALK_DM_MERCHANT_2", + "effect": [ + { "u_buy_item": "mercenary_contract", "cost": 50000, "true_eocs": "defense_mode_hire_merc_true" }, + { "run_eocs": "defense_mode_money_add_npc" } + ] + }, + { "text": "Nevermind, I don't want anything.", "topic": "TALK_DONE" } + ] + } +] diff --git a/data/mods/Defense_Mode/dialogue/TALK_WANDERING_SURVIVOR.json b/data/mods/Defense_Mode/dialogue/TALK_WANDERING_SURVIVOR.json new file mode 100644 index 0000000000000..ec42b6f37cf6b --- /dev/null +++ b/data/mods/Defense_Mode/dialogue/TALK_WANDERING_SURVIVOR.json @@ -0,0 +1,82 @@ +[ + { + "type": "talk_topic", + "id": "TALK_NPC_DEFENSE_WANDERER", + "dynamic_line": { + "npc_has_var": "knows_u", + "type": "dialogue", + "context": "first_meeting", + "value": "yes", + "yes": "", + "no": "Freeze you !" + }, + "speaker_effect": { "effect": { "npc_add_var": "knows_u", "type": "dialogue", "context": "first_meeting", "value": "yes" } }, + "responses": [ + { + "text": "&Hold up your hands. \"Don't worry, I'm not going to hurt you\"", + "topic": "TALK_NPC_DEFENSE_WANDERER_CALM", + "condition": { "not": { "npc_has_var": "knows_u", "type": "dialogue", "context": "first_meeting", "value": "yes" } } + }, + { + "text": "Hand over your stuff! Don't make any sudden moves, or you die!", + "trial": { "type": "INTIMIDATE", "difficulty": 30 }, + "success": { "topic": "TALK_WEAPON_DROPPED", "effect": "drop_weapon", "opinion": { "trust": -4, "fear": 3 } }, + "failure": { "topic": "TALK_DONE", "effect": "hostile" }, + "condition": { "not": { "npc_has_var": "knows_u", "type": "dialogue", "context": "first_meeting", "value": "yes" } } + }, + { + "text": "Nice to see you.", + "topic": "TALK_NPC_DEFENSE_WANDERER_INTRO", + "condition": { "npc_has_var": "knows_u", "type": "dialogue", "context": "first_meeting", "value": "yes" } + }, + { "text": "Bye.", "topic": "TALK_DONE" } + ] + }, + { + "type": "talk_topic", + "id": "TALK_NPC_DEFENSE_WANDERER_CALM", + "dynamic_line": "Oh, you're not one of the . I'm glad to see another survivor out here, such a relief.", + "responses": [ + { "text": "Alright, let's chat.", "topic": "TALK_NPC_DEFENSE_WANDERER_INTRO" }, + { "text": "I'll be back later.", "topic": "TALK_DONE" } + ] + }, + { + "type": "talk_topic", + "id": "TALK_NPC_DEFENSE_WANDERER_INTRO", + "dynamic_line": [ "What's up?", "What do you need?", "What can I do for you?" ], + "responses": [ + { "text": "What are you doing out here in the sticks?", "topic": "TALK_NPC_DEFENSE_WANDERER_STORY" }, + { "text": "Care to trade?", "topic": "TALK_NPC_DEFENSE_WANDERER_INTRO", "effect": "start_trade" }, + { + "text": "Why don't you come with me, maybe we can hold out here?", + "trial": { "type": "PERSUADE", "difficulty": -35, "mod": [ [ "value", 2 ] ] }, + "success": { "topic": "TALK_AGREE_FOLLOW", "effect": "follow", "opinion": { "trust": 1, "value": 1 } }, + "failure": { "topic": "TALK_DENY_FOLLOW", "effect": "deny_follow", "opinion": { "trust": 0, "fear": 0 } } + }, + { "text": "I gotta go.", "topic": "TALK_DONE" } + ] + }, + { + "type": "talk_topic", + "id": "TALK_NPC_DEFENSE_WANDERER_STORY", + "dynamic_line": "I can't remember, actually. I have a fague sense of being in my house, asleep, before I woke up in the middle of a field. I have this strange feeling that something's after me, keep seeing things out in the woods, so I had to keep moving.", + "//": "Potential lore? This could be a good mystery.", + "responses": [ + { "text": "Seems like a hard life.", "topic": "TALK_NPC_DEFENSE_WANDERER_INTRO" }, + { "text": "Where'd you get all your stuff at?", "topic": "TALK_NPC_DEFENSE_WANDERER_STUFF" }, + { + "text": "I guess we're both in a similar predicament, then. Why not team up with me? We can hold out together and try to stay alive.", + "trial": { "type": "PERSUADE", "difficulty": -35, "mod": [ [ "value", 2 ] ] }, + "success": { "topic": "TALK_AGREE_FOLLOW", "effect": "follow", "opinion": { "trust": 1, "value": 1 } }, + "failure": { "topic": "TALK_DENY_FOLLOW", "effect": "deny_follow", "opinion": { "trust": 0, "fear": 0 } } + } + ] + }, + { + "type": "talk_topic", + "id": "TALK_NPC_DEFENSE_WANDERER_STUFF", + "dynamic_line": "I just found it near where I woke up at. Who's it was and where it came from I have no idea, but I couldn't find anyone else around, and it seemed like it'd all been left there for someone to pick up.", + "responses": [ { "text": "Makes sense.", "topic": "TALK_NPC_DEFENSE_WANDERER_INTRO" } ] + } +] diff --git a/data/mods/Defense_Mode/menu_screen.json b/data/mods/Defense_Mode/dialogue/menu_screen.json similarity index 100% rename from data/mods/Defense_Mode/menu_screen.json rename to data/mods/Defense_Mode/dialogue/menu_screen.json index d8141869ddfa5..47291c447077c 100644 --- a/data/mods/Defense_Mode/menu_screen.json +++ b/data/mods/Defense_Mode/dialogue/menu_screen.json @@ -16,12 +16,12 @@ { "math": [ "triffids_allowed", "==", "1" ] }, { "math": [ "robots_allowed", "==", "1" ] }, { "math": [ "subspace_allowed", "==", "1" ] }, - { "math": [ "megafauna_allowed", "==", "1" ] }, { "math": [ "dinos_allowed", "==", "1" ] }, { "math": [ "lizardfolk_allowed", "==", "1" ] }, { "math": [ "goblins_allowed", "==", "1" ] }, { "math": [ "golems_allowed", "==", "1" ] }, { "math": [ "orcs_allowed", "==", "1" ] }, + { "math": [ "megafauna_allowed", "==", "1" ] }, { "math": [ "mindovermatter_allowed", "==", "1" ] }, { "math": [ "candymonsters_allowed", "==", "1" ] }, { "math": [ "mythos_allowed", "==", "1" ] } @@ -96,18 +96,6 @@ "effect": { "math": [ "robots_allowed", "=", "0" ] }, "topic": "TALK_DEFENSE_MODE_ENEMY_SELECTION" }, - { - "text": "Allow megafauna.", - "condition": { "and": [ { "mod_is_loaded": "megafauna" }, { "math": [ "megafauna_allowed", "==", "0" ] } ] }, - "effect": { "math": [ "megafauna_allowed", "=", "1" ] }, - "topic": "TALK_DEFENSE_MODE_ENEMY_SELECTION" - }, - { - "text": "Disable megafauna.", - "condition": { "and": [ { "mod_is_loaded": "megafauna" }, { "math": [ "megafauna_allowed", "==", "1" ] } ] }, - "effect": { "math": [ "megafauna_allowed", "=", "0" ] }, - "topic": "TALK_DEFENSE_MODE_ENEMY_SELECTION" - }, { "text": "Allow eldritch horrors.", "condition": { "math": [ "subspace_allowed", "==", "0" ] }, @@ -181,17 +169,15 @@ "topic": "TALK_DEFENSE_MODE_ENEMY_SELECTION" }, { - "text": "Mgah'ehye ya nyth'drnn.", - "//": "Allow my servants.", - "condition": { "and": [ { "mod_is_loaded": "Mythos-Creatures" }, { "math": [ "mythos_allowed", "==", "0" ] } ] }, - "effect": { "math": [ "mythos_allowed", "=", "1" ] }, + "text": "Allow megafauna.", + "condition": { "and": [ { "mod_is_loaded": "megafauna" }, { "math": [ "megafauna_allowed", "==", "0" ] } ] }, + "effect": { "math": [ "megafauna_allowed", "=", "1" ] }, "topic": "TALK_DEFENSE_MODE_ENEMY_SELECTION" }, { - "text": "Mgah ya nyth'drnn.", - "//": "Stop my servants.", - "condition": { "and": [ { "mod_is_loaded": "Mythos-Creatures" }, { "math": [ "mythos_allowed", "==", "1" ] } ] }, - "effect": { "math": [ "mythos_allowed", "=", "0" ] }, + "text": "Disable megafauna.", + "condition": { "and": [ { "mod_is_loaded": "megafauna" }, { "math": [ "megafauna_allowed", "==", "1" ] } ] }, + "effect": { "math": [ "megafauna_allowed", "=", "0" ] }, "topic": "TALK_DEFENSE_MODE_ENEMY_SELECTION" }, { @@ -218,6 +204,20 @@ "effect": { "math": [ "candymonsters_allowed", "=", "0" ] }, "topic": "TALK_DEFENSE_MODE_ENEMY_SELECTION" }, + { + "text": "Mgah'ehye ya nyth'drnn.", + "//": "Allow my servants.", + "condition": { "and": [ { "mod_is_loaded": "Mythos-Creatures" }, { "math": [ "mythos_allowed", "==", "0" ] } ] }, + "effect": { "math": [ "mythos_allowed", "=", "1" ] }, + "topic": "TALK_DEFENSE_MODE_ENEMY_SELECTION" + }, + { + "text": "Mgah ya nyth'drnn.", + "//": "Stop my servants.", + "condition": { "and": [ { "mod_is_loaded": "Mythos-Creatures" }, { "math": [ "mythos_allowed", "==", "1" ] } ] }, + "effect": { "math": [ "mythos_allowed", "=", "0" ] }, + "topic": "TALK_DEFENSE_MODE_ENEMY_SELECTION" + }, { "text": "Play!", "condition": { @@ -228,12 +228,12 @@ { "math": [ "triffids_allowed", "==", "1" ] }, { "math": [ "robots_allowed", "==", "1" ] }, { "math": [ "subspace_allowed", "==", "1" ] }, - { "math": [ "megafauna_allowed", "==", "1" ] }, { "math": [ "dinos_allowed", "==", "1" ] }, { "math": [ "lizardfolk_allowed", "==", "1" ] }, { "math": [ "goblins_allowed", "==", "1" ] }, { "math": [ "golems_allowed", "==", "1" ] }, { "math": [ "orcs_allowed", "==", "1" ] }, + { "math": [ "megafauna_allowed", "==", "1" ] }, { "math": [ "mindovermatter_allowed", "==", "1" ] }, { "math": [ "candymonsters_allowed", "==", "1" ] }, { "math": [ "mythos_allowed", "==", "1" ] } diff --git a/data/mods/Defense_Mode/eocs.json b/data/mods/Defense_Mode/eocs.json index 910233ae8561c..86a5963e7bee9 100644 --- a/data/mods/Defense_Mode/eocs.json +++ b/data/mods/Defense_Mode/eocs.json @@ -3,6 +3,7 @@ "type": "effect_on_condition", "id": "scenario_defense_mode", "eoc_type": "SCENARIO_SPECIFIC", + "deactivate_condition": { "compare_num": [ { "global_val": "var", "var_name": "wave_number" }, ">=", { "const": 1 } ] }, "effect": [ { "open_dialogue": { "topic": "TALK_DEFENSE_MODE_MAIN_MENU" } }, { "u_message": "Get ready for the first wave, it's not that far away!", "type": "good", "popup": true }, @@ -20,7 +21,6 @@ "id": "defense_mode_caravan_spawn", "recurrence": [ "2 days", "4 days" ], "global": true, - "condition": { "math": [ "u_monsters_nearby('radius': u_search_radius == 3)", "<=", "0" ] }, "effect": [ { "u_spawn_npc": "defense_mode_merchant", "lifespan": "2 hours", "real_count": 1, "min_radius": 2, "max_radius": 3 }, { "u_message": "A caravan approaches!", "type": "good", "popup": false } @@ -300,6 +300,7 @@ "type": "effect_on_condition", "id": "DEFENSE_MODE_FORTRESS_TRAP", "//": "Keeps you from running away from your hideout.", + "global": true, "recurrence": 10, "condition": { "or": [ @@ -314,5 +315,44 @@ { "u_message": "You can't leave your fortress behind!", "type": "bad", "popup": false }, { "u_teleport": { "global_val": "your_spawnpoint" } } ] + }, + { + "type": "effect_on_condition", + "id": "DEFENSE_MODE_RANDOM_EVENT", + "recurrence": [ "2 days", "4 days" ], + "//": "A general EOC for selecting a random event. Can and should be expanded.", + "condition": { "and": [ { "not": { "is_weather": "portal_storm" } }, { "x_in_y_chance": { "x": 7, "y": 10 } } ] }, + "effect": [ + { + "weighted_list_eocs": [ + [ "EOC_DEFENSE_MODE_RANDOM_NPC", { "const": 10 } ], + [ "EOC_DEFENSE_MODE_RANDOM_NPC_ROBBER", { "const": 6 } ], + [ "EOC_DEFENSE_MODE_BANDIT_ATTACK", { "const": 1 } ] + ] + } + ] + }, + { + "type": "effect_on_condition", + "id": "EOC_DEFENSE_MODE_RANDOM_NPC", + "effect": [ { "u_spawn_npc": "random_survivor", "outdoor_only": true, "real_count": 1, "min_radius": 15, "max_radius": 40 } ] + }, + { + "type": "effect_on_condition", + "id": "EOC_DEFENSE_MODE_RANDOM_NPC_ROBBER", + "effect": [ + { + "u_spawn_npc": "random_survivor_nefarious", + "outdoor_only": true, + "real_count": 1, + "min_radius": 15, + "max_radius": 40 + } + ] + }, + { + "type": "effect_on_condition", + "id": "EOC_DEFENSE_MODE_BANDIT_ATTACK", + "effect": [ { "u_spawn_npc": "defense_mode_raider", "outdoor_only": true, "real_count": 5, "min_radius": 15, "max_radius": 25 } ] } ] diff --git a/data/mods/Defense_Mode/monsters.json b/data/mods/Defense_Mode/monsters.json index 77019300e66e6..9bc5bb765c96b 100644 --- a/data/mods/Defense_Mode/monsters.json +++ b/data/mods/Defense_Mode/monsters.json @@ -2,6 +2,7 @@ { "id": "mon_zombie_nemesis", "copy-from": "mon_zombie", + "looks_like": "mon_zombie", "type": "MONSTER", "vision_day": 99, "vision_night": 99, diff --git a/data/mods/Defense_Mode/npcs.json b/data/mods/Defense_Mode/npcs.json index c5a62fb547bfa..96f3422ba0796 100644 --- a/data/mods/Defense_Mode/npcs.json +++ b/data/mods/Defense_Mode/npcs.json @@ -74,69 +74,33 @@ "faction": "your_followers" }, { - "type": "talk_topic", - "id": "TALK_DM_MERCHANT", - "dynamic_line": "Nice to see you again. Would you like to buy something, hire someone, or somethin' else?", - "responses": [ - { - "text": "I'll buy something.", - "topic": "TALK_DM_MERCHANT_2", - "effect": [ { "run_eocs": "defense_mode_money_add_npc" }, "start_trade" ] - }, - { "text": "What'll it cost me to get some help around here?", "topic": "TALK_DM_MERCHANT_HIRE_COST" }, - { - "text": "I'd like to hire some help.", - "topic": "TALK_DM_MERCHANT_2", - "effect": [ - { "u_buy_item": "mercenary_contract", "cost": 50000, "true_eocs": "defense_mode_hire_merc_true" }, - { "run_eocs": "defense_mode_money_add_npc" } - ] - }, - { "text": "Nevermind, I don't want anything.", "topic": "TALK_DONE" } - ] + "type": "npc", + "id": "random_survivor", + "class": "NC_SCAVENGER", + "attitude": 1, + "mission": 0, + "chat": "TALK_NPC_DEFENSE_WANDERER", + "faction": "no_faction" }, { - "type": "talk_topic", - "id": "TALK_DM_MERCHANT_HIRE_COST", - "dynamic_line": "It's usually $500. You can pay me up front in either goods or money, then we'll talk.", - "responses": [ - { - "text": "I'll buy something.", - "topic": "TALK_DM_MERCHANT_2", - "effect": [ { "run_eocs": "defense_mode_money_add_npc" }, "start_trade" ] - }, - { - "text": "I'd like to hire some help.", - "topic": "TALK_DM_MERCHANT_2", - "effect": [ - { "u_buy_item": "mercenary_contract", "cost": 50000, "true_eocs": "defense_mode_hire_merc_true" }, - { "run_eocs": "defense_mode_money_add_npc" } - ] - }, - { "text": "Nevermind, I don't want anything.", "topic": "TALK_DONE" } - ] + "type": "npc", + "id": "random_survivor_nefarious", + "class": "NC_SCAVENGER", + "attitude": 1, + "mission": 0, + "chat": "TALK_MUG", + "faction": "no_faction" }, { - "type": "talk_topic", - "id": "TALK_DM_MERCHANT_2", - "dynamic_line": "Anything else I can do for you?", - "responses": [ - { - "text": "I'll buy something.", - "topic": "TALK_DM_MERCHANT_2", - "effect": [ { "run_eocs": "defense_mode_money_add_npc" }, "start_trade" ] - }, - { "text": "What'll it cost me to get some help around here?", "topic": "TALK_DM_MERCHANT_HIRE_COST" }, - { - "text": "I'd like to hire some help.", - "topic": "TALK_DM_MERCHANT_2", - "effect": [ - { "u_buy_item": "mercenary_contract", "cost": 50000, "true_eocs": "defense_mode_hire_merc_true" }, - { "run_eocs": "defense_mode_money_add_npc" } - ] - }, - { "text": "Nevermind, I don't want anything.", "topic": "TALK_DONE" } - ] + "type": "npc", + "id": "defense_mode_raider", + "//": "Despite being similar to most other bandits, these are made to attack head-on.", + "name_suffix": "raider", + "class": "NC_SCAVENGER", + "attitude": 10, + "mission": 0, + "chat": "TALK_DONE", + "faction": "hells_raiders" }, { "type": "npc", @@ -161,6 +125,21 @@ "bonus_str": 10000, "worn_override": "NC_DM_MERCHANT_worn", "carry_override": "NC_DM_MERCHANT_carry", + "shopkeeper_price_rules": [ + { "group": "NC_DM_MERCHANT_stock", "markup": 2.5 }, + { "group": "zombie_humanoid", "fixed_adj": -2.5 }, + { "group": "human", "fixed_adj": -2.5 }, + { "group": "arachnid", "fixed_adj": -2.5 }, + { "group": "triffid_paralytic", "fixed_adj": -2.5 }, + { "group": "default_zombie_death_drops", "fixed_adj": -0.5 }, + { "group": "mon_zombie_cop_death_drops", "fixed_adj": -0.5 }, + { "group": "mon_zombie_fireman_death_drops", "fixed_adj": -0.5 }, + { "group": "mon_zombie_hazmat_death_drops", "fixed_adj": -0.5 }, + { "group": "mon_zombie_swat_death_drops", "fixed_adj": -0.5 }, + { "group": "mon_zombie_resort_dancer_death_drops", "fixed_adj": -0.5 }, + { "group": "mon_zombie_resort_bouncer_death_drops", "fixed_adj": -0.5 }, + { "group": "mon_zombie_resort_staff_death_drops", "fixed_adj": -0.5 } + ], "traits": [ [ "DEBUG_FLIMSY", 100 ], [ "DEBUG_FLIMSY2", 100 ], [ "DEBUG_NOSCENT", 100 ], [ "DEBUG_SILENT", 100 ] ] }, {