Skip to content

Commit 043c17c

Browse files
authored
Merge pull request #79448 from CleverRaven/no_unnecessary_eoc_types
remove SCENARIO_SPECIFIC and PROFESSION_SPECIFIC eoc types
2 parents 61bda61 + 3ab8b19 commit 043c17c

File tree

12 files changed

+3
-39
lines changed

12 files changed

+3
-39
lines changed

data/json/effects_on_condition/nether_eocs/portal_storm_effect_on_condition.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,16 @@
22
{
33
"type": "effect_on_condition",
44
"id": "scenario_strong_portal_storm_base",
5-
"eoc_type": "SCENARIO_SPECIFIC",
65
"effect": { "math": [ "ps_base_str = 10" ] }
76
},
87
{
98
"type": "effect_on_condition",
109
"id": "scenario_strong_portal_storm",
11-
"eoc_type": "SCENARIO_SPECIFIC",
1210
"effect": [ { "math": [ "ps_base_str = 15" ] }, { "run_eocs": "EOC_CAUSE_PORTAL_STORM" }, { "math": [ "ps_base_str = 1" ] } ]
1311
},
1412
{
1513
"type": "effect_on_condition",
1614
"id": "scenario_quick_portal_storm",
17-
"eoc_type": "SCENARIO_SPECIFIC",
1815
"effect": [ { "math": [ "ps_min_woc = time(' 1 d')" ] }, { "math": [ "ps_max_woc = time(' 2 d')" ] } ]
1916
},
2017
{

data/json/effects_on_condition/scenario_specific_eocs.json

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{
33
"type": "effect_on_condition",
44
"id": "scenario_bad_day",
5-
"eoc_type": "SCENARIO_SPECIFIC",
65
"effect": [
76
{ "u_add_effect": "flu", "intensity": 1, "duration": "1000 minutes" },
87
{ "u_add_effect": "drunk", "intensity": 1, "duration": "270 minutes" },
@@ -18,7 +17,6 @@
1817
{
1918
"type": "effect_on_condition",
2019
"id": "scenario_infected",
21-
"eoc_type": "SCENARIO_SPECIFIC",
2220
"effect": [
2321
{ "u_add_effect": "infected", "intensity": 1, "duration": "PERMANENT", "target_part": "RANDOM" },
2422
{ "assign_mission": "MISSION_INFECTED_START_FIND_ANTIBIOTICS" }
@@ -27,19 +25,16 @@
2725
{
2826
"type": "effect_on_condition",
2927
"id": "scenario_fungal_infection",
30-
"eoc_type": "SCENARIO_SPECIFIC",
3128
"effect": [ { "u_add_effect": "fungus", "intensity": 1, "duration": "PERMANENT", "target_part": "RANDOM" } ]
3229
},
3330
{
3431
"type": "effect_on_condition",
3532
"id": "scenario_paralyzepoison",
36-
"eoc_type": "SCENARIO_SPECIFIC",
3733
"effect": [ { "u_add_effect": "paralyzepoison", "intensity": 3, "duration": "10 minutes" } ]
3834
},
3935
{
4036
"type": "effect_on_condition",
4137
"id": "scenario_portal_dependent",
42-
"eoc_type": "SCENARIO_SPECIFIC",
4338
"effect": [
4439
{
4540
"run_eocs": [ "EOC_PORTAL_DEPENDENT_MESSAGES_BAD", "EOC_PORTAL_DEPENDENT_FOCUS_BAD", "EOC_PORTAL_DEPENDENT_DAMAGE_CONSTANT" ]
@@ -49,7 +44,6 @@
4944
{
5045
"type": "effect_on_condition",
5146
"id": "scenario_mansion_pursuit",
52-
"eoc_type": "SCENARIO_SPECIFIC",
5347
"//": "EOC_BANISH_MANSION_MONSTERS is not triggering/working at the moment.",
5448
"effect": [
5549
{
@@ -174,7 +168,6 @@
174168
{
175169
"type": "effect_on_condition",
176170
"id": "scenario_assassin_conv",
177-
"eoc_type": "PROFESSION_SPECIFIC",
178171
"//": "Determines which prison the assassin is in currently to correctly place the target.",
179172
"effect": [
180173
{ "if": { "u_near_om_location": "prison_1_5" }, "then": { "assign_mission": "MISSION_ASSASSIN_CONVICT_PRISON" } },
@@ -189,13 +182,11 @@
189182
{
190183
"type": "effect_on_condition",
191184
"id": "faction_camp_start",
192-
"eoc_type": "SCENARIO_SPECIFIC",
193185
"effect": [ { "mapgen_update": "faction_start_add" } ]
194186
},
195187
{
196188
"type": "effect_on_condition",
197189
"id": "scenario_liam",
198-
"eoc_type": "SCENARIO_SPECIFIC",
199190
"effect": [
200191
{ "open_dialogue": { "topic": "TALK_Liam_Introdialogue" } },
201192
{ "mapgen_update": "scenario_spawn_liam", "om_terrain": "cabin_liam" }
@@ -204,19 +195,16 @@
204195
{
205196
"type": "effect_on_condition",
206197
"id": "scenario_surrounded_zombie",
207-
"eoc_type": "SCENARIO_SPECIFIC",
208198
"effect": [ { "u_spawn_monster": "GROUP_ZOMBIE", "group": true, "real_count": 5, "min_radius": 12, "max_radius": 30 } ]
209199
},
210200
{
211201
"type": "effect_on_condition",
212202
"id": "scenario_surrounded_zombie_heavy",
213-
"eoc_type": "SCENARIO_SPECIFIC",
214203
"effect": [ { "u_spawn_monster": "GROUP_ZOMBIE", "group": true, "real_count": 10, "min_radius": 14, "max_radius": 30 } ]
215204
},
216205
{
217206
"type": "effect_on_condition",
218207
"id": "EOC_lone_survivor",
219-
"eoc_type": "SCENARIO_SPECIFIC",
220208
"effect": [
221209
{
222210
"u_message": "They are all dead. The group you were surviving with has been annihilated. Their bodies are still nearby. You are the last one left alive and their screams will haunt you.",
@@ -235,7 +223,6 @@
235223
{
236224
"type": "effect_on_condition",
237225
"id": "EOC_scenario_drunk",
238-
"eoc_type": "SCENARIO_SPECIFIC",
239226
"effect": [
240227
{ "u_add_effect": "drunk", "intensity": 1, "duration": "270 minutes" },
241228
{
@@ -250,7 +237,6 @@
250237
{
251238
"type": "effect_on_condition",
252239
"id": "EOC_scenario_blood",
253-
"eoc_type": "SCENARIO_SPECIFIC",
254240
"effect": [ { "mapgen_update": "SCENARIO_BLOOD" } ]
255241
},
256242
{
@@ -262,7 +248,6 @@
262248
{
263249
"type": "effect_on_condition",
264250
"id": "EOC_scenario_fire",
265-
"eoc_type": "SCENARIO_SPECIFIC",
266251
"effect": [ { "mapgen_update": "SCENARIO_FIRE" } ]
267252
},
268253
{
@@ -274,7 +259,6 @@
274259
{
275260
"type": "effect_on_condition",
276261
"id": "EOC_scenario_smoke",
277-
"eoc_type": "SCENARIO_SPECIFIC",
278262
"effect": [ { "mapgen_update": "SCENARIO_SMOKE" } ]
279263
},
280264
{
@@ -300,7 +284,6 @@
300284
{
301285
"type": "effect_on_condition",
302286
"id": "EOC_scenario_clear_weather",
303-
"eoc_type": "SCENARIO_SPECIFIC",
304287
"effect": [
305288
{ "u_message": "The moon shines brightly." },
306289
{ "math": [ "is_moonlit_scenario = 1" ] },

data/mods/Aftershock/effects_on_condition.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
{
7575
"type": "effect_on_condition",
7676
"id": "EOC_CRASHING_SHIP_SETUP",
77-
"eoc_type": "SCENARIO_SPECIFIC",
7877
"effect": [
7978
{
8079
"u_location_variable": { "global_val": "new_map" },
@@ -102,7 +101,6 @@
102101
{
103102
"type": "effect_on_condition",
104103
"id": "EOC_ESPER_SCENARIO_SETUP",
105-
"eoc_type": "SCENARIO_SPECIFIC",
106104
"effect": [
107105
{ "math": [ "u_hp('head')", "-=", "rand(5)" ] },
108106
{ "math": [ "u_hp('torso')", "-=", "rand(5)" ] },

data/mods/Defense_Mode/effects_on_condition/backend_eocs.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{
33
"type": "effect_on_condition",
44
"id": "scenario_defense_mode",
5-
"eoc_type": "SCENARIO_SPECIFIC",
65
"deactivate_condition": { "math": [ "wave_number >= 1" ] },
76
"effect": [
87
{ "math": [ "diffulty_modifier = 1" ] },

data/mods/Isolation-Protocol/EOC/scenario_init.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{
33
"type": "effect_on_condition",
44
"id": "scenario_fractal_facility",
5-
"eoc_type": "SCENARIO_SPECIFIC",
65
"effect": [ { "math": [ "SAFEPOINT_INTERVAL = 5" ] }, { "math": [ "ISO_CURRENT_LEVEL = 1" ] } ]
76
}
87
]

data/mods/Magiclysm/scenarios.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
{
1616
"type": "effect_on_condition",
1717
"id": "EOC_MAGICLYSM_LOST_FAITH",
18-
"eoc_type": "SCENARIO_SPECIFIC",
1918
"effect": [
2019
{ "u_spawn_item": "priest_beginner", "suppress_message": true },
2120
{ "u_spawn_item": "priest_advanced", "suppress_message": true }

data/mods/Sky_Island/EOCs.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,6 @@
424424
"type": "effect_on_condition",
425425
"id": "scenario_warp_begins",
426426
"//": "This EOC is triggered when the Warper scenario begins. It initializes a few variables, and memorizes your spawn location for resurrection just in case you somehow die before using the warp obelisk. Also learns your spell for emergencies.",
427-
"eoc_type": "SCENARIO_SPECIFIC",
428427
"effect": [
429428
{
430429
"u_message": "Welcome to Sky Islands.\n\nSpeak to the Heart of the Island to get your bearings, accept missions, manage upgrades, change your difficulty settings, and more.",

data/mods/Xedra_Evolved/eocs/scenario_specific.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,17 @@
22
{
33
"type": "effect_on_condition",
44
"id": "scenario_once_bitten",
5-
"eoc_type": "SCENARIO_SPECIFIC",
65
"effect": [ { "u_add_effect": "vampire_virus", "intensity": 1, "duration": "PERMANENT" } ]
76
},
87
{
98
"type": "effect_on_condition",
109
"id": "scenario_lilin_starting_ruach",
1110
"//": "Starts you off with some ruach so you don't begin starving immediately",
12-
"eoc_type": "SCENARIO_SPECIFIC",
1311
"effect": [ { "math": [ "u_vitamin('lilin_ruach_vitamin')", "+=", "rng(550,850) " ] } ]
1412
},
1513
{
1614
"type": "effect_on_condition",
1715
"id": "scenario_paraclesian_birth",
18-
"eoc_type": "SCENARIO_SPECIFIC",
1916
"effect": [
2017
{ "math": [ "u_vitamin('mutagen')", "+=", "550" ] },
2118
{ "if": { "u_has_trait": "IERDE" }, "then": { "math": [ "u_vitamin('mutagen_earthkin')", "+=", "550 " ] } },

data/mods/deadly_bites/effect_on_conditions.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
{
1313
"type": "effect_on_condition",
1414
"id": "scenario_deadly_virus",
15-
"eoc_type": "SCENARIO_SPECIFIC",
1615
"effect": [
1716
{ "u_add_effect": "zombie_virus", "intensity": 1, "duration": "PERMANENT" },
1817
{ "assign_mission": "MISSION_INFECTED_START_FIND_ANTIVIRALS" }

doc/JSON/EFFECT_ON_CONDITION.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,14 @@ An effect_on_condition is an object allowing the combination of dialog condition
3838
| `false_effect` | effect | The effect(s) caused if `condition` returns false upon activation. See the "Dialogue Effects" section of [NPCs](NPCs.md) for the full syntax.
3939
| `global` | bool | If this is true, this recurring eoc will be run on the player and every npc from a global queue. Deactivate conditions will work based on the avatar. If it is false the avatar and every character will have their own copy and their own deactivated list. Defaults to false.
4040
| `run_for_npcs` | bool | Can only be true if global is true. If false the EOC will only be run against the avatar. If true the eoc will be run against the avatar and all npcs. Defaults to false.
41-
| `EOC_TYPE` | string | Can be one of `ACTIVATION`, `RECURRING`, `SCENARIO_SPECIFIC`, `AVATAR_DEATH`, `NPC_DEATH`, `PREVENT_DEATH`, `EVENT` (see details below). It defaults to `ACTIVATION` unless `recurrence` is provided in which case it defaults to `RECURRING`.
41+
| `EOC_TYPE` | string | Can be one of `ACTIVATION`, `RECURRING`, `AVATAR_DEATH`, `NPC_DEATH`, `PREVENT_DEATH`, `EVENT` (see details below). It defaults to `ACTIVATION` unless `recurrence` is provided in which case it defaults to `RECURRING`.
4242

4343
### EOC types
4444

4545
`EOC_TYPE` can be any of:
4646

4747
* `ACTIVATION` - activated manually.
4848
* `RECURRING` - activated automatically on schedule (see `recurrence`)
49-
* `SCENARIO_SPECIFIC` - automatically invoked once on scenario start.
5049
* `AVATAR_DEATH` - automatically invoked whenever the current avatar dies (it will be run with the avatar as `u`), if after it the player is no longer dead they will not die, if there are multiple EOCs they all be run until the player is not dead.
5150
* `NPC_DEATH` - EOCs can only be assigned to run on the death of an npc, in which case u will be the dying npc and npc will be the killer. If after it npc is no longer dead they will not die, if there are multiple they all be run until npc is not dead.
5251
* `PREVENT_DEATH` - whenever the current avatar dies it will be run with the avatar as `u`, if after it the player is no longer dead they will not die, if there are multiple they all be run until the player is not dead.

src/effect_on_condition.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ namespace io
4040
switch ( data ) {
4141
case eoc_type::ACTIVATION: return "ACTIVATION";
4242
case eoc_type::RECURRING: return "RECURRING";
43-
// Why we need SCENARIO_SPECIFIC / PROFESSION_SPECIFIC? they are no different from ACTIVATION
44-
case eoc_type::SCENARIO_SPECIFIC: return "SCENARIO_SPECIFIC";
45-
case eoc_type::PROFESSION_SPECIFIC: return "PROFESSION_SPECIFIC";
4643
case eoc_type::AVATAR_DEATH: return "AVATAR_DEATH";
4744
case eoc_type::NPC_DEATH: return "NPC_DEATH";
4845
case eoc_type::PREVENT_DEATH: return "PREVENT_DEATH";
@@ -144,7 +141,7 @@ void effect_on_conditions::load_new_character( Character &you )
144141
bool is_avatar = you.is_avatar();
145142
for( const effect_on_condition_id &eoc_id : get_scenario()->eoc() ) {
146143
effect_on_condition eoc = eoc_id.obj();
147-
if( eoc.type == eoc_type::SCENARIO_SPECIFIC && ( is_avatar || eoc.run_for_npcs ) ) {
144+
if( is_avatar || eoc.run_for_npcs ) {
148145
queued_eoc new_eoc = queued_eoc{ eoc.id, calendar::turn_zero, {} };
149146
you.queued_effect_on_conditions.push( new_eoc );
150147
}
@@ -153,7 +150,7 @@ void effect_on_conditions::load_new_character( Character &you )
153150
if( you.get_profession() ) {
154151
for( const effect_on_condition_id &eoc_id : you.get_profession()->get_eocs() ) {
155152
effect_on_condition eoc = eoc_id.obj();
156-
if( eoc.type == eoc_type::PROFESSION_SPECIFIC && ( is_avatar || eoc.run_for_npcs ) ) {
153+
if( is_avatar || eoc.run_for_npcs ) {
157154
queued_eoc new_eoc = queued_eoc{ eoc.id, calendar::turn_zero, {} };
158155
you.queued_effect_on_conditions.push( new_eoc );
159156
}

src/effect_on_condition.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ template <typename T> class generic_factory;
2929
enum eoc_type {
3030
ACTIVATION,
3131
RECURRING,
32-
SCENARIO_SPECIFIC,
33-
PROFESSION_SPECIFIC,
3432
AVATAR_DEATH,
3533
NPC_DEATH,
3634
PREVENT_DEATH,

0 commit comments

Comments
 (0)