Skip to content

Commit

Permalink
Add some mod compatibility to Defense Mode (CleverRaven#67656)
Browse files Browse the repository at this point in the history
* Add everything

* Apply suggestions from code review

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Move some stuff to Magiclysm

* Move a file to Magiclysm

---------

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 17, 2023
1 parent 73e0659 commit 1aa594c
Show file tree
Hide file tree
Showing 10 changed files with 470 additions and 6 deletions.
15 changes: 12 additions & 3 deletions data/mods/Defense_Mode/eocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
{ "u_message": "Get ready for the first wave, it's not that far away!", "type": "good", "popup": true },
{
"u_location_variable": { "global_val": "your_spawnpoint" },
"terrain": "t_floor",
"target_max_radius": 2,
"min_radius": 0,
"max_radius": 0
Expand Down Expand Up @@ -70,7 +69,12 @@
[ "DEFENSE_MODE_WAVE_SPAWN_SPIDERS", { "const": 1 } ],
[ "DEFENSE_MODE_WAVE_SPAWN_ROBOTS", { "const": 1 } ],
[ "DEFENSE_MODE_WAVE_SPAWN_TRIFFIDS", { "const": 1 } ],
[ "DEFENSE_MODE_WAVE_SPAWN_SUBSPACE", { "const": 1 } ]
[ "DEFENSE_MODE_WAVE_SPAWN_SUBSPACE", { "const": 1 } ],
[ "DEFENSE_MODE_WAVE_SPAWN_DINOS", { "const": 1 } ],
[ "DEFENSE_MODE_WAVE_SPAWN_LIZARDFOLK", { "const": 1 } ],
[ "DEFENSE_MODE_WAVE_SPAWN_GOLEMS", { "const": 1 } ],
[ "DEFENSE_MODE_WAVE_SPAWN_GOBLINS", { "const": 1 } ],
[ "DEFENSE_MODE_WAVE_SPAWN_ORCS", { "const": 1 } ]
]
}
]
Expand All @@ -87,7 +91,12 @@
[ "DEFENSE_MODE_WAVE_SPAWN_SPIDERS", { "const": 1 } ],
[ "DEFENSE_MODE_WAVE_SPAWN_ROBOTS", { "const": 1 } ],
[ "DEFENSE_MODE_WAVE_SPAWN_TRIFFIDS", { "const": 1 } ],
[ "DEFENSE_MODE_WAVE_SPAWN_SUBSPACE", { "const": 1 } ]
[ "DEFENSE_MODE_WAVE_SPAWN_SUBSPACE", { "const": 1 } ],
[ "DEFENSE_MODE_WAVE_SPAWN_DINOS", { "const": 1 } ],
[ "DEFENSE_MODE_WAVE_SPAWN_LIZARDFOLK", { "const": 1 } ],
[ "DEFENSE_MODE_WAVE_SPAWN_GOLEMS", { "const": 1 } ],
[ "DEFENSE_MODE_WAVE_SPAWN_GOBLINS", { "const": 1 } ],
[ "DEFENSE_MODE_WAVE_SPAWN_ORCS", { "const": 1 } ]
]
}
]
Expand Down
74 changes: 72 additions & 2 deletions data/mods/Defense_Mode/menu_screen.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
{ "math": [ "spiders_allowed", "==", "1" ] },
{ "math": [ "triffids_allowed", "==", "1" ] },
{ "math": [ "robots_allowed", "==", "1" ] },
{ "math": [ "subspace_allowed", "==", "1" ] }
{ "math": [ "subspace_allowed", "==", "1" ] },
{ "math": [ "dinos_allowed", "==", "1" ] },
{ "math": [ "lizardfolk_allowed", "==", "1" ] },
{ "math": [ "goblins_allowed", "==", "1" ] },
{ "math": [ "golems_allowed", "==", "1" ] },
{ "math": [ "orcs_allowed", "==", "1" ] }
]
},
"topic": "TALK_DONE"
Expand Down Expand Up @@ -99,6 +104,66 @@
"effect": { "math": [ "subspace_allowed", "=", "0" ] },
"topic": "TALK_DEFENSE_MODE_ENEMY_SELECTION"
},
{
"text": "Allow dinosaurs.",
"condition": { "and": [ { "mod_is_loaded": "DinoMod" }, { "math": [ "dinos_allowed", "==", "0" ] } ] },
"effect": { "math": [ "dinos_allowed", "=", "1" ] },
"topic": "TALK_DEFENSE_MODE_ENEMY_SELECTION"
},
{
"text": "Disable dinosaurs.",
"condition": { "and": [ { "mod_is_loaded": "DinoMod" }, { "math": [ "dinos_allowed", "==", "1" ] } ] },
"effect": { "math": [ "dinos_allowed", "=", "0" ] },
"topic": "TALK_DEFENSE_MODE_ENEMY_SELECTION"
},
{
"text": "Allow lizardfolk.",
"condition": { "and": [ { "mod_is_loaded": "magiclysm" }, { "math": [ "lizardfolk_allowed", "==", "0" ] } ] },
"effect": { "math": [ "lizardfolk_allowed", "=", "1" ] },
"topic": "TALK_DEFENSE_MODE_ENEMY_SELECTION"
},
{
"text": "Disable lizardfolk.",
"condition": { "and": [ { "mod_is_loaded": "magiclysm" }, { "math": [ "lizardfolk_allowed", "==", "1" ] } ] },
"effect": { "math": [ "lizardfolk_allowed", "=", "0" ] },
"topic": "TALK_DEFENSE_MODE_ENEMY_SELECTION"
},
{
"text": "Allow golems.",
"condition": { "and": [ { "mod_is_loaded": "magiclysm" }, { "math": [ "golems_allowed", "==", "0" ] } ] },
"effect": { "math": [ "golems_allowed", "=", "1" ] },
"topic": "TALK_DEFENSE_MODE_ENEMY_SELECTION"
},
{
"text": "Disable golems.",
"condition": { "and": [ { "mod_is_loaded": "magiclysm" }, { "math": [ "golems_allowed", "==", "1" ] } ] },
"effect": { "math": [ "golems_allowed", "=", "0" ] },
"topic": "TALK_DEFENSE_MODE_ENEMY_SELECTION"
},
{
"text": "Allow goblins.",
"condition": { "and": [ { "mod_is_loaded": "magiclysm" }, { "math": [ "goblins_allowed", "==", "0" ] } ] },
"effect": { "math": [ "goblins_allowed", "=", "1" ] },
"topic": "TALK_DEFENSE_MODE_ENEMY_SELECTION"
},
{
"text": "Disable goblins.",
"condition": { "and": [ { "mod_is_loaded": "magiclysm" }, { "math": [ "goblins_allowed", "==", "1" ] } ] },
"effect": { "math": [ "goblins_allowed", "=", "0" ] },
"topic": "TALK_DEFENSE_MODE_ENEMY_SELECTION"
},
{
"text": "Allow orcs.",
"condition": { "and": [ { "mod_is_loaded": "magiclysm" }, { "math": [ "orcs_allowed", "==", "0" ] } ] },
"effect": { "math": [ "orcs_allowed", "=", "1" ] },
"topic": "TALK_DEFENSE_MODE_ENEMY_SELECTION"
},
{
"text": "Disable orcs.",
"condition": { "and": [ { "mod_is_loaded": "magiclysm" }, { "math": [ "orcs_allowed", "==", "1" ] } ] },
"effect": { "math": [ "orcs_allowed", "=", "0" ] },
"topic": "TALK_DEFENSE_MODE_ENEMY_SELECTION"
},
{
"text": "Play!",
"condition": {
Expand All @@ -108,7 +173,12 @@
{ "math": [ "spiders_allowed", "==", "1" ] },
{ "math": [ "triffids_allowed", "==", "1" ] },
{ "math": [ "robots_allowed", "==", "1" ] },
{ "math": [ "subspace_allowed", "==", "1" ] }
{ "math": [ "subspace_allowed", "==", "1" ] },
{ "math": [ "dinos_allowed", "==", "1" ] },
{ "math": [ "lizardfolk_allowed", "==", "1" ] },
{ "math": [ "goblins_allowed", "==", "1" ] },
{ "math": [ "golems_allowed", "==", "1" ] },
{ "math": [ "orcs_allowed", "==", "1" ] }
]
},
"topic": "TALK_DONE"
Expand Down
34 changes: 34 additions & 0 deletions data/mods/Defense_Mode/mod_interactions/DinoMod/eocs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"type": "effect_on_condition",
"id": "DEFENSE_MODE_WAVE_SPAWN_DINOS",
"condition": { "math": [ "dinos_allowed", "==", "1" ] },
"effect": [
{
"u_spawn_monster": "GROUP_DINOSAUR_DANGEROUS",
"real_count": { "global_val": "wave_number", "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_DINOSAUR_DANGEROUS",
"real_count": { "global_val": "wave_number", "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_DINOSAUR_DANGEROUS",
"real_count": { "global_val": "wave_number", "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
}
],
"false_effect": { "run_eocs": "DEFENSE_MODE_WAVE_SPAWN_FALLBACK" }
}
]
10 changes: 10 additions & 0 deletions data/mods/Defense_Mode/mod_interactions/DinoMod/species.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"type": "SPECIES",
"id": "DINOSAUR",
"fear_triggers": [ "FIRE" ],
"flags": [ "ALL_SEEING", "NEMESIS" ],
"bleeds": "fd_blood",
"description": "a dinosaur"
}
]
130 changes: 130 additions & 0 deletions data/mods/Defense_Mode/mod_interactions/Magiclysm/eocs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
[
{
"type": "effect_on_condition",
"id": "DEFENSE_MODE_WAVE_SPAWN_LIZARDFOLK",
"condition": { "math": [ "lizardfolk_allowed", "==", "1" ] },
"effect": [
{
"u_spawn_monster": "GROUP_LIZARDFOLK_DM",
"real_count": { "global_val": "wave_number", "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_LIZARDFOLK_DM",
"real_count": { "global_val": "wave_number", "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_LIZARDFOLK_DM",
"real_count": { "global_val": "wave_number", "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
}
],
"false_effect": { "run_eocs": "DEFENSE_MODE_WAVE_SPAWN_FALLBACK" }
},
{
"type": "effect_on_condition",
"id": "DEFENSE_MODE_WAVE_SPAWN_GOLEMS",
"condition": { "math": [ "golems_allowed", "==", "1" ] },
"effect": [
{
"u_spawn_monster": "GROUP_GOLEM_DM",
"real_count": { "global_val": "wave_number", "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_GOLEM_DM",
"real_count": { "global_val": "wave_number", "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_GOLEM_DM",
"real_count": { "global_val": "wave_number", "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
}
],
"false_effect": { "run_eocs": "DEFENSE_MODE_WAVE_SPAWN_FALLBACK" }
},
{
"type": "effect_on_condition",
"id": "DEFENSE_MODE_WAVE_SPAWN_GOBLINS",
"condition": { "math": [ "goblins_allowed", "==", "1" ] },
"effect": [
{
"u_spawn_monster": "GROUP_GOBLIN_STANDARD",
"real_count": { "global_val": "wave_number", "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_GOBLIN_STANDARD",
"real_count": { "global_val": "wave_number", "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_GOBLIN_STANDARD",
"real_count": { "global_val": "wave_number", "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
}
],
"false_effect": { "run_eocs": "DEFENSE_MODE_WAVE_SPAWN_FALLBACK" }
},
{
"type": "effect_on_condition",
"id": "DEFENSE_MODE_WAVE_SPAWN_ORCS",
"condition": { "math": [ "orcs_allowed", "==", "1" ] },
"effect": [
{
"u_spawn_monster": "GROUP_ORC_DM",
"real_count": { "global_val": "wave_number", "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_ORC_DM",
"real_count": { "global_val": "wave_number", "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_ORC_DM",
"real_count": { "global_val": "wave_number", "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
}
],
"false_effect": { "run_eocs": "DEFENSE_MODE_WAVE_SPAWN_FALLBACK" }
}
]
1 change: 1 addition & 0 deletions data/mods/Defense_Mode/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"description": "You do not know who you are, nor do you know why you're here. All you know is that you must fight and defend yourself from the horde.",
"allowed_locs": [ "bar", "hospital", "public_works", "megastore", "mansion" ],
"eoc": [ "scenario_defense_mode" ],
"forced_traits": [ "HAS_NEMESIS" ],
"flags": [ "LONE_START" ],
"start_name": "Holdout",
"reveal_locale": false
Expand Down
8 changes: 7 additions & 1 deletion data/mods/Defense_Mode/species.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "SPECIES",
"id": "SPIDER",
"description": "a spider",
"//": "Adding the ALL_SEEING flag lets monsters track your position without fancy C++ stuff.",
"//": "Adding the ALL_SEEING and NEMESIS flags lets monsters track your position without fancy C++ stuff.",
"anger_triggers": [ "FRIEND_DIED" ],
"fear_triggers": [ "HURT", "FIRE" ],
"flags": [ "ALL_SEEING", "NEMESIS" ],
Expand Down Expand Up @@ -47,5 +47,11 @@
"description": "a creature from the mi-go homeworld",
"flags": [ "ALL_SEEING", "NEMESIS" ],
"fear_triggers": [ "HURT" ]
},
{
"type": "SPECIES",
"id": "NETHER",
"flags": [ "ALL_SEEING", "NEMESIS" ],
"description": "a nether creature"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[
{
"type": "monstergroup",
"name": "GROUP_LIZARDFOLK_DM",
"monsters": [
{ "monster": "mon_lizardfolk_warrior_dm", "weight": 900 },
{ "monster": "mon_lizardfolk_warrior_dm", "weight": 20, "pack_size": [ 2, 4 ] },
{ "monster": "mon_lizardfolk_hunter_dm", "weight": 30, "cost_multiplier": 4, "pack_size": [ 1, 2 ] },
{ "monster": "mon_lizardfolk_shaman_dm", "weight": 10, "cost_multiplier": 30 },
{ "monster": "mon_lizardfolk_chieftan_dm", "weight": 10, "cost_multiplier": 50 }
]
},
{
"type": "monstergroup",
"name": "GROUP_GOLEM_DM",
"monsters": [
{ "monster": "mon_plasticgolem_dm", "weight": 965 },
{ "monster": "mon_claygolem_dm", "weight": 20 },
{ "monster": "mon_stonegolem_dm", "weight": 10 },
{ "monster": "mon_irongolem_dm", "weight": 5 }
]
},
{
"type": "monstergroup",
"name": "GROUP_GOBLIN_DM",
"monsters": [
{ "monster": "mon_goblin_warrior_dm", "weight": 900 },
{ "monster": "mon_goblin_warrior_dm", "weight": 35, "pack_size": [ 2, 4 ] },
{ "monster": "mon_goblin_slinger_dm", "weight": 65, "pack_size": [ 2, 4 ] }
]
},
{
"type": "monstergroup",
"name": "GROUP_ORC_DM",
"monsters": [
{ "monster": "mon_orc_warrior_dm", "weight": 960, "cost_multiplier": 5 },
{ "monster": "mon_orc_archer_dm", "weight": 25, "cost_multiplier": 7 },
{ "monster": "mon_orc_blood_warrior_dm", "weight": 15, "cost_multiplier": 5 }
]
}
]
Loading

0 comments on commit 1aa594c

Please sign in to comment.