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
+4 -4
View File
@@ -1863,7 +1863,7 @@
if(!P.ico)
P.ico = new
P.ico += "paper_stamp-[stampvalue]"
P.overlays += stampoverlay
P.stamp_overlays += stampoverlay
P.stamps += "<hr><img src='large_stamp-[stampvalue].png'>"
P.update_icon()
P.faxmachineid = fax.UID()
@@ -2233,7 +2233,7 @@
if(!P.ico)
P.ico = new
P.ico += "paper_stamp-[stampvalue]"
P.overlays += stampoverlay
P.stamp_overlays += stampoverlay
P.stamps += "<hr><img src='large_stamp-[stampvalue].png'>"
P.update_icon()
fax.receivefax(P)
@@ -2445,14 +2445,14 @@
if(!P.stamped)
P.stamped = new
P.stamped += /obj/item/stamp/centcom
P.overlays += stampoverlay
P.stamp_overlays += stampoverlay
P.stamps += "<hr><img src='large_stamp-[stampvalue].png'>"
else if(stamptype == "text")
if(!P.stamped)
P.stamped = new
P.stamped += /obj/item/stamp
P.overlays += stampoverlay
P.stamp_overlays += stampoverlay
P.stamps += "<hr><i>[stampvalue]</i>"
if(destination != "All Departments")
@@ -9,7 +9,8 @@
..()
update_name()
/obj/effect/proc_holder/spell/vampire/self/cloak/proc/update_name()
/obj/effect/proc_holder/spell/vampire/self/cloak/update_name()
. = ..()
var/mob/living/user = loc
if(!ishuman(user) || !user.mind)
return
-3
View File
@@ -88,9 +88,6 @@
default_deconstruction_crowbar(user, I)
return TRUE
/obj/machinery/arcade/update_icon()
return
/obj/machinery/arcade/proc/pay_with_cash(obj/item/stack/spacecash/cashmoney, mob/user)
if(cashmoney.amount < token_price)
to_chat(user, "[bicon(cashmoney)] <span class='warning'>That is not enough money.</span>")
+2 -2
View File
@@ -71,12 +71,12 @@
/obj/item/stack/tickets/New(loc, amount=null)
..()
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/stack/tickets/attack_self(mob/user as mob)
return
/obj/item/stack/tickets/update_icon()
/obj/item/stack/tickets/update_icon_state()
switch(get_amount())
if(1 to 3)
icon_state = "tickets_1" // One ticket
+3 -3
View File
@@ -20,7 +20,7 @@ GLOBAL_VAR(claw_game_html)
/obj/machinery/arcade/claw/Initialize(mapload)
. = ..()
machine_image = pick("_1", "_2")
update_icon()
update_icon(UPDATE_ICON_STATE)
component_parts = list()
component_parts += new /obj/item/circuitboard/clawgame(null)
@@ -39,7 +39,7 @@ GLOBAL_VAR(claw_game_html)
bin_upgrades = B.rating
bonus_prize_chance = bin_upgrades * 5 //equals +5% chance per matter bin rating level (+20% with rating 4)
/obj/machinery/arcade/claw/update_icon()
/obj/machinery/arcade/claw/update_icon_state()
if(stat & BROKEN)
icon_state = "clawmachine[machine_image]_broken"
else if(panel_open)
@@ -58,7 +58,7 @@ GLOBAL_VAR(claw_game_html)
atom_say("WINNER!")
new /obj/item/toy/prizeball(get_turf(src))
playsound(loc, 'sound/arcade/win.ogg', 50, TRUE)
addtimer(CALLBACK(src, .proc/update_icon), 10)
addtimer(CALLBACK(src, /atom/.proc/update_icon, UPDATE_ICON_STATE), 10)
/obj/machinery/arcade/claw/start_play(mob/user as mob)
..()
@@ -32,12 +32,11 @@
..()
check_connection()
/obj/machinery/computer/mob_battle_terminal/update_icon()
/obj/machinery/computer/mob_battle_terminal/update_icon_state()
if(card)
icon_state = "mob_battle_loaded"
else
icon_state = "mob_battle_empty"
..()
/obj/machinery/computer/mob_battle_terminal/Destroy()
eject_card(1)
+2 -3
View File
@@ -20,7 +20,7 @@
component_parts += new /obj/item/stack/sheet/glass(null)
RefreshParts()
/obj/machinery/prize_counter/update_icon()
/obj/machinery/prize_counter/update_icon_state()
if(stat & BROKEN)
icon_state = "prize_counter-broken"
else if(panel_open)
@@ -29,7 +29,6 @@
icon_state = "prize_counter-off"
else
icon_state = "prize_counter-on"
return
/obj/machinery/prize_counter/attackby(obj/item/O as obj, mob/user as mob, params)
if(istype(O, /obj/item/stack/tickets))
@@ -44,7 +43,7 @@
playsound(src.loc, O.usesound, 50, 1)
panel_open = !panel_open
to_chat(user, "You [panel_open ? "open" : "close"] the maintenance panel.")
update_icon()
update_icon(UPDATE_ICON_STATE)
return
if(panel_open)
if(istype(O, /obj/item/wrench))
+7 -4
View File
@@ -16,13 +16,16 @@
. = ..()
. += bombtank.examine(user)
/obj/item/onetankbomb/update_icon()
/obj/item/onetankbomb/update_icon_state()
if(bombtank)
icon_state = bombtank.icon_state
/obj/item/onetankbomb/update_overlays()
. = ..()
if(bombassembly)
overlays += bombassembly.icon_state
overlays += bombassembly.overlays
overlays += "bomb_assembly"
. += bombassembly.icon_state
. += bombassembly.overlays
. += "bomb_assembly"
/obj/item/onetankbomb/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/analyzer))
+7 -7
View File
@@ -51,7 +51,7 @@
a_left = A1
a_right = A2
name = "[A1.name]-[A2.name] assembly"
update_icon()
update_icon(UPDATE_OVERLAYS)
return TRUE
/obj/item/assembly_holder/proc/has_prox_sensors()
@@ -59,16 +59,16 @@
return TRUE
return FALSE
/obj/item/assembly_holder/update_icon()
overlays.Cut()
/obj/item/assembly_holder/update_overlays()
. = ..()
if(a_left)
overlays += "[a_left.icon_state]_left"
. += "[a_left.icon_state]_left"
for(var/O in a_left.attached_overlays)
overlays += "[O]_l"
. += "[O]_l"
if(a_right)
overlays += "[a_right.icon_state]_right"
. += "[a_right.icon_state]_right"
for(var/O in a_right.attached_overlays)
overlays += "[O]_r"
. += "[O]_r"
if(master)
master.update_icon()
+4 -5
View File
@@ -61,13 +61,12 @@
toggle_secure()
on = TRUE
/obj/item/assembly/infra/update_icon()
overlays.Cut()
/obj/item/assembly/infra/update_overlays()
. = ..()
attached_overlays = list()
if(on)
overlays += "infrared_on"
. += "infrared_on"
attached_overlays += "infrared_on"
if(holder)
holder.update_icon()
@@ -228,7 +227,7 @@
if(next)
next.vis_spread(v)
/obj/effect/beam/i_beam/update_icon()
/obj/effect/beam/i_beam/update_icon_state()
transform = turn(matrix(), dir2angle(dir))
/obj/effect/beam/i_beam/process()
+1 -1
View File
@@ -29,7 +29,7 @@
/obj/item/assembly/mousetrap/describe()
return "The pressure switch is [armed ? "primed" : "safe"]."
/obj/item/assembly/mousetrap/update_icon()
/obj/item/assembly/mousetrap/update_icon_state()
if(armed)
icon_state = "mousetraparmed"
else
+4 -4
View File
@@ -76,14 +76,14 @@
scanning = !scanning
update_icon()
/obj/item/assembly/prox_sensor/update_icon()
overlays.Cut()
/obj/item/assembly/prox_sensor/update_overlays()
. = ..()
attached_overlays = list()
if(timing)
overlays += "prox_timing"
. += "prox_timing"
attached_overlays += "prox_timing"
if(scanning)
overlays += "prox_scanning"
. += "prox_scanning"
attached_overlays += "prox_scanning"
if(holder)
holder.update_icon()
+1 -2
View File
@@ -46,10 +46,9 @@
signal()
return TRUE
/obj/item/assembly/signaler/update_icon()
/obj/item/assembly/signaler/update_icon_state()
if(holder)
holder.update_icon()
return
/obj/item/assembly/signaler/interact(mob/user, flag1)
var/t1 = "-------"
+3 -3
View File
@@ -53,11 +53,11 @@
timer_end()
time = set_time
/obj/item/assembly/timer/update_icon()
overlays.Cut()
/obj/item/assembly/timer/update_overlays()
. = ..()
attached_overlays = list()
if(timing)
overlays += "timer_timing"
. += "timer_timing"
attached_overlays += "timer_timing"
if(holder)
holder.update_icon()
+12 -12
View File
@@ -376,7 +376,7 @@
environment.merge(gas)
/obj/machinery/alarm/update_icon()
/obj/machinery/alarm/update_icon_state()
if(wiresexposed)
icon_state = "alarmx"
return
@@ -555,7 +555,7 @@
if(alarm_area.atmosalert(new_area_danger_level, src)) //if area was in normal state or if area was in alert state
post_alert(new_area_danger_level)
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/machinery/alarm/proc/post_alert(alert_level)
if(!report_danger_level)
@@ -914,13 +914,13 @@
if(alarm_area.atmosalert(ATMOS_ALARM_DANGER, src))
post_alert(ATMOS_ALARM_DANGER)
alarmActivated = TRUE
update_icon()
update_icon(UPDATE_ICON_STATE)
if("atmos_reset")
if(alarm_area.atmosalert(ATMOS_ALARM_NONE, src, TRUE))
post_alert(ATMOS_ALARM_NONE)
alarmActivated = FALSE
update_icon()
update_icon(UPDATE_ICON_STATE)
if("mode")
if(!is_authenticated(usr, active_ui))
@@ -994,7 +994,7 @@
coil.use(5)
buildstage = 2
update_icon()
update_icon(UPDATE_ICON_STATE)
first_run()
return
if(0)
@@ -1003,7 +1003,7 @@
playsound(get_turf(src), I.usesound, 50, 1)
qdel(I)
buildstage = 1
update_icon()
update_icon(UPDATE_ICON_STATE)
return
return ..()
@@ -1021,7 +1021,7 @@
to_chat(user, "You pry out the circuit!")
new /obj/item/airalarm_electronics(user.drop_location())
buildstage = AIR_ALARM_FRAME
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/machinery/alarm/multitool_act(mob/user, obj/item/I)
if(buildstage != AIR_ALARM_READY)
@@ -1039,7 +1039,7 @@
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
wiresexposed = !wiresexposed
update_icon()
update_icon(UPDATE_ICON_STATE)
if(wiresexposed)
SCREWDRIVER_OPEN_PANEL_MESSAGE
else
@@ -1055,7 +1055,7 @@
var/obj/item/stack/cable_coil/new_coil = new /obj/item/stack/cable_coil(user.drop_location())
new_coil.amount = 5
buildstage = AIR_ALARM_BUILDING
update_icon()
update_icon(UPDATE_ICON_STATE)
if(wiresexposed)
wires.Interact(user)
@@ -1074,11 +1074,11 @@
stat &= ~NOPOWER
else
stat |= NOPOWER
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/machinery/alarm/obj_break(damage_flag)
..()
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/machinery/alarm/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
@@ -1099,7 +1099,7 @@
/obj/machinery/alarm/proc/unshort_callback()
if(shorted)
shorted = FALSE
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/machinery/alarm/proc/enable_ai_control_callback()
if(aidisabled)
@@ -70,6 +70,12 @@ Pipelines + Other Objects -> Pipe network
// Icons/overlays/underlays
/obj/machinery/atmospherics/update_icon()
if(check_icon_cache())
..(ALL)
else
..(UPDATE_ICON_STATE)
/obj/machinery/atmospherics/update_icon_state()
var/turf/T = get_turf(loc)
if(T && T.transparent_floor)
plane = FLOOR_PLANE
@@ -112,10 +118,7 @@ Pipelines + Other Objects -> Pipe network
underlays += SSair.icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "exposed" + icon_connect_type)
/obj/machinery/atmospherics/proc/update_underlays()
if(check_icon_cache())
return 1
else
return 0
return check_icon_cache()
// Connect types
/obj/machinery/atmospherics/proc/check_connect_types(obj/machinery/atmospherics/atmos1, obj/machinery/atmospherics/atmos2)
@@ -106,39 +106,47 @@
return
side_inverted = !side_inverted
to_chat(user, "<span class='notice'>You reverse the circulator's valve settings. The inlet of the circulator is now on the [get_inlet_side(dir)] side.</span>")
update_appearance(UPDATE_DESC|UPDATE_ICON)
/obj/machinery/atmospherics/binary/circulator/update_desc()
. = ..()
desc = "A gas circulator pump and heat exchanger. Its input port is on the [get_inlet_side(dir)] side, and its output port is on the [get_outlet_side(dir)] side."
/obj/machinery/atmospherics/binary/circulator/update_icon() //this gets called everytime atmos is updated in the circulator (alot)
..()
underlays.Cut()
cut_overlays()
/obj/machinery/atmospherics/binary/circulator/update_icon_state() //this gets called everytime atmos is updated in the circulator (alot)
if(stat & (BROKEN|NOPOWER))
icon_state = "circ[side]-p"
else if(last_pressure_delta > 0)
return
if(last_pressure_delta > 0)
if(last_pressure_delta > ONE_ATMOSPHERE)
icon_state = "circ[side]-run"
underlays += emissive_appearance(icon,"emit[side]-run")
else
icon_state = "circ[side]-slow"
underlays += emissive_appearance(icon,"emit[side]-slow")
else
icon_state = "circ[side]-off"
underlays += emissive_appearance(icon,"emit[side]-off")
/obj/machinery/atmospherics/binary/circulator/update_overlays()
. = ..()
if(!side_inverted)
add_overlay(mutable_appearance(icon,"in_up"))
. += "in_up"
else
add_overlay(mutable_appearance(icon,"in_down"))
. += "in_down"
if(node2)
var/image/new_pipe_overlay = image(icon, "connected")
new_pipe_overlay.color = node2.pipe_color
add_overlay(new_pipe_overlay)
. += new_pipe_overlay
else
add_overlay(mutable_appearance(icon, "disconnected"))
. += "disconnected"
return 1
if(stat & (BROKEN|NOPOWER) && !light)
return
if(last_pressure_delta > 0)
if(last_pressure_delta > ONE_ATMOSPHERE)
. += emissive_appearance(icon,"emit[side]-run")
else
. += emissive_appearance(icon,"emit[side]-slow")
else
. += emissive_appearance(icon,"emit[side]-off")
/obj/machinery/atmospherics/binary/circulator/power_change()
. = ..()
@@ -70,13 +70,8 @@
add_underlay(T, node1, turn(dir, -180))
add_underlay(T, node2, dir)
/obj/machinery/atmospherics/binary/dp_vent_pump/update_icon(safety = 0)
..()
if(!check_icon_cache())
return
overlays.Cut()
/obj/machinery/atmospherics/binary/dp_vent_pump/update_overlays()
. = ..()
var/vent_icon = "vent"
@@ -89,7 +84,7 @@
else
vent_icon += "[on ? "[releasing ? "out" : "in"]" : "off"]"
overlays += SSair.icon_manager.get_atmos_icon("device", , , vent_icon)
. += SSair.icon_manager.get_atmos_icon("device", , , vent_icon)
/obj/machinery/atmospherics/binary/dp_vent_pump/update_underlays()
if(..())
@@ -27,8 +27,7 @@
radio_connection = null
return ..()
/obj/machinery/atmospherics/binary/passive_gate/update_icon()
..()
/obj/machinery/atmospherics/binary/passive_gate/update_icon_state()
icon_state = "[on ? "on" : "off"]"
/obj/machinery/atmospherics/binary/passive_gate/update_underlays()
@@ -57,9 +57,7 @@ Thus, the two variables affect pump operation are set in New():
icon_state = "map_on"
on = TRUE
/obj/machinery/atmospherics/binary/pump/update_icon()
..()
/obj/machinery/atmospherics/binary/pump/update_icon_state()
if(!powered())
icon_state = "off"
else
@@ -8,6 +8,7 @@
can_unwrench = TRUE
var/open = FALSE
var/animating = FALSE
req_one_access_txt = "24;10"
@@ -22,11 +23,9 @@
open = TRUE
icon_state = "map_valve1"
/obj/machinery/atmospherics/binary/valve/update_icon(animation)
..()
if(animation)
flick("valve[src.open][!src.open]",src)
/obj/machinery/atmospherics/binary/valve/update_icon_state()
if(animating)
flick("valve[open][!open]",src)
else
icon_state = "valve[open]"
@@ -41,7 +40,7 @@
/obj/machinery/atmospherics/binary/valve/proc/open()
open = TRUE
update_icon()
update_icon(UPDATE_ICON_STATE)
parent1.update = 0
parent2.update = 0
parent1.reconcile_air()
@@ -50,7 +49,7 @@
/obj/machinery/atmospherics/binary/valve/proc/close()
open = FALSE
update_icon()
update_icon(UPDATE_ICON_STATE)
investigate_log("was closed by [usr ? key_name(usr) : "a remote signal"]", "atmos")
return
@@ -63,8 +62,10 @@
/obj/machinery/atmospherics/binary/valve/attack_hand(mob/user)
add_fingerprint(usr)
update_icon(1)
animating = TRUE
update_icon(UPDATE_ICON_STATE)
sleep(10)
animating = FALSE
if(open)
close()
else
@@ -105,12 +106,13 @@
var/old_stat = stat
..()
if(old_stat != stat)
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/machinery/atmospherics/binary/valve/digital/update_icon()
..()
/obj/machinery/atmospherics/binary/valve/digital/update_icon_state()
if(!powered())
icon_state = "valve[open]nopower"
return
..()
/obj/machinery/atmospherics/binary/valve/digital/atmos_init()
..()
@@ -58,9 +58,7 @@ Thus, the two variables affect pump operation are set in New():
..()
set_frequency(frequency)
/obj/machinery/atmospherics/binary/volume_pump/update_icon()
..()
/obj/machinery/atmospherics/binary/volume_pump/update_icon_state()
if(!powered())
icon_state = "off"
else
@@ -60,9 +60,7 @@
icon_state = "mmap"
flipped = TRUE
/obj/machinery/atmospherics/trinary/filter/update_icon()
..()
/obj/machinery/atmospherics/trinary/filter/update_icon_state()
if(flipped)
icon_state = "m"
else
@@ -35,9 +35,7 @@
icon_state = "mmap"
flipped = TRUE
/obj/machinery/atmospherics/trinary/mixer/update_icon(safety = 0)
..()
/obj/machinery/atmospherics/trinary/mixer/update_icon_state()
if(flipped)
icon_state = "m"
else
@@ -36,6 +36,7 @@
flick("tvalve[flipstate][state][!state]",src)
else
icon_state = "tvalve[flipstate][state]"
..()
/obj/machinery/atmospherics/trinary/tvalve/update_underlays()
if(..())
@@ -134,9 +135,7 @@
if(old_stat != stat)
update_icon()
/obj/machinery/atmospherics/trinary/tvalve/digital/update_icon()
..()
/obj/machinery/atmospherics/trinary/tvalve/digital/update_icon_state()
if(!powered())
icon_state = "tvalvenopower"
@@ -1,6 +1,8 @@
#define AUTO_EJECT_DEAD (1<<0)
#define AUTO_EJECT_HEALTHY (1<<1)
#define HIGH 24
#define MID 23
#define LOW 22
/obj/machinery/atmospherics/unary/cryo_cell
name = "cryo cell"
desc = "Lowers the body temperature so certain medications may take effect."
@@ -340,52 +342,50 @@
if(default_deconstruction_screwdriver(user, "pod0-o", "pod0", I))
return TRUE
/obj/machinery/atmospherics/unary/cryo_cell/update_icon()
handle_update_icon()
/obj/machinery/atmospherics/unary/cryo_cell/proc/handle_update_icon() //making another proc to avoid spam in update_icon
overlays.Cut() //empty the overlay proc, just in case
/obj/machinery/atmospherics/unary/cryo_cell/update_icon_state()
icon_state = "pod[on]" //set the icon properly every time
if(!src.occupant)
overlays += "lid[on]" //if no occupant, just put the lid overlay on, and ignore the rest
/obj/machinery/atmospherics/unary/cryo_cell/update_overlays()
. = ..()
if(!occupant)
. += "lid[on]" //if no occupant, just put the lid overlay on, and ignore the rest
return
if(occupant)
var/mutable_appearance/pickle = mutable_appearance(occupant.icon, occupant.icon_state)
pickle.overlays = occupant.overlays
pickle.pixel_y = 22
pickle.pixel_y = LOW
overlays += pickle
overlays += "lid[on]"
if(src.on && !running_bob_animation) //no bobbing if off
var/up = 0 //used to see if we are going up or down, 1 is down, 2 is up
. += pickle
. += "lid[on]"
if(on && !running_bob_animation) //no bobbing if off
var/bobbing = NONE //used to see if we are going up or down
spawn(0) // Without this, the icon update will block. The new thread will die once the occupant leaves.
running_bob_animation = TRUE
while(occupant)
overlays -= "lid[on]" //have to remove the overlays first, to force an update- remove cloning pod overlay
overlays -= pickle //remove mob overlay
while(occupant && on)
cut_overlay("lid[on]") //have to remove the overlays first, to force an update- remove cloning pod overlay
cut_overlay(pickle) //remove mob overlay
switch(pickle.pixel_y) //this looks messy as fuck but it works, switch won't call itself twice
if(23) //inbetween state, for smoothness
switch(up) //this is set later in the switch, to keep track of where the mob is supposed to go
if(2) //2 is up
pickle.pixel_y = 24 //set to highest
if(MID) //inbetween state, for smoothness
switch(bobbing) //this is set later in the switch, to keep track of where the mob is supposed to go
if(UP)
pickle.pixel_y = HIGH //set to highest
if(1) //1 is down
pickle.pixel_y = 22 //set to lowest
if(DOWN)
pickle.pixel_y = LOW //set to lowest
if(22) //mob is at it's lowest
pickle.pixel_y = 23 //set to inbetween
up = 2 //have to go up
if(LOW) //mob is at it's lowest
pickle.pixel_y = MID //set to inbetween
bobbing = UP //have to go up
if(24) //mob is at it's highest
pickle.pixel_y = 23 //set to inbetween
up = 1 //have to go down
if(HIGH) //mob is at it's highest
pickle.pixel_y = MID //set to inbetween
bobbing = DOWN //have to go down
overlays += pickle //re-add the mob to the icon
overlays += "lid[on]" //re-add the overlay of the pod, they are inside it, not floating
add_overlay(pickle) //re-add the mob to the icon
add_overlay("lid[on]") //re-add the overlay of the pod, they are inside it, not floating
sleep(7) //don't want to jiggle violently, just slowly bob
running_bob_animation = FALSE
@@ -434,7 +434,7 @@
if(occupant.bodytemperature < 261 && occupant.bodytemperature >= 70) //Patch by Aranclanos to stop people from taking burn damage after being ejected
occupant.bodytemperature = 261
occupant = null
update_icon()
update_icon(UPDATE_OVERLAYS)
// eject trash the occupant dropped
for(var/atom/movable/A in contents - component_parts - list(beaker))
A.forceMove(get_step(loc, SOUTH))
@@ -473,9 +473,9 @@
occupant = M
// M.metabslow = 1
add_fingerprint(usr)
update_icon()
update_icon(UPDATE_OVERLAYS)
M.ExtinguishMob()
return 1
return TRUE
/obj/machinery/atmospherics/unary/cryo_cell/verb/move_eject()
set name = "Eject occupant"
@@ -549,3 +549,6 @@
#undef AUTO_EJECT_HEALTHY
#undef AUTO_EJECT_DEAD
#undef HIGH
#undef MID
#undef LOW
@@ -8,9 +8,7 @@
var/update_cycle
/obj/machinery/atmospherics/unary/generator_input/update_icon()
..()
/obj/machinery/atmospherics/unary/generator_input/update_icon_state()
if(node)
icon_state = "intact"
else
@@ -10,9 +10,7 @@
var/obj/machinery/atmospherics/unary/heat_exchanger/partner = null
var/update_cycle
/obj/machinery/atmospherics/unary/heat_exchanger/update_icon()
..()
/obj/machinery/atmospherics/unary/heat_exchanger/update_icon_state()
if(node)
icon_state = "intact"
else
@@ -39,9 +39,7 @@
radio_connection = null
return ..()
/obj/machinery/atmospherics/unary/outlet_injector/update_icon()
..()
/obj/machinery/atmospherics/unary/outlet_injector/update_icon_state()
if(!powered())
icon_state = "off"
else
@@ -11,9 +11,7 @@
var/oxygen_content = 10
/obj/machinery/atmospherics/unary/oxygen_generator/update_icon()
..()
/obj/machinery/atmospherics/unary/oxygen_generator/update_icon_state()
if(node)
icon_state = "intact_[on?("on"):("off")]"
else
@@ -15,8 +15,7 @@
connected_device.disconnect()
return ..()
/obj/machinery/atmospherics/unary/portables_connector/update_icon()
..()
/obj/machinery/atmospherics/unary/portables_connector/update_icon_state()
icon_state = "connector"
/obj/machinery/atmospherics/unary/portables_connector/update_underlays()
@@ -10,9 +10,7 @@
name = "thermal tansfer plate"
desc = "Transfers heat to and from an area"
/obj/machinery/atmospherics/unary/thermal_plate/update_icon()
..()
/obj/machinery/atmospherics/unary/thermal_plate/update_icon_state()
var/prefix = ""
//var/suffix="_idle" // Also available: _heat, _cool
if(level == 1 && istype(loc, /turf/simulated))
@@ -74,7 +74,7 @@
calculated_laser_rating += laser.rating
max_temperature = T20C + (base_heating * calculated_laser_rating) //573.15K with T1 stock parts
/obj/machinery/atmospherics/unary/thermomachine/update_icon()
/obj/machinery/atmospherics/unary/thermomachine/update_icon_state()
if(panel_open)
icon_state = icon_state_open
else if(on)
@@ -78,16 +78,9 @@
..()
air_contents.volume = 1000
/obj/machinery/atmospherics/unary/vent_pump/update_icon(safety = 0)
..()
/obj/machinery/atmospherics/unary/vent_pump/update_overlays()
. = ..()
plane = FLOOR_PLANE
if(!check_icon_cache())
return
overlays.Cut()
var/vent_icon = "vent"
var/turf/T = get_turf(src)
@@ -101,7 +94,7 @@
else
vent_icon += "[on ? "[releasing ? "out" : "in"]" : "off"]"
overlays += SSair.icon_manager.get_atmos_icon("device", state = vent_icon)
. += SSair.icon_manager.get_atmos_icon("device", state = vent_icon)
update_pipe_image()
@@ -96,16 +96,9 @@
use_power(amount, power_channel)
return 1
/obj/machinery/atmospherics/unary/vent_scrubber/update_icon(safety = 0)
..()
/obj/machinery/atmospherics/unary/vent_scrubber/update_overlays()
. = ..()
plane = FLOOR_PLANE
if(!check_icon_cache())
return
overlays.Cut()
var/scrubber_icon = "scrubber"
var/turf/T = get_turf(src)
@@ -122,7 +115,7 @@
if(welded)
scrubber_icon = "scrubberweld"
overlays += SSair.icon_manager.get_atmos_icon("device", state = scrubber_icon)
. += SSair.icon_manager.get_atmos_icon("device", state = scrubber_icon)
update_pipe_image()
/obj/machinery/atmospherics/unary/vent_scrubber/update_underlays()
@@ -43,34 +43,17 @@
return "Measures the volume and temperature of the pipe under the meter."
/obj/machinery/meter/process_atmos()
if(!target)
icon_state = "meterX"
return 0
if(stat & (BROKEN|NOPOWER))
icon_state = "meter0"
return 0
if(!target || (stat & (BROKEN|NOPOWER)))
update_icon(UPDATE_ICON_STATE)
return
var/datum/gas_mixture/environment = target.return_air()
if(!environment)
icon_state = "meterX"
return 0
update_icon(UPDATE_ICON_STATE)
return
update_icon(UPDATE_ICON_STATE)
var/env_pressure = environment.return_pressure()
if(env_pressure <= 0.15*ONE_ATMOSPHERE)
icon_state = "meter0"
else if(env_pressure <= 1.8*ONE_ATMOSPHERE)
var/val = round(env_pressure/(ONE_ATMOSPHERE*0.3) + 0.5)
icon_state = "meter1_[val]"
else if(env_pressure <= 30*ONE_ATMOSPHERE)
var/val = round(env_pressure/(ONE_ATMOSPHERE*5)-0.35) + 1
icon_state = "meter2_[val]"
else if(env_pressure <= 59*ONE_ATMOSPHERE)
var/val = round(env_pressure/(ONE_ATMOSPHERE*5) - 6) + 1
icon_state = "meter3_[val]"
else
icon_state = "meter4"
if(frequency)
var/datum/radio_frequency/radio_connection = SSradio.return_frequency(frequency)
@@ -86,6 +69,36 @@
"sigtype" = "status"
)
radio_connection.post_signal(src, signal)
/obj/machinery/meter/update_icon_state()
if(!target)
icon_state = "meterX"
return
if(stat & (BROKEN|NOPOWER))
icon_state = "meter0"
return
var/datum/gas_mixture/environment = target.return_air()
if(!environment)
icon_state = "meterX"
return
var/env_pressure = environment.return_pressure()
if(env_pressure <= 0.15*ONE_ATMOSPHERE)
icon_state = "meter0"
else if(env_pressure <= 1.8*ONE_ATMOSPHERE)
var/val = round(env_pressure/(ONE_ATMOSPHERE*0.3) + 0.5)
icon_state = "meter1_[val]"
else if(env_pressure <= 30*ONE_ATMOSPHERE)
var/val = round(env_pressure/(ONE_ATMOSPHERE*5)-0.35) + 1
icon_state = "meter2_[val]"
else if(env_pressure <= 59*ONE_ATMOSPHERE)
var/val = round(env_pressure/(ONE_ATMOSPHERE*5) - 6) + 1
icon_state = "meter3_[val]"
else
icon_state = "meter4"
/obj/machinery/meter/proc/status()
var/t = ""
@@ -56,16 +56,10 @@
if(node)
node.update_underlays()
/obj/machinery/atmospherics/pipe/cap/update_icon(safety = 0)
..()
if(!check_icon_cache())
return
/obj/machinery/atmospherics/pipe/cap/update_overlays()
. = ..()
alpha = 255
overlays.Cut()
overlays += SSair.icon_manager.get_atmos_icon("pipe", , pipe_color, "cap" + icon_connect_type)
. += SSair.icon_manager.get_atmos_icon("pipe", , pipe_color, "cap" + icon_connect_type)
/obj/machinery/atmospherics/pipe/cap/atmos_init()
..()
@@ -118,17 +118,14 @@
if(node3)
node3.update_underlays()
/obj/machinery/atmospherics/pipe/manifold/update_icon(safety = 0)
..()
if(!check_icon_cache())
return
/obj/machinery/atmospherics/pipe/manifold/update_overlays()
. = ..()
alpha = 255
. += SSair.icon_manager.get_atmos_icon("manifold", , pipe_color, "core" + icon_connect_type)
. += SSair.icon_manager.get_atmos_icon("manifold", , , "clamps" + icon_connect_type)
update_underlays()
overlays.Cut()
overlays += SSair.icon_manager.get_atmos_icon("manifold", , pipe_color, "core" + icon_connect_type)
overlays += SSair.icon_manager.get_atmos_icon("manifold", , , "clamps" + icon_connect_type)
/obj/machinery/atmospherics/pipe/manifold/update_underlays()
underlays.Cut()
var/turf/T = get_turf(src)
@@ -147,10 +144,6 @@
for(var/D in directions)
add_underlay(T,,D,icon_connect_type)
/obj/machinery/atmospherics/pipe/manifold/update_underlays()
..()
update_icon()
// A check to make sure both nodes exist - self-delete if they aren't present
/obj/machinery/atmospherics/pipe/manifold/check_nodes_exist()
if(!node1 && !node2 && !node3)
@@ -91,16 +91,14 @@
if(node4)
node4.update_underlays()
/obj/machinery/atmospherics/pipe/manifold4w/update_icon(safety = 0)
..()
if(!check_icon_cache())
return
/obj/machinery/atmospherics/pipe/manifold4w/update_overlays()
. = ..()
alpha = 255
overlays.Cut()
overlays += SSair.icon_manager.get_atmos_icon("manifold", , pipe_color, "4way" + icon_connect_type)
overlays += SSair.icon_manager.get_atmos_icon("manifold", , , "clamps_4way" + icon_connect_type)
. += SSair.icon_manager.get_atmos_icon("manifold", , pipe_color, "4way" + icon_connect_type)
. += SSair.icon_manager.get_atmos_icon("manifold", , , "clamps_4way" + icon_connect_type)
update_underlays()
/obj/machinery/atmospherics/pipe/manifold4w/update_underlays()
underlays.Cut()
var/turf/T = get_turf(src)
@@ -121,11 +119,6 @@
for(var/D in directions)
add_underlay(T,,D,icon_connect_type)
/obj/machinery/atmospherics/pipe/manifold4w/update_underlays()
..()
update_icon()
// A check to make sure both nodes exist - self-delete if they aren't present
/obj/machinery/atmospherics/pipe/manifold4w/check_nodes_exist()
if(!node1 && !node2 && !node3 && !node4)
@@ -137,20 +137,13 @@
if(node2)
node2.update_underlays()
/obj/machinery/atmospherics/pipe/simple/update_icon(safety = 0)
..()
if(!check_icon_cache())
return
/obj/machinery/atmospherics/pipe/simple/update_overlays()
. = ..()
alpha = 255
overlays.Cut()
if(node1 && node2)
overlays += SSair.icon_manager.get_atmos_icon("pipe", , pipe_color, pipe_icon + "intact" + icon_connect_type)
. += SSair.icon_manager.get_atmos_icon("pipe", , pipe_color, pipe_icon + "intact" + icon_connect_type)
else
overlays += SSair.icon_manager.get_atmos_icon("pipe", , pipe_color, pipe_icon + "exposed[node1?1:0][node2?1:0]" + icon_connect_type)
. += SSair.icon_manager.get_atmos_icon("pipe", , pipe_color, pipe_icon + "exposed[node1?1:0][node2?1:0]" + icon_connect_type)
// A check to make sure both nodes exist - self-delete if they aren't present
/obj/machinery/atmospherics/pipe/simple/check_nodes_exist()
@@ -38,16 +38,13 @@
/obj/machinery/atmospherics/pipe/simple/hidden/universal/detailed_examine()
return "This allows you to connect 'normal' pipes, red 'scrubber' pipes, and blue 'supply' pipes."
/obj/machinery/atmospherics/pipe/simple/hidden/universal/update_icon(safety = 0)
..()
if(!check_icon_cache())
return
/obj/machinery/atmospherics/pipe/simple/hidden/universal/update_overlays()
. = list()
alpha = 255
. += SSair.icon_manager.get_atmos_icon("pipe", , pipe_color, "universal")
update_underlays()
overlays.Cut()
overlays += SSair.icon_manager.get_atmos_icon("pipe", , pipe_color, "universal")
/obj/machinery/atmospherics/pipe/simple/hidden/universal/update_underlays()
underlays.Cut()
if(node1)
@@ -65,10 +62,6 @@
universal_underlays(,dir)
universal_underlays(,turn(dir, -180))
/obj/machinery/atmospherics/pipe/simple/hidden/universal/update_underlays()
..()
update_icon()
/obj/machinery/atmospherics/pipe/simple/hidden/yellow
color = PIPE_COLOR_YELLOW
@@ -55,16 +55,13 @@
/obj/machinery/atmospherics/pipe/simple/visible/universal/detailed_examine()
return "This allows you to connect 'normal' pipes, red 'scrubber' pipes, and blue 'supply' pipes."
/obj/machinery/atmospherics/pipe/simple/visible/universal/update_icon(safety = 0)
..()
if(!check_icon_cache())
return
/obj/machinery/atmospherics/pipe/simple/visible/universal/update_overlays()
. = list()
alpha = 255
. += SSair.icon_manager.get_atmos_icon("pipe", , pipe_color, "universal")
update_underlays()
overlays.Cut()
overlays += SSair.icon_manager.get_atmos_icon("pipe", , pipe_color, "universal")
/obj/machinery/atmospherics/pipe/simple/visible/universal/update_underlays()
underlays.Cut()
if(node1)
@@ -79,7 +76,3 @@
else
universal_underlays(,dir)
universal_underlays(,turn(dir, -180))
/obj/machinery/atmospherics/pipe/simple/visible/universal/update_underlays()
..()
update_icon()
@@ -39,6 +39,15 @@
)
GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new())
#define HOLDING_TANK 1
#define CONNECTED_PORT 2
#define LOW_PRESSURE 4
#define NORMAL_PRESSURE 8
#define HIGH_PRESSURE 16
#define EXTREME_PRESSURE 32
#define NEW_COLOR 64
#define RESET 68
/obj/machinery/portable_atmospherics/canister
name = "canister"
icon = 'icons/obj/atmos.dmi'
@@ -56,7 +65,7 @@ GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new())
var/list/color_index // list which stores tgui color indexes for the recoloring options, to enable previously-set colors to show up right
//lists for check_change()
var/list/oldcolor
var/list/old_color
//passed to the ui to render the color lists
var/list/colorcontainer
@@ -69,7 +78,7 @@ GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new())
use_power = NO_POWER_USE
interact_offline = TRUE
var/release_log = ""
var/update_flag = 0
var/update_flag = NONE
/obj/machinery/portable_atmospherics/canister/New()
..()
@@ -79,7 +88,7 @@ GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new())
"ter" = "none",
"quart" = "none"
)
oldcolor = new /list()
old_color = new /list()
colorcontainer = list(
"prim" = list(
"options" = GLOB.canister_icon_container.possiblemaincolor,
@@ -111,78 +120,71 @@ GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new())
/obj/machinery/portable_atmospherics/canister/proc/check_change()
var/old_flag = update_flag
update_flag = 0
if(holding)
update_flag |= 1
update_flag = NONE
if(holding_tank)
update_flag |= HOLDING_TANK
if(connected_port)
update_flag |= 2
update_flag |= CONNECTED_PORT
var/tank_pressure = air_contents.return_pressure()
if(tank_pressure < 10)
update_flag |= 4
update_flag |= LOW_PRESSURE
else if(tank_pressure < ONE_ATMOSPHERE)
update_flag |= 8
update_flag |= NORMAL_PRESSURE
else if(tank_pressure < 15*ONE_ATMOSPHERE)
update_flag |= 16
update_flag |= HIGH_PRESSURE
else
update_flag |= 32
update_flag |= EXTREME_PRESSURE
if(list2params(oldcolor) != list2params(canister_color))
update_flag |= 64
oldcolor = canister_color.Copy()
if(list2params(old_color) != list2params(canister_color))
update_flag |= NEW_COLOR
old_color = canister_color.Copy()
if(update_flag == old_flag)
return 1
else
return 0
return FALSE
return TRUE
/obj/machinery/portable_atmospherics/canister/update_icon()
/obj/machinery/portable_atmospherics/canister/update_icon_state()
/*
update_flag
1 = holding
2 = connected_port
4 = tank_pressure < 10
8 = tank_pressure < ONE_ATMOS
16 = tank_pressure < 15*ONE_ATMOS
32 = tank_pressure go boom.
64 = colors
(note: colors has to be applied every icon update)
*/
if(stat & BROKEN)
cut_overlays()
icon_state = text("[]-1", canister_color["prim"])//yes, I KNOW the colours don't reflect when the can's borked, whatever.
return
if(icon_state != canister_color["prim"])
icon_state = canister_color["prim"]
if(check_change()) //Returns 1 if no change needed to icons.
if(!check_change()) //Returns FALSE if no change needed to icons.
return
cut_overlays()
/obj/machinery/portable_atmospherics/canister/update_overlays()
. = ..()
if(stat & BROKEN)
return
for(var/C in canister_color)
if(C == "prim")
continue
if(canister_color[C] == "none")
continue
add_overlay(canister_color[C])
. += canister_color[C]
if(update_flag & 1)
add_overlay("can-open")
if(update_flag & 2)
add_overlay("can-connector")
if(update_flag & 4)
add_overlay("can-o0")
if(update_flag & 8)
add_overlay("can-o1")
else if(update_flag & 16)
add_overlay("can-o2")
else if(update_flag & 32)
add_overlay("can-o3")
if(update_flag & HOLDING_TANK)
. += "can-open"
if(update_flag & CONNECTED_PORT)
. += "can-connector"
if(update_flag & LOW_PRESSURE)
. += "can-o0"
if(update_flag & NORMAL_PRESSURE)
. += "can-o1"
else if(update_flag & HIGH_PRESSURE)
. += "can-o2"
else if(update_flag & EXTREME_PRESSURE)
. += "can-o3"
update_flag &= ~68 //the flag 64 represents change, not states. As such, we have to reset them to be able to detect a change on the next go.
update_flag &= ~RESET //the flag NEW_COLOR represents change, not states. As such, we have to reset them to be able to detect a change on the next go.
return
/obj/machinery/portable_atmospherics/canister/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
@@ -217,9 +219,9 @@ update_flag
playsound(loc, 'sound/effects/spray.ogg', 10, TRUE, -3)
update_icon()
if(holding)
holding.forceMove(T)
holding = null
if(holding_tank)
holding_tank.forceMove(T)
holding_tank = null
/obj/machinery/portable_atmospherics/canister/process_atmos()
if(stat & BROKEN)
@@ -229,8 +231,8 @@ update_flag
if(valve_open)
var/datum/gas_mixture/environment
if(holding)
environment = holding.air_contents
if(holding_tank)
environment = holding_tank.air_contents
else
environment = loc.return_air()
@@ -245,7 +247,7 @@ update_flag
//Actually transfer the gas
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
if(holding)
if(holding_tank)
environment.merge(removed)
else
loc.assume_air(removed)
@@ -266,13 +268,13 @@ update_flag
var/datum/gas_mixture/GM = return_air()
if(GM && GM.volume>0)
return GM.temperature
return 0
return
/obj/machinery/portable_atmospherics/canister/proc/return_pressure()
var/datum/gas_mixture/GM = return_air()
if(GM && GM.volume>0)
return GM.return_pressure()
return 0
return
/obj/machinery/portable_atmospherics/canister/replace_tank(mob/living/user, close_valve)
. = ..()
@@ -281,8 +283,8 @@ update_flag
valve_open = FALSE
update_icon()
investigate_log("Valve was <b>closed</b> by [key_name(user)].<br>", "atmos")
else if(valve_open && holding)
investigate_log("[key_name(user)] started a transfer into [holding].<br>", "atmos")
else if(valve_open && holding_tank)
investigate_log("[key_name(user)] started a transfer into [holding_tank].<br>", "atmos")
/obj/machinery/portable_atmospherics/canister/attack_ai(mob/user)
add_hiddenprint(user)
@@ -302,20 +304,20 @@ update_flag
/obj/machinery/portable_atmospherics/canister/ui_data()
var/data = list()
data["portConnected"] = connected_port ? 1 : 0
data["portConnected"] = connected_port ? TRUE : FALSE
data["tankPressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0)
data["releasePressure"] = round(release_pressure ? release_pressure : 0)
data["defaultReleasePressure"] = ONE_ATMOSPHERE
data["minReleasePressure"] = round(ONE_ATMOSPHERE / 10)
data["maxReleasePressure"] = round(ONE_ATMOSPHERE * 10)
data["valveOpen"] = valve_open ? 1 : 0
data["valveOpen"] = valve_open ? TRUE : FALSE
data["name"] = name
data["canLabel"] = can_label ? 1 : 0
data["canLabel"] = can_label ? TRUE : FALSE
data["colorContainer"] = colorcontainer.Copy()
data["color_index"] = color_index
data["hasHoldingTank"] = holding ? 1 : 0
if(holding)
data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure()))
data["hasHoldingTank"] = holding_tank ? TRUE : FALSE
if(holding_tank)
data["holdingTank"] = list("name" = holding_tank.name, "tankPressure" = round(holding_tank.air_contents.return_pressure()))
return data
/obj/machinery/portable_atmospherics/canister/ui_act(action, params)
@@ -357,8 +359,8 @@ update_flag
var/logmsg
valve_open = !valve_open
if(valve_open)
logmsg = "Valve was <b>opened</b> by [key_name(usr)], starting a transfer into the [holding || "air"].<br>"
if(!holding)
logmsg = "Valve was <b>opened</b> by [key_name(usr)], starting a transfer into the [holding_tank || "air"].<br>"
if(!holding_tank)
logmsg = "Valve was <b>opened</b> by [key_name(usr)], starting a transfer into the air.<br>"
if(air_contents.toxins > 0)
message_admins("[key_name_admin(usr)] opened a canister that contains plasma in [get_area(src)]! (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)")
@@ -367,14 +369,14 @@ update_flag
message_admins("[key_name_admin(usr)] opened a canister that contains N2O in [get_area(src)]! (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)")
log_admin("[key_name(usr)] opened a canister that contains N2O at [get_area(src)]: [x], [y], [z]")
else
logmsg = "Valve was <b>closed</b> by [key_name(usr)], stopping the transfer into the [holding || "air"].<br>"
logmsg = "Valve was <b>closed</b> by [key_name(usr)], stopping the transfer into the [holding_tank || "air"].<br>"
investigate_log(logmsg, "atmos")
release_log += logmsg
if("eject")
if(holding)
if(holding_tank)
if(valve_open)
valve_open = FALSE
release_log += "Valve was <b>closed</b> by [key_name(usr)], stopping the transfer into the [holding]<br>"
release_log += "Valve was <b>closed</b> by [key_name(usr)], stopping the transfer into the [holding_tank]<br>"
replace_tank(usr, FALSE)
if("recolor")
if(can_label)
@@ -420,7 +422,6 @@ update_flag
icon_state = "whiters" //See New()
can_label = FALSE
/obj/machinery/portable_atmospherics/canister/toxins/New()
..()
@@ -428,7 +429,7 @@ update_flag
air_contents.toxins = (maximum_pressure * filled) * air_contents.volume / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
update_icon()
return 1
return TRUE
/obj/machinery/portable_atmospherics/canister/oxygen/New()
..()
@@ -437,7 +438,7 @@ update_flag
air_contents.oxygen = (maximum_pressure * filled) * air_contents.volume / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
update_icon()
return 1
return TRUE
/obj/machinery/portable_atmospherics/canister/sleeping_agent/New()
..()
@@ -446,7 +447,7 @@ update_flag
air_contents.sleeping_agent = (maximum_pressure * filled) * air_contents.volume / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
update_icon()
return 1
return TRUE
/obj/machinery/portable_atmospherics/canister/nitrogen/New()
..()
@@ -455,7 +456,7 @@ update_flag
air_contents.nitrogen = (maximum_pressure * filled) * air_contents.volume / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
update_icon()
return 1
return TRUE
/obj/machinery/portable_atmospherics/canister/carbon_dioxide/New()
..()
@@ -464,8 +465,7 @@ update_flag
air_contents.carbon_dioxide = (maximum_pressure * filled) * air_contents.volume / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
update_icon()
return 1
return TRUE
/obj/machinery/portable_atmospherics/canister/air/New()
..()
@@ -475,14 +475,14 @@ update_flag
air_contents.nitrogen = (N2STANDARD * maximum_pressure * filled) * air_contents.volume / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
update_icon()
return 1
return TRUE
/obj/machinery/portable_atmospherics/canister/custom_mix/New()
..()
canister_color["prim"] = "whiters"
update_icon() // Otherwise new canisters do not have their icon updated with the pressure light, likely want to add this to the canister class constructor, avoiding at current time to refrain from screwing up code for other canisters. --DZD
return 1
return TRUE
/obj/machinery/portable_atmospherics/canister/welder_act(mob/user, obj/item/I)
if(!(stat & BROKEN))
@@ -495,3 +495,12 @@ update_flag
to_chat(user, "<span class='notice'>You salvage whats left of [src]!</span>")
new /obj/item/stack/sheet/metal(drop_location(), 3)
qdel(src)
#undef HOLDING_TANK
#undef CONNECTED_PORT
#undef LOW_PRESSURE
#undef NORMAL_PRESSURE
#undef HIGH_PRESSURE
#undef EXTREME_PRESSURE
#undef NEW_COLOR
#undef RESET
@@ -6,7 +6,7 @@
var/datum/gas_mixture/air_contents = new
var/obj/machinery/atmospherics/unary/portables_connector/connected_port
var/obj/item/tank/holding
var/obj/item/tank/holding_tank
var/volume = 0
@@ -19,7 +19,7 @@
air_contents.volume = volume
air_contents.temperature = T20C
return 1
return TRUE
/obj/machinery/portable_atmospherics/Initialize()
. = ..()
@@ -40,20 +40,17 @@
SSair.atmos_machinery -= src
disconnect()
QDEL_NULL(air_contents)
QDEL_NULL(holding)
QDEL_NULL(holding_tank)
return ..()
/obj/machinery/portable_atmospherics/update_icon()
return null
/obj/machinery/portable_atmospherics/proc/connect(obj/machinery/atmospherics/unary/portables_connector/new_port)
//Make sure not already connected to something else
if(connected_port || !new_port || new_port.connected_device)
return 0
return
//Make sure are close enough for a valid connection
if(new_port.loc != loc)
return 0
return
//Perform the connection
connected_port = new_port
@@ -66,18 +63,18 @@
anchored = TRUE //Prevent movement
return 1
return TRUE
/obj/machinery/portable_atmospherics/proc/disconnect()
if(!connected_port)
return 0
return
anchored = FALSE
connected_port.connected_device = null
connected_port = null
return 1
return TRUE
/obj/machinery/portable_atmospherics/portableConnectorReturnAir()
return air_contents
@@ -90,24 +87,24 @@
return
if(!ishuman(usr) && !issilicon(usr))
return
if(holding)
to_chat(user, "<span class='notice'>You remove [holding] from [src].</span>")
if(holding_tank)
to_chat(user, "<span class='notice'>You remove [holding_tank] from [src].</span>")
replace_tank(user, TRUE)
/obj/machinery/portable_atmospherics/examine(mob/user)
. = ..()
if(holding)
. += "<span class='notice'>\The [src] contains [holding]. Alt-click [src] to remove it.</span>"
if(holding_tank)
. += "<span class='notice'>\The [src] contains [holding_tank]. Alt-click [src] to remove it.</span>"
/obj/machinery/portable_atmospherics/proc/replace_tank(mob/living/user, close_valve, obj/item/tank/new_tank)
if(holding)
holding.forceMove(drop_location())
if(holding_tank)
holding_tank.forceMove(drop_location())
if(Adjacent(user) && !issilicon(user))
user.put_in_hands(holding)
user.put_in_hands(holding_tank)
if(new_tank)
holding = new_tank
holding_tank = new_tank
else
holding = null
holding_tank = null
update_icon()
return TRUE
@@ -118,11 +115,11 @@
return
var/obj/item/tank/T = W
user.drop_item()
if(src.holding)
to_chat(user, "<span class='notice'>[holding ? "In one smooth motion you pop [holding] out of [src]'s connector and replace it with [T]" : "You insert [T] into [src]"].</span>")
if(holding_tank)
to_chat(user, "<span class='notice'>[holding_tank ? "In one smooth motion you pop [holding_tank] out of [src]'s connector and replace it with [T]" : "You insert [T] into [src]"].</span>")
replace_tank(user, FALSE)
T.loc = src
src.holding = T
holding_tank = T
update_icon()
return
if((istype(W, /obj/item/analyzer)) && get_dist(user, src) <= 1)
@@ -24,21 +24,15 @@
connecting it to a connector port. The pump can pump the air in (sucking) or out (blowing), at a specific target pressure. The powercell inside can be \
replaced by using a screwdriver, and then adding a new cell. A tank of gas can also be attached to the air pump."
/obj/machinery/portable_atmospherics/pump/update_icon()
overlays = 0
if(on)
icon_state = "psiphon:1"
else
icon_state = "psiphon:0"
if(holding)
overlays += "siphon-open"
/obj/machinery/portable_atmospherics/pump/update_icon_state()
icon_state = "psiphon:[on]"
/obj/machinery/portable_atmospherics/pump/update_overlays()
. = ..()
if(holding_tank)
. += "siphon-open"
if(connected_port)
overlays += "siphon-connector"
return
. += "siphon-connector"
/obj/machinery/portable_atmospherics/pump/emp_act(severity)
if(stat & (BROKEN|NOPOWER))
@@ -60,8 +54,8 @@
..()
if(on)
var/datum/gas_mixture/environment
if(holding)
environment = holding.air_contents
if(holding_tank)
environment = holding_tank.air_contents
else
environment = loc.return_air()
if(direction == DIRECTION_OUT)
@@ -75,7 +69,7 @@
//Actually transfer the gas
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
if(holding)
if(holding_tank)
environment.merge(removed)
else
loc.assume_air(removed)
@@ -90,7 +84,7 @@
//Actually transfer the gas
var/datum/gas_mixture/removed
if(holding)
if(holding_tank)
removed = environment.remove(transfer_moles)
else
removed = loc.remove_air(transfer_moles)
@@ -110,8 +104,8 @@
if(on)
on = FALSE
update_icon()
else if(on && holding && direction == DIRECTION_OUT)
investigate_log("[key_name(user)] started a transfer into [holding].<br>", "atmos")
else if(on && holding_tank && direction == DIRECTION_OUT)
investigate_log("[key_name(user)] started a transfer into [holding_tank].<br>", "atmos")
/obj/machinery/portable_atmospherics/pump/attack_ai(mob/user)
add_hiddenprint(user)
@@ -138,9 +132,9 @@
"target_pressure" = round(target_pressure, 0.001),
"tank_pressure" = air_contents.return_pressure() > 0 ? round(air_contents.return_pressure(), 0.001) : 0
)
if(holding)
if(holding_tank)
data["has_holding_tank"] = TRUE
data["holding_tank"] = list("name" = holding.name, "tank_pressure" = holding.air_contents.return_pressure() > 0 ? round(holding.air_contents.return_pressure(), 0.001) : 0)
data["holding_tank"] = list("name" = holding_tank.name, "tank_pressure" = holding_tank.air_contents.return_pressure() > 0 ? round(holding_tank.air_contents.return_pressure(), 0.001) : 0)
else
data["has_holding_tank"] = FALSE
@@ -154,7 +148,7 @@
if("power")
on = !on
if(on && direction == DIRECTION_OUT)
investigate_log("[key_name(usr)] started a transfer into [holding].<br>", "atmos")
investigate_log("[key_name(usr)] started a transfer into [holding_tank].<br>", "atmos")
update_icon()
return TRUE
@@ -163,15 +157,15 @@
direction = DIRECTION_IN
else
direction = DIRECTION_OUT
if(on && holding)
investigate_log("[key_name(usr)] started a transfer into [holding].<br>", "atmos")
if(on && holding_tank)
investigate_log("[key_name(usr)] started a transfer into [holding_tank].<br>", "atmos")
return TRUE
if("remove_tank")
if(holding)
if(holding_tank)
on = FALSE
holding.forceMove(get_turf(src))
holding = null
holding_tank.forceMove(get_turf(src))
holding_tank = null
update_icon()
return TRUE
@@ -30,21 +30,18 @@
..(severity)
/obj/machinery/portable_atmospherics/scrubber/update_icon()
overlays = 0
/obj/machinery/portable_atmospherics/scrubber/update_icon_state()
if(on)
icon_state = "pscrubber:1"
else
icon_state = "pscrubber:0"
if(holding)
overlays += "scrubber-open"
/obj/machinery/portable_atmospherics/scrubber/update_overlays()
. = ..()
if(holding_tank)
. += "scrubber-open"
if(connected_port)
overlays += "scrubber-connector"
return
. += "scrubber-connector"
/obj/machinery/portable_atmospherics/scrubber/process_atmos()
..()
@@ -60,15 +57,15 @@
/obj/machinery/portable_atmospherics/scrubber/proc/scrub(turf/simulated/tile)
var/datum/gas_mixture/environment
if(holding)
environment = holding.air_contents
if(holding_tank)
environment = holding_tank.air_contents
else
environment = tile.return_air()
var/transfer_moles = min(1,volume_rate/environment.volume)*environment.total_moles()
//Take a gas sample
var/datum/gas_mixture/removed
if(holding)
if(holding_tank)
removed = environment.remove(transfer_moles)
else
removed = loc.remove_air(transfer_moles)
@@ -95,7 +92,7 @@
//Remix the resulting gases
air_contents.merge(filtered_out)
if(holding)
if(holding_tank)
environment.merge(removed)
else
tile.assume_air(removed)
@@ -130,9 +127,9 @@
"rate" = round(volume_rate, 0.001),
"tank_pressure" = air_contents.return_pressure() > 0 ? round(air_contents.return_pressure(), 0.001) : 0
)
if(holding)
if(holding_tank)
data["has_holding_tank"] = TRUE
data["holding_tank"] = list("name" = holding.name, "tank_pressure" = holding.air_contents.return_pressure() > 0 ? round(holding.air_contents.return_pressure(), 0.001) : 0)
data["holding_tank"] = list("name" = holding_tank.name, "tank_pressure" = holding_tank.air_contents.return_pressure() > 0 ? round(holding_tank.air_contents.return_pressure(), 0.001) : 0)
else
data["has_holding_tank"] = FALSE
@@ -149,9 +146,9 @@
return TRUE
if("remove_tank")
if(holding)
holding.forceMove(get_turf(src))
holding = null
if(holding_tank)
holding_tank.forceMove(get_turf(src))
holding_tank = null
update_icon()
return TRUE
@@ -183,13 +180,8 @@
/obj/machinery/portable_atmospherics/scrubber/huge/attack_hand(mob/user)
to_chat(usr, "<span class='warning'>You can't directly interact with this machine. Use the area atmos computer.</span>")
/obj/machinery/portable_atmospherics/scrubber/huge/update_icon()
overlays = 0
if(on)
icon_state = "scrubber:1"
else
icon_state = "scrubber:0"
/obj/machinery/portable_atmospherics/scrubber/huge/update_icon_state()
icon_state = "scrubber:[on]"
/obj/machinery/portable_atmospherics/scrubber/huge/attackby(obj/item/W, mob/user, params)
if((istype(W, /obj/item/analyzer)) && get_dist(user, src) <= 1)
+17 -29
View File
@@ -12,20 +12,15 @@ GLOBAL_DATUM_INIT(the_gateway, /obj/machinery/gateway/centerstation, null)
/obj/machinery/gateway/Initialize()
..()
update_icon()
update_icon(UPDATE_ICON_STATE)
update_density_from_dir()
/obj/machinery/gateway/proc/update_density_from_dir()
if(dir == 2)
density = FALSE
/obj/machinery/gateway/update_icon()
if(active)
icon_state = "on"
return
icon_state = "off"
/obj/machinery/gateway/update_icon_state()
icon_state = active ? "on" : "off"
//this is da important part wot makes things go
@@ -45,7 +40,7 @@ GLOBAL_DATUM_INIT(the_gateway, /obj/machinery/gateway/centerstation, null)
if(!GLOB.the_gateway)
GLOB.the_gateway = src
update_icon()
update_icon(UPDATE_ICON_STATE)
wait = world.time + GLOB.configuration.gateway.away_mission_delay
return INITIALIZE_HINT_LATELOAD
@@ -60,12 +55,8 @@ GLOBAL_DATUM_INIT(the_gateway, /obj/machinery/gateway/centerstation, null)
GLOB.the_gateway = null
return ..()
/obj/machinery/gateway/centerstation/update_icon()
if(active)
icon_state = "oncenter"
return
icon_state = "offcenter"
/obj/machinery/gateway/centerstation/update_icon_state()
icon_state = active ? "oncenter" : "offcenter"
/obj/machinery/gateway/centerstation/process()
@@ -115,17 +106,17 @@ GLOBAL_DATUM_INIT(the_gateway, /obj/machinery/gateway/centerstation, null)
for(var/obj/machinery/gateway/G in linked)
G.active = TRUE
G.update_icon()
G.update_icon(UPDATE_ICON_STATE)
active = TRUE
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/machinery/gateway/centerstation/proc/toggleoff()
for(var/obj/machinery/gateway/G in linked)
G.active = FALSE
G.update_icon()
G.update_icon(UPDATE_ICON_STATE)
active = FALSE
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/machinery/gateway/centerstation/attack_hand(mob/user as mob)
@@ -181,18 +172,15 @@ GLOBAL_DATUM_INIT(the_gateway, /obj/machinery/gateway/centerstation, null)
/obj/machinery/gateway/centeraway/Initialize()
..()
update_icon()
update_icon(UPDATE_ICON_STATE)
stationgate = locate(/obj/machinery/gateway/centerstation) in GLOB.machines
/obj/machinery/gateway/centeraway/update_density_from_dir()
return
/obj/machinery/gateway/centeraway/update_icon()
if(active)
icon_state = "oncenter"
return
icon_state = "offcenter"
/obj/machinery/gateway/centeraway/update_icon_state()
icon_state = active ? "oncenter" : "offcenter"
/obj/machinery/gateway/centeraway/proc/detect()
@@ -228,17 +216,17 @@ GLOBAL_DATUM_INIT(the_gateway, /obj/machinery/gateway/centerstation, null)
for(var/obj/machinery/gateway/G in linked)
G.active = TRUE
G.update_icon()
G.update_icon(UPDATE_ICON_STATE)
active = TRUE
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/machinery/gateway/centeraway/proc/toggleoff()
for(var/obj/machinery/gateway/G in linked)
G.active = FALSE
G.update_icon()
G.update_icon(UPDATE_ICON_STATE)
active = FALSE
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/machinery/gateway/centeraway/attack_hand(mob/user as mob)
@@ -66,7 +66,7 @@
/obj/item/clothing/head/helmet/old
name = "degrading helmet"
desc = "Standard issue security helmet. Due to degradation the helmet's visor obstructs the users ability to see long distances."
tint = 2
tint = FLASH_PROTECTION_WELDER
/obj/item/clothing/suit/armor/vest/old
name = "degrading armor vest"
+1 -1
View File
@@ -34,5 +34,5 @@
environs."
//we don't want the silly text overlay!
/obj/item/paper/pamphlet/update_icon()
/obj/item/paper/pamphlet/update_icon_state()
return
+3 -2
View File
@@ -26,7 +26,7 @@
update_icon()
return TRUE
/obj/screen/buildmode/mode/update_icon()
/obj/screen/buildmode/mode/update_icon_state()
icon_state = bd.mode.get_button_iconstate()
/obj/screen/buildmode/help
@@ -43,8 +43,9 @@
screen_loc = "NORTH,WEST+2"
name = "Change Dir"
/obj/screen/buildmode/bdir/update_icon()
/obj/screen/buildmode/bdir/update_icon(updates=UPDATE_ICON_STATE)
dir = bd.build_dir
..()
/obj/screen/buildmode/bdir/Click()
bd.toggle_dirswitch()
+1
View File
@@ -165,6 +165,7 @@
var/obj/item/clothing/CL = I
var/obj/item/clothing/PCL = picked_item
CL.flags_cover = initial(PCL.flags_cover)
I.update_appearance()
target.icon = initial(picked_item.icon)
+104 -78
View File
@@ -17,13 +17,14 @@
righthand_file = 'icons/mob/inhands/clothing_righthand.dmi'
var/alt_desc = null
var/flash_protect = FLASH_PROTECTION_NONE //What level of bright light protection item has. 1 = Flashers, Flashes, & Flashbangs | 2 = Welding | -1 = OH GOD WELDING BURNT OUT MY RETINAS
var/tint = 0 //Sets the item's level of visual impairment tint, normally set to the same as flash_protect
var/tint = FLASH_PROTECTION_NONE //Sets the item's level of visual impairment tint, normally set to the same as flash_protect
var/up = FALSE //but seperated to allow items to protect but not impair vision, like space helmets
var/visor_flags = 0 //flags that are added/removed when an item is adjusted up/down
var/visor_flags_inv = 0 //same as visor_flags, but for flags_inv
var/visor_flags = NONE //flags that are added/removed when an item is adjusted up/down
var/visor_flags_inv = NONE //same as visor_flags, but for flags_inv
var/visor_vars_to_toggle = VISOR_FLASHPROTECT | VISOR_TINT | VISOR_VISIONFLAGS | VISOR_DARKNESSVIEW | VISOR_INVISVIEW //what to toggle when toggled with weldingvisortoggle()
var/can_toggle = FALSE
var/toggle_message = null
var/alt_toggle_message = null
var/active_sound = null
@@ -35,6 +36,13 @@
var/dyeable = FALSE
w_class = WEIGHT_CLASS_SMALL
/obj/item/clothing/update_icon_state()
if(!can_toggle)
return
/// Done as such to not break chameleon gear since you can't rely on initial states
icon_state = "[replacetext("[icon_state]", "_up", "")][up ? "_up" : ""]"
return TRUE
/obj/item/clothing/proc/weldingvisortoggle(mob/user) //proc to toggle welding visors on helmets, masks, goggles, etc.
if(!can_use(user))
return FALSE
@@ -56,11 +64,11 @@
flags ^= visor_flags
flags_inv ^= visor_flags_inv
flags_cover ^= initial(flags_cover)
icon_state = "[initial(icon_state)][up ? "up" : ""]"
if(visor_vars_to_toggle & VISOR_FLASHPROTECT)
flash_protect ^= initial(flash_protect)
if(visor_vars_to_toggle & VISOR_TINT)
tint ^= initial(tint)
update_icon(UPDATE_ICON_STATE)
/obj/item/clothing/proc/can_use(mob/user)
if(user && ismob(user))
@@ -269,14 +277,14 @@ BLIND // can't see anything
// Called just before an attack_hand(), in mob/UnarmedAttack()
/obj/item/clothing/gloves/proc/Touch(atom/A, proximity)
return 0 // return 1 to cancel attack_hand()
return // return TRUE to cancel attack_hand()
/obj/item/clothing/gloves/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/wirecutters))
if(!clipped)
playsound(src.loc, W.usesound, 100, 1)
user.visible_message("<span class='warning'>[user] snips the fingertips off [src].</span>","<span class='warning'>You snip the fingertips off [src].</span>")
clipped = 1
clipped = TRUE
name = "mangled [name]"
desc = "[desc] They have had the fingertips cut off of them."
update_icon()
@@ -290,7 +298,7 @@ BLIND // can't see anything
* Tries to turn the sensors off. Returns TRUE if it succeeds
*/
/obj/item/clothing/under/proc/turn_sensors_off()
if(has_sensor != 1)
if(has_sensor != SUIT_SENSOR_BINARY)
return FALSE
sensor_mode = SUIT_SENSOR_OFF
return TRUE
@@ -300,10 +308,10 @@ BLIND // can't see anything
return
if(has_sensor >= 2)
to_chat(user, "The controls are locked.")
return 0
if(has_sensor <= 0)
return
if(has_sensor <= SUIT_SENSOR_OFF)
to_chat(user, "This suit does not have any sensors.")
return 0
return
var/list/modes = list("Off", "Binary sensors", "Vitals tracker", "Tracking beacon")
var/switchMode = input("Select a sensor mode:", "Suit Sensor Mode", modes[sensor_mode + 1]) in modes
@@ -374,7 +382,9 @@ BLIND // can't see anything
var/see_in_dark = 0
var/lighting_alpha
var/can_toggle = null
/obj/item/clothing/head/update_icon_state()
if(..())
item_state = "[replacetext("[item_state]", "_up", "")][up ? "_up" : ""]"
//Mask
/obj/item/clothing/mask
@@ -382,7 +392,6 @@ BLIND // can't see anything
icon = 'icons/obj/clothing/masks.dmi'
body_parts_covered = HEAD
slot_flags = SLOT_MASK
var/mask_adjusted = 0
var/adjusted_flags = null
strip_delay = 40
put_on_delay = 40
@@ -392,12 +401,14 @@ BLIND // can't see anything
var/mob/living/carbon/human/H = usr //Used to check if the mask is on the head, to check if the hands are full, and to turn off internals if they were on when the mask was pushed out of the way.
if(user.incapacitated()) //This check allows you to adjust your masks while you're buckled into chairs or beds.
return
if(mask_adjusted)
icon_state = initial(icon_state)
up = !up
update_icon(UPDATE_ICON_STATE)
if(!up)
gas_transfer_coefficient = initial(gas_transfer_coefficient)
permeability_coefficient = initial(permeability_coefficient)
to_chat(user, "<span class='notice'>You push \the [src] back into place.</span>")
mask_adjusted = 0
slot_flags = initial(slot_flags)
if(flags_inv != initial(flags_inv))
if(initial(flags_inv) & HIDEFACE) //If the mask is one that hides the face and can be adjusted yet lost that trait when it was adjusted, make it hide the face again.
@@ -415,11 +426,9 @@ BLIND // can't see anything
user.unEquip(src)
user.put_in_hands(src)
else
icon_state += "_up"
to_chat(user, "<span class='notice'>You push \the [src] out of the way.</span>")
gas_transfer_coefficient = null
permeability_coefficient = null
mask_adjusted = 1
if(adjusted_flags)
slot_flags = adjusted_flags
if(ishuman(user) && H.internal && !H.get_organ_slot("breathing_tube") && user.wear_mask == src) /*If the user was wearing the mask providing internals on their face at the time it was adjusted, turn off internals.
@@ -439,7 +448,7 @@ BLIND // can't see anything
else //Otherwise, put it in an available hand, the active one preferentially.
user.unEquip(src)
user.put_in_hands(src)
H.wear_mask_update(src, toggle_off = mask_adjusted)
H.wear_mask_update(src, toggle_off = up)
usr.update_inv_wear_mask()
usr.update_inv_head()
for(var/X in actions)
@@ -448,7 +457,7 @@ BLIND // can't see anything
// Changes the speech verb when wearing a mask if a value is returned
/obj/item/clothing/mask/proc/change_speech_verb()
return
return
//Shoes
/obj/item/clothing/shoes
@@ -456,9 +465,9 @@ BLIND // can't see anything
icon = 'icons/obj/clothing/shoes.dmi'
desc = "Comfortable-looking shoes."
gender = PLURAL //Carn: for grammatically correct text-parsing
var/chained = 0
var/can_cut_open = 0
var/cut_open = 0
var/chained = FALSE
var/can_cut_open = FALSE
var/cut_open = FALSE
body_parts_covered = FEET
slot_flags = SLOT_FEET
@@ -491,20 +500,34 @@ BLIND // can't see anything
if(!cut_open)
playsound(src.loc, I.usesound, 100, 1)
user.visible_message("<span class='warning'>[user] cuts open the toes of [src].</span>","<span class='warning'>You cut open the toes of [src].</span>")
cut_open = 1
icon_state = "[icon_state]_opentoe"
item_state = "[item_state]_opentoe"
name = "mangled [name]"
desc = "[desc] They have had their toes opened up."
update_icon()
cut_open = TRUE
update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_ICON_STATE)
else
to_chat(user, "<span class='notice'>[src] have already had [p_their()] toes cut open!</span>")
return
else
return ..()
/obj/item/clothing/shoes/update_name()
. = ..()
if(!cut_open)
return
name = "mangled [initial(name)]"
/obj/item/clothing/shoes/update_desc()
. = ..()
if(!cut_open)
return
desc = "[initial(desc)] They have had their toes opened up."
/obj/item/clothing/shoes/update_icon_state()
if(!cut_open)
return
icon_state = "[icon_state]_opentoe"
item_state = "[item_state]_opentoe"
/obj/item/proc/negates_gravity()
return 0
return
//Suit
/obj/item/clothing/suit
@@ -517,60 +540,63 @@ BLIND // can't see anything
pickup_sound = 'sound/items/handling/cloth_pickup.ogg'
slot_flags = SLOT_OCLOTHING
var/blood_overlay_type = "suit"
var/suittoggled = FALSE
var/suit_adjusted = 0
var/ignore_suitadjust = 1
var/suit_toggled = FALSE
var/suit_adjusted = FALSE
var/ignore_suitadjust = TRUE
var/adjust_flavour = null
var/list/hide_tail_by_species = null
//Proc that opens and closes jackets.
/obj/item/clothing/suit/proc/adjustsuit(mob/user)
if(!ignore_suitadjust)
if(!user.incapacitated())
if(!HAS_TRAIT(user, TRAIT_HULK))
if(suit_adjusted)
var/flavour = "close"
icon_state = copytext(icon_state, 1, findtext(icon_state, "_open")) /*Trims the '_open' off the end of the icon state, thus avoiding a case where jackets that start open will
end up with a suffix of _open_open if adjusted twice, since their initial state is _open. */
item_state = copytext(item_state, 1, findtext(item_state, "_open"))
if(adjust_flavour)
flavour = "[copytext(adjust_flavour, 3, length(adjust_flavour) + 1)] up" //Trims off the 'un' at the beginning of the word. unzip -> zip, unbutton->button.
to_chat(user, "You [flavour] \the [src].")
suit_adjusted = 0 //Suit is no longer adjusted.
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
else
var/flavour = "open"
icon_state += "_open"
item_state += "_open"
if(adjust_flavour)
flavour = "[adjust_flavour]"
to_chat(user, "You [flavour] \the [src].")
suit_adjusted = 1 //Suit's adjusted.
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
else
if(user.canUnEquip(src)) //Checks to see if the item can be unequipped. If so, lets shred. Otherwise, struggle and fail.
if(contents) //If the suit's got any storage capability...
for(var/obj/item/O in contents) //AVOIDING ITEM LOSS. Check through everything that's stored in the jacket and see if one of the items is a pocket.
if(istype(O, /obj/item/storage/internal)) //If it's a pocket...
if(O.contents) //Check to see if the pocket's got anything in it.
for(var/obj/item/I in O.contents) //Dump the pocket out onto the floor below the user.
user.unEquip(I,1)
user.visible_message("<span class='warning'>[user] bellows, [pick("shredding", "ripping open", "tearing off")] [user.p_their()] jacket in a fit of rage!</span>","<span class='warning'>You accidentally [pick("shred", "rend", "tear apart")] [src] with your [pick("excessive", "extreme", "insane", "monstrous", "ridiculous", "unreal", "stupendous")] [pick("power", "strength")]!</span>")
user.unEquip(src)
qdel(src) //Now that the pockets have been emptied, we can safely destroy the jacket.
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!"))
else
to_chat(user, "<span class='warning'>You yank and pull at \the [src] with your [pick("excessive", "extreme", "insane", "monstrous", "ridiculous", "unreal", "stupendous")] [pick("power", "strength")], however you are unable to change its state!</span>")//Yep, that's all they get. Avoids having to snowflake in a cooldown.
return
user.update_inv_wear_suit()
else
if(ignore_suitadjust)
to_chat(user, "<span class='notice'>You attempt to button up the velcro on \the [src], before promptly realising how foolish you are.</span>")
return
if(user.incapacitated())
return
if(HAS_TRAIT(user, TRAIT_HULK))
if(user.canUnEquip(src)) //Checks to see if the item can be unequipped. If so, lets shred. Otherwise, struggle and fail.
if(contents) //If the suit's got any storage capability...
for(var/obj/item/O in contents) //AVOIDING ITEM LOSS. Check through everything that's stored in the jacket and see if one of the items is a pocket.
if(istype(O, /obj/item/storage/internal)) //If it's a pocket...
if(O.contents) //Check to see if the pocket's got anything in it.
for(var/obj/item/I in O.contents) //Dump the pocket out onto the floor below the user.
user.unEquip(I,1)
user.visible_message("<span class='warning'>[user] bellows, [pick("shredding", "ripping open", "tearing off")] [user.p_their()] jacket in a fit of rage!</span>","<span class='warning'>You accidentally [pick("shred", "rend", "tear apart")] [src] with your [pick("excessive", "extreme", "insane", "monstrous", "ridiculous", "unreal", "stupendous")] [pick("power", "strength")]!</span>")
user.unEquip(src)
qdel(src) //Now that the pockets have been emptied, we can safely destroy the jacket.
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!"))
user.update_inv_wear_suit()
return
else
to_chat(user, "<span class='warning'>You yank and pull at \the [src] with your [pick("excessive", "extreme", "insane", "monstrous", "ridiculous", "unreal", "stupendous")] [pick("power", "strength")], however you are unable to change its state!</span>")//Yep, that's all they get. Avoids having to snowflake in a cooldown.
return
if(suit_adjusted)
var/flavour = "close"
icon_state = copytext(icon_state, 1, findtext(icon_state, "_open")) /*Trims the '_open' off the end of the icon state, thus avoiding a case where jackets that start open will end up with a suffix of _open_open if adjusted twice, since their initial state is _open. */
item_state = copytext(item_state, 1, findtext(item_state, "_open"))
if(adjust_flavour)
flavour = "[copytext(adjust_flavour, 3, length(adjust_flavour) + 1)] up" //Trims off the 'un' at the beginning of the word. unzip -> zip, unbutton->button.
to_chat(user, "You [flavour] \the [src].")
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
else
var/flavour = "open"
icon_state += "_open"
item_state += "_open"
if(adjust_flavour)
flavour = "[adjust_flavour]"
to_chat(user, "You [flavour] \the [src].")
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
suit_adjusted = !suit_adjusted
update_icon(UPDATE_ICON_STATE)
user.update_inv_wear_suit()
/obj/item/clothing/suit/equipped(mob/living/carbon/human/user, slot) //Handle tail-hiding on a by-species basis.
..()
@@ -672,7 +698,7 @@ BLIND // can't see anything
3 = Report location
*/
var/list/accessories = list()
var/displays_id = 1
var/displays_id = TRUE
var/rolled_down = FALSE
var/basecolor
@@ -22,7 +22,7 @@
/obj/item/clothing/glasses/meson/engine/Initialize(mapload)
. = ..()
START_PROCESSING(SSobj, src)
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/clothing/glasses/meson/engine/Destroy()
STOP_PROCESSING(SSobj, src)
@@ -46,7 +46,7 @@
if(H.glasses == src)
H.update_sight()
update_icon()
update_icon(UPDATE_ICON_STATE)
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
@@ -71,7 +71,7 @@
var/mob/living/carbon/human/user = loc
user.show_rads(range * 5) // Rads are easier to see than wires under the floor
/obj/item/clothing/glasses/meson/engine/update_icon()
/obj/item/clothing/glasses/meson/engine/update_icon_state()
icon_state = "trayson-[mode]"
update_mob()
+16 -14
View File
@@ -32,6 +32,10 @@
H.update_nearsighted_effects()
/obj/item/clothing/glasses/update_icon_state()
if(..())
item_state = "[replacetext("[item_state]", "_up", "")][up ? "_up" : ""]"
/obj/item/clothing/glasses/visor_toggling()
..()
if(visor_vars_to_toggle & VISOR_VISIONFLAGS)
@@ -272,7 +276,7 @@
item_state = "sunglasses"
see_in_dark = 1
flash_protect = FLASH_PROTECTION_FLASH
tint = 1
tint = FLASH_PROTECTION_FLASH
prescription_upgradable = TRUE
dog_fashion = /datum/dog_fashion/head
sprite_sheets = list(
@@ -288,7 +292,7 @@
item_state = "sunglasses"
see_in_dark = 0
flash_protect = FLASH_PROTECTION_NONE
tint = 0
tint = FLASH_PROTECTION_NONE
sprite_sheets = list(
"Vox" = 'icons/mob/clothing/species/vox/eyes.dmi',
"Drask" = 'icons/mob/clothing/species/drask/eyes.dmi',
@@ -341,7 +345,7 @@
item_state = "sunglasses"
see_in_dark = 1
flash_protect = FLASH_PROTECTION_FLASH
tint = 1
tint = FLASH_PROTECTION_FLASH
sprite_sheets = list(
"Vox" = 'icons/mob/clothing/species/vox/eyes.dmi',
@@ -367,7 +371,8 @@
item_state = "welding-g"
actions_types = list(/datum/action/item_action/toggle)
flash_protect = FLASH_PROTECTION_WELDER
tint = 2
tint = FLASH_PROTECTION_WELDER
can_toggle = TRUE
visor_vars_to_toggle = VISOR_FLASHPROTECT | VISOR_TINT
sprite_sheets = list(
"Vox" = 'icons/mob/clothing/species/vox/eyes.dmi',
@@ -384,7 +389,7 @@
icon_state = "rwelding-g"
item_state = "rwelding-g"
flash_protect = FLASH_PROTECTION_WELDER
tint = 0
tint = FLASH_PROTECTION_NONE
/obj/item/clothing/glasses/sunglasses/blindfold
name = "blindfold"
@@ -399,7 +404,7 @@
name = "tattered blindfold"
desc = "A see-through blindfold perfect for cheating at games like pin the stunbaton on the clown."
flash_protect = FLASH_PROTECTION_NONE
tint = 0
tint = FLASH_PROTECTION_NONE
/obj/item/clothing/glasses/sunglasses/prescription
prescription = 1
@@ -496,7 +501,7 @@
flags_cover = GLASSESCOVERSEYES
actions_types = list(/datum/action/item_action/toggle)
up = FALSE
tint = 0
tint = FLASH_PROTECTION_NONE
sprite_sheets = list(
"Vox" = 'icons/mob/clothing/species/vox/eyes.dmi',
@@ -525,15 +530,12 @@
/obj/item/clothing/glasses/proc/toggle_veil()
if(HAS_TRAIT(usr, TRAIT_HANDS_BLOCKED) || usr.incapacitated())
return
up = !up
if(up)
up = !up
tint = initial(tint)
to_chat(usr, "You activate [src], allowing you to see.")
else
up = !up
tint = 3
to_chat(usr, "You deactivate [src], obscuring your vision.")
else
tint = initial(tint)
to_chat(usr, up ? "You deactivate [src], obscuring your vision." : "You activate [src], allowing you to see.")
var/mob/living/carbon/user = usr
user.update_tint()
user.update_inv_glasses()
+4 -4
View File
@@ -57,7 +57,7 @@
icon_state = "sunhudmed"
see_in_dark = 1
flash_protect = FLASH_PROTECTION_FLASH
tint = 1
tint = FLASH_PROTECTION_FLASH
/obj/item/clothing/glasses/hud/diagnostic
name = "diagnostic HUD"
@@ -88,7 +88,7 @@
icon_state = "sunhuddiag"
item_state = "glasses"
flash_protect = FLASH_PROTECTION_FLASH
tint = 1
tint = FLASH_PROTECTION_FLASH
/obj/item/clothing/glasses/hud/security
name = "security HUD"
@@ -133,7 +133,7 @@
origin_tech = "magnets=3;combat=3;engineering=3"
see_in_dark = 1
flash_protect = FLASH_PROTECTION_FLASH
tint = 1
tint = FLASH_PROTECTION_FLASH
prescription_upgradable = TRUE
sprite_sheets = list(
@@ -220,7 +220,7 @@
icon_state = "sunhudskill"
see_in_dark = 1 // None of these three can be converted to booleans. Do not try it.
flash_protect = FLASH_PROTECTION_FLASH
tint = 1
tint = FLASH_PROTECTION_FLASH
prescription_upgradable = TRUE
sprite_sheets = list(
"Drask" = 'icons/mob/clothing/species/drask/eyes.dmi',
@@ -9,7 +9,7 @@
min_cold_protection_temperature = GLOVES_MIN_TEMP_PROTECT
strip_delay = 40
put_on_delay = 20
clipped = 1
clipped = TRUE
/obj/item/clothing/gloves/cyborg
name = "cyborg gloves"
@@ -93,7 +93,7 @@
/obj/item/clothing/gloves/color/yellow/stun/New()
..()
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/item/clothing/gloves/color/yellow/stun/Destroy()
QDEL_NULL(cell)
@@ -123,12 +123,11 @@
return TRUE
return FALSE
/obj/item/clothing/gloves/color/yellow/stun/update_icon()
..()
overlays.Cut()
overlays += "gloves_wire"
/obj/item/clothing/gloves/color/yellow/stun/update_overlays()
. = ..()
. += "gloves_wire"
if(cell)
overlays += "gloves_cell"
. += "gloves_cell"
/obj/item/clothing/gloves/color/yellow/stun/attackby(obj/item/W, mob/living/user, params)
if(istype(W, /obj/item/stock_parts/cell))
@@ -139,7 +138,7 @@
W.forceMove(src)
cell = W
to_chat(user, "<span class='notice'>You attach [W] to [src].</span>")
update_icon()
update_icon(UPDATE_OVERLAYS)
else
to_chat(user, "<span class='notice'>[src] already has a cell.</span>")
else
@@ -153,7 +152,7 @@
to_chat(user, "<span class='notice'>You cut [cell] away from [src].</span>")
cell.forceMove(get_turf(loc))
cell = null
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/item/clothing/gloves/color/yellow/fake/examine(mob/user)
. = ..()
+4 -4
View File
@@ -13,9 +13,9 @@
/obj/item/clothing/gloves/ring/New()
..()
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/clothing/gloves/ring/update_icon()
/obj/item/clothing/gloves/ring/update_icon_state()
icon_state = "[stud ? "d_" : ""][ring_color]ring"
/obj/item/clothing/gloves/ring/examine(mob/user)
@@ -33,8 +33,8 @@
else
if(D.amount >= 1)
D.use(1)
stud = 1
update_icon()
stud = TRUE
update_icon(UPDATE_ICON_STATE)
to_chat(usr, "<span class='notice'>You socket the diamond into [src].</span>")
// s'pensive
+3 -4
View File
@@ -25,9 +25,9 @@
turn_on(user)
else
turn_off(user)
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/clothing/head/hardhat/update_icon()
/obj/item/clothing/head/hardhat/update_icon_state()
icon_state = "hardhat[on]_[item_color]"
item_state = "hardhat[on]_[item_color]"
if(ishuman(loc))
@@ -36,7 +36,6 @@
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
..()
/obj/item/clothing/head/hardhat/proc/turn_on(mob/user)
set_light(brightness_on)
@@ -48,7 +47,7 @@
if(on)
on = FALSE
turn_off(user)
update_icon()
update_icon(UPDATE_ICON_STATE)
visible_message("<span class='danger'>[src]'s light fades and turns off.</span>")
/obj/item/clothing/head/hardhat/orange
+1 -3
View File
@@ -27,9 +27,8 @@
up = !up
flags ^= visor_flags
flags_inv ^= visor_flags_inv
icon_state = "[initial(icon_state)][up ? "up" : ""]"
to_chat(user, "[up ? alt_toggle_message : toggle_message] \the [src]")
update_icon(UPDATE_ICON_STATE)
user.update_inv_head()
if(active_sound)
@@ -39,7 +38,6 @@
if(toggle_sound)
playsound(src.loc, "[toggle_sound]", 100, 0, 4)
/obj/item/clothing/head/helmet/visor
name = "visor helmet"
desc = "A helmet with a built-in visor. It doesn't seem to do anything, but it sure looks cool!"
+12 -50
View File
@@ -20,7 +20,8 @@
item_state = "welding"
materials = list(MAT_METAL=1750, MAT_GLASS=400)
flash_protect = FLASH_PROTECTION_WELDER
tint = 2
tint = FLASH_PROTECTION_WELDER
can_toggle = TRUE
armor = list(MELEE = 10, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 100, ACID = 60)
flags_inv = (HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE)
actions_types = list(/datum/action/item_action/toggle)
@@ -35,6 +36,9 @@
"Grey" = 'icons/mob/clothing/species/grey/helmet.dmi'
)
/obj/item/clothing/head/welding/attack_self(mob/user)
weldingvisortoggle(user)
/obj/item/clothing/head/welding/flamedecal
name = "flame decal welding helmet"
desc = "A welding helmet adorned with flame decals, and several cryptic slogans of varying degrees of legibility."
@@ -50,38 +54,6 @@
desc = "A white welding helmet with a character written across it."
icon_state = "welding_white"
/obj/item/clothing/head/welding/attack_self()
toggle()
/obj/item/clothing/head/welding/proc/toggle()
if(up)
up = !up
flags_cover |= (HEADCOVERSEYES | HEADCOVERSMOUTH)
flags_inv |= (HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE)
icon_state = initial(icon_state)
to_chat(usr, "You flip [src] down to protect your eyes.")
flash_protect = FLASH_PROTECTION_WELDER
tint = 2
else
up = !up
flags_cover &= ~(HEADCOVERSEYES | HEADCOVERSMOUTH)
flags_inv &= ~(HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE)
icon_state = "[initial(icon_state)]up"
to_chat(usr, "You push [src] up out of your face.")
flash_protect = FLASH_PROTECTION_NONE
tint = 0
var/mob/living/carbon/user = usr
user.update_tint()
//so our mob-overlays update
user.update_inv_wear_mask()
user.update_inv_head()
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
/*
* Cakehat
*/
@@ -194,14 +166,16 @@
var/icon/mob
dog_fashion = /datum/dog_fashion/head/kitty
/obj/item/clothing/head/kitty/update_icon(mob/living/carbon/human/user)
if(!istype(user)) return
/obj/item/clothing/head/kitty/update_icon(updates=ALL, mob/living/carbon/human/user)
..()
if(!istype(user))
return
var/obj/item/organ/external/head/head_organ = user.get_organ("head")
mob = new/icon("icon" = 'icons/mob/clothing/head.dmi', "icon_state" = "kitty")
mob = new/icon("icon" = 'icons/mob/clothing/head.dmi', "icon_state" = icon_state)
mob.Blend(head_organ.hair_colour, ICON_ADD)
var/icon/earbit = new/icon("icon" = 'icons/mob/clothing/head.dmi', "icon_state" = "kittyinner")
var/icon/earbit = new/icon("icon" = 'icons/mob/clothing/head.dmi', "icon_state" = "[icon_state]inner")
mob.Blend(earbit, ICON_OVERLAY)
icon_override = mob
@@ -209,25 +183,13 @@
/obj/item/clothing/head/kitty/equipped(mob/M, slot)
. = ..()
if(ishuman(M) && slot == slot_head)
update_icon(M)
update_icon(NONE, M)
/obj/item/clothing/head/kitty/mouse
name = "mouse ears"
desc = "A pair of mouse ears. Squeak!"
icon_state = "mousey"
/obj/item/clothing/head/kitty/mouse/update_icon(mob/living/carbon/human/user)
if(!istype(user)) return
var/obj/item/organ/external/head/head_organ = user.get_organ("head")
mob = new/icon("icon" = 'icons/mob/clothing/head.dmi', "icon_state" = "mousey")
mob.Blend(head_organ.hair_colour, ICON_ADD)
var/icon/earbit = new/icon("icon" = 'icons/mob/clothing/head.dmi', "icon_state" = "mouseyinner")
mob.Blend(earbit, ICON_OVERLAY)
icon_override = mob
/obj/item/clothing/head/cardborg
name = "cardborg helmet"
desc = "A helmet made out of a box."
+1
View File
@@ -5,6 +5,7 @@
item_state = "breath"
flags = AIRTIGHT
flags_cover = MASKCOVERSMOUTH
can_toggle = TRUE
w_class = WEIGHT_CLASS_SMALL
gas_transfer_coefficient = 0.10
permeability_coefficient = 0.50
+7 -2
View File
@@ -29,12 +29,13 @@
item_state = "weldingmask"
materials = list(MAT_METAL=4000, MAT_GLASS=2000)
flash_protect = FLASH_PROTECTION_WELDER
tint = 2
tint = FLASH_PROTECTION_WELDER
armor = list(MELEE = 10, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 100, ACID = 55)
origin_tech = "materials=2;engineering=3"
actions_types = list(/datum/action/item_action/toggle)
flags_inv = HIDEEARS|HIDEEYES|HIDEFACE
flags_cover = MASKCOVERSEYES
can_toggle = TRUE
visor_flags_inv = HIDEEYES
resistance_flags = FIRE_PROOF
@@ -48,6 +49,7 @@
actions_types = list(/datum/action/item_action/adjust)
armor = list(MELEE = 10, BULLET = 5, LASER = 5, ENERGY = 5, BOMB = 0, BIO = 50, RAD = 0, FIRE = 20, ACID = 40)
resistance_flags = FIRE_PROOF
can_toggle = TRUE
sprite_sheets = list(
"Vox" = 'icons/mob/clothing/species/vox/mask.dmi',
@@ -66,7 +68,7 @@
/obj/item/clothing/mask/gas/explorer/adjustmask(user)
..()
w_class = mask_adjusted ? WEIGHT_CLASS_SMALL : WEIGHT_CLASS_NORMAL
w_class = up ? WEIGHT_CLASS_SMALL : WEIGHT_CLASS_NORMAL
/obj/item/clothing/mask/gas/explorer/folded/Initialize()
. = ..()
@@ -214,6 +216,7 @@
var/phrase = 1
var/aggressiveness = 1
var/safety = 1
can_toggle = TRUE
actions_types = list(/datum/action/item_action/halt, /datum/action/item_action/adjust, /datum/action/item_action/selectphrase)
var/phrase_list = list(
@@ -240,6 +243,7 @@
name = "head of security's SWAT mask"
desc = "A close-fitting tactical mask with an especially aggressive Compli-o-nator 3000. It has a tan stripe."
icon_state = "hosmask"
can_toggle = FALSE
aggressiveness = 3
phrase = 12
actions_types = list(/datum/action/item_action/halt, /datum/action/item_action/selectphrase)
@@ -248,6 +252,7 @@
name = "warden's SWAT mask"
desc = "A close-fitting tactical mask with an especially aggressive Compli-o-nator 3000. It has a blue stripe."
icon_state = "wardenmask"
can_toggle = FALSE
aggressiveness = 3
phrase = 12
actions_types = list(/datum/action/item_action/halt, /datum/action/item_action/selectphrase)
+3 -1
View File
@@ -208,6 +208,7 @@
permeability_coefficient = 0.01
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 25, RAD = 0, FIRE = 0, ACID = 0)
actions_types = list(/datum/action/item_action/adjust)
can_toggle = TRUE
sprite_sheets = list(
"Vox" = 'icons/mob/clothing/species/vox/mask.dmi',
@@ -424,6 +425,7 @@
adjusted_flags = SLOT_HEAD
icon_state = "bandbotany"
dyeable = TRUE
can_toggle = TRUE
sprite_sheets = list(
"Vox" = 'icons/mob/clothing/species/vox/mask.dmi',
@@ -434,7 +436,7 @@
"Drask" = 'icons/mob/clothing/species/drask/mask.dmi'
)
actions_types = list(/datum/action/item_action/adjust)
can_toggle = TRUE
/obj/item/clothing/mask/bandana/attack_self(mob/user)
adjustmask(user)
+1 -1
View File
@@ -147,7 +147,7 @@
desc = "An almost organic looking nonhuman pressure suit."
/obj/item/clothing/under/vox
has_sensor = 0
has_sensor = FALSE
icon = 'icons/obj/clothing/species/vox/uniforms.dmi'
species_restricted = list("Vox")
sprite_sheets = list(
+4 -4
View File
@@ -341,7 +341,7 @@
visor_flags_inv = HIDEMASK|HIDEEYES|HIDEFACE|HIDETAIL
visor_flags = STOPSPRESSUREDMAGE
/obj/item/clothing/head/helmet/space/hardsuit/syndi/update_icon()
/obj/item/clothing/head/helmet/space/hardsuit/syndi/update_icon_state()
icon_state = "hardsuit[on]-[item_color]"
/obj/item/clothing/head/helmet/space/hardsuit/syndi/New()
@@ -417,7 +417,7 @@
helmettype = /obj/item/clothing/head/helmet/space/hardsuit/syndi
jetpack = /obj/item/tank/jetpack/suit
/obj/item/clothing/suit/space/hardsuit/syndi/update_icon()
/obj/item/clothing/suit/space/hardsuit/syndi/update_icon_state()
icon_state = "hardsuit[on]-[item_color]"
//Elite Syndie suit
@@ -462,7 +462,7 @@
helmettype = /obj/item/clothing/head/helmet/space/hardsuit/syndi/freedom
sprite_sheets = null
/obj/item/clothing/suit/space/hardsuit/syndi/freedom/update_icon()
/obj/item/clothing/suit/space/hardsuit/syndi/freedom/update_icon_state()
return
/obj/item/clothing/head/helmet/space/hardsuit/syndi/freedom
@@ -472,7 +472,7 @@
item_state = "griffinhat"
sprite_sheets = null
/obj/item/clothing/head/helmet/space/hardsuit/syndi/freedom/update_icon()
/obj/item/clothing/head/helmet/space/hardsuit/syndi/freedom/update_icon_state()
return
//Medical hardsuit
@@ -6,7 +6,7 @@
item_state = "plasmaman-helm"
strip_delay = 80
flash_protect = FLASH_PROTECTION_WELDER
tint = 2
tint = FLASH_PROTECTION_WELDER
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 100, RAD = 0, FIRE = 100, ACID = 75)
resistance_flags = FIRE_PROOF
var/brightness_on = 4 //luminosity when the light is on
@@ -28,7 +28,6 @@
..()
visor_toggling()
update_icon()
cut_overlays()
/obj/item/clothing/head/helmet/space/plasmaman/AltClick(mob/user)
if(!user.incapacitated() && Adjacent(user))
@@ -57,20 +56,21 @@
playsound(src, 'sound/mecha/mechmove03.ogg', 50, 1) //Visors don't just come from nothing
update_icon()
/obj/item/clothing/head/helmet/space/plasmaman/update_icon()
cut_overlays()
add_overlay(visor_icon)
..()
/obj/item/clothing/head/helmet/space/plasmaman/update_icon_state()
icon_state = "[initial(icon_state)][on ? "-light":""]"
item_state = icon_state
actions_types = list(/datum/action/item_action/toggle_helmet_light)
/obj/item/clothing/head/helmet/space/plasmaman/update_overlays()
. = ..()
. += visor_icon
/obj/item/clothing/head/helmet/space/plasmaman/attack_self(mob/user)
toggle_light(user)
/obj/item/clothing/head/helmet/space/plasmaman/proc/toggle_light(mob/user)
if(up)
on = !on
icon_state = "[initial(icon_state)][on ? "-light":""]"
item_state = icon_state
if(isnull(user))
user = loc
var/mob/living/carbon/human/H = user
@@ -89,6 +89,7 @@
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
update_icon()
/obj/item/clothing/head/helmet/space/plasmaman/extinguish_light()
if(on)
+3 -3
View File
@@ -37,7 +37,7 @@
/obj/item/clothing/suit/space/hardsuit/proc/RemoveHelmet()
if(!helmet)
return
suittoggled = FALSE
suit_toggled = FALSE
if(ishuman(helmet.loc))
var/mob/living/carbon/H = helmet.loc
if(helmet.on)
@@ -60,7 +60,7 @@
return
if(!helmet)
return
if(!suittoggled)
if(!suit_toggled)
if(ishuman(src.loc))
if(H.wear_suit != src)
to_chat(H, "<span class='warning'>You must be wearing [src] to engage the helmet!</span>")
@@ -70,7 +70,7 @@
return
else if(H.equip_to_slot_if_possible(helmet, slot_head, FALSE, FALSE))
to_chat(H, "<span class='notice'>You engage the helmet on the hardsuit.</span>")
suittoggled = TRUE
suit_toggled = TRUE
H.update_inv_wear_suit()
playsound(src.loc, 'sound/mecha/mechmove03.ogg', 50, 1)
else
+2 -2
View File
@@ -56,7 +56,7 @@
/obj/item/clothing/under/color/grey/glorf/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
owner.forcesay(GLOB.hit_appends)
return 0
return
/obj/item/clothing/under/color/orange
name = "orange jumpsuit"
@@ -72,7 +72,7 @@
item_state = "prisoner"
item_color = "prisoner"
has_sensor = 2
sensor_mode = 3
sensor_mode = SENSOR_COORDS
/obj/item/clothing/under/color/pink
name = "pink jumpsuit"
+8 -8
View File
@@ -67,7 +67,7 @@
item_state = "ro_suit"
item_color = "solgov"
armor = list(MELEE = 10, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 30, ACID = 30)
displays_id = 0
displays_id = FALSE
/obj/item/clothing/under/solgov/elite
name = "\improper Trans-Solar Federation Specops marine uniform"
desc = "A comfortable and durable combat uniform worn by Trans-Solar Federation Specops Marine Forces."
@@ -127,7 +127,7 @@
item_state = "navy_gold"
item_color = "navy_gold"
armor = list(MELEE = 10, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 30, ACID = 30)
displays_id = 0
displays_id = FALSE
/obj/item/clothing/under/rank/centcom/captain
name = "\improper Nanotrasen naval captain's uniform"
@@ -136,7 +136,7 @@
item_state = "navy_gold"
item_color = "navy_gold"
armor = list(MELEE = 10, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 30, ACID = 30)
displays_id = 0
displays_id = FALSE
/obj/item/clothing/under/rank/centcom/captain/solgov
name = "\improper Trans-Solar Federation commander's uniform"
@@ -149,7 +149,7 @@
item_state = "g_suit"
item_color = "officer"
armor = list(MELEE = 10, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 30, ACID = 30)
displays_id = 0
displays_id = FALSE
/obj/item/clothing/under/rank/centcom/representative
name = "formal Nanotrasen Representative's uniform"
@@ -157,7 +157,7 @@
icon_state = "officer"
item_state = "g_suit"
item_color = "officer"
displays_id = 0
displays_id = FALSE
/obj/item/clothing/under/rank/centcom/representative/New()
..()
@@ -169,7 +169,7 @@
icon_state = "officer"
item_state = "g_suit"
item_color = "officer"
displays_id = 0
displays_id = FALSE
/obj/item/clothing/under/rank/centcom/magistrate/New()
..()
@@ -181,7 +181,7 @@
icon_state = "presidente"
item_state = "g_suit"
item_color = "presidente"
displays_id = 0
displays_id = FALSE
/obj/item/clothing/under/rank/blueshield
name = "blueshield's uniform"
@@ -777,7 +777,7 @@
righthand_file = 'icons/goonstation/mob/inhands/clothing_righthand.dmi'
flags = NODROP
resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF
has_sensor = 0 // HUNKE
has_sensor = FALSE // HUNKE
/obj/item/clothing/under/victdress
name = "black victorian dress"
@@ -6,7 +6,7 @@
icon_state = "retro_sec"
item_state = "retro_sec"
item_color = "retro_sec"
displays_id = 0
displays_id = FALSE
/obj/item/clothing/under/retro/medical
name = "retro medical officer's uniform"
@@ -14,7 +14,7 @@
icon_state = "retro_med"
item_state = "retro_med"
item_color = "retro_med"
displays_id = 0
displays_id = FALSE
/obj/item/clothing/under/retro/engineering
name = "retro engineering uniform"
@@ -22,7 +22,7 @@
icon_state = "retro_eng"
item_state = "retro_eng"
item_color = "retro_eng"
displays_id = 0
displays_id = FALSE
/obj/item/clothing/under/retro/science
name = "retro science officer's uniform"
@@ -30,4 +30,4 @@
icon_state = "retro_sci"
item_state = "retro_sci"
item_color = "retro_sci"
displays_id = 0
displays_id = FALSE
+1 -1
View File
@@ -3,7 +3,7 @@
desc = "95% Polyester, 5% Spandex!"
gender = PLURAL
body_parts_covered = LOWER_TORSO
displays_id = 0
displays_id = FALSE
/obj/item/clothing/under/shorts/red
icon_state = "redshorts"
+1 -1
View File
@@ -4,7 +4,7 @@
icon_state = "syndicate"
item_state = "bl_suit"
item_color = "syndicate"
has_sensor = 0
has_sensor = FALSE
armor = list(MELEE = 10, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 50, ACID = 40)
/obj/item/clothing/under/syndicate/combat
+9 -12
View File
@@ -78,15 +78,12 @@
used = TRUE
update_icon()
/obj/item/fluff/tattoo_gun/update_icon()
..()
overlays.Cut()
/obj/item/fluff/tattoo_gun/update_overlays()
. = ..()
if(!used)
var/image/ink = image(src.icon, src, "ink_overlay")
ink.icon += rgb(tattoo_r, tattoo_g, tattoo_b, 190)
overlays += ink
. += ink
/obj/item/fluff/tattoo_gun/New()
..()
@@ -1108,7 +1105,7 @@
icon_state = "elishirt"
item_state = "elishirt"
item_color = "elishirt"
displays_id = 0
displays_id = FALSE
/obj/item/clothing/under/fluff/jay_turtleneck // Jayfeather: Jay Wingler
name = "Mar's Pattern Custom Turtleneck"
@@ -1117,7 +1114,7 @@
icon_state = "jaywingler"
item_state = "jaywingler"
item_color = "jaywingler"
displays_id = 0
displays_id = FALSE
/obj/item/clothing/under/psysuit/fluff/isaca_sirius_1 // Xilia: Isaca Sirius
name = "Isaca's suit"
@@ -1131,7 +1128,7 @@
item_state = "jane_sid_suit"
item_color = "jane_sid_suit"
has_sensor = 2
sensor_mode = 3
sensor_mode = SENSOR_COORDS
/obj/item/clothing/under/fluff/jane_sidsuit/verb/toggle_zipper()
set name = "Toggle Jumpsuit Zipper"
@@ -1159,7 +1156,7 @@
icon_state = "roman"
item_state = "maximus_armor"
item_color = "maximus_armor"
displays_id = 0
displays_id = FALSE
strip_delay = 100
/obj/item/clothing/under/fluff/aegis //PlagueWalker: A.E.G.I.S.
@@ -1171,7 +1168,7 @@
icon_state = "aegisuniform"
item_state = "aegisuniform"
item_color = "aegisuniform"
displays_id = 0
displays_id = FALSE
/obj/item/clothing/under/fluff/elo_turtleneck // vforcebomber: E.L.O.
name = "E.L.O's Turtleneck"
@@ -1666,7 +1663,7 @@
icon = 'icons/obj/custom_items.dmi'
fluff_material = TRUE
/obj/item/clothing/gloves/ring/fluff/update_icon()
/obj/item/clothing/gloves/ring/fluff/update_icon_state()
return
/obj/item/clothing/gloves/ring/fluff/attackby(obj/item/I as obj, mob/user as mob, params)
@@ -21,6 +21,7 @@
flags = NOBLUDGEON
container_type = OPENCONTAINER
has_lid = FALSE
blocks_emissive = EMISSIVE_BLOCK_GENERIC
var/wipespeed = 30
/obj/item/reagent_containers/glass/rag/attack(atom/target as obj|turf|area, mob/user as mob , flag)
+28 -29
View File
@@ -16,9 +16,9 @@
var/tank_type = "" // Type of aquarium, used for icon updating
var/water_capacity = 0 // Number of units the tank holds (varies with tank type)
var/water_level = 0 // Number of units currently in the tank (new tanks start empty)
var/light_switch = 0 // 0 = off, 1 = on (off by default)
var/light_switch = FALSE
var/filth_level = 0 // How dirty the tank is (max 10)
var/lid_switch = 0 // 0 = open, 1 = closed (open by default)
var/lid_switch = FALSE
var/max_fish = 0 // How many fish the tank can support (varies with tank type, 1 fish per 50 units sounds reasonable)
var/food_level = 0 // Amount of fishfood floating in the tank (max 10)
var/fish_count = 0 // Number of fish in the tank
@@ -94,7 +94,7 @@
/obj/machinery/fishtank/proc/toggle_lid()
lid_switch = !lid_switch
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/machinery/fishtank/verb/toggle_light_verb()
set name = "Toggle Tank Light"
@@ -129,24 +129,23 @@
// ICON PROCS //
//////////////////////////////
/obj/machinery/fishtank/update_icon()
cut_overlays()
/obj/machinery/fishtank/update_overlays()
. = ..()
//Update Alert Lights
if(has_lid) //Skip the alert lights for aquariums that don't have lids (fishbowls)
if(egg_count > 0) //There is at least 1 egg to harvest
add_overlay("over_egg")
if(lid_switch == 1) //Lid is closed, lid status light is red
add_overlay("over_lid_1")
. += "over_egg"
if(lid_switch) //Lid is closed, lid status light is red
. += "over_lid_1"
else //Lid is open, lid status light is green
add_overlay("over_lid_0")
. += "over_lid_0"
if(food_level > 5) //Food_level is high and isn't a concern yet
add_overlay("over_food_0")
. += "over_food_0"
else if(food_level > 2) //Food_level is starting to get low, but still above the breeding threshold
add_overlay("over_food_1")
. += "over_food_1"
else //Food_level is below breeding threshold, or fully consumed, feed the fish!
add_overlay("over_food_2")
add_overlay("over_leak_[leaking]") //Green if we aren't leaking, light blue and slow blink if minor link, dark blue and rapid flashing for major leak
. += "over_food_2"
. += "over_leak_[leaking]" //Green if we aren't leaking, light blue and slow blink if minor link, dark blue and rapid flashing for major leak
//Update water overlay
if(!water_level)
@@ -154,23 +153,23 @@
var/water_type = "_clean" //Default to clean water
if(filth_level > 5) water_type = "_dirty" //Show dirty water above filth_level 5 (breeding threshold)
if(water_level > (water_capacity * 0.85)) //Show full if the water_level is over 85% of water_capacity
add_overlay("over_[tank_type]_full[water_type]")
. += "over_[tank_type]_full[water_type]"
else if(water_level > (water_capacity * 0.35)) //Show half-full if the water_level is over 35% of water_capacity
add_overlay("over_[tank_type]_half[water_type]")
. += "over_[tank_type]_half[water_type]"
/obj/machinery/fishtank/wall/update_icon()
..()
/obj/machinery/fishtank/wall/update_overlays()
. = ..()
// Update fish overlay for wall tanks
var/num_fish = length(fish_list)
if(!num_fish)
return
switch(num_fish)
if(1 to 3)
add_overlay("over_tank_fish_33")
. += "over_tank_fish_33"
if(4 to 7)
add_overlay("over_tank_fish_66")
. += "over_tank_fish_66"
if(7 to INFINITY)
add_overlay("over_tank_fish_100")
. += "over_tank_fish_100"
//////////////////////////////
// PROCESS PROC //
@@ -183,7 +182,7 @@
/obj/machinery/fishtank/process()
//Start by counting fish in the tank
fish_count = 0
var/ate_food = 0
var/ate_food = FALSE
for(var/fish in fish_list)
if(fish)
fish_count++
@@ -205,7 +204,7 @@
if(prob(((fish_count - 2) * 5)+10)) //Chances increase with each additional fish, 10% base + 5% per additional fish
breed_fish()
adjust_food_level(-0.1) //Remove extra food for the breeding process
ate_food = 1
ate_food = TRUE
//Handle standard food and filth adjustments
if(food_level > 0 && prob(50)) //Chance for the fish to eat some food
@@ -213,7 +212,7 @@
adjust_food_level(fish_count * -0.05)
else //Use up the last of the food
adjust_food_level(-food_level)
ate_food = 1
ate_food = TRUE
if(water_level > 0) //Don't dirty the tank if it has no water
if(fish_count == 0) //If the tank has no fish, algae growth can occur
@@ -284,7 +283,7 @@
if(istype(fish_type, /datum/fish/glofish))
adjust_tank_light()
qdel(fish_type)
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/machinery/fishtank/proc/add_fish(datum/fish/fish_type = null)
//Check if we were passed a fish type
@@ -294,7 +293,7 @@
fish_count++ //Increase fish_count to reflect the introduction of a fish, so the everything else works fine
//Announce the new fish
visible_message("A new [fish_type.fish_name] has hatched in [src]!")
update_icon()
update_icon(UPDATE_OVERLAYS)
//Null type fish are dud eggs, give a message to inform the player
else
to_chat(usr, "The eggs disolve in the water. They were duds!")
@@ -376,10 +375,10 @@
var/list/breed_candidates = fish_list.Copy()
var/datum/fish/parent1 = pick_n_take(breed_candidates)
if(!parent1.crossbreeder) //fish with crossbreed = 0 will only breed with their own species, and only leave duds if they can't breed
var/match_found = 0
var/match_found = FALSE
for(var/datum/fish/possible in breed_candidates)
if(parent1.type == possible.type)
match_found = 1
match_found = TRUE
break
if(match_found)
egg_list.Add(parent1.egg_item)
@@ -523,7 +522,7 @@
. += "<span class='notice'>[examine_message]</span>"
//////////////////////////////
// ATACK PROCS //
// ATTACK PROCS //
//////////////////////////////
/obj/machinery/fishtank/attack_animal(mob/living/simple_animal/M)
@@ -57,7 +57,7 @@
else if(istype(O, /obj/item/reagent_containers/food/drinks/cans))
var/obj/item/reagent_containers/food/drinks/cans/C = O
if(C.reagents)
if(C.canopened && C.reagents.total_volume) //This prevents us from using opened cans that still have something in them
if(C.can_opened && C.reagents.total_volume) //This prevents us from using opened cans that still have something in them
to_chat(user, "<span class='warning'>Only unopened cans and bottles can be processed to ensure product integrity.</span>")
return 0
user.unEquip(C)
@@ -235,7 +235,7 @@
if(containers[con_type])
//empties aren't sealed, so let's open it quietly
drink_container = new drink_container()
drink_container.canopened = TRUE
drink_container.can_opened = TRUE
drink_container.container_type |= OPENCONTAINER
drink_container.forceMove(loc)
containers[con_type]--
@@ -399,7 +399,7 @@
updateUsrDialog()
return
/obj/machinery/bottler/update_icon()
/obj/machinery/bottler/update_icon_state()
if(stat & BROKEN)
icon_state = "bottler_broken"
else if(bottling)
@@ -10,7 +10,7 @@
throwforce = 15
item_state = "broken_beer" //Generic held-item sprite until unique ones are made.
var/const/duration = 13 //Directly relates to the 'weaken' duration. Lowered by armor (i.e. helmets)
var/isGlass = 1 //Whether the 'bottle' is made of glass or not so that milk cartons dont shatter when someone gets hit by it
var/is_glass = TRUE //Whether the 'bottle' is made of glass or not so that milk cartons dont shatter when someone gets hit by it
/obj/item/reagent_containers/food/drinks/bottle/proc/smash(mob/living/target, mob/living/user, ranged = FALSE)
@@ -29,7 +29,7 @@
I.SwapColor(rgb(255, 0, 220, 255), rgb(0, 0, 0, 0))
B.icon = I
if(isGlass)
if(is_glass)
if(prob(33))
new/obj/item/shard(new_location)
playsound(src, "shatter", 70, 1)
@@ -47,7 +47,7 @@
if(!target)
return
if(user.a_intent != INTENT_HARM || !isGlass)
if(user.a_intent != INTENT_HARM || !is_glass)
return ..()
if(HAS_TRAIT(user, TRAIT_PACIFISM))
@@ -285,7 +285,7 @@
icon_state = "orangejuice"
item_state = "carton"
throwforce = 0
isGlass = 0
is_glass = FALSE
list_reagents = list("orangejuice" = 100)
/obj/item/reagent_containers/food/drinks/bottle/cream
@@ -294,7 +294,7 @@
icon_state = "cream"
item_state = "carton"
throwforce = 0
isGlass = 0
is_glass = FALSE
list_reagents = list("cream" = 100)
/obj/item/reagent_containers/food/drinks/bottle/tomatojuice
@@ -303,7 +303,7 @@
icon_state = "tomatojuice"
item_state = "carton"
throwforce = 0
isGlass = 0
is_glass = FALSE
list_reagents = list("tomatojuice" = 100)
/obj/item/reagent_containers/food/drinks/bottle/limejuice
@@ -312,7 +312,7 @@
icon_state = "limejuice"
item_state = "carton"
throwforce = 0
isGlass = 0
is_glass = FALSE
list_reagents = list("limejuice" = 100)
/obj/item/reagent_containers/food/drinks/bottle/milk
@@ -321,7 +321,7 @@
icon_state = "milk"
item_state = "carton"
throwforce = 0
isGlass = 0
is_glass = FALSE
list_reagents = list("milk" = 100)
////////////////////////// MOLOTOV ///////////////////////
@@ -334,22 +334,37 @@
/datum/reagent/napalm,/datum/reagent/hellwater,/datum/reagent/plasma,/datum/reagent/plasma_dust)
var/active = FALSE
/obj/item/reagent_containers/food/drinks/bottle/molotov/CheckParts(list/parts_list)
..()
/obj/item/reagent_containers/food/drinks/bottle/molotov/update_desc()
. = ..()
desc = initial(desc)
if(!is_glass)
desc += " You're not sure if making this out of a carton was the brightest idea."
/obj/item/reagent_containers/food/drinks/bottle/molotov/update_icon_state()
var/obj/item/reagent_containers/food/drinks/bottle/B = locate() in contents
if(B)
icon_state = B.icon_state
/obj/item/reagent_containers/food/drinks/bottle/molotov/update_overlays()
. = ..()
if(active)
. += GLOB.fire_overlay
/obj/item/reagent_containers/food/drinks/bottle/molotov/CheckParts(list/parts_list)
..()
var/obj/item/reagent_containers/food/drinks/bottle/B = locate() in contents
if(B)
B.reagents.copy_to(src, 100)
if(!B.isGlass)
desc += " You're not sure if making this out of a carton was the brightest idea."
isGlass = 0
if(!B.is_glass)
is_glass = FALSE
update_appearance(UPDATE_DESC|UPDATE_ICON)
/obj/item/reagent_containers/food/drinks/bottle/molotov/throw_impact(atom/target,mob/thrower)
var/firestarter = 0
var/firestarter = FALSE
for(var/datum/reagent/R in reagents.reagent_list)
for(var/A in accelerants)
if(istype(R, A))
firestarter = 1
firestarter = TRUE
break
..()
if(firestarter && active)
@@ -365,8 +380,7 @@
log_game("[key_name(user)] has primed a [name] for detonation at [bombarea] ([bombturf.x],[bombturf.y],[bombturf.z]).")
to_chat(user, "<span class='info'>You light [src] on fire.</span>")
overlays += GLOB.fire_overlay
if(!isGlass)
if(!is_glass)
spawn(50)
if(active)
var/counter
@@ -383,9 +397,9 @@
/obj/item/reagent_containers/food/drinks/bottle/molotov/attack_self(mob/user)
if(active)
if(!isGlass)
if(!is_glass)
to_chat(user, "<span class='danger'>The flame's spread too far on it!</span>")
return
to_chat(user, "<span class='info'>You snuff out the flame on \the [src].</span>")
overlays -= GLOB.fire_overlay
active = FALSE
update_icon(UPDATE_OVERLAYS)
@@ -1,28 +1,28 @@
/obj/item/reagent_containers/food/drinks/cans
container_type = NONE
var/canopened = FALSE
var/is_glass = 0
var/is_plastic = 0
var/times_shaken = 0
var/can_opened = FALSE
var/is_glass = FALSE
var/is_plastic = FALSE
var/times_shaken = FALSE
var/can_shake = TRUE
var/can_burst = FALSE
var/burst_chance = 0
/obj/item/reagent_containers/food/drinks/cans/examine(mob/user)
. = ..()
if(canopened)
if(can_opened)
. += "<span class='notice'>It has been opened.</span>"
else
. += "<span class='info'>Alt-click to shake it up!</span>"
/obj/item/reagent_containers/food/drinks/cans/attack_self(mob/user)
if(canopened)
if(can_opened)
return ..()
if(times_shaken)
fizzy_open(user)
return ..()
playsound(loc, 'sound/effects/canopen.ogg', rand(10, 50), 1)
canopened = TRUE
can_opened = TRUE
container_type |= OPENCONTAINER
to_chat(user, "<span class='notice'>You open the drink with an audible pop!</span>")
return ..()
@@ -46,7 +46,7 @@
if(!can_shake || !ishuman(user))
return ..()
H = user
if(canopened)
if(can_opened)
to_chat(H, "<span class='warning'>You can't shake up an already opened drink!")
return ..()
if(src == H.l_hand || src == H.r_hand)
@@ -69,7 +69,7 @@
return ..()
/obj/item/reagent_containers/food/drinks/cans/attack(mob/M, mob/user, proximity)
if(!canopened)
if(!can_opened)
to_chat(user, "<span class='notice'>You need to open the drink!</span>")
return
else if(M == user && !reagents.total_volume && user.a_intent == INTENT_HARM && user.zone_selected == "head")
@@ -83,16 +83,16 @@
user.visible_message("<span class='notice'>[user] crushes [src] in [user.p_their()] trash compactor.</span>", "<span class='notice'>You crush [src] in your trash compactor.</span>")
var/obj/can = crush(user)
can.attackby(I, user, params)
return 1
return TRUE
..()
/obj/item/reagent_containers/food/drinks/cans/afterattack(obj/target, mob/user, proximity)
if(!proximity)
return
if(istype(target, /obj/structure/reagent_dispensers) && !canopened)
if(istype(target, /obj/structure/reagent_dispensers) && !can_opened)
to_chat(user, "<span class='notice'>You need to open the drink!</span>")
return
else if(target.is_open_container() && !canopened)
else if(target.is_open_container() && !can_opened)
to_chat(user, "<span class='notice'>You need to open the drink!</span>")
return
else
@@ -107,7 +107,7 @@
/obj/item/reagent_containers/food/drinks/cans/proc/fizzy_open(mob/user, burstopen = FALSE)
playsound(loc, 'sound/effects/canopenfizz.ogg', rand(10, 50), 1)
canopened = TRUE
can_opened = TRUE
container_type |= OPENCONTAINER
if(!burstopen && user)
@@ -132,7 +132,7 @@
reagents.remove_any(times_shaken / 5 * reagents.total_volume)
/obj/item/reagent_containers/food/drinks/cans/proc/handle_bursting(mob/user)
if(times_shaken != 5 || canopened)
if(times_shaken != 5 || can_opened)
return
if(!can_burst)
@@ -170,28 +170,28 @@
name = "space beer"
desc = "Contains only water, malt and hops."
icon_state = "beer"
is_glass = 1
is_glass = TRUE
list_reagents = list("beer" = 30)
/obj/item/reagent_containers/food/drinks/cans/adminbooze
name = "admin booze"
desc = "Bottled Griffon tears. Drink with caution."
icon_state = "adminbooze"
is_glass = 1
is_glass = TRUE
list_reagents = list("adminordrazine" = 5, "capsaicin" = 5, "methamphetamine"= 20, "thirteenloko" = 20)
/obj/item/reagent_containers/food/drinks/cans/madminmalt
name = "madmin malt"
desc = "Bottled essence of angry admins. Drink with <i>EXTREME</i> caution."
icon_state = "madminmalt"
is_glass = 1
is_glass = TRUE
list_reagents = list("hell_water" = 20, "neurotoxin" = 15, "thirteenloko" = 15)
/obj/item/reagent_containers/food/drinks/cans/badminbrew
name = "badmin brew"
desc = "Bottled trickery and terrible admin work. Probably shouldn't drink this one at all."
icon_state = "badminbrew"
is_glass = 1
is_glass = TRUE
list_reagents = list("mutagen" = 25, "charcoal" = 10, "thirteenloko" = 15)
/obj/item/reagent_containers/food/drinks/cans/ale
@@ -199,7 +199,7 @@
desc = "A true dorf's drink of choice."
icon_state = "alebottle"
item_state = "beer"
is_glass = 1
is_glass = TRUE
list_reagents = list("ale" = 30)
/obj/item/reagent_containers/food/drinks/cans/space_mountain_wind
@@ -275,11 +275,10 @@
icon_state = "glass_bottle"
/obj/item/reagent_containers/food/drinks/cans/bottler/on_reagent_change()
update_icon()
/obj/item/reagent_containers/food/drinks/cans/bottler/update_icon()
overlays.Cut()
update_icon(UPDATE_OVERLAYS)
/obj/item/reagent_containers/food/drinks/cans/bottler/update_overlays()
. = ..()
if(reagents.total_volume)
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]10")
@@ -298,19 +297,19 @@
filling.icon_state = "[icon_state]50"
filling.icon += mix_color_from_reagents(reagents.reagent_list)
overlays += filling
. += filling
/obj/item/reagent_containers/food/drinks/cans/bottler/glass_bottle
name = "glass bottle"
desc = "A glass bottle suitable for beverages."
icon_state = "glass_bottle"
is_glass = 1
is_glass = TRUE
/obj/item/reagent_containers/food/drinks/cans/bottler/plastic_bottle
name = "plastic bottle"
desc = "A plastic bottle suitable for beverages."
icon_state = "plastic_bottle"
is_plastic = 1
is_plastic = TRUE
/obj/item/reagent_containers/food/drinks/cans/bottler/metal_can
name = "metal can"
@@ -2,6 +2,7 @@
name = "shot glass"
desc = "No glasses were shot in the making of this glass."
icon_state = "shotglass"
custom_fire_overlay = "shotglass_fire"
amount_per_transfer_from_this = 15
volume = 15
materials = list(MAT_GLASS=100)
@@ -12,10 +13,19 @@
/obj/item/reagent_containers/food/drinks/drinkingglass/shotglass/on_reagent_change()
if(!isShotFlammable() && (resistance_flags & ON_FIRE))
extinguish()
update_icon()
update_appearance(UPDATE_NAME|UPDATE_OVERLAYS)
/obj/item/reagent_containers/food/drinks/drinkingglass/shotglass/update_icon()
overlays.Cut()
/obj/item/reagent_containers/food/drinks/drinkingglass/shotglass/update_name()
. = ..()
if(reagents.total_volume)
name = "shot glass of " + reagents.get_master_reagent_name() //No matter what, the glass will tell you the reagent's name. Might be too abusable in the future.
if(resistance_flags & ON_FIRE)
name = "flaming [name]"
else
name = "shot glass"
/obj/item/reagent_containers/food/drinks/drinkingglass/shotglass/update_overlays()
. = ..()
if(reagents.total_volume)
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]1")
@@ -28,14 +38,7 @@
if(80 to INFINITY)
filling.icon_state = "[icon_state]12"
filling.icon += mix_color_from_reagents(reagents.reagent_list)
overlays += filling
name = "shot glass of " + reagents.get_master_reagent_name() //No matter what, the glass will tell you the reagent's name. Might be too abusable in the future.
if(resistance_flags & ON_FIRE)
cut_overlay(GLOB.fire_overlay, TRUE)
overlays += "shotglass_fire"
name = "flaming [name]"
else
name = "shot glass"
. += filling
/obj/item/reagent_containers/food/drinks/drinkingglass/shotglass/proc/clumsilyDrink(mob/living/carbon/human/user) //Clowns beware
if(!(resistance_flags & ON_FIRE))
@@ -59,14 +62,14 @@
..()
set_light(light_intensity, null, light_color)
visible_message("<span class = 'notice'>[src] begins to burn with a blue hue!</span>")
update_icon()
update_appearance(UPDATE_NAME|UPDATE_OVERLAYS)
/obj/item/reagent_containers/food/drinks/drinkingglass/shotglass/extinguish(silent = FALSE)
..()
set_light(0)
if(!silent)
visible_message("<span class = 'notice'>The dancing flame on [src] dies out.</span>")
update_icon()
update_appearance(UPDATE_NAME|UPDATE_OVERLAYS)
/obj/item/reagent_containers/food/drinks/drinkingglass/shotglass/burn() //Let's override fire deleting the reagents inside the shot
return
@@ -14,13 +14,13 @@
/obj/item/reagent_containers/food/snacks/icecream/New()
..()
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/item/reagent_containers/food/snacks/icecream/update_icon()
cut_overlays()
/obj/item/reagent_containers/food/snacks/icecream/update_overlays()
. = ..()
var/mutable_appearance/filling = mutable_appearance('icons/obj/kitchen.dmi', "icecream_color")
filling.color = mix_color_from_reagents(reagents.reagent_list)
add_overlay(filling)
. += filling
/obj/item/reagent_containers/food/snacks/icecream/icecreamcone
name = "ice cream cone"
@@ -153,15 +153,16 @@
list_reagents = list("nutriment" = 5, "sugar" = 5)
tastes = list("dough" = 1, "sugar" = 1)
/obj/item/reagent_containers/food/snacks/cookiedough/update_name()
. = ..()
if(flat)
name = "flat pastry dough"
/obj/item/reagent_containers/food/snacks/cookiedough/update_icon()
if(flat)
icon_state = "cookiedough_flat"
name = "flat pastry dough"
else
icon_state = "cookiedough"
/obj/item/reagent_containers/food/snacks/cookiedough/update_icon_state()
if(flat)
icon_state = "cookiedough_flat"
else
icon_state = "cookiedough"
// Dough + rolling pin = flat cookie dough // Flat dough + circular cutter = unbaked cookies
/obj/item/reagent_containers/food/snacks/cookiedough/attackby(obj/item/I, mob/user, params)
@@ -169,7 +170,7 @@
if(isturf(loc))
to_chat(user, "<span class='notice'>You flatten [src].</span>")
flat = TRUE
update_icon()
update_appearance(UPDATE_NAME|UPDATE_ICON_STATE)
else
to_chat(user, "<span class='notice'>You need to put [src] on a surface to roll it out!</span>")
else if(istype(I, /obj/item/kitchen/cutter) && flat)
@@ -120,62 +120,67 @@
icon_state = "pizzabox1"
var/open = FALSE // Is the box open?
var/ismessy = FALSE // Fancy mess on the lid
var/is_messy = FALSE // Fancy mess on the lid
var/obj/item/reagent_containers/food/snacks/sliceable/pizza/pizza // Content pizza
var/list/boxes = list() // If the boxes are stacked, they come here
var/boxtag = ""
var/box_tag = ""
/obj/item/pizzabox/update_icon()
overlays = list()
/obj/item/pizzabox/Initialize(mapload)
. = ..()
update_appearance(UPDATE_DESC|UPDATE_ICON)
// Set appropriate description
/obj/item/pizzabox/update_desc()
. = ..()
if(open && pizza)
desc = "A box suited for pizzas. It appears to have a [pizza.name] inside."
else if(boxes.len > 0)
desc = "A pile of boxes suited for pizzas. There appears to be [boxes.len + 1] boxes in the pile."
var/obj/item/pizzabox/topbox = boxes[boxes.len]
var/toptag = topbox.boxtag
if(toptag != "")
desc = "[desc] The box on top has a tag, it reads: '[toptag]'."
var/obj/item/pizzabox/top_box = boxes[boxes.len]
var/top_tag = top_box.box_tag
if(top_tag != "")
desc = "[desc] The box on top has a tag, it reads: '[top_tag]'."
else
desc = "A box suited for pizzas."
if(boxtag != "")
desc = "[desc] The box has a tag, it reads: '[boxtag]'."
if(box_tag != "")
desc = "[desc] The box has a tag, it reads: '[box_tag]'."
// Icon states and overlays
/obj/item/pizzabox/update_icon_state()
if(open)
if(ismessy)
if(is_messy)
icon_state = "pizzabox_messy"
else
icon_state = "pizzabox_open"
if(pizza)
var/image/pizzaimg = image("food/pizza.dmi", icon_state = pizza.icon_state)
pizzaimg.pixel_y = -3
overlays += pizzaimg
return
icon_state = "pizzabox[boxes.len+1]"
/obj/item/pizzabox/update_overlays()
. = ..()
if(open && pizza)
var/image/pizzaimg = image("food/pizza.dmi", icon_state = pizza.icon_state)
pizzaimg.pixel_y = -3
. += pizzaimg
return
else
// Stupid code because byondcode sucks
var/doimgtag = 0
var/set_tag = TRUE
if(boxes.len > 0)
var/obj/item/pizzabox/topbox = boxes[boxes.len]
if(topbox.boxtag != "")
doimgtag = 1
var/obj/item/pizzabox/top_box = boxes[boxes.len]
if(top_box.box_tag != "")
set_tag = TRUE
else
if(boxtag != "")
doimgtag = 1
if(doimgtag)
var/image/tagimg = image("food/pizza.dmi", icon_state = "pizzabox_tag")
tagimg.pixel_y = boxes.len * 3
overlays += tagimg
icon_state = "pizzabox[boxes.len+1]"
if(box_tag != "")
set_tag = TRUE
if(!open && set_tag)
var/image/tag = image("food/pizza.dmi", icon_state = "pizzabox_tag")
tag.pixel_y = boxes.len * 3
. += tag
/obj/item/pizzabox/attack_hand(mob/user)
if(open && pizza)
user.put_in_hands(pizza)
to_chat(user, "<span class='warning'>You take [pizza] out of [src].</span>")
pizza = null
update_icon()
update_appearance(UPDATE_DESC|UPDATE_ICON)
return
if(boxes.len > 0)
@@ -186,8 +191,8 @@
boxes -= box
user.put_in_hands(box)
to_chat(user, "<span class='warning'>You remove the topmost [src] from your hand.</span>")
box.update_icon()
update_icon()
box.update_appearance(UPDATE_DESC|UPDATE_ICON)
update_appearance(UPDATE_DESC|UPDATE_ICON)
return
..()
@@ -196,8 +201,8 @@
return
open = !open
if(open && pizza)
ismessy = TRUE
update_icon()
is_messy = TRUE
update_appearance(UPDATE_DESC|UPDATE_ICON)
/obj/item/pizzabox/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/pizzabox/))
@@ -213,8 +218,8 @@
box.loc = src
box.boxes = list() // Clear the box boxes so we don't have boxes inside boxes. - Xzibit
boxes.Add(boxestoadd)
box.update_icon()
update_icon()
box.update_appearance(UPDATE_DESC|UPDATE_ICON)
update_appearance(UPDATE_DESC|UPDATE_ICON)
to_chat(user, "<span class='warning'>You put [box] on top of [src]!</span>")
else
to_chat(user, "<span class='warning'>The stack is too high!</span>")
@@ -228,7 +233,7 @@
I.loc = src
pizza = I
update_icon()
update_appearance(UPDATE_DESC|UPDATE_ICON)
to_chat(user, "<span class='warning'>You put [I] in [src]!</span>")
else
@@ -242,32 +247,32 @@
var/obj/item/pizzabox/boxtotagto = src
if(boxes.len > 0)
boxtotagto = boxes[boxes.len]
boxtotagto.boxtag = copytext("[boxtotagto.boxtag][t]", 1, 30)
update_icon()
boxtotagto.box_tag = copytext("[boxtotagto.box_tag][t]", 1, 30)
update_appearance(UPDATE_DESC|UPDATE_ICON)
return
..()
/obj/item/pizzabox/margherita/New()
..()
/obj/item/pizzabox/margherita/Initialize(mapload)
pizza = new /obj/item/reagent_containers/food/snacks/sliceable/pizza/margherita(src)
boxtag = "margherita deluxe"
box_tag = "margherita deluxe"
return ..()
/obj/item/pizzabox/vegetable/New()
..()
/obj/item/pizzabox/vegetable/Initialize(mapload)
pizza = new /obj/item/reagent_containers/food/snacks/sliceable/pizza/vegetablepizza(src)
boxtag = "gourmet vegetable"
box_tag = "gourmet vegetable"
return ..()
/obj/item/pizzabox/mushroom/New()
..()
/obj/item/pizzabox/mushroom/Initialize(mapload)
pizza = new /obj/item/reagent_containers/food/snacks/sliceable/pizza/mushroompizza(src)
boxtag = "mushroom special"
box_tag = "mushroom special"
return ..()
/obj/item/pizzabox/meat/New()
..()
/obj/item/pizzabox/meat/Initialize(mapload)
pizza = new /obj/item/reagent_containers/food/snacks/sliceable/pizza/meatpizza(src)
boxtag = "meatlover's supreme"
box_tag = "meatlover's supreme"
return ..()
/obj/item/pizzabox/hawaiian/New()
..()
/obj/item/pizzabox/hawaiian/Initialize(mapload)
pizza = new /obj/item/reagent_containers/food/snacks/sliceable/pizza/hawaiianpizza(src)
boxtag = "Hawaiian feast"
box_tag = "Hawaiian feast"
return ..()
@@ -46,28 +46,23 @@
user.Stun(20 SECONDS)
user.forceMove(src)
occupant = user
update_icon()
update_icon(UPDATE_OVERLAYS)
feedinTopanim()
addtimer(CALLBACK(src, .proc/startgibbing, user), 33)
return OBLITERATION
/obj/machinery/gibber/update_icon()
overlays.Cut()
/obj/machinery/gibber/update_overlays()
. = ..()
if(dirty)
overlays += image('icons/obj/kitchen.dmi', "grbloody")
. += "grbloody"
if(stat & (NOPOWER|BROKEN))
return
if(!occupant)
overlays += image('icons/obj/kitchen.dmi', "grjam")
. += "grjam"
else if(operating)
overlays += image('icons/obj/kitchen.dmi', "gruse")
. += "gruse"
else
overlays += image('icons/obj/kitchen.dmi', "gridle")
. += "gridle"
/obj/machinery/gibber/relaymove(mob/user)
if(locked)
@@ -151,7 +146,7 @@
victim.forceMove(src)
occupant = victim
update_icon()
update_icon(UPDATE_OVERLAYS)
feedinTopanim()
/obj/machinery/gibber/verb/eject()
@@ -178,7 +173,7 @@
occupant.forceMove(get_turf(src))
occupant = null
update_icon()
update_icon(UPDATE_OVERLAYS)
return
@@ -248,7 +243,7 @@
visible_message("<span class='danger'>You hear a loud squelchy grinding sound.</span>")
operating = TRUE
update_icon()
update_icon(UPDATE_OVERLAYS)
var/offset = prob(50) ? -2 : 2
animate(src, pixel_x = pixel_x + offset, time = 0.2, loop = gibtime * 5) //start shaking
@@ -310,7 +305,7 @@
pixel_x = initial(pixel_x) //return to it's spot after shaking
operating = FALSE
update_icon()
update_icon(UPDATE_OVERLAYS)
@@ -374,7 +369,7 @@
victim.forceMove(src)
occupant = victim
update_icon()
update_icon(UPDATE_OVERLAYS)
feedinTopanim()
return 1
@@ -34,46 +34,47 @@
. = ..()
beaker = new /obj/item/reagent_containers/glass/beaker/large(src)
/obj/machinery/juicer/update_icon()
icon_state = "juicer"+num2text(!isnull(beaker))
return
/obj/machinery/juicer/update_icon_state()
if(beaker)
icon_state = "juicer1"
else
icon_state = "juicer0"
/obj/machinery/juicer/attackby(obj/item/O, mob/user, params)
if(istype(O,/obj/item/reagent_containers/glass) || \
istype(O,/obj/item/reagent_containers/food/drinks/drinkingglass))
if(beaker)
return 1
return TRUE
else
if(!user.unEquip(O))
to_chat(user, "<span class='notice'>\the [O] is stuck to your hand, you cannot put it in \the [src]</span>")
return 0
return
O.forceMove(src)
beaker = O
verbs += /obj/machinery/juicer/verb/detach
update_icon()
update_icon(UPDATE_ICON_STATE)
updateUsrDialog()
return 0
return
if(!is_type_in_list(O, allowed_items))
to_chat(user, "It doesn't look like that contains any juice.")
return 1
return TRUE
if(!user.unEquip(O))
to_chat(user, "<span class='notice'>\the [O] is stuck to your hand, you cannot put it in \the [src]</span>")
return 0
return
O.forceMove(src)
updateUsrDialog()
return 0
return
/obj/machinery/juicer/attack_ai(mob/user)
return 0
return
/obj/machinery/juicer/attack_hand(mob/user)
user.set_machine(src)
interact(user)
/obj/machinery/juicer/interact(mob/user) // The microwave Menu
var/is_chamber_empty = 0
var/is_beaker_ready = 0
var/is_chamber_empty = FALSE
var/is_beaker_ready = FALSE
var/processing_chamber = ""
var/beaker_contents = ""
@@ -84,16 +85,16 @@
processing_chamber+= "some <B>[O]</B><BR>"
break
if(!processing_chamber)
is_chamber_empty = 1
is_chamber_empty = TRUE
processing_chamber = "Nothing."
if(!beaker)
beaker_contents = "\The [src] has no beaker attached."
else if(!beaker.reagents.total_volume)
beaker_contents = "\The [src] has attached an empty beaker."
is_beaker_ready = 1
is_beaker_ready = TRUE
else if(beaker.reagents.total_volume < beaker.reagents.maximum_volume)
beaker_contents = "\The [src] has attached a beaker with something."
is_beaker_ready = 1
is_beaker_ready = TRUE
else
beaker_contents = "\The [src] has attached a beaker and beaker is full!"
@@ -137,7 +138,7 @@
verbs -= /obj/machinery/juicer/verb/detach
beaker.forceMove(loc)
beaker = null
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/machinery/juicer/proc/get_juice_id(obj/item/reagent_containers/food/snacks/grown/O)
for (var/i in allowed_items)
@@ -76,7 +76,7 @@
while(amount--)
var/obj/item/I = new typekey(src)
item_quants[I.name] += 1
update_icon()
update_icon(UPDATE_OVERLAYS)
// Accepted items
accepted_items_typecache = typecacheof(list(
/obj/item/reagent_containers/food/snacks/grown,
@@ -111,32 +111,32 @@
else
set_light(light_range_on, light_power_on)
if(old_stat != stat)
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/machinery/smartfridge/extinguish_light()
set_light(0)
underlays.Cut()
/obj/machinery/smartfridge/update_icon()
cut_overlays()
/obj/machinery/smartfridge/update_overlays()
. = ..()
underlays.Cut()
if(light)
underlays += emissive_appearance(icon, "[icon_lightmask]_lightmask")
if(panel_open)
add_overlay("[icon_state]_panel")
. += "[icon_state]_panel"
if(stat & (BROKEN|NOPOWER))
add_overlay("[icon_state]_off")
. += "[icon_state]_off"
if(icon_addon)
add_overlay("[icon_addon]")
. += "[icon_addon]"
if(stat & BROKEN)
add_overlay("[icon_state]_broken")
. += "[icon_state]_broken"
return
if(visible_contents)
update_fridge_contents()
if(fill_level)
add_overlay("[icon_state][fill_level]")
. += "[icon_state][fill_level]"
if(icon_addon)
add_overlay("[icon_addon]")
if(light)
underlays += emissive_appearance(icon, "[icon_lightmask]_lightmask")
. += "[icon_addon]"
/obj/machinery/smartfridge/proc/update_fridge_contents()
switch(length(contents))
@@ -154,7 +154,7 @@
. = default_deconstruction_screwdriver(user, icon_state, icon_state, I)
if(!.)
return
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/machinery/smartfridge/wrench_act(mob/living/user, obj/item/I)
. = default_unfasten_wrench(user, I)
@@ -187,7 +187,7 @@
if(load(O, user))
user.visible_message("<span class='notice'>[user] has added \the [O] to \the [src].</span>", "<span class='notice'>You add \the [O] to \the [src].</span>")
SStgui.update_uis(src)
update_icon()
update_icon(UPDATE_OVERLAYS)
else if(istype(O, /obj/item/storage/bag))
var/obj/item/storage/bag/P = O
var/items_loaded = 0
@@ -197,7 +197,7 @@
if(items_loaded)
user.visible_message("<span class='notice'>[user] loads \the [src] with \the [P].</span>", "<span class='notice'>You load \the [src] with \the [P].</span>")
SStgui.update_uis(src)
update_icon()
update_icon(UPDATE_OVERLAYS)
var/failed = length(P.contents)
if(failed)
to_chat(user, "<span class='notice'>[failed] item\s [failed == 1 ? "is" : "are"] refused.</span>")
@@ -237,7 +237,7 @@
items_loaded++
if(items_loaded)
user.visible_message("<span class='notice'>[user] empties \the [P] into \the [src].</span>", "<span class='notice'>You empty \the [P] into \the [src].</span>")
update_icon()
update_icon(UPDATE_OVERLAYS)
var/failed = length(P.contents)
if(failed)
to_chat(user, "<span class='notice'>[failed] item\s [failed == 1 ? "is" : "are"] refused.</span>")
@@ -304,14 +304,14 @@
if(!user.put_in_hands(O))
O.forceMove(loc)
adjust_item_drop_location(O)
update_icon()
update_icon(UPDATE_OVERLAYS)
break
else
for(var/obj/O in contents)
if(O.name == K)
O.forceMove(loc)
adjust_item_drop_location(O)
update_icon()
update_icon(UPDATE_OVERLAYS)
i--
if(i <= 0)
return TRUE
@@ -366,7 +366,7 @@
if(I.name == O)
I.forceMove(loc)
throw_item = I
update_icon()
update_icon(UPDATE_OVERLAYS)
break
if(!throw_item)
return FALSE
@@ -785,7 +785,7 @@
else
stat |= NOPOWER
toggle_drying(TRUE)
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/machinery/smartfridge/drying_rack/screwdriver_act(mob/living/user, obj/item/I)
return
@@ -810,22 +810,21 @@
if("drying")
drying = !drying
use_power = drying ? ACTIVE_POWER_USE : IDLE_POWER_USE
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/machinery/smartfridge/drying_rack/update_icon()
cut_overlays()
/obj/machinery/smartfridge/drying_rack/update_overlays()
if(stat & NOPOWER)
add_overlay("drying_rack_off")
. += "drying_rack_off"
return
if(drying)
add_overlay("drying_rack_drying")
. += "drying_rack_drying"
if(length(contents))
add_overlay("drying_rack_filled")
. += "drying_rack_filled"
/obj/machinery/smartfridge/drying_rack/process()
..()
if(drying && rack_dry())//no need to update unless something got dried
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/machinery/smartfridge/drying_rack/accept_check(obj/item/O)
. = ..()
@@ -848,7 +847,7 @@
else
drying = TRUE
use_power = ACTIVE_POWER_USE
update_icon()
update_icon(UPDATE_OVERLAYS)
/**
* Called in [/obj/machinery/smartfridge/drying_rack/process] to dry the contents.
+2 -2
View File
@@ -33,7 +33,7 @@
for(var/jokers in 1 to 2)
cards += new /datum/playingcard("Joker", "sc_Joker_[card_style]", "singlecard_down_[card_style]")
/obj/item/deck/cards/update_icon()
/obj/item/deck/cards/update_icon_state()
if(!length(cards))
icon_state = "deck_[card_style]_empty"
return
@@ -78,7 +78,7 @@
card_style = "simple"
simple_deck = TRUE
/obj/item/deck/cards/tiny/update_icon()
/obj/item/deck/cards/tiny/update_icon_state()
return
/obj/item/deck/cards/tiny/doublecards
+53 -24
View File
@@ -53,7 +53,7 @@
for(var/deck in 1 to deck_size)
build_deck()
deck_total = length(cards)
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/deck/proc/build_deck()
return
@@ -66,7 +66,7 @@
cards += P
qdel(H)
to_chat(user,"<span class='notice'>You place your cards on the bottom of [src]</span>.")
update_icon()
update_icon(UPDATE_ICON_STATE)
return
else
to_chat(user,"<span class='warning'>You can't mix cards from different decks!</span>")
@@ -159,10 +159,10 @@
var/datum/playingcard/P = cards[1]
H.cards += P
cards -= P
update_icon()
update_icon(UPDATE_ICON_STATE)
H.parentdeck = src
H.update_values()
H.update_icon()
H.update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
user.visible_message("<span class='notice'>[user] draws a card.</span>","<span class='notice'>You draw a card.</span>")
to_chat(user,"<span class='notice'>It's the [P].</span>")
@@ -224,11 +224,11 @@
for(var/i in 1 to dcard)
H.cards += cards[1]
cards -= cards[1]
update_icon()
update_icon(UPDATE_ICON_STATE)
H.parentdeck = src
H.update_values()
H.concealed = TRUE
H.update_icon()
H.update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
if(user == target)
user.visible_message("<span class='notice'>[user] deals [dcard] card(s) to \himself.</span>")
else
@@ -298,7 +298,7 @@
user.unEquip(src, force = 1)
qdel(src)
H.update_icon()
H.update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
user.put_in_hands(H)
/obj/item/cardhand
@@ -341,7 +341,7 @@
P.name = t
// SNOWFLAKE FOR CAG, REMOVE IF OTHER CARDS ARE ADDED THAT USE THIS.
P.card_icon = "cag_white_card"
update_icon()
update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
else if(istype(O,/obj/item/cardhand))
var/obj/item/cardhand/H = O
if((length(H.cards) + length(cards)) > maxcardlen)
@@ -352,7 +352,7 @@
H.cards += P
H.concealed = concealed
qdel(src)
H.update_icon()
H.update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
return
else
to_chat(user,"<span class='notice'>You cannot mix cards from other deck!</span>")
@@ -368,7 +368,7 @@
/obj/item/cardhand/proc/turn_hand(mob/user)
concealed = !concealed
update_icon()
update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
user.visible_message("<span class='notice'>[user] [concealed ? "conceals" : "reveals"] their hand.</span>")
/obj/item/cardhand/interact(mob/user)
@@ -411,7 +411,18 @@
button_icon_state = "remove_card"
use_itemicon = FALSE
/datum/action/item_action/remove_card/IsAvailable()
var/obj/item/cardhand/C = target
if(length(C.cards) <= 1)
return FALSE
var/mob/living/carbon/human/O = owner
if(O.l_hand && O.r_hand)
return FALSE
return ..()
/datum/action/item_action/remove_card/Trigger()
if(!IsAvailable())
return
if(istype(target, /obj/item/cardhand))
var/obj/item/cardhand/C = target
return C.Removecard()
@@ -464,11 +475,11 @@
H.parentdeck = parentdeck
H.update_values()
H.concealed = concealed
H.update_icon()
H.update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
if(!length(cards))
qdel(src)
return
update_icon()
update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
/obj/item/cardhand/verb/discard()
@@ -487,7 +498,10 @@
for(var/datum/playingcard/P in cards)
to_discard[P.name] = P
var/discarding = input("Which card do you wish to put down?") as null|anything in to_discard
if(!discarding)
continue
if(QDELETED(src))
return
@@ -501,9 +515,9 @@
H.parentdeck = parentdeck
H.update_values()
H.direction = user.dir
H.update_icon()
H.update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
if(length(cards))
update_icon()
update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
if(length(H.cards))
user.visible_message("<span class='notice'>[user] plays the [discarding].</span>", "<span class='notice'>You play the [discarding].</span>")
H.loc = get_step(user, user.dir)
@@ -511,19 +525,34 @@
if(!length(cards))
qdel(src)
/obj/item/cardhand/update_icon()
/obj/item/cardhand/update_appearance(updates=ALL)
if(!length(cards))
return
else if(length(cards) > 1)
if(length(cards) <= 2)
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
..()
/obj/item/cardhand/update_name()
. = ..()
if(length(cards) > 1)
name = "hand of cards"
desc = "Some playing cards."
else
name = "a playing card"
/obj/item/cardhand/update_desc()
. = ..()
if(length(cards) > 1)
desc = "Some playing cards."
else
desc = "A playing card."
cut_overlays()
/obj/item/cardhand/update_icon_state()
return
/obj/item/cardhand/update_overlays()
. = ..()
var/matrix/M = matrix()
switch(direction)
if(NORTH)
@@ -544,7 +573,7 @@
I.transform = M
I.pixel_x += (-5+rand(10))
I.pixel_y += (-5+rand(10))
add_overlay(I)
. += I
return
var/offset = FLOOR(20/length(cards) + 1, 1)
@@ -562,7 +591,7 @@
else
I.pixel_x = -7+(offset*i)
I.transform = M
add_overlay(I)
. += I
i++
/obj/item/cardhand/dropped(mob/user)
@@ -571,9 +600,9 @@
direction = user.dir
else
direction = NORTH
update_icon()
update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
/obj/item/cardhand/pickup(mob/user as mob)
. = ..()
direction = NORTH
update_icon()
update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
@@ -15,20 +15,20 @@
..()
pixel_x = rand(8,-8)
pixel_y = rand(8,-8)
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/item/reagent_containers/honeycomb/set_APTFT()
set hidden = TRUE
/obj/item/reagent_containers/honeycomb/update_icon()
overlays.Cut()
/obj/item/reagent_containers/honeycomb/update_overlays()
. = ..()
var/image/honey
if(honey_color)
honey = image(icon = 'icons/obj/hydroponics/harvest.dmi', icon_state = "greyscale_honey")
honey.color = honey_color
else
honey = image(icon = 'icons/obj/hydroponics/harvest.dmi', icon_state = "honey")
overlays += honey
. += honey
/obj/item/reagent_containers/honeycomb/proc/set_reagent(reagent)
@@ -39,4 +39,4 @@
reagents.add_reagent(R.id,5)
else
honey_color = ""
update_icon()
update_icon(UPDATE_OVERLAYS)
+7 -7
View File
@@ -57,7 +57,7 @@
if(A != container)
return
container = null
update_icon()
update_icon(UPDATE_ICON_STATE)
SStgui.update_uis(src)
/obj/machinery/biogenerator/RefreshParts()
@@ -75,7 +75,7 @@
if(effeciency_prev != efficiency)
update_ui_product_list() // We have have a higher `efficiency` now, and need to re-calc the product costs.
/obj/machinery/biogenerator/update_icon()
/obj/machinery/biogenerator/update_icon_state()
if(panel_open)
icon_state = "biogen-empty-o"
else if(!container)
@@ -118,7 +118,7 @@
O.forceMove(src)
container = O
to_chat(user, "<span class='notice'>You add the [container] to [src].</span>")
update_icon()
update_icon(UPDATE_ICON_STATE)
SStgui.update_uis(src)
return TRUE
@@ -260,7 +260,7 @@
processing = TRUE
SStgui.update_uis(src)
update_icon()
update_icon(UPDATE_ICON_STATE)
var/plants_processed = length(stored_plants)
for(var/obj/plant as anything in stored_plants)
@@ -276,7 +276,7 @@
/obj/machinery/biogenerator/proc/end_processing()
processing = FALSE
SStgui.update_uis(src)
update_icon()
update_icon(UPDATE_ICON_STATE)
/**
* Ejects the biogenerator's stored plants
@@ -346,7 +346,7 @@
biomass -= (D.materials[MAT_BIOMASS] / efficiency) * amount
SStgui.update_uis(src)
update_icon()
update_icon(UPDATE_ICON_STATE)
/**
* Detach the `container` from the biogenerator.
@@ -356,6 +356,6 @@
return
container.forceMove(get_turf(src))
container = null
update_icon()
update_icon(UPDATE_ICON_STATE)
#undef BASE_MAX_STORABLE_PLANTS
@@ -63,7 +63,7 @@
else
container_type = DRAINABLE | AMOUNT_VISIBLE
to_chat(user, "<span class='notice'>You close [src], letting you draw from its tap.</span>")
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/structure/fermenting_barrel/crowbar_act(mob/living/user, obj/item/I)
. = TRUE
@@ -85,7 +85,7 @@
new /obj/item/stack/sheet/wood(drop_location(), mat_drop)
..()
/obj/structure/fermenting_barrel/update_icon()
/obj/structure/fermenting_barrel/update_icon_state()
if(open)
icon_state = "barrel_open"
else
+13 -11
View File
@@ -82,21 +82,22 @@
min_wchance = 0
min_wrate = 0
/obj/machinery/plantgenes/update_icon()
..()
overlays.Cut()
/obj/machinery/plantgenes/update_icon_state()
if((stat & (BROKEN|NOPOWER)))
icon_state = "dnamod-off"
else
icon_state = "dnamod"
/obj/machinery/plantgenes/update_overlays()
. = ..()
if(seed)
overlays += "dnamod-dna"
. += "dnamod-dna"
if(panel_open)
overlays += "dnamod-open"
. += "dnamod-open"
/obj/machinery/plantgenes/attackby(obj/item/I, mob/user, params)
if(default_deconstruction_screwdriver(user, "dnamod", "dnamod", I))
update_icon()
update_icon(UPDATE_OVERLAYS)
return
if(exchange_parts(user, I))
return
@@ -301,7 +302,7 @@
seed.verb_pickup()
seed = null
update_genes()
update_icon()
update_icon(UPDATE_OVERLAYS)
else
var/obj/item/I = usr.get_active_hand()
if(istype(I, /obj/item/seeds))
@@ -309,7 +310,7 @@
return
insert_seed(I)
to_chat(usr, "<span class='notice'>You add [I] to the machine.</span>")
update_icon()
update_icon(UPDATE_OVERLAYS)
else if(href_list["eject_disk"] && !operation)
if(disk)
disk.forceMove(loc)
@@ -376,7 +377,7 @@
gene.value = max(gene.value, min_wchance)
disk.update_name()
QDEL_NULL(seed)
update_icon()
update_icon(UPDATE_OVERLAYS)
if("replace")
if(disk && disk.gene && istype(disk.gene, G.type) && istype(G, /datum/plant_gene/core))
seed.genes -= G
@@ -417,7 +418,7 @@
S.forceMove(src)
seed = S
update_genes()
update_icon()
update_icon(UPDATE_OVERLAYS)
/obj/machinery/plantgenes/proc/update_genes()
core_genes = list()
@@ -477,7 +478,8 @@
if(istype(W, /obj/item/pen))
rename_interactive(user, W)
/obj/item/disk/plantgene/proc/update_name()
/obj/item/disk/plantgene/update_name()
. = ..()
if(gene)
name = "[gene.get_name()] (Plant Data Disk)"
else
+16 -12
View File
@@ -130,7 +130,7 @@
attack_verb = list("chopped", "sliced", "cut", "reaped")
hitsound = 'sound/weapons/bladeslice.ogg'
sharp = TRUE
var/extend = 1
var/extend = TRUE
var/swiping = FALSE
/obj/item/scythe/bone
@@ -174,7 +174,7 @@
force = 3
sharp = FALSE
w_class = WEIGHT_CLASS_SMALL
extend = 0
extend = FALSE
slot_flags = SLOT_BELT
origin_tech = "materials=3;combat=3"
attack_verb = list("hit", "poked")
@@ -184,8 +184,6 @@
extend = !extend
if(extend)
to_chat(user, "<span class='warning'>With a flick of your wrist, you extend the scythe. It's reaping time!</span>")
icon_state = "tscythe1"
item_state = "scythe0" //use the normal scythe in-hands
slot_flags = SLOT_BACK //won't fit on belt, but can be worn on belt when extended
w_class = WEIGHT_CLASS_BULKY //won't fit in backpacks while extended
force = 15 //slightly better than normal scythe damage
@@ -195,8 +193,6 @@
playsound(src.loc, 'sound/weapons/blade_unsheath.ogg', 50, 1) //Sound credit to Qat of Freesound.org
else
to_chat(user, "<span class='notice'>You collapse the scythe, folding it away for easy storage.</span>")
icon_state = "tscythe0"
item_state = null //no sprite for folded version, like a tele-baton
slot_flags = SLOT_BELT //can be worn on belt again, but no longer makes sense to wear on the back
w_class = WEIGHT_CLASS_SMALL
force = 3
@@ -205,12 +201,21 @@
//Collapse sound (blade sheath)
playsound(src.loc, 'sound/weapons/blade_sheath.ogg', 50, 1) //Sound credit to Q.K. of Freesound.org
sharp = extend
update_icon(UPDATE_ICON_STATE)
if(ishuman(user))
var/mob/living/carbon/human/H = user
H.update_inv_l_hand()
H.update_inv_r_hand()
add_fingerprint(user)
/obj/item/scythe/tele/update_icon_state()
if(extend)
icon_state = "tscythe1"
item_state = "scythe0" //use the normal scythe in-hands
else
icon_state = "tscythe0"
item_state = null //no sprite for folded version, like a tele-baton
// *************************************
// Nutrient defines for hydroponics
// *************************************
@@ -240,7 +245,7 @@
/obj/item/reagent_containers/glass/bottle/nutrient/on_reagent_change()
. = ..()
update_icon()
update_icon(UPDATE_OVERLAYS)
if(reagents.total_volume)
hitsound = 'sound/weapons/jug_filled_impact.ogg'
mob_throw_hit_sound = 'sound/weapons/jug_filled_impact.ogg'
@@ -248,9 +253,8 @@
hitsound = 'sound/weapons/jug_empty_impact.ogg'
mob_throw_hit_sound = 'sound/weapons/jug_empty_impact.ogg'
/obj/item/reagent_containers/glass/bottle/nutrient/update_icon()
cut_overlays()
/obj/item/reagent_containers/glass/bottle/nutrient/update_overlays()
. = ..()
if(reagents.total_volume)
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "plastic_jug10")
@@ -272,10 +276,10 @@
filling.icon_state = "plastic_jug100"
filling.icon += mix_color_from_reagents(reagents.reagent_list)
add_overlay(filling)
. += filling
if(!is_open_container())
add_overlay("lid_jug")
. += "lid_jug"
/obj/item/reagent_containers/glass/bottle/nutrient/ez
+40 -41
View File
@@ -125,7 +125,7 @@
lid_closed = !lid_closed
to_chat(user, "<span class='notice'>You [lid_closed ? "close" : "open"] the tray's lid.</span>")
update_icon()
update_state()
/obj/machinery/hydroponics/bullet_act(obj/item/projectile/Proj) //Works with the Somatoray to modify plant variables.
@@ -253,7 +253,7 @@
weedinvasion() // Weed invasion into empty tray
needs_update = 1
if (needs_update)
update_icon()
update_state()
return
/obj/machinery/hydroponics/proc/nutrimentMutation()
@@ -275,36 +275,34 @@
return
return
/obj/machinery/hydroponics/update_icon()
/obj/machinery/hydroponics/proc/update_state()
//Refreshes the icon and sets the luminosity
overlays.Cut()
if(self_sustaining)
if(istype(src, /obj/machinery/hydroponics/soil))
color = rgb(255, 175, 0)
else
overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "gaia_blessing")
set_light(3)
if(lid_closed)
overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "hydrocover")
update_icon_hoses()
if(myseed)
update_icon_plant()
update_icon_lights()
if(!self_sustaining)
else
if(myseed && myseed.get_gene(/datum/plant_gene/trait/glow))
var/datum/plant_gene/trait/glow/G = myseed.get_gene(/datum/plant_gene/trait/glow)
set_light(G.glow_range(myseed), G.glow_power(myseed), G.glow_color)
else
set_light(0)
return
update_icon()
/obj/machinery/hydroponics/proc/update_icon_hoses()
/obj/machinery/hydroponics/update_overlays()
. = ..()
if(self_sustaining && !istype(src, /obj/machinery/hydroponics/soil))
. += "gaia_blessing"
if(lid_closed)
. += "hydrocover"
if(myseed)
. += update_icon_plant()
. += update_icon_lights()
/obj/machinery/hydroponics/update_icon_state()
var/n = 0
for(var/Dir in GLOB.cardinal)
var/obj/machinery/hydroponics/t = locate() in get_step(src,Dir)
@@ -326,19 +324,20 @@
var/t_growthstate = clamp(round((age / myseed.maturation) * myseed.growthstages), 1, myseed.growthstages)
I = image(icon = myseed.growing_icon, icon_state = "[myseed.icon_grow][t_growthstate]")
I.layer = OBJ_LAYER + 0.01
overlays += I
return I
/obj/machinery/hydroponics/proc/update_icon_lights()
. = list()
if(waterlevel <= 10)
overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_lowwater3")
. += "over_lowwater3"
if(nutrilevel <= 2)
overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_lownutri3")
. += "over_lownutri3"
if(plant_health <= (myseed.endurance / 2))
overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_lowhealth3")
. += "over_lowhealth3"
if(weedlevel >= 5 || pestlevel >= 5 || toxic >= 40)
overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_alert3")
. += "over_alert3"
if(harvest)
overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_harvest3")
. += "over_harvest3"
/obj/machinery/hydroponics/examine(user)
@@ -404,7 +403,7 @@
harvest = FALSE
adjustWeeds(-10) // Reset
adjustPests(-10) // Reset
update_icon()
update_state()
plant_hud_set_health()
plant_hud_set_status()
visible_message("<span class='warning'>The [oldPlantName] is overtaken by some [myseed.plantname]!</span>")
@@ -441,7 +440,7 @@
adjustWeeds(-10) // Reset
sleep(5) // Wait a while
update_icon()
update_state()
visible_message("<span class='warning'>[oldPlantName] suddenly mutates into [myseed.plantname]!</span>")
@@ -461,7 +460,7 @@
adjustWeeds(-10) // Reset
sleep(5) // Wait a while
update_icon()
update_state()
visible_message("<span class='warning'>The mutated weeds in [src] spawn some [myseed.plantname]!</span>")
else
to_chat(usr, "<span class='warning'>The few weeds in [src] seem to react, but only for a moment...</span>")
@@ -472,7 +471,7 @@
harvest = FALSE
adjustPests(-10) // Pests die
if(!dead)
update_icon()
update_state()
dead = TRUE
plant_hud_set_health()
plant_hud_set_status()
@@ -802,7 +801,7 @@
S.clear_reagents()
qdel(S)
H.update_icon()
H.update_state()
if(reagent_source) // If the source wasn't composted and destroyed
reagent_source.update_icon()
return 1
@@ -821,7 +820,7 @@
plant_hud_set_status()
lastcycle = world.time
O.forceMove(src)
update_icon()
update_state()
else
to_chat(user, "<span class='warning'>[src] already has seeds in it!</span>")
@@ -845,7 +844,7 @@
if(weedlevel > 0)
user.visible_message("[user] uproots the weeds.", "<span class='notice'>You remove the weeds from [src].</span>")
adjustWeeds(-10)
update_icon()
update_state()
else
to_chat(user, "<span class='warning'>This plot is completely devoid of weeds! It doesn't need uprooting.</span>")
@@ -877,7 +876,7 @@
plant_hud_set_health()
plant_hud_set_status()
adjustWeeds(-10) //Has a side effect of cleaning up those nasty weeds
update_icon()
update_state()
else if(istype(O, /obj/item/pen) && myseed)
myseed.variant_prompt(user, src)
else
@@ -892,7 +891,7 @@
user.visible_message("<span class='notice'>[user] [using_irrigation ? "" : "dis"]connects [src]'s irrigation hoses.</span>", \
"<span class='notice'>You [using_irrigation ? "" : "dis"]connect [src]'s irrigation hoses.</span>")
for(var/obj/machinery/hydroponics/h in range(1,src))
h.update_icon()
h.update_state()
/obj/machinery/hydroponics/wrench_act(mob/user, obj/item/I)
. = TRUE
@@ -933,7 +932,7 @@
dead = FALSE
to_chat(user, "<span class='notice'>You remove the dead plant from [src].</span>")
QDEL_NULL(myseed)
update_icon()
update_state()
plant_hud_set_status()
plant_hud_set_health()
else
@@ -953,7 +952,7 @@
dead = FALSE
plant_hud_set_status()
plant_hud_set_health()
update_icon()
update_state()
/// Tray Setters - The following procs adjust the tray or plants variables, and make sure that the stat doesn't go out of bounds.///
/obj/machinery/hydroponics/proc/adjustNutri(adjustamt)
@@ -992,7 +991,7 @@
/obj/machinery/hydroponics/proc/become_self_sufficient() // Ambrosia Gaia effect
visible_message("<span class='boldnotice'>[src] begins to glow with a beautiful light!</span>")
self_sustaining = TRUE
update_icon()
update_state()
///Diona Nymph Related Procs///
/obj/machinery/hydroponics/CanPass(atom/movable/mover, turf/target, height=0) //So nymphs can climb over top of trays.
@@ -1009,12 +1008,12 @@
if(weedlevel > 0)
user.adjust_nutrition(weedlevel * 15)
adjustWeeds(-10)
update_icon()
update_state()
visible_message("<span class='danger'>[user] begins rooting through [src], ripping out weeds and eating them noisily.</span>","<span class='danger'>You begin rooting through [src], ripping out weeds and eating them noisily.</span>")
else if(nutrilevel < 10)
user.adjust_nutrition(-((10 - nutrilevel) * 5))
adjustNutri(10)
update_icon()
update_state()
visible_message("<span class='danger'>[user] secretes a trickle of green liquid from its tail, refilling [src]'s nutrient tray.</span>","<span class='danger'>You secrete a trickle of green liquid from your tail, refilling [src]'s nutrient tray.</span>")
else
return ..()
@@ -1028,7 +1027,7 @@
use_power = NO_POWER_USE
wrenchable = FALSE
/obj/machinery/hydroponics/soil/update_icon_hoses()
/obj/machinery/hydroponics/soil/update_icon_state()
return // Has no hoses
/obj/machinery/hydroponics/soil/update_icon_lights()
@@ -25,9 +25,7 @@
ui_interact(user)
else
on = !on
icon_state = "headphones[on]"
item_state = "headphones[on]"
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/clothing/ears/headphones/ui_data(mob/user)
return song.ui_data(user)
@@ -42,12 +40,12 @@
return
return song.ui_act(action, params)
/obj/item/clothing/ears/headphones/update_icon()
/obj/item/clothing/ears/headphones/update_icon_state()
var/mob/living/carbon/human/user = loc
if(istype(user))
user.update_action_buttons_icon()
user.update_inv_ears()
..()
icon_state = item_state = "headphones[on]"
/obj/item/clothing/ears/headphones/item_action_slot_check(slot)
if(slot == slot_l_ear || slot == slot_r_ear)
@@ -57,15 +55,15 @@
* Called by a component signal when our song starts playing.
*/
/obj/item/clothing/ears/headphones/proc/start_playing()
icon_state = item_state = "headphones1"
update_icon()
on = TRUE
update_icon(UPDATE_ICON_STATE)
/**
* Called by a component signal when our song stops playing.
*/
/obj/item/clothing/ears/headphones/proc/stop_playing()
icon_state = item_state = "headphones0"
update_icon()
on = FALSE
update_icon(UPDATE_ICON_STATE)
/**
* Whether the headphone's song should stop playing
+9 -9
View File
@@ -24,7 +24,7 @@
if(!user.drop_item())
return
O.forceMove(src)
update_icon()
update_icon(UPDATE_ICON_STATE)
return TRUE
if(istype(O, /obj/item/storage/bag/books))
var/obj/item/storage/bag/books/B = O
@@ -32,7 +32,7 @@
if(is_type_in_list(T, allowed_books))
B.remove_from_storage(T, src)
to_chat(user, "<span class='notice'>You empty [O] into [src].</span>")
update_icon()
update_icon(UPDATE_ICON_STATE)
return TRUE
if(istype(O, /obj/item/pen))
rename_interactive(user, O)
@@ -53,7 +53,7 @@
user.put_in_hands(choice)
else
choice.forceMove(get_turf(src))
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/structure/bookcase/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/wood(loc, 5)
@@ -62,7 +62,7 @@
I.forceMove(get_turf(src))
..()
/obj/structure/bookcase/update_icon()
/obj/structure/bookcase/update_icon_state()
icon_state = "bookshelf-[min(length(contents), 5)]"
@@ -89,7 +89,7 @@
/obj/structure/bookcase/manuals/medical/Initialize()
. = ..()
new /obj/item/book/manual/medical_cloning(src)
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/structure/bookcase/manuals/engineering
@@ -103,7 +103,7 @@
new /obj/item/book/manual/wiki/engineering_guide(src)
new /obj/item/book/manual/engineering_singularity_safety(src)
new /obj/item/book/manual/wiki/robotics_cyborgs(src)
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/structure/bookcase/manuals/research_and_development
name = "R&D Manuals bookcase"
@@ -111,7 +111,7 @@
/obj/structure/bookcase/manuals/research_and_development/Initialize()
. = ..()
new /obj/item/book/manual/research_and_development(src)
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/structure/bookcase/sop
name = "bookcase (Standard Operating Procedures)"
@@ -127,7 +127,7 @@
new /obj/item/book/manual/wiki/sop_security(src)
new /obj/item/book/manual/wiki/sop_service(src)
new /obj/item/book/manual/wiki/sop_supply(src)
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/structure/bookcase/random
var/category = null
@@ -140,7 +140,7 @@
var/list/books = GLOB.library_catalog.get_random_book(book_count, doAsync = FALSE)
for(var/datum/cachedbook/book as anything in books)
new /obj/item/book(src, book, TRUE, FALSE)
update_icon()
update_icon(UPDATE_ICON_STATE)
/*
* Book binder
+1 -2
View File
@@ -325,9 +325,8 @@
icon_state = "bostaff0"
block_chance = 50
/obj/item/twohanded/bostaff/update_icon()
/obj/item/twohanded/bostaff/update_icon_state()
icon_state = "bostaff[wielded]"
return
/obj/item/twohanded/bostaff/attack(mob/target, mob/living/user)
add_fingerprint(user)
@@ -88,9 +88,8 @@
AddComponent(/datum/component/spraycan_paintable)
update_icon()
/obj/item/clothing/head/helmet/space/hostile_environment/update_icon()
..()
cut_overlays()
/obj/item/clothing/head/helmet/space/hostile_environment/update_overlays()
. = ..()
var/mutable_appearance/glass_overlay = mutable_appearance(icon, "hostile_env_glass")
glass_overlay.appearance_flags = RESET_COLOR
add_overlay(glass_overlay)
. += glass_overlay
@@ -154,18 +154,19 @@
else
set_light(0)
/obj/item/twohanded/kinetic_crusher/update_icon()
..()
cut_overlays()
/obj/item/twohanded/kinetic_crusher/update_icon_state()
item_state = "crusher[wielded]"
/obj/item/twohanded/kinetic_crusher/update_overlays()
. = ..()
if(!charged)
add_overlay("[icon_state]_uncharged")
. += "[icon_state]_uncharged"
if(light_on)
add_overlay("[icon_state]_lit")
. += "[icon_state]_lit"
spawn(1)
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
item_state = "crusher[wielded]"
//destablizing force
/obj/item/projectile/destabilizer
@@ -118,5 +118,7 @@
colorindex += 1
if(colorindex >= 6)
colorindex = 0
update_icon(UPDATE_ICON_STATE)
/obj/item/mobcapsule/update_icon_state()
icon_state = "mobcap[colorindex]"
update_icon()
+10 -11
View File
@@ -34,14 +34,14 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
/obj/item/stack/marker_beacon/Initialize(mapload)
. = ..()
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/item/stack/marker_beacon/examine(mob/user)
. = ..()
. += "<span class='notice'>Use in-hand to place a [singular_name].</span>"
. += "<span class='notice'>Alt-click to select a color. Current color is [picked_color].</span>"
/obj/item/stack/marker_beacon/update_icon()
/obj/item/stack/marker_beacon/update_icon_state()
icon_state = "[initial(icon_state)][lowertext(picked_color)]"
/obj/item/stack/marker_beacon/attack_self(mob/user)
@@ -65,7 +65,7 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
return
if(input_color)
picked_color = input_color
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/structure/marker_beacon
name = "marker beacon"
@@ -84,13 +84,13 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
/obj/structure/marker_beacon/Initialize(mapload, set_color)
. = ..()
picked_color = set_color
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/structure/marker_beacon/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
var/obj/item/stack/marker_beacon/M = new(loc)
M.picked_color = picked_color
M.update_icon()
M.update_icon(UPDATE_ICON_STATE)
qdel(src)
/obj/structure/marker_beacon/examine(mob/user)
@@ -98,7 +98,7 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
if(picked_color)
. += "<span class='notice'>Alt-click to select a color. Current color is [picked_color].</span>"
/obj/structure/marker_beacon/update_icon()
/obj/structure/marker_beacon/update_icon_state()
while(!picked_color || !GLOB.marker_beacon_colors[picked_color])
picked_color = pick(GLOB.marker_beacon_colors)
icon_state = "[initial(icon_state)][lowertext(picked_color)]-on"
@@ -115,7 +115,7 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
if(do_after(user, remove_speed, target = src))
var/obj/item/stack/marker_beacon/M = new(loc)
M.picked_color = picked_color
M.update_icon()
M.update_icon(UPDATE_ICON_STATE)
transfer_fingerprints_to(M)
user.put_in_hands(M)
playsound(src, 'sound/items/deconstruct.ogg', 50, TRUE)
@@ -141,7 +141,7 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
return
if(input_color)
picked_color = input_color
update_icon()
update_icon(UPDATE_ICON_STATE)
/obj/structure/marker_beacon/dock_marker
name = "docking beacon"
@@ -149,7 +149,7 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
icon_state = "dockingmarker"
flags = NODECONSTRUCT
/obj/structure/marker_beacon/dock_marker/update_icon()
/obj/structure/marker_beacon/dock_marker/update_icon_state()
set_light(light_range, light_power, LIGHT_COLOR_BLUE)
/obj/structure/marker_beacon/dock_marker/attackby()
@@ -166,6 +166,5 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
desc = "A Prism-brand collision illumination device. It is anchored in place and glowing steadily."
icon_state = "markerburgundy-on"
/obj/structure/marker_beacon/dock_marker/collision/update_icon()
/obj/structure/marker_beacon/dock_marker/collision/update_icon_state()
set_light(light_range, light_power, LIGHT_COLOR_FLARE)
return

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