[MIRROR] update_appearance (#3508)

* update_appearance

* a

* a

Co-authored-by: TemporalOroboros <TemporalOroboros@gmail.com>
Co-authored-by: Gandalf2k15 <jzo123@hotmail.com>
This commit is contained in:
SkyratBot
2021-02-19 16:08:09 +00:00
committed by GitHub
co-authored by TemporalOroboros Gandalf2k15
parent 3f106caf48
commit 18eca27569
595 changed files with 4768 additions and 4208 deletions
+7 -9
View File
@@ -59,10 +59,8 @@
/obj/machinery/ntnet_relay/update_icon_state()
if(is_operational)
icon_state = "bus"
else
icon_state = "bus_off"
icon_state = "bus[is_operational ? null : "_off"]"
return ..()
/obj/machinery/ntnet_relay/process(delta_time)
if(is_operational)
@@ -70,7 +68,7 @@
else
use_power = IDLE_POWER_USE
update_icon()
update_appearance()
if(dos_overload > 0)
dos_overload = max(0, dos_overload - dos_dissipate * delta_time)
@@ -78,12 +76,12 @@
// If DoS traffic exceeded capacity, crash.
if((dos_overload > dos_capacity) && !dos_failure)
set_dos_failure(TRUE)
update_icon()
update_appearance()
SSnetworks.add_log("Quantum relay switched from normal operation mode to overload recovery mode.")
// If the DoS buffer reaches 0 again, restart.
if((dos_overload == 0) && dos_failure)
set_dos_failure(FALSE)
update_icon()
update_appearance()
SSnetworks.add_log("Quantum relay switched from overload recovery mode to normal operation mode.")
..()
@@ -109,13 +107,13 @@
if("restart")
dos_overload = 0
set_dos_failure(FALSE)
update_icon()
update_appearance()
SSnetworks.add_log("Quantum relay manually restarted from overload recovery mode to normal operation mode.")
return TRUE
if("toggle")
set_relay_enabled(!relay_enabled)
SSnetworks.add_log("Quantum relay manually [relay_enabled ? "enabled" : "disabled"].")
update_icon()
update_appearance()
return TRUE
/obj/machinery/ntnet_relay/Initialize()
+1 -1
View File
@@ -216,7 +216,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
var/obj/item/storage/wallet/W = worn
W.front_id = id
id.forceMove(W)
W.update_icon()
W.update_appearance()
else
H.equip_to_slot(id,ITEM_SLOT_ID)
@@ -71,4 +71,4 @@
var/obj/item/implantcase/case = new(get_turf(C))
case.imp = I
I.forceMove(case)
case.update_icon()
case.update_appearance()
@@ -488,9 +488,10 @@ Congratulations! You are now trained for invasive xenobiology research!"}
if(!turned_on)
toggle_on(user)
to_chat(usr, "<span class='notice'>You switch the baton to [txt] mode.</span>")
update_icon()
update_appearance()
/obj/item/melee/baton/abductor/update_icon_state()
. = ..()
switch(mode)
if(BATON_STUN)
icon_state = "wonderprodStun"
@@ -183,7 +183,5 @@
return
/obj/machinery/abductor/experiment/update_icon_state()
if(state_open)
icon_state = "experiment-open"
else
icon_state = "experiment"
icon_state = "experiment[state_open ? "-open" : null]"
return ..()
@@ -95,7 +95,7 @@ GLOBAL_LIST_INIT(valid_blobstrains, subtypesof(/datum/blobstrain) - list(/datum/
for(var/obj/structure/blob/B as anything in overmind.all_blobs)
B.max_integrity *= max_structure_health_multiplier
B.obj_integrity *= max_structure_health_multiplier
B.update_icon()
B.update_appearance()
for(var/mob/living/simple_animal/hostile/blob/BM as anything in overmind.blob_mobs)
BM.maxHealth *= max_mob_health_multiplier
@@ -17,7 +17,7 @@
var/obj/structure/blob/newB = B.expand(null, null, 0)
if(newB)
newB.obj_integrity = B.obj_integrity - damage
newB.update_icon()
newB.update_appearance()
return ..()
+2 -2
View File
@@ -64,7 +64,7 @@ GLOBAL_LIST_EMPTY(blob_nodes)
set_strain(BS)
color = blobstrain.complementary_color
if(blob_core)
blob_core.update_icon()
blob_core.update_appearance()
SSshuttle.registerHostileEnvironment(src)
. = ..()
START_PROCESSING(SSobj, src)
@@ -186,7 +186,7 @@ GLOBAL_LIST_EMPTY(blob_nodes)
var/obj/structure/blob/B = BL
if(B && B.overmind == src)
B.overmind = null
B.update_icon() //reset anything that was ours
B.update_appearance() //reset anything that was ours
for(var/BLO in blob_mobs)
var/mob/living/simple_animal/hostile/blob/BM = BLO
if(BM)
+2 -2
View File
@@ -55,7 +55,7 @@
core.overmind = src
blobs_legit += src
blob_core = core
core.update_icon()
core.update_appearance()
update_health_hud()
placed = TRUE
announcement_time = world.time + OVERMIND_ANNOUNCEMENT_MAX_TIME
@@ -146,7 +146,7 @@
if(LAZYLEN(candidates)) //if we got at least one candidate, they're a blobbernaut now.
B.max_integrity = initial(B.max_integrity) * 0.25 //factories that produced a blobbernaut have much lower health
B.obj_integrity = min(B.obj_integrity, B.max_integrity)
B.update_icon()
B.update_appearance()
B.visible_message("<span class='warning'><b>The blobbernaut [pick("rips", "tears", "shreds")] its way out of the factory blob!</b></span>")
playsound(B.loc, 'sound/effects/splat.ogg', 50, TRUE)
var/mob/living/simple_animal/hostile/blob/blobbernaut/blobber = new /mob/living/simple_animal/hostile/blob/blobbernaut(get_turf(B))
@@ -41,7 +41,7 @@
overmind.blobs_legit += src
GLOB.blobs += src //Keep track of the blob in the normal list either way
setDir(pick(GLOB.cardinals))
update_icon()
update_appearance()
if(atmosblock)
air_update_turf(TRUE, TRUE)
ConsumeTile()
@@ -86,6 +86,7 @@
return !atmosblock
/obj/structure/blob/update_icon() //Updates color based on overmind color if we have an overmind.
. = ..()
if(overmind)
add_atom_colour(overmind.blobstrain.color, FIXED_COLOUR_PRIORITY)
else
@@ -97,7 +98,7 @@
if(COOLDOWN_FINISHED(src, heal_timestamp))
obj_integrity = min(max_integrity, obj_integrity+health_regen)
COOLDOWN_START(src, heal_timestamp, 20)
update_icon()
update_appearance()
COOLDOWN_START(src, pulse_timestamp, 10)
return TRUE//we did it, we were pulsed!
return FALSE //oh no we failed
@@ -161,7 +162,7 @@
if(T.Enter(B,src)) //NOW we can attempt to move into the tile
B.density = initial(B.density)
B.forceMove(T)
B.update_icon()
B.update_appearance()
if(B.overmind && expand_reaction)
B.overmind.blobstrain.expand_reaction(src, B, T, controller)
return B
@@ -267,7 +268,7 @@
/obj/structure/blob/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
. = ..()
if(. && obj_integrity > 0)
update_icon()
update_appearance()
/obj/structure/blob/obj_destruction(damage_flag)
if(overmind)
@@ -279,7 +280,7 @@
CRASH("change_to(): invalid type for blob")
var/obj/structure/blob/B = new type(src.loc, controller)
B.creation_action()
B.update_icon()
B.update_appearance()
B.setDir(dir)
qdel(src)
return B
@@ -321,23 +322,30 @@
return "Currently weak to brute damage."
return "N/A"
/obj/structure/blob/normal/update_icon()
..()
/obj/structure/blob/normal/update_name()
. = ..()
name = "[(obj_integrity <= 15) ? "fragile " : (overmind ? null : "dead ")][initial(name)]"
/obj/structure/blob/normal/update_desc()
. = ..()
if(obj_integrity <= 15)
icon_state = "blob_damaged"
name = "fragile blob"
desc = "A thin lattice of slightly twitching tendrils."
else if(overmind)
desc = "A thick wall of writhing tendrils."
else
desc = "A thick wall of lifeless tendrils."
/obj/structure/blob/normal/update_icon_state()
icon_state = "blob[(obj_integrity <= 15) ? "_damaged" : null]"
/// - [] TODO: Move this elsewhere
if(obj_integrity <= 15)
brute_resist = BLOB_BRUTE_RESIST
else if (overmind)
icon_state = "blob"
name = "blob"
desc = "A thick wall of writhing tendrils."
brute_resist = BLOB_BRUTE_RESIST * 0.5
else
icon_state = "blob"
name = "dead blob"
desc = "A thick wall of lifeless tendrils."
brute_resist = BLOB_BRUTE_RESIST * 0.5
return ..()
/obj/structure/blob/special // Generic type for nodes/factories/cores/resource
// Core and node vars: claiming, pulsing and expanding
@@ -386,7 +394,7 @@
var/obj/structure/blob/B = L
if(!B.overmind && prob(30))
B.overmind = pulsing_overmind //reclaim unclaimed, non-core blobs.
B.update_icon()
B.update_appearance()
var/distance = get_dist(get_turf(src), get_turf(B))
var/expand_probablity = max(20 - distance * 8, 1)
if(B.Adjacent(src))
@@ -21,34 +21,37 @@
GLOB.blob_cores += src
START_PROCESSING(SSobj, src)
AddElement(/datum/element/point_of_interest)
update_icon() //so it atleast appears
update_appearance() //so it atleast appears
if(!placed && !overmind)
return INITIALIZE_HINT_QDEL
if(overmind)
overmind.blobstrain.on_gain()
update_icon()
update_appearance()
. = ..()
/obj/structure/blob/special/core/scannerreport()
return "Directs the blob's expansion, gradually expands, and sustains nearby blob spores and blobbernauts."
/obj/structure/blob/special/core/update_icon()
cut_overlays()
color = null
var/mutable_appearance/blob_overlay = mutable_appearance('icons/mob/blob.dmi', "blob")
if(overmind)
blob_overlay.color = overmind.blobstrain.color
add_overlay(blob_overlay)
add_overlay(mutable_appearance('icons/mob/blob.dmi', "blob_core_overlay"))
/obj/structure/blob/special/core/Destroy()
GLOB.blob_cores -= src
if(overmind)
overmind.blob_core = null
overmind = null
overmind = null
STOP_PROCESSING(SSobj, src)
return ..()
/obj/structure/blob/special/core/scannerreport()
return "Directs the blob's expansion, gradually expands, and sustains nearby blob spores and blobbernauts."
/obj/structure/blob/special/core/update_overlays()
. = ..()
var/mutable_appearance/blob_overlay = mutable_appearance('icons/mob/blob.dmi', "blob")
if(overmind)
blob_overlay.color = overmind.blobstrain.color
. += blob_overlay
. += mutable_appearance('icons/mob/blob.dmi', "blob_core_overlay")
/obj/structure/blob/special/core/update_icon()
color = null
return ..()
/obj/structure/blob/special/core/ex_act(severity, target)
var/damage = 50 - 10 * severity //remember, the core takes half brute damage, so this is 20/15/10 damage based on severity
take_damage(damage, BRUTE, BOMB, 0)
@@ -24,13 +24,16 @@
return "Gradually expands and sustains nearby blob spores and blobbernauts."
/obj/structure/blob/special/node/update_icon()
cut_overlays()
color = null
return ..()
/obj/structure/blob/special/node/update_overlays()
. = ..()
var/mutable_appearance/blob_overlay = mutable_appearance('icons/mob/blob.dmi', "blob")
if(overmind)
blob_overlay.color = overmind.blobstrain.color
add_overlay(blob_overlay)
add_overlay(mutable_appearance('icons/mob/blob.dmi', "blob_node_overlay"))
. += blob_overlay
. += mutable_appearance('icons/mob/blob.dmi', "blob_node_overlay")
/obj/structure/blob/special/node/creation_action()
if(overmind)
@@ -20,20 +20,23 @@
/obj/structure/blob/shield/core // Automatically generated by the core
point_return = 0
/obj/structure/blob/shield/update_icon()
..()
if(obj_integrity < max_integrity * 0.5)
icon_state = "[initial(icon_state)]_damaged"
name = "weakened [initial(name)]"
desc = "[damaged_desc]"
atmosblock = FALSE
air_update_turf(TRUE, FALSE)
else
icon_state = initial(icon_state)
name = initial(name)
desc = initial(desc)
atmosblock = TRUE
air_update_turf(TRUE, TRUE)
/obj/structure/blob/shield/update_name(updates)
. = ..()
name = "[(obj_integrity < (max_integrity * 0.5)) ? "weakened " : null][initial(name)]"
/obj/structure/blob/shield/update_desc(updates)
. = ..()
desc = (obj_integrity < (max_integrity * 0.5)) ? "[damaged_desc]" : initial(desc)
/obj/structure/blob/shield/take_damage(damage_amount, damage_type, damage_flag, sound_effect, attack_dir)
. = ..()
if(. && obj_integrity > 0)
atmosblock = obj_integrity < (max_integrity * 0.5)
air_update_turf(TRUE, atmosblock)
/obj/structure/blob/shield/update_icon_state()
icon_state = "[initial(icon_state)][(obj_integrity < (max_integrity * 0.5)) ? "_damaged" : null]"
return ..()
/obj/structure/blob/shield/reflective
name = "reflective blob"
+5 -9
View File
@@ -372,6 +372,7 @@
/obj/item/sharpener/cult/update_icon_state()
icon_state = "cult_sharpener[(uses == 0) ? "_used" : ""]"
return ..()
/obj/item/clothing/suit/hooded/cultrobes/cult_shield
name = "empowered cultist armor"
@@ -639,8 +640,7 @@
name = "bloody halberd"
desc = "A halberd with a volatile axehead made from crystallized blood. It seems linked to its creator. And, admittedly, more of a poleaxe than a halberd."
icon_state = "occultpoleaxe0"
inhand_icon_state = "occultpoleaxe0"
base_icon_state = "occultpoleaxe0"
base_icon_state = "occultpoleaxe"
w_class = WEIGHT_CLASS_HUGE
force = 17
throwforce = 40
@@ -663,7 +663,7 @@
/obj/item/melee/cultblade/halberd/ComponentInitialize()
. = ..()
AddComponent(/datum/component/butchering, 100, 90)
AddComponent(/datum/component/two_handed, force_unwielded=17, force_wielded=24)
AddComponent(/datum/component/two_handed, force_unwielded=17, force_wielded=24, icon_wielded = "[base_icon_state]1")
/// triggered on wield of two handed item
/obj/item/melee/cultblade/halberd/proc/on_wield(obj/item/source, mob/user)
@@ -678,12 +678,8 @@
wielded = FALSE
/obj/item/melee/cultblade/halberd/update_icon_state()
if(wielded)
icon_state = "occultpoleaxe1"
inhand_icon_state = "occultpoleaxe1"
else
icon_state = "[base_icon_state]"
inhand_icon_state = "[base_icon_state]"
icon_state = "[base_icon_state]0"
return ..()
/obj/item/melee/cultblade/halberd/Destroy()
if(halberd_act)
@@ -63,10 +63,11 @@
. = ..()
if(isnull(.))
return
update_icon()
update_appearance()
/obj/structure/destructible/cult/update_icon_state()
icon_state = "[initial(icon_state)][anchored ? null : "_off"]"
return ..()
/obj/structure/destructible/cult/attackby(obj/I, mob/user, params)
if(istype(I, /obj/item/melee/cultblade/dagger) && iscultist(user))
@@ -135,7 +135,7 @@
charge -= initial(EK.cost)
return TRUE
update_icon() // Not applicable to all objects.
update_appearance() // Not applicable to all objects.
/obj/item/forbidden_book/ui_close(mob/user)
flick("book_closing",src)
@@ -630,7 +630,7 @@
pixel_y = rand(-6,6)
pixel_x = rand(-6,6)
icon_state = "small_rune_[rand(12)]"
update_icon()
update_appearance()
/obj/effect/proc_holder/spell/cone/staggered/entropic_plume
name = "Entropic Plume"
@@ -3,6 +3,7 @@
desc = "Immortalized cast iron, the steel-like teeth holding it in place, it's vile extract has the power of rebirthing things, remaking them from the very beginning."
icon = 'icons/obj/eldritch.dmi'
icon_state = "crucible"
base_icon_state = "crucible"
anchored = FALSE
density = TRUE
///How much mass this currently holds
@@ -100,11 +101,8 @@
update_icon_state()
/obj/structure/eldritch_crucible/update_icon_state()
. = ..()
if(current_mass == max_mass)
icon_state = "crucible"
else
icon_state = "crucible_empty"
icon_state = "[base_icon_state][(current_mass == max_mass) ? null : "_empty"]"
return ..()
/obj/structure/trap/eldritch
name = "elder carving"
@@ -37,7 +37,7 @@
GLOB.nuke_list += src
core = new /obj/item/nuke_core(src)
STOP_PROCESSING(SSobj, core)
update_icon()
update_appearance()
AddElement(/datum/element/point_of_interest)
previous_level = get_security_level()
@@ -108,7 +108,7 @@
if(I.use_tool(src, user, 60, volume=100))
deconstruction_state = NUKESTATE_UNSCREWED
to_chat(user, "<span class='notice'>You remove the screws from [src]'s front panel.</span>")
update_icon()
update_appearance()
return
if(NUKESTATE_PANEL_REMOVED)
@@ -119,7 +119,7 @@
if(I.use_tool(src, user, 80, volume=100, amount=1))
to_chat(user, "<span class='notice'>You cut [src]'s inner plate.</span>")
deconstruction_state = NUKESTATE_WELDED
update_icon()
update_appearance()
return
if(NUKESTATE_CORE_EXPOSED)
if(istype(I, /obj/item/nuke_core_container))
@@ -129,7 +129,7 @@
if(core_box.load(core, user))
to_chat(user, "<span class='notice'>You load the plutonium core into [core_box].</span>")
deconstruction_state = NUKESTATE_CORE_REMOVED
update_icon()
update_appearance()
core = null
else
to_chat(user, "<span class='warning'>You fail to load the plutonium core into [core_box]. [core_box] has already been used!</span>")
@@ -143,7 +143,7 @@
to_chat(user, "<span class='notice'>You repair [src]'s inner metal plate. The radiation is contained.</span>")
deconstruction_state = NUKESTATE_PANEL_REMOVED
STOP_PROCESSING(SSobj, core)
update_icon()
update_appearance()
return
. = ..()
@@ -155,14 +155,14 @@
if(tool.use_tool(src, user, 30, volume=100))
to_chat(user, "<span class='notice'>You remove [src]'s front panel.</span>")
deconstruction_state = NUKESTATE_PANEL_REMOVED
update_icon()
update_appearance()
return TRUE
if(NUKESTATE_WELDED)
to_chat(user, "<span class='notice'>You start prying off [src]'s inner plate...</span>")
if(tool.use_tool(src, user, 30, volume=100))
to_chat(user, "<span class='notice'>You pry off [src]'s inner plate. You can see the core's green glow!</span>")
deconstruction_state = NUKESTATE_CORE_EXPOSED
update_icon()
update_appearance()
START_PROCESSING(SSobj, core)
return TRUE
@@ -179,7 +179,7 @@
/obj/machinery/nuclearbomb/update_icon_state()
if(deconstruction_state != NUKESTATE_INTACT)
icon_state = "nuclearbomb_base"
return
return ..()
switch(get_nuke_state())
if(NUKE_OFF_LOCKED, NUKE_OFF_UNLOCKED)
icon_state = "nuclearbomb_base"
@@ -187,6 +187,7 @@
icon_state = "nuclearbomb_timing"
if(NUKE_ON_EXPLODING)
icon_state = "nuclearbomb_exploding"
return ..()
/obj/machinery/nuclearbomb/update_overlays()
. += ..()
@@ -406,7 +407,7 @@
timing = FALSE
detonation_timer = null
countdown.stop()
update_icon()
update_appearance()
/obj/machinery/nuclearbomb/proc/set_active()
var/turf/our_turf = get_turf(src)
@@ -432,7 +433,7 @@
S.switch_mode_to(initial(S.mode))
S.alert = FALSE
countdown.stop()
update_icon()
update_appearance()
/obj/machinery/nuclearbomb/proc/get_time_left()
if(timing)
@@ -459,7 +460,7 @@
exploding = TRUE
yes_code = FALSE
safety = TRUE
update_icon()
update_appearance()
sound_to_playing_players('sound/machines/alarm.ogg')
if(SSticker?.mode)
SSticker.roundend_check_paused = TRUE
@@ -555,7 +556,7 @@
S.switch_mode_to(initial(S.mode))
S.alert = FALSE
countdown.stop()
update_icon()
update_appearance()
/obj/machinery/nuclearbomb/beer/proc/local_foam()
var/datum/reagents/R = new/datum/reagents(1000)
@@ -146,7 +146,7 @@
to_chat(admin, "<span class='danger'>Repairing flash failed!</span>")
else
flash.burnt_out = FALSE
flash.update_icon()
flash.update_appearance()
/datum/antagonist/rev/head/proc/admin_demote(datum/mind/target,mob/user)
message_admins("[key_name_admin(user)] has demoted [key_name_admin(owner)] from head revolutionary.")
@@ -678,7 +678,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module))
if(!is_station_level(F.z))
continue
F.obj_flags |= EMAGGED
F.update_icon()
F.update_appearance()
to_chat(owner, "<span class='notice'>All thermal sensors on the station have been disabled. Fire alerts will no longer be recognized.</span>")
owner.playsound_local(owner, 'sound/machines/terminal_off.ogg', 50, 0)
+6 -6
View File
@@ -42,7 +42,7 @@
/obj/structure/aquarium/Initialize()
. = ..()
update_icon()
update_appearance()
RegisterSignal(src,COMSIG_PARENT_ATTACKBY, .proc/feed_feedback)
@@ -96,7 +96,7 @@
if(!user.canUseTopic(src, BE_CLOSE))
return ..()
panel_open = !panel_open
update_icon()
update_appearance()
/obj/structure/aquarium/wrench_act(mob/living/user, obj/item/I)
if(default_unfasten_wrench(user,I))
@@ -114,7 +114,7 @@
glass.use(2)
broken = FALSE
obj_integrity = max_integrity
update_icon()
update_appearance()
return TRUE
else
// This signal exists so we common items instead of adding component on init can just register creation of one in response.
@@ -123,7 +123,7 @@
var/datum/component/aquarium_content/content_component = I.GetComponent(/datum/component/aquarium_content)
if(content_component && content_component.is_ready_to_insert(src))
if(user.transferItemToLoc(I,src))
update_icon()
update_appearance()
return TRUE
else
return ..()
@@ -163,7 +163,7 @@
return
user.visible_message("<span class='danger'>[user] stuffs [living_pulled] into [src]!</span>")
living_pulled.forceMove(src)
update_icon()
update_appearance()
///Apply mood bonus depending on aquarium status
/obj/structure/aquarium/proc/admire(mob/user)
@@ -250,7 +250,7 @@
var/datum/reagents/reagent_splash = new()
reagent_splash.add_reagent(/datum/reagent/water, 30)
chem_splash(droploc, 3, list(reagent_splash))
update_icon()
update_appearance()
#undef AQUARIUM_LAYER_STEP
#undef AQUARIUM_MIN_OFFSET
+7 -3
View File
@@ -18,8 +18,12 @@
throw_range = 7
drop_sound = 'sound/items/handling/component_drop.ogg'
pickup_sound = 'sound/items/handling/component_pickup.ogg'
var/is_position_sensitive = FALSE //set to true if the device has different icons for each position.
//This will prevent things such as visible lasers from facing the incorrect direction when transformed by assembly_holder's update_icon()
/**
* Set to true if the device has different icons for each position.
* This will prevent things such as visible lasers from facing the incorrect direction when transformed by assembly_holder's update_appearance()
*/
var/is_position_sensitive = FALSE
var/secured = TRUE
var/list/attached_overlays = null
var/obj/item/assembly_holder/holder = null
@@ -82,7 +86,7 @@
/obj/item/assembly/proc/toggle_secure()
secured = !secured
update_icon()
update_appearance()
return secured
/obj/item/assembly/attackby(obj/item/W, mob/user, params)
+7 -4
View File
@@ -19,10 +19,13 @@
/obj/item/onetankbomb/examine(mob/user)
return bombtank.examine(user)
/obj/item/onetankbomb/update_icon(updates)
icon = bombtank?.icon || initial(icon)
return ..()
/obj/item/onetankbomb/update_icon_state()
if(bombtank)
icon = bombtank.icon
icon_state = bombtank.icon_state
icon_state = bombtank?.icon_state || initial(icon_state)
return ..()
/obj/item/onetankbomb/update_overlays()
. = ..()
@@ -135,7 +138,7 @@
master = bomb
forceMove(bomb)
bomb.update_icon()
bomb.update_appearance()
user.put_in_hands(bomb) //Equips the bomb if possible, or puts it on the floor.
to_chat(user, "<span class='notice'>You attach [assembly] to [src].</span>")
+1 -1
View File
@@ -83,7 +83,7 @@
if(specialfunctions & BOLTS)
if(!D.wires.is_cut(WIRE_BOLTS) && D.hasPower())
D.locked = !D.locked
D.update_icon()
D.update_appearance()
if(specialfunctions & SHOCK)
if(D.secondsElectrified)
D.set_electrified(MACHINE_ELECTRIFIED_PERMANENT, usr)
+21 -14
View File
@@ -22,6 +22,9 @@
light_color = COLOR_WHITE
light_power = FLASH_LIGHT_POWER
light_on = FALSE
/// Whether we currently have the flashing overlay.
var/flashing = FALSE
/// The overlay we use for flashing.
var/flashing_overlay = "flash-f"
var/times_used = 0 //Number of times it's been used.
var/burnt_out = FALSE //Is the flash burnt out?
@@ -42,18 +45,22 @@
attack(user,user)
return FIRELOSS
/obj/item/assembly/flash/update_icon(flash = FALSE)
cut_overlays()
attached_overlays = list()
if(burnt_out)
add_overlay("flashburnt")
attached_overlays += "flashburnt"
/obj/item/assembly/flash/update_icon(updates=ALL, flash = FALSE)
flashing = flash
. = ..()
if(flash)
add_overlay(flashing_overlay)
attached_overlays += flashing_overlay
addtimer(CALLBACK(src, /atom/.proc/update_icon), 5)
if(holder)
holder.update_icon()
holder?.update_icon(updates)
/obj/item/assembly/flash/update_overlays()
attached_overlays = list()
. = ..()
if(burnt_out)
. += "flashburnt"
attached_overlays += "flashburnt"
if(flashing)
. += flashing_overlay
attached_overlays += flashing_overlay
/obj/item/assembly/flash/proc/clown_check(mob/living/carbon/human/user)
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
@@ -64,7 +71,7 @@
/obj/item/assembly/flash/proc/burn_out() //Made so you can override it if you want to have an invincible flash from R&D or something.
if(!burnt_out)
burnt_out = TRUE
update_icon()
update_appearance()
if(ismob(loc))
var/mob/M = loc
M.visible_message("<span class='danger'>[src] burns out!</span>","<span class='userdanger'>[src] burns out!</span>")
@@ -113,7 +120,7 @@
addtimer(CALLBACK(src, .proc/flash_end), FLASH_LIGHT_DURATION, TIMER_OVERRIDE|TIMER_UNIQUE)
times_used++
flash_recharge()
update_icon(TRUE)
update_icon(ALL, TRUE)
if(user && !clown_check(user))
return FALSE
return TRUE
@@ -239,7 +246,7 @@
if(issilicon(M))
var/mob/living/silicon/robot/flashed_borgo = M
log_combat(user, flashed_borgo, "flashed", src)
update_icon(TRUE)
update_icon(ALL, TRUE)
if(!flashed_borgo.flash_act(affect_silicon = TRUE))
user.visible_message("<span class='warning'>[user] fails to blind [flashed_borgo] with the flash!</span>", "<span class='warning'>You fail to blind [flashed_borgo] with the flash!</span>")
return
@@ -346,7 +353,7 @@
overheat = TRUE
addtimer(CALLBACK(src, .proc/cooldown), flashcd)
playsound(src, 'sound/weapons/flash.ogg', 100, TRUE)
update_icon(1)
update_icon(ALL, TRUE)
return TRUE
+1 -1
View File
@@ -27,7 +27,7 @@
else
scanning = FALSE
STOP_PROCESSING(SSobj, src)
update_icon()
update_appearance()
return secured
/obj/item/assembly/health/AltClick(mob/living/user)
+23 -19
View File
@@ -27,7 +27,7 @@
attach(A,user)
attach(A2,user)
name = "[A.name]-[A2.name] assembly"
update_icon()
update_appearance()
SSblackbox.record_feedback("tally", "assembly_made", 1, "[initial(A.name)]-[initial(A2.name)]")
/obj/item/assembly_holder/proc/attach(obj/item/assembly/A, mob/user)
@@ -44,27 +44,31 @@
a_right = A
A.holder_movement()
/obj/item/assembly_holder/update_icon()
cut_overlays()
/obj/item/assembly_holder/update_appearance(updates=ALL)
. = ..()
master?.update_appearance(updates)
/obj/item/assembly_holder/update_overlays()
. = ..()
if(a_left)
add_overlay("[a_left.icon_state]_left")
for(var/O in a_left.attached_overlays)
add_overlay("[O]_l")
. += "[a_left.icon_state]_left"
for(var/left_overlay in a_left.attached_overlays)
. += "[left_overlay]_l"
if(a_right)
if(a_right.is_position_sensitive)
add_overlay("[a_right.icon_state]_right")
for(var/O in a_right.attached_overlays)
add_overlay("[O]_r")
else
var/mutable_appearance/right = mutable_appearance(icon, "[a_right.icon_state]_left")
right.transform = matrix(-1, 0, 0, 0, 1, 0)
for(var/O in a_right.attached_overlays)
right.add_overlay("[O]_l")
add_overlay(right)
if(!a_right)
return
if(master)
master.update_icon()
if(a_right.is_position_sensitive)
. += "[a_right.icon_state]_right"
for(var/right_overlay in a_right.attached_overlays)
. += "[right_overlay]_r"
return
var/mutable_appearance/right = mutable_appearance(icon, "[a_right.icon_state]_left")
right.transform = matrix(-1, 0, 0, 0, 1, 0)
for(var/right_overlay in a_right.attached_overlays)
right.add_overlay("[right_overlay]_l")
. += right
/obj/item/assembly_holder/Crossed(atom/movable/AM as mob|obj)
. = ..()
+16 -15
View File
@@ -42,7 +42,7 @@
return FALSE //Cooldown check
on = !on
refreshBeam()
update_icon()
update_appearance()
return TRUE
/obj/item/assembly/infra/toggle_secure()
@@ -53,22 +53,23 @@
else
QDEL_LIST(beams)
STOP_PROCESSING(SSobj, src)
update_icon()
update_appearance()
return secured
/obj/item/assembly/infra/update_icon()
cut_overlays()
attached_overlays = list()
if(on)
add_overlay("infrared_on")
attached_overlays += "infrared_on"
if(visible && secured)
add_overlay("infrared_visible")
attached_overlays += "infrared_visible"
/obj/item/assembly/infra/update_appearance(updates=ALL)
. = ..()
holder?.update_appearance(updates)
if(holder)
holder.update_icon()
return
/obj/item/assembly/infra/update_overlays()
. = ..()
attached_overlays = list()
if(!on)
return
. += "infrared_on"
attached_overlays += "infrared_on"
if(visible && secured)
. += "infrared_visible"
attached_overlays += "infrared_visible"
/obj/item/assembly/infra/dropped()
. = ..()
@@ -213,7 +214,7 @@
visible = !visible
. = TRUE
update_icon()
update_appearance()
refreshBeam()
/***************************IBeam*********************************/
+11 -11
View File
@@ -23,16 +23,16 @@
if((HAS_TRAIT(user, TRAIT_DUMB) || HAS_TRAIT(user, TRAIT_CLUMSY)) && prob(50))
to_chat(user, "<span class='warning'>Your hand slips, setting off the trigger!</span>")
pulse(FALSE)
update_icon()
update_appearance()
playsound(src, 'sound/weapons/handcuffs.ogg', 30, TRUE, -3)
/obj/item/assembly/mousetrap/update_icon()
if(armed)
icon_state = "mousetraparmed"
else
icon_state = "mousetrap"
if(holder)
holder.update_icon()
/obj/item/assembly/mousetrap/update_icon_state()
icon_state = "mousetrap[armed ? "armed" : ""]"
return ..()
/obj/item/assembly/mousetrap/update_icon(updates=ALL)
. = ..()
holder?.update_icon(updates)
/obj/item/assembly/mousetrap/proc/triggered(mob/target, type = "feet")
if(!armed)
@@ -43,7 +43,7 @@
if(HAS_TRAIT(H, TRAIT_PIERCEIMMUNE))
playsound(src, 'sound/effects/snap.ogg', 50, TRUE)
armed = FALSE
update_icon()
update_appearance()
pulse(FALSE)
return FALSE
switch(type)
@@ -71,7 +71,7 @@
visible_message("<span class='boldannounce'>Skreeeee!</span>") //He's simply too large to be affected by a tiny mouse trap.
playsound(src, 'sound/effects/snap.ogg', 50, TRUE)
armed = FALSE
update_icon()
update_appearance()
pulse(FALSE)
@@ -89,7 +89,7 @@
return
to_chat(user, "<span class='notice'>You disarm [src].</span>")
armed = !armed
update_icon()
update_appearance()
playsound(src, 'sound/weapons/handcuffs.ogg', 30, TRUE, -3)
+12 -11
View File
@@ -32,7 +32,7 @@
timing = !timing
else
scanning = FALSE
update_icon()
update_appearance()
return TRUE
/obj/item/assembly/prox_sensor/on_detach()
@@ -53,7 +53,7 @@
else
START_PROCESSING(SSobj, src)
proximity_monitor.SetHost(loc,src)
update_icon()
update_appearance()
return secured
/obj/item/assembly/prox_sensor/HasProximity(atom/movable/AM as mob|obj)
@@ -87,7 +87,7 @@
return FALSE
scanning = scan
proximity_monitor.SetRange(scanning ? sensitivity : 0)
update_icon()
update_appearance()
/obj/item/assembly/prox_sensor/proc/sensitivity_change(value)
var/sense = min(max(sensitivity + value, 0), 5)
@@ -95,18 +95,19 @@
if(scanning && proximity_monitor.SetRange(sense))
sense()
/obj/item/assembly/prox_sensor/update_icon()
cut_overlays()
/obj/item/assembly/prox_sensor/update_appearance()
. = ..()
holder?.update_appearance()
/obj/item/assembly/prox_sensor/update_overlays()
. = ..()
attached_overlays = list()
if(timing)
add_overlay("prox_timing")
. += "prox_timing"
attached_overlays += "prox_timing"
if(scanning)
add_overlay("prox_scanning")
. += "prox_scanning"
attached_overlays += "prox_scanning"
if(holder)
holder.update_icon()
return
/obj/item/assembly/prox_sensor/ui_status(mob/user)
if(is_secured(user))
@@ -144,7 +145,7 @@
. = TRUE
if("time")
timing = !timing
update_icon()
update_appearance()
. = TRUE
if("input")
var/value = text2num(params["adjust"])
+4 -5
View File
@@ -61,10 +61,9 @@
signal()
return TRUE
/obj/item/assembly/signaler/update_icon()
if(holder)
holder.update_icon()
return
/obj/item/assembly/signaler/update_appearance()
. = ..()
holder?.update_appearance()
/obj/item/assembly/signaler/ui_status(mob/user)
if(is_secured(user))
@@ -110,7 +109,7 @@
code = initial(code)
. = TRUE
update_icon()
update_appearance()
/obj/item/assembly/signaler/attackby(obj/item/W, mob/user, params)
if(issignaler(W))
+11 -9
View File
@@ -40,7 +40,7 @@
if(!..())
return FALSE//Cooldown check
timing = !timing
update_icon()
update_appearance()
return TRUE
/obj/item/assembly/timer/toggle_secure()
@@ -50,7 +50,7 @@
else
timing = FALSE
STOP_PROCESSING(SSobj, src)
update_icon()
update_appearance()
return secured
/obj/item/assembly/timer/proc/timer_end()
@@ -64,7 +64,7 @@
LM.playsound_local(get_turf(src), 'sound/machines/triple_beep.ogg', ASSEMBLY_BEEP_VOLUME, TRUE)
if(loop)
timing = TRUE
update_icon()
update_appearance()
/obj/item/assembly/timer/process(delta_time)
if(!timing)
@@ -75,14 +75,16 @@
timer_end()
time = saved_time
/obj/item/assembly/timer/update_icon()
cut_overlays()
/obj/item/assembly/timer/update_appearance()
. = ..()
holder?.update_appearance()
/obj/item/assembly/timer/update_overlays()
. = ..()
attached_overlays = list()
if(timing)
add_overlay("timer_timing")
. += "timer_timing"
attached_overlays += "timer_timing"
if(holder)
holder.update_icon()
/obj/item/assembly/timer/ui_status(mob/user)
if(is_secured(user))
@@ -113,7 +115,7 @@
timing = !timing
if(timing && istype(holder, /obj/item/transfer_valve))
log_bomber(usr, "activated a", src, "attachment on [holder]")
update_icon()
update_appearance()
. = TRUE
if("repeat")
loop = !loop
+14 -13
View File
@@ -227,7 +227,7 @@
if(name == initial(name))
name = "[get_area_name(src)] Air Alarm"
update_icon()
update_appearance()
/obj/machinery/airalarm/Destroy()
SSradio.remove_object(src, frequency)
@@ -451,7 +451,7 @@
if(A.atmosalert(FALSE, src))
post_alert(0)
. = TRUE
update_icon()
update_appearance()
/obj/machinery/airalarm/proc/reset(wire)
@@ -459,7 +459,7 @@
if(WIRE_POWER)
if(!wires.is_cut(WIRE_POWER))
shorted = FALSE
update_icon()
update_appearance()
if(WIRE_AI)
if(!wires.is_cut(WIRE_AI))
aidisabled = FALSE
@@ -648,11 +648,11 @@
icon_state = "alarm_b2"
if(0)
icon_state = "alarm_b1"
return
return ..()
if((machine_stat & (NOPOWER|BROKEN)) || shorted)
icon_state = "alarmp"
return
return ..()
var/area/A = get_area(src)
switch(max(danger_level, A.atmosalm))
@@ -662,6 +662,7 @@
icon_state = "alarm2" //yes, alarm2 is yellow alarm
if(2)
icon_state = "alarm1"
return ..()
/obj/machinery/airalarm/process()
if((machine_stat & (NOPOWER|BROKEN)) || shorted)
@@ -732,7 +733,7 @@
if(A.atmosalert(new_area_danger_level,src)) //if area was in normal state or if area was in alert state
post_alert(new_area_danger_level)
update_icon()
update_appearance()
/obj/machinery/airalarm/attackby(obj/item/W, mob/user, params)
switch(buildstage)
@@ -742,13 +743,13 @@
to_chat(user, "<span class='notice'>You cut the final wires.</span>")
new /obj/item/stack/cable_coil(loc, 5)
buildstage = 1
update_icon()
update_appearance()
return
else if(W.tool_behaviour == TOOL_SCREWDRIVER) // Opening that Air Alarm up.
W.play_tool_sound(src)
panel_open = !panel_open
to_chat(user, "<span class='notice'>The wires have been [panel_open ? "exposed" : "unexposed"].</span>")
update_icon()
update_appearance()
return
else if(W.GetID())// trying to unlock the interface with an ID card
togglelock(user)
@@ -767,7 +768,7 @@
new /obj/item/electronics/airalarm( src.loc )
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, TRUE)
buildstage = 0
update_icon()
update_appearance()
return
if(istype(W, /obj/item/stack/cable_coil))
@@ -788,14 +789,14 @@
shorted = 0
post_alert(0)
buildstage = 2
update_icon()
update_appearance()
return
if(0)
if(istype(W, /obj/item/electronics/airalarm))
if(user.temporarilyRemoveItemFromInventory(W))
to_chat(user, "<span class='notice'>You insert the circuit.</span>")
buildstage = 1
update_icon()
update_appearance()
qdel(W)
return
@@ -806,7 +807,7 @@
user.visible_message("<span class='notice'>[user] fabricates a circuit and places it into [src].</span>", \
"<span class='notice'>You adapt an air alarm circuit and slot it into the assembly.</span>")
buildstage = 1
update_icon()
update_appearance()
return
if(W.tool_behaviour == TOOL_WRENCH)
@@ -829,7 +830,7 @@
user.visible_message("<span class='notice'>[user] fabricates a circuit and places it into [src].</span>", \
"<span class='notice'>You adapt an air alarm circuit and slot it into the assembly.</span>")
buildstage = 1
update_icon()
update_appearance()
return TRUE
return FALSE
@@ -158,7 +158,7 @@
if(can_be_node(target, i))
nodes[i] = target
break
update_icon()
update_appearance()
/**
* setter for pipe layers
@@ -169,7 +169,7 @@
*/
/obj/machinery/atmospherics/proc/setPipingLayer(new_layer)
piping_layer = (pipe_flags & PIPING_DEFAULT_LAYER_ONLY) ? PIPING_LAYER_DEFAULT : new_layer
update_icon()
update_appearance()
/obj/machinery/atmospherics/update_icon()
layer = initial(layer) + piping_layer / 1000
@@ -280,7 +280,7 @@
var/obj/machinery/atmospherics/pipe/P = reference
P.destroy_network()
nodes[nodes.Find(reference)] = null
update_icon()
update_appearance()
/obj/machinery/atmospherics/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/pipe)) //lets you autodrop
@@ -67,18 +67,21 @@
/obj/machinery/atmospherics/components/binary/circulator/process_atmos()
..()
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/binary/circulator/update_icon()
/obj/machinery/atmospherics/components/binary/circulator/update_icon_state()
if(!is_operational)
icon_state = "circ-p-[flipped]"
else if(last_pressure_delta > 0)
return ..()
if(last_pressure_delta > 0)
if(last_pressure_delta > ONE_ATMOSPHERE)
icon_state = "circ-run-[flipped]"
else
icon_state = "circ-slow-[flipped]"
else
icon_state = "circ-off-[flipped]"
return ..()
icon_state = "circ-off-[flipped]"
return ..()
/obj/machinery/atmospherics/components/binary/circulator/wrench_act(mob/living/user, obj/item/I)
if(!panel_open)
@@ -162,7 +165,7 @@
generator.cold_circ = null
else
generator.hot_circ = null
generator.update_icon()
generator.update_appearance()
generator = null
/obj/machinery/atmospherics/components/binary/circulator/setPipingLayer(new_layer)
@@ -184,4 +187,4 @@
flipped = !flipped
to_chat(usr, "<span class='notice'>You flip [src].</span>")
update_icon()
update_appearance()
@@ -170,8 +170,8 @@
addtimer(CALLBACK(src, .proc/broadcast_status), 2)
if(!("status" in signal.data)) //do not update_icon
update_icon()
if(!("status" in signal.data)) //do not update_appearance
update_appearance()
/obj/machinery/atmospherics/components/binary/dp_vent_pump/high_volume
name = "large dual-port air vent"
@@ -31,7 +31,7 @@ Passive gate is similar to the regular pump except:
if(can_interact(user))
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(user)]", INVESTIGATE_ATMOS)
update_icon()
update_appearance()
return ..()
/obj/machinery/atmospherics/components/binary/passive_gate/AltClick(mob/user)
@@ -39,7 +39,7 @@ Passive gate is similar to the regular pump except:
target_pressure = MAX_OUTPUT_PRESSURE
investigate_log("was set to [target_pressure] kPa by [key_name(user)]", INVESTIGATE_ATMOS)
to_chat(user, "<span class='notice'>You maximize the pressure output on [src] to [target_pressure] kPa.</span>")
update_icon()
update_appearance()
return ..()
/obj/machinery/atmospherics/components/binary/passive_gate/Destroy()
@@ -117,7 +117,7 @@ Passive gate is similar to the regular pump except:
if(.)
target_pressure = clamp(pressure, 0, ONE_ATMOSPHERE*100)
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", INVESTIGATE_ATMOS)
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/binary/passive_gate/atmosinit()
..()
@@ -147,7 +147,7 @@ Passive gate is similar to the regular pump except:
return
broadcast_status()
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/binary/passive_gate/can_unwrench(mob/user)
. = ..()
@@ -24,7 +24,7 @@
if(can_interact(user))
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(user)]", INVESTIGATE_ATMOS)
update_icon()
update_appearance()
return ..()
/obj/machinery/atmospherics/components/binary/pressure_valve/AltClick(mob/user)
@@ -32,7 +32,7 @@
target_pressure = MAX_OUTPUT_PRESSURE
investigate_log("was set to [target_pressure] kPa by [key_name(user)]", INVESTIGATE_ATMOS)
to_chat(user, "<span class='notice'>You set the target pressure on [src] to [target_pressure] kPa.</span>")
update_icon()
update_appearance()
return ..()
/obj/machinery/atmospherics/components/binary/pressure_valve/Destroy()
@@ -117,7 +117,7 @@
if(.)
target_pressure = clamp(pressure, 0, ONE_ATMOSPHERE*100)
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", INVESTIGATE_ATMOS)
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/binary/pressure_valve/atmosinit()
. = ..()
@@ -147,7 +147,7 @@
return
broadcast_status()
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/binary/pressure_valve/can_unwrench(mob/user)
. = ..()
@@ -31,7 +31,7 @@
if(can_interact(user))
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(user)]", INVESTIGATE_ATMOS)
update_icon()
update_appearance()
return ..()
/obj/machinery/atmospherics/components/binary/pump/AltClick(mob/user)
@@ -39,7 +39,7 @@
target_pressure = MAX_OUTPUT_PRESSURE
investigate_log("was set to [target_pressure] kPa by [key_name(user)]", INVESTIGATE_ATMOS)
to_chat(user, "<span class='notice'>You maximize the pressure output on [src] to [target_pressure] kPa.</span>")
update_icon()
update_appearance()
return ..()
/obj/machinery/atmospherics/components/binary/pump/Destroy()
@@ -115,7 +115,7 @@
if(.)
target_pressure = clamp(pressure, 0, MAX_OUTPUT_PRESSURE)
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", INVESTIGATE_ATMOS)
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/binary/pump/atmosinit()
..()
@@ -145,7 +145,7 @@
return
broadcast_status()
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/binary/pump/can_unwrench(mob/user)
. = ..()
@@ -23,7 +23,7 @@
if(can_interact(user))
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(user)]", INVESTIGATE_ATMOS)
update_icon()
update_appearance()
return ..()
/obj/machinery/atmospherics/components/binary/temperature_gate/AltClick(mob/user)
@@ -31,7 +31,7 @@
target_temperature = max_temperature
investigate_log("was set to [target_temperature] K by [key_name(user)]", INVESTIGATE_ATMOS)
to_chat(user, "<span class='notice'>You set the target temperature on [src] to [target_temperature] K.</span>")
update_icon()
update_appearance()
return ..()
@@ -110,7 +110,7 @@
if(.)
target_temperature = clamp(minimum_temperature, temperature, max_temperature)
investigate_log("was set to [target_temperature] K by [key_name(usr)]", INVESTIGATE_ATMOS)
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/binary/temperature_gate/can_unwrench(mob/user)
. = ..()
@@ -18,14 +18,14 @@
if(can_interact(user))
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(user)]", INVESTIGATE_ATMOS)
update_icon()
update_appearance()
return ..()
/obj/machinery/atmospherics/components/binary/temperature_pump/AltClick(mob/user)
if(can_interact(user) && !(heat_transfer_rate == max_heat_transfer_rate))
heat_transfer_rate = max_heat_transfer_rate
investigate_log("was set to [heat_transfer_rate]% by [key_name(user)]", INVESTIGATE_ATMOS)
update_icon()
update_appearance()
return ..()
/obj/machinery/atmospherics/components/binary/temperature_pump/update_icon_nopipes()
@@ -92,4 +92,4 @@
if(.)
heat_transfer_rate = clamp(rate, 0, max_heat_transfer_rate)
investigate_log("was set to [heat_transfer_rate]% by [key_name(usr)]", INVESTIGATE_ATMOS)
update_icon()
update_appearance()
@@ -32,7 +32,7 @@
if(can_interact(user))
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(user)]", INVESTIGATE_ATMOS)
update_icon()
update_appearance()
return ..()
/obj/machinery/atmospherics/components/binary/volume_pump/AltClick(mob/user)
@@ -40,7 +40,7 @@
transfer_rate = MAX_TRANSFER_RATE
investigate_log("was set to [transfer_rate] L/s by [key_name(user)]", INVESTIGATE_ATMOS)
to_chat(user, "<span class='notice'>You maximize the volume output on [src] to [transfer_rate] L/s.</span>")
update_icon()
update_appearance()
return ..()
/obj/machinery/atmospherics/components/binary/volume_pump/Destroy()
@@ -147,7 +147,7 @@
if(.)
transfer_rate = clamp(rate, 0, MAX_TRANSFER_RATE)
investigate_log("was set to [transfer_rate] L/s by [key_name(usr)]", INVESTIGATE_ATMOS)
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/binary/volume_pump/receive_signal(datum/signal/signal)
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
@@ -170,10 +170,10 @@
if("status" in signal.data)
broadcast_status()
return //do not update_icon
return //do not update_appearance
broadcast_status()
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/binary/volume_pump/can_unwrench(mob/user)
. = ..()
@@ -35,7 +35,7 @@
/obj/machinery/atmospherics/components/proc/hide_pipe(datum/source, covered)
showpipe = !covered
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/update_icon()
update_icon_nopipes()
@@ -108,14 +108,15 @@
node.addMember(src)
SSair.add_to_rebuild_queue(src)
/obj/machinery/atmospherics/components/unary/hypertorus/update_icon()
. = ..()
/obj/machinery/atmospherics/components/unary/hypertorus/update_icon_state()
if(panel_open)
icon_state = icon_state_open
else if(active)
return ..()
if(active)
icon_state = icon_state_active
else
icon_state = icon_state_off
return ..()
icon_state = icon_state_off
return ..()
/obj/machinery/atmospherics/components/unary/hypertorus/fuel_input
name = "HFR fuel input port"
@@ -411,22 +412,22 @@
return
to_chat(user, "<span class='notice'>You link all parts toghether.</span>")
active = TRUE
update_icon()
update_appearance()
linked_interface.active = TRUE
linked_interface.update_icon()
linked_interface.update_appearance()
RegisterSignal(linked_interface, COMSIG_PARENT_QDELETING, .proc/unregister_signals)
linked_input.active = TRUE
linked_input.update_icon()
linked_input.update_appearance()
RegisterSignal(linked_input, COMSIG_PARENT_QDELETING, .proc/unregister_signals)
linked_output.active = TRUE
linked_output.update_icon()
linked_output.update_appearance()
RegisterSignal(linked_output, COMSIG_PARENT_QDELETING, .proc/unregister_signals)
linked_moderator.active = TRUE
linked_moderator.update_icon()
linked_moderator.update_appearance()
RegisterSignal(linked_moderator, COMSIG_PARENT_QDELETING, .proc/unregister_signals)
for(var/obj/machinery/hypertorus/corner/corner in corners)
corner.active = TRUE
corner.update_icon()
corner.update_appearance()
RegisterSignal(corner, COMSIG_PARENT_QDELETING, .proc/unregister_signals)
soundloop = new(list(src), TRUE)
soundloop.volume = 5
@@ -445,27 +446,27 @@
if(!active)
return
active = FALSE
update_icon()
update_appearance()
if(linked_interface)
linked_interface.active = FALSE
linked_interface.update_icon()
linked_interface.update_appearance()
linked_interface = null
if(linked_input)
linked_input.active = FALSE
linked_input.update_icon()
linked_input.update_appearance()
linked_input = null
if(linked_output)
linked_output.active = FALSE
linked_output.update_icon()
linked_output.update_appearance()
linked_output = null
if(linked_moderator)
linked_moderator.active = FALSE
linked_moderator.update_icon()
linked_moderator.update_appearance()
linked_moderator = null
if(corners.len)
for(var/obj/machinery/hypertorus/corner/corner in corners)
corner.active = FALSE
corner.update_icon()
corner.update_appearance()
corners = list()
QDEL_NULL(soundloop)
@@ -1154,13 +1155,15 @@
return
return ..()
/obj/machinery/hypertorus/update_icon()
/obj/machinery/hypertorus/update_icon_state()
if(panel_open)
icon_state = icon_state_open
else if(active)
return ..()
if(active)
icon_state = icon_state_active
else
icon_state = icon_state_off
return ..()
icon_state = icon_state_off
return ..()
/obj/machinery/hypertorus/interface
name = "HFR interface"
@@ -18,7 +18,7 @@
if(can_interact(user))
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(user)]", INVESTIGATE_ATMOS)
update_icon()
update_appearance()
return ..()
/obj/machinery/atmospherics/components/trinary/filter/AltClick(mob/user)
@@ -26,7 +26,7 @@
transfer_rate = MAX_TRANSFER_RATE
investigate_log("was set to [transfer_rate] L/s by [key_name(user)]", INVESTIGATE_ATMOS)
to_chat(user, "<span class='notice'>You maximize the volume output on [src] to [transfer_rate] L/s.</span>")
update_icon()
update_appearance()
return ..()
/obj/machinery/atmospherics/components/trinary/filter/proc/set_frequency(new_frequency)
@@ -39,22 +39,14 @@
SSradio.remove_object(src,frequency)
return ..()
/obj/machinery/atmospherics/components/trinary/filter/update_icon()
cut_overlays()
/obj/machinery/atmospherics/components/trinary/filter/update_overlays()
. = ..()
for(var/direction in GLOB.cardinals)
if(!(direction & initialize_directions))
continue
var/obj/machinery/atmospherics/node = findConnecting(direction)
var/image/cap
if(node)
cap = getpipeimage(icon, "cap", direction, node.pipe_color, piping_layer = piping_layer, trinary = TRUE)
else
cap = getpipeimage(icon, "cap", direction, piping_layer = piping_layer, trinary = TRUE)
add_overlay(cap)
return ..()
. += getpipeimage(icon, "cap", direction, node?.pipe_color, piping_layer, TRUE)
/obj/machinery/atmospherics/components/trinary/filter/update_icon_nopipes()
var/on_state = on && nodes[1] && nodes[2] && nodes[3] && is_operational
@@ -168,7 +160,7 @@
filter_name = GLOB.meta_gas_info[gas][META_GAS_NAME]
investigate_log("was set to filter [filter_name] by [key_name(usr)]", INVESTIGATE_ATMOS)
. = TRUE
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/trinary/filter/can_unwrench(mob/user)
. = ..()
@@ -20,7 +20,7 @@
if(can_interact(user))
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(user)]", INVESTIGATE_ATMOS)
update_icon()
update_appearance()
return ..()
/obj/machinery/atmospherics/components/trinary/mixer/AltClick(mob/user)
@@ -28,25 +28,17 @@
target_pressure = MAX_OUTPUT_PRESSURE
investigate_log("was set to [target_pressure] kPa by [key_name(user)]", INVESTIGATE_ATMOS)
to_chat(user, "<span class='notice'>You maximize the pressure output on [src] to [target_pressure] kPa.</span>")
update_icon()
update_appearance()
return ..()
/obj/machinery/atmospherics/components/trinary/mixer/update_icon()
cut_overlays()
/obj/machinery/atmospherics/components/trinary/mixer/update_overlays()
. = ..()
for(var/direction in GLOB.cardinals)
if(!(direction & initialize_directions))
continue
var/obj/machinery/atmospherics/node = findConnecting(direction)
var/image/cap
if(node)
cap = getpipeimage(icon, "cap", direction, node.pipe_color, piping_layer = piping_layer, trinary = TRUE)
else
cap = getpipeimage(icon, "cap", direction, piping_layer = piping_layer, trinary = TRUE)
add_overlay(cap)
return ..()
. += getpipeimage(icon, "cap", direction, node?.pipe_color, piping_layer, TRUE)
/obj/machinery/atmospherics/components/trinary/mixer/update_icon_nopipes()
var/on_state = on && nodes[1] && nodes[2] && nodes[3] && is_operational
@@ -170,7 +162,7 @@
adjust_node1_value(100 - value)
investigate_log("was set to [node2_concentration] % on node 2 by [key_name(usr)]", INVESTIGATE_ATMOS)
. = TRUE
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/trinary/mixer/proc/adjust_node1_value(newValue)
node1_concentration = newValue / 100
@@ -122,7 +122,7 @@
/obj/machinery/atmospherics/components/unary/cryo_cell/set_occupant(atom/movable/new_occupant)
. = ..()
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/unary/cryo_cell/on_construction()
..(dir, dir)
@@ -183,10 +183,13 @@
beaker.forceMove(drop_location())
beaker = null
/obj/machinery/atmospherics/components/unary/cryo_cell/update_icon_state()
icon_state = (state_open) ? "pod-open" : ((on && is_operational) ? "pod-on" : "pod-off")
return ..()
/obj/machinery/atmospherics/components/unary/cryo_cell/update_icon()
. = ..()
plane = initial(plane)
icon_state = (state_open) ? "pod-open" : (on && is_operational) ? "pod-on" : "pod-off"
GLOBAL_VAR_INIT(cryo_overlay_cover_on, mutable_appearance('icons/obj/cryogenics.dmi', "cover-on", layer = ABOVE_WINDOW_LAYER + 0.02))
GLOBAL_VAR_INIT(cryo_overlay_cover_off, mutable_appearance('icons/obj/cryogenics.dmi', "cover-off", layer = ABOVE_WINDOW_LAYER + 0.02))
@@ -197,10 +200,7 @@ GLOBAL_VAR_INIT(cryo_overlay_cover_off, mutable_appearance('icons/obj/cryogenics
. += "pod-panel"
if(state_open)
return
if(on && is_operational)
. += GLOB.cryo_overlay_cover_on
else
. += GLOB.cryo_overlay_cover_off
. += (on && is_operational) ? GLOB.cryo_overlay_cover_on : GLOB.cryo_overlay_cover_off
/obj/machinery/atmospherics/components/unary/cryo_cell/nap_violation(mob/violator)
open_machine()
@@ -212,7 +212,7 @@ GLOBAL_VAR_INIT(cryo_overlay_cover_off, mutable_appearance('icons/obj/cryogenics
SEND_SIGNAL(src, COMSIG_CRYO_SET_ON, new_value)
. = on
on = new_value
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/unary/cryo_cell/on_set_is_operational(old_value)
if(old_value) //Turned off
@@ -315,7 +315,7 @@ GLOBAL_VAR_INIT(cryo_overlay_cover_off, mutable_appearance('icons/obj/cryogenics
if(air1.temperature > 2000)
take_damage(clamp((air1.temperature)/200, 10, 20), BURN)
update_parents()
/obj/machinery/atmospherics/components/unary/cryo_cell/relaymove(mob/living/user, direction)
@@ -392,7 +392,7 @@ GLOBAL_VAR_INIT(cryo_overlay_cover_off, mutable_appearance('icons/obj/cryogenics
|| default_change_direction_wrench(user, I) \
|| default_pry_open(I) \
|| default_deconstruction_crowbar(I))
update_icon()
update_appearance()
return
else if(I.tool_behaviour == TOOL_SCREWDRIVER)
to_chat(user, "<span class='warning'>You can't access the maintenance panel while the pod is " \
@@ -23,13 +23,15 @@
piping_layer = 4
icon_state = "he_map-4"
/obj/machinery/atmospherics/components/unary/heat_exchanger/update_icon_state()
icon_state = "he[nodes[1] ? 1 : 0]"
return ..()
/obj/machinery/atmospherics/components/unary/heat_exchanger/update_icon()
. = ..()
if(nodes[1])
icon_state = "he1"
var/obj/machinery/atmospherics/node = nodes[1]
add_atom_colour(node.color, FIXED_COLOUR_PRIORITY)
else
icon_state = "he0"
PIPING_LAYER_SHIFT(src, piping_layer)
/obj/machinery/atmospherics/components/unary/heat_exchanger/atmosinit()
@@ -27,7 +27,7 @@
if(can_interact(user))
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(user)]", INVESTIGATE_ATMOS)
update_icon()
update_appearance()
return ..()
/obj/machinery/atmospherics/components/unary/outlet_injector/AltClick(mob/user)
@@ -35,7 +35,7 @@
volume_rate = MAX_TRANSFER_RATE
investigate_log("was set to [volume_rate] L/s by [key_name(user)]", INVESTIGATE_ATMOS)
to_chat(user, "<span class='notice'>You maximize the volume output on [src] to [volume_rate] L/s.</span>")
update_icon()
update_appearance()
return ..()
/obj/machinery/atmospherics/components/unary/outlet_injector/Destroy()
@@ -139,7 +139,7 @@
addtimer(CALLBACK(src, .proc/broadcast_status), 2)
if(!("status" in signal.data)) //do not update_icon
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/unary/outlet_injector/ui_interact(mob/user, datum/tgui/ui)
@@ -176,7 +176,7 @@
if(.)
volume_rate = clamp(rate, 0, MAX_TRANSFER_RATE)
investigate_log("was set to [volume_rate] L/s by [key_name(usr)]", INVESTIGATE_ATMOS)
update_icon()
update_appearance()
broadcast_status()
/obj/machinery/atmospherics/components/unary/outlet_injector/can_unwrench(mob/user)
@@ -31,7 +31,7 @@
. = ..()
initialize_directions = dir
RefreshParts()
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/unary/thermomachine/proc/swap_function()
cooling = !cooling
@@ -45,7 +45,7 @@
icon_state_open = "heater-o"
target_temperature = T20C
RefreshParts()
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/unary/thermomachine/on_construction(obj_color, set_layer)
var/obj/item/circuitboard/machine/thermomachine/board = circuit
@@ -72,17 +72,19 @@
calculated_laser_rating += laser.rating
max_temperature = T20C + (base_heating * calculated_laser_rating) //573.15K with T1 stock parts
/obj/machinery/atmospherics/components/unary/thermomachine/update_icon()
cut_overlays()
/obj/machinery/atmospherics/components/unary/thermomachine/update_icon_state()
if(panel_open)
icon_state = icon_state_open
else if(on && is_operational)
return ..()
if(on && is_operational)
icon_state = icon_state_on
else
icon_state = icon_state_off
return ..()
icon_state = icon_state_off
return ..()
add_overlay(getpipeimage(icon, "pipe", dir, , piping_layer))
/obj/machinery/atmospherics/components/unary/thermomachine/update_overlays()
. = ..()
. += getpipeimage(icon, "pipe", dir, , piping_layer)
/obj/machinery/atmospherics/components/unary/thermomachine/update_icon_nopipes()
cut_overlays()
@@ -221,14 +223,14 @@
target_temperature = clamp(target, min_temperature, max_temperature)
investigate_log("was set to [target_temperature] K by [key_name(usr)]", INVESTIGATE_ATMOS)
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/unary/thermomachine/CtrlClick(mob/living/user)
if(!can_interact(user))
return
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(user)]", INVESTIGATE_ATMOS)
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/unary/thermomachine/freezer
icon_state = "freezer"
@@ -13,7 +13,7 @@
/obj/machinery/atmospherics/components/unary/on_construction()
..()
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/unary/proc/assign_uid_vents()
uid = num2text(gl_uid++)
@@ -246,11 +246,11 @@
if("status" in signal.data)
broadcast_status()
return // do not update_icon
return // do not update_appearance
// log_admin("DEBUG \[[world.timeofday]\]: vent_pump/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]")
broadcast_status()
update_icon()
update_appearance()
/obj/machinery/atmospherics/components/unary/vent_pump/welder_act(mob/living/user, obj/item/I)
..()
@@ -264,7 +264,7 @@
else
user.visible_message("<span class='notice'>[user] unwelded the vent.</span>", "<span class='notice'>You unweld the vent.</span>", "<span class='hear'>You hear welding.</span>")
welded = FALSE
update_icon()
update_appearance()
pipe_vision_img = image(src, loc, layer = ABOVE_HUD_LAYER, dir = dir)
pipe_vision_img.plane = ABOVE_HUD_PLANE
investigate_log("was [welded ? "welded shut" : "unwelded"] by [key_name(user)]", INVESTIGATE_ATMOS)
@@ -294,7 +294,7 @@
return
user.visible_message("<span class='warning'>[user] furiously claws at [src]!</span>", "<span class='notice'>You manage to clear away the stuff blocking the vent.</span>", "<span class='hear'>You hear loud scraping noises.</span>")
welded = FALSE
update_icon()
update_appearance()
pipe_vision_img = image(src, loc, layer = ABOVE_HUD_LAYER, dir = dir)
pipe_vision_img.plane = ABOVE_HUD_PLANE
playsound(loc, 'sound/weapons/bladeslice.ogg', 100, TRUE)
@@ -255,10 +255,10 @@
if("status" in signal.data)
broadcast_status()
return //do not update_icon
return //do not update_appearance
broadcast_status()
update_icon()
update_appearance()
return
/obj/machinery/atmospherics/components/unary/vent_scrubber/power_change()
@@ -277,7 +277,7 @@
else
user.visible_message("<span class='notice'>[user] unwelds the scrubber.</span>", "<span class='notice'>You unweld the scrubber.</span>", "<span class='hear'>You hear welding.</span>")
welded = FALSE
update_icon()
update_appearance()
pipe_vision_img = image(src, loc, layer = ABOVE_HUD_LAYER, dir = dir)
pipe_vision_img.plane = ABOVE_HUD_PLANE
investigate_log("was [welded ? "welded shut" : "unwelded"] by [key_name(user)]", INVESTIGATE_ATMOS)
@@ -303,7 +303,7 @@
return
user.visible_message("<span class='warning'>[user] furiously claws at [src]!</span>", "<span class='notice'>You manage to clear away the stuff blocking the scrubber.</span>", "<span class='hear'>You hear loud scraping noises.</span>")
welded = FALSE
update_icon()
update_appearance()
pipe_vision_img = image(src, loc, layer = ABOVE_HUD_LAYER, dir = dir)
pipe_vision_img.plane = ABOVE_HUD_PLANE
playsound(loc, 'sound/weapons/bladeslice.ogg', 100, TRUE)
@@ -72,12 +72,12 @@
/obj/machinery/atmospherics/miner/proc/set_active(setting)
if(active != setting)
active = setting
update_icon()
update_appearance()
/obj/machinery/atmospherics/miner/proc/set_broken(setting)
if(broken != setting)
broken = setting
update_icon()
update_appearance()
/obj/machinery/atmospherics/miner/proc/update_power()
if(!active)
@@ -113,7 +113,9 @@
. = ..()
if(broken)
. += "broken"
else if(active)
return
if(active)
var/mutable_appearance/on_overlay = mutable_appearance(icon, "on")
on_overlay.color = overlay_color
. += on_overlay
@@ -30,9 +30,9 @@
return ..(target, given_layer, FALSE) //we want a normal pipe instead
return ..(target, given_layer, TRUE)
/obj/machinery/atmospherics/pipe/heat_exchanging/junction/update_icon()
/obj/machinery/atmospherics/pipe/heat_exchanging/junction/update_icon_state()
icon_state = "pipe[nodes[1] ? "1" : "0"][nodes[2] ? "1" : "0"]-[piping_layer]"
update_layer()
return ..()
/obj/machinery/atmospherics/pipe/heat_exchanging/junction/layer2
piping_layer = 2
@@ -26,18 +26,16 @@
initialize_directions = ALL_CARDINALS
initialize_directions &= ~dir
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold/update_icon()
cut_overlays()
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold/update_overlays()
. = ..()
PIPING_LAYER_DOUBLE_SHIFT(center, piping_layer)
add_overlay(center)
. += center
//Add non-broken pieces
for(var/i in 1 to device_type)
if(nodes[i])
add_overlay( getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i])) )
update_layer()
. += getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i]))
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold/layer2
piping_layer = 2
@@ -24,18 +24,16 @@
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w/SetInitDirections()
initialize_directions = initial(initialize_directions)
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w/update_icon()
cut_overlays()
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w/update_overlays()
. = ..()
PIPING_LAYER_DOUBLE_SHIFT(center, piping_layer)
add_overlay(center)
. += center
//Add non-broken pieces
for(var/i in 1 to device_type)
if(nodes[i])
add_overlay( getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i])) )
update_layer()
. += getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i]))
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w/layer2
piping_layer = 2
@@ -24,9 +24,9 @@
if(EAST, WEST)
initialize_directions = EAST|WEST
/obj/machinery/atmospherics/pipe/heat_exchanging/simple/update_icon()
/obj/machinery/atmospherics/pipe/heat_exchanging/simple/update_icon_state()
icon_state = "pipe[nodes[1] ? "1" : "0"][nodes[2] ? "1" : "0"]-[piping_layer]"
update_layer()
return ..()
/obj/machinery/atmospherics/pipe/heat_exchanging/simple/layer2
piping_layer = 2
@@ -38,35 +38,33 @@
/obj/machinery/atmospherics/pipe/layer_manifold/proc/get_all_connected_nodes()
return front_nodes + back_nodes + nodes
/obj/machinery/atmospherics/pipe/layer_manifold/update_icon()
cut_overlays()
/obj/machinery/atmospherics/pipe/layer_manifold/update_layer()
layer = initial(layer) + (PIPING_LAYER_MAX * PIPING_LAYER_LCHANGE) //This is above everything else.
for(var/node in front_nodes)
add_attached_images(node)
for(var/node in back_nodes)
add_attached_images(node)
/obj/machinery/atmospherics/pipe/layer_manifold/update_overlays()
. = ..()
/obj/machinery/atmospherics/pipe/layer_manifold/proc/add_attached_images(obj/machinery/atmospherics/A)
for(var/node in front_nodes)
. += get_attached_images(node)
for(var/node in back_nodes)
. += get_attached_images(node)
/obj/machinery/atmospherics/pipe/layer_manifold/proc/get_attached_images(obj/machinery/atmospherics/A)
if(!A)
return
. = list()
if(istype(A, /obj/machinery/atmospherics/pipe/layer_manifold))
for(var/i in PIPING_LAYER_MIN to PIPING_LAYER_MAX)
add_attached_image(get_dir(src, A), i)
return
add_attached_image(get_dir(src, A), A.piping_layer, A.pipe_color)
/obj/machinery/atmospherics/pipe/layer_manifold/proc/add_attached_image(p_dir, p_layer, p_color = null)
var/image/I
. += get_attached_image(get_dir(src, A), i)
return
. += get_attached_image(get_dir(src, A), A.piping_layer, A.pipe_color)
/obj/machinery/atmospherics/pipe/layer_manifold/proc/get_attached_image(p_dir, p_layer, p_color = null)
// Uses pipe-3 because we don't want the vertical shifting
if(p_color)
I = getpipeimage(icon, "pipe-3", p_dir, p_color, piping_layer = p_layer)
else
I = getpipeimage(icon, "pipe-3", p_dir, piping_layer = p_layer)
var/image/I = getpipeimage(icon, "pipe-3", p_dir, p_color, p_layer)
I.layer = layer - 0.01
add_overlay(I)
return I
/obj/machinery/atmospherics/pipe/layer_manifold/SetInitDirections()
switch(dir)
@@ -93,7 +91,7 @@
new_nodes += foundfront
if(foundback && !QDELETED(foundback))
new_nodes += foundback
update_icon()
update_appearance()
return new_nodes
/obj/machinery/atmospherics/pipe/layer_manifold/atmosinit()
@@ -120,7 +118,7 @@
if(reference in back_nodes)
var/i = back_nodes.Find(reference)
back_nodes[i] = null
update_icon()
update_appearance()
/obj/machinery/atmospherics/pipe/layer_manifold/relaymove(mob/living/user, direction)
if(initialize_directions & direction)
@@ -30,16 +30,15 @@
initialize_directions = ALL_CARDINALS
initialize_directions &= ~dir
/obj/machinery/atmospherics/pipe/manifold/update_icon()
cut_overlays()
/obj/machinery/atmospherics/pipe/manifold/update_overlays()
. = ..()
if(!center)
center = mutable_appearance(icon, "manifold_center")
PIPING_LAYER_DOUBLE_SHIFT(center, piping_layer)
add_overlay(center)
. += center
//Add non-broken pieces
for(var/i in 1 to device_type)
if(nodes[i])
add_overlay( getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i])) )
update_layer()
. += getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i]))
@@ -24,16 +24,14 @@
/obj/machinery/atmospherics/pipe/manifold4w/SetInitDirections()
initialize_directions = initial(initialize_directions)
/obj/machinery/atmospherics/pipe/manifold4w/update_icon()
cut_overlays()
/obj/machinery/atmospherics/pipe/manifold4w/update_overlays()
. = ..()
if(!center)
center = mutable_appearance(icon, "manifold_center")
PIPING_LAYER_DOUBLE_SHIFT(center, piping_layer)
add_overlay(center)
. += center
//Add non-broken pieces
for(var/i in 1 to device_type)
if(nodes[i])
add_overlay( getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i])) )
update_layer()
. += getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i]))
@@ -32,13 +32,17 @@
/obj/machinery/atmospherics/pipe/multiz/SetInitDirections()
initialize_directions = dir
/obj/machinery/atmospherics/pipe/multiz/update_icon()
cut_overlays()
/obj/machinery/atmospherics/pipe/multiz/update_layer()
return // Noop because we're moving this to /obj/machinery/atmospherics/pipe
/obj/machinery/atmospherics/pipe/multiz/update_overlays()
. = ..()
pipe.color = front_node ? front_node.pipe_color : rgb(255, 255, 255)
pipe.icon_state = "pipe-[piping_layer]"
. += pipe
center.pixel_x = PIPING_LAYER_P_X * (piping_layer - PIPING_LAYER_DEFAULT)
add_overlay(pipe)
add_overlay(center)
. += center
///Attempts to locate a multiz pipe that's above us, if it finds one it merges us into its pipenet
/obj/machinery/atmospherics/pipe/multiz/pipeline_expansion()
@@ -83,6 +83,10 @@
qdel(meter)
. = ..()
/obj/machinery/atmospherics/pipe/update_icon()
. = ..()
update_layer()
/obj/machinery/atmospherics/pipe/proc/update_node_icon()
for(var/i in 1 to device_type)
if(nodes[i])
@@ -27,6 +27,6 @@
if(EAST, WEST)
initialize_directions = EAST|WEST
/obj/machinery/atmospherics/pipe/simple/update_icon()
/obj/machinery/atmospherics/pipe/simple/update_icon_state()
icon_state = "pipe[nodes[1] ? "1" : "0"][nodes[2] ? "1" : "0"]-[piping_layer]"
update_layer()
return ..()
@@ -275,7 +275,7 @@
timing = !timing
if(timing)
valve_timer = world.time + (timer_set * 10)
update_icon()
update_appearance()
/obj/machinery/portable_atmospherics/canister/proto
name = "prototype canister"
@@ -330,7 +330,7 @@
air_contents.copy_from(existing_mixture)
else
create_gas()
update_icon()
update_appearance()
/obj/machinery/portable_atmospherics/canister/proc/create_gas()
@@ -350,6 +350,7 @@
/obj/machinery/portable_atmospherics/canister/update_icon_state()
if(machine_stat & BROKEN)
icon_state = "[base_icon_state]-1"
return ..()
/obj/machinery/portable_atmospherics/canister/update_overlays()
. = ..()
@@ -362,15 +363,16 @@
. += "can-open"
if(connected_port)
. += "can-connector"
var/pressure = air_contents.return_pressure()
if(pressure >= 40 * ONE_ATMOSPHERE)
. += "can-3"
else if(pressure >= 10 * ONE_ATMOSPHERE)
. += "can-2"
else if(pressure >= 5 * ONE_ATMOSPHERE)
. += "can-1"
else if(pressure >= 10)
. += "can-0"
switch(air_contents.return_pressure())
if((40 * ONE_ATMOSPHERE) to INFINITY)
. += "can-3"
if((10 * ONE_ATMOSPHERE) to (40 * ONE_ATMOSPHERE))
. += "can-2"
if((5 * ONE_ATMOSPHERE) to (10 * ONE_ATMOSPHERE))
. += "can-1"
if((10) to (5 * ONE_ATMOSPHERE))
. += "can-0"
/obj/machinery/portable_atmospherics/canister/should_atmos_process(datum/gas_mixture/air, exposed_temperature)
@@ -444,7 +446,7 @@
if(.)
if(close_valve)
valve_open = FALSE
update_icon()
update_appearance()
investigate_log("Valve was <b>closed</b> by [key_name(user)].", INVESTIGATE_ATMOS)
else if(valve_open && holding)
investigate_log("[key_name(user)] started a transfer into [holding].", INVESTIGATE_ATMOS)
@@ -471,7 +473,7 @@
///function used to check the limit of the canisters and also set the amount of damage that the canister can receive, if the heat and pressure are way higher than the limit the more damage will be done
if(our_temperature > heat_limit || our_pressure > pressure_limit)
take_damage(clamp((our_temperature/heat_limit) * (our_pressure/pressure_limit) * delta_time * 2, 5, 50), BURN, 0)
update_icon()
update_appearance()
/obj/machinery/portable_atmospherics/canister/ui_state(mob/user)
return GLOB.physical_state
@@ -619,4 +621,4 @@
investigate_log("[key_name(usr)] removed the [holding], leaving the valve open and transferring into the <span class='boldannounce'>air</span>.", INVESTIGATE_ATMOS)
replace_tank(usr, FALSE)
. = TRUE
update_icon()
update_appearance()
@@ -70,7 +70,7 @@
anchored = TRUE //Prevent movement
pixel_x = new_port.pixel_x
pixel_y = new_port.pixel_y
update_icon()
update_appearance()
return TRUE
/obj/machinery/portable_atmospherics/Move()
@@ -86,7 +86,7 @@
connected_port = null
pixel_x = 0
pixel_y = 0
update_icon()
update_appearance()
return TRUE
/obj/machinery/portable_atmospherics/AltClick(mob/living/user)
@@ -111,7 +111,7 @@
holding = null
if(new_tank)
holding = new_tank
update_icon()
update_appearance()
return TRUE
/obj/machinery/portable_atmospherics/attackby(obj/item/W, mob/user, params)
@@ -123,7 +123,7 @@
to_chat(user, "<span class='notice'>[holding ? "In one smooth motion you pop [holding] out of [src]'s connector and replace it with [T]" : "You insert [T] into [src]"].</span>")
investigate_log("had its internal [holding] swapped with [T] by [key_name(user)].", INVESTIGATE_ATMOS)
replace_tank(user, FALSE, T)
update_icon()
update_appearance()
else if(W.tool_behaviour == TOOL_WRENCH)
if(!(machine_stat & BROKEN))
if(connected_port)
@@ -134,7 +134,7 @@
"[user] disconnects [src].", \
"<span class='notice'>You unfasten [src] from the port.</span>", \
"<span class='hear'>You hear a ratchet.</span>")
update_icon()
update_appearance()
return
else
var/obj/machinery/atmospherics/components/unary/portables_connector/possible_port = locate(/obj/machinery/atmospherics/components/unary/portables_connector) in loc
@@ -149,7 +149,7 @@
"[user] connects [src].", \
"<span class='notice'>You fasten [src] to the port.</span>", \
"<span class='hear'>You hear a ratchet.</span>")
update_icon()
update_appearance()
investigate_log("was connected to [possible_port] by [key_name(user)].", INVESTIGATE_ATMOS)
else
return ..()
@@ -29,6 +29,7 @@
/obj/machinery/portable_atmospherics/pump/update_icon_state()
icon_state = "psiphon:[on]"
return ..()
/obj/machinery/portable_atmospherics/pump/update_overlays()
. = ..()
@@ -74,7 +75,7 @@
if(prob(100 / severity))
direction = PUMP_OUT
target_pressure = rand(0, 100 * ONE_ATMOSPHERE)
update_icon()
update_appearance()
/obj/machinery/portable_atmospherics/pump/replace_tank(mob/living/user, close_valve)
. = ..()
@@ -82,7 +83,7 @@
if(close_valve)
if(on)
on = FALSE
update_icon()
update_appearance()
else if(on && holding && direction == PUMP_OUT)
investigate_log("[key_name(user)] started a transfer into [holding].", INVESTIGATE_ATMOS)
@@ -156,4 +157,4 @@
if(holding)
replace_tank(usr, FALSE)
. = TRUE
update_icon()
update_appearance()
@@ -38,6 +38,7 @@
/obj/machinery/portable_atmospherics/scrubber/update_icon_state()
icon_state = "pscrubber:[on]"
return ..()
/obj/machinery/portable_atmospherics/scrubber/update_overlays()
. = ..()
@@ -97,7 +98,7 @@
if(is_operational)
if(prob(50 / severity))
on = !on
update_icon()
update_appearance()
/obj/machinery/portable_atmospherics/scrubber/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
@@ -131,7 +132,7 @@
if(close_valve)
if(on)
on = FALSE
update_icon()
update_appearance()
else if(on && holding)
investigate_log("[key_name(user)] started a transfer into [holding].", INVESTIGATE_ATMOS)
@@ -150,7 +151,7 @@
if("toggle_filter")
scrubbing ^= gas_id2path(params["val"])
. = TRUE
update_icon()
update_appearance()
/obj/machinery/portable_atmospherics/scrubber/huge
name = "huge air scrubber"
@@ -174,11 +175,12 @@
/obj/machinery/portable_atmospherics/scrubber/huge/update_icon_state()
icon_state = "scrubber:[on]"
return ..()
/obj/machinery/portable_atmospherics/scrubber/huge/process_atmos(delta_time)
if((!anchored && !movable) || !is_operational)
on = FALSE
update_icon()
update_appearance()
use_power = on ? ACTIVE_POWER_USE : IDLE_POWER_USE
if(!on)
return
+4 -3
View File
@@ -176,7 +176,7 @@ GLOBAL_LIST_EMPTY(gateway_destinations)
/obj/machinery/gateway/Initialize()
generate_destination()
update_icon()
update_appearance()
portal_visuals = new
vis_contents += portal_visuals
return ..()
@@ -193,7 +193,7 @@ GLOBAL_LIST_EMPTY(gateway_destinations)
dest.deactivate(src)
QDEL_NULL(portal)
use_power = IDLE_POWER_USE
update_icon()
update_appearance()
portal_visuals.reset_visuals()
/obj/machinery/gateway/process()
@@ -201,6 +201,7 @@ GLOBAL_LIST_EMPTY(gateway_destinations)
if(target)
deactivate()
return
/obj/machinery/gateway/safe_throw_at(atom/target, range, speed, mob/thrower, spin = TRUE, diagonals_first = FALSE, datum/callback/callback, force = MOVE_FORCE_STRONG, gentle = FALSE)
return
@@ -216,7 +217,7 @@ GLOBAL_LIST_EMPTY(gateway_destinations)
portal_visuals.setup_visuals(target)
generate_bumper()
use_power = ACTIVE_POWER_USE
update_icon()
update_appearance()
/obj/machinery/gateway/proc/Transfer(atom/movable/AM)
if(!target || !target.incoming_pass_check(AM))
@@ -20,6 +20,7 @@
desc = "A heavy duty industrial laser."
icon = 'icons/obj/singularity.dmi'
icon_state = "emitter_+a"
base_icon_state = "emitter_+a"
anchored = TRUE
density = TRUE
resistance_flags = INDESTRUCTIBLE | FIRE_PROOF | ACID_PROOF
+2 -2
View File
@@ -130,12 +130,12 @@
close_switchstates()
mode = new newmode(src)
mode.enter_mode(src)
modebutton.update_icon()
modebutton.update_appearance()
/datum/buildmode/proc/change_dir(newdir)
build_dir = newdir
close_dirswitch()
dirbutton.update_icon()
dirbutton.update_appearance()
return 1
/datum/buildmode/proc/InterceptClickOn(mob/user, params, atom/object)
+4 -2
View File
@@ -24,11 +24,12 @@
else if(LAZYACCESS(modifiers, RIGHT_CLICK))
bd.mode.change_settings(usr.client)
update_icon()
update_appearance()
return 1
/atom/movable/screen/buildmode/mode/update_icon_state()
icon_state = bd.mode.get_button_iconstate()
return ..()
/atom/movable/screen/buildmode/help
icon_state = "buildhelp"
@@ -46,10 +47,11 @@
/atom/movable/screen/buildmode/bdir/update_icon_state()
dir = bd.build_dir
return ..()
/atom/movable/screen/buildmode/bdir/Click()
bd.toggle_dirswitch()
update_icon()
update_appearance()
return 1
// used to switch between modes
+1 -1
View File
@@ -709,7 +709,7 @@
if (isnull(target_turf))
return
var/obj/structure/closet/supplypod/centcompod/toLaunch = DuplicateObject(temp_pod) //Duplicate the temp_pod (which we have been varediting or configuring with the UI) and store the result
toLaunch.update_icon()//we update_icon() here so that the door doesnt "flicker on" right after it lands
toLaunch.update_appearance()//we update_appearance() here so that the door doesnt "flicker on" right after it lands
var/shippingLane = GLOB.areas_by_type[/area/centcom/supplypod/supplypod_temp_holding]
toLaunch.forceMove(shippingLane)
if (launchClone) //We arent launching the actual items from the bay, rather we are creating clones and launching those
+2 -2
View File
@@ -210,7 +210,7 @@
else
new /obj/effect/pod_landingzone(LZ, podType, SO)
. = TRUE
update_icon()
update_appearance()
else
if(SO.pack.get_cost() * (0.72*MAX_EMAG_ROCKETS) <= points_to_check) // bulk discount :^)
landingzone = GLOB.areas_by_type[pick(GLOB.the_station_areas)] //override default landing zone
@@ -232,5 +232,5 @@
else
new /obj/effect/pod_landingzone(LZ, podType, SO)
. = TRUE
update_icon()
update_appearance()
CHECK_TICK
+2 -2
View File
@@ -65,12 +65,12 @@
/mob/living/simple_animal/pet/gondola/gondolapod/setOpened()
opened = TRUE
update_icon()
update_appearance()
addtimer(CALLBACK(src, /atom/.proc/setClosed), 50)
/mob/living/simple_animal/pet/gondola/gondolapod/setClosed()
opened = FALSE
update_icon()
update_appearance()
/mob/living/simple_animal/pet/gondola/gondolapod/death()
qdel(linked_pod) //Will cause the open() proc for the linked supplypod to be called with the "broken" parameter set to true, meaning that it will dump its contents on death
+3 -3
View File
@@ -58,7 +58,7 @@
P.info += "Rank: [orderer_rank]<br/>"
P.info += "Comment: [reason]<br/>"
P.update_icon()
P.update_appearance()
return P
/datum/supply_order/proc/generateManifest(obj/container, owner, packname) //generates-the-manifests.
@@ -96,13 +96,13 @@
while(--lost >= 0)
qdel(pick(container.contents))
P.update_icon()
P.update_appearance()
P.forceMove(container)
if(istype(container, /obj/structure/closet/crate))
var/obj/structure/closet/crate/C = container
C.manifest = P
C.update_icon()
C.update_appearance()
else
container.contents += P
+2 -2
View File
@@ -1840,7 +1840,7 @@
var/obj/item/pizzabox/infinite/fourfiveeight = new(C)
fourfiveeight.boxtag = P.boxtag
fourfiveeight.boxtag_set = TRUE
fourfiveeight.update_icon()
fourfiveeight.update_appearance()
qdel(P)
anomalous_box_provided = TRUE
log_game("An anomalous pizza box was provided in a pizza crate at during cargo delivery")
@@ -1875,7 +1875,7 @@
P.pizza = new replacement_type
P.boxtag = P.pizza.boxtag
P.boxtag_set = TRUE
P.update_icon()
P.update_appearance()
/datum/supply_pack/organic/pizza/proc/anomalous_pizza_report()
print_command_report("[station_name()], our anomalous materials divison has reported a missing object that is highly likely to have been sent to your station during a routine cargo \
+37 -33
View File
@@ -107,7 +107,7 @@
door = "[base]_door"
else
door = FALSE
update_icon()
update_appearance()
/obj/structure/closet/supplypod/proc/SetReverseIcon()
fin_mask = "bottomfin"
@@ -115,7 +115,7 @@
icon_state = GLOB.podstyles[style][POD_BASE] + "_reverse"
pixel_x = initial(pixel_x)
transform = matrix()
update_icon()
update_appearance()
/obj/structure/closet/supplypod/proc/backToNonReverseIcon()
fin_mask = initial(fin_mask)
@@ -123,33 +123,35 @@
icon_state = GLOB.podstyles[style][POD_BASE]
pixel_x = initial(pixel_x)
transform = matrix()
update_icon()
update_appearance()
/obj/structure/closet/supplypod/closet_update_overlays(list/new_overlays)
return
/obj/structure/closet/supplypod/update_overlays()
. = ..()
if (style == STYLE_INVISIBLE)
if(style == STYLE_INVISIBLE)
return
if (rubble)
if(rubble)
. += rubble.getForeground(src)
if (style == STYLE_SEETHROUGH)
for (var/atom/A in contents)
if(style == STYLE_SEETHROUGH)
for(var/atom/A in contents)
var/mutable_appearance/itemIcon = new(A)
itemIcon.transform = matrix().Translate(-1 * SUPPLYPOD_X_OFFSET, 0)
. += itemIcon
for (var/t in turfs_in_cargo)//T is just a turf's type
for(var/t in turfs_in_cargo)//T is just a turf's type
var/turf/turf_type = t
var/mutable_appearance/itemIcon = mutable_appearance(initial(turf_type.icon), initial(turf_type.icon_state))
itemIcon.transform = matrix().Translate(-1 * SUPPLYPOD_X_OFFSET, 0)
. += itemIcon
return
if (opened) //We're opened means all we have to worry about is masking a decal if we have one
if (!decal) //We don't have a decal to mask
if(opened) //We're opened means all we have to worry about is masking a decal if we have one
if(!decal) //We don't have a decal to mask
return
if (!door) //We have a decal but no door, so let's just add the decal
if(!door) //We have a decal but no door, so let's just add the decal
. += decal
return
var/icon/masked_decal = new(icon, decal) //The decal we want to apply
@@ -159,23 +161,25 @@
door_masker.Blend("#000000", ICON_SUBTRACT)
masked_decal.Blend(door_masker, ICON_ADD)
. += masked_decal
else //If we're closed
if (!door) //We have no door, lets see if we have a decal. If not, theres nothing we need to do
if (decal)
. += decal
return
else if (GLOB.podstyles[style][POD_SHAPE] != POD_SHAPE_NORML) //If we're not a normal pod shape (aka, if we don't have fins), just add the door without masking
. += door
else
var/icon/masked_door = new(icon, door) //The door we want to apply
var/icon/fin_masker = new(icon, "mask_[fin_mask]") //The fin shape we want to 'cut out' of the door
fin_masker.MapColors(0,0,0,1, 0,0,0,1, 0,0,0,1, 1,1,1,0, 0,0,0,1)
fin_masker.SwapColor("#ffffffff", null)
fin_masker.Blend("#000000", ICON_SUBTRACT)
masked_door.Blend(fin_masker, ICON_ADD)
. += masked_door
if (decal)
return
//If we're closed
if(!door) //We have no door, lets see if we have a decal. If not, theres nothing we need to do
if(decal)
. += decal
return
else if (GLOB.podstyles[style][POD_SHAPE] != POD_SHAPE_NORML) //If we're not a normal pod shape (aka, if we don't have fins), just add the door without masking
. += door
else
var/icon/masked_door = new(icon, door) //The door we want to apply
var/icon/fin_masker = new(icon, "mask_[fin_mask]") //The fin shape we want to 'cut out' of the door
fin_masker.MapColors(0,0,0,1, 0,0,0,1, 0,0,0,1, 1,1,1,0, 0,0,0,1)
fin_masker.SwapColor("#ffffffff", null)
fin_masker.Blend("#000000", ICON_SUBTRACT)
masked_door.Blend(fin_masker, ICON_ADD)
. += masked_door
if(decal)
. += decal
/obj/structure/closet/supplypod/tool_interact(obj/item/W, mob/user)
if(bluespace) //We dont want to worry about interacting with bluespace pods, as they are due to delete themselves soon anyways.
@@ -408,17 +412,17 @@
/obj/structure/closet/supplypod/setOpened() //Proc exists here, as well as in any atom that can assume the role of a "holder" of a supplypod. Check the open_pod() proc for more details
opened = TRUE
density = FALSE
update_icon()
update_appearance()
/obj/structure/closet/supplypod/extractionpod/setOpened()
opened = TRUE
density = TRUE
update_icon()
update_appearance()
/obj/structure/closet/supplypod/setClosed() //Ditto
opened = FALSE
density = TRUE
update_icon()
update_appearance()
/obj/structure/closet/supplypod/proc/tryMakeRubble(turf/T) //Ditto
if (rubble_type == RUBBLE_NONE)
@@ -431,7 +435,7 @@
return
rubble = new /obj/effect/supplypod_rubble(T)
rubble.setStyle(rubble_type, src)
update_icon()
update_appearance()
/obj/structure/closet/supplypod/Moved()
deleteRubble()
@@ -440,7 +444,7 @@
/obj/structure/closet/supplypod/proc/deleteRubble()
rubble?.fadeAway()
rubble = null
update_icon()
update_appearance()
/obj/structure/closet/supplypod/proc/addGlow()
if (GLOB.podstyles[style][POD_SHAPE] != POD_SHAPE_NORML)
@@ -587,7 +591,7 @@
/obj/effect/pod_landingzone/proc/beginLaunch(effectCircle) //Begin the animation for the pod falling. The effectCircle param determines whether the pod gets to come in from any descent angle
pod.addGlow()
pod.update_icon()
pod.update_appearance()
if (pod.style != STYLE_INVISIBLE)
pod.add_filter("motionblur",1,list("type"="motion_blur", "x"=0, "y"=3))
pod.forceMove(drop_location())
+7 -4
View File
@@ -29,16 +29,19 @@
playsound(src,'sound/machines/synth_no.ogg',50,FALSE)
if (SP_UNREADY)
ready = FALSE
update_icon()
update_appearance()
/obj/item/supplypod_beacon/update_overlays()
. = ..()
if (launched)
if(launched)
. += "sp_green"
else if (ready)
return
if(ready)
. += "sp_yellow"
else if (linked)
return
if(linked)
. += "sp_orange"
return
/obj/item/supplypod_beacon/proc/endLaunch()
launched = FALSE
+2 -2
View File
@@ -321,7 +321,7 @@ GLOBAL_LIST_INIT(ghost_forms, sortList(list("ghost","ghostking","ghostian2","ske
prefs.save_preferences()
if(isobserver(mob))
var/mob/dead/observer/O = mob
O.update_icon(new_form)
O.update_icon(ALL, new_form)
GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOST_ORBIT_SQUARE,GHOST_ORBIT_HEXAGON,GHOST_ORBIT_PENTAGON))
@@ -350,7 +350,7 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS
prefs.save_preferences()
if(isobserver(mob))
var/mob/dead/observer/O = mob
O.update_icon()
O.update_appearance()
/client/verb/pick_ghost_customization()
set name = "Ghost Customization"
+1 -1
View File
@@ -282,7 +282,7 @@
var/obj/item/pda/agent_pda = target
if(istype(agent_pda))
agent_pda.update_label()
agent_pda.update_icon()
agent_pda.update_appearance()
/datum/action/item_action/chameleon/change/pda/apply_job_data(datum/job/job_datum)
..()
+13 -11
View File
@@ -411,17 +411,19 @@
/obj/item/clothing/update_overlays()
. = ..()
if(damaged_clothes)
var/index = "[REF(initial(icon))]-[initial(icon_state)]"
var/static/list/damaged_clothes_icons = list()
var/icon/damaged_clothes_icon = damaged_clothes_icons[index]
if(!damaged_clothes_icon)
damaged_clothes_icon = icon(initial(icon), initial(icon_state), , 1) //we only want to apply damaged effect to the initial icon_state for each object
damaged_clothes_icon.Blend("#fff", ICON_ADD) //fills the icon_state with white (except where it's transparent)
damaged_clothes_icon.Blend(icon('icons/effects/item_damage.dmi', "itemdamaged"), ICON_MULTIPLY) //adds damage effect and the remaining white areas become transparant
damaged_clothes_icon = fcopy_rsc(damaged_clothes_icon)
damaged_clothes_icons[index] = damaged_clothes_icon
. += damaged_clothes_icon
if(!damaged_clothes)
return
var/index = "[REF(initial(icon))]-[initial(icon_state)]"
var/static/list/damaged_clothes_icons = list()
var/icon/damaged_clothes_icon = damaged_clothes_icons[index]
if(!damaged_clothes_icon)
damaged_clothes_icon = icon(initial(icon), initial(icon_state), , 1) //we only want to apply damaged effect to the initial icon_state for each object
damaged_clothes_icon.Blend("#fff", ICON_ADD) //fills the icon_state with white (except where it's transparent)
damaged_clothes_icon.Blend(icon('icons/effects/item_damage.dmi', "itemdamaged"), ICON_MULTIPLY) //adds damage effect and the remaining white areas become transparant
damaged_clothes_icon = fcopy_rsc(damaged_clothes_icon)
damaged_clothes_icons[index] = damaged_clothes_icon
. += damaged_clothes_icon
/*
SEE_SELF // can see self, no matter what
+3 -2
View File
@@ -341,11 +341,12 @@
/obj/item/clothing/glasses/blindfold/white/equipped(mob/living/carbon/human/user, slot)
if(ishuman(user) && slot == ITEM_SLOT_EYES)
update_icon(user)
update_icon(ALL, user)
user.update_inv_glasses() //Color might have been changed by update_icon.
..()
/obj/item/clothing/glasses/blindfold/white/update_icon(mob/living/carbon/human/user)
/obj/item/clothing/glasses/blindfold/white/update_icon(updates=ALL, mob/living/carbon/human/user)
. = ..()
if(ishuman(user) && !colored_before)
add_atom_colour("#[user.eye_color]", FIXED_COLOUR_PRIORITY)
colored_before = TRUE
@@ -25,7 +25,7 @@
/obj/item/clothing/glasses/meson/engine/Initialize()
. = ..()
START_PROCESSING(SSobj, src)
update_icon()
update_appearance()
/obj/item/clothing/glasses/meson/engine/ComponentInitialize()
. = ..()
@@ -66,7 +66,7 @@
if(H.glasses == src)
H.update_sight()
update_icon()
update_appearance()
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
@@ -133,6 +133,7 @@
/obj/item/clothing/glasses/meson/engine/update_icon_state()
icon_state = inhand_icon_state = "trayson-[mode]"
return ..()
/obj/item/clothing/glasses/meson/engine/tray //atmos techs have lived far too long without tray goggles while those damned engineers get their dual-purpose gogles all to themselves
name = "optical t-ray scanner"
+4 -3
View File
@@ -34,10 +34,11 @@
turn_on(user)
else
turn_off(user)
update_icon()
update_appearance()
/obj/item/clothing/head/hardhat/update_icon_state()
icon_state = inhand_icon_state = "hardhat[on]_[hat_type]"
return ..()
/obj/item/clothing/head/hardhat/proc/turn_on(mob/user)
set_light_on(TRUE)
@@ -121,7 +122,7 @@
/obj/item/clothing/head/hardhat/weldhat/Initialize()
. = ..()
update_icon()
update_appearance()
/obj/item/clothing/head/hardhat/weldhat/attack_self(mob/living/user)
toggle_helmet_light(user)
@@ -133,7 +134,7 @@
/obj/item/clothing/head/hardhat/weldhat/proc/toggle_welding_screen(mob/living/user)
if(weldingvisortoggle(user))
playsound(src, 'sound/mecha/mechmove03.ogg', 50, TRUE) //Visors don't just come from nothing
update_icon()
update_appearance()
/obj/item/clothing/head/hardhat/weldhat/worn_overlays(isinhands)
. = ..()
+7 -5
View File
@@ -46,7 +46,7 @@
if(A == attached_light)
set_attached_light(null)
update_helmlight()
update_icon()
update_appearance()
QDEL_NULL(alight)
qdel(A)
return ..()
@@ -397,7 +397,7 @@
/obj/item/clothing/head/helmet/monkey_sentience/Initialize()
. = ..()
light_colors = rand(1,3)
update_icon()
update_appearance()
/obj/item/clothing/head/helmet/monkey_sentience/examine(mob/user)
. = ..()
@@ -410,6 +410,7 @@
/obj/item/clothing/head/helmet/monkey_sentience/update_icon_state()
icon_state = "[initial(icon_state)][light_colors][magnification ? "up" : ""]"
return ..()
/obj/item/clothing/head/helmet/monkey_sentience/equipped(mob/user, slot)
. = ..()
@@ -493,6 +494,7 @@
state += "-flight" //etc.
icon_state = state
return ..()
/obj/item/clothing/head/helmet/ui_action_click(mob/user, action)
if(istype(action, alight))
@@ -508,7 +510,7 @@
return
to_chat(user, "<span class='notice'>You click [S] into place on [src].</span>")
set_attached_light(S)
update_icon()
update_appearance()
update_helmlight()
alight = new(src)
if(loc == user)
@@ -528,7 +530,7 @@
var/obj/item/flashlight/removed_light = set_attached_light(null)
update_helmlight()
removed_light.update_brightness(user)
update_icon()
update_appearance()
user.update_inv_head()
QDEL_NULL(alight)
return TRUE
@@ -553,7 +555,7 @@
/obj/item/clothing/head/helmet/proc/update_helmlight()
if(attached_light)
update_icon()
update_appearance()
for(var/X in actions)
var/datum/action/A = X
+10 -10
View File
@@ -167,11 +167,12 @@
/obj/item/clothing/head/kitty/equipped(mob/living/carbon/human/user, slot)
if(ishuman(user) && slot == ITEM_SLOT_HEAD)
update_icon(user)
user.update_inv_head() //Color might have been changed by update_icon.
update_icon(ALL, user)
user.update_inv_head() //Color might have been changed by update_appearance.
..()
/obj/item/clothing/head/kitty/update_icon(mob/living/carbon/human/user)
/obj/item/clothing/head/kitty/update_icon(updates=ALL, mob/living/carbon/human/user)
. = ..()
if(ishuman(user))
add_atom_colour("#[user.hair_color]", FIXED_COLOUR_PRIORITY)
@@ -228,14 +229,13 @@
/obj/item/clothing/head/wig/Initialize(mapload)
. = ..()
update_icon()
update_appearance()
/obj/item/clothing/head/wig/update_icon_state()
var/datum/sprite_accessory/S = GLOB.hairstyles_list[hairstyle]
if(!S)
return
else
if(S)
icon_state = S.icon_state
return ..()
/obj/item/clothing/head/wig/worn_overlays(isinhands = FALSE, file2use)
@@ -259,7 +259,7 @@
user.visible_message("<span class='notice'>[user] changes \the [src]'s hairstyle to [new_style].</span>", "<span class='notice'>You change \the [src]'s hairstyle to [new_style].</span>")
if(newcolor && newcolor != color) // only update if necessary
add_atom_colour(newcolor, FIXED_COLOUR_PRIORITY)
update_icon()
update_appearance()
/obj/item/clothing/head/wig/afterattack(mob/living/carbon/human/target, mob/user)
. = ..()
@@ -267,7 +267,7 @@
to_chat(user, "<span class='notice'>You adjust the [src] to look just like [target.name]'s [target.hairstyle].</span>")
add_atom_colour("#[target.hair_color]", FIXED_COLOUR_PRIORITY)
hairstyle = target.hairstyle
update_icon()
update_appearance()
/obj/item/clothing/head/wig/random/Initialize(mapload)
hairstyle = pick(GLOB.hairstyles_list - "Bald") //Don't want invisible wig
@@ -290,7 +290,7 @@
if(ishuman(user) && slot == ITEM_SLOT_HEAD)
if (color != "#[user.hair_color]") // only update if necessary
add_atom_colour("#[user.hair_color]", FIXED_COLOUR_PRIORITY)
update_icon()
update_appearance()
user.update_inv_head()
/obj/item/clothing/head/bronze
+4 -6
View File
@@ -30,7 +30,7 @@
on = !on
if(!always_noslip)
clothing_flags &= ~NOSLIP
update_icon()
update_appearance()
to_chat(loc, "<span class='warning'>You ran out of bananium!</span>")
else
new /obj/item/grown/bananapeel/specialpeel(get_step(src,turn(wearer.dir, 180))) //honk
@@ -52,7 +52,7 @@
var/datum/component/material_container/bananium = GetComponent(/datum/component/material_container)
if(bananium.get_material_amount(/datum/material/bananium))
on = !on
update_icon()
update_appearance()
to_chat(user, "<span class='notice'>You [on ? "activate" : "deactivate"] the prototype shoes.</span>")
if(!always_noslip)
if(on)
@@ -63,7 +63,5 @@
to_chat(user, "<span class='warning'>You need bananium to turn the prototype shoes on!</span>")
/obj/item/clothing/shoes/clown_shoes/banana_shoes/update_icon_state()
if(on)
icon_state = "clown_prototype_on"
else
icon_state = "clown_prototype_off"
icon_state = "clown_prototype_[on ? "on" : "off"]"
return ..()
+1 -1
View File
@@ -346,7 +346,7 @@
else
worn_icon_state = "[initial(icon_state)]"
playsound(src, 'sound/weapons/tap.ogg', 10, TRUE)
update_icon()
update_appearance()
/obj/item/clothing/shoes/wheelys/Destroy()
QDEL_NULL(wheels)
+3 -2
View File
@@ -350,6 +350,7 @@
/obj/item/clothing/head/helmet/space/hardsuit/syndi/update_icon_state()
icon_state = "hardsuit[on]-[hardsuit_type]"
return ..()
/obj/item/clothing/head/helmet/space/hardsuit/syndi/Initialize()
. = ..()
@@ -379,7 +380,7 @@
flags_cover &= ~(HEADCOVERSEYES | HEADCOVERSMOUTH)
flags_inv &= ~visor_flags_inv
cold_protection &= ~HEAD
update_icon()
update_appearance()
playsound(src.loc, 'sound/mecha/mechmove03.ogg', 50, TRUE)
toggle_hardsuit_mode(user)
user.update_inv_head()
@@ -406,7 +407,7 @@
linkedsuit.cold_protection &= ~(CHEST | GROIN | LEGS | FEET | ARMS | HANDS)
linkedsuit.icon_state = "hardsuit[on]-[hardsuit_type]"
linkedsuit.update_icon()
linkedsuit.update_appearance()
user.update_inv_wear_suit()
user.update_inv_w_uniform()
user.update_equipment_speed_mods()
@@ -62,7 +62,7 @@
/obj/item/clothing/head/helmet/space/plasmaman/Initialize()
. = ..()
visor_toggling()
update_icon()
update_appearance()
/obj/item/clothing/head/helmet/space/plasmaman/AltClick(mob/user)
if(user.canUseTopic(src, BE_CLOSE))
@@ -74,10 +74,10 @@
to_chat(user, "<span class='notice'>Your helmet's torch can't pass through your welding visor!</span>")
helmet_on = FALSE
playsound(src, 'sound/mecha/mechmove03.ogg', 50, TRUE) //Visors don't just come from nothing
update_icon()
update_appearance()
else
playsound(src, 'sound/mecha/mechmove03.ogg', 50, TRUE) //Visors don't just come from nothing
update_icon()
update_appearance()
/obj/item/clothing/head/helmet/space/plasmaman/update_overlays()
. = ..()
@@ -93,7 +93,7 @@
smile = TRUE
smile_color = CR.paint_color
to_chat(user, "You draw a smiley on the helmet visor.")
update_icon()
update_appearance()
else
to_chat(user, "<span class='warning'>Seems like someone already drew something on this helmet's visor!</span>")
@@ -112,7 +112,7 @@
. = ..()
if(smile && (clean_types & CLEAN_TYPE_PAINT))
smile = FALSE
update_icon()
update_appearance()
return TRUE
/obj/item/clothing/head/helmet/space/plasmaman/attack_self(mob/user)
+1 -1
View File
@@ -52,7 +52,7 @@
P.info = text("<center><B>Forensic Record - (FR-[])</B></center><HR><BR>", frNum)
P.info += jointext(log, "<BR>")
P.info += "<HR><B>Notes:</B><BR>"
P.update_icon()
P.update_appearance()
if(ismob(loc))
var/mob/M = loc
+4 -6
View File
@@ -131,7 +131,7 @@
/obj/machinery/shuttle_scrambler/Initialize(mapload)
. = ..()
update_icon()
update_appearance()
/obj/machinery/shuttle_scrambler/process()
if(active)
@@ -162,7 +162,7 @@
if(active || !user.canUseTopic(src, BE_CLOSE))
return
toggle_on(user)
update_icon()
update_appearance()
send_notification()
else
dump_loot(user)
@@ -192,10 +192,8 @@
STOP_PROCESSING(SSobj,src)
/obj/machinery/shuttle_scrambler/update_icon_state()
if(active)
icon_state = "dominator-blue"
else
icon_state = "dominator"
icon_state = active ? "dominator-blue" : "dominator"
return ..()
/obj/machinery/shuttle_scrambler/Destroy()
toggle_off()
+1 -1
View File
@@ -47,7 +47,7 @@
if(istype(O, /obj/structure/closet/secure_closet))
var/obj/structure/closet/secure_closet/temp = O
temp.locked = FALSE
temp.update_icon()
temp.update_appearance()
else if(istype(O, /obj/machinery/door/airlock))
var/obj/machinery/door/airlock/temp = O
if(temp.critical_machine) //Skip doors in critical positions, such as the SM chamber.
+1 -1
View File
@@ -263,7 +263,7 @@
set_anchored(TRUE)
timer_set = rand(480, 600) //once the supply shuttle docks (after 5 minutes travel time), players have between 3-5 minutes to defuse the bomb
activate()
update_icon()
update_appearance()
/obj/item/paper/fluff/cargo/bomb
name = "hastly scribbled note"
+1 -1
View File
@@ -53,7 +53,7 @@
var/datum/supply_pack/SP = new pack_type
var/obj/structure/closet/crate/crate = SP.generate(null)
crate.locked = FALSE //Unlock secure crates
crate.update_icon()
crate.update_appearance()
var/obj/structure/closet/supplypod/pod = make_pod()
new /obj/effect/pod_landingzone(LZ, pod, crate)
+3 -2
View File
@@ -135,7 +135,7 @@ GLOBAL_LIST_INIT(hallucination_list, list(
if(target.client)
target.client.images |= current_image
/obj/effect/hallucination/simple/update_icon(new_state,new_icon,new_px=0,new_py=0)
/obj/effect/hallucination/simple/update_icon(updates=ALL, new_state, new_icon, new_px=0, new_py=0)
image_state = new_state
if(new_icon)
image_icon = new_icon
@@ -143,6 +143,7 @@ GLOBAL_LIST_INIT(hallucination_list, list(
image_icon = initial(image_icon)
px = new_px
py = new_py
. = ..()
Show()
/obj/effect/hallucination/simple/Moved(atom/OldLoc, Dir)
@@ -248,7 +249,7 @@ GLOBAL_LIST_INIT(hallucination_list, list(
name = "alien hunter ([rand(1, 1000)])"
/obj/effect/hallucination/simple/xeno/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
update_icon("alienh_pounce")
update_icon(ALL, "alienh_pounce")
if(hit_atom == target && target.stat!=DEAD)
target.Paralyze(100)
target.visible_message("<span class='danger'>[target] flails around wildly.</span>","<span class='userdanger'>[name] pounces on you!</span>")
+54 -24
View File
@@ -246,8 +246,8 @@
spillable = TRUE
/obj/item/reagent_containers/food/drinks/mug/update_icon_state()
. = ..()
icon_state = reagents.total_volume ? "tea" : "tea_empty"
return ..()
/obj/item/reagent_containers/food/drinks/mug/tea
name = "Duke Purple tea"
@@ -297,7 +297,7 @@
cap_overlay = mutable_appearance(icon, cap_icon_state)
if(cap_on)
spillable = FALSE
update_icon()
update_appearance()
/obj/item/reagent_containers/food/drinks/waterbottle/update_overlays()
. = ..()
@@ -333,7 +333,7 @@
cap_on = TRUE
spillable = FALSE
to_chat(user, "<span class='notice'>You put the cap on [src].</span>")
update_icon()
update_appearance()
/obj/item/reagent_containers/food/drinks/waterbottle/is_refillable()
if(cap_on)
@@ -415,7 +415,7 @@
list_reagents = list(random_reagent.type = 50)
. = ..()
desc += "<span class='notice'>The writing reads '[random_reagent.name]'.</span>"
update_icon()
update_appearance()
/obj/item/reagent_containers/food/drinks/beer
name = "space beer"
@@ -449,8 +449,8 @@
isGlass = FALSE
/obj/item/reagent_containers/food/drinks/sillycup/update_icon_state()
. = ..()
icon_state = reagents.total_volume ? "water_cup" : "water_cup_e"
return ..()
/obj/item/reagent_containers/food/drinks/sillycup/smallcarton
name = "small carton"
@@ -458,44 +458,74 @@
icon_state = "juicebox"
volume = 15 //I figure if you have to craft these it should at least be slightly better than something you can get for free from a watercooler
/// Reagent container icon updates, especially this one, are complete jank. I will need to rework them after this is merged.
/obj/item/reagent_containers/food/drinks/sillycup/smallcarton/on_reagent_change(datum/reagents/holder, ...)
. = ..()
if(!length(reagents.reagent_list))
name = "small carton"
desc = "A small carton, intended for holding drinks."
foodtype = NONE
foodtype = NONE /// Why are food types on the _container_? TODO: move these to the reagents
return
switch(reagents.get_master_reagent_id()) // - [] TODO: Unshitcode this. Right now I'm just passing through and this really needs it's own dedicated PR.
switch(reagents.get_master_reagent_id())
if(/datum/reagent/consumable/orangejuice)
name = "orange juice box" // I know this shouldn't be here, but I really don't have the time to fix this right now. Blame the last guy
desc = "A great source of vitamins. Stay healthy!" // Ditto
foodtype = FRUIT | BREAKFAST // Ditto
foodtype = FRUIT | BREAKFAST
if(/datum/reagent/consumable/milk)
name = "carton of milk"
desc = "An excellent source of calcium for growing space explorers."
foodtype = DAIRY | BREAKFAST
if(/datum/reagent/consumable/applejuice)
name = "apple juice box"
desc = "Sweet apple juice. Don't be late for school!"
foodtype = FRUIT
if(/datum/reagent/consumable/grapejuice)
name = "grape juice box"
desc = "Tasty grape juice in a fun little container. Non-alcoholic!"
foodtype = FRUIT
if(/datum/reagent/consumable/pineapplejuice)
name = "pineapple juice box"
desc = "Why would you even want this?"
foodtype = FRUIT | PINEAPPLE
if(/datum/reagent/consumable/milk/chocolate_milk)
name = "carton of chocolate milk"
desc = "Milk for cool kids!"
foodtype = SUGAR
if(/datum/reagent/consumable/ethanol/eggnog)
name = "carton of eggnog"
desc = "For enjoying the most wonderful time of the year."
foodtype = MEAT
/obj/item/reagent_containers/food/drinks/sillycup/smallcarton/update_name(updates)
. = ..()
if(!length(reagents.reagent_list))
name = "small carton"
return
switch(reagents.get_master_reagent_id())
if(/datum/reagent/consumable/orangejuice)
name = "orange juice box"
if(/datum/reagent/consumable/milk)
name = "carton of milk"
if(/datum/reagent/consumable/applejuice)
name = "apple juice box"
if(/datum/reagent/consumable/grapejuice)
name = "grape juice box"
if(/datum/reagent/consumable/pineapplejuice)
name = "pineapple juice box"
if(/datum/reagent/consumable/milk/chocolate_milk)
name = "carton of chocolate milk"
if(/datum/reagent/consumable/ethanol/eggnog)
name = "carton of eggnog"
/obj/item/reagent_containers/food/drinks/sillycup/smallcarton/update_desc(updates)
. = ..()
if(!length(reagents.reagent_list))
desc = "A small carton, intended for holding drinks."
return
switch(reagents.get_master_reagent_id())
if(/datum/reagent/consumable/orangejuice)
desc = "A great source of vitamins. Stay healthy!"
if(/datum/reagent/consumable/milk)
desc = "An excellent source of calcium for growing space explorers."
if(/datum/reagent/consumable/applejuice)
desc = "Sweet apple juice. Don't be late for school!"
if(/datum/reagent/consumable/grapejuice)
desc = "Tasty grape juice in a fun little container. Non-alcoholic!"
if(/datum/reagent/consumable/pineapplejuice)
desc = "Why would you even want this?"
if(/datum/reagent/consumable/milk/chocolate_milk)
desc = "Milk for cool kids!"
if(/datum/reagent/consumable/ethanol/eggnog)
desc = "For enjoying the most wonderful time of the year."
/obj/item/reagent_containers/food/drinks/sillycup/smallcarton/update_icon_state()
. = ..()
if(!length(reagents.reagent_list))
@@ -19,26 +19,31 @@
. = ..()
if(!length(reagents.reagent_list))
renamedByPlayer = FALSE //so new drinks can rename the glass
return
/obj/item/reagent_containers/food/drinks/drinkingglass/update_name(updates)
if(renamedByPlayer)
return
. = ..()
var/datum/reagent/largest_reagent = reagents.get_master_reagent()
name = largest_reagent.glass_name || initial(name)
desc = largest_reagent.glass_desc || initial(desc)
name = largest_reagent?.glass_name || initial(name)
/obj/item/reagent_containers/food/drinks/drinkingglass/update_desc(updates)
if(renamedByPlayer)
return
. = ..()
var/datum/reagent/largest_reagent = reagents.get_master_reagent()
desc = largest_reagent?.glass_desc || initial(desc)
/obj/item/reagent_containers/food/drinks/drinkingglass/update_icon_state()
. = ..()
if(!length(reagents.reagent_list))
icon_state = "glass_empty"
return
return ..()
var/datum/reagent/largest_reagent = reagents.get_master_reagent()
if(largest_reagent.glass_icon_state)
if(largest_reagent?.glass_icon_state)
icon_state = largest_reagent.glass_icon_state
icon = largest_reagent.glass_icon || 'icons/obj/drinks.dmi' //SKYRAT EDIT ADDITION - CUSTOMIZATION
return NONE
return ..()
/obj/item/reagent_containers/food/drinks/drinkingglass/update_overlays()
. = ..()
@@ -60,6 +65,7 @@
name = "shot glass"
desc = "A shot glass - the universal symbol for bad decisions."
icon_state = "shotglass"
base_icon_state = "shotglass"
gulp_size = 15
amount_per_transfer_from_this = 15
possible_transfer_amounts = list()
@@ -67,32 +73,33 @@
custom_materials = list(/datum/material/glass=100)
custom_price = PAYCHECK_ASSISTANT * 0.4
/obj/item/reagent_containers/food/drinks/drinkingglass/shotglass/on_reagent_change(datum/reagents/holder, ...)
/obj/item/reagent_containers/food/drinks/drinkingglass/shotglass/update_name(updates)
if(renamedByPlayer)
return
. = ..()
name = "[length(reagents.reagent_list) ? "filled " : null]shot glass"
/obj/item/reagent_containers/food/drinks/drinkingglass/shotglass/update_desc(updates)
if(renamedByPlayer)
return
. = ..()
if(!length(reagents.reagent_list))
name = "shot glass"
desc = "A shot glass - the universal symbol for bad decisions."
return
name = "filled shot glass"
desc = "The challenge is not taking as many as you can, but guessing what it is before you pass out."
else
desc = "The challenge is not taking as many as you can, but guessing what it is before you pass out."
/obj/item/reagent_containers/food/drinks/drinkingglass/shotglass/update_icon_state()
. = ..()
if(!length(reagents.reagent_list))
icon_state = "shotglass"
name = "shot glass"
desc = "A shot glass - the universal symbol for bad decisions."
icon_state = base_icon_state
return
var/datum/reagent/largest_reagent = reagents.get_master_reagent()
name = "filled shot glass"
desc = "The challenge is not taking as many as you can, but guessing what it is before you pass out."
icon_state = largest_reagent.shot_glass_icon_state || "shotglassclear"
icon_state = largest_reagent.shot_glass_icon_state || "[base_icon_state]clear"
/obj/item/reagent_containers/food/drinks/drinkingglass/shotglass/update_overlays()
. = ..()
if(icon_state != "shotglassclear")
if(icon_state != "[base_icon_state]clear")
return
var/mutable_appearance/shot_overlay = mutable_appearance(icon, "shotglassoverlay")

Some files were not shown because too many files have changed in this diff Show More