Skip to content

Commit cfa43db

Browse files
[Sky Island] Missions take place in alternate dimensions (#83451)
1 parent c7b514d commit cfa43db

File tree

4 files changed

+140
-22
lines changed

4 files changed

+140
-22
lines changed

data/mods/Sky_Island/EOCs.json

Lines changed: 60 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@
1919
"effect": [
2020
{ "math": [ "u_spell_level('island_hostile_eviction') = -1" ] },
2121
{ "math": [ "u_spell_level('island_close_tear_and_portal') = -1" ] },
22-
{ "u_location_variable": { "global_val": "OM_HQ_origin" } },
23-
{
24-
"u_location_variable": { "global_val": "OM_HQ_origin_npc" },
25-
"passable_only": true,
26-
"min_radius": 2,
27-
"max_radius": 10
28-
},
2922
{ "u_add_effect": "warpcloak", "intensity": 2, "duration": { "global_val": "invistime", "default": "3 s" } },
3023
{
3124
"run_eocs": [
@@ -83,10 +76,12 @@
8376
"u_run_npc_eocs": [
8477
{
8578
"id": "EOC_initiate_randomport_npc_follower",
86-
"condition": "u_following",
79+
"//": "Since NPC teleporting is bugged, the condition here and below prevents this from running for NPCs",
80+
"condition": { "and": [ "u_following", { "u_has_trait": "GETS_RANDOM_MISSION_NOMOVE" } ] },
8781
"effect": [
8882
{
8983
"u_teleport": { "global_val": "OM_missionspot" },
84+
"success_message": "Your followers teleport with you.",
9085
"fail_message": "It seems some of your followers couldn't teleport with you.",
9186
"force": true
9287
},
@@ -104,6 +99,7 @@
10499
},
105100
{
106101
"u_teleport": { "global_val": "OM_missionspot" },
102+
"success_message": "You arrive on the raid.",
107103
"fail_message": "It seems the portal couldn't find a valid location.",
108104
"force": true
109105
},
@@ -115,11 +111,57 @@
115111
"id": "EOC_return_OM_teleport",
116112
"//": "This is the EOC which actually returns you home. It brings you home and removes all warp-related effects including warp sickness. It heals you enough to fix broken limbs. It also resets the awayfromhome counter to 0 so warp sickness can be tracked properly next time you're out.",
117113
"effect": [
114+
{
115+
"u_run_npc_eocs": [
116+
{
117+
"id": "EOC_SKY_ISLAND_MISSION_DIMENSION_SHIFT_ADD_NPC_EFFECT_RETURN",
118+
"//": "Since NPC teleporting is bugged, the condition here and below prevents this from running for NPCs",
119+
"condition": { "and": [ "u_following", { "u_has_trait": "GETS_RANDOM_MISSION_NOMOVE" } ] },
120+
"effect": [ { "u_add_effect": "blind", "duration": 0 }, { "u_add_effect": "effect_sky_island_momentary_flight", "duration": 1 } ]
121+
}
122+
],
123+
"npc_range": 10,
124+
"local": true
125+
},
126+
{ "u_add_effect": "blind", "duration": 0 },
127+
{ "u_add_effect": "effect_sky_island_momentary_flight", "duration": 1 },
128+
{
129+
"u_location_variable": { "global_val": "sky_dimension_teleport_departure" },
130+
"z_adjust": 7,
131+
"z_override": true
132+
},
133+
{
134+
"u_location_variable": { "global_val": "sky_dimension_teleport_departure_npc" },
135+
"z_adjust": 7,
136+
"z_override": true
137+
},
138+
{
139+
"u_run_npc_eocs": [
140+
{
141+
"id": "EOC_return_to_dimension_teleport_followers",
142+
"condition": { "and": [ "u_following", { "u_has_trait": "GETS_RANDOM_MISSION_NOMOVE" } ] },
143+
"effect": [
144+
{ "u_add_effect": "blind", "duration": 0 },
145+
{ "u_add_effect": "effect_sky_island_momentary_flight", "duration": 1 },
146+
{ "u_teleport": { "global_val": "sky_dimension_teleport_departure_npc" }, "force": true },
147+
{
148+
"location_variable_adjust": { "global_val": "sky_dimension_teleport_departure_npc" },
149+
"x_adjust": [ -2, 2 ],
150+
"y_adjust": [ -2, 2 ]
151+
}
152+
]
153+
}
154+
],
155+
"npc_range": 10,
156+
"local": true
157+
},
158+
{ "u_teleport": { "global_val": "sky_dimension_teleport_departure" }, "force": true },
159+
{ "u_travel_to_dimension": "default", "npc_travel_radius": 10, "region_type": "default" },
118160
{
119161
"u_run_npc_eocs": [
120162
{
121163
"id": "EOC_return_OM_teleport_followers",
122-
"condition": "u_following",
164+
"condition": { "and": [ "u_following", { "u_has_trait": "GETS_RANDOM_MISSION_NOMOVE" } ] },
123165
"effect": [
124166
{ "u_teleport": { "global_val": "OM_HQ_origin_npc" }, "force": true },
125167
{
@@ -153,10 +195,17 @@
153195
"EOC_return_heal"
154196
]
155197
},
198+
{ "clear_dimension": "dimension_sky_island_mission" },
156199
{ "alter_timed_events": "return_portal_close" },
157200
{ "math": [ "timeawayfromhome = 0 - bonuspulses" ] }
158201
]
159202
},
203+
{
204+
"type": "effect_on_condition",
205+
"id": "EOC_DIMENSION_HECK",
206+
"condition": { "current_dimension": "dimension_sky_island_mission" },
207+
"effect": [ { "u_message": "You are on a mission" } ]
208+
},
160209
{
161210
"type": "effect_on_condition",
162211
"id": "EOC_award_material_tokens",
@@ -618,8 +667,8 @@
618667
"title": "Adjust Return Obelisk Behavior",
619668
"keys": [ "1", "2", "3" ],
620669
"descriptions": [
621-
"Set the behavior of the return obelisk.\nWith this option, everything in the room with you will return to your sky island. Getting resources will generally not be a problem as long as you make it to the extraction point.",
622-
"Set the behavior of the return obelisk.\nWith this option, if you have a warp vortex token with you, everything in the room with you will return to your sky island. Otherwise, only what you are carrying on your person will return with you. You may have to make difficult choices about what to bring back.",
670+
"Set the behavior of the return obelisk.\nWith this option, everything in the room with you will return to your sky island. Getting resources will generally not be a problem as long as you make it to the extraction point.NOTE: THIS OPTION CURRENTLY <color_red>DOES NOT WORK</color>",
671+
"Set the behavior of the return obelisk.\nWith this option, if you have a warp vortex token with you, everything in the room with you will return to your sky island. Otherwise, only what you are carrying on your person will return with you. You may have to make difficult choices about what to bring back. NOTE: THE WARP VORTEX TOKEN CURRENTLY <color_red>DOES NOT WORK</color>",
623672
"Set the behavior of the return obelisk.\nWith this option, only what you are carrying on your person will return with you. You will always have to make difficult choices about what to bring back."
624673
]
625674
}

data/mods/Sky_Island/effects.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,12 @@
144144
"name": [ "" ],
145145
"desc": [ "" ],
146146
"flags": [ "STEADY" ]
147+
},
148+
{
149+
"type": "effect_type",
150+
"id": "effect_sky_island_momentary_flight",
151+
"name": [ "" ],
152+
"desc": [ "" ],
153+
"flags": [ "LEVITATION" ]
147154
}
148155
]

data/mods/Sky_Island/modinfo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"description": "An attempt at an entirely new way to play CDDA, inspired by games like Escape from Tarkov and Dark and Darker. Begin on a floating island in the sky and warp down to random spots on the earth below to conduct expeditions for items you need. Permadeath is gone - you will return to the island on death but lose any items you had on you. Build up your stockpile, carry out missions for unique rewards, customize your home island, unlock upgrades, and be prudent about what you take on any given outing. Be aware that 'PLAY NOW' will NOT work, you MUST make a custom character.",
88
"category": "total_conversion",
99
"dependencies": [ "dda" ],
10-
"version": "0.3.0"
10+
"version": "0.4.0"
1111
}
1212
]

data/mods/Sky_Island/obelisk_selector.json

Lines changed: 72 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,14 @@
9191
"id": "EOC_Random_Loc_Warp",
9292
"//": "Picks a random location of any kind and activates the actual teleport EOC.",
9393
"effect": [
94+
{ "run_eocs": "EOC_SKY_ISLAND_MISSION_DIMENSION_SHIFT" },
9495
{
9596
"u_location_variable": { "global_val": "OM_missionspot" },
9697
"target_params": {
9798
"om_terrain": "field",
9899
"om_terrain_match_type": "CONTAINS",
99-
"search_range": 1200,
100-
"min_distance": 200,
100+
"search_range": 200,
101+
"min_distance": 0,
101102
"reveal_radius": { "global_val": "scoutingdistancelanding", "default": 0 },
102103
"z": 0,
103104
"random": true
@@ -111,13 +112,14 @@
111112
"id": "EOC_Field_Loc_Warp",
112113
"//": "Picks a random field and activates the actual teleport EOC.",
113114
"effect": [
115+
{ "run_eocs": "EOC_SKY_ISLAND_MISSION_DIMENSION_SHIFT" },
114116
{
115117
"u_location_variable": { "global_val": "OM_missionspot" },
116118
"target_params": {
117119
"om_terrain": "field",
118120
"om_terrain_match_type": "CONTAINS",
119-
"search_range": 1200,
120-
"min_distance": 200,
121+
"search_range": 200,
122+
"min_distance": 0,
121123
"reveal_radius": { "global_val": "scoutingdistancelanding", "default": 0 },
122124
"z": 0,
123125
"random": true
@@ -132,13 +134,14 @@
132134
"//": "Picks a random basement and activates the actual teleport EOC.",
133135
"condition": { "math": [ "basementsunlocked == 1" ] },
134136
"effect": [
137+
{ "run_eocs": "EOC_SKY_ISLAND_MISSION_DIMENSION_SHIFT" },
135138
{
136139
"u_location_variable": { "global_val": "OM_missionspot" },
137140
"target_params": {
138141
"om_terrain": "basement",
139142
"om_terrain_match_type": "CONTAINS",
140-
"search_range": 1200,
141-
"min_distance": 200,
143+
"search_range": 200,
144+
"min_distance": 0,
142145
"reveal_radius": { "global_val": "scoutingdistancelanding", "default": 0 },
143146
"z": -1,
144147
"random": true
@@ -155,13 +158,14 @@
155158
"//": "Picks a random rooftop and activates the actual teleport EOC.",
156159
"condition": { "math": [ "roofsunlocked == 1" ] },
157160
"effect": [
161+
{ "run_eocs": "EOC_SKY_ISLAND_MISSION_DIMENSION_SHIFT" },
158162
{
159163
"u_location_variable": { "global_val": "OM_missionspot" },
160164
"target_params": {
161165
"om_terrain": "roof",
162166
"om_terrain_match_type": "CONTAINS",
163-
"search_range": 1200,
164-
"min_distance": 200,
167+
"search_range": 200,
168+
"min_distance": 0,
165169
"reveal_radius": { "global_val": "scoutingdistancelanding", "default": 0 },
166170
"z": 1,
167171
"random": true
@@ -178,6 +182,7 @@
178182
"//": "Picks a random underground lab and activates the actual teleport EOC.",
179183
"condition": { "and": [ { "math": [ "labsunlocked == 1" ] }, { "u_has_items": { "item": "warp_labs_catalyst", "count": 1 } } ] },
180184
"effect": [
185+
{ "run_eocs": "EOC_SKY_ISLAND_MISSION_DIMENSION_SHIFT" },
181186
{
182187
"run_eoc_selector": [
183188
"EOC_Lab_Science_Loc_Warp",
@@ -205,13 +210,14 @@
205210
"//": "Picks a random underground lab and activates the actual teleport EOC.",
206211
"condition": { "and": [ { "math": [ "labsunlocked == 1" ] }, { "u_has_items": { "item": "warp_labs_catalyst", "count": 1 } } ] },
207212
"effect": [
213+
{ "run_eocs": "EOC_SKY_ISLAND_MISSION_DIMENSION_SHIFT" },
208214
{
209215
"u_location_variable": { "global_val": "OM_missionspot" },
210216
"target_params": {
211217
"om_terrain": "lab_stairs",
212218
"om_terrain_match_type": "CONTAINS",
213-
"search_range": 1200,
214-
"min_distance": 200,
219+
"search_range": 200,
220+
"min_distance": 0,
215221
"reveal_radius": { "global_val": "scoutingdistancelanding", "default": 0 },
216222
"z": -2,
217223
"random": true
@@ -229,6 +235,7 @@
229235
"//": "Picks a random underground lab and activates the actual teleport EOC.",
230236
"condition": { "and": [ { "math": [ "labsunlocked == 1" ] }, { "u_has_items": { "item": "warp_labs_catalyst", "count": 1 } } ] },
231237
"effect": [
238+
{ "run_eocs": "EOC_SKY_ISLAND_MISSION_DIMENSION_SHIFT" },
232239
{
233240
"u_location_variable": { "global_val": "OM_missionspot" },
234241
"target_params": {
@@ -253,6 +260,7 @@
253260
"//": "Picks a random research facility and activates the actual teleport EOC.",
254261
"condition": { "and": [ { "math": [ "labsunlocked == 1" ] }, { "u_has_items": { "item": "warp_labs_catalyst", "count": 1 } } ] },
255262
"effect": [
263+
{ "run_eocs": "EOC_SKY_ISLAND_MISSION_DIMENSION_SHIFT" },
256264
{
257265
"u_location_variable": { "global_val": "OM_missionspot" },
258266
"target_params": {
@@ -276,6 +284,7 @@
276284
"//": "Picks a random TCL and activates the actual teleport EOC.",
277285
"condition": { "and": [ { "math": [ "labsunlocked == 1" ] }, { "u_has_items": { "item": "warp_labs_catalyst", "count": 1 } } ] },
278286
"effect": [
287+
{ "run_eocs": "EOC_SKY_ISLAND_MISSION_DIMENSION_SHIFT" },
279288
{
280289
"u_location_variable": { "global_val": "OM_missionspot" },
281290
"target_params": {
@@ -293,5 +302,58 @@
293302
{ "math": [ "goingtolabs = 1" ] },
294303
{ "run_eocs": [ "EOC_initiate_randomport" ] }
295304
]
305+
},
306+
{
307+
"type": "effect_on_condition",
308+
"id": "EOC_SKY_ISLAND_MISSION_DIMENSION_SHIFT",
309+
"effect": [
310+
{ "u_location_variable": { "global_val": "OM_HQ_origin" } },
311+
{
312+
"u_location_variable": { "global_val": "OM_HQ_origin_npc" },
313+
"passable_only": true,
314+
"min_radius": 2,
315+
"max_radius": 10
316+
},
317+
{
318+
"u_location_variable": { "global_val": "sky_dimension_teleport_departure" },
319+
"z_adjust": -3,
320+
"z_override": true
321+
},
322+
{
323+
"u_location_variable": { "global_val": "sky_dimension_teleport_departure_npc" },
324+
"z_adjust": -3,
325+
"z_override": true
326+
},
327+
{
328+
"location_variable_adjust": { "global_val": "sky_dimension_teleport_departure_npc" },
329+
"x_adjust": [ -2, 2 ],
330+
"y_adjust": [ -2, 2 ]
331+
},
332+
{
333+
"u_run_npc_eocs": [
334+
{
335+
"id": "EOC_SKY_ISLAND_MISSION_DIMENSION_SHIFT_ADD_NPC_EFFECT",
336+
"//": "Since NPC teleporting is bugged, the condition here and below prevents this from running for NPCs",
337+
"condition": { "and": [ "u_following", { "u_has_trait": "GETS_RANDOM_MISSION_NOMOVE" } ] },
338+
"effect": [
339+
{ "u_add_effect": "blind", "duration": 0 },
340+
{ "u_add_effect": "effect_sky_island_momentary_flight", "duration": 2 },
341+
{ "u_teleport": { "global_val": "sky_dimension_teleport_departure_npc" }, "force": true },
342+
{
343+
"location_variable_adjust": { "global_val": "sky_dimension_teleport_departure_npc" },
344+
"x_adjust": [ -2, 2 ],
345+
"y_adjust": [ -2, 2 ]
346+
}
347+
]
348+
}
349+
],
350+
"npc_range": 10,
351+
"local": true
352+
},
353+
{ "u_add_effect": "blind", "duration": 0 },
354+
{ "u_add_effect": "effect_sky_island_momentary_flight", "duration": 2 },
355+
{ "u_teleport": { "global_val": "sky_dimension_teleport_departure" }, "force": true },
356+
{ "u_travel_to_dimension": "dimension_sky_island_mission", "npc_travel_radius": 10, "region_type": "default" }
357+
]
296358
}
297359
]

0 commit comments

Comments
 (0)