Merge pull request #1946 from Citadel-Station-13/upstream-merge-29106

[MIRROR] Chasm code cleanup
This commit is contained in:
LetterJay
2017-07-09 23:03:31 -05:00
committed by GitHub
2 changed files with 26 additions and 9 deletions
+16 -9
View File
@@ -10,6 +10,7 @@
icon_state = "smooth"
canSmoothWith = list(/turf/open/floor/fakepit, /turf/open/chasm)
density = TRUE //This will prevent hostile mobs from pathing into chasms, while the canpass override will still let it function like an open turf
var/static/list/falling_atoms = list() //Atoms currently falling into the chasm
var/drop_x = 1
var/drop_y = 1
var/drop_z = 1
@@ -79,18 +80,20 @@
INVOKE_ASYNC(src, .proc/drop, thing)
/turf/open/chasm/proc/droppable(atom/movable/AM)
if(falling_atoms[AM])
return FALSE
if(!isliving(AM) && !isobj(AM))
return 0
return FALSE
if(istype(AM, /obj/singularity) || istype(AM, /obj/item/projectile) || AM.throwing)
return 0
return FALSE
if(istype(AM, /obj/effect/portal))
//Portals aren't affected by gravity. Probably.
return 0
return FALSE
//Flies right over the chasm
if(isliving(AM))
var/mob/MM = AM
if(MM.movement_type & FLYING)
return 0
var/mob/M = AM
if(M.is_flying())
return FALSE
if(ishuman(AM))
var/mob/living/carbon/human/H = AM
if(istype(H.belt, /obj/item/device/wormhole_jaunter))
@@ -98,14 +101,14 @@
//To freak out any bystanders
visible_message("<span class='boldwarning'>[H] falls into [src]!</span>")
J.chasm_react(H)
return 0
return 1
return FALSE
return TRUE
/turf/open/chasm/proc/drop(atom/movable/AM)
//Make sure the item is still there after our sleep
if(!AM || QDELETED(AM))
return
falling_atoms[AM] = TRUE
var/turf/T = locate(drop_x, drop_y, drop_z)
if(T)
AM.visible_message("<span class='boldwarning'>[AM] falls into [src]!</span>", "<span class='userdanger'>GAH! Ah... where are you?</span>")
@@ -115,6 +118,7 @@
var/mob/living/L = AM
L.Knockdown(100)
L.adjustBruteLoss(30)
falling_atoms -= AM
/turf/open/chasm/straight_down/Initialize()
@@ -137,6 +141,7 @@
//Make sure the item is still there after our sleep
if(!AM || QDELETED(AM))
return
falling_atoms[AM] = TRUE
AM.visible_message("<span class='boldwarning'>[AM] falls into [src]!</span>", "<span class='userdanger'>You stumble and stare into an abyss before you. It stares back, and you fall \
into the enveloping dark.</span>")
if(isliving(AM))
@@ -163,6 +168,8 @@
var/mob/living/silicon/robot/S = AM
qdel(S.mmi)
falling_atoms -= AM
qdel(AM)
if(AM && !QDELETED(AM)) //It's indestructible
+10
View File
@@ -0,0 +1,10 @@
diff a/code/game/turfs/simulated/chasm.dm b/code/game/turfs/simulated/chasm.dm (rejected hunks)
@@ -91,7 +91,7 @@
return FALSE
if(istype(AM, /obj/effect/portal))
//Portals aren't affected by gravity. Probably.
- return 0
+ return FALSE
if(istype(AM, /obj/structure/stone_tile))
return FALSE
//Flies right over the chasm