Skip to content

Commit

Permalink
Add more things to Defense Mode (#67894)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
MNG-cataclysm and github-actions[bot] authored Aug 26, 2023
1 parent ae4082e commit ef57fb4
Show file tree
Hide file tree
Showing 6 changed files with 251 additions and 82 deletions.
67 changes: 67 additions & 0 deletions data/mods/Defense_Mode/dialogue/TALK_DM_MERCHANT.json
Original file line number Diff line number Diff line change
@@ -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" }
]
}
]
82 changes: 82 additions & 0 deletions data/mods/Defense_Mode/dialogue/TALK_WANDERING_SURVIVOR.json
Original file line number Diff line number Diff line change
@@ -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": "<greet>",
"no": "Freeze you <swear> <zombies>!"
},
"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 <zombies>. 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" } ]
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -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" ] }
Expand Down Expand Up @@ -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" ] },
Expand Down Expand Up @@ -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"
},
{
Expand All @@ -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": {
Expand All @@ -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" ] }
Expand Down
42 changes: 41 additions & 1 deletion data/mods/Defense_Mode/eocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand All @@ -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 }
Expand Down Expand Up @@ -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": [
Expand All @@ -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 } ]
}
]
1 change: 1 addition & 0 deletions data/mods/Defense_Mode/monsters.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"id": "mon_zombie_nemesis",
"copy-from": "mon_zombie",
"looks_like": "mon_zombie",
"type": "MONSTER",
"vision_day": 99,
"vision_night": 99,
Expand Down
Loading

0 comments on commit ef57fb4

Please sign in to comment.