@@ -77,6 +77,10 @@
|
||||
#define COMSIG_ATOM_ATTACK_HAND "atom_attack_hand" //from base of atom/attack_hand(): (mob/user)
|
||||
#define COMSIG_ATOM_ATTACK_PAW "atom_attack_paw" //from base of atom/attack_paw(): (mob/user)
|
||||
#define COMPONENT_NO_ATTACK_HAND 1 //works on all 3.
|
||||
//This signal return value bitflags can be found in __DEFINES/misc.dm
|
||||
#define COMSIG_ATOM_INTERCEPT_Z_FALL "movable_intercept_z_impact" //called for each movable in a turf contents on /turf/zImpact(): (atom/movable/A, levels)
|
||||
|
||||
|
||||
/////////////////
|
||||
|
||||
#define COMSIG_ENTER_AREA "enter_area" //from base of area/Entered(): (/area)
|
||||
|
||||
@@ -511,5 +511,10 @@ GLOBAL_LIST_INIT(pda_reskins, list(PDA_SKIN_CLASSIC = 'icons/obj/pda.dmi', PDA_S
|
||||
#define VOMIT_TOXIC 1
|
||||
#define VOMIT_PURPLE 2
|
||||
|
||||
// possible bitflag return values of intercept_zImpact(atom/movable/AM, levels = 1) calls
|
||||
#define FALL_INTERCEPTED (1<<0) //Stops the movable from falling further and crashing on the ground
|
||||
#define FALL_NO_MESSAGE (1<<1) //Used to suppress the "[A] falls through [old_turf]" messages where it'd make little sense at all, like going downstairs.
|
||||
#define FALL_STOP_INTERCEPTING (1<<2) //Used in situations where halting the whole "intercept" loop would be better, like supermatter dusting (and thus deleting) the atom.
|
||||
|
||||
//Misc text define. Does 4 spaces. Used as a makeshift tabulator.
|
||||
#define FOURSPACES " "
|
||||
|
||||
@@ -839,4 +839,4 @@ Proc for attack log creation, because really why not
|
||||
return TRUE
|
||||
|
||||
/atom/proc/intercept_zImpact(atom/movable/AM, levels = 1)
|
||||
return FALSE
|
||||
. |= SEND_SIGNAL(src, COMSIG_ATOM_INTERCEPT_Z_FALL, AM, levels)
|
||||
@@ -2,14 +2,17 @@
|
||||
#define STAIR_TERMINATOR_NO 1
|
||||
#define STAIR_TERMINATOR_YES 2
|
||||
|
||||
// dir determines the direction of travel to go upwards (due to lack of sprites, currently only 1 and 2 make sense)
|
||||
// stairs require /turf/open/openspace as the tile above them to work
|
||||
// multiple stair objects can be chained together; the Z level transition will happen on the final stair object in the chain
|
||||
|
||||
/obj/structure/stairs
|
||||
name = "stairs"
|
||||
icon = 'icons/obj/stairs.dmi'
|
||||
icon_state = "stairs"
|
||||
anchored = TRUE
|
||||
//dir = direction of travel to go upwards
|
||||
|
||||
var/force_open_above = FALSE
|
||||
var/force_open_above = FALSE // replaces the turf above this stair obj with /turf/open/openspace
|
||||
var/terminator_mode = STAIR_TERMINATOR_AUTOMATIC
|
||||
var/turf/listeningTo
|
||||
|
||||
@@ -108,7 +111,9 @@
|
||||
T.ChangeTurf(/turf/open/openspace)
|
||||
|
||||
/obj/structure/stairs/intercept_zImpact(atom/movable/AM, levels = 1)
|
||||
return isTerminator()
|
||||
. = ..()
|
||||
if(isTerminator())
|
||||
. |= FALL_INTERCEPTED | FALL_NO_MESSAGE
|
||||
|
||||
/obj/structure/stairs/proc/isTerminator() //If this is the last stair in a chain and should move mobs up
|
||||
if(terminator_mode != STAIR_TERMINATOR_AUTOMATIC)
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
icon_state = "grey"
|
||||
baseturfs = /turf/open/openspace
|
||||
CanAtmosPassVertical = ATMOS_PASS_YES
|
||||
plane = FLOOR_OPENSPACE_PLANE
|
||||
layer = OPENSPACE_LAYER
|
||||
//mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
var/can_cover_up = TRUE
|
||||
var/can_build_on = TRUE
|
||||
@@ -14,8 +12,10 @@
|
||||
..()
|
||||
return TRUE
|
||||
|
||||
/turf/open/openspace/Initialize()
|
||||
/turf/open/openspace/Initialize() // handle plane and layer here so that they don't cover other obs/turfs in Dream Maker
|
||||
. = ..()
|
||||
plane = FLOOR_OPENSPACE_PLANE
|
||||
layer = OPENSPACE_LAYER
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
/turf/open/openspace/LateInitialize()
|
||||
|
||||
@@ -141,11 +141,18 @@
|
||||
/turf/proc/zAirOut(direction, turf/source)
|
||||
return FALSE
|
||||
|
||||
/turf/proc/zImpact(atom/movable/A, levels = 1)
|
||||
/turf/proc/zImpact(atom/movable/A, levels = 1, turf/prev_turf)
|
||||
var/flags = NONE
|
||||
var/mov_name = A.name
|
||||
for(var/i in contents)
|
||||
var/atom/thing = i
|
||||
if(thing.intercept_zImpact(A, levels))
|
||||
return FALSE
|
||||
flags |= thing.intercept_zImpact(A, levels)
|
||||
if(flags & FALL_STOP_INTERCEPTING)
|
||||
break
|
||||
if(prev_turf && !(flags & FALL_NO_MESSAGE))
|
||||
prev_turf.visible_message("<span class='danger'>[mov_name] falls through [prev_turf]!</span>")
|
||||
if(flags & FALL_INTERCEPTED)
|
||||
return
|
||||
if(zFall(A, ++levels))
|
||||
return FALSE
|
||||
A.visible_message("<span class='danger'>[A] crashes into [src]!</span>")
|
||||
@@ -161,11 +168,10 @@
|
||||
return FALSE
|
||||
if(!force && (!can_zFall(A, levels, target) || !A.can_zFall(src, levels, target, DOWN)))
|
||||
return FALSE
|
||||
A.visible_message("<span class='danger'>[A] falls through [src]!</span>")
|
||||
A.zfalling = TRUE
|
||||
A.forceMove(target)
|
||||
A.zfalling = FALSE
|
||||
target.zImpact(A, levels)
|
||||
target.zImpact(A, levels, src)
|
||||
return TRUE
|
||||
|
||||
/turf/proc/handleRCL(obj/item/twohanded/rcl/C, mob/user)
|
||||
|
||||
@@ -651,7 +651,9 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
Consume(AM)
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/intercept_zImpact(atom/movable/AM, levels)
|
||||
. = ..()
|
||||
Bumped(AM)
|
||||
. |= FALL_STOP_INTERCEPTING | FALL_INTERCEPTED
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/proc/Consume(atom/movable/AM)
|
||||
if(isliving(AM))
|
||||
|
||||
Reference in New Issue
Block a user