mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-11 18:33:36 +00:00
Merge pull request #31286 from KorPhaeron/ismachinery
ismachinery define
This commit is contained in:
@@ -140,6 +140,8 @@
|
||||
|
||||
#define isstructure(A) (istype(A, /obj/structure))
|
||||
|
||||
#define ismachinery(A) (istype(A, /obj/machinery))
|
||||
|
||||
#define ismecha(A) (istype(A, /obj/mecha))
|
||||
|
||||
#define is_cleanable(A) (istype(A, /obj/effect/decal/cleanable) || istype(A, /obj/effect/rune)) //if something is cleanable
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
src.grille += 1
|
||||
else if(istype(O, /obj/machinery/door))
|
||||
src.door += 1
|
||||
else if(istype(O, /obj/machinery))
|
||||
else if(ismachinery(O))
|
||||
src.mach += 1
|
||||
|
||||
if(count_territories)
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
T.add_blueprints_preround(src)
|
||||
|
||||
/obj/Destroy(force=FALSE)
|
||||
if(!istype(src, /obj/machinery))
|
||||
if(!ismachinery(src))
|
||||
STOP_PROCESSING(SSobj, src) // TODO: Have a processing bitflag to reduce on unnecessary loops through the processing lists
|
||||
SStgui.close_uis(src)
|
||||
. = ..()
|
||||
|
||||
@@ -31,7 +31,7 @@ GLOBAL_LIST_INIT(duplicate_forbidden_vars,list("tag","area","type","loc","locs",
|
||||
I.damtype = STAMINA // thou shalt not
|
||||
|
||||
N.update_icon()
|
||||
if(istype(O, /obj/machinery))
|
||||
if(ismachinery(O))
|
||||
var/obj/machinery/M = O
|
||||
M.power_change()
|
||||
|
||||
|
||||
@@ -275,7 +275,7 @@
|
||||
if(O.anchored)
|
||||
continue
|
||||
|
||||
if(isitem(O) || isstructure(O) || istype(O, /obj/machinery))
|
||||
if(isitem(O) || isstructure(O) || ismachinery(O))
|
||||
cocoon_target = O
|
||||
busy = MOVING_TO_TARGET
|
||||
stop_automated_movement = 1
|
||||
|
||||
@@ -144,7 +144,7 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca
|
||||
icon_living = icon_state
|
||||
copy_overlays(O)
|
||||
add_overlay(googly_eyes)
|
||||
if(isstructure(O) || istype(O, /obj/machinery))
|
||||
if(isstructure(O) || ismachinery(O))
|
||||
health = (anchored * 50) + 50
|
||||
destroy_objects = 1
|
||||
if(O.density && O.anchored)
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
origin_tech = "programming=2;engineering=2;powerstorage=3"
|
||||
|
||||
/obj/item/computer_hardware/recharger/APC/use_power(amount, charging=0)
|
||||
if(istype(holder.physical, /obj/machinery))
|
||||
if(ismachinery(holder.physical))
|
||||
var/obj/machinery/M = holder.physical
|
||||
if(M.powered())
|
||||
M.use_power(amount)
|
||||
@@ -55,13 +55,13 @@
|
||||
origin_tech = "engineering=2;powerstorage=1"
|
||||
|
||||
/obj/item/computer_hardware/recharger/wired/can_install(obj/item/device/modular_computer/M, mob/living/user = null)
|
||||
if(istype(M.physical, /obj/machinery) && M.physical.anchored)
|
||||
if(ismachinery(M.physical) && M.physical.anchored)
|
||||
return ..()
|
||||
to_chat(user, "<span class='warning'>\The [src] is incompatible with portable computers!</span>")
|
||||
return 0
|
||||
|
||||
/obj/item/computer_hardware/recharger/wired/use_power(amount, charging=0)
|
||||
if(istype(holder.physical, /obj/machinery) && holder.physical.anchored)
|
||||
if(ismachinery(holder.physical) && holder.physical.anchored)
|
||||
var/obj/machinery/M = holder.physical
|
||||
var/turf/T = M.loc
|
||||
if(!T || !istype(T))
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
if(isliving(mover))
|
||||
shock(mover)
|
||||
|
||||
if(istype(mover, /obj/machinery) || isstructure(mover) || ismecha(mover))
|
||||
if(ismachinery(mover) || isstructure(mover) || ismecha(mover))
|
||||
bump_field(mover)
|
||||
|
||||
/obj/machinery/field/containment/proc/set_master(master1,master2)
|
||||
@@ -90,13 +90,13 @@
|
||||
if(isliving(mover))
|
||||
shock(mover)
|
||||
return
|
||||
if(istype(mover, /obj/machinery) || isstructure(mover) || ismecha(mover))
|
||||
if(ismachinery(mover) || isstructure(mover) || ismecha(mover))
|
||||
bump_field(mover)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/field/CanPass(atom/movable/mover, turf/target)
|
||||
if(hasShocked || isliving(mover) || istype(mover, /obj/machinery) || isstructure(mover) || ismecha(mover))
|
||||
if(hasShocked || isliving(mover) || ismachinery(mover) || isstructure(mover) || ismecha(mover))
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
else if(closest_mob)
|
||||
continue
|
||||
|
||||
else if(istype(A, /obj/machinery))
|
||||
else if(ismachinery(A))
|
||||
var/obj/machinery/M = A
|
||||
var/dist = get_dist(source, A)
|
||||
if(dist <= zap_range && (dist < closest_dist || !closest_machine) && !M.being_shocked)
|
||||
|
||||
Reference in New Issue
Block a user