Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow u/npc_spawn_monster to pick randomly from a group for count > 1 #71019

Merged
merged 17 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 27 additions & 30 deletions data/json/effects_on_condition/npc_eocs/hallucination_eocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,25 +175,30 @@
"type": "effect_on_condition",
"id": "creature_hallucinations",
"//TODO": "ideally checks is the tile visible, and then spawns hallu where player can't see it",
"//": "if monsters are nearby, 3/4 chance to get copy of random monster nearby and run again (with 1/2 prob) and 1/4 chance to spawns one of YOUR_FEARS. If not, spawns one of YOUR_FEARS",
"//": "If monsters are nearby, 3/4 chance to spawn some hallucinations of random monsters nearby and run again half the time, 1/4 chance to spawn some of YOUR_FEARS. If not, spawns some of YOUR_FEARS",
"condition": { "and": [ { "math": [ "rand(3)", "<", "3" ] }, { "math": [ "u_monsters_nearby()", ">", "0" ] } ] },
"effect": [
{
"if": { "and": [ { "math": [ "rand(3)", "==", "3" ] }, { "not": { "math": [ "u_monsters_nearby()", ">", "1" ] } } ] },
"then": {
"u_spawn_monster": "GROUP_YOUR_FEARS",
"group": true,
"hallucination_count": { "math": [ "1 + rand(2)" ] },
"max_radius": 40,
"lifespan": [ "1 hours", "4 hours" ]
},
"else": {
"u_spawn_monster": "",
"hallucination_count": { "math": [ "1 + rand(4)" ] },
"target_range": 50,
"lifespan": [ "2 hours", "9 hours" ]
}
}
]
"u_spawn_monster": "",
"hallucination_count": { "math": [ "1 + rand(4)" ] },
"target_range": 50,
"lifespan": [ "2 hours", "9 hours" ]
},
{ "weighted_list_eocs": [ [ "creature_hallucinations", 1 ], [ "EOC_NONE", 1 ] ] }
],
"false_effect": { "run_eocs": "creature_hallucinations_fears" }
},
{
"type": "effect_on_condition",
"id": "creature_hallucinations_fears",
"//TODO": "ideally checks is the tile visible, and then spawns hallu where player can't see it",
"effect": {
"u_spawn_monster": "GROUP_YOUR_FEARS",
"group": true,
"hallucination_count": { "math": [ "1 + rand(2)" ] },
"max_radius": 40,
"lifespan": [ "1 hours", "4 hours" ]
}
},
{
"type": "effect_on_condition",
Expand All @@ -209,19 +214,11 @@
"condition": { "math": [ "u_monsters_nearby()", ">", "1" ] },
"effect": [
{
"if": { "math": [ "u_i", "<", "rng(50, 100)" ] },
"then": [
{
"u_spawn_monster": "",
"hallucination_count": 1,
"target_range": 50,
"max_radius": 50,
"lifespan": [ "2 hours", "9 hours" ]
},
{ "math": [ "u_i", "++" ] },
{ "run_eocs": "hallucination_swarm" }
],
"else": { "math": [ "u_i", "=", "0" ] }
"u_spawn_monster": "",
"hallucination_count": [ 50, 100 ],
Procyonae marked this conversation as resolved.
Show resolved Hide resolved
"target_range": 50,
"max_radius": 50,
"lifespan": [ "2 hours", "9 hours" ]
}
]
}
Expand Down
21 changes: 2 additions & 19 deletions data/json/effects_on_condition/scenario_specific_eocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,30 +131,13 @@
"type": "effect_on_condition",
"id": "scenario_surrounded_zombie",
"eoc_type": "SCENARIO_SPECIFIC",
"effect": [
{ "u_spawn_monster": "GROUP_ZOMBIE", "group": true, "real_count": 1, "min_radius": 12, "max_radius": 20 },
{ "u_spawn_monster": "GROUP_ZOMBIE", "group": true, "real_count": 1, "min_radius": 12, "max_radius": 20 },
{ "u_spawn_monster": "GROUP_ZOMBIE", "group": true, "real_count": 1, "min_radius": 15, "max_radius": 22 },
{ "u_spawn_monster": "GROUP_ZOMBIE", "group": true, "real_count": 1, "min_radius": 15, "max_radius": 22 },
{ "u_spawn_monster": "GROUP_ZOMBIE", "group": true, "real_count": 1, "min_radius": 18, "max_radius": 30 }
]
"effect": [ { "u_spawn_monster": "GROUP_ZOMBIE", "group": true, "real_count": 5, "min_radius": 12, "max_radius": 30 } ]
},
{
"type": "effect_on_condition",
"id": "scenario_surrounded_zombie_heavy",
"eoc_type": "SCENARIO_SPECIFIC",
"effect": [
{ "u_spawn_monster": "GROUP_ZOMBIE", "group": true, "real_count": 1, "min_radius": 14, "max_radius": 20 },
{ "u_spawn_monster": "GROUP_ZOMBIE", "group": true, "real_count": 1, "min_radius": 14, "max_radius": 20 },
{ "u_spawn_monster": "GROUP_ZOMBIE", "group": true, "real_count": 1, "min_radius": 14, "max_radius": 20 },
{ "u_spawn_monster": "GROUP_ZOMBIE", "group": true, "real_count": 1, "min_radius": 14, "max_radius": 20 },
{ "u_spawn_monster": "GROUP_ZOMBIE", "group": true, "real_count": 1, "min_radius": 18, "max_radius": 25 },
{ "u_spawn_monster": "GROUP_ZOMBIE", "group": true, "real_count": 1, "min_radius": 18, "max_radius": 25 },
{ "u_spawn_monster": "GROUP_ZOMBIE", "group": true, "real_count": 1, "min_radius": 18, "max_radius": 25 },
{ "u_spawn_monster": "GROUP_ZOMBIE", "group": true, "real_count": 1, "min_radius": 18, "max_radius": 25 },
{ "u_spawn_monster": "GROUP_ZOMBIE", "group": true, "real_count": 1, "min_radius": 20, "max_radius": 30 },
{ "u_spawn_monster": "GROUP_ZOMBIE", "group": true, "real_count": 1, "min_radius": 20, "max_radius": 30 }
]
"effect": [ { "u_spawn_monster": "GROUP_ZOMBIE", "group": true, "real_count": 10, "min_radius": 14, "max_radius": 30 } ]
},
{
"type": "effect_on_condition",
Expand Down
5 changes: 2 additions & 3 deletions data/json/monsters/zed_lieutenant.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,8 @@
{
"u_spawn_monster": "GROUP_AMALGAMATIONS_SPAWNED",
"group": true,
"//": "This always spawns 6 of the same type, which is not ideal (6 soldiers is way too deadly). Consider revising the weights if/when talk_effect_fun_t::set_spawn_monster can pick each individual spawn from the group.",
"real_count": 6,
"//2": "The maximum lifespan should not be terribly longer than the cooldown(currently 20 seconds), or else multiple groups can be active at once and make this much harder than desired.",
"//": "The maximum lifespan should not be terribly longer than the cooldown(currently 20 seconds), or else multiple groups can be active at once and make this much harder than desired.",
"lifespan": [ "15 seconds", "30 seconds" ],
"target_var": { "global_val": "drain_terrain" }
},
Expand Down Expand Up @@ -307,7 +306,7 @@
"name": "GROUP_AMALGAMATIONS_SPAWNED",
"type": "monstergroup",
"monsters": [
{ "monster": "mon_amalgamation_swarmer", "weight": 20 },
{ "monster": "mon_amalgamation_swarmer", "weight": 10 },
{ "monster": "mon_amalgamation_corroder", "weight": 4 },
{ "monster": "mon_amalgamation_soldier", "weight": 1 }
]
Expand Down
162 changes: 9 additions & 153 deletions data/mods/Defense_Mode/effects_on_condition/wave_eocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,7 @@
"effect": [
{
"u_spawn_monster": "GROUP_VANILLA_ONLY_HUMANS",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_VANILLA_ONLY_HUMANS",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_VANILLA_ONLY_HUMANS",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"real_count": { "math": [ "wave_spawn_number() * 3" ], "default": 3 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
Expand All @@ -109,23 +93,7 @@
"effect": [
{
"u_spawn_monster": "GROUP_ZOMBIE",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_ZOMBIE",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_ZOMBIE",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"real_count": { "math": [ "wave_spawn_number() * 3" ], "default": 3 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
Expand All @@ -141,23 +109,7 @@
"effect": [
{
"u_spawn_monster": "GROUP_SPIDER_DM",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_SPIDER_DM",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_SPIDER_DM",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"real_count": { "math": [ "wave_spawn_number() * 3" ], "default": 3 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
Expand All @@ -173,23 +125,7 @@
"effect": [
{
"u_spawn_monster": "GROUP_ROBOT_DM",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_ROBOT_DM",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_ROBOT_DM",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"real_count": { "math": [ "wave_spawn_number() * 3" ], "default": 3 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
Expand All @@ -205,23 +141,7 @@
"effect": [
{
"u_spawn_monster": "GROUP_TRIFFID_DM",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_TRIFFID_DM",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_TRIFFID_DM",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"real_count": { "math": [ "wave_spawn_number() * 3" ], "default": 3 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
Expand All @@ -237,23 +157,7 @@
"effect": [
{
"u_spawn_monster": "GROUP_NETHER_DM",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_NETHER_DM",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_NETHER_DM",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"real_count": { "math": [ "wave_spawn_number() * 3" ], "default": 3 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
Expand All @@ -269,23 +173,7 @@
"effect": [
{
"u_spawn_monster": "GROUP_FERAL",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_FERAL",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_FERAL",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"real_count": { "math": [ "wave_spawn_number() * 3" ], "default": 3 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
Expand All @@ -305,23 +193,7 @@
"effect": [
{
"u_spawn_monster": "GROUP_RATKIN_EVOLVED",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_RATKIN_EVOLVED",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_RATKIN_EVOLVED",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"real_count": { "math": [ "wave_spawn_number() * 3" ], "default": 3 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
Expand All @@ -341,23 +213,7 @@
"effect": [
{
"u_spawn_monster": "GROUP_MIL_HELIPAD",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_MIL_HELIPAD",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "GROUP_MIL_HELIPAD",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"real_count": { "math": [ "wave_spawn_number() * 3" ], "default": 3 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
Expand Down
18 changes: 1 addition & 17 deletions data/mods/Defense_Mode/mod_interactions/Aftershock/eocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,7 @@
"effect": [
{
"u_spawn_monster": "AFS_GROUP_DM",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "AFS_GROUP_DM",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
"max_radius": 40
},
{
"u_spawn_monster": "AFS_GROUP_DM",
"real_count": { "math": [ "wave_spawn_number()" ], "default": 1 },
"real_count": { "math": [ "wave_spawn_number() * 3" ], "default": 3 },
"outdoor_only": true,
"group": true,
"min_radius": 20,
Expand Down
Loading
Loading