mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 14:39:58 +01:00
update_appearance (#55468)
Creates update_name and update_desc Creates the wrapper proc update_appearance to batch update_name, update_desc, and update_icon together Less non-icon handling code in update_icon and friends Signal hooks for things that want to change names and descriptions 99%+ of the changes in this are just from switching everything over to update_appearance from update_icon
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
circuit = null
|
||||
if((state != GLASS_CORE) && (state != AI_READY_CORE))
|
||||
state = EMPTY_CORE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
if(A == brain)
|
||||
brain = null
|
||||
return ..()
|
||||
@@ -120,7 +120,7 @@
|
||||
return
|
||||
playsound(loc, 'sound/items/deconstruct.ogg', 50, TRUE)
|
||||
to_chat(user, "<span class='notice'>You place the circuit board inside the frame.</span>")
|
||||
update_icon()
|
||||
update_appearance()
|
||||
state = CIRCUIT_CORE
|
||||
circuit = P
|
||||
return
|
||||
@@ -129,13 +129,13 @@
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You screw the circuit board into place.</span>")
|
||||
state = SCREWED_CORE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
return
|
||||
if(P.tool_behaviour == TOOL_CROWBAR)
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You remove the circuit board.</span>")
|
||||
state = EMPTY_CORE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
circuit.forceMove(loc)
|
||||
circuit = null
|
||||
return
|
||||
@@ -144,7 +144,7 @@
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You unfasten the circuit board.</span>")
|
||||
state = CIRCUIT_CORE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
return
|
||||
if(istype(P, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/C = P
|
||||
@@ -154,7 +154,7 @@
|
||||
if(do_after(user, 20, target = src) && state == SCREWED_CORE && C.use(5))
|
||||
to_chat(user, "<span class='notice'>You add cables to the frame.</span>")
|
||||
state = CABLED_CORE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need five lengths of cable to wire the AI core!</span>")
|
||||
return
|
||||
@@ -166,7 +166,7 @@
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You remove the cables.</span>")
|
||||
state = SCREWED_CORE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
new /obj/item/stack/cable_coil(drop_location(), 5)
|
||||
return
|
||||
|
||||
@@ -178,7 +178,7 @@
|
||||
if(do_after(user, 20, target = src) && state == CABLED_CORE && G.use(2))
|
||||
to_chat(user, "<span class='notice'>You put in the glass panel.</span>")
|
||||
state = GLASS_CORE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need two sheets of reinforced glass to insert them into the AI core!</span>")
|
||||
return
|
||||
@@ -206,7 +206,7 @@
|
||||
|
||||
brain = M
|
||||
to_chat(user, "<span class='notice'>You add [M.name] to the frame.</span>")
|
||||
update_icon()
|
||||
update_appearance()
|
||||
return
|
||||
|
||||
if(P.tool_behaviour == TOOL_CROWBAR && brain)
|
||||
@@ -214,7 +214,7 @@
|
||||
to_chat(user, "<span class='notice'>You remove the brain.</span>")
|
||||
brain.forceMove(loc)
|
||||
brain = null
|
||||
update_icon()
|
||||
update_appearance()
|
||||
return
|
||||
|
||||
if(GLASS_CORE)
|
||||
@@ -222,7 +222,7 @@
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You remove the glass panel.</span>")
|
||||
state = CABLED_CORE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
new /obj/item/stack/sheet/rglass(loc, 2)
|
||||
return
|
||||
|
||||
@@ -249,7 +249,7 @@
|
||||
qdel(src)
|
||||
else
|
||||
state = AI_READY_CORE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
return
|
||||
|
||||
if(AI_READY_CORE)
|
||||
@@ -260,7 +260,7 @@
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You disconnect the monitor.</span>")
|
||||
state = GLASS_CORE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
return
|
||||
return ..()
|
||||
|
||||
@@ -281,6 +281,7 @@
|
||||
icon_state = "4"
|
||||
if(AI_READY_CORE)
|
||||
icon_state = "ai-empty"
|
||||
return ..()
|
||||
|
||||
/obj/structure/ai_core/deconstruct(disassembled = TRUE)
|
||||
if(state == GLASS_CORE)
|
||||
|
||||
@@ -277,7 +277,7 @@
|
||||
|
||||
/obj/structure/alien/egg/Initialize(mapload)
|
||||
. = ..()
|
||||
update_icon()
|
||||
update_appearance()
|
||||
if(status == GROWING || status == GROWN)
|
||||
child = new(src)
|
||||
if(status == GROWING)
|
||||
@@ -298,6 +298,7 @@
|
||||
icon_state = "[base_icon]"
|
||||
if(BURST)
|
||||
icon_state = "[base_icon]_hatched"
|
||||
return ..()
|
||||
|
||||
/obj/structure/alien/egg/attack_paw(mob/living/user, list/modifiers)
|
||||
return attack_hand(user, modifiers)
|
||||
@@ -330,7 +331,7 @@
|
||||
|
||||
/obj/structure/alien/egg/proc/Grow()
|
||||
status = GROWN
|
||||
update_icon()
|
||||
update_appearance()
|
||||
proximity_monitor.SetRange(1)
|
||||
|
||||
//drops and kills the hugger if any is remaining
|
||||
@@ -338,7 +339,7 @@
|
||||
if(status == GROWN || status == GROWING)
|
||||
proximity_monitor.SetRange(0)
|
||||
status = BURST
|
||||
update_icon()
|
||||
update_appearance()
|
||||
flick("egg_opening", src)
|
||||
addtimer(CALLBACK(src, .proc/finish_bursting, kill), 15)
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
var/y = text2num(params["y"])
|
||||
grid[x][y] = color
|
||||
used = TRUE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
. = TRUE
|
||||
if("finalize")
|
||||
. = TRUE
|
||||
@@ -133,17 +133,19 @@
|
||||
|
||||
/obj/item/canvas/update_overlays()
|
||||
. = ..()
|
||||
if(!icon_generated)
|
||||
if(used)
|
||||
var/mutable_appearance/detail = mutable_appearance(icon,"[icon_state]wip")
|
||||
detail.pixel_x = 1
|
||||
detail.pixel_y = 1
|
||||
. += detail
|
||||
else
|
||||
if(icon_generated)
|
||||
var/mutable_appearance/detail = mutable_appearance(generated_icon)
|
||||
detail.pixel_x = 1
|
||||
detail.pixel_y = 1
|
||||
. += detail
|
||||
return
|
||||
if(!used)
|
||||
return
|
||||
|
||||
var/mutable_appearance/detail = mutable_appearance(icon, "[icon_state]wip")
|
||||
detail.pixel_x = 1
|
||||
detail.pixel_y = 1
|
||||
. += detail
|
||||
|
||||
/obj/item/canvas/proc/generate_proper_overlay()
|
||||
if(icon_generated)
|
||||
@@ -154,7 +156,7 @@
|
||||
CRASH("Error generating painting png : [result]")
|
||||
generated_icon = new(png_filename)
|
||||
icon_generated = TRUE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/item/canvas/proc/get_data_string()
|
||||
var/list/data = list()
|
||||
@@ -241,6 +243,7 @@
|
||||
desc = "Art or \"Art\"? You decide."
|
||||
icon = 'icons/obj/decals.dmi'
|
||||
icon_state = "frame-empty"
|
||||
base_icon_state = "frame"
|
||||
custom_materials = list(/datum/material/wood = 2000)
|
||||
buildable_sign = FALSE
|
||||
///Canvas we're currently displaying.
|
||||
@@ -284,8 +287,7 @@
|
||||
current_canvas.forceMove(drop_location())
|
||||
current_canvas = null
|
||||
to_chat(user, "<span class='notice'>You remove the painting from the frame.</span>")
|
||||
update_icon()
|
||||
update_name_and_desc()
|
||||
update_appearance()
|
||||
return TRUE
|
||||
|
||||
/obj/structure/sign/painting/proc/frame_canvas(mob/user,obj/item/canvas/new_canvas)
|
||||
@@ -294,40 +296,37 @@
|
||||
if(!current_canvas.finalized)
|
||||
current_canvas.finalize(user)
|
||||
to_chat(user,"<span class='notice'>You frame [current_canvas].</span>")
|
||||
update_icon()
|
||||
update_name_and_desc()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/sign/painting/proc/try_rename(mob/user)
|
||||
if(current_canvas.painting_name == initial(current_canvas.painting_name))
|
||||
current_canvas.try_rename(user)
|
||||
|
||||
/obj/structure/sign/painting/proc/update_name_and_desc()
|
||||
if(current_canvas)
|
||||
name = "painting - [current_canvas.painting_name]"
|
||||
desc = desc_with_canvas
|
||||
else
|
||||
name = initial(name)
|
||||
desc = initial(desc)
|
||||
/obj/structure/sign/painting/update_name(updates)
|
||||
name = current_canvas ? "painting - [current_canvas.painting_name]" : initial(name)
|
||||
return ..()
|
||||
|
||||
/obj/structure/sign/painting/update_desc(updates)
|
||||
desc = current_canvas ? desc_with_canvas : initial(desc)
|
||||
return ..()
|
||||
|
||||
/obj/structure/sign/painting/update_icon_state()
|
||||
. = ..()
|
||||
if(current_canvas?.generated_icon)
|
||||
icon_state = "frame-overlay"
|
||||
else
|
||||
icon_state = "frame-empty"
|
||||
|
||||
icon_state = "[base_icon_state]-[current_canvas?.generated_icon ? "overlay" : "empty"]"
|
||||
return ..()
|
||||
|
||||
/obj/structure/sign/painting/update_overlays()
|
||||
. = ..()
|
||||
if(current_canvas?.generated_icon)
|
||||
var/mutable_appearance/MA = mutable_appearance(current_canvas.generated_icon)
|
||||
MA.pixel_x = current_canvas.framed_offset_x
|
||||
MA.pixel_y = current_canvas.framed_offset_y
|
||||
. += MA
|
||||
var/mutable_appearance/frame = mutable_appearance(current_canvas.icon,"[current_canvas.icon_state]frame")
|
||||
frame.pixel_x = current_canvas.framed_offset_x - 1
|
||||
frame.pixel_y = current_canvas.framed_offset_y - 1
|
||||
. += frame
|
||||
if(!current_canvas?.generated_icon)
|
||||
return
|
||||
|
||||
var/mutable_appearance/MA = mutable_appearance(current_canvas.generated_icon)
|
||||
MA.pixel_x = current_canvas.framed_offset_x
|
||||
MA.pixel_y = current_canvas.framed_offset_y
|
||||
. += MA
|
||||
var/mutable_appearance/frame = mutable_appearance(current_canvas.icon,"[current_canvas.icon_state]frame")
|
||||
frame.pixel_x = current_canvas.framed_offset_x - 1
|
||||
frame.pixel_y = current_canvas.framed_offset_y - 1
|
||||
. += frame
|
||||
|
||||
/obj/structure/sign/painting/proc/load_persistent()
|
||||
if(!persistence_id)
|
||||
@@ -362,8 +361,7 @@
|
||||
new_canvas.author_ckey = author
|
||||
new_canvas.name = "painting - [title]"
|
||||
current_canvas = new_canvas
|
||||
update_icon()
|
||||
update_name_and_desc()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/sign/painting/proc/save_persistent()
|
||||
if(!persistence_id || !current_canvas)
|
||||
@@ -439,7 +437,6 @@
|
||||
for(var/obj/structure/sign/painting/P in SSpersistence.painting_frames)
|
||||
if(P.current_canvas && md5(P.current_canvas.get_data_string()) == md5)
|
||||
QDEL_NULL(P.current_canvas)
|
||||
P.update_icon()
|
||||
P.update_name_and_desc()
|
||||
P.update_appearance()
|
||||
log_admin("[key_name(user)] has deleted a persistent painting made by [author].")
|
||||
message_admins("<span class='notice'>[key_name_admin(user)] has deleted persistent painting made by [author].</span>")
|
||||
|
||||
@@ -325,11 +325,12 @@ LINEN BINS
|
||||
icon_state = "linenbin-half"
|
||||
else
|
||||
icon_state = "linenbin-full"
|
||||
return ..()
|
||||
|
||||
/obj/structure/bedsheetbin/fire_act(exposed_temperature, exposed_volume)
|
||||
if(amount)
|
||||
amount = 0
|
||||
update_icon()
|
||||
update_appearance()
|
||||
..()
|
||||
|
||||
/obj/structure/bedsheetbin/attackby(obj/item/I, mob/user, params)
|
||||
@@ -339,7 +340,7 @@ LINEN BINS
|
||||
sheets.Add(I)
|
||||
amount++
|
||||
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
else if(default_unfasten_wrench(user, I, 5))
|
||||
return
|
||||
@@ -388,7 +389,7 @@ LINEN BINS
|
||||
B.forceMove(drop_location())
|
||||
user.put_in_hands(B)
|
||||
to_chat(user, "<span class='notice'>You take [B] out of [src].</span>")
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
if(hidden)
|
||||
hidden.forceMove(drop_location())
|
||||
@@ -412,7 +413,7 @@ LINEN BINS
|
||||
|
||||
B.forceMove(drop_location())
|
||||
to_chat(user, "<span class='notice'>You telekinetically remove [B] from [src].</span>")
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
if(hidden)
|
||||
hidden.forceMove(drop_location())
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
if(mapload && !opened) // if closed, any item at the crate's loc is put in the contents
|
||||
addtimer(CALLBACK(src, .proc/take_contents), 0)
|
||||
. = ..()
|
||||
update_icon()
|
||||
update_appearance()
|
||||
PopulateContents()
|
||||
|
||||
//USE THIS TO FILL IT, NOT INITIALIZE OR NEW
|
||||
@@ -56,14 +56,19 @@
|
||||
dump_contents()
|
||||
return ..()
|
||||
|
||||
/obj/structure/closet/update_appearance(updates=ALL)
|
||||
. = ..()
|
||||
if(opened || broken || !secure)
|
||||
luminosity = 0
|
||||
return
|
||||
luminosity = 1
|
||||
|
||||
/obj/structure/closet/update_icon()
|
||||
. = ..()
|
||||
if (istype(src, /obj/structure/closet/supplypod))
|
||||
if(istype(src, /obj/structure/closet/supplypod))
|
||||
return
|
||||
if(!opened)
|
||||
layer = OBJ_LAYER
|
||||
else
|
||||
layer = BELOW_OBJ_LAYER
|
||||
|
||||
layer = opened ? BELOW_OBJ_LAYER : OBJ_LAYER
|
||||
|
||||
/obj/structure/closet/update_overlays()
|
||||
. = ..()
|
||||
@@ -71,28 +76,19 @@
|
||||
|
||||
/obj/structure/closet/proc/closet_update_overlays(list/new_overlays)
|
||||
. = new_overlays
|
||||
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
|
||||
luminosity = 0
|
||||
if(!opened)
|
||||
if(icon_door)
|
||||
. += "[icon_door]_door"
|
||||
else
|
||||
. += "[icon_state]_door"
|
||||
if(welded)
|
||||
. += icon_welded
|
||||
if(secure && !broken)
|
||||
//Overlay is similar enough for both that we can use the same mask for both
|
||||
luminosity = 1
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "locked", EMISSIVE_LAYER, EMISSIVE_PLANE, dir, alpha)
|
||||
if(locked)
|
||||
. += "locked"
|
||||
else
|
||||
. += "unlocked"
|
||||
else
|
||||
if(icon_door_override)
|
||||
. += "[icon_door]_open"
|
||||
else
|
||||
. += "[icon_state]_open"
|
||||
if(opened)
|
||||
. += "[icon_door_override ? icon_door : icon_state]_open"
|
||||
return
|
||||
|
||||
. += "[icon_door || icon_state]_door"
|
||||
if(welded)
|
||||
. += icon_welded
|
||||
|
||||
if(broken || !secure)
|
||||
return
|
||||
//Overlay is similar enough for both that we can use the same mask for both
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "locked", EMISSIVE_LAYER, EMISSIVE_PLANE, dir, alpha)
|
||||
. += locked ? "locked" : "unlocked"
|
||||
|
||||
/obj/structure/closet/examine(mob/user)
|
||||
. = ..()
|
||||
@@ -168,7 +164,7 @@
|
||||
if(!dense_when_open)
|
||||
density = FALSE
|
||||
dump_contents()
|
||||
update_icon()
|
||||
update_appearance()
|
||||
after_open(user, force)
|
||||
return TRUE
|
||||
|
||||
@@ -224,7 +220,7 @@
|
||||
playsound(loc, close_sound, close_sound_volume, TRUE, -3)
|
||||
opened = FALSE
|
||||
density = TRUE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
after_close(user)
|
||||
return TRUE
|
||||
|
||||
@@ -294,7 +290,7 @@
|
||||
"<span class='notice'>You [welded ? "weld" : "unwelded"] \the [src] with \the [W].</span>",
|
||||
"<span class='hear'>You hear welding.</span>")
|
||||
log_game("[key_name(user)] [welded ? "welded":"unwelded"] closet [src] with [W] at [AREACOORD(src)]")
|
||||
update_icon()
|
||||
update_appearance()
|
||||
else if(W.tool_behaviour == TOOL_WRENCH && anchorable)
|
||||
if(isinspace() && !anchored)
|
||||
return
|
||||
@@ -466,7 +462,7 @@
|
||||
locked = !locked
|
||||
user.visible_message("<span class='notice'>[user] [locked ? null : "un"]locks [src].</span>",
|
||||
"<span class='notice'>You [locked ? null : "un"]lock [src].</span>")
|
||||
update_icon()
|
||||
update_appearance()
|
||||
else if(!silent)
|
||||
to_chat(user, "<span class='alert'>Access Denied.</span>")
|
||||
else if(secure && broken)
|
||||
@@ -481,7 +477,7 @@
|
||||
playsound(src, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
broken = TRUE
|
||||
locked = FALSE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/closet/get_remote_view_fullscreens(mob/user)
|
||||
if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS)))
|
||||
@@ -497,7 +493,7 @@
|
||||
if(secure && !broken && !(. & EMP_PROTECT_SELF))
|
||||
if(prob(50 / severity))
|
||||
locked = !locked
|
||||
update_icon()
|
||||
update_appearance()
|
||||
if(prob(20 / severity) && !opened)
|
||||
if(!locked)
|
||||
open()
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
if(t)
|
||||
name = "[initial(name)] - [t]"
|
||||
tagged = TRUE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
else
|
||||
name = initial(name)
|
||||
return
|
||||
@@ -47,7 +47,7 @@
|
||||
to_chat(user, "<span class='notice'>You cut the tag off [src].</span>")
|
||||
name = "body bag"
|
||||
tagged = FALSE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/closet/body_bag/update_overlays()
|
||||
. = ..()
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
if(allowed(user) || !registered_name || (istype(I) && (registered_name == I.registered_name)))
|
||||
//they can open all lockers, or nobody owns this, or they own this locker
|
||||
locked = !locked
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
if(!registered_name)
|
||||
registered_name = I.registered_name
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
AddElement(/datum/element/climbable, climb_time = crate_climb_time * 0.5, climb_stun = 0)
|
||||
else
|
||||
AddElement(/datum/element/climbable, climb_time = crate_climb_time, climb_stun = 0)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/closet/crate/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
@@ -39,6 +39,7 @@
|
||||
|
||||
/obj/structure/closet/crate/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][opened ? "open" : ""]"
|
||||
return ..()
|
||||
|
||||
/obj/structure/closet/crate/closet_update_overlays(list/new_overlays)
|
||||
. = new_overlays
|
||||
@@ -70,7 +71,7 @@
|
||||
playsound(src, 'sound/items/poster_ripped.ogg', 75, TRUE)
|
||||
manifest.forceMove(get_turf(src))
|
||||
manifest = null
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/closet/crate/proc/tear_manifest(mob/user)
|
||||
to_chat(user, "<span class='notice'>You tear the manifest off of [src].</span>")
|
||||
@@ -80,7 +81,7 @@
|
||||
if(ishuman(user))
|
||||
user.put_in_hands(manifest)
|
||||
manifest = null
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/closet/crate/coffin
|
||||
name = "coffin"
|
||||
|
||||
@@ -10,16 +10,17 @@
|
||||
|
||||
/obj/structure/closet/crate/bin/Initialize()
|
||||
. = ..()
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/closet/crate/bin/update_overlays()
|
||||
. = ..()
|
||||
if(contents.len == 0)
|
||||
. += "largebing"
|
||||
else if(contents.len >= storage_capacity)
|
||||
return
|
||||
if(contents.len >= storage_capacity)
|
||||
. += "largebinr"
|
||||
else
|
||||
. += "largebino"
|
||||
return
|
||||
. += "largebino"
|
||||
|
||||
/obj/structure/closet/crate/bin/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/storage/bag/trash))
|
||||
@@ -27,7 +28,7 @@
|
||||
to_chat(user, "<span class='notice'>You fill the bag.</span>")
|
||||
for(var/obj/item/O in src)
|
||||
SEND_SIGNAL(T, COMSIG_TRY_STORAGE_INSERT, O, user, TRUE)
|
||||
T.update_icon()
|
||||
T.update_appearance()
|
||||
do_animate()
|
||||
return TRUE
|
||||
else
|
||||
@@ -40,4 +41,4 @@
|
||||
|
||||
/obj/structure/closet/crate/bin/proc/do_close()
|
||||
playsound(loc, close_sound, 15, TRUE, -3)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
@@ -27,16 +27,18 @@
|
||||
return ..()
|
||||
|
||||
/obj/structure/closet/crate/critter/update_icon_state()
|
||||
SHOULD_CALL_PARENT(FALSE)
|
||||
return
|
||||
|
||||
/obj/structure/closet/crate/critter/update_overlays()
|
||||
. = ..()
|
||||
if(opened)
|
||||
. += "crittercrate_door_open"
|
||||
else
|
||||
. += "crittercrate_door"
|
||||
if(manifest)
|
||||
. += "manifest"
|
||||
return
|
||||
|
||||
. += "crittercrate_door"
|
||||
if(manifest)
|
||||
. += "manifest"
|
||||
|
||||
/obj/structure/closet/crate/critter/return_air()
|
||||
if(tank)
|
||||
|
||||
@@ -13,10 +13,11 @@
|
||||
. = ..()
|
||||
if(broken)
|
||||
. += "securecrateemag"
|
||||
else if(locked)
|
||||
return
|
||||
if(locked)
|
||||
. += "securecrater"
|
||||
else
|
||||
. += "securecrateg"
|
||||
return
|
||||
. += "securecrateg"
|
||||
|
||||
/obj/structure/closet/crate/secure/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1)
|
||||
if(prob(tamperproof) && damage_amount >= DAMAGE_PRECISION)
|
||||
@@ -116,7 +117,7 @@
|
||||
user.visible_message("<span class='notice'>[user] unlocks [src]'s privacy lock.</span>",
|
||||
"<span class='notice'>You unlock [src]'s privacy lock.</span>")
|
||||
privacy_lock = FALSE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
else if(!silent)
|
||||
to_chat(user, "<span class='notice'>Bank account does not match with buyer!</span>")
|
||||
else if(!silent)
|
||||
|
||||
@@ -31,19 +31,19 @@
|
||||
trophy_message = showpiece_entry["trophy_message"]
|
||||
if(start_showpiece_type)
|
||||
showpiece = new start_showpiece_type (src)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/displaycase/vv_edit_var(vname, vval)
|
||||
. = ..()
|
||||
if(vname in list(NAMEOF(src, open), NAMEOF(src, showpiece), NAMEOF(src, custom_glass_overlay)))
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/displaycase/handle_atom_del(atom/A)
|
||||
if(A == electronics)
|
||||
electronics = null
|
||||
if(A == showpiece)
|
||||
showpiece = null
|
||||
update_icon()
|
||||
update_appearance()
|
||||
return ..()
|
||||
|
||||
/obj/structure/displaycase/Destroy()
|
||||
@@ -65,7 +65,7 @@
|
||||
return
|
||||
showpiece.forceMove(drop_location())
|
||||
showpiece = null
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/displaycase/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
|
||||
switch(damage_type)
|
||||
@@ -88,7 +88,7 @@
|
||||
broken = TRUE
|
||||
new /obj/item/shard(drop_location())
|
||||
playsound(src, "shatter", 70, TRUE)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
trigger_alarm()
|
||||
|
||||
///Anti-theft alarm triggered when broken.
|
||||
@@ -110,8 +110,10 @@
|
||||
return
|
||||
if(broken)
|
||||
. += "[initial(icon_state)]_broken"
|
||||
else if(!open)
|
||||
return
|
||||
if(!open)
|
||||
. += "[initial(icon_state)]_closed"
|
||||
return
|
||||
|
||||
/obj/structure/displaycase/attackby(obj/item/W, mob/living/user, params)
|
||||
if(W.GetID() && !broken && openable)
|
||||
@@ -128,7 +130,7 @@
|
||||
to_chat(user, "<span class='notice'>You begin repairing [src]...</span>")
|
||||
if(W.use_tool(src, user, 40, amount=5, volume=50))
|
||||
obj_integrity = max_integrity
|
||||
update_icon()
|
||||
update_appearance()
|
||||
to_chat(user, "<span class='notice'>You repair [src].</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] is already in good condition!</span>")
|
||||
@@ -157,7 +159,7 @@
|
||||
G.use(2)
|
||||
broken = FALSE
|
||||
obj_integrity = max_integrity
|
||||
update_icon()
|
||||
update_appearance()
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -168,11 +170,11 @@
|
||||
if(user.transferItemToLoc(wack, src))
|
||||
showpiece = wack
|
||||
to_chat(user, "<span class='notice'>You put [wack] on display.</span>")
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/displaycase/proc/toggle_lock(mob/user)
|
||||
open = !open
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/displaycase/attack_paw(mob/user, list/modifiers)
|
||||
return attack_hand(user, modifiers)
|
||||
@@ -334,7 +336,7 @@
|
||||
to_chat(user, "<span class='notice'>You insert [W] into the case.</span>")
|
||||
showpiece = W
|
||||
added_roundstart = FALSE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
placer_key = user.ckey
|
||||
|
||||
@@ -399,6 +401,7 @@
|
||||
|
||||
/obj/structure/displaycase/forsale/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][broken ? "_broken" : (open ? "_open" : (!showpiece ? "_empty" : null))]"
|
||||
return ..()
|
||||
|
||||
/obj/structure/displaycase/forsale/update_overlays()
|
||||
. = ..()
|
||||
@@ -468,7 +471,7 @@
|
||||
playsound(src, 'sound/effects/cashregister.ogg', 40, TRUE)
|
||||
flick("[initial(icon_state)]_vend", src)
|
||||
showpiece = null
|
||||
update_icon()
|
||||
update_appearance()
|
||||
SStgui.update_uis(src)
|
||||
return TRUE
|
||||
if("Open")
|
||||
@@ -534,7 +537,7 @@
|
||||
if(do_after(user, 20, target = src))
|
||||
broken = FALSE
|
||||
obj_integrity = max_integrity
|
||||
update_icon()
|
||||
update_appearance()
|
||||
return TRUE
|
||||
|
||||
/obj/structure/displaycase/forsale/wrench_act(mob/living/user, obj/item/I)
|
||||
@@ -574,7 +577,7 @@
|
||||
if(!broken && !(flags_1 & NODECONSTRUCT_1))
|
||||
broken = TRUE
|
||||
playsound(src, "shatter", 70, TRUE)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
trigger_alarm() //In case it's given an alarm anyway.
|
||||
|
||||
/obj/structure/displaycase/forsale/kitchen
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
last_process = world.time
|
||||
to_chat(user, "<span class='notice'>The water feels warm and soothing as you touch it. The fountain immediately dries up shortly afterwards.</span>")
|
||||
user.reagents.add_reagent(/datum/reagent/medicine/omnizine/godblood,20)
|
||||
update_icon()
|
||||
addtimer(CALLBACK(src, /atom/.proc/update_icon), time_between_uses)
|
||||
update_appearance()
|
||||
addtimer(CALLBACK(src, /atom/.proc/update_appearance), time_between_uses)
|
||||
|
||||
|
||||
/obj/structure/healingfountain/update_icon_state()
|
||||
@@ -49,3 +49,4 @@
|
||||
icon_state = "fountain"
|
||||
else
|
||||
icon_state = "fountain-red"
|
||||
return ..()
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
/obj/structure/door_assembly/Initialize()
|
||||
. = ..()
|
||||
update_icon()
|
||||
update_appearance()
|
||||
update_name()
|
||||
|
||||
/obj/structure/door_assembly/examine(mob/user)
|
||||
@@ -263,12 +263,12 @@
|
||||
door.name = base_name
|
||||
door.previous_airlock = previous_assembly
|
||||
electronics.forceMove(door)
|
||||
door.update_icon()
|
||||
door.update_appearance()
|
||||
qdel(src)
|
||||
else
|
||||
return ..()
|
||||
update_name()
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/door_assembly/update_overlays()
|
||||
. = ..()
|
||||
@@ -278,7 +278,7 @@
|
||||
. += get_airlock_overlay("glass_construction", overlays_file)
|
||||
. += get_airlock_overlay("panel_c[state+1]", overlays_file)
|
||||
|
||||
/obj/structure/door_assembly/proc/update_name()
|
||||
/obj/structure/door_assembly/update_name()
|
||||
name = ""
|
||||
switch(state)
|
||||
if(AIRLOCK_ASSEMBLY_NEEDS_WIRES)
|
||||
@@ -289,6 +289,7 @@
|
||||
if(AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER)
|
||||
name = "near finished "
|
||||
name += "[heat_proof_finished ? "heat-proofed " : ""][glass ? "window " : ""][base_name] assembly"
|
||||
return ..()
|
||||
|
||||
/obj/structure/door_assembly/proc/transfer_assembly_vars(obj/structure/door_assembly/source, obj/structure/door_assembly/target, previous = FALSE)
|
||||
target.glass = source.glass
|
||||
@@ -301,7 +302,7 @@
|
||||
if(electronics)
|
||||
target.electronics = source.electronics
|
||||
source.electronics.forceMove(target)
|
||||
target.update_icon()
|
||||
target.update_appearance()
|
||||
target.update_name()
|
||||
qdel(source)
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
/obj/structure/extinguisher_cabinet/handle_atom_del(atom/A)
|
||||
if(A == stored_extinguisher)
|
||||
stored_extinguisher = null
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/extinguisher_cabinet/attackby(obj/item/I, mob/living/user, params)
|
||||
if(I.tool_behaviour == TOOL_WRENCH && !stored_extinguisher)
|
||||
@@ -64,7 +64,7 @@
|
||||
return
|
||||
stored_extinguisher = I
|
||||
to_chat(user, "<span class='notice'>You place [I] in [src].</span>")
|
||||
update_icon()
|
||||
update_appearance()
|
||||
return TRUE
|
||||
else
|
||||
toggle_cabinet(user)
|
||||
@@ -87,7 +87,7 @@
|
||||
if(!opened)
|
||||
opened = 1
|
||||
playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
else
|
||||
toggle_cabinet(user)
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
stored_extinguisher = null
|
||||
opened = TRUE
|
||||
playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
return
|
||||
toggle_cabinet(user)
|
||||
|
||||
@@ -119,18 +119,20 @@
|
||||
else
|
||||
playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3)
|
||||
opened = !opened
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/extinguisher_cabinet/update_icon_state()
|
||||
if(!opened)
|
||||
icon_state = "extinguisher_closed"
|
||||
else if(stored_extinguisher)
|
||||
if(istype(stored_extinguisher, /obj/item/extinguisher/mini))
|
||||
icon_state = "extinguisher_mini"
|
||||
else
|
||||
icon_state = "extinguisher_full"
|
||||
else
|
||||
return ..()
|
||||
if(!stored_extinguisher)
|
||||
icon_state = "extinguisher_empty"
|
||||
return ..()
|
||||
if(istype(stored_extinguisher, /obj/item/extinguisher/mini))
|
||||
icon_state = "extinguisher_mini"
|
||||
return ..()
|
||||
icon_state = "extinguisher_full"
|
||||
return ..()
|
||||
|
||||
/obj/structure/extinguisher_cabinet/obj_break(damage_flag)
|
||||
if(!broken && !(flags_1 & NODECONSTRUCT_1))
|
||||
@@ -139,7 +141,7 @@
|
||||
if(stored_extinguisher)
|
||||
stored_extinguisher.forceMove(loc)
|
||||
stored_extinguisher = null
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
|
||||
/obj/structure/extinguisher_cabinet/deconstruct(disassembled = TRUE)
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
return
|
||||
|
||||
opening = TRUE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
if(!density)
|
||||
var/srcturf = get_turf(src)
|
||||
for(var/mob/living/obstacle in srcturf) //Stop people from using this as a shield
|
||||
@@ -51,24 +51,27 @@
|
||||
density = !density
|
||||
set_opacity(density)
|
||||
opening = FALSE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
air_update_turf(TRUE, !density)
|
||||
|
||||
/obj/structure/falsewall/update_icon()//Calling icon_update will refresh the smoothwalls if it's closed, otherwise it will make sure the icon is correct if it's open
|
||||
. = ..()
|
||||
if(!density)
|
||||
return
|
||||
|
||||
if(opening)
|
||||
if(density)
|
||||
icon_state = "fwall_opening"
|
||||
smoothing_flags = NONE
|
||||
clear_smooth_overlays()
|
||||
else
|
||||
icon_state = "fwall_closing"
|
||||
smoothing_flags = NONE
|
||||
clear_smooth_overlays()
|
||||
else
|
||||
if(density)
|
||||
icon_state = "[base_icon_state]-[smoothing_junction]"
|
||||
smoothing_flags = SMOOTH_BITMASK
|
||||
QUEUE_SMOOTH(src)
|
||||
else
|
||||
icon_state = "fwall_open"
|
||||
smoothing_flags = SMOOTH_BITMASK
|
||||
QUEUE_SMOOTH(src)
|
||||
|
||||
/obj/structure/falsewall/update_icon_state()
|
||||
if(opening)
|
||||
icon_state = "fwall_[density ? "opening" : "closing"]"
|
||||
return ..()
|
||||
icon_state = density ? "[base_icon_state]-[smoothing_junction]" : "fwall_open"
|
||||
return ..()
|
||||
|
||||
/obj/structure/falsewall/proc/ChangeToWall(delete = 1)
|
||||
var/turf/T = get_turf(src)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
/obj/structure/fireaxecabinet/Initialize()
|
||||
. = ..()
|
||||
fireaxe = new
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/fireaxecabinet/Destroy()
|
||||
if(fireaxe)
|
||||
@@ -33,7 +33,7 @@
|
||||
to_chat(user, "<span class='notice'>You begin repairing [src].</span>")
|
||||
if(I.use_tool(src, user, 40, volume=50, amount=2))
|
||||
obj_integrity = max_integrity
|
||||
update_icon()
|
||||
update_appearance()
|
||||
to_chat(user, "<span class='notice'>You repair [src].</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] is already in good condition!</span>")
|
||||
@@ -47,7 +47,7 @@
|
||||
if(do_after(user, 20, target = src) && G.use(2))
|
||||
broken = FALSE
|
||||
obj_integrity = max_integrity
|
||||
update_icon()
|
||||
update_appearance()
|
||||
else if(open || broken)
|
||||
if(istype(I, /obj/item/fireaxe) && !fireaxe)
|
||||
var/obj/item/fireaxe/F = I
|
||||
@@ -58,7 +58,7 @@
|
||||
return
|
||||
fireaxe = F
|
||||
to_chat(user, "<span class='notice'>You place the [F.name] back in the [name].</span>")
|
||||
update_icon()
|
||||
update_appearance()
|
||||
return
|
||||
else if(!broken)
|
||||
toggle_open()
|
||||
@@ -80,11 +80,11 @@
|
||||
return
|
||||
. = ..()
|
||||
if(.)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/fireaxecabinet/obj_break(damage_flag)
|
||||
if(!broken && !(flags_1 & NODECONSTRUCT_1))
|
||||
update_icon()
|
||||
update_appearance()
|
||||
broken = TRUE
|
||||
playsound(src, 'sound/effects/glassbr3.ogg', 100, TRUE)
|
||||
new /obj/item/shard(loc)
|
||||
@@ -114,14 +114,14 @@
|
||||
fireaxe = null
|
||||
to_chat(user, "<span class='notice'>You take the fire axe from the [name].</span>")
|
||||
src.add_fingerprint(user)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
return
|
||||
if(locked)
|
||||
to_chat(user, "<span class='warning'>The [name] won't budge!</span>")
|
||||
return
|
||||
else
|
||||
open = !open
|
||||
update_icon()
|
||||
update_appearance()
|
||||
return
|
||||
|
||||
/obj/structure/fireaxecabinet/attack_paw(mob/living/user, list/modifiers)
|
||||
@@ -138,33 +138,31 @@
|
||||
to_chat(user, "<span class='warning'>The [name] won't budge!</span>")
|
||||
return
|
||||
open = !open
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
|
||||
/obj/structure/fireaxecabinet/update_overlays()
|
||||
. = ..()
|
||||
if(fireaxe)
|
||||
. += "axe"
|
||||
if(!open)
|
||||
var/hp_percent = obj_integrity/max_integrity * 100
|
||||
if(broken)
|
||||
. += "glass4"
|
||||
else
|
||||
switch(hp_percent)
|
||||
if(-INFINITY to 40)
|
||||
. += "glass3"
|
||||
if(40 to 60)
|
||||
. += "glass2"
|
||||
if(60 to 80)
|
||||
. += "glass1"
|
||||
if(80 to INFINITY)
|
||||
. += "glass"
|
||||
if(locked)
|
||||
. += "locked"
|
||||
else
|
||||
. += "unlocked"
|
||||
else
|
||||
if(open)
|
||||
. += "glass_raised"
|
||||
return
|
||||
var/hp_percent = obj_integrity/max_integrity * 100
|
||||
if(broken)
|
||||
. += "glass4"
|
||||
else
|
||||
switch(hp_percent)
|
||||
if(-INFINITY to 40)
|
||||
. += "glass3"
|
||||
if(40 to 60)
|
||||
. += "glass2"
|
||||
if(60 to 80)
|
||||
. += "glass1"
|
||||
if(80 to INFINITY)
|
||||
. += "glass"
|
||||
|
||||
. += locked ? "locked" : "unlocked"
|
||||
|
||||
/obj/structure/fireaxecabinet/proc/toggle_lock(mob/user)
|
||||
to_chat(user, "<span class='notice'>Resetting circuitry...</span>")
|
||||
@@ -172,7 +170,7 @@
|
||||
if(do_after(user, 20, target = src))
|
||||
to_chat(user, "<span class='notice'>You [locked ? "disable" : "re-enable"] the locking modules.</span>")
|
||||
locked = !locked
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/fireaxecabinet/verb/toggle_open()
|
||||
set name = "Open/Close"
|
||||
@@ -184,5 +182,5 @@
|
||||
return
|
||||
else
|
||||
open = !open
|
||||
update_icon()
|
||||
update_appearance()
|
||||
return
|
||||
|
||||
@@ -71,19 +71,21 @@
|
||||
|
||||
/obj/structure/fireplace/update_overlays()
|
||||
. = ..()
|
||||
if(lit)
|
||||
switch(burn_time_remaining())
|
||||
if(0 to 500)
|
||||
. += "fireplace_fire0"
|
||||
if(500 to 1000)
|
||||
. += "fireplace_fire1"
|
||||
if(1000 to 1500)
|
||||
. += "fireplace_fire2"
|
||||
if(1500 to 2000)
|
||||
. += "fireplace_fire3"
|
||||
if(2000 to MAXIMUM_BURN_TIMER)
|
||||
. += "fireplace_fire4"
|
||||
. += "fireplace_glow"
|
||||
if(!lit)
|
||||
return
|
||||
|
||||
switch(burn_time_remaining())
|
||||
if(0 to 500)
|
||||
. += "fireplace_fire0"
|
||||
if(500 to 1000)
|
||||
. += "fireplace_fire1"
|
||||
if(1000 to 1500)
|
||||
. += "fireplace_fire2"
|
||||
if(1500 to 2000)
|
||||
. += "fireplace_fire3"
|
||||
if(2000 to MAXIMUM_BURN_TIMER)
|
||||
. += "fireplace_fire4"
|
||||
. += "fireplace_glow"
|
||||
|
||||
/obj/structure/fireplace/proc/adjust_light()
|
||||
if(!lit)
|
||||
@@ -112,7 +114,7 @@
|
||||
playsound(src, 'sound/effects/comfyfire.ogg',50,FALSE, FALSE, TRUE)
|
||||
var/turf/T = get_turf(src)
|
||||
T.hotspot_expose(700, 2.5 * delta_time)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
adjust_light()
|
||||
|
||||
/obj/structure/fireplace/extinguish()
|
||||
@@ -142,11 +144,11 @@
|
||||
desc = "A large stone brick fireplace, warm and cozy."
|
||||
flame_expiry_timer = world.time + fuel_added
|
||||
fuel_added = 0
|
||||
update_icon()
|
||||
update_appearance()
|
||||
adjust_light()
|
||||
|
||||
/obj/structure/fireplace/proc/put_out()
|
||||
lit = FALSE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
adjust_light()
|
||||
desc = initial(desc)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
name = "grille"
|
||||
icon = 'icons/obj/structures.dmi'
|
||||
icon_state = "grille"
|
||||
base_icon_state = "grille"
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
pass_flags_self = PASSGRILLE
|
||||
@@ -27,21 +28,19 @@
|
||||
|
||||
/obj/structure/grille/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
|
||||
. = ..()
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/grille/update_icon()
|
||||
/obj/structure/grille/update_appearance(updates)
|
||||
if(QDELETED(src) || broken)
|
||||
return
|
||||
|
||||
var/ratio = obj_integrity / max_integrity
|
||||
ratio = CEILING(ratio*4, 1) * 25
|
||||
|
||||
. = ..()
|
||||
if(smoothing_flags & (SMOOTH_CORNERS|SMOOTH_BITMASK))
|
||||
QUEUE_SMOOTH(src)
|
||||
|
||||
if(ratio > 50)
|
||||
return
|
||||
icon_state = "grille50_[rand(0,3)]"
|
||||
/obj/structure/grille/update_icon_state()
|
||||
icon_state = "[base_icon_state][((obj_integrity / max_integrity) <= 0.5) ? "50_[rand(0, 3)]" : null]"
|
||||
return ..()
|
||||
|
||||
/obj/structure/grille/examine(mob/user)
|
||||
. = ..()
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
I.forceMove(src)
|
||||
if(contents.len >= capacity)
|
||||
break
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/guncase/update_overlays()
|
||||
. = ..()
|
||||
@@ -29,10 +29,7 @@
|
||||
for(var/i in 1 to contents.len)
|
||||
gun_overlay.pixel_x = 3 * (i - 1)
|
||||
. += new /mutable_appearance(gun_overlay)
|
||||
if(open)
|
||||
. += "[icon_state]_open"
|
||||
else
|
||||
. += "[icon_state]_door"
|
||||
. += "[icon_state]_[open ? "open" : "door"]"
|
||||
|
||||
/obj/structure/guncase/attackby(obj/item/I, mob/living/user, params)
|
||||
if(iscyborg(user) || isalien(user))
|
||||
@@ -42,14 +39,14 @@
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You place [I] in [src].</span>")
|
||||
update_icon()
|
||||
update_appearance()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] is full.</span>")
|
||||
return
|
||||
|
||||
else if(!user.combat_mode)
|
||||
open = !open
|
||||
update_icon()
|
||||
update_appearance()
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -63,7 +60,7 @@
|
||||
show_menu(user)
|
||||
else
|
||||
open = !open
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/**
|
||||
* show_menu: Shows a radial menu to a user consisting of an available weaponry for taking
|
||||
@@ -95,7 +92,7 @@
|
||||
return
|
||||
if(!user.put_in_hands(weapon))
|
||||
weapon.forceMove(get_turf(src))
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/**
|
||||
* check_menu: Checks if we are allowed to interact with a radial menu
|
||||
@@ -113,7 +110,7 @@
|
||||
return TRUE
|
||||
|
||||
/obj/structure/guncase/handle_atom_del(atom/A)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/guncase/contents_explosion(severity, target)
|
||||
for(var/thing in contents)
|
||||
|
||||
@@ -17,24 +17,38 @@
|
||||
. = ..()
|
||||
if(mapload)
|
||||
CheckParts()
|
||||
pixel_x = rand(-8, 8)
|
||||
|
||||
/obj/structure/headpike/Destroy()
|
||||
QDEL_NULL(victim)
|
||||
QDEL_NULL(spear)
|
||||
return ..()
|
||||
|
||||
/obj/structure/headpike/CheckParts(list/parts_list)
|
||||
victim = locate() in parts_list
|
||||
if(!victim) //likely a mapspawned one
|
||||
victim = new(src)
|
||||
victim.real_name = random_unique_name(prob(50))
|
||||
name = "[victim.real_name] on a spear"
|
||||
spear = locate(bonespear ? /obj/item/spear/bonespear : /obj/item/spear) in parts_list
|
||||
if(!spear)
|
||||
spear = bonespear ? new/obj/item/spear/bonespear(src) : new/obj/item/spear(src)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
return ..()
|
||||
|
||||
/obj/structure/headpike/Destroy()
|
||||
QDEL_NULL(victim)
|
||||
QDEL_NULL(spear)
|
||||
/obj/structure/headpike/update_name()
|
||||
name = "[victim.real_name] on a [spear]"
|
||||
return ..()
|
||||
|
||||
/obj/structure/headpike/update_overlays()
|
||||
. = ..()
|
||||
if(!victim)
|
||||
return
|
||||
var/mutable_appearance/MA = new()
|
||||
MA.copy_overlays(victim)
|
||||
MA.pixel_y = 12
|
||||
MA.pixel_x = pixel_x
|
||||
. += victim
|
||||
|
||||
/obj/structure/headpike/handle_atom_del(atom/A)
|
||||
if(A == victim)
|
||||
victim = null
|
||||
@@ -54,19 +68,6 @@
|
||||
spear = null
|
||||
return ..()
|
||||
|
||||
/obj/structure/headpike/Initialize()
|
||||
. = ..()
|
||||
pixel_x = rand(-8, 8)
|
||||
|
||||
/obj/structure/headpike/update_overlays()
|
||||
. = ..()
|
||||
if(victim)
|
||||
var/mutable_appearance/MA = new()
|
||||
MA.copy_overlays(victim)
|
||||
MA.pixel_y = 12
|
||||
MA.pixel_x = pixel_x
|
||||
. += victim
|
||||
|
||||
/obj/structure/headpike/attack_hand(mob/user, list/modifiers)
|
||||
. = ..()
|
||||
if(.)
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
if(!myspray)
|
||||
put_in_cart(I, user)
|
||||
myspray=I
|
||||
update_icon()
|
||||
update_appearance()
|
||||
else
|
||||
to_chat(user, fail_msg)
|
||||
else if(istype(I, /obj/item/lightreplacer))
|
||||
@@ -79,7 +79,7 @@
|
||||
if(signs < max_signs)
|
||||
put_in_cart(I, user)
|
||||
signs++
|
||||
update_icon()
|
||||
update_appearance()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] can't hold any more signs!</span>")
|
||||
else if(mybag)
|
||||
@@ -159,7 +159,7 @@
|
||||
else
|
||||
return
|
||||
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/**
|
||||
* check_menu: Checks if we are allowed to interact with a radial menu
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
if (up)
|
||||
src.up = up
|
||||
up.down = src
|
||||
up.update_icon()
|
||||
up.update_appearance()
|
||||
if (down)
|
||||
src.down = down
|
||||
down.up = src
|
||||
down.update_icon()
|
||||
down.update_appearance()
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
/obj/structure/ladder/Destroy(force)
|
||||
@@ -41,35 +41,29 @@
|
||||
if(crafted == L.crafted)
|
||||
down = L
|
||||
L.up = src // Don't waste effort looping the other way
|
||||
L.update_icon()
|
||||
L.update_appearance()
|
||||
if (!up)
|
||||
L = locate() in SSmapping.get_turf_above(T)
|
||||
if (L)
|
||||
if(crafted == L.crafted)
|
||||
up = L
|
||||
L.down = src // Don't waste effort looping the other way
|
||||
L.update_icon()
|
||||
L.update_appearance()
|
||||
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/ladder/proc/disconnect()
|
||||
if(up && up.down == src)
|
||||
up.down = null
|
||||
up.update_icon()
|
||||
up.update_appearance()
|
||||
if(down && down.up == src)
|
||||
down.up = null
|
||||
down.update_icon()
|
||||
down.update_appearance()
|
||||
up = down = null
|
||||
|
||||
/obj/structure/ladder/update_icon_state()
|
||||
if(up && down)
|
||||
icon_state = "ladder11"
|
||||
else if(up)
|
||||
icon_state = "ladder10"
|
||||
else if(down)
|
||||
icon_state = "ladder01"
|
||||
else //wtf make your ladders properly assholes
|
||||
icon_state = "ladder00"
|
||||
icon_state = "ladder[up ? 1 : 0][down ? 1 : 0]"
|
||||
return ..()
|
||||
|
||||
/obj/structure/ladder/singularity_pull()
|
||||
if (!(resistance_flags & INDESTRUCTIBLE))
|
||||
@@ -191,7 +185,7 @@
|
||||
/obj/structure/ladder/unbreakable/LateInitialize()
|
||||
// Override the parent to find ladders based on being height-linked
|
||||
if (!id || (up && down))
|
||||
update_icon()
|
||||
update_appearance()
|
||||
return
|
||||
|
||||
for (var/O in GLOB.ladders)
|
||||
@@ -201,17 +195,17 @@
|
||||
if (!down && L.height == height - 1)
|
||||
down = L
|
||||
L.up = src
|
||||
L.update_icon()
|
||||
L.update_appearance()
|
||||
if (up)
|
||||
break // break if both our connections are filled
|
||||
else if (!up && L.height == height + 1)
|
||||
up = L
|
||||
L.down = src
|
||||
L.update_icon()
|
||||
L.update_appearance()
|
||||
if (down)
|
||||
break // break if both our connections are filled
|
||||
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/ladder/crafted
|
||||
crafted = TRUE
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
user.visible_message("<span class='notice'>[user] touches [src]. It seems to respond to [user.p_their()] presence!</span>", "<span class='warning'>You create a connection between you and [src].</span>")
|
||||
linked_minds |= user.mind
|
||||
|
||||
update_icon()
|
||||
update_appearance()
|
||||
if(linked_minds.len)
|
||||
START_PROCESSING(SSobj, src)
|
||||
set_light(lit_luminosity)
|
||||
@@ -54,10 +54,8 @@
|
||||
set_light(0)
|
||||
|
||||
/obj/structure/life_candle/update_icon_state()
|
||||
if(linked_minds.len)
|
||||
icon_state = icon_state_active
|
||||
else
|
||||
icon_state = icon_state_inactive
|
||||
icon_state = linked_minds.len ? icon_state_active : icon_state_inactive
|
||||
return ..()
|
||||
|
||||
/obj/structure/life_candle/examine(mob/user)
|
||||
. = ..()
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
door_opened = TRUE
|
||||
layer = OPEN_DOOR_LAYER
|
||||
air_update_turf(TRUE, FALSE)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
isSwitchingStates = FALSE
|
||||
|
||||
if(close_delay != -1)
|
||||
@@ -121,11 +121,12 @@
|
||||
door_opened = FALSE
|
||||
layer = initial(layer)
|
||||
air_update_turf(TRUE, TRUE)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
isSwitchingStates = FALSE
|
||||
|
||||
/obj/structure/mineral_door/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][door_opened ? "open":""]"
|
||||
return ..()
|
||||
|
||||
/obj/structure/mineral_door/attackby(obj/item/I, mob/living/user)
|
||||
if(pickaxe_door(user, I))
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
reagents.trans_to(I, 5, transfered_by = user)
|
||||
to_chat(user, "<span class='notice'>You wet [I] in [src].</span>")
|
||||
playsound(loc, 'sound/effects/slosh.ogg', 25, TRUE)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
else
|
||||
. = ..()
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/mopbucket/update_overlays()
|
||||
. = ..()
|
||||
|
||||
@@ -37,16 +37,12 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
|
||||
GLOB.bodycontainers -= src
|
||||
open()
|
||||
if(connected)
|
||||
qdel(connected)
|
||||
connected = null
|
||||
QDEL_NULL(connected)
|
||||
return ..()
|
||||
|
||||
/obj/structure/bodycontainer/on_log(login)
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/structure/bodycontainer/update_icon()
|
||||
return
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/bodycontainer/relaymove(mob/living/user, direction)
|
||||
if(user.stat || !isturf(loc))
|
||||
@@ -131,7 +127,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
|
||||
connected.setDir(dir)
|
||||
for(var/atom/movable/AM in src)
|
||||
AM.forceMove(T)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/bodycontainer/proc/close()
|
||||
playsound(src, 'sound/effects/roll.ogg', 5, TRUE)
|
||||
@@ -142,7 +138,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
|
||||
continue
|
||||
AM.forceMove(src)
|
||||
recursive_organ_check(src)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/bodycontainer/get_remote_view_fullscreens(mob/user)
|
||||
if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS)))
|
||||
@@ -155,9 +151,12 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
|
||||
desc = "Used to keep bodies in until someone fetches them. Now includes a high-tech alert system."
|
||||
icon_state = "morgue1"
|
||||
dir = EAST
|
||||
/// Whether or not this morgue beeps to alert parameds of revivable corpses.
|
||||
var/beeper = TRUE
|
||||
var/beep_cooldown = 50
|
||||
var/next_beep = 0
|
||||
/// The minimum time between beeps.
|
||||
var/beep_cooldown = 5 SECONDS
|
||||
/// The cooldown to prevent this from spamming beeps.
|
||||
COOLDOWN_DECLARE(next_beep)
|
||||
|
||||
/obj/structure/bodycontainer/morgue/Initialize()
|
||||
. = ..()
|
||||
@@ -175,28 +174,31 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
|
||||
beeper = !beeper
|
||||
to_chat(user, "<span class='notice'>You turn the speaker function [beeper ? "on" : "off"].</span>")
|
||||
|
||||
/obj/structure/bodycontainer/morgue/update_icon()
|
||||
if (!connected || connected.loc != src) // Open or tray is gone.
|
||||
/obj/structure/bodycontainer/morgue/update_icon_state()
|
||||
if(!connected || connected.loc != src) // Open or tray is gone.
|
||||
icon_state = "morgue0"
|
||||
else
|
||||
if(contents.len == 1) // Empty
|
||||
icon_state = "morgue1"
|
||||
else
|
||||
icon_state = "morgue2" // Dead, brainded mob.
|
||||
var/list/compiled = get_all_contents_type(/mob/living) // Search for mobs in all contents.
|
||||
if(!length(compiled)) // No mobs?
|
||||
icon_state = "morgue3"
|
||||
return
|
||||
return ..()
|
||||
|
||||
for(var/mob/living/M in compiled)
|
||||
var/mob/living/mob_occupant = get_mob_or_brainmob(M)
|
||||
if(mob_occupant.client && !mob_occupant.suiciding && !(HAS_TRAIT(mob_occupant, TRAIT_BADDNA)))
|
||||
icon_state = "morgue4" // Revivable
|
||||
if(mob_occupant.stat == DEAD && beeper)
|
||||
if(world.time > next_beep)
|
||||
playsound(src, 'sound/weapons/gun/general/empty_alarm.ogg', 50, FALSE) //Revive them you blind fucks
|
||||
next_beep = world.time + beep_cooldown
|
||||
break
|
||||
if(contents.len == 1) // Empty
|
||||
icon_state = "morgue1"
|
||||
return ..()
|
||||
|
||||
var/list/compiled = get_all_contents_type(/mob/living) // Search for mobs in all contents.
|
||||
if(!length(compiled)) // No mobs?
|
||||
icon_state = "morgue3"
|
||||
return ..()
|
||||
|
||||
for(var/mob/living/M in compiled)
|
||||
var/mob/living/mob_occupant = get_mob_or_brainmob(M)
|
||||
if(mob_occupant.client && !mob_occupant.suiciding && !(HAS_TRAIT(mob_occupant, TRAIT_BADDNA)))
|
||||
icon_state = "morgue4" // Revivable
|
||||
if(mob_occupant.stat == DEAD && beeper && COOLDOWN_FINISHED(src, next_beep))
|
||||
playsound(src, 'sound/weapons/gun/general/empty_alarm.ogg', 50, FALSE) //Revive them you blind fucks
|
||||
COOLDOWN_START(src, next_beep, beep_cooldown)
|
||||
return ..()
|
||||
|
||||
icon_state = "morgue2" // Dead, brainded mob.
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/paper/guides/jobs/medical/morgue
|
||||
@@ -211,6 +213,7 @@ GLOBAL_LIST_EMPTY(crematoriums)
|
||||
name = "crematorium"
|
||||
desc = "A human incinerator. Works well on barbecue nights."
|
||||
icon_state = "crema1"
|
||||
base_icon_state = "crema"
|
||||
dir = SOUTH
|
||||
var/id = 1
|
||||
|
||||
@@ -234,20 +237,15 @@ GLOBAL_LIST_EMPTY(crematoriums)
|
||||
/obj/structure/bodycontainer/crematorium/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock)
|
||||
id = "[port.id]_[id]"
|
||||
|
||||
/obj/structure/bodycontainer/crematorium/update_icon()
|
||||
/obj/structure/bodycontainer/crematorium/update_icon_state()
|
||||
if(!connected || connected.loc != src)
|
||||
icon_state = "crema0"
|
||||
else
|
||||
|
||||
if(src.contents.len > 1)
|
||||
src.icon_state = "crema2"
|
||||
else
|
||||
src.icon_state = "crema1"
|
||||
|
||||
if(locked)
|
||||
src.icon_state = "crema_active"
|
||||
|
||||
return
|
||||
icon_state = "[base_icon_state]0"
|
||||
return ..()
|
||||
if(locked)
|
||||
icon_state = "[base_icon_state]_active"
|
||||
return ..()
|
||||
icon_state = "[base_icon_state][(contents.len > 1) ? 2 : 1]"
|
||||
return ..()
|
||||
|
||||
/obj/structure/bodycontainer/crematorium/proc/cremate(mob/user)
|
||||
if(locked)
|
||||
@@ -263,7 +261,7 @@ GLOBAL_LIST_EMPTY(crematoriums)
|
||||
audible_message("<span class='hear'>You hear a roar as the crematorium activates.</span>")
|
||||
|
||||
locked = TRUE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
for(var/mob/living/M in conts)
|
||||
if (M.stat != DEAD)
|
||||
@@ -288,7 +286,7 @@ GLOBAL_LIST_EMPTY(crematoriums)
|
||||
|
||||
if(!QDELETED(src))
|
||||
locked = FALSE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, TRUE) //you horrible people
|
||||
|
||||
/obj/structure/bodycontainer/crematorium/creamatorium
|
||||
@@ -322,7 +320,7 @@ GLOBAL_LIST_EMPTY(crematoriums)
|
||||
/obj/structure/tray/Destroy()
|
||||
if(connected)
|
||||
connected.connected = null
|
||||
connected.update_icon()
|
||||
connected.update_appearance()
|
||||
connected = null
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -57,10 +57,8 @@ FLOOR SAFES
|
||||
I.forceMove(src)
|
||||
|
||||
/obj/structure/safe/update_icon_state()
|
||||
if(open)
|
||||
icon_state = "[initial(icon_state)]-open"
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
icon_state = "[initial(icon_state)][open ? "-open" : null]"
|
||||
return ..()
|
||||
|
||||
/obj/structure/safe/attackby(obj/item/I, mob/user, params)
|
||||
if(open)
|
||||
@@ -147,7 +145,7 @@ FLOOR SAFES
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You [open ? "close" : "open"] [src].</span>")
|
||||
open = !open
|
||||
update_icon()
|
||||
update_appearance()
|
||||
return TRUE
|
||||
if("turnright")
|
||||
if(open)
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
to_chat(M,"<span class='notice'>\The [src] is dry.</span>")
|
||||
return FALSE
|
||||
on = !on
|
||||
update_icon()
|
||||
update_appearance()
|
||||
handle_mist()
|
||||
add_fingerprint(M)
|
||||
if(on)
|
||||
@@ -105,10 +105,11 @@
|
||||
|
||||
/obj/machinery/shower/update_overlays()
|
||||
. = ..()
|
||||
if(on)
|
||||
var/mutable_appearance/water_falling = mutable_appearance('icons/obj/watercloset.dmi', "water", ABOVE_MOB_LAYER)
|
||||
water_falling.color = mix_color_from_reagents(reagents.reagent_list)
|
||||
. += water_falling
|
||||
if(!on)
|
||||
return
|
||||
var/mutable_appearance/water_falling = mutable_appearance('icons/obj/watercloset.dmi', "water", ABOVE_MOB_LAYER)
|
||||
water_falling.color = mix_color_from_reagents(reagents.reagent_list)
|
||||
. += water_falling
|
||||
|
||||
/obj/machinery/shower/proc/handle_mist()
|
||||
// If there is no mist, and the shower was turned on (on a non-freezing temp): make mist in 5 seconds
|
||||
@@ -160,7 +161,7 @@
|
||||
handle_mist()
|
||||
if(can_refill)
|
||||
reagents.add_reagent(reagent_id, refill_rate * delta_time)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
if(reagents.total_volume == reagents.maximum_volume)
|
||||
return PROCESS_KILL
|
||||
|
||||
|
||||
@@ -46,12 +46,12 @@
|
||||
update_surrounding()
|
||||
|
||||
/obj/structure/stairs/proc/update_surrounding()
|
||||
update_icon()
|
||||
update_appearance()
|
||||
for(var/i in GLOB.cardinals)
|
||||
var/turf/T = get_step(get_turf(src), i)
|
||||
var/obj/structure/stairs/S = locate() in T
|
||||
if(S)
|
||||
S.update_icon()
|
||||
S.update_appearance()
|
||||
|
||||
/obj/structure/stairs/Uncross(atom/movable/AM, atom/newloc)
|
||||
if(!newloc || !AM)
|
||||
@@ -67,10 +67,8 @@
|
||||
return ..()
|
||||
|
||||
/obj/structure/stairs/update_icon_state()
|
||||
if(isTerminator())
|
||||
icon_state = "stairs_t"
|
||||
else
|
||||
icon_state = "stairs"
|
||||
icon_state = "stairs[isTerminator() ? "_t" : null]"
|
||||
return ..()
|
||||
|
||||
/obj/structure/stairs/proc/stair_ascend(atom/movable/AM)
|
||||
var/turf/checking = get_step_multiz(get_turf(src), UP)
|
||||
|
||||
@@ -458,10 +458,11 @@ Moving interrupts
|
||||
|
||||
/obj/structure/carving_block/update_overlays()
|
||||
. = ..()
|
||||
if(target_appearance_with_filters)
|
||||
//We're only keeping one instance here that changes in the middle so we have to clone it to avoid managed overlay issues
|
||||
var/mutable_appearance/clone = new(target_appearance_with_filters)
|
||||
. += clone
|
||||
if(!target_appearance_with_filters)
|
||||
return
|
||||
//We're only keeping one instance here that changes in the middle so we have to clone it to avoid managed overlay issues
|
||||
var/mutable_appearance/clone = new(target_appearance_with_filters)
|
||||
. += clone
|
||||
|
||||
/obj/structure/carving_block/proc/is_viable_target(atom/movable/target)
|
||||
//Only things on turfs
|
||||
@@ -508,7 +509,7 @@ Moving interrupts
|
||||
remove_filter("partial_uncover")
|
||||
add_filter("partial_uncover", 1, alpha_mask_filter(icon = white, y = -mask_offset))
|
||||
target_appearance_with_filters.filters = filter(type="alpha",icon=white,y=-mask_offset,flags=MASK_INVERSE)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
|
||||
/// Returns a list of preset statues carvable from this block depending on the custom materials
|
||||
@@ -559,7 +560,7 @@ Moving interrupts
|
||||
content_ma.alpha = 255
|
||||
content_ma.appearance_flags &= ~KEEP_APART //Don't want this
|
||||
content_ma.filters = filter(type="color",color=greyscale_with_value_bump,space=FILTER_COLOR_HSV)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/statue/custom/update_overlays()
|
||||
. = ..()
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
return "<span class='notice'>The top is <b>screwed</b> on, but the main <b>bolts</b> are also visible.</span>"
|
||||
|
||||
/obj/structure/table/update_icon()
|
||||
. = ..()
|
||||
if(smoothing_flags & (SMOOTH_CORNERS|SMOOTH_BITMASK))
|
||||
QUEUE_SMOOTH(src)
|
||||
QUEUE_SMOOTH_NEIGHBORS(src)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
new /obj/item/tank/internals/oxygen(src)
|
||||
for(var/i in 1 to plasmatanks)
|
||||
new /obj/item/tank/internals/plasma(src)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/tank_dispenser/update_overlays()
|
||||
. = ..()
|
||||
@@ -65,7 +65,7 @@
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/tank_dispenser/ui_state(mob/user)
|
||||
return GLOB.physical_state
|
||||
@@ -100,7 +100,7 @@
|
||||
usr.put_in_hands(tank)
|
||||
oxygentanks--
|
||||
. = TRUE
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
|
||||
/obj/structure/tank_dispenser/deconstruct(disassembled = TRUE)
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
for(var/obj/structure/transit_tube_pod/pod in loc)
|
||||
if(!pod.moving)
|
||||
AM.forceMove(pod)
|
||||
pod.update_icon()
|
||||
pod.update_appearance()
|
||||
return
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@
|
||||
playsound(src, 'sound/weapons/emitter2.ogg', 50, TRUE)
|
||||
pod.setDir(turn(src.dir, -90))
|
||||
AM.forceMove(pod)
|
||||
pod.update_icon()
|
||||
pod.update_appearance()
|
||||
launch_pod()
|
||||
|
||||
/obj/structure/transit_tube/station/dispenser/pod_stopped(obj/structure/transit_tube_pod/pod, from_dir)
|
||||
|
||||
@@ -31,10 +31,8 @@
|
||||
return ..()
|
||||
|
||||
/obj/structure/transit_tube_pod/update_icon_state()
|
||||
if(contents.len)
|
||||
icon_state = occupied_icon_state
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
icon_state = contents.len ? occupied_icon_state : initial(icon_state)
|
||||
return ..()
|
||||
|
||||
/obj/structure/transit_tube_pod/attackby(obj/item/I, mob/user, params)
|
||||
if(I.tool_behaviour == TOOL_CROWBAR)
|
||||
@@ -98,7 +96,7 @@
|
||||
location = get_turf(src)
|
||||
for(var/atom/movable/M in contents)
|
||||
M.forceMove(location)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/transit_tube_pod/Process_Spacemove()
|
||||
if(moving) //No drifting while moving in the tubes
|
||||
@@ -199,7 +197,7 @@
|
||||
if(direction == turn(station.boarding_dir,180))
|
||||
if(station.open_status == STATION_TUBE_OPEN)
|
||||
user.forceMove(loc)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
else
|
||||
station.open_animation()
|
||||
else if(direction in station.tube_dirs)
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
switch(href_list["act"])
|
||||
if("toggle_vote")
|
||||
voting_active = !voting_active
|
||||
update_icon()
|
||||
update_appearance()
|
||||
if("toggle_auth")
|
||||
id_auth = !id_auth
|
||||
if("reset_voted")
|
||||
@@ -205,12 +205,13 @@
|
||||
|
||||
P.info = tally.Join()
|
||||
P.name = "Voting Results"
|
||||
P.update_icon()
|
||||
P.update_appearance()
|
||||
user.put_in_hands(P)
|
||||
to_chat(user,"<span class='notice'>[src] prints out the voting tally.</span>")
|
||||
|
||||
/obj/structure/votebox/update_icon_state()
|
||||
icon_state = "votebox_[voting_active ? "active" : "maint"]"
|
||||
return ..()
|
||||
|
||||
#undef VOTE_TEXT_LIMIT
|
||||
#undef MAX_VOTES
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
/obj/structure/toilet/Initialize()
|
||||
. = ..()
|
||||
open = round(rand(0, 1))
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
|
||||
/obj/structure/toilet/attack_hand(mob/living/user, list/modifiers)
|
||||
@@ -75,11 +75,12 @@
|
||||
w_items -= I.w_class
|
||||
else
|
||||
open = !open
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
|
||||
/obj/structure/toilet/update_icon_state()
|
||||
icon_state = "toilet[open][cistern]"
|
||||
return ..()
|
||||
|
||||
/obj/structure/toilet/deconstruct()
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
@@ -99,7 +100,7 @@
|
||||
if(I.use_tool(src, user, 30))
|
||||
user.visible_message("<span class='notice'>[user] [cistern ? "replaces the lid on the cistern" : "lifts the lid off the cistern"]!</span>", "<span class='notice'>You [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"]!</span>", "<span class='hear'>You hear grinding porcelain.</span>")
|
||||
cistern = !cistern
|
||||
update_icon()
|
||||
update_appearance()
|
||||
else if(I.tool_behaviour == TOOL_WRENCH && !(flags_1&NODECONSTRUCT_1))
|
||||
I.play_tool_sound(src)
|
||||
deconstruct()
|
||||
@@ -636,22 +637,21 @@
|
||||
|
||||
/obj/structure/curtain/proc/toggle()
|
||||
open = !open
|
||||
update_icon()
|
||||
|
||||
/obj/structure/curtain/update_icon()
|
||||
if(!open)
|
||||
icon_state = "[icon_type]-closed"
|
||||
layer = WALL_OBJ_LAYER
|
||||
density = TRUE
|
||||
open = FALSE
|
||||
if(opaque_closed)
|
||||
set_opacity(TRUE)
|
||||
else
|
||||
icon_state = "[icon_type]-open"
|
||||
if(open)
|
||||
layer = SIGN_LAYER
|
||||
density = FALSE
|
||||
open = TRUE
|
||||
set_opacity(FALSE)
|
||||
else
|
||||
layer = WALL_OBJ_LAYER
|
||||
density = TRUE
|
||||
if(opaque_closed)
|
||||
set_opacity(TRUE)
|
||||
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/curtain/update_icon_state()
|
||||
icon_state = "[icon_type]-[open ? "open" : "closed"]"
|
||||
return ..()
|
||||
|
||||
/obj/structure/curtain/attackby(obj/item/W, mob/user)
|
||||
if (istype(W, /obj/item/toy/crayon))
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
|
||||
/obj/structure/windoor_assembly/update_icon_state()
|
||||
icon_state = "[facing]_[secure ? "secure_" : ""]windoor_assembly[state]"
|
||||
return ..()
|
||||
|
||||
/obj/structure/windoor_assembly/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
@@ -302,7 +303,7 @@
|
||||
return ..()
|
||||
|
||||
//Update to reflect changes(if applicable)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
|
||||
|
||||
@@ -323,7 +324,7 @@
|
||||
return TRUE
|
||||
|
||||
/obj/structure/windoor_assembly/proc/after_rotation(mob/user)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
//Flips the windoor assembly, determines whather the door opens to the left or the right
|
||||
/obj/structure/windoor_assembly/verb/flip()
|
||||
@@ -345,5 +346,5 @@
|
||||
facing = "l"
|
||||
to_chat(usr, "<span class='notice'>The windoor will now slide to the left.</span>")
|
||||
|
||||
update_icon()
|
||||
update_appearance()
|
||||
return
|
||||
|
||||
@@ -312,28 +312,26 @@
|
||||
|
||||
//This proc is used to update the icons of nearby windows.
|
||||
/obj/structure/window/proc/update_nearby_icons()
|
||||
update_icon()
|
||||
update_appearance()
|
||||
if(smoothing_flags & (SMOOTH_CORNERS|SMOOTH_BITMASK))
|
||||
QUEUE_SMOOTH_NEIGHBORS(src)
|
||||
|
||||
//merges adjacent full-tile windows into one
|
||||
/obj/structure/window/update_overlays()
|
||||
. = ..()
|
||||
if(!QDELETED(src))
|
||||
if(!fulltile)
|
||||
return
|
||||
if(QDELETED(src) || !fulltile)
|
||||
return
|
||||
|
||||
var/ratio = obj_integrity / max_integrity
|
||||
ratio = CEILING(ratio*4, 1) * 25
|
||||
if(smoothing_flags & (SMOOTH_CORNERS|SMOOTH_BITMASK))
|
||||
QUEUE_SMOOTH(src)
|
||||
|
||||
if(smoothing_flags & (SMOOTH_CORNERS|SMOOTH_BITMASK))
|
||||
QUEUE_SMOOTH(src)
|
||||
|
||||
cut_overlay(crack_overlay)
|
||||
if(ratio > 75)
|
||||
return
|
||||
crack_overlay = mutable_appearance('icons/obj/structures.dmi', "damage[ratio]", -(layer+0.1))
|
||||
. += crack_overlay
|
||||
var/ratio = obj_integrity / max_integrity
|
||||
ratio = CEILING(ratio*4, 1) * 25
|
||||
cut_overlay(crack_overlay)
|
||||
if(ratio > 75)
|
||||
return
|
||||
crack_overlay = mutable_appearance('icons/obj/structures.dmi', "damage[ratio]", -(layer+0.1))
|
||||
. += crack_overlay
|
||||
|
||||
/obj/structure/window/should_atmos_process(datum/gas_mixture/air, exposed_temperature)
|
||||
return exposed_temperature > T0C + heat_resistance
|
||||
@@ -765,7 +763,7 @@
|
||||
|
||||
/obj/structure/window/paperframe/Initialize()
|
||||
. = ..()
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/window/paperframe/examine(mob/user)
|
||||
. = ..()
|
||||
@@ -782,22 +780,22 @@
|
||||
if(.)
|
||||
return
|
||||
if(user.combat_mode)
|
||||
take_damage(4,BRUTE,MELEE, 0)
|
||||
take_damage(4, BRUTE, MELEE, 0)
|
||||
if(!QDELETED(src))
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/window/paperframe/update_appearance(updates)
|
||||
. = ..()
|
||||
set_opacity(obj_integrity >= max_integrity)
|
||||
|
||||
/obj/structure/window/paperframe/update_icon()
|
||||
if(obj_integrity < max_integrity)
|
||||
cut_overlay(paper)
|
||||
add_overlay(torn)
|
||||
set_opacity(FALSE)
|
||||
else
|
||||
cut_overlay(torn)
|
||||
add_overlay(paper)
|
||||
set_opacity(TRUE)
|
||||
. = ..()
|
||||
if(smoothing_flags & (SMOOTH_CORNERS|SMOOTH_BITMASK))
|
||||
QUEUE_SMOOTH(src)
|
||||
|
||||
/obj/structure/window/paperframe/update_overlays()
|
||||
. = ..()
|
||||
. += (obj_integrity < max_integrity) ? torn : paper
|
||||
|
||||
/obj/structure/window/paperframe/attackby(obj/item/W, mob/living/user)
|
||||
if(W.get_temperature())
|
||||
@@ -812,10 +810,10 @@
|
||||
qdel(W)
|
||||
user.visible_message("<span class='notice'>[user] patches some of the holes in \the [src].</span>")
|
||||
if(obj_integrity == max_integrity)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
return
|
||||
..()
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/window/bronze
|
||||
name = "brass window"
|
||||
|
||||
Reference in New Issue
Block a user