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

Unify all run_eocs in a single eoc function #77000

Merged
merged 11 commits into from
Oct 25, 2024
2 changes: 1 addition & 1 deletion data/mods/Perk_melee/EOC/shared_eocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
{
"run_eoc_until": "EOC_PERK_TRY_RETREAT",
"condition": { "math": [ "u_monsters_nearby('radius': 1)", ">", "0" ] },
"iteration": 10
"iterations": 10
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion data/mods/Perk_melee/martial_arts.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
{
"run_eoc_until": "EOC_PERK_TRY_RETREAT",
"condition": { "math": [ "u_monsters_nearby('radius': 1)", ">", "0" ] },
"iteration": 10
"iterations": 10
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion data/mods/TEST_DATA/EOC.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
{
"run_eoc_until": "EOC_until_nested",
"condition": { "math": [ "u_context", "<", "10000" ] },
"iteration": 10000
"iterations": 10000
}
]
},
Expand Down
139 changes: 139 additions & 0 deletions data/mods/TEST_DATA/effect_on_condition.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,144 @@
"type": "ter_furn_transform",
"id": "test_dirt_transform",
"terrain": [ { "result": [ "t_grass" ], "valid_terrain": [ "t_dirt" ] } ]
},
{
"type": "effect_on_condition",
"id": "run_eocs_1",
"//": "run_eocs_1 should be 2",
"effect": [ { "run_eocs": [ "EOC_A", "EOC_B" ] } ]
},
{
"type": "effect_on_condition",
"id": "EOC_A",
"effect": [ { "math": [ "run_eocs_1", "++" ] } ]
},
{
"type": "effect_on_condition",
"id": "EOC_B",
"effect": [ { "math": [ "run_eocs_1", "++" ] } ]
},
{
"type": "effect_on_condition",
"id": "run_eocs_2",
"//": "run_eocs_2 should be 20",
"effect": [ { "run_eocs": [ "EOC_C", "EOC_D" ], "iterations": 10 } ]
},
{
"type": "effect_on_condition",
"id": "EOC_C",
"effect": [ { "math": [ "run_eocs_2", "++" ] } ]
},
{
"type": "effect_on_condition",
"id": "EOC_D",
"effect": [ { "math": [ "run_eocs_2", "++" ] } ]
},
{
"type": "effect_on_condition",
"id": "run_eocs_3",
"//": "in 5 seconds, run_eocs_3 should be 2 - 2 eocs would be fired in 2 seconds",
"effect": [ { "run_eocs": [ "EOC_E", "EOC_F" ], "time_in_future": "2 seconds" } ]
},
{
"type": "effect_on_condition",
"id": "EOC_E",
"effect": [ { "math": [ "run_eocs_3", "++" ] } ]
},
{
"type": "effect_on_condition",
"id": "EOC_F",
"effect": [ { "math": [ "run_eocs_3", "++" ] } ]
},
{
"type": "effect_on_condition",
"id": "run_eocs_4",
"//": "in 2 seconds, run_eocs_4 should be 10 - we shove 10 eocs to run in two seconds",
"effect": [ { "run_eocs": [ "EOC_G", "EOC_H" ], "time_in_future": "2 seconds", "iterations": 5 } ]
},
{
"type": "effect_on_condition",
"id": "EOC_G",
"effect": [ { "math": [ "run_eocs_4", "++" ] } ]
},
{
"type": "effect_on_condition",
"id": "EOC_H",
"effect": [ { "math": [ "run_eocs_4", "++" ] } ]
},
{
"type": "effect_on_condition",
"id": "run_eocs_5",
"//": "run_eocs_5 should be 4 - we run eocs until run_eocs_5 would be 4",
"effect": [ { "run_eocs": [ "EOC_I", "EOC_J" ], "condition": { "math": [ "run_eocs_5 <= 3" ] } } ]
},
{
"type": "effect_on_condition",
"id": "EOC_I",
"effect": [ { "math": [ "run_eocs_5", "++" ] } ]
},
{
"type": "effect_on_condition",
"id": "EOC_J",
"effect": [ { "math": [ "run_eocs_5", "++" ] } ]
},
{
"type": "effect_on_condition",
"id": "run_eocs_6",
"//": "in 10 seconds, run_eocs_6 should be 10 - two eocs would be randomly fired for 10 seconds",
"effect": [
{
"run_eocs": [ "EOC_K", "EOC_L" ],
"time_in_future": [ "0 seconds", "10 seconds" ],
"randomize_time_in_future": true,
"iterations": 5
}
]
},
{
"type": "effect_on_condition",
"id": "EOC_K",
"effect": [ { "math": [ "run_eocs_6", "++" ] } ]
},
{
"type": "effect_on_condition",
"id": "EOC_L",
"effect": [ { "math": [ "run_eocs_6", "++" ] } ]
},
{
"type": "effect_on_condition",
"id": "run_eocs_7",
"//": "in 10 seconds, run_eocs_7 should be 10, 'test_global_key_M' should contain 'test_context_value_M', and 'test_global_key_N' should contain 'test_context_value_N'",
"effect": [
{
"run_eocs": [ "EOC_M", "EOC_N" ],
"time_in_future": [ "0 seconds", "10 seconds" ],
"randomize_time_in_future": true,
"iterations": 5,
"variables": { "test_context_key_M": "test_context_value_M", "test_context_key_N": "test_context_value_N" }
}
]
},
{
"type": "effect_on_condition",
"id": "EOC_M",
"effect": [
{ "math": [ "run_eocs_7", "++" ] },
{
"set_string_var": { "context_val": "test_context_key_M" },
"target_var": { "global_val": "test_global_key_M" }
}
]
},
{
"type": "effect_on_condition",
"id": "EOC_N",
"effect": [
{ "math": [ "run_eocs_7", "++" ] },
{
"set_string_var": { "context_val": "test_context_key_N" },
"target_var": { "global_val": "test_global_key_N" }
}
]
}
]
4 changes: 2 additions & 2 deletions data/mods/Xedra_Evolved/eocs/spell_learning_eoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@
"effect": [
{
"if": { "math": [ "xe_eater_leveling", ">", "0" ] },
"then": [ { "run_eocs": "EOC_PICK_SPELL_EATER", "repeat": { "global_val": "xe_eater_leveling" } } ]
"then": [ { "run_eocs": "EOC_PICK_SPELL_EATER", "iterations": { "global_val": "xe_eater_leveling" } } ]
},
{
"if": { "math": [ "xe_dreamer_leveling", ">", "0" ] },
"then": [ { "run_eocs": "EOC_PICK_SPELL_DREAMER", "repeat": { "global_val": "xe_dreamer_leveling" } } ]
"then": [ { "run_eocs": "EOC_PICK_SPELL_DREAMER", "iterations": { "global_val": "xe_dreamer_leveling" } } ]
}
]
},
Expand Down
Loading
Loading