mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 15:17:01 +01:00
* Hard Del Fixes, Ref Tracking Changes
This commit is contained in:
@@ -254,61 +254,55 @@
|
||||
|
||||
/obj/effect/anomaly/bluespace/detonate()
|
||||
var/turf/T = pick(get_area_turfs(impact_area))
|
||||
if(T)
|
||||
// Calculate new position (searches through beacons in world)
|
||||
var/obj/item/beacon/chosen
|
||||
var/list/possible = list()
|
||||
for(var/obj/item/beacon/W in GLOB.teleportbeacons)
|
||||
possible += W
|
||||
if(!T)
|
||||
return
|
||||
|
||||
if(possible.len > 0)
|
||||
chosen = pick(possible)
|
||||
// Calculate new position (searches through beacons in world)
|
||||
var/obj/item/beacon/chosen
|
||||
var/list/possible = list()
|
||||
for(var/obj/item/beacon/W in GLOB.teleportbeacons)
|
||||
possible += W
|
||||
|
||||
if(chosen)
|
||||
// Calculate previous position for transition
|
||||
if(possible.len > 0)
|
||||
chosen = pick(possible)
|
||||
|
||||
var/turf/FROM = T // the turf of origin we're travelling FROM
|
||||
var/turf/TO = get_turf(chosen) // the turf of origin we're travelling TO
|
||||
if(!chosen)
|
||||
return
|
||||
|
||||
playsound(TO, 'sound/effects/phasein.ogg', 100, TRUE)
|
||||
priority_announce("Massive bluespace translocation detected.", "Anomaly Alert")
|
||||
// Calculate previous position for transition
|
||||
var/turf/FROM = T // the turf of origin we're travelling FROM
|
||||
var/turf/TO = get_turf(chosen) // the turf of origin we're travelling TO
|
||||
|
||||
var/list/flashers = list()
|
||||
for(var/mob/living/carbon/C in viewers(TO, null))
|
||||
if(C.flash_act())
|
||||
flashers += C
|
||||
playsound(TO, 'sound/effects/phasein.ogg', 100, TRUE)
|
||||
priority_announce("Massive bluespace translocation detected.", "Anomaly Alert")
|
||||
|
||||
var/y_distance = TO.y - FROM.y
|
||||
var/x_distance = TO.x - FROM.x
|
||||
for (var/atom/movable/A in urange(12, FROM )) // iterate thru list of mobs in the area
|
||||
if(istype(A, /obj/item/beacon))
|
||||
continue // don't teleport beacons because that's just insanely stupid
|
||||
if(iscameramob(A))
|
||||
continue // Don't mess with AI eye, blob eye, xenobio or advanced cameras
|
||||
if(A.anchored)
|
||||
continue
|
||||
var/list/flashers = list()
|
||||
for(var/mob/living/carbon/C in viewers(TO, null))
|
||||
if(C.flash_act())
|
||||
flashers += C
|
||||
|
||||
var/turf/newloc = locate(A.x + x_distance, A.y + y_distance, TO.z) // calculate the new place
|
||||
if(!A.Move(newloc) && newloc) // if the atom, for some reason, can't move, FORCE them to move! :) We try Move() first to invoke any movement-related checks the atom needs to perform after moving
|
||||
A.forceMove(newloc)
|
||||
var/y_distance = TO.y - FROM.y
|
||||
var/x_distance = TO.x - FROM.x
|
||||
for (var/atom/movable/A in urange(12, FROM )) // iterate thru list of mobs in the area
|
||||
if(istype(A, /obj/item/beacon))
|
||||
continue // don't teleport beacons because that's just insanely stupid
|
||||
if(iscameramob(A))
|
||||
continue // Don't mess with AI eye, blob eye, xenobio or advanced cameras
|
||||
if(A.anchored)
|
||||
continue
|
||||
|
||||
if(ismob(A) && !(A in flashers)) // don't flash if we're already doing an effect
|
||||
var/mob/M = A
|
||||
if(M.client)
|
||||
INVOKE_ASYNC(src, .proc/blue_effect, M)
|
||||
var/turf/newloc = locate(A.x + x_distance, A.y + y_distance, TO.z) // calculate the new place
|
||||
if(!A.Move(newloc) && newloc) // if the atom, for some reason, can't move, FORCE them to move! :) We try Move() first to invoke any movement-related checks the atom needs to perform after moving
|
||||
A.forceMove(newloc)
|
||||
|
||||
/obj/effect/anomaly/bluespace/proc/blue_effect(mob/M)
|
||||
var/obj/blueeffect = new /obj(src)
|
||||
blueeffect.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
blueeffect.icon = 'icons/effects/effects.dmi'
|
||||
blueeffect.icon_state = "shieldsparkles"
|
||||
blueeffect.layer = FLASH_LAYER
|
||||
blueeffect.plane = FULLSCREEN_PLANE
|
||||
blueeffect.mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
M.client.screen += blueeffect
|
||||
sleep(20)
|
||||
M.client.screen -= blueeffect
|
||||
qdel(blueeffect)
|
||||
if(ismob(A) && !(A in flashers)) // don't flash if we're already doing an effect
|
||||
var/mob/give_sparkles = A
|
||||
if(give_sparkles.client)
|
||||
blue_effect(give_sparkles)
|
||||
|
||||
/obj/effect/anomaly/bluespace/proc/blue_effect(mob/make_sparkle)
|
||||
make_sparkle.overlay_fullscreen("bluespace_flash", /atom/movable/screen/fullscreen/bluespace_sparkle, 1)
|
||||
addtimer(CALLBACK(make_sparkle, /mob/.proc/clear_fullscreen, "bluespace_flash"), 2 SECONDS)
|
||||
|
||||
/////////////////////
|
||||
|
||||
|
||||
@@ -202,8 +202,10 @@
|
||||
///////////////////////////////////////////////
|
||||
//FOAM EFFECT DATUM
|
||||
/datum/effect_system/foam_spread
|
||||
var/amount = 10 // the size of the foam spread.
|
||||
var/obj/chemholder
|
||||
/// the size of the foam spread.
|
||||
var/amount = 10
|
||||
/// Stupid hack alertm exists to hold chems for us
|
||||
var/atom/movable/chem_holder/chemholder
|
||||
effect_type = /obj/effect/particle_effect/foam
|
||||
var/metal = 0
|
||||
|
||||
@@ -221,14 +223,11 @@
|
||||
|
||||
/datum/effect_system/foam_spread/New()
|
||||
..()
|
||||
chemholder = new /obj()
|
||||
var/datum/reagents/R = new/datum/reagents(1000, REAGENT_HOLDER_INSTANT_REACT) //same as above
|
||||
chemholder.reagents = R
|
||||
R.my_atom = chemholder
|
||||
chemholder = new()
|
||||
chemholder.create_reagents(1000, REAGENT_HOLDER_INSTANT_REACT)
|
||||
|
||||
/datum/effect_system/foam_spread/Destroy()
|
||||
qdel(chemholder)
|
||||
chemholder = null
|
||||
QDEL_NULL(chemholder)
|
||||
return ..()
|
||||
|
||||
/datum/effect_system/foam_spread/set_up(amt=5, loca, datum/reagents/carry = null, metaltype = 0)
|
||||
|
||||
@@ -265,20 +265,18 @@
|
||||
|
||||
|
||||
/datum/effect_system/smoke_spread/chem
|
||||
var/obj/chemholder
|
||||
/// Evil evil hack so we have something to "hold" our reagents
|
||||
var/atom/movable/chem_holder/chemholder
|
||||
effect_type = /obj/effect/particle_effect/smoke/chem
|
||||
|
||||
/datum/effect_system/smoke_spread/chem/New()
|
||||
..()
|
||||
chemholder = new /obj()
|
||||
var/datum/reagents/R = new (500, REAGENT_HOLDER_INSTANT_REACT) //This is a safety for now to prevent smoke generating more smoke as the smoke reagents react in the smoke. This is prevented naturally from happening even if this is off, but I want to be sure that any edge cases are prevented before I get a chance to rework smoke reactions (specifically adding water or reacting away stabilizing agent in the middle of it).
|
||||
chemholder.reagents = R
|
||||
|
||||
R.my_atom = chemholder
|
||||
chemholder = new()
|
||||
//This is a safety for now to prevent smoke generating more smoke as the smoke reagents react in the smoke. This is prevented naturally from happening even if this is off, but I want to be sure that any edge cases are prevented before I get a chance to rework smoke reactions (specifically adding water or reacting away stabilizing agent in the middle of it).
|
||||
chemholder.create_reagents(500, REAGENT_HOLDER_INSTANT_REACT)
|
||||
|
||||
/datum/effect_system/smoke_spread/chem/Destroy()
|
||||
qdel(chemholder)
|
||||
chemholder = null
|
||||
QDEL_NULL(chemholder)
|
||||
return ..()
|
||||
|
||||
/datum/effect_system/smoke_spread/chem/set_up(datum/reagents/carry = null, radius = 1, loca, silent = FALSE)
|
||||
|
||||
Reference in New Issue
Block a user