-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathmeteor_types.dm
457 lines (383 loc) · 13.4 KB
/
meteor_types.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
#define DEFAULT_METEOR_LIFETIME 1800
/obj/effect/meteor
name = "\proper the concept of meteor"
desc = "You should probably run instead of gawking at this."
icon = 'icons/obj/meteor.dmi'
icon_state = "small"
density = TRUE
anchored = TRUE
pass_flags = PASSTABLE
///The resilience of our meteor
var/hits = 4
///Level of ex_act to be called on hit.
var/hitpwr = EXPLODE_HEAVY
//Should we shake people's screens on impact
var/heavy = FALSE
///Sound to play when you hit something
var/meteorsound = 'sound/effects/meteorimpact.ogg'
///Our starting z level, prevents infinite meteors
var/z_original
///Used for determining which meteors are most interesting
var/threat = 0
//Potential items to spawn when you die
var/list/meteordrop = list(/obj/item/stack/ore/iron)
///How much stuff to spawn when you die
var/dropamt = 2
///The thing we're moving towards, usually a turf
var/atom/dest
///Lifetime in seconds
var/lifetime = DEFAULT_METEOR_LIFETIME
///Used by Stray Meteor event to indicate meteor type (the type of sensor that "detected" it) in announcement
var/signature = "motion"
/obj/effect/meteor/Initialize(mapload, turf/target)
. = ..()
z_original = z
GLOB.meteor_list += src
SSaugury.register_doom(src, threat)
SpinAnimation()
chase_target(target)
/obj/effect/meteor/Destroy()
GLOB.meteor_list -= src
return ..()
/obj/effect/meteor/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(QDELETED(src))
return
if(old_loc != loc)//If did move, ram the turf we get in
var/turf/T = get_turf(loc)
ram_turf(T)
if(prob(10) && !isspaceturf(T))//randomly takes a 'hit' from ramming
get_hit()
if(z != z_original || loc == get_turf(dest))
qdel(src)
return
/obj/effect/meteor/Process_Spacemove(movement_dir = 0, continuous_move = FALSE)
return TRUE //Keeps us from drifting for no reason
/obj/effect/meteor/Bump(atom/A)
. = ..() //What could go wrong
if(A)
ram_turf(get_turf(A))
playsound(src.loc, meteorsound, 40, TRUE)
get_hit()
/obj/effect/meteor/proc/chase_target(atom/chasing, delay = 1)
set waitfor = FALSE
if(chasing)
walk_towards(src, chasing, delay)
///Deals with what happens when we stop moving, IE we die
/obj/effect/meteor/proc/handle_stopping()
SIGNAL_HANDLER
if(!QDELETED(src))
qdel(src)
/obj/effect/meteor/proc/ram_turf(turf/T)
//first yell at mobs about them dying horribly
for(var/mob/living/thing in T)
thing.visible_message(span_warning("[src] slams into [thing]."), span_userdanger("[src] slams into you!."))
//then, ram the turf
switch(hitpwr)
if(EXPLODE_DEVASTATE)
SSexplosions.highturf += T
if(EXPLODE_HEAVY)
SSexplosions.medturf += T
if(EXPLODE_LIGHT)
SSexplosions.lowturf += T
//process getting 'hit' by colliding with a dense object
//or randomly when ramming turfs
/obj/effect/meteor/proc/get_hit()
hits--
if(hits <= 0)
make_debris()
meteor_effect()
qdel(src)
/obj/effect/meteor/attackby(obj/item/I, mob/user, params)
if(I.tool_behaviour == TOOL_MINING)
make_debris()
qdel(src)
else
. = ..()
/obj/effect/meteor/proc/make_debris()
for(var/throws = dropamt, throws > 0, throws--)
var/thing_to_spawn = pick(meteordrop)
new thing_to_spawn(get_turf(src))
/obj/effect/meteor/proc/meteor_effect()
if(heavy)
var/sound/meteor_sound = sound(meteorsound)
var/random_frequency = get_rand_frequency()
for(var/mob/M in GLOB.player_list)
if((M.orbiting) && (SSaugury.watchers[M]))
continue
var/turf/T = get_turf(M)
if(!T || T.z != src.z)
continue
var/dist = get_dist(M.loc, src.loc)
shake_camera(M, dist > 20 ? 2 : 4, dist > 20 ? 1 : 3)
M.playsound_local(src.loc, meteor_sound, 50, 1, random_frequency, 10)
/**
* Handles the meteor's interaction with meteor shields.
*
* Returns TRUE if the meteor should be destroyed. Overridable for custom shield interaction.
* Return FALSE if a meteor's interaction with meteor shields should NOT destroy it.
*
* Arguments:
* * defender - The meteor shield that is vaporizing us.
*/
/obj/effect/meteor/proc/shield_defense(obj/machinery/satellite/meteor_shield/defender)
return TRUE
///////////////////////
//Meteor types
///////////////////////
//Sand
/obj/effect/meteor/sand
name = "space sand"
icon_state = "dust"
hits = 2
hitpwr = EXPLODE_LIGHT
meteorsound = 'sound/items/dodgeball.ogg'
threat = 1
/obj/effect/meteor/sand/make_debris()
return //We drop NOTHING
/obj/effect/meteor/sand/ram_turf(turf/turf_to_ram)
if(istype(turf_to_ram, /turf/closed/wall)) //sand is too weak to affect rwalls or walls with similar durability.
var/turf/closed/wall/wall_to_ram = turf_to_ram
if(wall_to_ram.hardness <= 25)
return
var/area/area_to_check = get_area(turf_to_ram)
if(area_to_check.area_flags & EVENT_PROTECTED) //This event absolutely destroys arrivals, and putting latejoiners into firelock hell is cringe
return
return ..()
//Dust
/obj/effect/meteor/dust
name = "space dust"
icon_state = "dust"
pass_flags = PASSTABLE | PASSGRILLE
hits = 1
hitpwr = EXPLODE_LIGHT
meteorsound = 'sound/weapons/gunshot_smg.ogg'
meteordrop = list(/obj/item/stack/ore/glass)
threat = 1
//Medium-sized
/obj/effect/meteor/medium
name = "meteor"
dropamt = 3
threat = 5
/obj/effect/meteor/medium/meteor_effect()
..()
explosion(src, heavy_impact_range = 1, light_impact_range = 2, flash_range = 3, adminlog = FALSE)
//Large-sized
/obj/effect/meteor/big
name = "big meteor"
icon_state = "large"
hits = 6
heavy = TRUE
dropamt = 4
threat = 10
/obj/effect/meteor/big/meteor_effect()
..()
explosion(src, devastation_range = 1, heavy_impact_range = 2, light_impact_range = 3, flash_range = 4, adminlog = FALSE)
//Flaming meteor
/obj/effect/meteor/flaming
name = "flaming meteor"
desc = "An veritable shooting star, both beautiful and frightening. You should probably keep your distance from this."
icon_state = "flaming"
hits = 5
heavy = TRUE
meteorsound = 'sound/effects/bamf.ogg'
meteordrop = list(/obj/item/stack/ore/plasma)
threat = 20
signature = "thermal"
/obj/effect/meteor/flaming/meteor_effect()
..()
explosion(src, devastation_range = 1, heavy_impact_range = 2, light_impact_range = 3, flame_range = 5, flash_range = 4, adminlog = FALSE)
//Radiation meteor
/obj/effect/meteor/irradiated
name = "glowing meteor"
desc = "An irradiated chunk of space rock. You could probably stop and appreciate its incandescent green glow, if it weren't moving so fast."
icon_state = "glowing"
heavy = TRUE
meteordrop = list(/obj/item/stack/ore/uranium)
threat = 15
signature = "radiation"
/obj/effect/meteor/irradiated/meteor_effect()
..()
explosion(src, light_impact_range = 4, flash_range = 3, adminlog = FALSE)
new /obj/effect/decal/cleanable/greenglow(get_turf(src))
radiation_pulse(src, 500)
//Cluster meteor
/obj/effect/meteor/cluster
name = "cluster meteor"
desc = "A cluster of densely packed rocks, with a volatile core. You should probably get out of the way."
icon_state = "sharp"
hits = 9
heavy = TRUE
meteorsound = 'sound/effects/break_stone.ogg'
threat = 25
signature = "ordnance"
///Number of fragmentation meteors to be spawned
var/cluster_count = 8
/obj/effect/meteor/cluster/meteor_effect()
..()
var/start_turf = get_turf(src)
while(cluster_count > 0)
var/startSide = pick(GLOB.cardinals)
var/turf/destination = spaceDebrisStartLoc(startSide, z)
new /obj/effect/meteor/cluster_fragment(start_turf, destination)
cluster_count--
explosion(src, heavy_impact_range = 2, light_impact_range = 3, flash_range = 4, adminlog = FALSE)
/obj/effect/meteor/cluster_fragment
name = "cluster meteor fragment"
desc = "A fast-moving fragment of exploded cluster-rock."
icon_state = "dust"
//frozen carp "meteor"
/obj/effect/meteor/carp
name = "frozen carp"
icon_state = "carp"
desc = "Am I glad he's frozen in there, and that we're out here."
hits = 4
meteorsound = 'sound/effects/ethereal_revive_fail.ogg'
meteordrop = list(/mob/living/simple_animal/hostile/carp)
dropamt = 1
threat = 5
signature = "fishing and trawling"
/obj/effect/meteor/carp/Initialize(mapload)
if(prob(2))
meteordrop = list(/mob/living/simple_animal/hostile/carp/megacarp) //hehe
return ..()
//bluespace meteor
/obj/effect/meteor/bluespace
name = "bluespace meteor"
desc = "A large geode containing bluespace dust at its core, hurtling through space. That's the stuff the crew are here to research. How convenient for them."
icon_state = "bluespace"
dropamt = 3
hits = 12
meteordrop = list(/obj/item/stack/ore/bluespace_crystal)
threat = 15
signature = "bluespace flux"
/obj/effect/meteor/bluespace/Bump()
. = ..()
if(!QDELETED(src) && prob(35)) // monkestation edit: runtime fix
do_teleport(src, get_turf(src), 6, asoundin = 'sound/effects/phasein.ogg', channel = TELEPORT_CHANNEL_BLUESPACE)
/obj/effect/meteor/banana
name = "bananium meteor"
desc = "Maybe it's a chunk blasted off of the legendary Clown Planet... How annoying."
icon_state = "bananium"
dropamt = 4
hits = 175 //Honks everything, including space tiles. Depending on the angle/how much stuff it hits, there's a fair chance that it will spare the station from the actual explosion
meteordrop = list(/obj/item/stack/ore/bananium)
meteorsound = 'sound/items/bikehorn.ogg'
threat = 15
movement_type = PHASING
signature = "comedy"
/obj/effect/meteor/banana/meteor_effect()
..()
playsound(src, 'sound/items/AirHorn.ogg', 100, TRUE, -1)
for(var/atom/movable/object in view(4, get_turf(src)))
var/turf/throwtarget = get_edge_target_turf(get_turf(src), get_dir(get_turf(src), get_step_away(object, get_turf(src))))
object.safe_throw_at(throwtarget, 5, 1, force = MOVE_FORCE_STRONG)
/obj/effect/meteor/banana/ram_turf(turf/bumped)
for(var/mob/living/slipped in get_turf(bumped))
slipped.slip(100, slipped.loc,- GALOSHES_DONT_HELP|SLIDE, 0, FALSE)
slipped.visible_message(span_warning("[src] honks [slipped] to the floor!"), span_userdanger("[src] harmlessly passes through you, knocking you over."))
get_hit()
/obj/effect/meteor/emp
name = "electromagnetically charged meteor"
desc = "It radiates with captive energy, ready to be let loose upon the world."
icon_state = "bluespace"
hits = 6
threat = 10
signature = "electromagnetic interference"
/obj/effect/meteor/emp/Move()
. = ..()
if(.)
new /obj/effect/temp_visual/impact_effect/ion(get_turf(src))
/obj/effect/meteor/emp/meteor_effect()
..()
playsound(src, 'sound/weapons/zapbang.ogg', 100, TRUE, -1)
empulse(src, 3, 8)
//Meaty Ore
/obj/effect/meteor/meaty
name = "meaty ore"
icon_state = "meateor"
desc = "Just... don't think too hard about where this thing came from."
hits = 2
heavy = TRUE
meteorsound = 'sound/effects/blobattack.ogg'
meteordrop = list(/obj/item/reagent_containers/food/snacks/meat/slab/human, /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant, /obj/item/organ/heart, /obj/item/organ/lungs, /obj/item/organ/tongue, /obj/item/organ/appendix/, /obj/item/organ/heart/freedom)
var/meteorgibs = /obj/effect/gibspawner/generic
threat = 2
signature = "culinary material"
/obj/effect/meteor/meaty/Initialize(mapload)
for(var/path in meteordrop)
if(path == /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant)
meteordrop -= path
meteordrop += pick(subtypesof(path))
for(var/path in meteordrop)
if(path == /obj/item/organ/tongue)
meteordrop -= path
meteordrop += pick(typesof(path))
return ..()
/obj/effect/meteor/meaty/make_debris()
..()
new meteorgibs(get_turf(src))
/obj/effect/meteor/meaty/ram_turf(turf/T)
if(!isspaceturf(T))
new /obj/effect/decal/cleanable/blood(T)
/obj/effect/meteor/meaty/Bump(atom/A)
A.ex_act(hitpwr)
get_hit()
//Meaty Ore Xeno edition
/obj/effect/meteor/meaty/xeno
color = "#5EFF00"
meteordrop = list(/obj/item/reagent_containers/food/snacks/meat/slab/xeno, /obj/item/organ/tongue/alien)
meteorgibs = /obj/effect/gibspawner/xeno
signature = "exotic culinary material"
/obj/effect/meteor/meaty/xeno/Initialize(mapload)
meteordrop += subtypesof(/obj/item/organ/alien)
return ..()
/obj/effect/meteor/meaty/xeno/ram_turf(turf/T)
if(!isspaceturf(T))
new /obj/effect/decal/cleanable/xenoblood(T)
//Station buster Tunguska
/obj/effect/meteor/tunguska
name = "tunguska meteor"
icon_state = "flaming"
desc = "Your life briefly passes before your eyes the moment you lay them on this monstrosity."
hits = 30
hitpwr = EXPLODE_DEVASTATE
heavy = TRUE
meteorsound = 'sound/effects/bamf.ogg'
meteordrop = list(/obj/item/stack/ore/plasma)
threat = 50
signature = "armageddon"
/obj/effect/meteor/tunguska/Move()
. = ..()
if(.)
new /obj/effect/temp_visual/revenant(get_turf(src))
/obj/effect/meteor/tunguska/meteor_effect()
..()
explosion(src, devastation_range = 5, heavy_impact_range = 10, light_impact_range = 15, flash_range = 20, adminlog = FALSE)
/obj/effect/meteor/tunguska/Bump()
..()
if(prob(20))
explosion(src, devastation_range = 2, heavy_impact_range = 4, light_impact_range = 6, flash_range = 8, adminlog = FALSE)
/obj/effect/meteor/pumpkin
name = "PUMPKING"
desc = "THE PUMPKING'S COMING!"
icon = 'icons/obj/meteor_spooky.dmi'
icon_state = "pumpkin"
hits = 10
heavy = TRUE
dropamt = 1
meteordrop = list(/obj/item/clothing/head/hardhat/pumpkinhead, /obj/item/reagent_containers/food/snacks/grown/pumpkin)
threat = 100
/obj/effect/meteor/pumpkin/Initialize(mapload)
. = ..()
meteorsound = pick('sound/hallucinations/im_here1.ogg','sound/hallucinations/im_here2.ogg')
/obj/effect/meteor/guardian
name = "glowing meteor"
icon_state = "glowing"
hits = 3
heavy = TRUE
meteorsound = 'sound/effects/bamf.ogg'
meteordrop = list(/obj/item/stand_arrow)
dropamt = 1
threat = 100
#undef DEFAULT_METEOR_LIFETIME