update_appearance (#55468)

Creates update_name and update_desc
Creates the wrapper proc update_appearance to batch update_name, update_desc, and update_icon together
Less non-icon handling code in update_icon and friends
Signal hooks for things that want to change names and descriptions
99%+ of the changes in this are just from switching everything over to update_appearance from update_icon
This commit is contained in:
TemporalOroboros
2021-02-19 07:06:18 -08:00
committed by GitHub
parent dc4b7226d0
commit e4079c87b8
585 changed files with 4689 additions and 4133 deletions

View File

@@ -82,13 +82,30 @@
#define EXAMINE_POSITION_BEFORE (1<<1)
//End positions
#define COMPONENT_EXNAME_CHANGED (1<<0)
///from base of atom/update_icon(): ()
///from base of [/atom/proc/update_appearance]: (updates)
#define COMSIG_ATOM_UPDATE_APPEARANCE "atom_update_appearance"
/// If returned from [COMSIG_ATOM_UPDATE_APPEARANCE] it prevents the atom from updating its name.
#define COMSIG_ATOM_NO_UPDATE_NAME UPDATE_NAME
/// If returned from [COMSIG_ATOM_UPDATE_APPEARANCE] it prevents the atom from updating its desc.
#define COMSIG_ATOM_NO_UPDATE_DESC UPDATE_DESC
/// If returned from [COMSIG_ATOM_UPDATE_APPEARANCE] it prevents the atom from updating its icon.
#define COMSIG_ATOM_NO_UPDATE_ICON UPDATE_ICON
///from base of [/atom/proc/update_name]: (updates)
#define COMSIG_ATOM_UPDATE_NAME "atom_update_name"
///from base of [/atom/proc/update_desc]: (updates)
#define COMSIG_ATOM_UPDATE_DESC "atom_update_desc"
///from base of [/atom/update_icon]: ()
#define COMSIG_ATOM_UPDATE_ICON "atom_update_icon"
#define COMSIG_ATOM_NO_UPDATE_ICON_STATE (1<<0)
#define COMSIG_ATOM_NO_UPDATE_OVERLAYS (1<<1)
///from base of atom/update_overlays(): (list/new_overlays)
/// If returned from [COMSIG_ATOM_UPDATE_ICON] it prevents the atom from updating its icon state.
#define COMSIG_ATOM_NO_UPDATE_ICON_STATE UPDATE_ICON_STATE
/// If returned from [COMSIG_ATOM_UPDATE_ICON] it prevents the atom from updating its overlays.
#define COMSIG_ATOM_NO_UPDATE_OVERLAYS UPDATE_OVERLAYS
///from base of [atom/update_icon_state]: ()
#define COMSIG_ATOM_UPDATE_ICON_STATE "atom_update_icon_state"
///from base of [/atom/update_overlays]: (list/new_overlays)
#define COMSIG_ATOM_UPDATE_OVERLAYS "atom_update_overlays"
///from base of atom/update_icon(): (signalOut, did_anything)
///from base of [/atom/update_icon]: (signalOut, did_anything)
#define COMSIG_ATOM_UPDATED_ICON "atom_updated_icon"
///from base of atom/Entered(): (atom/movable/entering, /atom)
#define COMSIG_ATOM_ENTERED "atom_entered"

View File

@@ -62,6 +62,18 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define SUPERMATTER_IGNORES_1 (1 << 23)
// Update flags for [/atom/proc/update_appearance]
/// Update the atom's name
#define UPDATE_NAME (1<<0)
/// Update the atom's desc
#define UPDATE_DESC (1<<1)
/// Update the atom's icon state
#define UPDATE_ICON_STATE (1<<2)
/// Update the atom's overlays
#define UPDATE_OVERLAYS (1<<3)
/// Update the atom's icon
#define UPDATE_ICON (UPDATE_ICON_STATE|UPDATE_OVERLAYS)
/// If the thing can reflect light (lasers/energy)
#define RICOCHET_SHINY (1<<0)
/// If the thing can reflect matter (bullets/bomb shrapnel)

View File

@@ -130,7 +130,7 @@
name = "Show Buttons"
else
name = "Hide Buttons"
update_icon()
update_appearance()
usr.update_action_buttons()
/atom/movable/screen/movable/action_button/hide_toggle/AltClick(mob/user)
@@ -151,14 +151,11 @@
hide_icon = settings["toggle_icon"]
hide_state = settings["toggle_hide"]
show_state = settings["toggle_show"]
update_icon()
update_appearance()
/atom/movable/screen/movable/action_button/hide_toggle/update_overlays()
. = ..()
if(hidden)
. += show_appearance
else
. += hide_appearance
. += hidden ? show_appearance : hide_appearance
/atom/movable/screen/movable/action_button/MouseEntered(location,control,params)
if(!QDELETED(src))

View File

@@ -87,7 +87,7 @@
pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon()
pull_icon.update_appearance()
pull_icon.screen_loc = ui_above_movement
pull_icon.hud = src
static_inventory += pull_icon
@@ -109,14 +109,14 @@
zone_select = new /atom/movable/screen/zone_sel/alien()
zone_select.hud = src
zone_select.update_icon()
zone_select.update_appearance()
static_inventory += zone_select
for(var/atom/movable/screen/inventory/inv in (static_inventory + toggleable_inventory))
if(inv.slot_id)
inv.hud = src
inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv
inv.update_icon()
inv.update_appearance()
/datum/hud/alien/persistent_inventory_update()
if(!mymob)

View File

@@ -21,7 +21,7 @@
pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = 'icons/hud/screen_alien.dmi'
pull_icon.update_icon()
pull_icon.update_appearance()
pull_icon.screen_loc = ui_above_movement
pull_icon.hud = src
hotkeybuttons += pull_icon
@@ -33,5 +33,5 @@
zone_select = new /atom/movable/screen/zone_sel/alien()
zone_select.hud = src
zone_select.update_icon()
zone_select.update_appearance()
static_inventory += zone_select

View File

@@ -26,7 +26,7 @@
if(inv.slot_id)
inv.hud = src
inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv
inv.update_icon()
inv.update_appearance()
/datum/hud/dextrous/drone/persistent_inventory_update()

View File

@@ -3,6 +3,7 @@
desc = "Shows the current level of hostility the space police is planning to rain down on you. Better be careful."
icon = 'icons/obj/gang/wanted_160x32.dmi'
icon_state = "wanted_0"
base_icon_state = "wanted"
screen_loc = ui_wanted_lvl
/// Wanted level, affects the hud icon. Level 0 is default, and the level 0 icon is blank, so in case of no families gamemode (and thus no wanted level), this HUD element will never appear.
var/level = 0
@@ -14,7 +15,7 @@
/atom/movable/screen/wanted/Initialize()
. = ..()
update_icon()
update_appearance()
/atom/movable/screen/wanted/MouseEntered(location,control,params)
openToolTip(usr,src,params,title = name,content = desc, theme = "alerttooltipstyle")
@@ -23,5 +24,5 @@
closeToolTip(usr)
/atom/movable/screen/wanted/update_icon_state()
. = ..()
icon_state = "wanted_[level][cops_arrived ? "_active" : ""]"
icon_state = "[base_icon_state]_[level][cops_arrived ? "_active" : null]"
return ..()

View File

@@ -11,7 +11,7 @@
pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon()
pull_icon.update_appearance()
pull_icon.screen_loc = ui_drone_pull
pull_icon.hud = src
static_inventory += pull_icon
@@ -42,7 +42,7 @@
zone_select = new /atom/movable/screen/zone_sel()
zone_select.icon = ui_style
zone_select.hud = src
zone_select.update_icon()
zone_select.update_appearance()
static_inventory += zone_select
using = new /atom/movable/screen/area_creator
@@ -56,7 +56,7 @@
if(inv.slot_id)
inv.hud = src
inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv
inv.update_icon()
inv.update_appearance()
/datum/hud/dextrous/persistent_inventory_update()
if(!mymob)

View File

@@ -7,7 +7,7 @@
pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon()
pull_icon.update_appearance()
pull_icon.screen_loc = ui_living_pull
pull_icon.hud = src
static_inventory += pull_icon
@@ -70,7 +70,7 @@
pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = 'icons/hud/guardian.dmi'
pull_icon.update_icon()
pull_icon.update_appearance()
pull_icon.screen_loc = ui_living_pull
pull_icon.hud = src
static_inventory += pull_icon

View File

@@ -297,7 +297,7 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
hand_slots["[i]"] = hand_box
hand_box.hud = src
static_inventory += hand_box
hand_box.update_icon()
hand_box.update_appearance()
var/i = 1
for(var/atom/movable/screen/swap_hand/SH in static_inventory)

View File

@@ -293,7 +293,7 @@
pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon()
pull_icon.update_appearance()
pull_icon.screen_loc = ui_above_intent
pull_icon.hud = src
static_inventory += pull_icon
@@ -309,7 +309,7 @@
zone_select = new /atom/movable/screen/zone_sel()
zone_select.icon = ui_style
zone_select.hud = src
zone_select.update_icon()
zone_select.update_appearance()
static_inventory += zone_select
combo_display = new /atom/movable/screen/combo()
@@ -319,7 +319,7 @@
if(inv.slot_id)
inv.hud = src
inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv
inv.update_icon()
inv.update_appearance()
update_locked_slots()

View File

@@ -6,7 +6,7 @@
pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon()
pull_icon.update_appearance()
pull_icon.screen_loc = ui_living_pull
pull_icon.hud = src
static_inventory += pull_icon

View File

@@ -5,7 +5,7 @@
zone_select = new /atom/movable/screen/zone_sel()
zone_select.icon = ui_style
zone_select.hud = src
zone_select.update_icon()
zone_select.update_appearance()
static_inventory += zone_select
alien_plasma_display = new /atom/movable/screen/ooze_nutrition_display //Just going to use the alien plasma display because making new vars for each object is braindead.

View File

@@ -6,7 +6,7 @@
pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon()
pull_icon.update_appearance()
pull_icon.screen_loc = ui_living_pull
pull_icon.hud = src
static_inventory += pull_icon

View File

@@ -168,13 +168,13 @@
pull_icon.icon = 'icons/hud/screen_cyborg.dmi'
pull_icon.screen_loc = ui_borg_pull
pull_icon.hud = src
pull_icon.update_icon()
pull_icon.update_appearance()
hotkeybuttons += pull_icon
zone_select = new /atom/movable/screen/zone_sel/robot()
zone_select.hud = src
zone_select.update_icon()
zone_select.update_appearance()
static_inventory += zone_select
@@ -273,6 +273,7 @@
/atom/movable/screen/robot/lamp
name = "headlamp"
icon_state = "lamp_off"
base_icon_state = "lamp"
var/mob/living/silicon/robot/robot
/atom/movable/screen/robot/lamp/Click()
@@ -280,13 +281,11 @@
if(.)
return
robot?.toggle_headlamp()
update_icon()
update_appearance()
/atom/movable/screen/robot/lamp/update_icon()
if(robot?.lamp_enabled)
icon_state = "lamp_on"
else
icon_state = "lamp_off"
/atom/movable/screen/robot/lamp/update_icon_state()
icon_state = "[base_icon_state]_[robot?.lamp_enabled ? "on" : "off"]"
return ..()
/atom/movable/screen/robot/modPC
name = "Modular Interface"

View File

@@ -162,11 +162,10 @@
if(!icon_empty)
icon_empty = icon_state
if(hud?.mymob && slot_id && icon_full)
if(hud.mymob.get_item_by_slot(slot_id))
icon_state = icon_full
else
icon_state = icon_empty
if(!hud?.mymob || !slot_id || !icon_full)
return ..()
icon_state = hud.mymob.get_item_by_slot(slot_id) ? icon_full : icon_empty
return ..()
/atom/movable/screen/inventory/proc/add_overlays()
var/mob/user = hud?.mymob
@@ -274,20 +273,20 @@
/atom/movable/screen/combattoggle/New(loc, ...)
. = ..()
update_icon()
update_appearance()
/atom/movable/screen/combattoggle/Click()
if(isliving(usr))
var/mob/living/owner = usr
owner.set_combat_mode(!owner.combat_mode, FALSE)
update_icon()
update_appearance()
/atom/movable/screen/combattoggle/update_icon_state()
. = ..()
var/mob/living/user = hud?.mymob
if(!istype(user) || !user.client)
return
return ..()
icon_state = user.combat_mode ? "combat" : "combat_off" //Treats the combat_mode
return ..()
//Version of the combat toggle with the flashy overlay
/atom/movable/screen/combattoggle/flashy
@@ -300,11 +299,13 @@
if(!istype(user) || !user.client)
return
if(user.combat_mode)
if(!flashy)
flashy = mutable_appearance('icons/hud/screen_gen.dmi', "togglefull_flash")
flashy.color = "#C62727"
. += flashy
if(!user.combat_mode)
return
if(!flashy)
flashy = mutable_appearance('icons/hud/screen_gen.dmi', "togglefull_flash")
flashy.color = "#C62727"
. += flashy
/atom/movable/screen/combattoggle/robot
icon = 'icons/hud/screen_cyborg.dmi'
@@ -389,6 +390,7 @@
icon_state = "walking"
if(MOVE_INTENT_RUN)
icon_state = "running"
return ..()
/atom/movable/screen/mov_intent/proc/toggle(mob/user)
if(isobserver(user))
@@ -399,6 +401,7 @@
name = "stop pulling"
icon = 'icons/hud/screen_midnight.dmi'
icon_state = "pull"
base_icon_state = "pull"
/atom/movable/screen/pull/Click()
if(isobserver(usr))
@@ -406,10 +409,8 @@
usr.stop_pulling()
/atom/movable/screen/pull/update_icon_state()
if(hud?.mymob?.pulling)
icon_state = "pull"
else
icon_state = "pull0"
icon_state = "[base_icon_state][hud?.mymob?.pulling ? null : 0]"
return ..()
/atom/movable/screen/resist
name = "resist"
@@ -427,6 +428,7 @@
name = "rest"
icon = 'icons/hud/screen_midnight.dmi'
icon_state = "act_rest"
base_icon_state = "act_rest"
layer = HUD_LAYER
plane = HUD_PLANE
@@ -438,11 +440,9 @@
/atom/movable/screen/rest/update_icon_state()
var/mob/living/user = hud?.mymob
if(!istype(user))
return
if(!user.resting)
icon_state = "act_rest"
else
icon_state = "act_rest0"
return ..()
icon_state = "[base_icon_state][user.resting ? 0 : null]"
return ..()
/atom/movable/screen/storage
name = "storage"
@@ -580,7 +580,7 @@
if(choice != hud.mymob.zone_selected)
hud.mymob.zone_selected = choice
update_icon()
update_appearance()
return TRUE
@@ -747,14 +747,15 @@
/atom/movable/screen/combo/update_icon_state(streak = "")
clear_streak()
if (timerid)
if(timerid)
deltimer(timerid)
if (!streak)
return
if(!streak)
return ..()
timerid = addtimer(CALLBACK(src, .proc/clear_streak), 20, TIMER_UNIQUE | TIMER_STOPPABLE)
icon_state = "combo"
for (var/i = 1; i <= length(streak); ++i)
for(var/i = 1; i <= length(streak); ++i)
var/intent_text = copytext(streak, i, i + 1)
var/image/intent_icon = image(icon,src,"combo_[intent_text]")
intent_icon.pixel_x = 16 * (i - 1) - 8 * length(streak)
add_overlay(intent_icon)
return ..()

View File

@@ -109,7 +109,7 @@
/obj/item/tk_grab/process()
if(check_if_focusable(focus)) //if somebody grabs your thing, no waiting for them to put it down and hitting them again.
update_icon()
update_appearance()
/obj/item/tk_grab/dropped(mob/user)
if(focus && user && loc != user && loc != user.loc) // drop_item() gets called when you tk-attack a table/closet with an item
@@ -139,7 +139,7 @@
return
if(focus.attack_self_tk(user) & COMPONENT_CANCEL_ATTACK_CHAIN)
. = TRUE
update_icon()
update_appearance()
/obj/item/tk_grab/afterattack(atom/target, mob/living/carbon/user, proximity, params)//TODO: go over this
@@ -160,7 +160,7 @@
if(target == focus)
if(target.attack_self_tk(user) & COMPONENT_CANCEL_ATTACK_CHAIN)
. = TRUE
update_icon()
update_appearance()
return
if(!isturf(target) && isitem(focus) && target.Adjacent(focus))
@@ -175,7 +175,7 @@
//Only items can be thrown 10 tiles everything else only 1 tile
focus.throw_at(target, focus.tk_throw_range, 1,user)
user.changeNext_move(CLICK_CD_MELEE)
update_icon()
update_appearance()
/proc/tkMaxRangeCheck(mob/user, atom/target)
@@ -192,7 +192,7 @@
if(!check_if_focusable(target))
return
focus = target
update_icon()
update_appearance()
apply_focus_overlay()
return TRUE

View File

@@ -40,7 +40,7 @@ SUBSYSTEM_DEF(communications)
var/obj/item/paper/P = new /obj/item/paper(C.loc)
P.name = "paper - '[sending.title]'"
P.info = sending.content
P.update_icon()
P.update_appearance()
#undef COMMUNICATION_COOLDOWN
#undef COMMUNICATION_COOLDOWN_AI

View File

@@ -177,7 +177,7 @@ Used by the AI doomsday and the self-destruct nuke.
for(var/N in nuke_tiles)
var/turf/open/floor/circuit/C = N
C.update_icon()
C.update_appearance()
/datum/controller/subsystem/mapping/Recover()
flags |= SS_NO_INIT

View File

@@ -168,7 +168,7 @@ SUBSYSTEM_DEF(persistence)
T.showpiece = new /obj/item/showpiece_dummy(T, path)
T.trophy_message = chosen_trophy["message"]
T.placer_key = chosen_trophy["placer_key"]
T.update_icon()
T.update_appearance()
/datum/controller/subsystem/persistence/proc/CollectData()
CollectChiselMessages()

View File

@@ -141,7 +141,6 @@
/datum/action/proc/OnUpdatedIcon()
SIGNAL_HANDLER
UpdateButtonIcon()
//Presets for item actions

View File

@@ -49,7 +49,7 @@
var/atom/parent_atom = parent
RegisterSignal(parent, COMSIG_ATOM_UPDATE_OVERLAYS, .proc/on_update_overlays)
parent_atom.update_icon()
parent_atom.update_appearance()
sizzle = new(list(parent), TRUE)
START_PROCESSING(SSacid, src)
@@ -62,7 +62,7 @@
UnregisterSignal(parent, COMSIG_ATOM_UPDATE_OVERLAYS)
if(parent && !QDELING(parent))
var/atom/parent_atom = parent
parent_atom.update_icon()
parent_atom.update_appearance()
return ..()
/datum/component/acid/RegisterWithParent()

View File

@@ -72,7 +72,7 @@
if(ismecha(O))
var/obj/vehicle/sealed/mecha/R = O
R.update_icon()
R.update_appearance()
to_chat(user, "<span class='info'>You strengthen [R], improving its resistance against melee, bullet and laser damage.</span>")
else
SEND_SIGNAL(O, COMSIG_ARMOR_PLATED, amount, maxamount)

View File

@@ -141,7 +141,7 @@
add_parent_to_footprint(oldLocFP)
if (!(oldLocFP.exited_dirs & wielder.dir))
oldLocFP.exited_dirs |= wielder.dir
oldLocFP.update_icon()
oldLocFP.update_appearance()
else if(find_pool_by_blood_state(oldLocTurf))
// No footprints in the tile we left, but there was some other blood pool there. Add exit footprints on it
bloody_shoes[last_blood_state] -= half_our_blood
@@ -153,7 +153,7 @@
add_parent_to_footprint(oldLocFP)
oldLocFP.bloodiness = half_our_blood
oldLocFP.add_blood_DNA(parent_atom.return_blood_DNA())
oldLocFP.update_icon()
oldLocFP.update_appearance()
half_our_blood = bloody_shoes[last_blood_state] / 2
@@ -172,7 +172,7 @@
add_parent_to_footprint(FP)
FP.bloodiness = half_our_blood
FP.add_blood_DNA(parent_atom.return_blood_DNA())
FP.update_icon()
FP.update_appearance()
/**
@@ -193,7 +193,7 @@
if((bloody_shoes[last_blood_state] / 2) >= BLOOD_FOOTPRINTS_MIN && !(pool_FP.entered_dirs & wielder.dir))
// If our feet are bloody enough, add an entered dir
pool_FP.entered_dirs |= wielder.dir
pool_FP.update_icon()
pool_FP.update_appearance()
share_blood(pool)

View File

@@ -62,7 +62,7 @@
RegisterSignal(parent, COMSIG_ATOM_UPDATE_OVERLAYS, .proc/AddGrilledItemOverlay)
var/atom/A = parent
A.update_icon()
A.update_appearance()
///Ran when an object finished grilling
/datum/component/grillable/proc/FinishGrilling(atom/grill_source)
@@ -98,7 +98,7 @@
currently_grilling = FALSE
UnregisterSignal(parent, COMSIG_ATOM_UPDATE_OVERLAYS)
UnregisterSignal(parent, COMSIG_MOVABLE_MOVED)
A.update_icon()
A.update_appearance()
/datum/component/grillable/proc/AddGrilledItemOverlay(datum/source, list/overlays)
SIGNAL_HANDLER

View File

@@ -195,7 +195,7 @@
for(var/obj/machinery/duct/duct in get_step(parent, D))
if(duct.duct_layer == ducting_layer)
duct.remove_connects(turn(D, 180))
duct.update_icon()
duct.update_appearance()
///settle wherever we are, and start behaving like a piece of plumbing
/datum/component/plumbing/proc/enable()
@@ -279,14 +279,14 @@
SIGNAL_HANDLER
tile_covered = intact
AM.update_icon()
AM.update_appearance()
/datum/component/plumbing/proc/change_ducting_layer(obj/caller, obj/O, new_layer = DUCT_LAYER_DEFAULT)
ducting_layer = new_layer
if(ismovable(parent))
var/atom/movable/AM = parent
AM.update_icon()
AM.update_appearance()
if(O)
playsound(O, 'sound/items/ratchet.ogg', 10, TRUE) //sound

View File

@@ -139,7 +139,7 @@
refresh_mob_views()
if(isobj(parent))
var/obj/O = parent
O.update_icon()
O.update_appearance()
return TRUE
/datum/component/storage/concrete/proc/slave_can_insert_object(datum/component/storage/slave, obj/item/I, stop_messages = FALSE, mob/M)
@@ -195,7 +195,7 @@
/datum/component/storage/concrete/update_icon()
if(isobj(parent))
var/obj/O = parent
O.update_icon()
O.update_appearance()
for(var/i in slaves)
var/datum/component/storage/slave = i
slave.update_icon()

View File

@@ -698,7 +698,7 @@
/datum/component/storage/proc/update_icon()
if(isobj(parent))
var/obj/O = parent
O.update_icon()
O.update_appearance()
/datum/component/storage/proc/signal_insertion_attempt(datum/source, obj/item/I, mob/M, silent = FALSE, force = FALSE)
SIGNAL_HANDLER

View File

@@ -82,7 +82,7 @@ This component is used in vat growing to swab for microbiological samples which
LAZYCLEARLIST(swabbed_items)
var/obj/item/I = parent
I.update_icon()
I.update_appearance()
return COMPONENT_CANCEL_ATTACK_CHAIN
if(!can_swab(target))
@@ -108,7 +108,7 @@ This component is used in vat growing to swab for microbiological samples which
to_chat(user, "<span class='nicegreen'>You manage to collect a microbiological sample from [target]!</span>")
var/obj/item/parent_item = parent
parent_item.update_icon()
parent_item.update_appearance()
///Checks if the swabbing component can swab the specific object or nots
/datum/component/swabbing/proc/can_swab(atom/target)

View File

@@ -163,7 +163,7 @@
if(sharpened_increase)
parent_item.force += sharpened_increase
parent_item.name = "[parent_item.name] (Wielded)"
parent_item.update_icon()
parent_item.update_appearance()
if(iscyborg(user))
to_chat(user, "<span class='notice'>You dedicate your module to [parent].</span>")
@@ -215,7 +215,7 @@
parent_item.name = "[initial(parent_item.name)]"
// Update icons
parent_item.update_icon()
parent_item.update_appearance()
if(istype(user)) // tk showed that we might not have a mob here
if(user.get_item_by_slot(ITEM_SLOT_BACK) == parent)
@@ -260,14 +260,14 @@
*
* Updates the icon using icon_wielded if set
*/
/datum/component/two_handed/proc/on_update_icon(datum/source)
/datum/component/two_handed/proc/on_update_icon(obj/item/source)
SIGNAL_HANDLER
if(icon_wielded && wielded)
var/obj/item/parent_item = parent
if(parent_item)
parent_item.icon_state = icon_wielded
return COMSIG_ATOM_NO_UPDATE_ICON_STATE
if(!wielded)
return NONE
if(!icon_wielded)
return NONE
source.icon_state = icon_wielded
return COMSIG_ATOM_NO_UPDATE_ICON_STATE
/**
* on_moved Triggers on item moved

View File

@@ -28,7 +28,7 @@
var/obj/item/organ/appendix/A = affected_mob.getorgan(/obj/item/organ/appendix)
if(A)
A.inflamed = 1
A.update_icon()
A.update_appearance()
if(prob(3))
to_chat(affected_mob, "<span class='warning'>You feel a stabbing pain in your abdomen!</span>")
affected_mob.adjustOrganLoss(ORGAN_SLOT_APPENDIX, 5)

View File

@@ -14,7 +14,7 @@
RegisterSignal(target,COMSIG_ATOM_UPDATE_OVERLAYS,.proc/apply_overlay, TRUE)
if(target.flags_1 & INITIALIZED_1)
target.update_icon() //could use some queuing here now maybe.
target.update_appearance() //could use some queuing here now maybe.
else
RegisterSignal(target,COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZE,.proc/late_update_icon, TRUE)
if(isitem(target))
@@ -37,7 +37,7 @@
/datum/element/decal/Detach(atom/source, force)
UnregisterSignal(source, list(COMSIG_ATOM_DIR_CHANGE, COMSIG_COMPONENT_CLEAN_ACT, COMSIG_PARENT_EXAMINE, COMSIG_ATOM_UPDATE_OVERLAYS))
source.update_icon()
source.update_appearance()
if(isitem(source))
INVOKE_ASYNC(source, /obj/item/.proc/update_slot_icon)
return ..()
@@ -46,7 +46,7 @@
SIGNAL_HANDLER
if(source && istype(source))
source.update_icon()
source.update_appearance()
UnregisterSignal(source,COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZE)

View File

@@ -163,6 +163,7 @@
attack_verb_simple = list("smash", "slam", "whack", "thwack")
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "bostaff0"
base_icon_state = "bostaff"
lefthand_file = 'icons/mob/inhands/weapons/staves_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/staves_righthand.dmi'
block_chance = 50
@@ -175,7 +176,7 @@
/obj/item/staff/bostaff/ComponentInitialize()
. = ..()
AddComponent(/datum/component/two_handed, force_unwielded=10, force_wielded=24, icon_wielded="bostaff1")
AddComponent(/datum/component/two_handed, force_unwielded=10, force_wielded=24, icon_wielded="[base_icon_state]1")
/// triggered on wield of two handed item
/obj/item/staff/bostaff/proc/on_wield(obj/item/source, mob/user)
@@ -190,7 +191,8 @@
wielded = FALSE
/obj/item/staff/bostaff/update_icon_state()
icon_state = "bostaff0"
icon_state = "[base_icon_state]0"
return ..()
/obj/item/staff/bostaff/attack(mob/target, mob/living/user, params)
add_fingerprint(user)

View File

@@ -240,7 +240,7 @@
W.hairstyle = pick(GLOB.hairstyles_list - "Bald")
else
W.hairstyle = old_hair
W.update_icon()
W.update_appearance()
var/list/slots = list (
"head" = ITEM_SLOT_HEAD,
"backpack" = ITEM_SLOT_BACKPACK,

View File

@@ -382,13 +382,13 @@
/datum/status_effect/eldritch/on_apply()
if(owner.mob_size >= MOB_SIZE_HUMAN)
RegisterSignal(owner,COMSIG_ATOM_UPDATE_OVERLAYS,.proc/update_owner_underlay)
owner.update_icon()
owner.update_appearance()
return TRUE
return FALSE
/datum/status_effect/eldritch/on_remove()
UnregisterSignal(owner,COMSIG_ATOM_UPDATE_OVERLAYS)
owner.update_icon()
owner.update_appearance()
return ..()
/datum/status_effect/eldritch/proc/update_owner_underlay(atom/source, list/overlays)
@@ -951,7 +951,7 @@
/datum/status_effect/cloudstruck/on_apply()
mob_overlay = mutable_appearance('icons/effects/eldritch.dmi', "cloud_swirl", ABOVE_MOB_LAYER)
owner.overlays += mob_overlay
owner.update_icon()
owner.update_appearance()
ADD_TRAIT(owner, TRAIT_BLIND, "cloudstruck")
return TRUE
@@ -962,7 +962,7 @@
REMOVE_TRAIT(owner, TRAIT_BLIND, "cloudstruck")
if(owner)
owner.overlays -= mob_overlay
owner.update_icon()
owner.update_appearance()
/datum/status_effect/cloudstruck/Destroy()
. = ..()

View File

@@ -109,7 +109,7 @@
for(var/obj/effect/proc_holder/spell/spell in rewarded.mind.spell_list)
spell.charge_counter = spell.charge_max
spell.recharging = FALSE
spell.update_icon()
spell.update_appearance()
rewarded.adjustBruteLoss(-25)
rewarded.adjustFireLoss(-25)
rewarded.adjustToxLoss(-25)

View File

@@ -30,7 +30,7 @@
if(WIRE_POWER) // Short out for a long time.
if(!A.shorted)
A.shorted = TRUE
A.update_icon()
A.update_appearance()
addtimer(CALLBACK(A, /obj/machinery/airalarm.proc/reset, wire), 1200)
if(WIRE_IDSCAN) // Toggle lock.
A.locked = !A.locked
@@ -49,7 +49,7 @@
var/area/AA = get_area(A)
if(AA.atmosalert(FALSE, holder))
A.post_alert(0)
A.update_icon()
A.update_appearance()
/datum/wires/airalarm/on_cut(wire, mend)
var/obj/machinery/airalarm/A = holder
@@ -57,7 +57,7 @@
if(WIRE_POWER) // Short out forever.
A.shock(usr, 50)
A.shorted = !mend
A.update_icon()
A.update_appearance()
if(WIRE_IDSCAN)
if(!mend)
A.locked = TRUE
@@ -71,4 +71,4 @@
var/area/AA = get_area(A)
if(AA.atmosalert(TRUE, holder))
A.post_alert(2)
A.update_icon()
A.update_appearance()

View File

@@ -105,13 +105,13 @@
else
if(A.hasPower())
A.unbolt()
A.update_icon()
A.update_appearance()
if(WIRE_IDSCAN) // Pulse to disable emergency access and flash red lights.
if(A.hasPower() && A.density)
A.do_animate("deny")
if(A.emergency)
A.emergency = FALSE
A.update_icon()
A.update_appearance()
if(WIRE_AI) // Pulse to disable WIRE_AI control for 10 ticks (follows same rules as cutting).
if(A.aiControlDisabled == AI_WIRE_NORMAL)
A.aiControlDisabled = AI_WIRE_DISABLED
@@ -130,7 +130,7 @@
A.normalspeed = !A.normalspeed
if(WIRE_LIGHT)
A.lights = !A.lights
A.update_icon()
A.update_appearance()
/obj/machinery/door/airlock/proc/reset_ai_wire()
if(aiControlDisabled == AI_WIRE_DISABLED)
@@ -185,7 +185,7 @@
A.close()
if(WIRE_LIGHT) // Cut to disable lights, mend to re-enable.
A.lights = mend
A.update_icon()
A.update_appearance()
if(WIRE_ZAP1, WIRE_ZAP2) // Ouch.
if(isliving(usr))
A.shock(usr, 50)

View File

@@ -29,14 +29,14 @@
if(WIRE_POWER1, WIRE_POWER2) // Short for a long while.
if(!A.shorted)
A.shorted = TRUE
addtimer(CALLBACK(A, /obj/machinery/power/apc.proc/reset, wire), 1200)
addtimer(CALLBACK(A, /obj/machinery/power/apc.proc/reset, wire), 2 MINUTES)
if(WIRE_IDSCAN) // Unlock for a little while.
A.locked = FALSE
addtimer(CALLBACK(A, /obj/machinery/power/apc.proc/reset, wire), 300)
addtimer(CALLBACK(A, /obj/machinery/power/apc.proc/reset, wire), 30 SECONDS)
if(WIRE_AI) // Disable AI control for a very short time.
if(!A.aidisabled)
A.aidisabled = TRUE
addtimer(CALLBACK(A, /obj/machinery/power/apc.proc/reset, wire), 10)
addtimer(CALLBACK(A, /obj/machinery/power/apc.proc/reset, wire), 1 SECONDS)
/datum/wires/apc/on_cut(index, mend)
var/obj/machinery/power/apc/A = holder
@@ -44,15 +44,11 @@
if(WIRE_POWER1, WIRE_POWER2) // Short out.
if(mend && !is_cut(WIRE_POWER1) && !is_cut(WIRE_POWER2))
A.shorted = FALSE
A.shock(usr, 50)
else
A.shorted = TRUE
A.shock(usr, 50)
A.shock(usr, 50)
if(WIRE_AI) // Disable AI control.
if(mend)
A.aidisabled = FALSE
else
A.aidisabled = TRUE
A.aidisabled = !mend
/datum/wires/apc/can_reveal_wires(mob/user)
if(HAS_TRAIT(user, TRAIT_KNOW_ENGI_WIRES))

View File

@@ -50,7 +50,7 @@
if(!B.active)
holder.visible_message("<span class='danger'>[icon2html(B, viewers(holder))] You hear the bomb start ticking!</span>")
B.activate()
B.update_icon()
B.update_appearance()
else if(B.delayedlittle)
holder.visible_message("<span class='notice'>[icon2html(B, viewers(holder))] Nothing happens.</span>")
else
@@ -82,7 +82,7 @@
B.active = FALSE
B.delayedlittle = FALSE
B.delayedbig = FALSE
B.update_icon()
B.update_appearance()
/datum/wires/syndicatebomb/proc/tell_admins(obj/machinery/syndicatebomb/B)
if(istype(B, /obj/machinery/syndicatebomb/training))

View File

@@ -348,7 +348,7 @@ GLOBAL_LIST_EMPTY(teleportlocs)
ModifyFiredoors(FALSE)
for(var/item in firealarms)
var/obj/machinery/firealarm/F = item
F.update_icon()
F.update_appearance()
if (!(area_flags & NO_ALERTS)) //Check here instead at the start of the proc so that fire alarms can still work locally even in areas that don't send alerts
for (var/item in GLOB.alert_consoles)
var/obj/machinery/computer/station_alert/a = item
@@ -378,7 +378,7 @@ GLOBAL_LIST_EMPTY(teleportlocs)
ModifyFiredoors(TRUE)
for(var/item in firealarms)
var/obj/machinery/firealarm/F = item
F.update_icon()
F.update_appearance()
if (!(area_flags & NO_ALERTS)) //Check here instead at the start of the proc so that fire alarms can still work locally even in areas that don't send alerts
for (var/item in GLOB.silicon_mobs)
var/mob/living/silicon/aiPlayer = item
@@ -483,11 +483,13 @@ GLOBAL_LIST_EMPTY(teleportlocs)
weather_icon = TRUE
if(!weather_icon)
icon_state = null
return ..()
/**
* Update the icon of the area (overridden to always be null for space
*/
/area/space/update_icon_state()
SHOULD_CALL_PARENT(FALSE)
icon_state = null
@@ -528,7 +530,7 @@ GLOBAL_LIST_EMPTY(teleportlocs)
for(var/obj/machinery/M in src) // for each machine in the area
M.power_change() // reverify power status (to update icons etc.)
SEND_SIGNAL(src, COMSIG_AREA_POWER_CHANGE)
update_icon()
update_appearance()
/**

View File

@@ -643,18 +643,52 @@
if(!LAZYLEN(.)) // lol ..length
return list("<span class='notice'><i>You examine [src] closer, but find nothing of interest...</i></span>")
/**
* Updates the appearence of the icon
*
* Mostly delegates to update_name, update_desc, and update_icon
*
* Arguments:
* - updates: A set of bitflags dictating what should be updated. Defaults to [ALL]
*/
/atom/proc/update_appearance(updates=ALL)
SHOULD_NOT_SLEEP(TRUE)
SHOULD_CALL_PARENT(TRUE)
. = NONE
updates &= ~SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_APPEARANCE, updates)
if(updates & UPDATE_NAME)
. |= update_name(updates)
if(updates & UPDATE_DESC)
. |= update_desc(updates)
if(updates & UPDATE_ICON)
. |= update_icon(updates)
/// Updates the name of the atom
/atom/proc/update_name(updates=ALL)
SHOULD_CALL_PARENT(TRUE)
return SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_NAME, updates)
/// Updates the description of the atom
/atom/proc/update_desc(updates=ALL)
SHOULD_CALL_PARENT(TRUE)
return SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_DESC, updates)
/// Updates the icon of the atom
/atom/proc/update_icon()
/atom/proc/update_icon(updates=ALL)
SIGNAL_HANDLER
SHOULD_CALL_PARENT(TRUE)
var/signalOut = SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_ICON)
. = FALSE
if(!(signalOut & COMSIG_ATOM_NO_UPDATE_ICON_STATE))
. = NONE
updates &= ~SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_ICON, updates)
if(updates & UPDATE_ICON_STATE)
update_icon_state()
. = TRUE
. |= UPDATE_ICON_STATE
if(updates & UPDATE_OVERLAYS)
if(LAZYLEN(managed_vis_overlays))
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
if(!(signalOut & COMSIG_ATOM_NO_UPDATE_OVERLAYS))
var/list/new_overlays = update_overlays()
if(managed_overlays)
cut_overlay(managed_overlays)
@@ -662,12 +696,14 @@
if(length(new_overlays))
managed_overlays = new_overlays
add_overlay(new_overlays)
. = TRUE
. |= UPDATE_OVERLAYS
SEND_SIGNAL(src, COMSIG_ATOM_UPDATED_ICON, signalOut, .)
. |= SEND_SIGNAL(src, COMSIG_ATOM_UPDATED_ICON, updates, .)
/// Updates the icon state of the atom
/atom/proc/update_icon_state()
SHOULD_CALL_PARENT(TRUE)
return SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_ICON_STATE)
/// Updates the overlays of the atom
/atom/proc/update_overlays()

View File

@@ -3,19 +3,21 @@
desc = "You probably shouldn't stick around to see if this is armed."
icon = 'icons/obj/machines/nuke.dmi'
icon_state = "bananiumbomb_base"
base_icon_state = "bananiumbomb"
/obj/machinery/nuclearbomb/syndicate/bananium/update_icon_state()
. = ..()
if(deconstruction_state != NUKESTATE_INTACT)
icon_state = "bananiumbomb_base"
icon_state = "[base_icon_state]_base"
return
switch(get_nuke_state())
if(NUKE_OFF_LOCKED, NUKE_OFF_UNLOCKED)
icon_state = "bananiumbomb_base"
icon_state = "[base_icon_state]_base"
if(NUKE_ON_TIMING)
icon_state = "bananiumbomb_timing"
icon_state = "[base_icon_state]_timing"
if(NUKE_ON_EXPLODING)
icon_state = "bananiumbomb_exploding"
icon_state = "[base_icon_state]_exploding"
/obj/machinery/nuclearbomb/syndicate/bananium/get_cinematic_type(off_station)
switch(off_station)

View File

@@ -6,7 +6,7 @@
S.charge = 0
S.output_level = 0
S.output_attempt = FALSE
S.update_icon()
S.update_appearance()
S.power_change()
for(var/area/A in GLOB.the_station_areas)
@@ -34,14 +34,14 @@
for(var/obj/machinery/power/apc/C in GLOB.machines)
if(C.cell && is_station_level(C.z))
C.cell.charge = C.cell.maxcharge
C.failure_timer = 0
COOLDOWN_RESET(C, failure_timer)
for(var/obj/machinery/power/smes/S in GLOB.machines)
if(!is_station_level(S.z))
continue
S.charge = S.capacity
S.output_level = S.output_level_max
S.output_attempt = TRUE
S.update_icon()
S.update_appearance()
S.power_change()
for(var/area/A in GLOB.the_station_areas)
if(!A.requires_power || A.always_unpowered)
@@ -61,6 +61,6 @@
S.charge = S.capacity
S.output_level = S.output_level_max
S.output_attempt = TRUE
S.update_icon()
S.update_appearance()
S.power_change()

View File

@@ -346,7 +346,7 @@ GLOBAL_VAR_INIT(deaths_during_shift, 0)
var/datum/hud/H = M.hud_used
H.wanted_lvl.level = newlevel
H.wanted_lvl.cops_arrived = cops_arrived
H.wanted_lvl.update_icon()
H.wanted_lvl.update_appearance()
/// Internal. Updates the end_time and sends out an announcement if the wanted level has increased. Called by update_wanted_level().
/datum/gang_handler/proc/on_gain_wanted_level(newlevel)

View File

@@ -180,7 +180,7 @@ GLOBAL_VAR_INIT(hsboxspawn, TRUE)
if("hsbscrubber") // This is beyond its normal capability but this is sandbox and you spawned one, I assume you need it
var/obj/hsb = new/obj/machinery/portable_atmospherics/scrubber{volume_rate=50*ONE_ATMOSPHERE;on=1}(usr.loc)
hsb.update_icon() // hackish but it wasn't meant to be spawned I guess?
hsb.update_appearance() // hackish but it wasn't meant to be spawned I guess?
//
// Stacked Materials

View File

@@ -3,6 +3,7 @@
desc = "A PDA painting machine. To use, simply insert your PDA and choose the desired preset paint scheme."
icon = 'icons/obj/pda.dmi'
icon_state = "pdapainter"
base_icon_state = "pdapainter"
density = TRUE
max_integrity = 200
var/obj/item/pda/storedpda = null
@@ -10,13 +11,10 @@
/obj/machinery/pdapainter/update_icon_state()
if(machine_stat & BROKEN)
icon_state = "[initial(icon_state)]-broken"
return
if(powered())
icon_state = initial(icon_state)
else
icon_state = "[initial(icon_state)]-off"
icon_state = "[base_icon_state]-broken"
return ..()
icon_state = "[base_icon_state][powered() ? null : "-off"]"
return ..()
/obj/machinery/pdapainter/update_overlays()
. = ..()
@@ -62,7 +60,7 @@
/obj/machinery/pdapainter/handle_atom_del(atom/A)
if(A == storedpda)
storedpda = null
update_icon()
update_appearance()
/obj/machinery/pdapainter/attackby(obj/item/O, mob/living/user, params)
if(machine_stat & BROKEN)
@@ -78,7 +76,7 @@
to_chat(user, "<span class='notice'>You repair [src].</span>")
set_machine_stat(machine_stat & ~BROKEN)
obj_integrity = max_integrity
update_icon()
update_appearance()
else
return ..()
@@ -95,7 +93,7 @@
return
storedpda = O
O.add_fingerprint(user)
update_icon()
update_appearance()
else
return ..()
@@ -140,6 +138,6 @@
if(storedpda)
storedpda.forceMove(drop_location())
storedpda = null
update_icon()
update_appearance()
else
to_chat(usr, "<span class='warning'>[src] is empty!</span>")

View File

@@ -9,6 +9,7 @@
desc = "An enclosed machine used to stabilize and heal patients."
icon = 'icons/obj/machines/sleeper.dmi'
icon_state = "sleeper"
base_icon_state = "sleeper"
density = FALSE
state_open = TRUE
circuit = /obj/item/circuitboard/machine/sleeper
@@ -35,7 +36,7 @@
LAZYREMOVE(component_parts, circuit)
QDEL_NULL(circuit)
occupant_typecache = GLOB.typecache_living
update_icon()
update_appearance()
reset_chem_buttons()
/obj/machinery/sleeper/RefreshParts()
@@ -54,10 +55,8 @@
reset_chem_buttons()
/obj/machinery/sleeper/update_icon_state()
if(state_open)
icon_state = "[initial(icon_state)]-open"
else
icon_state = initial(icon_state)
icon_state = "[base_icon_state][state_open ? "-open" : null]"
return ..()
/obj/machinery/sleeper/container_resist_act(mob/living/user)
visible_message("<span class='notice'>[occupant] emerges from [src]!</span>",
@@ -266,6 +265,7 @@
/obj/machinery/sleeper/syndie
icon_state = "sleeper_s"
base_icon_state = "sleeper_s"
controls_inside = TRUE
/obj/machinery/sleeper/syndie/fullupgrade/Initialize()
@@ -286,11 +286,13 @@
/obj/machinery/sleeper/old
icon_state = "oldpod"
base_icon_state = "oldpod"
/obj/machinery/sleeper/party
name = "party pod"
desc = "'Sleeper' units were once known for their healing properties, until a lengthy investigation revealed they were also dosing patients with deadly lead acetate. This appears to be one of those old 'sleeper' units repurposed as a 'Party Pod'. Its probably not a good idea to use it."
icon_state = "partypod"
base_icon_state = "partypod"
idle_power_usage = 3000
circuit = /obj/item/circuitboard/machine/sleeper/party
var/leddit = FALSE //Get it like reddit and lead alright fine

View File

@@ -222,7 +222,7 @@
density = FALSE
if(drop)
dump_inventory_contents()
update_icon()
update_appearance()
updateUsrDialog()
/**
@@ -305,7 +305,7 @@
set_occupant(target)
target.forceMove(src)
updateUsrDialog()
update_icon()
update_appearance()
/obj/machinery/proc/auto_use_power()
if(!powered(power_channel))
@@ -530,7 +530,7 @@
if(!(machine_stat & BROKEN) && !(flags_1 & NODECONSTRUCT_1))
set_machine_stat(machine_stat | BROKEN)
SEND_SIGNAL(src, COMSIG_MACHINERY_BROKEN, damage_flag)
update_icon()
update_appearance()
return TRUE
/obj/machinery/contents_explosion(severity, target)
@@ -539,7 +539,7 @@
/obj/machinery/handle_atom_del(atom/A)
if(A == occupant)
set_occupant(null)
update_icon()
update_appearance()
updateUsrDialog()
return ..()

View File

@@ -30,7 +30,7 @@
var/datum/bank_account/bank_account = new /datum/bank_account(inserted_id.registered_name)
inserted_id.registered_account = bank_account
playsound(loc, 'sound/machines/synth_yes.ogg', 30 , TRUE)
update_icon()
update_appearance()
return
return ..()
@@ -51,21 +51,26 @@
/obj/machinery/accounting/proc/remove_card()
UnregisterSignal(inserted_id, COMSIG_PARENT_QDELETING)
inserted_id = null
update_icon()
update_appearance()
/obj/machinery/accounting/update_overlays()
. = ..()
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
luminosity = 0
if(machine_stat & (NOPOWER|BROKEN) || !anchored)
return
if(panel_open)
SSvis_overlays.add_vis_overlay(src, icon, "recharger-open", layer, plane, dir, alpha)
return
luminosity = 1
if(inserted_id)
SSvis_overlays.add_vis_overlay(src, icon, "recharger-full", layer, plane, dir, alpha)
SSvis_overlays.add_vis_overlay(src, icon, "recharger-full", EMISSIVE_LAYER, EMISSIVE_PLANE, dir, alpha)
else
SSvis_overlays.add_vis_overlay(src, icon, "recharger-empty", layer, plane, dir, alpha)
SSvis_overlays.add_vis_overlay(src, icon, "recharger-empty", EMISSIVE_LAYER, EMISSIVE_PLANE, dir, alpha)
return
SSvis_overlays.add_vis_overlay(src, icon, "recharger-empty", layer, plane, dir, alpha)
SSvis_overlays.add_vis_overlay(src, icon, "recharger-empty", EMISSIVE_LAYER, EMISSIVE_PLANE, dir, alpha)
/obj/machinery/accounting/update_appearance(updates)
. = ..()
if((machine_stat & (NOPOWER|BROKEN)) || panel_open || !anchored)
luminosity = 0
return
luminosity = 1

View File

@@ -3,6 +3,7 @@
desc = "A remotely-activatable dispenser for crowd-controlling foam."
icon = 'icons/obj/device.dmi'
icon_state = "ai-slipper0"
base_icon_state = "ai-slipper"
layer = PROJECTILE_HIT_THRESHHOLD_LAYER
plane = FLOOR_PLANE
max_integrity = 200
@@ -19,11 +20,12 @@
/obj/machinery/ai_slipper/update_icon_state()
if(machine_stat & BROKEN)
return
return ..()
if((machine_stat & NOPOWER) || cooldown_time > world.time || !uses)
icon_state = "ai-slipper0"
else
icon_state = "ai-slipper1"
icon_state = "[base_icon_state]0"
return ..()
icon_state = "[base_icon_state]1"
return ..()
/obj/machinery/ai_slipper/interact(mob/user)
if(!allowed(user))

View File

@@ -2,6 +2,8 @@
// This code allows for airlocks to be controlled externally by setting an id_tag and comm frequency (disables ID access)
/obj/machinery/door/airlock
/// The current state of the airlock, used to construct the airlock overlays
var/airlock_state
var/frequency
var/datum/radio_frequency/radio_connection
@@ -22,21 +24,21 @@
if("unlock")
locked = FALSE
update_icon()
update_appearance()
if("lock")
locked = TRUE
update_icon()
update_appearance()
if("secure_open")
locked = FALSE
update_icon()
update_appearance()
sleep(2)
open(1)
locked = TRUE
update_icon()
update_appearance()
if("secure_close")
locked = FALSE
@@ -44,7 +46,7 @@
locked = TRUE
sleep(2)
update_icon()
update_appearance()
send_status()
@@ -86,6 +88,7 @@
/obj/machinery/airlock_sensor
icon = 'icons/obj/airlock_machines.dmi'
icon_state = "airlock_sensor_off"
base_icon_state = "airlock_sensor"
name = "airlock sensor"
resistance_flags = FIRE_PROOF
@@ -112,13 +115,14 @@
master_tag = INCINERATOR_SYNDICATELAVA_AIRLOCK_CONTROLLER
/obj/machinery/airlock_sensor/update_icon_state()
if(on)
if(alert)
icon_state = "airlock_sensor_alert"
else
icon_state = "airlock_sensor_standby"
if(!on)
icon_state = "[base_icon_state]_off"
else
icon_state = "airlock_sensor_off"
if(alert)
icon_state = "[base_icon_state]_alert"
else
icon_state = "[base_icon_state]_standby"
return ..()
/obj/machinery/airlock_sensor/attack_hand(mob/user, list/modifiers)
. = ..()
@@ -146,7 +150,7 @@
radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = RADIO_AIRLOCK)
update_icon()
update_appearance()
/obj/machinery/airlock_sensor/proc/set_frequency(new_frequency)
SSradio.remove_object(src, frequency)

View File

@@ -6,6 +6,7 @@ GLOBAL_LIST_EMPTY(announcement_systems)
desc = "An automated announcement system that handles minor announcements over the radio."
icon = 'icons/obj/machines/telecomms.dmi'
icon_state = "AAS_On"
base_icon_state = "AAS"
verb_say = "coldly states"
verb_ask = "queries"
@@ -30,13 +31,11 @@ GLOBAL_LIST_EMPTY(announcement_systems)
. = ..()
GLOB.announcement_systems += src
radio = new /obj/item/radio/headset/silicon/ai(src)
update_icon()
update_appearance()
/obj/machinery/announcement_system/update_icon_state()
if(is_operational)
icon_state = (panel_open ? "AAS_On_Open" : "AAS_On")
else
icon_state = (panel_open ? "AAS_Off_Open" : "AAS_Off")
icon_state = "[base_icon_state]_[is_operational ? "On" : "Off"][panel_open ? "_Open" : null]"
return ..()
/obj/machinery/announcement_system/update_overlays()
. = ..()
@@ -59,13 +58,13 @@ GLOBAL_LIST_EMPTY(announcement_systems)
P.play_tool_sound(src)
panel_open = !panel_open
to_chat(user, "<span class='notice'>You [panel_open ? "open" : "close"] the maintenance hatch of [src].</span>")
update_icon()
update_appearance()
else if(default_deconstruction_crowbar(P))
return
else if(P.tool_behaviour == TOOL_MULTITOOL && panel_open && (machine_stat & BROKEN))
to_chat(user, "<span class='notice'>You reset [src]'s firmware.</span>")
set_machine_stat(machine_stat & ~BROKEN)
update_icon()
update_appearance()
else
return ..()
@@ -134,10 +133,10 @@ GLOBAL_LIST_EMPTY(announcement_systems)
log_game("The head announcement was updated: [NewMessage] by:[key_name(usr)]")
if("NewheadToggle")
newheadToggle = !newheadToggle
update_icon()
update_appearance()
if("ArrivalToggle")
arrivalToggle = !arrivalToggle
update_icon()
update_appearance()
add_fingerprint(usr)
/obj/machinery/announcement_system/attack_robot(mob/living/silicon/user)

View File

@@ -3,11 +3,11 @@
desc = "A machine for custom fitting augmentations, with in-built spraypainter."
icon = 'icons/obj/pda.dmi'
icon_state = "pdapainter"
base_icon_state = "pdapainter"
density = TRUE
obj_integrity = 200
max_integrity = 200
var/obj/item/bodypart/storedpart
var/initial_icon_state
var/static/list/style_list_icons = list("standard" = 'icons/mob/augmentation/augments.dmi', "engineer" = 'icons/mob/augmentation/augments_engineer.dmi', "security" = 'icons/mob/augmentation/augments_security.dmi', "mining" = 'icons/mob/augmentation/augments_mining.dmi')
/obj/machinery/aug_manipulator/examine(mob/user)
@@ -16,23 +16,21 @@
. += "<span class='notice'>Alt-click to eject the limb.</span>"
/obj/machinery/aug_manipulator/Initialize()
initial_icon_state = initial(icon_state)
if(!base_icon_state)
base_icon_state = initial(icon_state)
return ..()
/obj/machinery/aug_manipulator/update_icon_state()
if(machine_stat & BROKEN)
icon_state = "[initial_icon_state]-broken"
return
if(powered())
icon_state = initial_icon_state
else
icon_state = "[initial_icon_state]-off"
icon_state = "[base_icon_state]-broken"
return ..()
icon_state = "[base_icon_state][powered() ? null : "-off"]"
return ..()
/obj/machinery/aug_manipulator/update_overlays()
. = ..()
if(storedpart)
. += "[initial_icon_state]-closed"
. += "[base_icon_state]-closed"
/obj/machinery/aug_manipulator/Destroy()
QDEL_NULL(storedpart)
@@ -50,7 +48,7 @@
/obj/machinery/aug_manipulator/handle_atom_del(atom/A)
if(A == storedpart)
storedpart = null
update_icon()
update_appearance()
/obj/machinery/aug_manipulator/attackby(obj/item/O, mob/living/user, params)
if(default_unfasten_wrench(user, O))
@@ -71,7 +69,7 @@
return
storedpart = O
O.add_fingerprint(user)
update_icon()
update_appearance()
else if(O.tool_behaviour == TOOL_WELDER && !user.combat_mode)
if(obj_integrity < max_integrity)
@@ -88,7 +86,7 @@
to_chat(user, "<span class='notice'>You repair [src].</span>")
set_machine_stat(machine_stat & ~BROKEN)
obj_integrity = max(obj_integrity, max_integrity)
update_icon()
update_appearance()
else
to_chat(user, "<span class='notice'>[src] does not need repairs.</span>")
else
@@ -135,7 +133,7 @@
if(storedpart)
storedpart.forceMove(get_turf(src))
storedpart = null
update_icon()
update_appearance()
else
to_chat(user, "<span class='warning'>[src] is empty!</span>")

View File

@@ -224,7 +224,7 @@
if(is_stack)
var/obj/item/stack/N = new being_built.build_path(A, multiplier, FALSE)
N.update_icon()
N.update_appearance()
N.autolathe_crafted(src)
else
for(var/i=1, i<=multiplier, i++)

View File

@@ -25,7 +25,7 @@
pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24)
pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0
panel_open = TRUE
update_icon()
update_appearance()
if(!built && !device && device_type)
@@ -46,10 +46,12 @@
/obj/machinery/button/update_icon_state()
if(panel_open)
icon_state = "button-open"
else if(machine_stat & (NOPOWER|BROKEN))
return ..()
if(machine_stat & (NOPOWER|BROKEN))
icon_state = "[skin]-p"
else
icon_state = skin
return ..()
icon_state = skin
return ..()
/obj/machinery/button/update_overlays()
. = ..()
@@ -64,7 +66,7 @@
if(W.tool_behaviour == TOOL_SCREWDRIVER)
if(panel_open || allowed(user))
default_deconstruction_screwdriver(user, "button-open", "[skin]",W)
update_icon()
update_appearance()
else
to_chat(user, "<span class='alert'>Maintenance Access Denied.</span>")
flick("[skin]-denied", src)
@@ -98,7 +100,7 @@
playsound(loc, 'sound/items/deconstruct.ogg', 50, TRUE)
qdel(src)
update_icon()
update_appearance()
return
if(!user.combat_mode && !(W.item_flags & NOBLUDGEON))
@@ -149,7 +151,7 @@
req_access = list()
req_one_access = list()
board = null
update_icon()
update_appearance()
to_chat(user, "<span class='notice'>You remove electronics from the button frame.</span>")
else
@@ -178,7 +180,7 @@
device.pulsed()
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_BUTTON_PRESSED,src)
addtimer(CALLBACK(src, /atom/.proc/update_icon), 15)
addtimer(CALLBACK(src, /atom/.proc/update_appearance), 15)
/obj/machinery/button/door
name = "door button"

View File

@@ -16,7 +16,7 @@
armor = list(MELEE = 50, BULLET = 20, LASER = 20, ENERGY = 20, BOMB = 0, BIO = 0, RAD = 0, FIRE = 90, ACID = 50)
max_integrity = 100
integrity_failure = 0.5
var/default_camera_icon = "camera" //the camera's base icon used by update_icon - icon_state is primarily used for mapping display purposes.
var/default_camera_icon = "camera" //the camera's base icon used by update_appearance - icon_state is primarily used for mapping display purposes.
var/list/network = list("ss13")
var/c_tag = null
var/status = TRUE
@@ -82,7 +82,7 @@
if(mapload && is_station_level(z) && prob(3) && !start_active)
toggle_cam()
else //this is handled by toggle_camera, so no need to update it twice.
update_icon()
update_appearance()
/obj/machinery/camera/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock)
for(var/i in network)
@@ -142,13 +142,13 @@
return
if(!(. & EMP_PROTECT_SELF))
if(prob(150/severity))
update_icon()
update_appearance()
network = list()
GLOB.cameranet.removeCamera(src)
set_machine_stat(machine_stat | EMPED)
set_light(0)
emped = emped+1 //Increase the number of consecutive EMP's
update_icon()
update_appearance()
addtimer(CALLBACK(src, .proc/post_emp_reset, emped, network), 90 SECONDS)
for(var/i in GLOB.player_list)
var/mob/M = i
@@ -165,7 +165,7 @@
return
network = previous_network
set_machine_stat(machine_stat & ~EMPED)
update_icon()
update_appearance()
if(can_use())
GLOB.cameranet.addCamera(src)
emped = 0 //Resets the consecutive EMP count
@@ -197,7 +197,7 @@
panel_open = !panel_open
to_chat(user, "<span class='notice'>You screw the camera's panel [panel_open ? "open" : "closed"].</span>")
I.play_tool_sound(src)
update_icon()
update_appearance()
return TRUE
/obj/machinery/camera/crowbar_act(mob/living/user, obj/item/I)
@@ -380,12 +380,15 @@
var/xray_module
if(isXRay(TRUE))
xray_module = "xray"
if(!status)
icon_state = "[xray_module][default_camera_icon]_off"
else if (machine_stat & EMPED)
return ..()
if(machine_stat & EMPED)
icon_state = "[xray_module][default_camera_icon]_emp"
else
icon_state = "[xray_module][default_camera_icon][in_use_lights ? "_in_use" : ""]"
return ..()
icon_state = "[xray_module][default_camera_icon][in_use_lights ? "_in_use" : ""]"
return ..()
/obj/machinery/camera/proc/toggle_cam(mob/user, displaymessage = 1)
status = !status
@@ -416,7 +419,7 @@
visible_message("<span class='danger'>\The [src] [change_msg]!</span>")
playsound(src, 'sound/items/wirecutter.ogg', 100, TRUE)
update_icon() //update Initialize() if you remove this.
update_appearance() //update Initialize() if you remove this.
// now disconnect anyone using the camera
//Apparently, this will disconnect anyone even if the camera was re-activated.

View File

@@ -69,11 +69,12 @@
/obj/structure/camera_assembly/update_icon_state()
icon_state = "[xray_module ? "xray" : null][initial(icon_state)]"
return ..()
/obj/structure/camera_assembly/handle_atom_del(atom/A)
if(A == xray_module)
xray_module = null
update_icon()
update_appearance()
if(malf_xray_firmware_present)
malf_xray_firmware_active = malf_xray_firmware_present //re-enable firmware based upgrades after the part is removed.
if(istype(loc, /obj/machinery/camera))
@@ -109,7 +110,7 @@
xray_module = null
if(malf_xray_firmware_present)
malf_xray_firmware_active = malf_xray_firmware_present //re-enable firmware based upgrades after the part is removed.
update_icon()
update_appearance()
else if(I == emp_module)
emp_module = null
@@ -174,7 +175,7 @@
if(malf_xray_firmware_active)
malf_xray_firmware_active = FALSE //flavor reason: MALF AI Upgrade Camera Network ability's firmware is incompatible with the new part
//real reason: make it a normal upgrade so the finished camera's icons and examine texts are restored.
update_icon()
update_appearance()
return
else if(istype(W, /obj/item/assembly/prox_sensor)) //motion sensing upgrade

View File

@@ -113,12 +113,12 @@
assembly.malf_xray_firmware_active = FALSE //make it appear like it's just normally upgraded so the icons and examine texts are restored.
upgrades |= CAMERA_UPGRADE_XRAY
update_icon()
update_appearance()
/obj/machinery/camera/proc/removeXRay(ignore_malf_upgrades)
if(!ignore_malf_upgrades) //don't downgrade it if malf software is forced onto it.
upgrades &= ~CAMERA_UPGRADE_XRAY
update_icon()
update_appearance()

View File

@@ -55,7 +55,7 @@
charging = W
user.visible_message("<span class='notice'>[user] inserts a cell into [src].</span>", "<span class='notice'>You insert a cell into [src].</span>")
update_icon()
update_appearance()
else
if(!charging && default_deconstruction_screwdriver(user, icon_state, icon_state, W))
return
@@ -75,9 +75,9 @@
return ..()
/obj/machinery/cell_charger/proc/removecell()
charging.update_icon()
charging.update_appearance()
charging = null
update_icon()
update_appearance()
/obj/machinery/cell_charger/attack_hand(mob/user, list/modifiers)
. = ..()
@@ -135,4 +135,4 @@
charging.give(main_draw)
use_power(charge_rate / 100) //use a small bit for the charger itself, but power usage scales up with the part tier
update_icon()
update_appearance()

View File

@@ -30,8 +30,6 @@
/obj/machinery/computer/update_overlays()
. = ..()
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
if(machine_stat & NOPOWER)
. += "[icon_keyboard]_off"
return

View File

@@ -81,7 +81,7 @@
var/oldstat = occupier.stat
restoring = Fix()
if(oldstat != occupier.stat)
update_icon()
update_appearance()
/obj/machinery/computer/aifixer/update_overlays()
. = ..()
@@ -90,14 +90,15 @@
if(restoring)
. += "ai-fixer-on"
if (occupier)
switch (occupier.stat)
if (CONSCIOUS)
. += "ai-fixer-full"
if (UNCONSCIOUS, HARD_CRIT)
. += "ai-fixer-404"
else
if(!occupier)
. += "ai-fixer-empty"
return
switch(occupier.stat)
if(CONSCIOUS)
. += "ai-fixer-full"
if(UNCONSCIOUS, HARD_CRIT)
. += "ai-fixer-404"
/obj/machinery/computer/aifixer/transfer_ai(interaction, mob/user, mob/living/silicon/ai/AI, obj/item/aicard/card)
if(!..())
@@ -114,7 +115,7 @@
to_chat(AI, "<span class='alert'>You have been uploaded to a stationary terminal. Sadly, there is no remote access from here.</span>")
to_chat(user, "<span class='notice'>Transfer successful</span>: [AI.name] ([rand(1000,9999)].exe) installed and executed successfully. Local copy has been removed.")
card.AI = null
update_icon()
update_appearance()
else //Uploading AI from terminal to card
if(occupier && !restoring)
@@ -123,7 +124,7 @@
occupier.forceMove(card)
card.AI = occupier
occupier = null
update_icon()
update_appearance()
else if (restoring)
to_chat(user, "<span class='alert'>ERROR: Reconstruction in progress.</span>")
else if (!occupier)

View File

@@ -26,7 +26,7 @@
playsound(active_apc, 'sound/machines/boltsdown.ogg', 25, FALSE)
playsound(active_apc, 'sound/machines/terminal_alert.ogg', 50, FALSE)
active_apc.locked = TRUE
active_apc.update_icon()
active_apc.update_appearance()
active_apc.remote_control = null
active_apc = null
@@ -127,7 +127,7 @@
playsound(active_apc, 'sound/machines/boltsdown.ogg', 25, FALSE)
playsound(active_apc, 'sound/machines/terminal_alert.ogg', 50, FALSE)
active_apc.locked = TRUE
active_apc.update_icon()
active_apc.update_appearance()
active_apc.remote_control = null
active_apc = null
APC.remote_control = src
@@ -140,7 +140,7 @@
playsound(APC, 'sound/machines/boltsup.ogg', 25, FALSE)
playsound(APC, 'sound/machines/terminal_alert.ogg', 50, FALSE)
APC.locked = FALSE
APC.update_icon()
APC.update_appearance()
active_apc = APC
if("check-logs")
log_activity("Checked Logs")
@@ -163,7 +163,7 @@
log_game("Warning: possible href exploit by [key_name(usr)] - attempted to set [type] on [target] to [value]")
return
target.update_icon()
target.update_appearance()
target.update()
var/setTo = ""
switch(target.vars[type])

View File

@@ -131,7 +131,7 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list(
return
prizevend(user)
T.pay_tickets()
T.update_icon()
T.update_appearance()
O = T
to_chat(user, "<span class='notice'>You turn in 2 tickets to the [src] and claim a prize!</span>")
return

View File

@@ -205,7 +205,7 @@
ready_to_spawn = !ready_to_spawn
to_chat(user,"You [ready_to_spawn ? "enable" : "disable"] the spawners.")
log_admin("[key_name(user)] toggled event arena spawning for [arena_id] arena.")
// Could use update_icon on spawnpoints here to show they're on
// Could use update_appearance on spawnpoints here to show they're on
if(ready_to_spawn)
for(var/mob/M in all_contestants())
to_chat(M,"<span class='userdanger'>Arena you're signed up for is ready!</span>")

View File

@@ -53,7 +53,7 @@
to_chat(usr, "<span class='notice'>Minor alarm for [zone] cleared.</span>")
minor_alarms -= zone
. = TRUE
update_icon()
update_appearance()
/obj/machinery/computer/atmos_alert/proc/set_frequency(new_frequency)
SSradio.remove_object(src, receive_frequency)
@@ -76,7 +76,7 @@
priority_alarms += zone
else if (severity == "minor")
minor_alarms += zone
update_icon()
update_appearance()
return
/obj/machinery/computer/atmos_alert/update_overlays()
@@ -85,5 +85,6 @@
return
if(priority_alarms.len)
. += "alert:2"
else if(minor_alarms.len)
return
if(minor_alarms.len)
. += "alert:1"

View File

@@ -91,6 +91,7 @@
/obj/machinery/air_sensor/update_icon_state()
icon_state = "gsensor[on]"
return ..()
/obj/machinery/air_sensor/process_atmos()
if(on)

View File

@@ -262,6 +262,7 @@
icon_state = initial(icon_state)
if(machine_stat & BROKEN)
icon_state += "b"
return ..()
/obj/machinery/computer/security/telescreen/entertainment
name = "entertainment monitor"

View File

@@ -526,7 +526,7 @@
P.info += "<B>Medical Record Lost!</B><BR>"
P.name = text("MR-[] '[]'", GLOB.data_core.medicalPrintCount, "Record Lost")
P.info += "</TT>"
P.update_icon()
P.update_appearance()
printing = null
add_fingerprint(usr)

View File

@@ -412,7 +412,7 @@ What a mess.*/
P.info += "<B>Security Record Lost!</B><BR>"
P.name = text("SR-[] '[]'", GLOB.data_core.securityPrintCount, "Record Lost")
P.info += "</TT>"
P.update_icon()
P.update_appearance()
printing = null
if("Print Poster")
if(!( printing ))

View File

@@ -69,13 +69,13 @@
switch(action)
if("regimeset")
power_station.engaged = FALSE
power_station.teleporter_hub.update_icon()
power_station.teleporter_hub.update_appearance()
power_station.teleporter_hub.calibrated = FALSE
reset_regime()
. = TRUE
if("settarget")
power_station.engaged = FALSE
power_station.teleporter_hub.update_icon()
power_station.teleporter_hub.update_appearance()
power_station.teleporter_hub.calibrated = FALSE
set_target(usr)
. = TRUE
@@ -89,7 +89,7 @@
say("Processing hub calibration to target...")
calibrating = TRUE
power_station.update_icon()
power_station.update_appearance()
addtimer(CALLBACK(src, .proc/finish_calibration), 50 * (3 - power_station.teleporter_hub.accuracy)) //Better parts mean faster calibration
. = TRUE
@@ -106,7 +106,7 @@
say("Calibration complete.")
else
say("Error: Unable to detect hub.")
power_station.update_icon()
power_station.update_appearance()
/obj/machinery/computer/teleporter/proc/check_hub_connection()
if(!power_station)
@@ -170,10 +170,10 @@
target_station.set_machine_stat(target_station.machine_stat & ~NOPOWER)
if(target_station.teleporter_hub)
target_station.teleporter_hub.set_machine_stat(target_station.teleporter_hub.machine_stat & ~NOPOWER)
target_station.teleporter_hub.update_icon()
target_station.teleporter_hub.update_appearance()
if(target_station.teleporter_console)
target_station.teleporter_console.set_machine_stat(target_station.teleporter_console.machine_stat & ~NOPOWER)
target_station.teleporter_console.update_icon()
target_station.teleporter_console.update_appearance()
/obj/machinery/computer/teleporter/proc/is_eligible(atom/movable/AM)
var/turf/T = get_turf(AM)

View File

@@ -80,10 +80,8 @@
return ..()
/obj/machinery/jukebox/update_icon_state()
if(active)
icon_state = "[initial(icon_state)]-active"
else
icon_state = "[initial(icon_state)]"
icon_state = "[initial(icon_state)]-[active ? "active" : null]"
return ..()
/obj/machinery/jukebox/ui_status(mob/user)
if(!anchored)
@@ -176,7 +174,7 @@
/obj/machinery/jukebox/proc/activate_music()
active = TRUE
update_icon()
update_appearance()
START_PROCESSING(SSobj, src)
stop = world.time + selection.song_length
@@ -471,7 +469,7 @@
STOP_PROCESSING(SSobj, src)
dance_over()
playsound(src,'sound/machines/terminal_off.ogg',50,TRUE)
update_icon()
update_appearance()
stop = world.time + 100
/obj/machinery/jukebox/disco/process()

View File

@@ -95,7 +95,7 @@
// Make sure the defib is set before processing begins.
defib = I
begin_processing()
update_icon()
update_appearance()
return
else if(defib && I == defib.paddles)
defib.paddles.snap_back()
@@ -108,7 +108,7 @@
return
clamps_locked = !clamps_locked
to_chat(user, "<span class='notice'>Clamps [clamps_locked ? "" : "dis"]engaged.</span>")
update_icon()
update_appearance()
else
to_chat(user, "<span class='warning'>Insufficient access.</span>")
return
@@ -131,7 +131,7 @@
"<span class='notice'>You override the locking clamps on [src]!</span>")
playsound(src, 'sound/machines/locktoggle.ogg', 50, TRUE)
clamps_locked = FALSE
update_icon()
update_appearance()
return TRUE
/obj/machinery/defibrillator_mount/wrench_act(mob/living/user, obj/item/wrench/W)
@@ -169,7 +169,7 @@
// Make sure processing ends before the defib is nulled
end_processing()
defib = null
update_icon()
update_appearance()
/obj/machinery/defibrillator_mount/charging
name = "PENLITE defibrillator mount"
@@ -200,7 +200,7 @@
if(C.charge < C.maxcharge)
use_power(50 * delta_time)
C.give(40 * delta_time)
update_icon()
update_appearance()
//wallframe, for attaching the mounts easily
/obj/item/wallframe/defib_mount

View File

@@ -132,7 +132,7 @@
playsound(src, 'sound/items/pshoom.ogg', 50, TRUE)
playsound(bin, 'sound/items/pshoom.ogg', 50, TRUE)
Beam(bin, icon_state = "rped_upgrade", time = 5)
bin.update_icon()
bin.update_appearance()
flick("synthesizer_beam", src)
else
visible_message("<span class='notice'>There are no disposable items in [src]!</span>")

View File

@@ -3,6 +3,7 @@
desc = "It scans DNA structures."
icon = 'icons/obj/machines/cloning.dmi'
icon_state = "scanner"
base_icon_state = "scanner"
density = TRUE
use_power = IDLE_POWER_USE
idle_power_usage = 50
@@ -36,20 +37,21 @@
/obj/machinery/dna_scannernew/update_icon_state()
//no power or maintenance
if(machine_stat & (NOPOWER|BROKEN))
icon_state = initial(icon_state)+ (state_open ? "_open" : "") + "_unpowered"
return
icon_state = "[base_icon_state][state_open ? "_open" : null]_unpowered"
return ..()
if((machine_stat & MAINT) || panel_open)
icon_state = initial(icon_state)+ (state_open ? "_open" : "") + "_maintenance"
return
icon_state = "[base_icon_state][state_open ? "_open" : null]_maintenance"
return ..()
//running and someone in there
if(occupant)
icon_state = initial(icon_state)+ "_occupied"
return
icon_state = "[base_icon_state]_occupied"
return ..()
//running
icon_state = initial(icon_state)+ (state_open ? "_open" : "")
icon_state = "[base_icon_state][state_open ? "_open" : null]"
return ..()
/obj/machinery/dna_scannernew/proc/toggle_open(mob/user)
if(panel_open)
@@ -125,7 +127,7 @@
/obj/machinery/dna_scannernew/attackby(obj/item/I, mob/user, params)
if(!occupant && default_deconstruction_screwdriver(user, icon_state, icon_state, I))//sent icon_state is irrelevant...
update_icon()//..since we're updating the icon here, since the scanner can be unpowered when opened/closed
update_appearance()//..since we're updating the icon here, since the scanner can be unpowered when opened/closed
return
if(default_pry_open(I))

View File

@@ -172,7 +172,7 @@
panel_open = TRUE
if(cutAiWire)
wires.cut(WIRE_AI)
update_icon()
update_appearance()
/obj/machinery/door/airlock/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock)
@@ -258,7 +258,7 @@
return
emergency = !emergency
update_icon()
update_appearance()
/obj/machinery/door/airlock/lock()
bolt()
@@ -269,7 +269,7 @@
locked = TRUE
playsound(src,boltDown,30,FALSE,3)
audible_message("<span class='hear'>You hear a click from the bottom of the door.</span>", null, 1)
update_icon()
update_appearance()
/obj/machinery/door/airlock/unlock()
unbolt()
@@ -280,7 +280,7 @@
locked = FALSE
playsound(src,boltUp,30,FALSE,3)
audible_message("<span class='hear'>You hear a click from the bottom of the door.</span>", null, 1)
update_icon()
update_appearance()
/obj/machinery/door/airlock/narsie_act()
var/turf/T = get_turf(src)
@@ -321,10 +321,10 @@
/obj/machinery/door/airlock/handle_atom_del(atom/A)
if(A == note)
note = null
update_icon()
update_appearance()
if(A == seal)
seal = null
update_icon()
update_appearance()
/obj/machinery/door/airlock/bumpopen(mob/living/user) //Airlocks now zap you when you 'bump' them open when they're electrified. --NeoFite
if(!issilicon(usr))
@@ -365,7 +365,7 @@
/obj/machinery/door/airlock/proc/regainMainPower()
if(secondsMainPowerLost > 0)
secondsMainPowerLost = 0
update_icon()
update_appearance()
/obj/machinery/door/airlock/proc/handlePowerRestore()
var/cont = TRUE
@@ -386,7 +386,7 @@
cont = TRUE
spawnPowerRestoreRunning = FALSE
updateDialog()
update_icon()
update_appearance()
/obj/machinery/door/airlock/proc/loseMainPower()
if(secondsMainPowerLost <= 0)
@@ -396,7 +396,7 @@
if(!spawnPowerRestoreRunning)
spawnPowerRestoreRunning = TRUE
INVOKE_ASYNC(src, .proc/handlePowerRestore)
update_icon()
update_appearance()
/obj/machinery/door/airlock/proc/loseBackupPower()
if(secondsBackupPowerLost < 60)
@@ -404,12 +404,12 @@
if(!spawnPowerRestoreRunning)
spawnPowerRestoreRunning = TRUE
INVOKE_ASYNC(src, .proc/handlePowerRestore)
update_icon()
update_appearance()
/obj/machinery/door/airlock/proc/regainBackupPower()
if(secondsBackupPowerLost > 0)
secondsBackupPowerLost = 0
update_icon()
update_appearance()
// shock user with probability prb (if all connections & power are working)
// returns TRUE if shocked, FALSE otherwise
@@ -429,23 +429,32 @@
else
return FALSE
/obj/machinery/door/airlock/update_icon(state=0, override=0)
/obj/machinery/door/airlock/update_icon(updates=ALL, state=0, override=FALSE)
if(operating && !override)
return
switch(state)
if(0)
if(density)
state = AIRLOCK_CLOSED
else
state = AIRLOCK_OPEN
icon_state = ""
if(!state)
state = density ? AIRLOCK_CLOSED : AIRLOCK_OPEN
airlock_state = state
. = ..()
if(hasPower() && unres_sides)
set_light(2, 1)
else
set_light(0)
/obj/machinery/door/airlock/update_icon_state()
. = ..()
switch(airlock_state)
if(AIRLOCK_OPEN, AIRLOCK_CLOSED)
icon_state = ""
if(AIRLOCK_DENY, AIRLOCK_OPENING, AIRLOCK_CLOSING, AIRLOCK_EMAG)
icon_state = "nonexistenticonstate" //MADNESS
set_airlock_overlays(state)
/obj/machinery/door/airlock/proc/set_airlock_overlays(state)
/obj/machinery/door/airlock/update_overlays()
. = ..()
var/mutable_appearance/frame_overlay
var/mutable_appearance/filling_overlay
var/mutable_appearance/lights_overlay
@@ -456,8 +465,7 @@
var/mutable_appearance/note_overlay
var/mutable_appearance/seal_overlay
var/notetype = note_type()
switch(state)
switch(airlock_state)
if(AIRLOCK_CLOSED)
frame_overlay = get_airlock_overlay("closed", icon)
if(airlock_material)
@@ -581,54 +589,45 @@
if(note)
note_overlay = get_airlock_overlay("[notetype]_opening", note_overlay_file)
cut_overlays()
add_overlay(frame_overlay)
add_overlay(filling_overlay)
add_overlay(lights_overlay)
add_overlay(panel_overlay)
add_overlay(weld_overlay)
add_overlay(sparks_overlay)
add_overlay(damag_overlay)
add_overlay(note_overlay)
add_overlay(seal_overlay)
check_unres()
. += frame_overlay
. += filling_overlay
. += lights_overlay
. += panel_overlay
. += weld_overlay
. += sparks_overlay
. += damag_overlay
. += note_overlay
. += seal_overlay
/obj/machinery/door/airlock/proc/check_unres() //unrestricted sides. This overlay indicates which directions the player can access even without an ID
if(hasPower() && unres_sides)
if(unres_sides & NORTH)
var/image/I = image(icon='icons/obj/doors/airlocks/station/overlays.dmi', icon_state="unres_n")
I.pixel_y = 32
set_light(l_range = 2, l_power = 1)
add_overlay(I)
. += I
if(unres_sides & SOUTH)
var/image/I = image(icon='icons/obj/doors/airlocks/station/overlays.dmi', icon_state="unres_s")
I.pixel_y = -32
set_light(l_range = 2, l_power = 1)
add_overlay(I)
. += I
if(unres_sides & EAST)
var/image/I = image(icon='icons/obj/doors/airlocks/station/overlays.dmi', icon_state="unres_e")
I.pixel_x = 32
set_light(l_range = 2, l_power = 1)
add_overlay(I)
. += I
if(unres_sides & WEST)
var/image/I = image(icon='icons/obj/doors/airlocks/station/overlays.dmi', icon_state="unres_w")
I.pixel_x = -32
set_light(l_range = 2, l_power = 1)
add_overlay(I)
else
set_light(0)
. += I
/obj/machinery/door/airlock/do_animate(animation)
switch(animation)
if("opening")
update_icon(AIRLOCK_OPENING)
update_icon(ALL, AIRLOCK_OPENING)
if("closing")
update_icon(AIRLOCK_CLOSING)
update_icon(ALL, AIRLOCK_CLOSING)
if("deny")
if(!machine_stat)
update_icon(AIRLOCK_DENY)
update_icon(ALL, AIRLOCK_DENY)
playsound(src,doorDeni,50,FALSE,3)
addtimer(CALLBACK(src, /atom/proc/update_icon, AIRLOCK_CLOSED), AIRLOCK_DENY_ANIMATION_TIME)
addtimer(CALLBACK(src, /atom/proc/update_icon, ALL, AIRLOCK_CLOSED), AIRLOCK_DENY_ANIMATION_TIME)
/obj/machinery/door/airlock/examine(mob/user)
. = ..()
@@ -822,7 +821,7 @@
user.visible_message("<span class='notice'>[user] reinforces \the [src] with iron.</span>",
"<span class='notice'>You reinforce \the [src] with iron.</span>")
security_level = AIRLOCK_SECURITY_IRON
update_icon()
update_appearance()
return
else if(istype(C, /obj/item/stack/sheet/plasteel))
var/obj/item/stack/sheet/plasteel/S = C
@@ -838,7 +837,7 @@
security_level = AIRLOCK_SECURITY_PLASTEEL
modify_max_integrity(max_integrity * AIRLOCK_INTEGRITY_MULTIPLIER)
damage_deflection = AIRLOCK_DAMAGE_DEFLECTION_R
update_icon()
update_appearance()
return
if(AIRLOCK_SECURITY_IRON)
if(C.tool_behaviour == TOOL_WELDER)
@@ -853,7 +852,7 @@
"<span class='hear'>You hear welding.</span>")
security_level = AIRLOCK_SECURITY_NONE
spawn_atom_to_turf(/obj/item/stack/sheet/iron, user.loc, 2)
update_icon()
update_appearance()
return
if(AIRLOCK_SECURITY_PLASTEEL_I_S)
if(C.tool_behaviour == TOOL_CROWBAR)
@@ -870,7 +869,7 @@
modify_max_integrity(max_integrity / AIRLOCK_INTEGRITY_MULTIPLIER)
damage_deflection = AIRLOCK_DAMAGE_DEFLECTION_N
spawn_atom_to_turf(/obj/item/stack/sheet/plasteel, user.loc, 1)
update_icon()
update_appearance()
return
if(AIRLOCK_SECURITY_PLASTEEL_I)
if(C.tool_behaviour == TOOL_WELDER)
@@ -930,13 +929,13 @@
panel_open = !panel_open
to_chat(user, "<span class='notice'>You [panel_open ? "open":"close"] the maintenance panel of the airlock.</span>")
C.play_tool_sound(src)
update_icon()
update_appearance()
else if((C.tool_behaviour == TOOL_WIRECUTTER) && note)
user.visible_message("<span class='notice'>[user] cuts down [note] from [src].</span>", "<span class='notice'>You remove [note] from [src].</span>")
C.play_tool_sound(src)
note.forceMove(get_turf(user))
note = null
update_icon()
update_appearance()
else if(is_wire_tool(C) && panel_open)
attempt_wire_interaction(user)
return
@@ -970,7 +969,7 @@
user.visible_message("<span class='notice'>[user] finishes sealing [src].</span>", "<span class='notice'>You finish sealing [src].</span>")
seal = airlockseal
modify_max_integrity(max_integrity * AIRLOCK_SEAL_MULTIPLIER)
update_icon()
update_appearance()
else if(istype(C, /obj/item/paper) || istype(C, /obj/item/photo))
if(note)
@@ -981,7 +980,7 @@
return
user.visible_message("<span class='notice'>[user] pins [C] to [src].</span>", "<span class='notice'>You pin [C] to [src].</span>")
note = C
update_icon()
update_appearance()
else
return ..()
@@ -1003,7 +1002,7 @@
set_machine_stat(machine_stat & ~BROKEN)
user.visible_message("<span class='notice'>[user] finishes welding [src].</span>", \
"<span class='notice'>You finish repairing the airlock.</span>")
update_icon()
update_appearance()
else
to_chat(user, "<span class='notice'>The airlock doesn't need repairing.</span>")
@@ -1019,7 +1018,7 @@
user.visible_message("<span class='notice'>[user] [welded? "welds shut":"unwelds"] [src].</span>", \
"<span class='notice'>You [welded ? "weld the airlock shut":"unweld the airlock"].</span>")
log_game("[key_name(user)] [welded ? "welded":"unwelded"] airlock [src] with [tool] at [AREACOORD(src)]")
update_icon()
update_appearance()
/obj/machinery/door/airlock/proc/weld_checks(obj/item/weldingtool/W, mob/user)
return !operating && density
@@ -1050,7 +1049,7 @@
user.visible_message("<span class='notice'>[user] finishes removing the seal from [src].</span>", "<span class='notice'>You finish removing [src]'s pneumatic seal.</span>")
seal = null
modify_max_integrity(max_integrity / AIRLOCK_SEAL_MULTIPLIER)
update_icon()
update_appearance()
return TRUE
@@ -1131,7 +1130,7 @@
return TRUE
SEND_SIGNAL(src, COMSIG_AIRLOCK_OPEN, forced)
operating = TRUE
update_icon(AIRLOCK_OPENING, 1)
update_icon(ALL, AIRLOCK_OPENING, TRUE)
sleep(1)
set_opacity(0)
update_freelook_sight()
@@ -1141,7 +1140,7 @@
air_update_turf(TRUE, FALSE)
sleep(1)
layer = OPEN_DOOR_LAYER
update_icon(AIRLOCK_OPEN, 1)
update_icon(ALL, AIRLOCK_OPEN, TRUE)
operating = FALSE
if(delayed_close_requested)
delayed_close_requested = FALSE
@@ -1178,7 +1177,7 @@
SSexplosions.med_mov_atom += killthis
SEND_SIGNAL(src, COMSIG_AIRLOCK_CLOSE, forced)
operating = TRUE
update_icon(AIRLOCK_CLOSING, 1)
update_icon(ALL, AIRLOCK_CLOSING, 1)
layer = CLOSED_DOOR_LAYER
if(air_tight)
density = TRUE
@@ -1196,7 +1195,7 @@
set_opacity(1)
update_freelook_sight()
sleep(1)
update_icon(AIRLOCK_CLOSED, 1)
update_icon(ALL, AIRLOCK_CLOSED, 1)
operating = FALSE
delayed_close_requested = FALSE
if(!dangerous_close)
@@ -1234,7 +1233,7 @@
icon = initial(airlock.icon)
overlays_file = initial(airlock.overlays_file)
assemblytype = initial(airlock.assemblytype)
update_icon()
update_appearance()
/obj/machinery/door/airlock/CanAStarPass(obj/item/card/id/ID)
//Airlock is passable if it is open (!density), bot has access, and is not bolted shut or powered off)
@@ -1245,13 +1244,13 @@
if(istype(D, /obj/item/card/emag/doorjack))
D.use_charge(user)
operating = TRUE
update_icon(AIRLOCK_EMAG, 1)
update_icon(ALL, AIRLOCK_EMAG, 1)
sleep(6)
if(QDELETED(src))
return
operating = FALSE
if(!open())
update_icon(AIRLOCK_CLOSED, 1)
update_icon(ALL, AIRLOCK_CLOSED, 1)
obj_flags |= EMAGGED
lights = FALSE
locked = TRUE
@@ -1335,7 +1334,7 @@
flags_1 |= NODECONSTRUCT_1 //If an explosive took us out, don't drop the assembly
. = ..()
if(obj_integrity < (0.75 * max_integrity))
update_icon()
update_appearance()
/obj/machinery/door/airlock/deconstruct(disassembled = TRUE, mob/user)
@@ -1353,7 +1352,7 @@
A.created_name = name
A.previous_assembly = previous_airlock
A.update_name()
A.update_icon()
A.update_appearance()
if(!disassembled)
if(A)
@@ -1462,14 +1461,14 @@
if("disrupt-main")
if(!secondsMainPowerLost)
loseMainPower()
update_icon()
update_appearance()
else
to_chat(usr, "<span class='warning'>Main power is already offline.</span>")
. = TRUE
if("disrupt-backup")
if(!secondsBackupPowerLost)
loseBackupPower()
update_icon()
update_appearance()
else
to_chat(usr, "<span class='warning'>Backup power is already offline.</span>")
. = TRUE
@@ -1493,7 +1492,7 @@
. = TRUE
if("light-toggle")
lights = !lights
update_icon()
update_appearance()
. = TRUE
if("safe-toggle")
safe = !safe
@@ -1552,7 +1551,7 @@
if(!user_allowed(user))
return
emergency = !emergency
update_icon()
update_appearance()
/obj/machinery/door/airlock/proc/user_toggle_open(mob/user)
if(!user_allowed(user))

View File

@@ -232,7 +232,7 @@
DA.glass = TRUE
if(heat_proof)
DA.heat_proof_finished = TRUE
DA.update_icon()
DA.update_appearance()
DA.update_name()
qdel(src)
@@ -500,7 +500,7 @@
name = "airlock"
desc = "It opens and closes."
stealthy = TRUE
update_icon()
update_appearance()
/obj/machinery/door/airlock/cult/proc/reveal()
icon = initial(icon)
@@ -508,7 +508,7 @@
name = initial(name)
desc = initial(desc)
stealthy = initial(stealthy)
update_icon()
update_appearance()
/obj/machinery/door/airlock/cult/narsie_act()
return

View File

@@ -61,7 +61,7 @@
if(!targets.len)
obj_break()
update_icon()
update_appearance()
//Main door timer loop, if it's timing and time is >0 reduce time by 1.
@@ -74,7 +74,7 @@
if(timing)
if(world.time - activation_time >= timer_duration)
timer_end() // open doors, reset timer, clear status screen
update_icon()
update_appearance()
// open/closedoor checks if door_timer has power, if so it checks if the
// linked door is open/closed (by density) then opens it/closes it.
@@ -96,7 +96,7 @@
if(C.opened && !C.close())
continue
C.locked = TRUE
C.update_icon()
C.update_appearance()
return 1
@@ -112,7 +112,7 @@
timing = FALSE
activation_time = null
set_timer(0)
update_icon()
update_appearance()
for(var/obj/machinery/door/window/brigdoor/door in targets)
if(!door.density)
@@ -125,7 +125,7 @@
if(C.opened)
continue
C.locked = FALSE
C.update_icon()
C.update_appearance()
return 1
@@ -151,8 +151,8 @@
// if BROKEN, display blue screen of death icon AI uses
// if timing=true, run update display function
/obj/machinery/door_timer/update_icon()
. = ..()
if(machine_stat & (NOPOWER))
icon_state = "frame"
return
if(machine_stat & (BROKEN))

View File

@@ -4,6 +4,7 @@
desc = "It opens and closes."
icon = 'icons/obj/doors/Doorint.dmi'
icon_state = "door1"
base_icon_state = "door"
opacity = TRUE
density = TRUE
move_resist = MOVE_FORCE_VERY_STRONG
@@ -277,10 +278,8 @@
secondsElectrified = MACHINE_NOT_ELECTRIFIED
/obj/machinery/door/update_icon_state()
if(density)
icon_state = "door1"
else
icon_state = "door0"
icon_state = "[base_icon_state][density]"
return ..()
/obj/machinery/door/proc/do_animate(animation)
switch(animation)
@@ -312,7 +311,7 @@
flags_1 &= ~PREVENT_CLICK_UNDER_1
sleep(5)
layer = initial(layer)
update_icon()
update_appearance()
set_opacity(0)
operating = FALSE
air_update_turf(TRUE, FALSE)
@@ -341,7 +340,7 @@
density = TRUE
flags_1 |= PREVENT_CLICK_UNDER_1
sleep(5)
update_icon()
update_appearance()
if(visible && !glass)
set_opacity(1)
operating = FALSE

View File

@@ -128,7 +128,7 @@
welded = !welded
to_chat(user, "<span class='danger'>[user] [welded?"welds":"unwelds"] [src].</span>", "<span class='notice'>You [welded ? "weld" : "unweld"] [src].</span>")
log_game("[key_name(user)] [welded ? "welded":"unwelded"] firedoor [src] with [W] at [AREACOORD(src)]")
update_icon()
update_appearance()
/obj/machinery/door/firedoor/try_to_crowbar(obj/item/I, mob/user)
if(welded || operating)
@@ -167,19 +167,14 @@
flick("door_closing", src)
/obj/machinery/door/firedoor/update_icon_state()
if(density)
icon_state = "door_closed"
else
icon_state = "door_open"
. = ..()
icon_state = "[base_icon_state]_[density ? "closed" : "open"]"
/obj/machinery/door/firedoor/update_overlays()
. = ..()
if(!welded)
return
if(density)
. += "welded"
else
. += "welded_open"
. += density ? "welded" : "welded_open"
/obj/machinery/door/firedoor/open()
. = ..()
@@ -199,7 +194,7 @@
else
F.constructionStep = CONSTRUCTION_NO_CIRCUIT
F.obj_integrity = F.max_integrity * 0.5
F.update_icon()
F.update_appearance()
else
new /obj/item/electronics/firelock (T)
qdel(src)
@@ -263,6 +258,7 @@
desc = "A partially completed firelock."
icon = 'icons/obj/doors/Doorfire.dmi'
icon_state = "frame1"
base_icon_state = "frame"
anchored = FALSE
density = TRUE
var/constructionStep = CONSTRUCTION_NO_CIRCUIT
@@ -279,7 +275,8 @@
. += "<span class='notice'>There are no <i>firelock electronics</i> in the frame. The frame could be <b>welded</b> apart .</span>"
/obj/structure/firelock_frame/update_icon_state()
icon_state = "frame[constructionStep]"
icon_state = "[base_icon_state][constructionStep]"
return ..()
/obj/structure/firelock_frame/attackby(obj/item/C, mob/user)
switch(constructionStep)
@@ -297,7 +294,7 @@
"<span class='notice'>You remove the circuit board from [src].</span>")
new /obj/item/electronics/firelock(drop_location())
constructionStep = CONSTRUCTION_NO_CIRCUIT
update_icon()
update_appearance()
return
if(C.tool_behaviour == TOOL_WRENCH)
if(locate(/obj/machinery/door/firedoor) in get_turf(src))
@@ -378,7 +375,7 @@
user.visible_message("<span class='notice'>[user] fabricates a circuit and places it into [src].</span>", \
"<span class='notice'>You adapt a firelock circuit and slot it into the assembly.</span>")
constructionStep = CONSTRUCTION_PANEL_OPEN
update_icon()
update_appearance()
return
return ..()
@@ -395,7 +392,7 @@
user.visible_message("<span class='notice'>[user] fabricates a circuit and places it into [src].</span>", \
"<span class='notice'>You adapt a firelock circuit and slot it into the assembly.</span>")
constructionStep = CONSTRUCTION_PANEL_OPEN
update_icon()
update_appearance()
return TRUE
if(RCD_DECONSTRUCT)
to_chat(user, "<span class='notice'>You deconstruct [src].</span>")

View File

@@ -43,10 +43,8 @@
do_animate("deny")
/obj/machinery/door/password/update_icon_state()
if(density)
icon_state = "closed"
else
icon_state = "open"
. = ..()
icon_state = density ? "closed" : "open"
/obj/machinery/door/password/do_animate(animation)
switch(animation)

View File

@@ -155,10 +155,8 @@
playsound(src, 'sound/machines/blastdoor.ogg', 30, TRUE)
/obj/machinery/door/poddoor/update_icon_state()
if(density)
icon_state = "closed"
else
icon_state = "open"
. = ..()
icon_state = density ? "closed" : "open"
/obj/machinery/door/poddoor/try_to_activate_door(mob/user)
return

View File

@@ -58,10 +58,8 @@
return ..()
/obj/machinery/door/window/update_icon_state()
if(density)
icon_state = base_state
else
icon_state = "[base_state]open"
. = ..()
icon_state = "[base_state][density ? null : "open"]"
/obj/machinery/door/window/proc/open_and_close()
if(!open())
@@ -260,7 +258,7 @@
WA.set_anchored(TRUE)
WA.state= "02"
WA.setDir(dir)
WA.update_icon()
WA.update_appearance()
WA.created_name = name
if(obj_flags & EMAGGED)

View File

@@ -5,6 +5,7 @@
desc = "A highly precise directional sensor array which measures the release of quants from decaying tachyons. The doppler shifting of the mirror-image formed by these quants can reveal the size, location and temporal affects of energetic disturbances within a large radius ahead of the array.\n"
icon = 'icons/obj/machines/research.dmi'
icon_state = "tdoppler"
base_icon_state = "tdoppler"
density = TRUE
verb_say = "states coldly"
var/cooldown = 10
@@ -111,7 +112,7 @@
<li>Theoretical Outer Radius: [record.theory_radius["outer_radius"]]</li>
<li>Theoretical Shockwave Radius: [record.theory_radius["shockwave_radius"]]</li></ul>"}
update_icon()
update_appearance()
/obj/machinery/doppler_array/attackby(obj/item/I, mob/user, params)
if(I.tool_behaviour == TOOL_WRENCH)
@@ -186,11 +187,10 @@
/obj/machinery/doppler_array/update_icon_state()
if(machine_stat & BROKEN)
icon_state = "[initial(icon_state)]-broken"
else if(powered())
icon_state = initial(icon_state)
else
icon_state = "[initial(icon_state)]-off"
icon_state = "[base_icon_state]-broken"
return ..()
icon_state = "[base_icon_state][powered() ? null : "-off"]"
return ..()
/obj/machinery/doppler_array/research
name = "tachyon-doppler research array"

View File

@@ -146,7 +146,7 @@
playsound(src, work_sound, 50, TRUE)
mode = DRONE_PRODUCTION
timer = world.time + production_time
update_icon()
update_appearance()
if(DRONE_PRODUCTION)
materials.use_materials(using_materials)
@@ -163,7 +163,7 @@
mode = DRONE_RECHARGING
timer = world.time + cooldownTime
update_icon()
update_appearance()
if(DRONE_RECHARGING)
if(recharge_sound)
@@ -172,7 +172,7 @@
visible_message("<span class='notice'>[src] [recharge_message]</span>")
mode = DRONE_READY
update_icon()
update_appearance()
/obj/machinery/drone_dispenser/proc/count_shells()
. = 0
@@ -183,12 +183,15 @@
/obj/machinery/drone_dispenser/update_icon_state()
if(machine_stat & (BROKEN|NOPOWER))
icon_state = icon_off
else if(mode == DRONE_RECHARGING)
return ..()
if(mode == DRONE_RECHARGING)
icon_state = icon_recharging
else if(mode == DRONE_PRODUCTION)
return ..()
if(mode == DRONE_PRODUCTION)
icon_state = icon_creating
else
icon_state = icon_on
return ..()
icon_state = icon_on
return ..()
/obj/machinery/drone_dispenser/attackby(obj/item/I, mob/living/user)
if(I.tool_behaviour == TOOL_CROWBAR)
@@ -218,7 +221,7 @@
set_machine_stat(machine_stat & ~BROKEN)
obj_integrity = max_integrity
update_icon()
update_appearance()
else
return ..()

View File

@@ -32,7 +32,7 @@
. = ..()
if(ispath(cell))
cell = new cell(src)
update_icon()
update_appearance()
/obj/machinery/electrolyzer/Destroy()
if(cell)
@@ -56,10 +56,10 @@
/obj/machinery/electrolyzer/update_icon_state()
icon_state = "electrolyzer-[on ? "[mode]" : "off"]"
return ..()
/obj/machinery/electrolyzer/update_overlays()
. = ..()
if(panel_open)
. += "electrolyzer-open"
@@ -71,21 +71,21 @@
if(!cell || cell.charge <= 0)
on = FALSE
update_icon()
update_appearance()
return PROCESS_KILL
var/turf/L = loc
if(!istype(L))
if(mode != ELECTROLYZER_MODE_STANDBY)
mode = ELECTROLYZER_MODE_STANDBY
update_icon()
update_appearance()
return
var/newMode = on ? ELECTROLYZER_MODE_WORKING : ELECTROLYZER_MODE_STANDBY //change the mode to working if the machine is on
if(mode != newMode) //check if the mode is set correctly
mode = newMode
update_icon()
update_appearance()
if(mode == ELECTROLYZER_MODE_STANDBY)
return
@@ -140,7 +140,7 @@
if(I.tool_behaviour == TOOL_SCREWDRIVER)
panel_open = !panel_open
user.visible_message("<span class='notice'>\The [user] [panel_open ? "opens" : "closes"] the hatch on \the [src].</span>", "<span class='notice'>You [panel_open ? "open" : "close"] the hatch on \the [src].</span>")
update_icon()
update_appearance()
return
if(default_deconstruction_crowbar(I))
return
@@ -173,7 +173,7 @@
on = !on
mode = ELECTROLYZER_MODE_STANDBY
usr.visible_message("<span class='notice'>[usr] switches [on ? "on" : "off"] \the [src].</span>", "<span class='notice'>You switch [on ? "on" : "off"] \the [src].</span>")
update_icon()
update_appearance()
if (on)
START_PROCESSING(SSmachines, src)
. = TRUE

View File

@@ -40,6 +40,7 @@
/obj/machinery/door_buttons/access_button
icon = 'icons/obj/airlock_machines.dmi'
icon_state = "access_button_standby"
base_icon_state = "access_button"
name = "access button"
desc = "A button used for the explicit purpose of opening an airlock."
var/idDoor
@@ -67,7 +68,7 @@
if(controller.machine_stat & NOPOWER)
return
busy = TRUE
update_icon()
update_appearance()
if(door.density)
if(!controller.exteriorAirlock || !controller.interiorAirlock)
controller.onlyOpen(door)
@@ -82,16 +83,14 @@
/obj/machinery/door_buttons/access_button/proc/not_busy()
busy = FALSE
update_icon()
update_appearance()
/obj/machinery/door_buttons/access_button/update_icon_state()
if(machine_stat & NOPOWER)
icon_state = "access_button_off"
else
if(busy)
icon_state = "access_button_cycle"
else
icon_state = "access_button_standby"
icon_state = "[base_icon_state]_off"
return ..()
icon_state = "[base_icon_state]_[busy ? "cycle" : "standby"]"
return ..()
/obj/machinery/door_buttons/access_button/removeMe(obj/O)
if(O == door)
@@ -102,6 +101,7 @@
/obj/machinery/door_buttons/airlock_controller
icon = 'icons/obj/airlock_machines.dmi'
icon_state = "access_control_standby"
base_icon_state = "access_control"
name = "access console"
desc = "A small console that can cycle opening between two airlocks."
var/obj/machinery/door/airlock/interiorAirlock
@@ -148,7 +148,7 @@
/obj/machinery/door_buttons/airlock_controller/proc/onlyOpen(obj/machinery/door/airlock/A)
if(A)
busy = CLOSING
update_icon()
update_appearance()
openDoor(A)
/obj/machinery/door_buttons/airlock_controller/proc/onlyClose(obj/machinery/door/airlock/A)
@@ -160,7 +160,7 @@
if(A.density)
goIdle()
return FALSE
update_icon()
update_appearance()
A.safe = FALSE //Door crushies, manual door after all. Set every time in case someone changed it, safe doors can end up waiting forever.
A.unbolt()
if(A.close())
@@ -179,7 +179,7 @@
if(exteriorAirlock.density == interiorAirlock.density || !A.density)
return
busy = CYCLE
update_icon()
update_appearance()
if(A == interiorAirlock)
if(closeDoor(exteriorAirlock))
busy = CYCLE_INTERIOR
@@ -219,7 +219,7 @@
lostPower = FALSE
busy = FALSE
if(update)
update_icon()
update_appearance()
updateUsrDialog()
/obj/machinery/door_buttons/airlock_controller/process()
@@ -248,11 +248,9 @@
/obj/machinery/door_buttons/airlock_controller/update_icon_state()
if(machine_stat & NOPOWER)
icon_state = "access_control_off"
return
if(busy || lostPower)
icon_state = "access_control_process"
else
icon_state = "access_control_standby"
return ..()
icon_state = "[base_icon_state]_[(busy || lostPower) ? "process" : "standby"]"
return ..()
/obj/machinery/door_buttons/airlock_controller/ui_interact(mob/user)
var/datum/browser/popup = new(user, "computer", name)

View File

@@ -196,6 +196,7 @@
/obj/machinery/embedded_controller/radio/airlock_controller
icon = 'icons/obj/airlock_machines.dmi'
icon_state = "airlock_control_standby"
base_icon_state = "airlock_control"
name = "airlock console"
density = FALSE
@@ -256,12 +257,10 @@
/obj/machinery/embedded_controller/radio/airlock_controller/update_icon_state()
if(on && program)
if(program.memory["processing"])
icon_state = "airlock_control_process"
else
icon_state = "airlock_control_standby"
else
icon_state = "airlock_control_off"
icon_state = "[base_icon_state]_[program.memory["processing"] ? "process" : "standby"]"
return ..()
icon_state = "[base_icon_state]_off"
return ..()
/obj/machinery/embedded_controller/radio/airlock_controller/return_text()

View File

@@ -57,7 +57,7 @@
if(program)
program.process(delta_time)
update_icon()
update_appearance()
src.updateDialog()
/obj/machinery/embedded_controller/radio

View File

@@ -55,10 +55,8 @@
program = new_prog
/obj/machinery/embedded_controller/radio/simple_vent_controller/update_icon_state()
if(on && program)
icon_state = "airlock_control_standby"
else
icon_state = "airlock_control_off"
icon_state = "[base_icon_state]_[(on && program) ? "standby" : "off"]"
return ..()
/obj/machinery/embedded_controller/radio/simple_vent_controller/return_text()

View File

@@ -30,7 +30,7 @@
/obj/machinery/fat_sucker/Initialize()
. = ..()
soundloop = new(list(src), FALSE)
update_icon()
update_appearance()
/obj/machinery/fat_sucker/RefreshParts()
..()
@@ -59,7 +59,7 @@
return
to_chat(occupant, "<span class='notice'>You enter [src].</span>")
addtimer(CALLBACK(src, .proc/start_extracting), 20, TIMER_OVERRIDE|TIMER_UNIQUE)
update_icon()
update_appearance()
/obj/machinery/fat_sucker/open_machine(mob/user)
make_meat()
@@ -159,7 +159,7 @@
if(C.nutrition > start_at)
processing = TRUE
soundloop.start()
update_icon()
update_appearance()
set_light(2, 1, "#ff0000")
else
say("Subject not fat enough.")
@@ -198,7 +198,7 @@
to_chat(user, "<span class='warning'>[src] must be closed to [panel_open ? "close" : "open"] its maintenance hatch!</span>")
return
if(default_deconstruction_screwdriver(user, icon_state, icon_state, I))
update_icon()
update_appearance()
return
return FALSE

View File

@@ -48,7 +48,7 @@
panel_open = TRUE
pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24)
pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0
update_icon()
update_appearance()
myarea = get_area(src)
LAZYADD(myarea.firealarms, src)
@@ -66,23 +66,19 @@
/obj/machinery/firealarm/update_icon_state()
if(panel_open)
icon_state = "fire_b[buildstage]"
return
return ..()
if(machine_stat & BROKEN)
icon_state = "firex"
return
return ..()
icon_state = "fire0"
return ..()
/obj/machinery/firealarm/update_overlays()
. = ..()
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
if(machine_stat & NOPOWER)
return
. += "fire_overlay"
if(is_station_level(z))
. += "fire_[GLOB.security_level]"
SSvis_overlays.add_vis_overlay(src, icon, "fire_[GLOB.security_level]", layer, plane, dir)
@@ -125,7 +121,7 @@
if(obj_flags & EMAGGED)
return
obj_flags |= EMAGGED
update_icon()
update_appearance()
if(user)
user.visible_message("<span class='warning'>Sparks fly out of [src]!</span>",
"<span class='notice'>You emag [src], disabling its thermal sensors.</span>")
@@ -140,7 +136,7 @@
if(!triggered)
triggered = TRUE
myarea.triggered_firealarms += 1
update_icon()
update_appearance()
alarm()
/obj/machinery/firealarm/atmos_end(datum/gas_mixture/air, exposed_temperature)
@@ -149,7 +145,7 @@
if(triggered)
triggered = FALSE
myarea.triggered_firealarms -= 1
update_icon()
update_appearance()
/obj/machinery/firealarm/proc/alarm(mob/user)
if(!is_operational || !COOLDOWN_FINISHED(src, last_alarm))
@@ -192,7 +188,7 @@
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
if(panel_open)
@@ -225,7 +221,7 @@
W.play_tool_sound(src)
new /obj/item/stack/cable_coil(user.loc, 5)
to_chat(user, "<span class='notice'>You cut the wires from \the [src].</span>")
update_icon()
update_appearance()
return
else if(W.force) //hit and turn it on
@@ -244,7 +240,7 @@
coil.use(5)
buildstage = 2
to_chat(user, "<span class='notice'>You wire \the [src].</span>")
update_icon()
update_appearance()
return
else if(W.tool_behaviour == TOOL_CROWBAR)
@@ -259,14 +255,14 @@
to_chat(user, "<span class='notice'>You pry out the circuit.</span>")
new /obj/item/electronics/firealarm(user.loc)
buildstage = 0
update_icon()
update_appearance()
return
if(0)
if(istype(W, /obj/item/electronics/firealarm))
to_chat(user, "<span class='notice'>You insert the circuit.</span>")
qdel(W)
buildstage = 1
update_icon()
update_appearance()
return
else if(istype(W, /obj/item/electroadaptive_pseudocircuit))
@@ -276,7 +272,7 @@
user.visible_message("<span class='notice'>[user] fabricates a circuit and places it into [src].</span>", \
"<span class='notice'>You adapt a fire alarm circuit and slot it into the assembly.</span>")
buildstage = 1
update_icon()
update_appearance()
return
else if(W.tool_behaviour == TOOL_WRENCH)
@@ -301,7 +297,7 @@
user.visible_message("<span class='notice'>[user] fabricates a circuit and places it into [src].</span>", \
"<span class='notice'>You adapt a fire alarm circuit and slot it into the assembly.</span>")
buildstage = 1
update_icon()
update_appearance()
return TRUE
return FALSE

View File

@@ -5,6 +5,7 @@
desc = "A wall-mounted flashbulb device."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "mflash1"
base_icon_state = "mflash"
max_integrity = 250
integrity_failure = 0.4
light_color = COLOR_WHITE
@@ -15,15 +16,14 @@
var/range = 2 //this is roughly the size of brig cell
var/last_flash = 0 //Don't want it getting spammed like regular flashes
var/strength = 100 //How knocked down targets are when flashed.
var/base_state = "mflash"
/obj/machinery/flasher/portable //Portable version of the flasher. Only flashes when anchored
name = "portable flasher"
desc = "A portable flashing device. Wrench to activate and deactivate. Cannot detect slow movements."
icon_state = "pflash1-p"
base_icon_state = "pflash"
strength = 80
anchored = FALSE
base_state = "pflash"
density = TRUE
light_system = MOVABLE_LIGHT //Used as a flash here.
light_range = FLASH_LIGHT_RANGE
@@ -52,13 +52,8 @@
return ..()
/obj/machinery/flasher/update_icon_state()
if (powered())
if(bulb.burnt_out)
icon_state = "[base_state]1-p"
else
icon_state = "[base_state]1"
else
icon_state = "[base_state]1-p"
icon_state = "[base_icon_state]1[(bulb?.burnt_out || !powered()) ? "-p" : null]"
return ..()
//Don't want to render prison breaks impossible
/obj/machinery/flasher/attackby(obj/item/W, mob/user, params)
@@ -110,7 +105,7 @@
return
playsound(src.loc, 'sound/weapons/flash.ogg', 100, TRUE)
flick("[base_state]_flash", src)
flick("[base_icon_state]_flash", src)
set_light_on(TRUE)
addtimer(CALLBACK(src, .proc/flash_end), FLASH_LIGHT_DURATION, TIMER_OVERRIDE|TIMER_UNIQUE)
@@ -184,7 +179,7 @@
if (!anchored && !isinspace())
to_chat(user, "<span class='notice'>[src] is now secured.</span>")
add_overlay("[base_state]-s")
add_overlay("[base_icon_state]-s")
set_anchored(TRUE)
power_change()
proximity_monitor.SetRange(range)

View File

@@ -11,6 +11,7 @@ The console is located at computer/gulag_teleporter.dm
desc = "A bluespace teleporter used for teleporting prisoners to the labor camp."
icon = 'icons/obj/machines/implantchair.dmi'
icon_state = "implantchair"
base_icon_state = "implantchair"
state_open = FALSE
density = TRUE
use_power = IDLE_POWER_USE
@@ -56,7 +57,7 @@ The console is located at computer/gulag_teleporter.dm
/obj/machinery/gulag_teleporter/attackby(obj/item/I, mob/user)
if(!occupant && default_deconstruction_screwdriver(user, "[icon_state]", "[icon_state]",I))
update_icon()
update_appearance()
return
if(default_deconstruction_crowbar(I))
@@ -68,22 +69,22 @@ The console is located at computer/gulag_teleporter.dm
return ..()
/obj/machinery/gulag_teleporter/update_icon_state()
icon_state = initial(icon_state) + (state_open ? "_open" : "")
icon_state = "[base_icon_state][state_open ? "_open" : null]"
//no power or maintenance
if(machine_stat & (NOPOWER|BROKEN))
icon_state += "_unpowered"
if((machine_stat & MAINT) || panel_open)
icon_state += "_maintenance"
return
return ..()
if((machine_stat & MAINT) || panel_open)
icon_state += "_maintenance"
return
return ..()
//running and someone in there
if(occupant)
icon_state += "_occupied"
return
return ..()
/obj/machinery/gulag_teleporter/relaymove(mob/living/user, direction)

View File

@@ -4,6 +4,7 @@
density = TRUE
icon = 'icons/obj/machines/harvester.dmi'
icon_state = "harvester"
base_icon_state = "harvester"
verb_say = "states"
state_open = FALSE
idle_power_usage = 50
@@ -30,13 +31,16 @@
/obj/machinery/harvester/update_icon_state()
if(state_open)
icon_state = initial(icon_state)+"-open"
else if(warming_up)
icon_state = initial(icon_state)+"-charging"
else if(harvesting)
icon_state = initial(icon_state)+"-active"
else
icon_state = initial(icon_state)
icon_state = "[base_icon_state]-open"
return ..()
if(warming_up)
icon_state = "[base_icon_state]-charging"
return ..()
if(harvesting)
icon_state = "[base_icon_state]-active"
return ..()
icon_state = base_icon_state
return ..()
/obj/machinery/harvester/open_machine(drop = TRUE)
if(panel_open)
@@ -89,12 +93,12 @@
harvesting = TRUE
visible_message("<span class='notice'>The [name] begins warming up!</span>")
say("Initializing harvest protocol.")
update_icon()
update_appearance()
addtimer(CALLBACK(src, .proc/harvest), interval)
/obj/machinery/harvester/proc/harvest()
warming_up = FALSE
update_icon()
update_appearance()
if(!harvesting || state_open || !powered() || !occupant || !iscarbon(occupant))
return
playsound(src, 'sound/machines/juicer.ogg', 20, TRUE)

View File

@@ -31,6 +31,7 @@ Possible to do for anyone motivated enough:
name = "holopad"
desc = "It's a floor-mounted device for projecting holographic images."
icon_state = "holopad0"
base_icon_state = "holopad"
layer = LOW_OBJ_LAYER
plane = FLOOR_PLANE
flags_1 = HEAR_1
@@ -380,7 +381,7 @@ Possible to do for anyone motivated enough:
playsound(src, 'sound/machines/twobeep.ogg', 100) //bring, bring!
ringing = TRUE
update_icon()
update_appearance()
/obj/machinery/holopad/proc/activate_holo(mob/living/user)
var/mob/living/silicon/ai/AI = user
@@ -446,16 +447,15 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
set_light(2)
else
set_light(0)
update_icon()
update_appearance()
/obj/machinery/holopad/update_icon_state()
var/total_users = LAZYLEN(masters) + LAZYLEN(holo_calls)
if(ringing)
icon_state = "holopad_ringing"
else if(total_users || replay_mode)
icon_state = "holopad1"
else
icon_state = "holopad0"
icon_state = "[base_icon_state]_ringing"
return ..()
icon_state = "[base_icon_state][(total_users || replay_mode) ? 1 : 0]"
return ..()
/obj/machinery/holopad/proc/set_holo(mob/living/user, obj/effect/overlay/holo_pad_hologram/h)
LAZYSET(masters, user, h)

View File

@@ -3,6 +3,7 @@
desc = "A device used to perform \"enhanced interrogation\" through invasive mental conditioning."
icon = 'icons/obj/machines/implantchair.dmi'
icon_state = "hypnochair"
base_icon_state = "hypnochair"
circuit = /obj/item/circuitboard/machine/hypnochair
density = TRUE
opacity = FALSE
@@ -17,11 +18,11 @@
/obj/machinery/hypnochair/Initialize()
. = ..()
open_machine()
update_icon()
update_appearance()
/obj/machinery/hypnochair/attackby(obj/item/I, mob/user, params)
if(!occupant && default_deconstruction_screwdriver(user, icon_state, icon_state, I))
update_icon()
update_appearance()
return
if(default_pry_open(I))
return
@@ -97,7 +98,7 @@
interrogating = TRUE
START_PROCESSING(SSobj, src)
start_time = world.time
update_icon()
update_appearance()
timerid = addtimer(CALLBACK(src, .proc/finish_interrogation), 450, TIMER_STOPPABLE)
/obj/machinery/hypnochair/process(delta_time)
@@ -117,7 +118,7 @@
/obj/machinery/hypnochair/proc/finish_interrogation()
interrogating = FALSE
STOP_PROCESSING(SSobj, src)
update_icon()
update_appearance()
var/temp_trigger = trigger_phrase
trigger_phrase = "" //Erase evidence, in case the subject is able to look at the panel afterwards
audible_message("<span class='notice'>[src] pings!</span>")
@@ -140,7 +141,7 @@
deltimer(timerid)
interrogating = FALSE
STOP_PROCESSING(SSobj, src)
update_icon()
update_appearance()
if(QDELETED(victim))
victim = null
@@ -169,14 +170,8 @@
victim = null
/obj/machinery/hypnochair/update_icon_state()
icon_state = initial(icon_state)
if(state_open)
icon_state += "_open"
if(occupant)
if(interrogating)
icon_state += "_active"
else
icon_state += "_occupied"
icon_state = "[base_icon_state][state_open ? "_open" : null][occupant ? "_[interrogating ? "active" : "occupied"]" : null]"
return ..()
/obj/machinery/hypnochair/container_resist_act(mob/living/user)
user.changeNext_move(CLICK_CD_BREAKOUT)

View File

@@ -3,6 +3,7 @@
desc = "It's useful for igniting plasma."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "igniter0"
base_icon_state = "igniter"
plane = FLOOR_PLANE
use_power = IDLE_POWER_USE
idle_power_usage = 2
@@ -34,7 +35,7 @@
use_power(50)
on = !( on )
update_icon()
update_appearance()
/obj/machinery/igniter/process() //ugh why is this even in process()?
if (on && !(machine_stat & NOPOWER) )
@@ -48,10 +49,8 @@
icon_state = "igniter[on]"
/obj/machinery/igniter/update_icon_state()
if(machine_stat & NOPOWER)
icon_state = "igniter0"
else
icon_state = "igniter[on]"
icon_state = "[base_icon_state][(machine_stat & NOPOWER) ? 0 : on]"
return ..()
/obj/machinery/igniter/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock)
id = "[port.id]_[id]"
@@ -63,6 +62,7 @@
desc = "A wall-mounted ignition device."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "migniter"
base_icon_state = "migniter"
resistance_flags = FIRE_PROOF
var/id = null
var/disable = 0
@@ -84,11 +84,10 @@
/obj/machinery/sparker/update_icon_state()
if(disable)
icon_state = "[initial(icon_state)]-d"
else if(powered())
icon_state = "[initial(icon_state)]"
else
icon_state = "[initial(icon_state)]-p"
icon_state = "[base_icon_state]-d"
return ..()
icon_state = "[base_icon_state][powered() ? null : "-p"]"
return ..()
/obj/machinery/sparker/powered()
if(disable)
@@ -103,7 +102,7 @@
user.visible_message("<span class='notice'>[user] disables \the [src]!</span>", "<span class='notice'>You disable the connection to \the [src].</span>")
if (!disable)
user.visible_message("<span class='notice'>[user] reconnects \the [src]!</span>", "<span class='notice'>You fix the connection to \the [src].</span>")
update_icon()
update_appearance()
else
return ..()

View File

@@ -6,6 +6,7 @@
desc = "An IV drip with an advanced infusion pump that can both drain blood into and inject liquids from attached containers. Blood packs are processed at an accelerated rate. Right-Click to change the transfer rate."
icon = 'icons/obj/iv_drip.dmi'
icon_state = "iv_drip"
base_icon_state = "iv_drip"
anchored = FALSE
mouse_drag_pointer = MOUSE_ACTIVE_POINTER
///Who are we sticking our needle in?
@@ -26,7 +27,7 @@
/obj/machinery/iv_drip/Initialize(mapload)
. = ..()
update_icon()
update_appearance()
if(use_internal_storage)
create_reagents(100, TRANSPARENT)
@@ -36,51 +37,43 @@
return ..()
/obj/machinery/iv_drip/update_icon_state()
icon_state = initial(icon_state)
if(attached)
if(mode)
icon_state += "_injecting"
else
icon_state += "_donating"
icon_state = "[base_icon_state]_[mode ? "injecting" : "donating"]"
else
if(mode)
icon_state += "_injectidle"
else
icon_state += "_donateidle"
icon_state = "[base_icon_state]_[mode ? "injectidle" : "donateidle"]"
return ..()
/obj/machinery/iv_drip/update_overlays()
. = ..()
if(beaker)
if(attached)
. += "beakeractive"
else
. += "beakeridle"
if(!beaker)
return
var/datum/reagents/target_reagents = get_reagent_holder()
if(target_reagents)
var/mutable_appearance/filling_overlay = mutable_appearance('icons/obj/iv_drip.dmi', "reagent")
. += attached ? "beakeractive" : "beakeridle"
var/datum/reagents/target_reagents = get_reagent_holder()
if(!target_reagents)
return
var/percent = round((target_reagents.total_volume / target_reagents.maximum_volume) * 100)
switch(percent)
if(0 to 9)
filling_overlay.icon_state = "reagent0"
if(10 to 24)
filling_overlay.icon_state = "reagent10"
if(25 to 49)
filling_overlay.icon_state = "reagent25"
if(50 to 74)
filling_overlay.icon_state = "reagent50"
if(75 to 79)
filling_overlay.icon_state = "reagent75"
if(80 to 90)
filling_overlay.icon_state = "reagent80"
if(91 to INFINITY)
filling_overlay.icon_state = "reagent100"
var/mutable_appearance/filling_overlay = mutable_appearance('icons/obj/iv_drip.dmi', "reagent")
var/percent = round((target_reagents.total_volume / target_reagents.maximum_volume) * 100)
switch(percent)
if(0 to 9)
filling_overlay.icon_state = "reagent0"
if(10 to 24)
filling_overlay.icon_state = "reagent10"
if(25 to 49)
filling_overlay.icon_state = "reagent25"
if(50 to 74)
filling_overlay.icon_state = "reagent50"
if(75 to 79)
filling_overlay.icon_state = "reagent75"
if(80 to 90)
filling_overlay.icon_state = "reagent80"
if(91 to INFINITY)
filling_overlay.icon_state = "reagent100"
filling_overlay.color = mix_color_from_reagents(target_reagents.reagent_list)
. += filling_overlay
filling_overlay.color = mix_color_from_reagents(target_reagents.reagent_list)
. += filling_overlay
/obj/machinery/iv_drip/MouseDrop(mob/living/target)
. = ..()
@@ -90,7 +83,7 @@
if(attached)
visible_message("<span class='warning'>[attached] is detached from [src].</span>")
attached = null
update_icon()
update_appearance()
return
if(!target.has_dna())
@@ -118,7 +111,7 @@
to_chat(user, "<span class='notice'>You attach [W] to [src].</span>")
user.log_message("attached a [W] to [src] at [AREACOORD(src)] containing ([beaker.reagents.log_list()])", LOG_ATTACK)
add_fingerprint(user)
update_icon()
update_appearance()
return
else
return ..()
@@ -150,7 +143,7 @@
// speed up transfer on blood packs
transfer_amount *= 2
target_reagents.trans_to(attached, transfer_amount * delta_time * 0.5, methods = INJECT, show_message = FALSE) //make reagents reacts, but don't spam messages
update_icon()
update_appearance()
// Take blood
else
@@ -168,7 +161,7 @@
playsound(loc, 'sound/machines/twobeep_high.ogg', 50, TRUE)
var/atom/movable/target = use_internal_storage ? src : beaker
attached.transfer_blood_to(target, amount)
update_icon()
update_appearance()
/obj/machinery/iv_drip/attack_hand(mob/user, list/modifiers)
. = ..()
@@ -202,7 +195,7 @@
add_fingerprint(usr)
attached = target
START_PROCESSING(SSmachines, src)
update_icon()
update_appearance()
SEND_SIGNAL(src, COMSIG_IV_ATTACH, target)
@@ -211,7 +204,7 @@
SEND_SIGNAL(src, COMSIG_IV_DETACH, attached)
attached = null
update_icon()
update_appearance()
/obj/machinery/iv_drip/proc/get_reagent_holder()
return use_internal_storage ? reagents : beaker?.reagents
@@ -230,7 +223,7 @@
if(beaker)
beaker.forceMove(drop_location())
beaker = null
update_icon()
update_appearance()
/obj/machinery/iv_drip/verb/toggle_mode()
set category = "Object"
@@ -245,7 +238,7 @@
return
mode = !mode
to_chat(usr, "<span class='notice'>The IV drip is now [mode ? "injecting" : "taking blood"].</span>")
update_icon()
update_appearance()
/obj/machinery/iv_drip/examine(mob/user)
. = ..()
@@ -271,6 +264,7 @@
name = "saline drip"
desc = "An all-you-can-drip saline canister designed to supply a hospital without running out, with a scary looking pump rigged to inject saline into containers, but filling people directly might be a bad idea."
icon_state = "saline"
base_icon_state = "saline"
density = TRUE
/obj/machinery/iv_drip/saline/Initialize(mapload)
@@ -292,6 +286,7 @@
name = "automated IV drip"
desc = "A modified IV drip with plumbing connects. Reagents received from the connect are injected directly into their bloodstream, blood that is drawn goes to the internal storage and then into the ducting."
icon_state = "plumb"
base_icon_state = "plumb"
density = TRUE
use_internal_storage = TRUE

View File

@@ -3,6 +3,7 @@
name = "light switch"
icon = 'icons/obj/power.dmi'
icon_state = "light1"
base_icon_state = "light"
desc = "Make dark."
power_channel = AREA_USAGE_LIGHT
/// Set this to a string, path, or area instance to control that area
@@ -21,20 +22,23 @@
if(!name)
name = "light switch ([area.name])"
update_icon()
update_appearance()
/obj/machinery/light_switch/update_appearance(updates=ALL)
. = ..()
luminosity = (machine_stat & NOPOWER) ? 0 : 1
/obj/machinery/light_switch/update_icon_state()
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
luminosity = 0
if(machine_stat & NOPOWER)
icon_state = "light-p"
else
luminosity = 1
SSvis_overlays.add_vis_overlay(src, icon, "light-glow", EMISSIVE_LAYER, EMISSIVE_PLANE, dir, alpha)
if(area.lightswitch)
icon_state = "light1"
else
icon_state = "light0"
icon_state = "[base_icon_state]-p"
return ..()
icon_state = "[base_icon_state][area.lightswitch ? 1 : 0]"
return ..()
/obj/machinery/light_switch/update_overlays()
. = ..()
if(!(machine_stat & NOPOWER))
SSvis_overlays.add_vis_overlay(src, icon, "[base_icon_state]-glow", EMISSIVE_LAYER, EMISSIVE_PLANE, dir, alpha)
/obj/machinery/light_switch/examine(mob/user)
. = ..()
@@ -44,10 +48,10 @@
. = ..()
area.lightswitch = !area.lightswitch
area.update_icon()
area.update_appearance()
for(var/obj/machinery/light_switch/L in area)
L.update_icon()
L.update_appearance()
area.power_change()

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