mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-30 09:15:22 +01:00
4ecb0bc21c
Repaths obj/machinery to obj/structure/machinery. **Note for reviewers:** the only meaningful changed code exists within **code/game/objects/structures.dm** and **code/game/objects/structures/_machinery.dm**, largely concerning damage procs. With the exception of moving airlock defines to their own file, ALL OTHER CHANGES ARE STRICTLY PATH CHANGES. Objects, _categorically_, are largely divided between those you can hold in your hand/inventory and those you can't. Machinery objects are already subtypes of Structures behaviorally, this PR just makes their pathing reflect that, and allows for future work (tool actions, more health/destruction functionality) to be developed without unnecessary code duplication. I have tested this PR by loading up the Horizon and dismantling various machines and structures with tools, shooting guns of various types throughout the ship, and detonating a bunch of explosions throughout the ship.
37 lines
1.1 KiB
Plaintext
37 lines
1.1 KiB
Plaintext
/obj/effect/decal/cleanable
|
|
mouse_opacity = MOUSE_OPACITY_ICON
|
|
var/list/random_icon_states
|
|
var/swept_away
|
|
|
|
/obj/effect/decal/cleanable/attack_hand(mob/user)
|
|
if(!swept_away && layer == DECAL_LAYER) // have to check layer otherwise more vars need to be added to determine whether it CAN be sweeped
|
|
if((locate(/obj/structure/machinery/atmospherics) in get_turf(src)) || (locate(/obj/structure/machinery/hologram/holopad) in get_turf(src)))
|
|
to_chat(user, SPAN_NOTICE("You brush \the [src] away with your hand."))
|
|
layer = TURF_DETAIL_LAYER
|
|
swept_away = TRUE
|
|
post_sweep(user)
|
|
|
|
/obj/effect/decal/cleanable/proc/post_sweep(var/mob/user)
|
|
return
|
|
|
|
/obj/effect/decal/cleanable/clean_blood(var/ignore = 0)
|
|
if(!ignore)
|
|
qdel(src)
|
|
return
|
|
..()
|
|
|
|
/obj/effect/decal/cleanable/Initialize(mapload)
|
|
if (LAZYLEN(random_icon_states))
|
|
icon_state = pick(src.random_icon_states)
|
|
. = ..()
|
|
if (!mapload && ROUND_IS_STARTED)
|
|
SSstatistics.IncrementSimpleStat("messes_made")
|
|
|
|
var/turf/T = get_turf(src)
|
|
if(T)
|
|
if(T.above?.is_open())
|
|
T.above.update_mimic()
|
|
if(T.is_space() || T.is_open())
|
|
animate(src, alpha = 0, time = 5 SECONDS)
|
|
QDEL_IN(src, 5 SECONDS)
|