Port TG updating appearances (#17943)

* Get pants that match or else you gonna look silly yo

* Posters

* Fix other hud elements

* Rereviewed

* Update shotglass.dm

* Fix for new merged PRs

* Typo

* Coming across other stuff

* Update theblob.dm

* No takebacksies

* smh i forget to leave a comment

* Updated for the detgun and cards

* Should have rerun langserver again

* No longer plastic, more in scope

* Damn you bluespace

* Reverting turret logic, out of scope at this point

* Tweak that part

* Went over energy guns again, and fixed UI White's sprite sheet

* Welding masks, glasses, and JUSTICE

* Update portable_atmospherics.dm

* Cleaning up, clearing things up

* Review and suggestions

* Update valve.dm

* More tweaks

* Missing character

* Not distinct lightmasks, so they can be overlays

* Update generator.dm

* Add parameter so holodeck doesn't try to make a perfect copy

* Update unsorted.dm

* Spiders

* Better fix for spiders, fix vamps too

* Ghosts

* Update telekinesis.dm

* Cleaning up old procs

* It's set up to not copy datums... Unless they're in a list

* Donuts, duct tape, and detgun. D3VR coming to Early Access

* Update procs that interact with doors so they call update_state instead

* Forgot one spot, and actually might as well just force lock

* Cleaning up other things... Sigh, and kitty ears

* oops

* Getting used to how it works

* blinds

* Going back to the suit obscuring thing, so it doesn't update all the time

* Missed that from merging master

* I made this PR and forgot about it

* Fix runtimes in cards

* Make things a bit more unified

* Update update_icons.dm

* yarn, really?

* Update library_equipment.dm

* Update shieldgen.dm

* Every time Charlie merges something, I go back and see if I can improve things further

* what's this? more?

* Update misc_special.dm

* wow, paper

* Review

* More reviews

* To be sure, seems like being broken messed something sometimes

* Brought airlocks closer to how TG works to iron out some stuff

* Pizza and morgue

* Doesn't seem to hurt, tried with holodeck

* Revert "Doesn't seem to hurt, tried with holodeck"

This reverts commit 158529302b.

* Icon conflict

* Fix organ damage

* Don't ask how. Why. It's like that on prod too.

* Cutting down on things and updating from TG.

* More flexible. Just in case the thing you stuck it on didn't destroy.

* Hydro was one the things I touched earlier on, better rework it

* Reviews

* Cleaning up further, also bri'ish

* Undo a change I did, and switch over to a more recent implementation

* Update biogenerator.dm

* Rolling back to old airlocks, but with new duct taped note

* Functionally the same. I'd just rather not have the smoothing happen there

* Went over APCs again

* Fix welding helmet names in species files

* Update airlock.dm

* Update persistent_overlay.dm

* Oh, topic
This commit is contained in:
Vi3trice
2022-07-21 08:11:59 +02:00
committed by GitHub
parent aa06a09f5f
commit f4b37b4177
429 changed files with 3487 additions and 3296 deletions
+11 -5
View File
@@ -30,19 +30,25 @@
visible_message("[user] places [I] in [src].")
add_fingerprint(user)
update_icon()
update_appearance(UPDATE_DESC|UPDATE_ICON_STATE)
else
return ..()
/obj/item/ashtray/update_icon()
/obj/item/ashtray/update_icon_state()
if(contents.len == max_butts)
icon_state = icon_full
desc = initial(desc) + " It's stuffed full."
else if(contents.len > max_butts * 0.5)
icon_state = icon_half
desc = initial(desc) + " It's half-filled."
else
icon_state = initial(icon_state)
/obj/item/ashtray/update_desc()
. = ..()
if(contents.len == max_butts)
desc = initial(desc) + " It's stuffed full."
else if(contents.len > max_butts * 0.5)
desc = initial(desc) + " It's half-filled."
else
desc = initial(desc)
/obj/item/ashtray/deconstruct()
@@ -52,7 +58,7 @@
/obj/item/ashtray/proc/empty_tray()
for(var/obj/item/I in contents)
I.forceMove(loc)
update_icon()
update_appearance(UPDATE_DESC|UPDATE_ICON_STATE)
/obj/item/ashtray/throw_impact(atom/hit_atom)
if(contents.len)
+1 -1
View File
@@ -56,7 +56,7 @@
/obj/structure/closet/body_bag/update_overlays()
..()
if(name != initial(name))
add_overlay("bodybag_label")
. += "bodybag_label"
/obj/structure/closet/body_bag/MouseDrop(over_object, src_location, over_location)
. = ..()
+6 -6
View File
@@ -22,7 +22,7 @@
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/candle/update_icon()
/obj/item/candle/update_icon_state()
if(flickering)
icon_state = "candle[get_icon_index()]_flicker"
else
@@ -58,7 +58,7 @@
usr.visible_message(show_message)
set_light(CANDLE_LUM)
START_PROCESSING(SSobj, src)
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/candle/proc/get_icon_index()
if(wax > 150)
@@ -70,12 +70,12 @@
/obj/item/candle/proc/start_flickering()
flickering = TRUE
update_icon()
update_icon(UPDATE_ICON_STATE)
addtimer(CALLBACK(src, .proc/stop_flickering), 4 SECONDS, TIMER_UNIQUE)
/obj/item/candle/proc/stop_flickering()
flickering = FALSE
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/candle/process()
if(!lit)
@@ -88,7 +88,7 @@
var/mob/M = src.loc
M.unEquip(src, 1) //src is being deleted anyway
qdel(src)
update_icon()
update_icon(UPDATE_ICON_STATE)
if(isturf(loc)) //start a fire if possible
var/turf/T = loc
T.hotspot_expose(700, 5)
@@ -98,7 +98,7 @@
if(lit)
user.visible_message("<span class='notice'>[user] snuffs out [src].</span>")
lit = FALSE
update_icon()
update_icon(UPDATE_ICON_STATE)
set_light(0)
/obj/item/candle/eternal
+8 -6
View File
@@ -269,13 +269,12 @@
if("Toggle Cap")
to_chat(user, "<span class='notice'>You [capped ? "remove" : "replace"] the cap of [src].</span>")
capped = !capped
icon_state = "spraycan[capped ? "_cap" : ""]"
update_icon()
update_icon(UPDATE_ICON_STATE)
if("Change Drawing")
..()
if("Change Color")
colour = input(user,"Choose Color") as color
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/item/toy/crayon/spraycan/afterattack(atom/target, mob/user as mob, proximity)
if(!proximity)
@@ -300,8 +299,11 @@
playsound(user.loc, 'sound/effects/spray.ogg', 5, 1, 5)
..()
/obj/item/toy/crayon/spraycan/update_icon()
overlays.Cut()
/obj/item/toy/crayon/spraycan/update_icon_state()
icon_state = "spraycan[capped ? "_cap" : ""]"
/obj/item/toy/crayon/spraycan/update_overlays()
. = ..()
var/image/I = image('icons/obj/crayons.dmi',icon_state = "[capped ? "spraycan_cap_colors" : "spraycan_colors"]")
I.color = colour
overlays += I
. += I
+29 -47
View File
@@ -15,34 +15,32 @@
/obj/item/flashlight/Initialize()
. = ..()
if(on)
icon_state = "[initial(icon_state)]-on"
set_light(brightness_on)
else
icon_state = initial(icon_state)
set_light(0)
update_brightness()
/obj/item/flashlight/proc/update_brightness(mob/user = null)
/obj/item/flashlight/update_icon_state()
if(on)
icon_state = "[initial(icon_state)]-on"
else
icon_state = "[initial(icon_state)]"
/obj/item/flashlight/proc/update_brightness()
if(on)
set_light(brightness_on)
else
icon_state = initial(icon_state)
set_light(0)
update_icon()
/obj/item/flashlight/attack_self(mob/user)
if(!isturf(user.loc))
to_chat(user, "You cannot turn the light on while in this [user.loc].")//To prevent some lighting anomalities.
return 0
return FALSE
on = !on
playsound(user, togglesound, 100, 1)
update_brightness(user)
update_brightness()
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
return 1
return TRUE
/obj/item/flashlight/attack(mob/living/M as mob, mob/living/user as mob)
add_fingerprint(user)
@@ -129,15 +127,12 @@
materials = list()
on = TRUE
// green-shaded desk lamp
/obj/item/flashlight/lamp/green
desc = "A classic green-shaded desk lamp."
icon_state = "lampgreen"
item_state = "lampgreen"
/obj/item/flashlight/lamp/verb/toggle_light()
set name = "Toggle light"
set category = "Object"
@@ -153,7 +148,6 @@
icon_state = "bananalamp"
item_state = "bananalamp"
// FLARES
/obj/item/flashlight/flare
@@ -174,6 +168,12 @@
fuel = rand(fuel_lower, fuel_upp)
..()
/obj/item/flashlight/flare/update_icon_state()
if(!fuel)
icon_state = "[initial(icon_state)]-empty"
return
..()
/obj/item/flashlight/flare/process()
var/turf/pos = get_turf(src)
if(pos && produce_heat)
@@ -181,8 +181,6 @@
fuel = max(fuel - 1, 0)
if(!fuel || !on)
turn_off()
if(!fuel)
icon_state = "[initial(icon_state)]-empty"
STOP_PROCESSING(SSobj, src)
/obj/item/flashlight/flare/Destroy()
@@ -193,21 +191,9 @@
on = FALSE
force = initial(force)
damtype = initial(damtype)
if(ismob(loc))
var/mob/U = loc
update_brightness(U)
else
update_brightness(null)
/obj/item/flashlight/flare/update_brightness(mob/user = null)
..()
if(on)
item_state = "[initial(item_state)]-on"
else
item_state = "[initial(item_state)]"
update_brightness()
/obj/item/flashlight/flare/attack_self(mob/user)
// Usual checks
if(!fuel)
to_chat(user, "<span class='notice'>[src] is out of fuel.</span>")
@@ -220,8 +206,9 @@
// All good, turn it on.
if(.)
user.visible_message("<span class='notice'>[user] activates [src].</span>", "<span class='notice'>You activate [src].</span>")
force = on_damage
damtype = "fire"
if(produce_heat)
force = on_damage
damtype = "fire"
START_PROCESSING(SSobj, src)
// GLOWSTICKS
@@ -234,30 +221,25 @@
icon_state = "glowstick"
item_state = "glowstick"
togglesound = 'sound/effects/bone_break_1.ogg'
produce_heat = 0
produce_heat = FALSE
fuel_lower = 1600
fuel_upp = 2000
blocks_emissive = FALSE
/obj/item/flashlight/flare/glowstick/Initialize()
light_color = color
..()
/obj/item/flashlight/flare/glowstick/update_icon()
item_state = "glowstick"
cut_overlays()
/obj/item/flashlight/flare/glowstick/update_icon_state()
if(!fuel)
icon_state = "glowstick-empty"
cut_overlays()
update_brightness(0)
else if(on)
/obj/item/flashlight/flare/glowstick/update_overlays()
. = ..()
if(on)
var/mutable_appearance/glowstick_overlay = mutable_appearance(icon, "glowstick-glow")
glowstick_overlay.color = color
add_overlay(glowstick_overlay)
item_state = "glowstick-on"
update_brightness(brightness_on)
else
icon_state = "glowstick"
cut_overlays()
. += glowstick_overlay
/obj/item/flashlight/flare/glowstick/red
name = "red glowstick"
@@ -53,7 +53,7 @@
current_tick_amount = 0
update_icon()
update_icon(UPDATE_ICON_STATE)
update_sound()
/obj/item/geiger_counter/examine(mob/user)
@@ -80,7 +80,7 @@
. += "<span class='notice'>The last radiation amount detected was [last_tick_amount]</span>"
/obj/item/geiger_counter/update_icon()
/obj/item/geiger_counter/update_icon_state()
if(!scanning)
icon_state = "geiger_off"
else if(emagged)
@@ -113,11 +113,11 @@
if(amount <= RAD_BACKGROUND_RADIATION || !scanning)
return
current_tick_amount += amount
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/geiger_counter/attack_self(mob/user)
scanning = !scanning
update_icon()
update_icon(UPDATE_ICON_STATE)
to_chat(user, "<span class='notice'>[bicon(src)] You switch [scanning ? "on" : "off"] [src].</span>")
/obj/item/geiger_counter/afterattack(atom/target, mob/user)
@@ -158,7 +158,7 @@
user.visible_message("<span class='notice'>[user] refastens [src]'s maintenance panel!</span>", "<span class='notice'>You reset [src] to its factory settings!</span>")
emagged = FALSE
radiation_count = 0
update_icon()
update_icon(UPDATE_ICON_STATE)
return TRUE
else
return ..()
@@ -171,7 +171,7 @@
return
radiation_count = 0
to_chat(user, "<span class='notice'>You flush [src]'s radiation counts, resetting it to normal.</span>")
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/geiger_counter/emag_act(mob/user)
if(emagged)
@@ -147,14 +147,23 @@
/obj/item/lightreplacer/emag_act(user as mob)
if(!emagged)
Emag()
emagged = !emagged
playsound(loc, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
update_appearance(UPDATE_NAME|UPDATE_ICON_STATE)
/obj/item/lightreplacer/attack_self(mob/user)
for(var/obj/machinery/light/target in user.loc)
ReplaceLight(target, user)
to_chat(user, status_string())
/obj/item/lightreplacer/update_icon()
/obj/item/lightreplacer/update_name()
. = ..()
if(emagged)
name = "shortcircuited [initial(name)]"
else
name = initial(name)
/obj/item/lightreplacer/update_icon_state()
icon_state = "lightreplacer[emagged]"
/obj/item/lightreplacer/proc/status_string()
@@ -214,15 +223,6 @@
to_chat(U, "<span class='warning'>There is a working [target.fitting] already inserted!</span>")
return
/obj/item/lightreplacer/proc/Emag()
emagged = !emagged
playsound(loc, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
if(emagged)
name = "shortcircuited [initial(name)]"
else
name = initial(name)
update_icon()
/obj/item/lightreplacer/proc/CanUse(mob/living/user)
add_fingerprint(user)
if(uses > 0)
@@ -249,9 +249,8 @@
to_chat(U, "[src]'s refill light blinks red.")
/obj/item/lightreplacer/proc/janicart_insert(mob/user, obj/structure/janitorialcart/J)
J.put_in_cart(src, user)
J.myreplacer = src
J.update_icon()
J.put_in_cart(src, user)
/obj/item/lightreplacer/cyborg/janicart_insert(mob/user, obj/structure/janitorialcart/J)
return
@@ -58,5 +58,5 @@
A.icon = initial(airlock.icon)
A.overlays_file = initial(airlock.overlays_file)
A.assemblytype = initial(airlock.assemblytype)
A.update_icon()
A.update_appearance()
return TRUE
+2 -2
View File
@@ -30,7 +30,7 @@
attached = null
return ..()
/obj/item/powersink/update_icon()
/obj/item/powersink/update_icon_state()
icon_state = "powersink[mode == OPERATING]"
/obj/item/powersink/proc/set_mode(value)
@@ -60,7 +60,7 @@
density = TRUE
mode = value
update_icon()
update_icon(UPDATE_ICON_STATE)
set_light(0)
/obj/item/powersink/screwdriver_act(mob/user, obj/item/I)
@@ -61,10 +61,10 @@
if(direction)
setDir(direction)
set_pixel_offsets_from_dir(28, -28, 28, -28)
b_stat=1
b_stat = TRUE
on = FALSE
GLOB.global_intercoms.Add(src)
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/radio/intercom/Initialize()
. = ..()
@@ -184,12 +184,12 @@
return
if(!I.use_tool(src, user, 10, volume = I.tool_volume) || buildstage != 2)
return
update_icon()
update_icon(UPDATE_ICON_STATE)
on = TRUE
b_stat = 0
b_stat = FALSE
buildstage = 3
to_chat(user, "<span class='notice'>You secure the electronics!</span>")
update_icon()
update_icon(UPDATE_ICON_STATE)
update_operating_status()
for(var/i, i<= 5, i++)
wires.on_cut(i, 1)
@@ -203,9 +203,9 @@
WIRECUTTER_SNIP_MESSAGE
new /obj/item/stack/cable_coil(get_turf(src),5)
on = FALSE
b_stat = 1
b_stat = TRUE
buildstage = 1
update_icon()
update_icon(UPDATE_ICON_STATE)
update_operating_status(FALSE)
/obj/item/radio/intercom/welder_act(mob/user, obj/item/I)
@@ -220,11 +220,11 @@
new /obj/item/mounted/frame/intercom(get_turf(src))
qdel(src)
/obj/item/radio/intercom/update_icon()
/obj/item/radio/intercom/update_icon_state()
if(!circuitry_installed)
icon_state="intercom-frame"
return
icon_state = "intercom[!on?"-p":""][b_stat ? "-open":""]"
else
icon_state = "intercom[!on?"-p":""][b_stat ? "-open":""]"
/obj/item/radio/intercom/proc/update_operating_status(on = TRUE)
var/area/current_area = get_area(src)
@@ -249,7 +249,7 @@
on = FALSE
else
on = current_area.powered(EQUIP) // set "on" to the equipment power status of our area.
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/intercom_electronics
name = "intercom electronics"
+15 -10
View File
@@ -596,6 +596,7 @@ REAGENT SCANNER
var/obj/item/stock_parts/cell/cell
var/cell_type = /obj/item/stock_parts/cell/upgraded
var/ready = TRUE // Ready to scan
var/printing = FALSE
var/time_to_use = 0 // How much time remaining before next scan is available.
var/usecharge = 750
var/scan_time = 10 SECONDS //how long does it take to scan
@@ -626,20 +627,22 @@ REAGENT SCANNER
playsound(src, 'sound/machines/defib_saftyon.ogg', 50, 0)
update_icon()
/obj/item/bodyanalyzer/update_icon(printing = FALSE)
overlays.Cut()
var/percent = cell.percent()
/obj/item/bodyanalyzer/update_icon_state()
if(!cell)
icon_state = "bodyanalyzer_0"
return
if(ready)
icon_state = "bodyanalyzer_1"
else
icon_state = "bodyanalyzer_2"
/obj/item/bodyanalyzer/update_overlays()
. = ..()
var/percent = cell.percent()
var/overlayid = round(percent / 10)
overlayid = "bodyanalyzer_charge[overlayid]"
overlays += icon(icon, overlayid)
. += "bodyanalyzer_charge[overlayid]"
if(printing)
overlays += icon(icon, "bodyanalyzer_printing")
. += "bodyanalyzer_printing"
/obj/item/bodyanalyzer/attack(mob/living/M, mob/living/carbon/human/user)
if(user.incapacitated() || !user.Adjacent(M))
@@ -686,14 +689,16 @@ REAGENT SCANNER
else
cell.use(usecharge)
ready = FALSE
update_icon(TRUE)
printing = TRUE
update_icon()
addtimer(CALLBACK(src, /obj/item/bodyanalyzer/.proc/setReady), scan_cd)
addtimer(CALLBACK(src, /obj/item/bodyanalyzer/.proc/update_icon), 20)
addtimer(VARSET_CALLBACK(src, printing, FALSE), 1.4 SECONDS)
addtimer(CALLBACK(src, /atom/.proc/update_icon, UPDATE_OVERLAYS), 1.5 SECONDS)
else if(iscorgi(M) && M.stat == DEAD)
to_chat(user, "<span class='notice'>You wonder if [M.p_they()] was a good dog. <b>[src] tells you they were the best...</b></span>") // :'(
playsound(loc, 'sound/machines/ping.ogg', 50, 0)
ready = FALSE
update_icon(UPDATE_ICON_STATE)
addtimer(CALLBACK(src, /obj/item/bodyanalyzer/.proc/setReady), scan_cd)
time_to_use = world.time + scan_cd
else
+17 -17
View File
@@ -26,7 +26,7 @@
..()
if(starts_with_tape)
mytape = new /obj/item/tape/random(src)
update_icon()
update_icon(UPDATE_ICON_STATE)
soundloop = new(list(src))
/obj/item/taperecorder/Destroy()
@@ -53,7 +53,7 @@
mytape = I
to_chat(user, "<span class='notice'>You insert [I] into [src].</span>")
playsound(src, 'sound/items/taperecorder/taperecorder_close.ogg', 50, FALSE)
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/taperecorder/proc/eject(mob/user)
if(mytape)
@@ -62,7 +62,7 @@
stop()
user.put_in_hands(mytape)
mytape = null
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/taperecorder/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
@@ -92,7 +92,7 @@
eject(usr)
/obj/item/taperecorder/update_icon()
/obj/item/taperecorder/update_icon_state()
if(!mytape)
icon_state = "taperecorder_empty"
else if(recording)
@@ -102,7 +102,6 @@
else
icon_state = "taperecorder_idle"
/obj/item/taperecorder/hear_talk(mob/living/M as mob, list/message_pieces)
var/msg = multilingual_to_message(message_pieces)
if(mytape && recording)
@@ -146,7 +145,7 @@
recording = TRUE
atom_say("Recording started.")
update_sound()
update_icon()
update_icon(UPDATE_ICON_STATE)
mytape.timestamp += mytape.used_capacity
mytape.storedinfo += "\[[time2text(mytape.used_capacity * 10,"mm:ss")]\] Recording started."
var/used = mytape.used_capacity //to stop runtimes when you eject the tape
@@ -180,7 +179,7 @@
playsound(src, 'sound/items/taperecorder/taperecorder_stop.ogg', 50, FALSE)
atom_say("Playback stopped.")
playing = FALSE
update_icon()
update_icon(UPDATE_ICON_STATE)
update_sound()
@@ -198,7 +197,7 @@
return
playing = TRUE
update_icon()
update_icon(UPDATE_ICON_STATE)
update_sound()
atom_say("Playback started.")
playsound(src, 'sound/items/taperecorder/taperecorder_play.ogg', 50, FALSE)
@@ -285,7 +284,7 @@
var/used_capacity = 0
var/list/storedinfo = list()
var/list/timestamp = list()
var/ruined = 0
var/ruined = FALSE
/obj/item/tape/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
@@ -308,22 +307,23 @@
to_chat(usr, "<span class='notice'>You erase the data from [src].</span>")
clear()
/obj/item/tape/update_overlays()
. = ..()
if(ruined)
. += "ribbonoverlay"
/obj/item/tape/proc/clear()
used_capacity = 0
storedinfo.Cut()
timestamp.Cut()
/obj/item/tape/proc/ruin()
if(!ruined)
overlays += "ribbonoverlay"
ruined = 1
ruined = TRUE
update_icon(UPDATE_OVERLAYS)
/obj/item/tape/proc/fix()
overlays -= "ribbonoverlay"
ruined = 0
ruined = FALSE
update_icon(UPDATE_OVERLAYS)
/obj/item/tape/attackby(obj/item/I, mob/user)
if(ruined && istype(I, /obj/item/screwdriver))
@@ -152,23 +152,25 @@
spawn(50) // To stop a signal being spammed from a proxy sensor constantly going off or whatever
toggle = TRUE
/obj/item/transfer_valve/update_icon()
overlays.Cut()
underlays = null
/obj/item/transfer_valve/update_icon_state()
if(!tank_one && !tank_two && !attached_device)
icon_state = "valve_1"
else
icon_state = "valve"
/obj/item/transfer_valve/update_overlays()
. = ..()
underlays.Cut()
if(!tank_one && !tank_two && !attached_device)
return
icon_state = "valve"
if(tank_one)
overlays += "[tank_one.icon_state]"
. += "[tank_one.icon_state]"
if(tank_two)
var/icon/J = new(icon, icon_state = "[tank_two.icon_state]")
J.Shift(WEST, 13)
underlays += J
if(attached_device)
overlays += "device"
. += "device"
/obj/item/transfer_valve/proc/merge_gases()
tank_two.air_contents.volume += tank_one.air_contents.volume
+5 -6
View File
@@ -8,6 +8,7 @@
w_class = WEIGHT_CLASS_BULKY
max_integrity = 40
resistance_flags = FLAMMABLE
custom_fire_overlay = "fire"
var/rolled = FALSE
/obj/item/flag/attackby(obj/item/W, mob/user, params)
@@ -29,18 +30,16 @@
..()
update_icon()
/obj/item/flag/update_icon()
overlays.Cut()
/obj/item/flag/update_icon_state()
updateFlagIcon()
item_state = icon_state
if(rolled)
icon_state = "[icon_state]_rolled"
custom_fire_overlay = "fire_rolled"
else
custom_fire_overlay = initial(custom_fire_overlay)
if(resistance_flags & ON_FIRE)
item_state = "[item_state]_fire"
if((resistance_flags & ON_FIRE) && rolled)
overlays += image('icons/obj/flag.dmi', src , "fire_rolled")
else if((resistance_flags & ON_FIRE) && !rolled)
overlays += image('icons/obj/flag.dmi', src , "fire")
if(ismob(loc))
var/mob/M = loc
M.update_inv_r_hand()
+7 -5
View File
@@ -41,16 +41,18 @@
GLOB.poi_list -= src
return ..()
/obj/item/his_grace/update_icon()
/obj/item/his_grace/update_icon_state()
icon_state = ascended ? "gold" : "green"
item_state = ascended ? "toolbox_gold" : "artistic_toolbox"
cut_overlays()
/obj/item/his_grace/update_overlays()
. = ..()
if(ascended)
add_overlay("triple_latch")
. += "triple_latch"
else if(awakened)
add_overlay("single_latch_open")
. += "single_latch_open"
else
add_overlay("single_latch")
. += "single_latch"
/obj/item/his_grace/attack_self(mob/living/user)
if(!awakened)
+15 -15
View File
@@ -102,7 +102,7 @@
/obj/item/robot_parts/robot_suit/New()
..()
updateicon()
update_icon(UPDATE_OVERLAYS)
/obj/item/robot_parts/robot_suit/Destroy()
QDEL_NULL(l_arm)
@@ -117,20 +117,20 @@
/obj/item/robot_parts/robot_suit/attack_self(mob/user)
return
/obj/item/robot_parts/robot_suit/proc/updateicon()
overlays.Cut()
/obj/item/robot_parts/robot_suit/update_overlays()
. = ..()
if(l_arm)
overlays += "l_arm+o"
. += "l_arm+o"
if(r_arm)
overlays += "r_arm+o"
. += "r_arm+o"
if(chest)
overlays += "chest+o"
. += "chest+o"
if(l_leg)
overlays += "l_leg+o"
. += "l_leg+o"
if(r_leg)
overlays += "r_leg+o"
. += "r_leg+o"
if(head)
overlays += "head+o"
. += "head+o"
/obj/item/robot_parts/robot_suit/proc/check_completion()
if(l_arm && r_arm)
@@ -158,7 +158,7 @@
user.drop_item()
W.forceMove(src)
l_leg = W
updateicon()
update_icon(UPDATE_OVERLAYS)
if(istype(W, /obj/item/robot_parts/r_leg))
if(r_leg)
@@ -166,7 +166,7 @@
user.drop_item()
W.forceMove(src)
r_leg = W
updateicon()
update_icon(UPDATE_OVERLAYS)
if(istype(W, /obj/item/robot_parts/l_arm))
if(l_arm)
@@ -174,7 +174,7 @@
user.drop_item()
W.forceMove(src)
l_arm = W
updateicon()
update_icon(UPDATE_OVERLAYS)
if(istype(W, /obj/item/robot_parts/r_arm))
if(r_arm)
@@ -182,7 +182,7 @@
user.drop_item()
W.forceMove(src)
r_arm = W
updateicon()
update_icon(UPDATE_OVERLAYS)
if(istype(W, /obj/item/robot_parts/chest))
var/obj/item/robot_parts/chest/CH = W
@@ -192,7 +192,7 @@
user.drop_item()
W.forceMove(src)
chest = W
updateicon()
update_icon(UPDATE_OVERLAYS)
else if(!CH.wired)
to_chat(user, "<span class='notice'>You need to attach wires to it first!</span>")
else
@@ -206,7 +206,7 @@
user.drop_item()
W.forceMove(src)
head = W
updateicon()
update_icon(UPDATE_OVERLAYS)
else
to_chat(user, "<span class='notice'>You need to attach a flash to it first!</span>")
@@ -39,11 +39,11 @@
/obj/item/borg/upgrade/proc/pre_install_checks(mob/living/silicon/robot/R)
if(R.stat == DEAD)
to_chat(usr, "<span class='warning'>[src] will not function on a deceased cyborg.</span>")
return FALSE
return
if(module_type && !istype(R.module, module_type))
to_chat(R, "<span class='warning'>Upgrade mounting error! No suitable hardpoint detected!</span>")
to_chat(usr, "<span class='warning'>There's no mounting point for the module!</span>")
return FALSE
return
return TRUE
/**
@@ -99,7 +99,7 @@
/obj/item/borg/upgrade/rename/do_install(mob/living/silicon/robot/R)
if(!R.allow_rename)
to_chat(R, "<span class='warning'>Internal diagnostic error: incompatible upgrade module detected.</span>")
return 0
return
R.notify_ai(3, R.name, heldname)
R.name = heldname
R.custom_name = heldname
@@ -116,7 +116,7 @@
/obj/item/borg/upgrade/restart/do_install(mob/living/silicon/robot/R)
if(R.health < 0)
to_chat(usr, "<span class='warning'>You have to repair the cyborg before using this module!</span>")
return 0
return
if(!R.key)
for(var/mob/dead/observer/ghost in GLOB.player_list)
@@ -286,7 +286,7 @@
var/obj/item/borg/upgrade/selfrepair/U = locate() in R
if(U)
to_chat(usr, "<span class='warning'>This unit is already equipped with a self-repair module.</span>")
return 0
return
cyborg = R
icon_state = "selfrepair_off"
@@ -308,9 +308,9 @@
else
to_chat(cyborg, "<span class='notice'>You deactivate the self-repair module.</span>")
STOP_PROCESSING(SSobj, src)
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/borg/upgrade/selfrepair/update_icon()
/obj/item/borg/upgrade/selfrepair/update_icon_state()
if(cyborg)
icon_state = "selfrepair_[on ? "on" : "off"]"
for(var/X in actions)
@@ -322,7 +322,7 @@
/obj/item/borg/upgrade/selfrepair/proc/deactivate()
STOP_PROCESSING(SSobj, src)
on = FALSE
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/borg/upgrade/selfrepair/process()
if(!repair_tick)
+3 -3
View File
@@ -43,7 +43,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
is_cyborg = TRUE
materials = list()
/obj/item/stack/rods/cyborg/update_icon()
/obj/item/stack/rods/cyborg/update_icon_state()
return // icon_state should always be a full stack of rods.
/obj/item/stack/rods/ten
@@ -58,9 +58,9 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
/obj/item/stack/rods/New(loc, amount=null)
..()
recipes = GLOB.rod_recipes
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/stack/rods/update_icon()
/obj/item/stack/rods/update_icon_state()
var/amount = get_amount()
if((amount <= 5) && (amount > 0))
icon_state = "rods-[amount]"
@@ -199,11 +199,7 @@ GLOBAL_LIST_INIT(sinew_recipes, list ( \
D.armor = D.armor.setRating(bullet_value = min(D.armor.getRating(BULLET) + 5, 50))
D.armor = D.armor.setRating(laser_value = min(D.armor.getRating(LASER) + 5, 50))
to_chat(user, "<span class='info'>You strengthen [target], improving its resistance against melee attacks.</span>")
D.update_icon()
if(D.hides == 3)
D.desc = "Autonomous Power Loader Unit. It's wearing a fearsome carapace entirely composed of goliath hide plates - its pilot must be an experienced monster hunter."
else
D.desc = "Autonomous Power Loader Unit. Its armour is enhanced with some goliath hide plates."
D.update_appearance(UPDATE_DESC|UPDATE_OVERLAYS)
use(1)
else
to_chat(user, "<span class='warning'>You can't improve [D] any further!</span>")
+10 -11
View File
@@ -170,15 +170,7 @@
else
to_chat(user, "<span class='warning'>There's not enough fuel in [A] to refuel [src]!</span>")
/obj/item/weldingtool/proc/update_torch()
overlays.Cut()
if(tool_enabled)
overlays += "[initial(icon_state)]-on"
item_state = "[initial(item_state)]1"
else
item_state = "[initial(item_state)]"
/obj/item/weldingtool/update_icon()
/obj/item/weldingtool/update_icon_state()
if(low_fuel_changes_icon)
var/ratio = GET_FUEL / maximum_fuel
ratio = CEILING(ratio*4, 1) * 25
@@ -186,8 +178,15 @@
icon_state = initial(icon_state)
else
icon_state = "[initial(icon_state)][ratio]"
update_torch()
..()
if(tool_enabled)
item_state = "[initial(item_state)]1"
else
item_state = "[initial(item_state)]"
/obj/item/weldingtool/update_overlays()
. = ..()
if(tool_enabled)
. += "[initial(icon_state)]-on"
/obj/item/weldingtool/cyborg_recharge(coeff, emagged)
if(reagents.check_and_add("fuel", maximum_fuel, 2 * coeff))
+9 -10
View File
@@ -96,7 +96,7 @@
qdel(src)
return
/obj/item/toy/balloon/update_icon()
/obj/item/toy/balloon/update_icon_state()
if(src.reagents.total_volume >= 1)
icon_state = "waterballoon"
item_state = "waterballoon"
@@ -772,21 +772,20 @@
/obj/item/toy/windup_toolbox/Initialize(mapload)
. = ..()
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/item/toy/windup_toolbox/update_icon()
..()
cut_overlays()
/obj/item/toy/windup_toolbox/update_overlays()
. = ..()
if(active)
add_overlay("single_latch_open")
. += "single_latch_open"
else
add_overlay("single_latch")
. += "single_latch"
/obj/item/toy/windup_toolbox/attack_self(mob/user)
if(!active)
to_chat(user, "<span class='notice'>You wind up [src], it begins to rumble.</span>")
active = TRUE
update_icon()
update_icon(UPDATE_OVERLAYS)
playsound(src, 'sound/effects/pope_entry.ogg', 100)
animate_rumble(src)
addtimer(CALLBACK(src, .proc/stopRumble), 60 SECONDS)
@@ -795,7 +794,7 @@
/obj/item/toy/windup_toolbox/proc/stopRumble()
active = FALSE
update_icon()
update_icon(UPDATE_OVERLAYS)
visible_message("<span class='warning'>[src] slowly stops rattling and falls still, its latch snapping shut.</span>") //subtle difference
playsound(loc, 'sound/weapons/batonextend.ogg', 100, TRUE)
animate(src, transform = matrix())
@@ -1113,7 +1112,7 @@
wieldsound = 'sound/weapons/chainsawstart.ogg'
attack_verb = list("sawed", "cut", "hacked", "carved", "cleaved", "butchered", "felled", "timbered")
/obj/item/twohanded/toy/chainsaw/update_icon()
/obj/item/twohanded/toy/chainsaw/update_icon_state()
if(wielded)
icon_state = "chainsaw[wielded]"
else
+5 -6
View File
@@ -34,7 +34,7 @@
loaded.amount = amount
else
return
update_icon()
update_icon(UPDATE_ICON_STATE)
to_chat(user, "<span class='notice'>You add the cables to [src]. It now contains [loaded.amount].</span>")
else
..()
@@ -58,7 +58,7 @@
loaded.forceMove(user.loc)
user.put_in_hands(loaded)
loaded = null
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/twohanded/rcl/examine(mob/user)
. = ..()
@@ -71,7 +71,7 @@
active = FALSE
return ..()
/obj/item/twohanded/rcl/update_icon()
/obj/item/twohanded/rcl/update_icon_state()
if(!loaded)
icon_state = "rcl-0"
item_state = "rcl-0"
@@ -89,10 +89,9 @@
else
icon_state = "rcl-0"
item_state = "rcl-0"
..()
/obj/item/twohanded/rcl/proc/is_empty(mob/user, loud = 1)
update_icon()
update_icon(UPDATE_ICON_STATE)
if(!loaded || !loaded.amount)
if(loud)
to_chat(user, "<span class='notice'>The last of the cables unreel from [src].</span>")
@@ -151,4 +150,4 @@
loaded = new()
loaded.max_amount = max_amount
loaded.amount = max_amount
update_icon()
update_icon(UPDATE_ICON_STATE)
+2 -3
View File
@@ -16,10 +16,9 @@
/obj/item/stack/spacecash/New(loc, amt = null)
..()
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/stack/spacecash/update_icon()
..()
/obj/item/stack/spacecash/update_icon_state()
name = "[amount == max_amount ? "1000000" : amount] Credit[amount > 1 ? "s" : ""]"
if(amount >= 1 && amount < 10)
icon_state = "cashgreen"
@@ -63,8 +63,8 @@
TED = new(src.loc)
qdel(src)
/obj/item/gun/energy/chrono_gun/update_icon()
return
/obj/item/gun/energy/chrono_gun/update_overlays()
return list()
/obj/item/gun/energy/chrono_gun/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override, bonus_spread = 0)
if(field)
@@ -177,7 +177,7 @@
cached_icon.Insert(mob_icon, "frame[i]")
mob_underlay = mutable_appearance(cached_icon, "frame1")
update_icon()
update_icon(UPDATE_ICON_STATE)
desc = initial(desc) + "<br><span class='info'>It appears to contain [target.name].</span>"
START_PROCESSING(SSobj, src)
@@ -188,7 +188,7 @@
gun.field_disconnect(src)
return ..()
/obj/structure/chrono_field/update_icon()
/obj/structure/chrono_field/update_icon_state()
var/ttk_frame = 1 - (tickstokill / initial(tickstokill))
ttk_frame = clamp(CEILING(ttk_frame * CHRONO_FRAME_COUNT, 1), 1, CHRONO_FRAME_COUNT)
if(ttk_frame != RPpos)
@@ -217,7 +217,7 @@
captured.Paralyse(8 SECONDS)
if(captured.loc != src)
captured.forceMove(src)
update_icon()
update_icon(UPDATE_ICON_STATE)
if(gun)
if(gun.field_check(src))
tickstokill--
+50 -54
View File
@@ -33,17 +33,16 @@
/obj/item/defibrillator/Initialize(mapload) //starts without a cell for rnd
. = ..()
paddles = new paddle_type(src)
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/item/defibrillator/loaded/Initialize(mapload) //starts with hicap
. = ..()
cell = new(src)
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/item/defibrillator/update_icon()
/obj/item/defibrillator/update_icon(updates=ALL)
update_power()
update_overlays()
update_charge()
..()
/obj/item/defibrillator/examine(mob/user)
. = ..()
@@ -58,28 +57,25 @@
else
powered = FALSE
/obj/item/defibrillator/proc/update_overlays()
overlays.Cut()
/obj/item/defibrillator/update_overlays()
. = ..()
if(paddles_on_defib)
overlays += "[icon_state]-paddles"
if(powered)
overlays += "[icon_state]-powered"
if(!cell)
overlays += "[icon_state]-nocell"
. += "[icon_state]-paddles"
if(!safety)
overlays += "[icon_state]-emagged"
/obj/item/defibrillator/proc/update_charge()
if(powered) //so it doesn't show charge if it's unpowered
if(cell)
var/ratio = cell.charge / cell.maxcharge
ratio = CEILING(ratio*4, 1) * 25
overlays += "[icon_state]-charge[ratio]"
. += "[icon_state]-emagged"
if(powered)
. += "[icon_state]-powered"
if(powered && cell)
var/ratio = cell.charge / cell.maxcharge
ratio = CEILING(ratio*4, 1) * 25
. += "[icon_state]-charge[ratio]"
if(!cell)
. += "[icon_state]-nocell"
/obj/item/defibrillator/CheckParts(list/parts_list)
..()
cell = locate(/obj/item/stock_parts/cell) in contents
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/item/defibrillator/ui_action_click()
toggle_paddles()
@@ -109,7 +105,7 @@
cell = null
to_chat(user, "<span class='notice'>You remove the cell from [src].</span>")
update_icon()
update_icon(UPDATE_OVERLAYS)
return
/obj/item/defibrillator/emag_act(user as mob)
@@ -131,7 +127,7 @@
safety = TRUE
visible_message("<span class='notice'>[src] beeps: Safety protocols enabled!</span>")
playsound(get_turf(src), 'sound/machines/defib_saftyon.ogg', 50, 0)
update_icon()
update_icon(UPDATE_OVERLAYS)
..()
/obj/item/defibrillator/verb/toggle_paddles()
@@ -146,7 +142,7 @@
if(!usr.put_in_hands(paddles))
to_chat(user, "<span class='warning'>You need a free hand to hold the paddles!</span>")
update_icon()
update_icon(UPDATE_OVERLAYS)
return
paddles.loc = user
paddles_on_defib = FALSE
@@ -154,7 +150,7 @@
//Remove from their hands and back onto the defib unit
remove_paddles(user)
update_icon()
update_icon(UPDATE_OVERLAYS)
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
@@ -163,7 +159,7 @@
..()
if(slot != slot_back)
remove_paddles(user)
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/item/defibrillator/item_action_slot_check(slot, mob/user)
if(slot == slot_back)
@@ -174,7 +170,7 @@
if(paddles in get_both_hands(M))
M.unEquip(paddles)
paddles_on_defib = TRUE
update_icon()
update_icon(UPDATE_OVERLAYS)
return
/obj/item/defibrillator/Destroy()
@@ -189,12 +185,12 @@
if(cell)
if(cell.charge < (paddles.revivecost+chrgdeductamt))
powered = FALSE
update_icon()
update_icon(UPDATE_OVERLAYS)
if(cell.use(chrgdeductamt))
update_icon()
update_icon(UPDATE_OVERLAYS)
return TRUE
else
update_icon()
update_icon(UPDATE_OVERLAYS)
return FALSE
/obj/item/defibrillator/proc/cooldowncheck(mob/user)
@@ -207,8 +203,8 @@
user.visible_message("<span class='notice'>[src] beeps: Charge depleted.</span>")
playsound(get_turf(src), 'sound/machines/defib_failed.ogg', 50, 0)
paddles.cooldown = FALSE
paddles.update_icon()
update_icon()
paddles.update_icon(UPDATE_ICON_STATE)
update_icon(UPDATE_OVERLAYS)
/obj/item/defibrillator/compact
name = "compact defibrillator"
@@ -223,7 +219,7 @@
/obj/item/defibrillator/compact/loaded/Initialize(mapload)
. = ..()
cell = new(src)
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/item/defibrillator/compact/item_action_slot_check(slot, mob/user)
if(slot == slot_belt)
@@ -242,7 +238,7 @@
/obj/item/defibrillator/compact/combat/loaded/Initialize(mapload)
. = ..()
cell = new(src)
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/item/defibrillator/compact/advanced
name = "advanced compact defibrillator"
@@ -260,12 +256,12 @@
if(W == paddles)
paddles.unwield()
toggle_paddles()
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/item/defibrillator/compact/advanced/loaded/Initialize(mapload)
. = ..()
cell = new /obj/item/stock_parts/cell/bluespace/charging(src)
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/item/defibrillator/compact/advanced/emp_act(severity)
if(world.time > next_emp_message)
@@ -277,7 +273,7 @@
if(W == paddles)
paddles.unwield()
toggle_paddles()
update_icon()
update_icon(UPDATE_OVERLAYS)
return
//paddles
@@ -306,10 +302,10 @@
defib = mainunit
loc = defib
busy = FALSE
update_icon()
update_icon(UPDATE_ICON_STATE)
return
/obj/item/twohanded/shockpaddles/update_icon()
/obj/item/twohanded/shockpaddles/update_icon_state()
icon_state = "[base_icon_state][wielded]"
item_state = "[base_icon_state][wielded]"
if(cooldown)
@@ -330,8 +326,8 @@
to_chat(user, "<span class='notice'>The paddles snap back into the main unit.</span>")
defib.paddles_on_defib = TRUE
loc = defib
defib.update_icon()
update_icon()
defib.update_icon(UPDATE_OVERLAYS)
update_icon(UPDATE_ICON_STATE)
unwield(user)
/obj/item/twohanded/shockpaddles/on_mob_move(dir, mob/user)
@@ -384,12 +380,12 @@
defib.deductcharge(revivecost)
cooldown = TRUE
busy = FALSE
update_icon()
update_icon(UPDATE_ICON_STATE)
defib.cooldowncheck(user)
return
user.visible_message("<span class='warning'>[user] begins to place [src] on [M.name]'s chest.</span>", "<span class='warning'>You begin to place [src] on [M.name]'s chest.</span>")
busy = TRUE
update_icon()
update_icon(UPDATE_ICON_STATE)
var/mob/dead/observer/ghost = H.get_ghost(TRUE)
if(ghost && ghost.can_reenter_corpse)
to_chat(ghost, "<span class='ghostalert'>Your heart is being defibrillated. Return to your body if you want to be revived!</span> (Verbs -> Ghost -> Re-enter corpse)")
@@ -415,14 +411,14 @@
user.visible_message("<span class='notice'>[defib] buzzes: Patient's chest is obscured. Operation aborted.</span>")
playsound(get_turf(src), 'sound/machines/defib_failed.ogg', 50, 0)
busy = FALSE
update_icon()
update_icon(UPDATE_ICON_STATE)
return
if(H.undergoing_cardiac_arrest())
if(!H.get_int_organ(/obj/item/organ/internal/heart) && !H.get_int_organ(/obj/item/organ/internal/brain/slime)) //prevents defibing someone still alive suffering from a heart attack attack if they lack a heart
user.visible_message("<span class='boldnotice'>[defib] buzzes: Resuscitation failed - Failed to pick up any heart electrical activity.</span>")
playsound(get_turf(src), 'sound/machines/defib_failed.ogg', 50, 0)
busy = FALSE
update_icon()
update_icon(UPDATE_ICON_STATE)
return
else
var/obj/item/organ/internal/heart/heart = H.get_int_organ(/obj/item/organ/internal/heart)
@@ -430,7 +426,7 @@
user.visible_message("<span class='boldnotice'>[defib] buzzes: Resuscitation failed - Heart necrosis detected.</span>")
playsound(get_turf(src), 'sound/machines/defib_failed.ogg', 50, 0)
busy = FALSE
update_icon()
update_icon(UPDATE_ICON_STATE)
return
H.set_heartattack(FALSE)
SEND_SIGNAL(H, COMSIG_LIVING_MINOR_SHOCK, 100)
@@ -442,7 +438,7 @@
defib.deductcharge(revivecost)
busy = FALSE
cooldown = TRUE
update_icon()
update_icon(UPDATE_ICON_STATE)
defib.cooldowncheck(user)
return
if(H.stat == DEAD)
@@ -497,14 +493,14 @@
user.visible_message("<span class='boldnotice'>[defib] buzzes: Resuscitation failed.</span>")
playsound(get_turf(src), 'sound/machines/defib_failed.ogg', 50, 0)
defib.deductcharge(revivecost)
update_icon()
cooldown = TRUE
update_icon(UPDATE_ICON_STATE)
defib.cooldowncheck(user)
else
user.visible_message("<span class='notice'>[defib] buzzes: Patient is not in a valid state. Operation aborted.</span>")
playsound(get_turf(src), 'sound/machines/defib_failed.ogg', 50, 0)
busy = FALSE
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/borg_defib
name = "defibrillator paddles"
@@ -551,10 +547,10 @@
R.cell.use(revivecost)
cooldown = TRUE
busy = FALSE
update_icon()
update_icon(UPDATE_ICON_STATE)
spawn(50)
cooldown = FALSE
update_icon()
update_icon(UPDATE_ICON_STATE)
return
user.visible_message("<span class='warning'>[user] begins to place [src] on [M.name]'s chest.</span>", "<span class='warning'>You begin to place [src] on [M.name]'s chest.</span>")
busy = TRUE
@@ -619,16 +615,16 @@
if(isrobot(user))
var/mob/living/silicon/robot/R = user
R.cell.use(revivecost)
update_icon()
cooldown = TRUE
update_icon(UPDATE_ICON_STATE)
spawn(50)
cooldown = FALSE
update_icon()
update_icon(UPDATE_ICON_STATE)
else
user.visible_message("<span class='notice'>[user] buzzes: Patient is not in a valid state. Operation aborted.</span>")
playsound(get_turf(src), 'sound/machines/defib_failed.ogg', 50, 0)
busy = FALSE
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/twohanded/shockpaddles/syndicate
name = "combat defibrillator paddles"
+6 -6
View File
@@ -304,8 +304,8 @@
icon_state = "d100"
sides = 100
/obj/item/dice/d100/update_icon()
return
/obj/item/dice/d100/update_overlays()
return list()
/obj/item/dice/d20/e20
var/triggered = FALSE
@@ -333,7 +333,7 @@
comment = "NAT 20!"
else if(sides == 20 && result == 1)
comment = "Ouch, bad luck."
update_icon()
update_icon(UPDATE_OVERLAYS)
if(initial(icon_state) == "d00")
result = (result - 1) * 10
if(length(special_faces) == sides)
@@ -375,9 +375,9 @@
log_game("E20 detonated at [A.name] ([epicenter.x],[epicenter.y],[epicenter.z]) with a roll of [actual_result]. Triggered by: [key_name(user)]")
add_attack_logs(user, src, "detonated with a roll of [actual_result]", ATKLOG_FEW)
/obj/item/dice/update_icon()
overlays.Cut()
overlays += "[icon_state][result]"
/obj/item/dice/update_overlays()
. = ..()
. += "[icon_state][result]"
/obj/item/storage/box/dice
name = "Box of dice"
@@ -6,7 +6,7 @@
icon_state = "lepopen"
var/used = FALSE
/obj/item/dnascrambler/update_icon()
/obj/item/dnascrambler/update_icon_state()
if(used)
icon_state = "lepopen0"
else
@@ -52,5 +52,5 @@
add_attack_logs(user, target, "injected with [src]")
used = TRUE
update_icon()
update_icon(UPDATE_ICON_STATE)
name = "used " + name
@@ -33,14 +33,14 @@
assemblyattacher = user.ckey
to_chat(user, "<span class='notice'>You add [A] to [src].</span>")
playsound(src, 'sound/weapons/tap.ogg', 20, 1)
update_icon()
update_icon(UPDATE_ICON_STATE)
return
if(nadeassembly && istype(I, /obj/item/wirecutters))
playsound(src, I.usesound, 20, 1)
nadeassembly.loc = get_turf(src)
nadeassembly.master = null
nadeassembly = null
update_icon()
update_icon(UPDATE_ICON_STATE)
return
..()
@@ -80,16 +80,16 @@
if(do_after(user, 50 * toolspeed, target = AM))
if(!user.unEquip(src))
return
src.target = AM
target = AM
loc = null
message_admins("[key_name_admin(user)]([ADMIN_QUE(user,"?")]) ([ADMIN_FLW(user,"FLW")]) planted [src.name] on [target.name] at ([target.x],[target.y],[target.z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[target.x];Y=[target.y];Z=[target.z]'>JMP</a>) with [det_time] second fuse",0,1)
log_game("[key_name(user)] planted [name] on [target.name] at ([target.x],[target.y],[target.z]) with [det_time] second fuse")
target.overlays += image_overlay
AddComponent(/datum/component/persistent_overlay, image_overlay, target)
if(!nadeassembly)
to_chat(user, "<span class='notice'>You plant the bomb. Timer counting down from [det_time].</span>")
addtimer(CALLBACK(src, .proc/prime), det_time*10)
addtimer(CALLBACK(src, .proc/prime), det_time SECONDS)
/obj/item/grenade/plastic/suicide_act(mob/user)
message_admins("[key_name_admin(user)]([ADMIN_QUE(user,"?")]) ([ADMIN_FLW(user,"FLW")]) suicided with [src.name] at ([user.x],[user.y],[user.z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)",0,1)
@@ -120,7 +120,7 @@
user.gib()
return OBLITERATION
/obj/item/grenade/plastic/update_icon()
/obj/item/grenade/plastic/update_icon_state()
if(nadeassembly)
icon_state = "[item_state]1"
else
@@ -153,7 +153,6 @@
if(target)
if(!QDELETED(target))
location = get_turf(target)
target.overlays -= image_overlay
if(!ex_breach && istype(target, /turf/simulated/wall)) //Walls get dismantled instead of destroyed to avoid making unwanted holes to space.
var/turf/simulated/wall/W = target
W.dismantle_wall(TRUE, TRUE)
@@ -219,7 +218,6 @@
if(target)
if(!QDELETED(target))
location = get_turf(target)
target.overlays -= image_overlay
else
location = get_turf(src)
if(location)
@@ -48,14 +48,8 @@
igniter.flamethrower_process(location)
/obj/item/flamethrower/update_icon()
cut_overlays()
if(igniter)
add_overlay("+igniter[status]")
if(ptank)
add_overlay("+ptank")
/obj/item/flamethrower/update_icon_state()
if(lit)
add_overlay("+lit")
item_state = "flamethrower_1"
else
item_state = "flamethrower_0"
@@ -64,6 +58,15 @@
M.update_inv_l_hand()
M.update_inv_r_hand()
/obj/item/flamethrower/update_overlays()
. = ..()
if(igniter)
. += "+igniter[status]"
if(ptank)
. += "+ptank"
if(lit)
. += "+lit"
/obj/item/flamethrower/can_enter_storage(obj/item/storage/S, mob/user)
if(lit)
to_chat(user, "<span class='warning'>[S] can't hold [src] while it's lit!</span>")
+12 -20
View File
@@ -10,32 +10,24 @@
icon_state = "garrot_wrap"
w_class = WEIGHT_CLASS_TINY
var/mob/living/carbon/human/strangling
var/improvised = 0
var/improvised = FALSE
var/garrote_time
/obj/item/twohanded/garrote/Destroy()
strangling = null
return ..()
/obj/item/twohanded/garrote/update_icon()
/obj/item/twohanded/garrote/update_icon_state()
if(strangling) // If we're strangling someone we want our icon to stay wielded
icon_state = "garrot_unwrap"
return
icon_state = "garrot_[wielded ? "un" : ""]wrap"
icon_state = "garrot_[improvised ? "I_" : ""]unwrap"
else
icon_state = "garrot_[improvised ? "I_" : ""][wielded ? "un" : ""]wrap"
/obj/item/twohanded/garrote/improvised // Made via tablecrafting
name = "garrote"
desc = "A length of cable with a shoddily-carved wooden handle tied to either end.<br>You suspect you'd have to be behind the target to use this weapon effectively."
icon_state = "garrot_I_wrap"
improvised = 1
/obj/item/twohanded/garrote/improvised/update_icon()
if(strangling)
icon_state = "garrot_I_unwrap"
return
icon_state = "garrot_I_[wielded ? "un" : ""]wrap"
improvised = TRUE
/obj/item/twohanded/garrote/wield(mob/living/carbon/user)
if(strangling)
@@ -43,7 +35,7 @@
"<span class='warning'>You remove [src] from [strangling]'s neck.</span>")
strangling = null
update_icon()
update_icon(UPDATE_ICON_STATE)
STOP_PROCESSING(SSobj, src)
else
@@ -99,7 +91,7 @@
garrote_time = world.time + 10
START_PROCESSING(SSobj, src)
strangling = M
update_icon()
update_icon(UPDATE_ICON_STATE)
playsound(src.loc, 'sound/weapons/cablecuff.ogg', 15, 1, -1)
@@ -112,14 +104,14 @@
/obj/item/twohanded/garrote/process()
if(!strangling)
// Our mark got gibbed or similar
update_icon()
update_icon(UPDATE_ICON_STATE)
STOP_PROCESSING(SSobj, src)
return
if(!istype(loc, /mob/living/carbon/human))
strangling = null
update_icon()
update_icon(UPDATE_ICON_STATE)
STOP_PROCESSING(SSobj, src)
return
@@ -137,7 +129,7 @@
"<span class='warning'>You lose your grip on [strangling]'s neck.</span>")
strangling = null
update_icon()
update_icon(UPDATE_ICON_STATE)
STOP_PROCESSING(SSobj, src)
return
@@ -147,7 +139,7 @@
"<span class='warning'>You lose your grip on [strangling]'s neck.</span>")
strangling = null
update_icon()
update_icon(UPDATE_ICON_STATE)
STOP_PROCESSING(SSobj, src)
return
@@ -50,22 +50,10 @@
return O
return null
/obj/item/grenade/chem_grenade/proc/update_overlays()
underlays = list()
if(nadeassembly)
underlays += "[nadeassembly.a_left.icon_state]_left"
for(var/O in nadeassembly.a_left.attached_overlays)
underlays += "[O]_l"
underlays += "[nadeassembly.a_right.icon_state]_right"
for(var/O in nadeassembly.a_right.attached_overlays)
underlays += "[O]_r"
/obj/item/grenade/chem_grenade/update_icon()
/obj/item/grenade/chem_grenade/update_icon_state()
if(nadeassembly)
icon = 'icons/obj/assemblies/new_assemblies.dmi'
icon_state = bomb_state
update_overlays()
var/obj/item/assembly/A = get_trigger()
if(stage != READY)
name = "bomb casing[label]"
@@ -90,6 +78,15 @@
else
icon_state += "_locked"
name = payload_name + "grenade" + label
underlays.Cut()
if(nadeassembly)
underlays += "[nadeassembly.a_left.icon_state]_left"
for(var/O in nadeassembly.a_left.attached_overlays)
underlays += "[O]_l"
underlays += "[nadeassembly.a_right.icon_state]_right"
for(var/O in nadeassembly.a_right.attached_overlays)
underlays += "[O]_r"
/obj/item/grenade/chem_grenade/attack_self(mob/user)
@@ -98,7 +95,7 @@
var/area/A = get_area(bombturf)
if(nadeassembly)
nadeassembly.attack_self(user)
update_icon()
update_icon(UPDATE_ICON_STATE)
else if(clown_check(user))
// This used to go before the assembly check, but that has absolutely zero to do with priming the damn thing. You could spam the admins with it.
log_game("[key_name(usr)] has primed a [name] for detonation at [A.name] ([bombturf.x],[bombturf.y],[bombturf.z]) [contained].")
@@ -133,7 +130,7 @@
else
if(label)
label = null
update_icon()
update_icon(UPDATE_ICON_STATE)
to_chat(user, "You remove the label from [src].")
return 1
if(istype(I, /obj/item/screwdriver))
@@ -142,7 +139,7 @@
to_chat(user, "<span class='notice'>You lock the assembly.</span>")
playsound(loc, prime_sound, 25, -3)
stage = READY
update_icon()
update_icon(UPDATE_ICON_STATE)
contained = ""
cores = "" // clear them out so no recursive logging by accidentally
for(var/obj/O in beakers)
@@ -195,7 +192,7 @@
assemblyattacher = user.ckey
stage = WIRED
to_chat(user, "<span class='notice'>You add [A] to [src]!</span>")
update_icon()
update_icon(UPDATE_ICON_STATE)
else if(stage == EMPTY && istype(I, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = I
@@ -203,12 +200,12 @@
stage = WIRED
to_chat(user, "<span class='notice'>You rig [src].</span>")
update_icon()
update_icon(UPDATE_ICON_STATE)
else if(stage == READY && istype(I, /obj/item/wirecutters))
to_chat(user, "<span class='notice'>You unlock the assembly.</span>")
stage = WIRED
update_icon()
update_icon(UPDATE_ICON_STATE)
else if(stage == WIRED && istype(I, /obj/item/wrench))
to_chat(user, "<span class='notice'>You open the grenade and remove the contents.</span>")
@@ -223,7 +220,7 @@
for(var/obj/O in beakers)
O.forceMove(get_turf(src))
beakers = list()
update_icon()
update_icon(UPDATE_ICON_STATE)
//assembly stuff
@@ -286,7 +283,7 @@
O.forceMove(get_turf(src))
beakers = list()
stage = EMPTY
update_icon()
update_icon(UPDATE_ICON_STATE)
return
if(nadeassembly)
@@ -448,7 +445,7 @@
beakers += B1
beakers += B2
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/grenade/chem_grenade/firefighting
@@ -466,7 +463,7 @@
beakers += B1
beakers += B2
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/grenade/chem_grenade/incendiary
payload_name = "incendiary"
@@ -485,7 +482,7 @@
beakers += B1
beakers += B2
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/grenade/chem_grenade/antiweed
@@ -506,7 +503,7 @@
beakers += B1
beakers += B2
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/grenade/chem_grenade/cleaner
@@ -526,7 +523,7 @@
beakers += B1
beakers += B2
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/grenade/chem_grenade/teargas
@@ -546,7 +543,7 @@
beakers += B1
beakers += B2
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/grenade/chem_grenade/facid
payload_name = "acid smoke"
@@ -566,7 +563,7 @@
beakers += B1
beakers += B2
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/grenade/chem_grenade/saringas
payload_name = "sarin gas"
@@ -585,7 +582,7 @@
beakers += B1
beakers += B2
update_icon()
update_icon(UPDATE_ICON_STATE)
#undef EMPTY
#undef WIRED
@@ -42,8 +42,6 @@
/obj/item/implanter/mindshield/New()
imp = new /obj/item/implant/mindshield(src)
..()
update_icon()
/obj/item/implantcase/mindshield
name = "implant case - 'mindshield'"
@@ -12,18 +12,22 @@
materials = list(MAT_GLASS=500)
var/obj/item/implant/imp = null
/obj/item/implantcase/update_icon()
/obj/item/implantcase/proc/update_state()
if(imp)
icon_state = "implantcase-[imp.item_color]"
origin_tech = imp.origin_tech
flags = imp.flags & ~DROPDEL
reagents = imp.reagents
else
icon_state = "implantcase-0"
origin_tech = initial(origin_tech)
flags = initial(flags)
reagents = null
update_icon(UPDATE_ICON_STATE)
/obj/item/implantcase/update_icon_state()
if(imp)
icon_state = "implantcase-[imp.item_color]"
else
icon_state = "implantcase-0"
/obj/item/implantcase/attackby(obj/item/W, mob/user, params)
@@ -38,8 +42,8 @@
I.imp.loc = src
imp = I.imp
I.imp = null
update_icon()
I.update_icon()
update_state()
I.update_icon(UPDATE_ICON_STATE)
else
if(imp)
if(I.imp)
@@ -47,8 +51,8 @@
imp.loc = I
I.imp = imp
imp = null
update_icon()
I.update_icon()
update_state()
I.update_icon(UPDATE_ICON_STATE)
/*else if(istype(W, /obj/item/ammo_casing/shotgun/implanter))
var/obj/item/ammo_casing/shotgun/implanter/I = W
@@ -57,7 +61,7 @@
/obj/item/implantcase/New()
..()
update_icon()
update_state()
/obj/item/implantcase/tracking
@@ -13,7 +13,7 @@
var/obj/item/implant/imp = null
/obj/item/implanter/update_icon()
/obj/item/implanter/update_icon_state()
if(imp)
icon_state = "implanter1"
origin_tech = imp.origin_tech
@@ -38,7 +38,7 @@
else
M.visible_message("[user] has implanted [M].", "<span class='notice'>[user] implants you.</span>")
imp = null
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/implanter/attackby(obj/item/W, mob/user, params)
..()
@@ -48,7 +48,7 @@
/obj/item/implanter/New()
..()
spawn(1)
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/implanter/adrenalin
@@ -14,12 +14,11 @@
dropcase()
return ..()
/obj/item/implantpad/update_icon()
/obj/item/implantpad/update_icon_state()
if(case)
src.icon_state = "implantpad-1"
icon_state = "implantpad-1"
else
src.icon_state = "implantpad-0"
return
icon_state = "implantpad-0"
/obj/item/implantpad/proc/addcase(mob/user as mob, obj/item/implantcase/C as obj)
if(!user || !C)
@@ -30,7 +29,7 @@
user.unEquip(C)
C.forceMove(src)
case = C
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/implantpad/proc/dropcase(mob/user as mob)
if(!case)
@@ -41,12 +40,12 @@
add_fingerprint(user)
case.add_fingerprint(user)
case = null
update_icon()
update_icon(UPDATE_ICON_STATE)
return
case.forceMove(get_turf(src))
case = null
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/implantpad/verb/remove_implant()
set category = "Object"
+2 -2
View File
@@ -26,7 +26,7 @@
/obj/item/restraints/legcuffs/beartrap/New()
..()
/obj/item/restraints/legcuffs/beartrap/update_icon()
/obj/item/restraints/legcuffs/beartrap/update_icon_state()
icon_state = "beartrap[armed]"
/obj/item/restraints/legcuffs/beartrap/Destroy()
@@ -43,7 +43,7 @@
..()
if(ishuman(user) && !user.stat && !user.restrained())
armed = !armed
update_icon()
update_icon(UPDATE_ICON_STATE)
to_chat(user, "<span class='notice'>[src] is now [armed ? "armed" : "disarmed"]</span>")
/obj/item/restraints/legcuffs/beartrap/attackby(obj/item/I, mob/user) //Let's get explosive.
+1 -2
View File
@@ -70,9 +70,8 @@
return ..()
/obj/item/mop/proc/janicart_insert(mob/user, obj/structure/janitorialcart/J)
J.mymop = src
J.put_in_cart(src, user)
J.mymop=src
J.update_icon()
/obj/item/mop/wash(mob/user, atom/source)
reagents.add_reagent("water", 5)
+1
View File
@@ -14,6 +14,7 @@
possible_transfer_amounts = list(5,10,20,30,50,70)
volume = 70
container_type = OPENCONTAINER
blocks_emissive = EMISSIVE_BLOCK_GENERIC
/obj/item/reagent_containers/glass/paint/afterattack(turf/simulated/target, mob/user, proximity)
if(!proximity)
+20 -29
View File
@@ -45,7 +45,7 @@
playsound(loc, 'sound/items/eatfood.ogg', 50, 1, -1)
return TOXLOSS
/obj/item/storage/bag/trash/update_icon()
/obj/item/storage/bag/trash/update_icon_state()
switch(contents.len)
if(21 to INFINITY)
icon_state = "[initial(icon_state)]3"
@@ -59,14 +59,12 @@
var/mob/living/carbon/human/H = loc
H.update_inv_l_hand()
H.update_inv_r_hand()
..()
/obj/item/storage/bag/trash/cyborg
/obj/item/storage/bag/trash/proc/janicart_insert(mob/user, obj/structure/janitorialcart/J)
J.mybag = src
J.put_in_cart(src, user)
J.mybag=src
J.update_icon()
/obj/item/storage/bag/trash/cyborg/janicart_insert(mob/user, obj/structure/janitorialcart/J)
return
@@ -405,58 +403,51 @@
if(prob(10))
M.Weaken(4 SECONDS)
/obj/item/storage/bag/tray/proc/rebuild_overlays()
overlays.Cut()
/obj/item/storage/bag/tray/update_icon_state()
return
/obj/item/storage/bag/tray/update_overlays()
. = ..()
for(var/obj/item/I in contents)
overlays += image("icon" = I.icon, "icon_state" = I.icon_state, "layer" = -1)
/obj/item/storage/bag/tray/remove_from_storage(obj/item/W as obj, atom/new_location)
..()
rebuild_overlays()
/obj/item/storage/bag/tray/handle_item_insertion(obj/item/I, prevent_warning = 0)
overlays += image("icon" = I.icon, "icon_state" = I.icon_state, "layer" = -1)
..()
. += image(icon = I.icon, icon_state = I.icon_state, layer = -1)
/obj/item/storage/bag/tray/cyborg
/obj/item/storage/bag/tray/cyborg/afterattack(atom/target, mob/user as mob)
if( isturf(target) || istype(target,/obj/structure/table) )
var/foundtable = istype(target,/obj/structure/table/)
if( !foundtable ) //it must be a turf!
var/found_table = istype(target,/obj/structure/table/)
if(!found_table) //it must be a turf!
for(var/obj/structure/table/T in target)
foundtable = 1
found_table = TRUE
break
var/turf/dropspot
if( !foundtable ) // don't unload things onto walls or other silly places.
if(!found_table) // don't unload things onto walls or other silly places.
dropspot = user.loc
else if( isturf(target) ) // they clicked on a turf with a table in it
dropspot = target
else // they clicked on a table
dropspot = target.loc
overlays = null
var/droppedSomething = 0
var/dropped_something = FALSE
for(var/obj/item/I in contents)
I.loc = dropspot
contents.Remove(I)
droppedSomething = 1
if(!foundtable && isturf(dropspot))
dropped_something = TRUE
if(!found_table && isturf(dropspot))
// if no table, presume that the person just shittily dropped the tray on the ground and made a mess everywhere!
spawn()
for(var/i = 1, i <= rand(1,2), i++)
if(I)
step(I, pick(NORTH,SOUTH,EAST,WEST))
sleep(rand(2,4))
if( droppedSomething )
if( foundtable )
if(dropped_something)
if(found_table)
user.visible_message("<span class='notice'>[user] unloads [user.p_their()] service tray.</span>")
else
user.visible_message("<span class='notice'>[user] drops all the items on [user.p_their()] tray.</span>")
update_icon(UPDATE_OVERLAYS)
return ..()
@@ -466,8 +457,8 @@
/obj/item/storage/bag/tray/cookies_tray/populate_contents() // By Azule Utama, thank you a lot!
for(var/i in 1 to 6)
var/obj/item/C = new cookie(src)
handle_item_insertion(C) // Done this way so the tray actually has the cookies visible when spawned
rebuild_overlays()
C.in_inventory = TRUE
update_icon(UPDATE_OVERLAYS)
/obj/item/storage/bag/tray/cookies_tray/sugarcookie
cookie = /obj/item/reagent_containers/food/snacks/sugarcookie
@@ -13,14 +13,13 @@
/// Do we have overlays for items held inside the belt?
var/use_item_overlays = FALSE
/obj/item/storage/belt/update_icon()
/obj/item/storage/belt/update_overlays()
. = ..()
if(use_item_overlays)
cut_overlays()
for(var/obj/item/I in contents)
var/image/belt_image = image(icon, I.belt_icon)
belt_image.color = I.color
add_overlay(belt_image)
..()
. += belt_image
/obj/item/storage/belt/proc/can_use()
return is_equipped()
@@ -433,8 +432,7 @@
. = ..()
update_icon()
/obj/item/storage/belt/lazarus/update_icon()
..()
/obj/item/storage/belt/lazarus/update_icon_state()
icon_state = "[initial(icon_state)]_[length(contents)]"
/obj/item/storage/belt/lazarus/attackby(obj/item/I, mob/user)
@@ -465,8 +463,7 @@
for(var/I in 1 to 8)
new /obj/item/ammo_casing/shotgun/beanbag(src)
/obj/item/storage/belt/bandolier/update_icon()
..()
/obj/item/storage/belt/bandolier/update_icon_state()
icon_state = "[initial(icon_state)]_[length(contents)]"
/obj/item/storage/belt/bandolier/attackby(obj/item/I, mob/user)
@@ -611,13 +608,13 @@
return
playsound(src, 'sound/weapons/blade_unsheath.ogg', 20)
/obj/item/storage/belt/rapier/update_icon()
. = ..()
icon_state = initial(icon_state)
item_state = initial(item_state)
/obj/item/storage/belt/rapier/update_icon_state()
if(length(contents))
icon_state = "[icon_state]-rapier"
item_state = "[item_state]-rapier"
else
icon_state = initial(icon_state)
item_state = initial(item_state)
if(isliving(loc))
var/mob/living/L = loc
L.update_inv_belt()
@@ -724,10 +724,26 @@
foldable = null
var/design = NODESIGN
/obj/item/storage/box/papersack/update_icon()
if(!contents.len)
/obj/item/storage/box/papersack/update_desc()
. = ..()
switch(design)
if(NODESIGN)
desc = "A sack neatly crafted out of paper."
if(NANOTRASEN)
desc = "A standard Nanotrasen paper lunch sack for loyal employees on the go."
if(SYNDI)
desc = "The design on this paper sack is a remnant of the notorious 'SyndieSnacks' program."
if(HEART)
desc = "A paper sack with a heart etched onto the side."
if(SMILE)
desc = "A paper sack with a crude smile etched onto the side."
/obj/item/storage/box/papersack/update_icon_state()
item_state = "paperbag_[design]"
if(!length(contents))
icon_state = "[item_state]"
else icon_state = "[item_state]_closed"
else
icon_state = "[item_state]_closed"
/obj/item/storage/box/papersack/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/pen))
@@ -746,19 +762,7 @@
return
to_chat(usr, "<span class='notice'>You make some modifications to [src] using your pen.</span>")
design = switchDesign
icon_state = "paperbag_[design]"
item_state = "paperbag_[design]"
switch(design)
if(NODESIGN)
desc = "A sack neatly crafted out of paper."
if(NANOTRASEN)
desc = "A standard Nanotrasen paper lunch sack for loyal employees on the go."
if(SYNDI)
desc = "The design on this paper sack is a remnant of the notorious 'SyndieSnacks' program."
if(HEART)
desc = "A paper sack with a heart etched onto the side."
if(SMILE)
desc = "A paper sack with a crude smile etched onto the side."
update_appearance(UPDATE_DESC|UPDATE_ICON_STATE)
return
else if(is_sharp(W))
if(!contents.len)
@@ -18,10 +18,8 @@
resistance_flags = FLAMMABLE
var/icon_type
/obj/item/storage/fancy/update_icon(itemremoved = 0)
var/total_contents = length(contents) - itemremoved
icon_state = "[icon_type]box[total_contents]"
return
/obj/item/storage/fancy/update_icon_state()
icon_state = "[icon_type]box[length(contents)]"
/obj/item/storage/fancy/examine(mob/user)
. = ..()
@@ -48,23 +46,23 @@
foldable = /obj/item/stack/sheet/cardboard
foldable_amt = 1
/obj/item/storage/fancy/donut_box/update_icon()
overlays.Cut()
/obj/item/storage/fancy/donut_box/update_overlays()
. = ..()
for(var/I = 1 to length(contents))
var/obj/item/reagent_containers/food/snacks/donut/donut = contents[I]
var/icon/new_donut_icon = icon('icons/obj/food/containers.dmi', "donut_[donut.donut_sprite_type]")
new_donut_icon.Shift(EAST, 3 * (I-1))
overlays += new_donut_icon
. += new_donut_icon
overlays += icon('icons/obj/food/containers.dmi', "donutbox_front")
. += "donutbox_front"
/obj/item/storage/fancy/donut_box/populate_contents()
for(var/I in 1 to storage_slots)
new /obj/item/reagent_containers/food/snacks/donut(src)
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/item/storage/fancy/donut_box/empty/populate_contents()
update_icon(UPDATE_OVERLAYS)
return
/*
@@ -138,11 +136,11 @@
new /obj/item/toy/crayon/black(src)
update_icon()
/obj/item/storage/fancy/crayons/update_icon()
overlays = list() //resets list
overlays += image('icons/obj/crayons.dmi',"crayonbox")
/obj/item/storage/fancy/crayons/update_overlays()
. = ..()
. += image('icons/obj/crayons.dmi',"crayonbox")
for(var/obj/item/toy/crayon/crayon in contents)
overlays += image('icons/obj/crayons.dmi',crayon.colourName)
. += image('icons/obj/crayons.dmi',crayon.colourName)
/obj/item/storage/fancy/crayons/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/toy/crayon))
@@ -184,7 +182,7 @@
for(var/I in 1 to storage_slots)
new cigarette_type(src)
/obj/item/storage/fancy/cigarettes/update_icon()
/obj/item/storage/fancy/cigarettes/update_icon_state()
icon_state = "[initial(icon_state)][contents.len]"
/obj/item/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
@@ -325,10 +323,10 @@
for(var/I in 1 to storage_slots)
new /obj/item/rollingpaper(src)
/obj/item/storage/fancy/rollingpapers/update_icon()
overlays.Cut()
/obj/item/storage/fancy/rollingpapers/update_overlays()
. = ..()
if(!contents.len)
overlays += "[icon_state]_empty"
. += "[icon_state]_empty"
/*
* Vial Box
@@ -364,15 +362,18 @@
. = ..()
update_icon()
/obj/item/storage/lockbox/vials/update_icon()
/obj/item/storage/lockbox/vials/update_icon_state()
icon_state = "vialbox[length(contents)]"
cut_overlays()
/obj/item/storage/lockbox/vials/update_overlays()
. = ..()
if(!broken)
overlays += image(icon, src, "led[locked]")
. += "led[locked]"
if(locked)
overlays += image(icon, src, "cover")
. += "cover"
else
overlays += image(icon, src, "ledb")
. += "ledb"
/obj/item/storage/lockbox/vials/attackby(obj/item/I, mob/user, params)
..()
@@ -460,7 +460,7 @@
if(istype(src, /obj/item/storage/fancy))
var/obj/item/storage/fancy/F = src
F.update_icon(TRUE)
F.update_icon()
for(var/_M in mobs_viewing)
var/mob/M = _M
@@ -24,16 +24,16 @@
. = ..()
if(has_latches)
if(prob(10))
latches = "double_latch"
if(prob(1))
latches = "triple_latch"
update_icon()
else
latches = "double_latch"
update_icon(UPDATE_OVERLAYS)
/obj/item/storage/toolbox/update_icon()
..()
cut_overlays()
/obj/item/storage/toolbox/update_overlays()
. = ..()
if(has_latches)
add_overlay(latches)
. += latches
/obj/item/storage/toolbox/emergency
name = "emergency toolbox"
@@ -36,17 +36,16 @@
if(.)
if(W == front_id)
front_id = null
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/storage/wallet/handle_item_insertion(obj/item/W as obj, prevent_warning = 0)
. = ..(W, prevent_warning)
if(.)
if(!front_id && istype(W, /obj/item/card/id))
front_id = W
update_icon()
/obj/item/storage/wallet/update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/storage/wallet/update_icon_state()
if(front_id)
switch(front_id.icon_state)
if("silver")
@@ -112,7 +111,7 @@
desc = "A cheap, [item_color] wallet from the arcade."
icon_state = "[item_color]_wallet"
/obj/item/storage/wallet/color/update_icon()
/obj/item/storage/wallet/color/update_icon_state()
if(front_id)
switch(front_id.icon_state)
if("silver")
+4 -4
View File
@@ -59,7 +59,7 @@
user.visible_message("<span class='suicide'>[user] is putting the live [name] in [user.p_their()] mouth! It looks like [user.p_theyre()] trying to commit suicide.</span>")
return FIRELOSS
/obj/item/melee/baton/update_icon()
/obj/item/melee/baton/update_icon_state()
if(turned_on)
icon_state = "[base_icon]_active"
else if(!cell)
@@ -97,7 +97,7 @@
if(cell.rigged)
cell = null
turned_on = FALSE
update_icon()
update_icon(UPDATE_ICON_STATE)
if(cell.charge < (hitcost)) // If after the deduction the baton doesn't have enough charge for a stun hit it turns off.
turned_on = FALSE
update_icon()
@@ -117,7 +117,7 @@
I.forceMove(src)
cell = I
to_chat(user, "<span class='notice'>You install [I] into [src].</span>")
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/melee/baton/screwdriver_act(mob/living/user, obj/item/I)
if(!cell)
@@ -131,7 +131,7 @@
cell.update_icon()
cell = null
turned_on = FALSE
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/melee/baton/attack_self(mob/user)
if(cell?.charge >= hitcost)
@@ -61,7 +61,7 @@
if(!silent)
to_chat(C, "<span class='warning'>You are not wearing a suitable mask or helmet.</span>")
return FALSE
if(M.mask_adjusted) // If the mask is equipped but pushed down
if(M.up) // If the mask is equipped but pushed away
M.adjustmask(C) // Adjust it back
if(!silent)
+2 -4
View File
@@ -10,8 +10,7 @@
/obj/item/stack/tape_roll/New(loc, amount=null)
..()
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/stack/tape_roll/attack(mob/living/carbon/human/M, mob/living/user)
if(!istype(M)) //What good is a duct tape mask if you are unable to speak?
@@ -42,7 +41,7 @@
M.equip_to_slot(G, slot_wear_mask)
G.add_fingerprint(user)
/obj/item/stack/tape_roll/update_icon()
/obj/item/stack/tape_roll/update_icon_state()
var/amount = get_amount()
if((amount <= 2) && (amount > 0))
icon_state = "taperoll"
@@ -54,4 +53,3 @@
icon_state = "taperoll-4"
else
icon_state = "taperoll-4"
..()
+9 -15
View File
@@ -202,9 +202,8 @@
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 100, ACID = 30)
resistance_flags = FIRE_PROOF
/obj/item/twohanded/fireaxe/update_icon() //Currently only here to fuck with the on-mob icons.
/obj/item/twohanded/fireaxe/update_icon_state() //Currently only here to fuck with the on-mob icons.
icon_state = "fireaxe[wielded]"
..()
/obj/item/twohanded/fireaxe/afterattack(atom/A, mob/user, proximity)
if(!proximity)
@@ -221,7 +220,7 @@
force_wielded = 23
needs_permit = TRUE
/obj/item/twohanded/fireaxe/boneaxe/update_icon()
/obj/item/twohanded/fireaxe/boneaxe/update_icon_state()
icon_state = "bone_axe[wielded]"
/obj/item/twohanded/fireaxe/energized
@@ -231,7 +230,7 @@
var/charge = 30
var/max_charge = 30
/obj/item/twohanded/fireaxe/energized/update_icon()
/obj/item/twohanded/fireaxe/energized/update_icon_state()
if(wielded)
icon_state = "fireaxe2"
else
@@ -298,14 +297,13 @@
if(!blade_color)
blade_color = pick("red", "blue", "green", "purple")
/obj/item/twohanded/dualsaber/update_icon()
/obj/item/twohanded/dualsaber/update_icon_state()
if(wielded)
icon_state = "dualsaber[blade_color][wielded]"
set_light(brightness_on, l_color=colormap[blade_color])
else
icon_state = "dualsaber0"
set_light(0)
..()
/obj/item/twohanded/dualsaber/attack(mob/target, mob/living/user)
if(HAS_TRAIT(user, TRAIT_HULK))
@@ -406,7 +404,7 @@
needs_permit = TRUE
var/icon_prefix = "spearglass"
/obj/item/twohanded/spear/update_icon()
/obj/item/twohanded/spear/update_icon_state()
icon_state = "[icon_prefix][wielded]"
/obj/item/twohanded/spear/CheckParts(list/parts_list)
@@ -609,12 +607,11 @@
attack_verb = list("sawed", "cut", "hacked", "carved", "cleaved", "butchered", "felled", "timbered")
sharp = TRUE
/obj/item/twohanded/chainsaw/update_icon()
/obj/item/twohanded/chainsaw/update_icon_state()
if(wielded)
icon_state = "chainsaw[wielded]"
else
icon_state = "chainsaw0"
..()
/obj/item/twohanded/chainsaw/attack(mob/living/target, mob/living/user)
if(wielded)
@@ -685,9 +682,8 @@
if(charged < 2)
charged++
/obj/item/twohanded/singularityhammer/update_icon() //Currently only here to fuck with the on-mob icons.
/obj/item/twohanded/singularityhammer/update_icon_state() //Currently only here to fuck with the on-mob icons.
icon_state = "singulohammer[wielded]"
..()
/obj/item/twohanded/singularityhammer/proc/vortex(turf/pull, mob/wielder)
for(var/atom/movable/X in orange(5, pull))
@@ -762,9 +758,8 @@
L.Stun(6 SECONDS)
shock(L)
/obj/item/twohanded/mjollnir/update_icon() //Currently only here to fuck with the on-mob icons.
/obj/item/twohanded/mjollnir/update_icon_state() //Currently only here to fuck with the on-mob icons.
icon_state = "mjollnir[wielded]"
..()
/obj/item/twohanded/knighthammer
name = "singuloth knight's hammer"
@@ -793,9 +788,8 @@
if(charged < 5)
charged++
/obj/item/twohanded/knighthammer/update_icon() //Currently only here to fuck with the on-mob icons.
/obj/item/twohanded/knighthammer/update_icon_state() //Currently only here to fuck with the on-mob icons.
icon_state = "knighthammer[wielded]"
..()
/obj/item/twohanded/knighthammer/afterattack(atom/A, mob/user, proximity)
if(!proximity)