Skip to content

Commit

Permalink
Merge pull request #77661 from GuardianDll/one_eoc_to_rule_them_all
Browse files Browse the repository at this point in the history
Unify all run_eocs in single function [2/2]
  • Loading branch information
Maleclypse authored Nov 13, 2024
2 parents c7c024a + 80e8545 commit f51474b
Show file tree
Hide file tree
Showing 132 changed files with 836 additions and 906 deletions.
4 changes: 2 additions & 2 deletions data/json/effects_on_condition/bionic_active_eocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"effect": [
{ "u_message": "Your muscles hiss as hydraulic strength fills them!", "type": "good" },
{ "u_make_sound": "HISISSS!", "volume": 19, "type": "activity" },
{ "queue_eocs": "EOC_bio_hydraulics_act", "time_in_future": 1 }
{ "run_eocs": "EOC_bio_hydraulics_act", "time_in_future": 1 }
]
},
{
Expand All @@ -58,7 +58,7 @@
"//": "Sound of hissing hydraulic muscle! (not quite as loud as a car horn)",
"effect": [
{ "u_make_sound": "HISISSS!", "volume": 19, "type": "activity" },
{ "queue_eocs": "EOC_bio_hydraulics_act", "time_in_future": 1 }
{ "run_eocs": "EOC_bio_hydraulics_act", "time_in_future": 1 }
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions data/json/effects_on_condition/dream_eocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{ "u_message": "nightmares", "snippet": true, "type": "bad" },
{ "u_add_morale": "morale_nightmare", "bonus": [ -15, -30 ], "max_bonus": -30 },
{ "math": [ "dream_counter", "=", "1" ] },
{ "queue_eocs": "EOC_RESET_DREAM_COUNTER", "time_in_future": 1 }
{ "run_eocs": "EOC_RESET_DREAM_COUNTER", "time_in_future": 1 }
]
},
{
Expand Down Expand Up @@ -50,7 +50,7 @@
]
},
{ "math": [ "dream_counter", "=", "1" ] },
{ "queue_eocs": "EOC_RESET_DREAM_COUNTER", "time_in_future": 1 }
{ "run_eocs": "EOC_RESET_DREAM_COUNTER", "time_in_future": 1 }
]
}
]
8 changes: 4 additions & 4 deletions data/json/effects_on_condition/example_eocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@
{
"if": { "u_query_tile": "anywhere", "target_var": { "global_val": "loc" }, "message": "Select point" },
"then": {
"run_eoc_with": { "id": "EOC_teleport_test_other_do", "effect": { "npc_teleport": { "global_val": "teleport_test_pos" } } },
"run_eocs": { "id": "EOC_teleport_test_other_do", "effect": { "npc_teleport": { "global_val": "teleport_test_pos" } } },
"beta_loc": { "global_val": "loc" },
"false_eocs": { "id": "EOC_teleport_test_other_do_fail_msg", "effect": { "message": "Please select a creature." } }
},
Expand Down Expand Up @@ -469,7 +469,7 @@
{
"if": { "u_query_tile": "anywhere", "target_var": { "global_val": "loc" }, "message": "Select point" },
"then": {
"run_eoc_with": {
"run_eocs": {
"id": "_EOC_control_npc_do",
"effect": [ { "if": "npc_is_npc", "then": [ "follow", "take_control" ], "else": { "message": "Please select a NPC." } } ]
},
Expand All @@ -485,7 +485,7 @@
"id": "EOC_return_to_player",
"effect": [
{
"run_eoc_with": { "id": "_EOC_return_to_player_do", "effect": [ "follow", "take_control" ] },
"run_eocs": { "id": "_EOC_return_to_player_do", "effect": [ "follow", "take_control" ] },
"alpha_talker": "avatar",
"beta_talker": { "global_val": "player_id" },
"false_eocs": { "id": "_EOC_return_to_player_fail_msg", "effect": { "message": "Unable to locate your original body." } }
Expand All @@ -497,7 +497,7 @@
"id": "EOC_null_talker_test",
"effect": [
{
"run_eoc_with": { "id": "_EOC_hello_world_msg", "effect": { "message": "hello world" } },
"run_eocs": { "id": "_EOC_hello_world_msg", "effect": { "message": "hello world" } },
"alpha_talker": "",
"beta_talker": "",
"false_eocs": { "id": "_EOC_null_talker_msg", "effect": { "message": "Constructed a EOC with no talkers!" } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
{ "math": [ "_serum_duration", "=", "rng(time('1 d'), time('2 d'))" ] },
{ "u_add_effect": "regen_serum_main", "duration": { "context_val": "serum_duration" } },
{ "u_add_effect": "regen_serum_crash_cardio", "duration": { "math": [ "_serum_duration * rng(1.5, 2.5)" ] } },
{ "queue_eocs": "EOC_APPLY_REGEN_SERUM_CRASH", "time_in_future": { "context_val": "serum_duration" } },
{ "queue_eocs": "EOC_REGEN_SERUM_PAIN_SPIKE", "time_in_future": [ "1 h", "6 h" ] },
{ "queue_eocs": "EOC_REGEN_SERUM_MUT_REJECTION", "time_in_future": [ "1 h", "6 h" ] }
{ "run_eocs": "EOC_APPLY_REGEN_SERUM_CRASH", "time_in_future": { "context_val": "serum_duration" } },
{ "run_eocs": "EOC_REGEN_SERUM_PAIN_SPIKE", "time_in_future": [ "1 h", "6 h" ] },
{ "run_eocs": "EOC_REGEN_SERUM_MUT_REJECTION", "time_in_future": [ "1 h", "6 h" ] }
]
},
{
Expand All @@ -32,7 +32,7 @@
"effect": [
{ "u_message": "You feel an immense pain, when something within your bloodstream moves eerily.", "type": "bad" },
{ "math": [ "u_pain('type': 'perceived')", "+=", "rng(15, 55)" ] },
{ "queue_eocs": "EOC_REGEN_SERUM_PAIN_SPIKE", "time_in_future": [ "1 h", "6 h" ] }
{ "run_eocs": "EOC_REGEN_SERUM_PAIN_SPIKE", "time_in_future": [ "1 h", "6 h" ] }
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
{
"if": { "compare_string": [ "your_followers", { "context_val": "new_owner" } ] },
"then": {
"queue_eocs": {
"run_eocs": {
"id": "EOC_camp_rumor_spread",
"effect": { "u_message": "Rumors of your takeover of <context_val:camp_name> have begun to spread…", "type": "mixed" }
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"id": "EOC_BIOLUM3_activated",
"effect": [
{
"run_eoc_with": "EOC_GENERIC_SPELL_MUTATION",
"run_eocs": "EOC_GENERIC_SPELL_MUTATION",
"variables": {
"prep_time": "3",
"spell_to_cast": "spell_spit_flare",
Expand All @@ -50,7 +50,7 @@
"id": "EOC_SLIME_SPRAY",
"effect": [
{
"run_eoc_with": "EOC_GENERIC_SPELL_MUTATION",
"run_eocs": "EOC_GENERIC_SPELL_MUTATION",
"variables": {
"prep_time": "1",
"spell_to_cast": "spell_slime_spray",
Expand All @@ -65,7 +65,7 @@
"id": "EOC_FELINE_LEAP",
"effect": [
{
"run_eoc_with": "EOC_GENERIC_SPELL_MUTATION",
"run_eocs": "EOC_GENERIC_SPELL_MUTATION",
"variables": {
"energy_amount": "2000",
"prep_time": "1",
Expand All @@ -84,7 +84,7 @@
"id": "EOC_SHORT_LEAP",
"effect": [
{
"run_eoc_with": "EOC_GENERIC_SPELL_MUTATION",
"run_eocs": "EOC_GENERIC_SPELL_MUTATION",
"variables": {
"energy_amount": "2000",
"prep_time": "2",
Expand All @@ -103,7 +103,7 @@
"id": "EOC_CRUSHING_LEAP",
"effect": [
{
"run_eoc_with": "EOC_GENERIC_SPELL_MUTATION",
"run_eocs": "EOC_GENERIC_SPELL_MUTATION",
"variables": {
"energy_amount": "6000",
"prep_time": "3",
Expand All @@ -119,7 +119,7 @@
"id": "EOC_AVIAN_LEAP",
"effect": [
{
"run_eoc_with": "EOC_GENERIC_SPELL_MUTATION",
"run_eocs": "EOC_GENERIC_SPELL_MUTATION",
"variables": {
"energy_amount": "2500",
"prep_time": "1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
"eoc_type": "EVENT",
"required_event": "loses_mutation",
"condition": { "and": [ { "compare_string": [ "BEAK", { "context_val": "trait" } ] } ] },
"effect": { "queue_eocs": "EOC_MUTE_BEAK_LOSE_2", "time_in_future": 1 }
"effect": { "run_eocs": "EOC_MUTE_BEAK_LOSE_2", "time_in_future": 1 }
},
{
"type": "effect_on_condition",
Expand Down Expand Up @@ -194,7 +194,7 @@
{ "compare_string": [ "GASTROPOD_EXTREMITY3", { "context_val": "trait" } ] }
]
},
"effect": [ { "queue_eocs": "EOC_MUTE_GASTROPOD_LOSE_2", "time_in_future": 1 } ]
"effect": [ { "run_eocs": "EOC_MUTE_GASTROPOD_LOSE_2", "time_in_future": 1 } ]
},
{
"type": "effect_on_condition",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2051,7 +2051,7 @@
"type": "effect_on_condition",
"id": "EOC_LIXA_unfold_return",
"effect": [
{ "queue_eocs": "EOC_LIXA_unfold_spawn_goodbye_cards", "time_in_future": "0 seconds" },
{ "run_eocs": "EOC_LIXA_unfold_spawn_goodbye_cards", "time_in_future": "0 seconds" },
{ "alter_timed_events": "LIXA_escape_key" },
{ "u_lose_effect": "LIXA_unfolded_eff" },
{ "mapgen_update": "turn_off_LIXA", "target_var": { "global_val": "LIXA_chamber_1" } },
Expand Down Expand Up @@ -2079,7 +2079,7 @@
{
"switch": { "math": [ "u_LIXA_unfold_level" ] },
"cases": [
{ "case": 0, "effect": { "queue_eocs": "EOC_LIXA_unfold_shift_0", "time_in_future": "2 seconds" } },
{ "case": 0, "effect": { "run_eocs": "EOC_LIXA_unfold_shift_0", "time_in_future": "2 seconds" } },
{
"case": 1,
"effect": {
Expand All @@ -2089,7 +2089,7 @@
"effect": [
{ "mapgen_update": "cleanup_LIXA", "target_var": { "global_val": "LIXA_unfold_A" } },
{ "mapgen_update": "cleanup_LIXA", "target_var": { "global_val": "LIXA_unfold_B" } },
{ "queue_eocs": "EOC_LIXA_unfold_shift_1", "time_in_future": "2 seconds" }
{ "run_eocs": "EOC_LIXA_unfold_shift_1", "time_in_future": "2 seconds" }
]
}
]
Expand All @@ -2104,7 +2104,7 @@
"effect": [
{ "mapgen_update": "cleanup_LIXA", "target_var": { "global_val": "LIXA_unfold_A" } },
{ "mapgen_update": "cleanup_LIXA", "target_var": { "global_val": "LIXA_unfold_B" } },
{ "queue_eocs": "EOC_LIXA_unfold_shift_2", "time_in_future": "2 seconds" }
{ "run_eocs": "EOC_LIXA_unfold_shift_2", "time_in_future": "2 seconds" }
]
}
]
Expand All @@ -2119,7 +2119,7 @@
"effect": [
{ "mapgen_update": "cleanup_LIXA", "target_var": { "global_val": "LIXA_unfold_A" } },
{ "mapgen_update": "cleanup_LIXA", "target_var": { "global_val": "LIXA_unfold_B" } },
{ "queue_eocs": "EOC_LIXA_unfold_shift_3", "time_in_future": "2 seconds" }
{ "run_eocs": "EOC_LIXA_unfold_shift_3", "time_in_future": "2 seconds" }
]
}
]
Expand All @@ -2134,7 +2134,7 @@
"effect": [
{ "mapgen_update": "cleanup_LIXA", "target_var": { "global_val": "LIXA_unfold_A" } },
{ "mapgen_update": "cleanup_LIXA", "target_var": { "global_val": "LIXA_unfold_B" } },
{ "queue_eocs": "EOC_LIXA_unfold_shift_4", "time_in_future": "2 seconds" }
{ "run_eocs": "EOC_LIXA_unfold_shift_4", "time_in_future": "2 seconds" }
]
}
]
Expand All @@ -2149,7 +2149,7 @@
"effect": [
{ "mapgen_update": "cleanup_LIXA", "target_var": { "global_val": "LIXA_unfold_A" } },
{ "mapgen_update": "cleanup_LIXA", "target_var": { "global_val": "LIXA_unfold_B" } },
{ "queue_eocs": "EOC_LIXA_unfold_shift_5", "time_in_future": "2 seconds" }
{ "run_eocs": "EOC_LIXA_unfold_shift_5", "time_in_future": "2 seconds" }
]
}
]
Expand All @@ -2164,7 +2164,7 @@
"effect": [
{ "mapgen_update": "cleanup_LIXA", "target_var": { "global_val": "LIXA_unfold_A" } },
{ "mapgen_update": "cleanup_LIXA", "target_var": { "global_val": "LIXA_unfold_B" } },
{ "queue_eocs": "EOC_LIXA_unfold_shift_6", "time_in_future": "2 seconds" }
{ "run_eocs": "EOC_LIXA_unfold_shift_6", "time_in_future": "2 seconds" }
]
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
"effect": [
{ "u_message": "You suddenly feel feeble. Your muscles wobble.", "type": "bad" },
{ "u_add_effect": "pd_str_bad", "duration": "50 minutes" },
{ "queue_eocs": "EOC_PORTAL_DEPENDENT_MESSAGES_STR_BAD", "time_in_future": [ "10 minutes", "40 minutes" ] }
{ "run_eocs": "EOC_PORTAL_DEPENDENT_MESSAGES_STR_BAD", "time_in_future": [ "10 minutes", "40 minutes" ] }
]
},
{
Expand All @@ -310,7 +310,7 @@
"effect": [
{ "u_message": "You suddenly feel a sharp pain in your hand. You reach out to grab it, and miss.", "type": "bad" },
{ "u_add_effect": "pd_dex_bad", "duration": "50 minutes" },
{ "queue_eocs": "EOC_PORTAL_DEPENDENT_MESSAGES_DEX_BAD", "time_in_future": [ "10 minutes", "40 minutes" ] }
{ "run_eocs": "EOC_PORTAL_DEPENDENT_MESSAGES_DEX_BAD", "time_in_future": [ "10 minutes", "40 minutes" ] }
]
},
{
Expand All @@ -321,7 +321,7 @@
"effect": [
{ "u_message": "You blink one time, and everything seems bigger.", "type": "bad" },
{ "u_add_effect": "pd_per_bad", "duration": "50 minutes" },
{ "queue_eocs": "EOC_PORTAL_DEPENDENT_MESSAGES_PER_BAD", "time_in_future": [ "10 minutes", "40 minutes" ] }
{ "run_eocs": "EOC_PORTAL_DEPENDENT_MESSAGES_PER_BAD", "time_in_future": [ "10 minutes", "40 minutes" ] }
]
},
{
Expand All @@ -332,7 +332,7 @@
"effect": [
{ "u_message": "You stop to think, but you can't seem to remember about what.", "type": "bad" },
{ "u_add_effect": "pd_int_bad", "duration": "50 minutes" },
{ "queue_eocs": "EOC_PORTAL_DEPENDENT_MESSAGES_INT_BAD", "time_in_future": [ "10 minutes", "40 minutes" ] }
{ "run_eocs": "EOC_PORTAL_DEPENDENT_MESSAGES_INT_BAD", "time_in_future": [ "10 minutes", "40 minutes" ] }
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
},
{ "math": [ "cause_early_portal_storm", "=", "1" ] },
"next_weather",
{ "queue_eocs": "EOC_CAUSE_PORTAL_STORM", "time_in_future": [ "30 seconds", "1 minutes" ] },
{ "run_eocs": "EOC_CAUSE_PORTAL_STORM", "time_in_future": [ "30 seconds", "1 minutes" ] },
{ "assign_mission": "MISSION_INVESTIGATE_PORTAL_STORM_CENTER" },
{
"u_message": "You suddenly register a buzzing in your senses. It's getting louder, and your head starts to throb. Somewhere nearby, a tiny cataclysm has begun (check mission log for details).",
Expand Down Expand Up @@ -208,7 +208,7 @@
"target_var": { "global_val": "portal_storm_voice_mood" }
},
{
"queue_eocs": "EOC_CANCEL_PORTAL_STORM",
"run_eocs": "EOC_CANCEL_PORTAL_STORM",
"time_in_future": [
{ "global_val": "ps_min_length", "default": "15 minutes" },
{ "global_val": "ps_max_length", "default": "30 minutes" }
Expand Down Expand Up @@ -703,7 +703,7 @@
},
"effect": [
{ "u_teleport": { "u_val": "stuck_teleport" }, "success_message": "You feel an intense sense of deja vu." },
{ "queue_eocs": "EOC_PORTAL_TELEPORT_STUCK_LOOP", "time_in_future": [ "3 seconds", "5 seconds" ] }
{ "run_eocs": "EOC_PORTAL_TELEPORT_STUCK_LOOP", "time_in_future": [ "3 seconds", "5 seconds" ] }
]
},
{
Expand Down Expand Up @@ -907,7 +907,7 @@
{ "mapgen_update": "portal_cell", "target_var": { "global_val": "cell_loc" } },
{ "u_teleport": { "global_val": "cell_start" }, "fail_message": "that sucks" },
{
"queue_eocs": {
"run_eocs": {
"id": "EOC_PORTAL_STORM_CELL_TELEPORT",
"effect": [
{ "math": [ "u_in_portal_cell", "=", "0" ] },
Expand Down Expand Up @@ -968,7 +968,7 @@
{ "u_teleport": { "global_val": "dungeon_start" }, "fail_message": "Something is very wrong!", "force": true },
{ "math": [ "portal_dungeon_level", "=", "1" ] },
{ "math": [ "visited_a_portal_dungeon", "=", "1" ] },
{ "queue_eocs": "EOC_PORTAL_STORM_DUNGEON_SHIFT", "time_in_future": [ "5 seconds", "15 seconds" ] },
{ "run_eocs": "EOC_PORTAL_STORM_DUNGEON_SHIFT", "time_in_future": [ "5 seconds", "15 seconds" ] },
{ "run_eocs": [ "EOC_PORTAL_STORM_DUNGEON_REFLECTION_SPAWN" ] },
{ "u_message": "You are trapped in <global_val:place_name>!" },
{ "u_message": { "global_val": "portal_storm_voice_mood", "default_str": "none" }, "snippet": true }
Expand All @@ -993,7 +993,7 @@
"condition": { "math": [ "portal_dungeon_level", ">", "0" ] },
"effect": [
{ "mapgen_update": "portal_dungeon", "target_var": { "global_val": "dungeon_loc" } },
{ "queue_eocs": "EOC_PORTAL_STORM_DUNGEON_SHIFT", "time_in_future": [ "5 seconds", "15 seconds" ] }
{ "run_eocs": "EOC_PORTAL_STORM_DUNGEON_SHIFT", "time_in_future": [ "5 seconds", "15 seconds" ] }
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
{
"type": "effect_on_condition",
"id": "EOC_queue_vitrified_int_drain",
"effect": { "queue_eocs": "EOC_vitrified_int_drain", "time_in_future": "1 seconds" }
"effect": { "run_eocs": "EOC_vitrified_int_drain", "time_in_future": "1 seconds" }
},
{
"type": "effect_on_condition",
Expand All @@ -294,7 +294,7 @@
"id": "EOC_queue_unvitrified_return",
"condition": { "math": [ "u_back_from_vitri_glass", "<", "1" ] },
"effect": [
{ "queue_eocs": "EOC_unvitrified_return", "time_in_future": "1 seconds" },
{ "run_eocs": "EOC_unvitrified_return", "time_in_future": "1 seconds" },
{ "math": [ "u_back_from_vitri_glass", "=", "1" ] }
]
},
Expand Down
Loading

0 comments on commit f51474b

Please sign in to comment.