Files
Yogstation/code/modules/fields/turf_objects.dm
alexkar598 dab25cb5a6 Dreamchecker (#8977)
* Changes obj_break on machines to use parent calls (#46485)

The way stat |= BROKEN was done was a mess, this makes everywhere use obj_break with proper parent calls and adds a signal for when a machine enters the broken state.
Why It's Good For The Game

Better code quality, more signals.

* e

* Can pass refactor (#48659)

* Makes all CanPass procs call parent

* Makes CanPass more extendable and gives the mover a say in the matter

* Replace CanPass with CanAllowThrough to use the new system

Regex replace `(?<!proc)/CanPass\(` => `/CanAllowThrough(`

* Simple optimization pass

* Adds linting for equipped() pickup() dropped() (#46614)

* lint some inventory procs

* lineends

* f

*  line end

* lineend

* fuck

* changes per review

* does more

* Changes power_change() to respect parent calls for toggling NOPOWER (#46486)

About The Pull Request

Similar to #46485
Now all relevant uses of power_change() call parent, theres a signal sent when a machine changes the NOPOWER flag, all remaining machines that were using power_change() instead of update_icon() have been fixed.
Why It's Good For The Game

code quality, eventually signal stuff. and signal stuff

* Fix Crossed/Entered/Exited/Bump/ui_act parameter casting (#49016)

About The Pull Request

Detected as part of my work on SpaceManiac/SpacemanDMM#167

* Makes Crossed and Moved should call parent (#49671)

* makes setDir shouldcallparent (#49692)

* owo

* hehe

* Update atoms.dm

* Update atoms.dm

* Update atoms_movable.dm

Co-authored-by: spookydonut <github@spooksoftware.com>
Co-authored-by: alexkar598 <>
Co-authored-by: Emmett Gaines <ninjanomnom@gmail.com>
2020-06-23 16:15:23 -04:00

80 lines
2.4 KiB
Plaintext

/obj/effect/abstract/proximity_checker/advanced
name = "field"
desc = "Why can you see energy fields?!"
icon = null
icon_state = null
alpha = 0
invisibility = INVISIBILITY_ABSTRACT
flags_1 = ON_BORDER_1
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
var/datum/proximity_monitor/advanced/parent = null
/obj/effect/abstract/proximity_checker/advanced/Initialize(mapload, _monitor)
if(_monitor)
parent = _monitor
return ..()
/obj/effect/abstract/proximity_checker/advanced/center
name = "field anchor"
desc = "No."
/obj/effect/abstract/proximity_checker/advanced/field_turf
name = "energy field"
desc = "Get off my turf!"
/obj/effect/abstract/proximity_checker/advanced/field_turf/CanAllowThrough(atom/movable/AM, turf/target)
. = ..()
if(parent)
return parent.field_turf_canpass(AM, src, target)
/obj/effect/abstract/proximity_checker/advanced/field_turf/Crossed(atom/movable/AM)
. = ..()
if(parent)
return parent.field_turf_crossed(AM, src)
return TRUE
/obj/effect/abstract/proximity_checker/advanced/field_turf/Uncross(atom/movable/AM)
if(parent)
return parent.field_turf_uncross(AM, src)
return TRUE
/obj/effect/abstract/proximity_checker/advanced/field_turf/Uncrossed(atom/movable/AM)
if(parent)
return parent.field_turf_uncrossed(AM, src)
return TRUE
/obj/effect/abstract/proximity_checker/advanced/field_edge
name = "energy field edge"
desc = "Edgy description here."
/obj/effect/abstract/proximity_checker/advanced/field_edge/CanAllowThrough(atom/movable/AM, turf/target)
. = ..()
if(parent)
return parent.field_edge_canpass(AM, src, target)
/obj/effect/abstract/proximity_checker/advanced/field_edge/Crossed(atom/movable/AM)
. = ..()
if(parent)
return parent.field_edge_crossed(AM, src)
return TRUE
/obj/effect/abstract/proximity_checker/advanced/field_edge/Uncross(atom/movable/AM)
if(parent)
return parent.field_edge_uncross(AM, src)
return TRUE
/obj/effect/abstract/proximity_checker/advanced/field_edge/Uncrossed(atom/movable/AM)
if(parent)
return parent.field_edge_uncrossed(AM, src)
return TRUE
/proc/is_turf_in_field(turf/T, datum/proximity_monitor/advanced/F) //Looking for ways to optimize this!
for(var/obj/effect/abstract/proximity_checker/advanced/O in T)
if(istype(O, /obj/effect/abstract/proximity_checker/advanced/field_edge))
if(O.parent == F)
return FIELD_EDGE
if(O.parent == F)
return FIELD_TURF
return FALSE