From f4b37b41775f4704b5d99dc09b2d7e824040e6af Mon Sep 17 00:00:00 2001
From: Vi3trice <80771500+Vi3trice@users.noreply.github.com>
Date: Thu, 21 Jul 2022 02:11:59 -0400
Subject: [PATCH] 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 158529302b3dd902229eb0d82dd7410f552cec90.
* 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
---
code/__DEFINES/dcs/signals.dm | 26 ++-
code/__DEFINES/flags.dm | 11 ++
code/__HELPERS/unsorted.dm | 6 +-
code/_onclick/hud/action_button.dm | 10 +-
code/_onclick/hud/alien.dm | 6 +-
code/_onclick/hud/alien_larva.dm | 6 +-
code/_onclick/hud/bot.dm | 3 +-
code/_onclick/hud/human.dm | 6 +-
code/_onclick/hud/other_mobs.dm | 3 +-
code/_onclick/hud/robot.dm | 6 +-
code/_onclick/hud/screen_objects.dm | 47 ++---
code/_onclick/telekinesis.dm | 11 +-
code/datums/components/ducttape.dm | 6 +-
code/datums/components/emissive_blocker.dm | 29 +++
code/datums/components/persistent_overlay.dm | 35 ++++
code/datums/spells/wizard.dm | 2 +-
code/game/area/areas.dm | 6 +-
code/game/area/areas/depot-areas.dm | 38 ++--
code/game/atoms.dm | 68 +++++++
code/game/atoms_movable.dm | 17 +-
code/game/data_huds.dm | 8 +-
code/game/dna/dna_modifier.dm | 12 +-
code/game/dna/mutations/powers.dm | 2 +-
.../gamemodes/blob/blobs/captured_nuke.dm | 7 +-
code/game/gamemodes/blob/blobs/shield.dm | 39 +++-
code/game/gamemodes/blob/theblob.dm | 57 ++++--
code/game/gamemodes/cult/cult_items.dm | 4 +-
.../miniantags/abduction/abduction_gear.dm | 6 +-
.../gamemodes/miniantags/abduction/gland.dm | 2 +-
.../abduction/machinery/experiment.dm | 14 +-
.../gamemodes/miniantags/guardian/guardian.dm | 3 +-
.../miniantags/slaughter/slaughter.dm | 2 +-
code/game/gamemodes/nuclear/nuclearbomb.dm | 9 +-
code/game/machinery/Beacon.dm | 8 +-
code/game/machinery/PDApainter.dm | 16 +-
code/game/machinery/Sleeper.dm | 17 +-
code/game/machinery/adv_med.dm | 14 +-
code/game/machinery/ai_slipper.dm | 4 +-
code/game/machinery/camera/camera.dm | 10 +-
code/game/machinery/camera/camera_assembly.dm | 6 +-
code/game/machinery/cell_charger.dm | 30 +--
code/game/machinery/cloning.dm | 13 +-
.../machinery/computer/HolodeckControl.dm | 10 +-
code/game/machinery/computer/ai_core.dm | 16 +-
code/game/machinery/computer/aifixer.dm | 34 ++--
code/game/machinery/computer/atmos_alert.dm | 2 +-
code/game/machinery/computer/atmos_control.dm | 2 +-
.../game/machinery/computer/buildandrepair.dm | 3 +-
code/game/machinery/computer/computer.dm | 10 +-
code/game/machinery/computer/message.dm | 4 +-
code/game/machinery/computer/station_alert.dm | 4 +-
code/game/machinery/dance_machine.dm | 6 +-
code/game/machinery/defib_mount.dm | 22 +--
code/game/machinery/doors/airlock.dm | 16 +-
code/game/machinery/doors/airlock_control.dm | 6 +-
code/game/machinery/doors/brigdoors.dm | 12 +-
code/game/machinery/doors/door.dm | 53 ++---
code/game/machinery/doors/firedoor.dm | 22 ++-
code/game/machinery/doors/poddoor.dm | 2 +-
code/game/machinery/doors/windowdoor.dm | 3 +-
code/game/machinery/dye_generator.dm | 22 +--
.../airlock_controllers.dm | 2 +-
.../embedded_controller_base.dm | 6 +-
code/game/machinery/firealarm.dm | 25 ++-
code/game/machinery/floodlight.dm | 26 +--
code/game/machinery/gameboard.dm | 4 +-
code/game/machinery/hologram.dm | 8 +-
code/game/machinery/holosign.dm | 6 +-
code/game/machinery/iv_drip.dm | 19 +-
code/game/machinery/lightswitch.dm | 21 +-
code/game/machinery/magnet.dm | 17 +-
code/game/machinery/navbeacon.dm | 18 +-
code/game/machinery/portable_tag_turret.dm | 2 +-
code/game/machinery/portable_turret.dm | 32 ++-
code/game/machinery/recharger.dm | 12 +-
code/game/machinery/rechargestation.dm | 12 +-
code/game/machinery/recycler.dm | 21 +-
code/game/machinery/requests_console.dm | 6 +-
code/game/machinery/shieldgen.dm | 186 ++++++++----------
code/game/machinery/snow_machine.dm | 7 +-
code/game/machinery/spaceheater.dm | 9 +-
code/game/machinery/suit_storage_unit.dm | 48 ++---
code/game/machinery/syndicatebomb.dm | 12 +-
code/game/machinery/tcomms/_base.dm | 15 +-
code/game/machinery/teleporter.dm | 28 +--
code/game/machinery/transformer.dm | 16 +-
code/game/machinery/turret_control.dm | 7 +-
code/game/machinery/vending.dm | 24 +--
code/game/machinery/washing_machine.dm | 14 +-
code/game/mecha/equipment/tools/work_tools.dm | 4 +-
code/game/mecha/mech_bay.dm | 2 +-
code/game/mecha/working/ripley.dm | 32 +--
.../effects/decals/Cleanable/aliens.dm | 1 +
.../effects/decals/Cleanable/humans.dm | 16 +-
.../effects/decals/Cleanable/robots.dm | 1 +
.../effects/decals/Cleanable/tracks.dm | 8 +-
.../game/objects/effects/decals/contraband.dm | 2 +-
.../effects/effect_system/effects_foam.dm | 13 +-
code/game/objects/items/ashtray.dm | 16 +-
code/game/objects/items/bodybag.dm | 2 +-
code/game/objects/items/candle.dm | 12 +-
code/game/objects/items/crayons.dm | 14 +-
code/game/objects/items/devices/flashlight.dm | 76 +++----
.../objects/items/devices/geiger_counter.dm | 12 +-
.../objects/items/devices/lightreplacer.dm | 25 ++-
.../items/devices/painter/airlock_painter.dm | 2 +-
code/game/objects/items/devices/powersink.dm | 4 +-
.../objects/items/devices/radio/intercom.dm | 22 +--
code/game/objects/items/devices/scanners.dm | 25 ++-
.../objects/items/devices/taperecorder.dm | 34 ++--
.../objects/items/devices/transfer_valve.dm | 18 +-
code/game/objects/items/flag.dm | 11 +-
code/game/objects/items/his_grace.dm | 12 +-
code/game/objects/items/robot/robot_parts.dm | 30 +--
.../objects/items/robot/robot_upgrades.dm | 16 +-
code/game/objects/items/stacks/rods.dm | 6 +-
.../objects/items/stacks/sheets/leather.dm | 6 +-
code/game/objects/items/tools/welder.dm | 21 +-
code/game/objects/items/toys.dm | 19 +-
code/game/objects/items/weapons/RCL.dm | 11 +-
code/game/objects/items/weapons/cash.dm | 5 +-
.../objects/items/weapons/chrono_eraser.dm | 10 +-
code/game/objects/items/weapons/defib.dm | 104 +++++-----
code/game/objects/items/weapons/dice.dm | 12 +-
.../objects/items/weapons/dnascrambler.dm | 4 +-
code/game/objects/items/weapons/explosives.dm | 14 +-
.../objects/items/weapons/flamethrower.dm | 17 +-
code/game/objects/items/weapons/garrote.dm | 32 ++-
.../items/weapons/grenades/chem_grenade.dm | 55 +++---
.../weapons/implants/implant_mindshield.dm | 2 -
.../items/weapons/implants/implantcase.dm | 22 ++-
.../items/weapons/implants/implanter.dm | 6 +-
.../items/weapons/implants/implantpad.dm | 13 +-
code/game/objects/items/weapons/legcuffs.dm | 4 +-
code/game/objects/items/weapons/mop.dm | 3 +-
code/game/objects/items/weapons/paint.dm | 1 +
.../objects/items/weapons/storage/bags.dm | 49 ++---
.../objects/items/weapons/storage/belt.dm | 21 +-
.../objects/items/weapons/storage/boxes.dm | 36 ++--
.../objects/items/weapons/storage/fancy.dm | 45 ++---
.../objects/items/weapons/storage/storage.dm | 2 +-
.../objects/items/weapons/storage/toolbox.dm | 12 +-
.../objects/items/weapons/storage/wallets.dm | 9 +-
code/game/objects/items/weapons/stunbaton.dm | 8 +-
.../game/objects/items/weapons/tanks/tanks.dm | 2 +-
code/game/objects/items/weapons/tape.dm | 6 +-
code/game/objects/items/weapons/twohanded.dm | 24 +--
code/game/objects/obj_defense.dm | 6 +-
code/game/objects/objs.dm | 4 +-
code/game/objects/structures/bedsheet_bin.dm | 7 +-
code/game/objects/structures/coathanger.dm | 42 ++--
.../structures/crates_lockers/closets.dm | 29 ++-
.../crates_lockers/closets/coffin.dm | 5 +-
.../crates_lockers/closets/fireaxe.dm | 25 +--
.../crates_lockers/closets/gimmick.dm | 5 +-
.../closets/secure/guncabinet.dm | 10 +-
.../closets/secure/secure_closets.dm | 2 +-
.../crates_lockers/closets/statue.dm | 5 +-
.../structures/crates_lockers/crates.dm | 17 +-
.../structures/crates_lockers/largecrate.dm | 7 +-
code/game/objects/structures/depot.dm | 4 +-
code/game/objects/structures/displaycase.dm | 20 +-
code/game/objects/structures/door_assembly.dm | 27 +--
code/game/objects/structures/electricchair.dm | 23 ++-
code/game/objects/structures/engicart.dm | 35 ++--
code/game/objects/structures/extinguisher.dm | 18 +-
code/game/objects/structures/false_walls.dm | 2 +-
code/game/objects/structures/grille.dm | 4 +-
code/game/objects/structures/inflatable.dm | 60 +++---
code/game/objects/structures/janicart.dm | 24 +--
code/game/objects/structures/ladders.dm | 4 +-
code/game/objects/structures/mineral_doors.dm | 77 +++-----
code/game/objects/structures/mop_bucket.dm | 34 ++--
code/game/objects/structures/morgue.dm | 98 ++++-----
code/game/objects/structures/safe.dm | 12 +-
code/game/objects/structures/tables_racks.dm | 18 +-
.../game/objects/structures/tank_dispenser.dm | 18 +-
code/game/objects/structures/watercloset.dm | 11 +-
.../objects/structures/windoor_assembly.dm | 12 +-
code/game/objects/structures/window.dm | 8 +-
code/game/turfs/simulated/floor.dm | 7 +-
.../game/turfs/simulated/floor/fancy_floor.dm | 4 +-
.../game/turfs/simulated/floor/light_floor.dm | 3 +-
code/game/turfs/simulated/floor/mineral.dm | 4 +-
.../turfs/simulated/floor/plasteel_floor.dm | 4 +-
code/game/turfs/simulated/floor/plating.dm | 6 +-
code/game/turfs/simulated/walls.dm | 33 ++--
code/game/turfs/simulated/walls_reinforced.dm | 4 +-
code/game/turfs/space/transit.dm | 4 +-
code/modules/admin/topic.dm | 8 +-
.../vampire/vampire_powers/umbrae_powers.dm | 3 +-
code/modules/arcade/arcade_base.dm | 3 -
code/modules/arcade/arcade_prize.dm | 4 +-
code/modules/arcade/claw_game.dm | 6 +-
.../arcade/mob_hunt/battle_computer.dm | 3 +-
code/modules/arcade/prize_counter.dm | 5 +-
code/modules/assembly/bomb.dm | 11 +-
code/modules/assembly/holder.dm | 14 +-
code/modules/assembly/infrared.dm | 9 +-
code/modules/assembly/mousetrap.dm | 2 +-
code/modules/assembly/proximity.dm | 8 +-
code/modules/assembly/signaler.dm | 3 +-
code/modules/assembly/timer.dm | 6 +-
.../atmospherics/machinery/airalarm.dm | 24 +--
.../atmospherics/machinery/atmospherics.dm | 11 +-
.../components/binary_devices/circulator.dm | 36 ++--
.../components/binary_devices/dp_vent_pump.dm | 11 +-
.../components/binary_devices/passive_gate.dm | 3 +-
.../components/binary_devices/pump.dm | 4 +-
.../components/binary_devices/valve.dm | 24 +--
.../components/binary_devices/volume_pump.dm | 4 +-
.../components/trinary_devices/filter.dm | 4 +-
.../components/trinary_devices/mixer.dm | 4 +-
.../components/trinary_devices/tvalve.dm | 5 +-
.../components/unary_devices/cryo.dm | 69 +++----
.../unary_devices/generator_input.dm | 4 +-
.../unary_devices/heat_exchanger.dm | 4 +-
.../unary_devices/outlet_injector.dm | 4 +-
.../unary_devices/oxygen_generator.dm | 4 +-
.../unary_devices/portables_connector.dm | 3 +-
.../components/unary_devices/thermal_plate.dm | 4 +-
.../components/unary_devices/thermomachine.dm | 2 +-
.../components/unary_devices/vent_pump.dm | 13 +-
.../components/unary_devices/vent_scrubber.dm | 13 +-
.../atmospherics/machinery/other/meter.dm | 59 +++---
.../atmospherics/machinery/pipes/cap.dm | 12 +-
.../atmospherics/machinery/pipes/manifold.dm | 19 +-
.../machinery/pipes/manifold4w.dm | 21 +-
.../machinery/pipes/simple/pipe_simple.dm | 15 +-
.../pipes/simple/pipe_simple_hidden.dm | 17 +-
.../pipes/simple/pipe_simple_visible.dm | 17 +-
.../machinery/portable/canister.dm | 155 ++++++++-------
.../portable/portable_atmospherics.dm | 43 ++--
.../atmospherics/machinery/portable/pump.dm | 48 ++---
.../machinery/portable/scrubber.dm | 42 ++--
code/modules/awaymissions/gateway.dm | 46 ++---
.../mission_code/ruins/oldstation.dm | 2 +-
code/modules/awaymissions/pamphlet.dm | 2 +-
code/modules/buildmode/buttons.dm | 5 +-
code/modules/clothing/chameleon.dm | 1 +
code/modules/clothing/clothing.dm | 182 +++++++++--------
.../clothing/glasses/engine_goggles.dm | 6 +-
code/modules/clothing/glasses/glasses.dm | 30 +--
code/modules/clothing/glasses/hud.dm | 8 +-
code/modules/clothing/gloves/miscellaneous.dm | 17 +-
code/modules/clothing/gloves/rings.dm | 8 +-
code/modules/clothing/head/hardhat.dm | 7 +-
code/modules/clothing/head/helmet.dm | 4 +-
code/modules/clothing/head/misc_special.dm | 62 ++----
code/modules/clothing/masks/breath.dm | 1 +
code/modules/clothing/masks/gasmask.dm | 9 +-
code/modules/clothing/masks/miscellaneous.dm | 4 +-
code/modules/clothing/spacesuits/alien.dm | 2 +-
code/modules/clothing/spacesuits/hardsuit.dm | 8 +-
code/modules/clothing/spacesuits/plasmamen.dm | 17 +-
code/modules/clothing/suits/toggles.dm | 6 +-
code/modules/clothing/under/color.dm | 4 +-
code/modules/clothing/under/miscellaneous.dm | 16 +-
code/modules/clothing/under/oldstation_uni.dm | 8 +-
code/modules/clothing/under/shorts.dm | 2 +-
code/modules/clothing/under/syndicate.dm | 2 +-
code/modules/customitems/item_defines.dm | 21 +-
.../detective_work/footprints_and_rag.dm | 1 +
code/modules/fish/fishtank.dm | 57 +++---
.../food_and_drinks/drinks/bottler/bottler.dm | 6 +-
.../food_and_drinks/drinks/drinks/bottle.dm | 52 +++--
.../food_and_drinks/drinks/drinks/cans.dm | 51 +++--
.../drinks/drinks/shotglass.dm | 29 +--
.../food_and_drinks/food/foods/desserts.dm | 8 +-
.../food_and_drinks/food/foods/ingredients.dm | 19 +-
.../food_and_drinks/food/foods/pizza.dm | 111 ++++++-----
.../kitchen_machinery/gibber.dm | 29 ++-
.../kitchen_machinery/juicer.dm | 37 ++--
.../kitchen_machinery/smartfridge.dm | 55 +++---
code/modules/games/52card.dm | 4 +-
code/modules/games/cards.dm | 77 +++++---
.../hydroponics/beekeeping/honeycomb.dm | 10 +-
code/modules/hydroponics/biogenerator.dm | 14 +-
code/modules/hydroponics/fermenting_barrel.dm | 4 +-
code/modules/hydroponics/gene_modder.dm | 24 +--
code/modules/hydroponics/hydroitemdefines.dm | 28 +--
code/modules/hydroponics/hydroponics.dm | 81 ++++----
.../instruments/objs/items/headphones.dm | 16 +-
code/modules/library/library_equipment.dm | 18 +-
code/modules/martial_arts/martial.dm | 3 +-
.../modules/mining/equipment/explorer_gear.dm | 7 +-
.../mining/equipment/kinetic_crusher.dm | 13 +-
.../mining/equipment/lazarus_injector.dm | 4 +-
.../mining/equipment/marker_beacons.dm | 21 +-
.../mining/equipment/regenerative_core.dm | 8 +-
code/modules/mining/equipment/survival_pod.dm | 5 +-
.../mining/lavaland/loot/hierophant_loot.dm | 2 +-
.../mining/lavaland/loot/tendril_loot.dm | 2 +-
code/modules/mining/machine_redemption.dm | 4 +-
code/modules/mining/machine_vending.dm | 4 +-
code/modules/mob/dead/observer/observer.dm | 5 +-
code/modules/mob/living/living.dm | 4 +-
.../mob/living/silicon/robot/drone/drone.dm | 1 -
.../modules/mob/living/silicon/robot/robot.dm | 2 +-
.../mob/living/simple_animal/bot/bot.dm | 8 +-
.../living/simple_animal/bot/construction.dm | 149 +++++++++-----
.../mob/living/simple_animal/bot/floorbot.dm | 16 +-
.../mob/living/simple_animal/bot/honkbot.dm | 4 +-
.../mob/living/simple_animal/bot/medbot.dm | 10 +-
.../mob/living/simple_animal/bot/mulebot.dm | 9 +-
.../mob/living/simple_animal/bot/syndicate.dm | 2 +-
.../simple_animal/friendly/spiderbot.dm | 2 +-
.../simple_animal/hostile/spaceworms.dm | 8 +-
.../living/simple_animal/posessed_object.dm | 3 +-
.../mob/living/simple_animal/slime/slime.dm | 3 +-
code/modules/mob/mob_movement.dm | 2 +-
code/modules/newscaster/obj/newscaster.dm | 22 ++-
.../ninja/suit/n_suit_verbs/ninja_stars.dm | 2 +-
code/modules/ninja/suit/suit_attackby.dm | 2 +-
code/modules/paperwork/carbonpaper.dm | 2 +-
code/modules/paperwork/clipboard.dm | 13 +-
code/modules/paperwork/folders.dm | 21 +-
code/modules/paperwork/frames.dm | 22 ++-
code/modules/paperwork/paper.dm | 20 +-
code/modules/paperwork/paper_bundle.dm | 60 +++---
code/modules/paperwork/paperbin.dm | 3 +-
code/modules/paperwork/paperplane.dm | 7 +-
code/modules/paperwork/pen.dm | 26 +--
code/modules/paperwork/photocopier.dm | 4 +-
code/modules/paperwork/ticketmachine.dm | 6 +-
code/modules/power/apc.dm | 78 ++++----
code/modules/power/cable.dm | 26 +--
code/modules/power/cell.dm | 31 ++-
code/modules/power/generator.dm | 32 +--
code/modules/power/gravitygenerator.dm | 11 +-
code/modules/power/lighting.dm | 4 +-
code/modules/power/port_gen.dm | 2 +-
code/modules/power/singularity/emitter.dm | 3 +-
.../power/singularity/field_generator.dm | 11 +-
.../particle_accelerator.dm | 11 +-
.../particle_accelerator/particle_chamber.dm | 4 -
.../particle_accelerator/particle_control.dm | 3 +-
.../particle_accelerator/particle_emitter.dm | 4 -
code/modules/power/smes.dm | 14 +-
code/modules/power/solar.dm | 22 +--
code/modules/power/treadmill.dm | 8 +-
code/modules/projectiles/ammunition.dm | 29 +--
.../projectiles/ammunition/ammo_casings.dm | 19 +-
.../projectiles/ammunition/magazines.dm | 27 ++-
code/modules/projectiles/guns/alien.dm | 5 +-
code/modules/projectiles/guns/energy.dm | 80 ++++----
.../guns/energy/kinetic_accelerator.dm | 11 +-
code/modules/projectiles/guns/energy/laser.dm | 7 +-
.../projectiles/guns/energy/nuclear.dm | 6 +-
.../projectiles/guns/energy/special.dm | 57 +++---
code/modules/projectiles/guns/magic.dm | 2 +-
code/modules/projectiles/guns/magic/wand.dm | 2 +-
.../projectiles/guns/misc/blastcannon.dm | 24 ++-
code/modules/projectiles/guns/projectile.dm | 26 ++-
.../projectiles/guns/projectile/automatic.dm | 61 +++---
.../projectiles/guns/projectile/bow.dm | 2 +-
.../projectiles/guns/projectile/launchers.dm | 6 +-
.../projectiles/guns/projectile/pistol.dm | 19 +-
.../projectiles/guns/projectile/revolver.dm | 15 +-
.../projectiles/guns/projectile/saw.dm | 2 +-
.../projectiles/guns/projectile/shotgun.dm | 13 +-
.../projectiles/guns/projectile/sniper.dm | 16 +-
.../projectiles/guns/projectile/toy.dm | 17 +-
code/modules/projectiles/guns/rocket.dm | 3 -
code/modules/projectiles/guns/throw.dm | 5 +-
.../projectiles/guns/throw/crossbow.dm | 11 +-
.../projectiles/guns/throw/pielauncher.dm | 4 +-
code/modules/projectiles/projectile/magic.dm | 2 +-
.../projectiles/projectile/reusable.dm | 2 +-
.../chemistry/machinery/chem_dispenser.dm | 32 ++-
.../chemistry/machinery/chem_master.dm | 8 +-
.../reagents/chemistry/machinery/pandemic.dm | 14 +-
.../chemistry/machinery/reagentgrinder.dm | 8 +-
code/modules/reagents/reagent_containers.dm | 4 +-
.../reagents/reagent_containers/applicator.dm | 20 +-
.../reagents/reagent_containers/bottle.dm | 10 +-
.../reagent_containers/glass_containers.dm | 25 +--
.../reagents/reagent_containers/hypospray.dm | 4 +-
.../reagents/reagent_containers/iv_bag.dm | 27 ++-
.../reagents/reagent_containers/syringes.dm | 21 +-
code/modules/recycling/conveyor2.dm | 17 +-
.../recycling/disposal-construction.dm | 2 +-
code/modules/recycling/disposal.dm | 8 +-
code/modules/recycling/sortingmachinery.dm | 3 +-
code/modules/research/message_server.dm | 7 +-
code/modules/research/server.dm | 4 +-
.../ruins/lavalandruin_code/fountain_hall.dm | 6 +-
.../security_levels/keycard_authentication.dm | 8 +-
.../security_levels/security_levels.dm | 10 +-
code/modules/shuttle/emergency.dm | 5 +-
code/modules/shuttle/shuttle_manipulator.dm | 10 +-
code/modules/shuttle/shuttle_rotate.dm | 2 +-
code/modules/shuttle/supply.dm | 2 +-
code/modules/station_goals/bsa.dm | 9 +-
code/modules/station_goals/dna_vault.dm | 5 +-
code/modules/station_goals/shield.dm | 4 +-
code/modules/surgery/implant_removal.dm | 2 +-
code/modules/surgery/organs/augments_arms.dm | 6 +-
code/modules/surgery/organs/eyes.dm | 2 +-
code/modules/surgery/organs/heart.dm | 6 +-
code/modules/surgery/organs/organ_icon.dm | 3 +-
code/modules/surgery/organs/subtypes/slime.dm | 2 +-
code/modules/telesci/gps.dm | 16 +-
code/modules/vehicle/janicart.dm | 14 +-
code/modules/vehicle/vehicle.dm | 3 +-
icons/mob/clothing/eyes.dmi | Bin 17019 -> 17020 bytes
icons/mob/clothing/head.dmi | Bin 257160 -> 257162 bytes
icons/mob/clothing/mask.dmi | Bin 50129 -> 50129 bytes
icons/mob/clothing/species/drask/eyes.dmi | Bin 10552 -> 10553 bytes
icons/mob/clothing/species/drask/helmet.dmi | Bin 67792 -> 67793 bytes
icons/mob/clothing/species/drask/mask.dmi | Bin 41299 -> 41299 bytes
icons/mob/clothing/species/grey/eyes.dmi | Bin 13458 -> 13459 bytes
icons/mob/clothing/species/grey/helmet.dmi | Bin 83530 -> 83533 bytes
icons/mob/clothing/species/grey/mask.dmi | Bin 47443 -> 47443 bytes
icons/mob/clothing/species/tajaran/helmet.dmi | Bin 59066 -> 59066 bytes
icons/mob/clothing/species/tajaran/mask.dmi | Bin 31381 -> 31381 bytes
icons/mob/clothing/species/unathi/helmet.dmi | Bin 63584 -> 63584 bytes
icons/mob/clothing/species/unathi/mask.dmi | Bin 37687 -> 37687 bytes
icons/mob/clothing/species/vox/eyes.dmi | Bin 13652 -> 13655 bytes
icons/mob/clothing/species/vox/helmet.dmi | Bin 105621 -> 105622 bytes
icons/mob/clothing/species/vox/mask.dmi | Bin 35415 -> 35415 bytes
.../mob/clothing/species/vulpkanin/helmet.dmi | Bin 72553 -> 72554 bytes
icons/mob/clothing/species/vulpkanin/mask.dmi | Bin 33602 -> 33601 bytes
icons/mob/screen_white.dmi | Bin 20921 -> 21671 bytes
icons/obj/clothing/glasses.dmi | Bin 14207 -> 14209 bytes
icons/obj/clothing/hats.dmi | Bin 114451 -> 114452 bytes
icons/obj/clothing/masks.dmi | Bin 28636 -> 28636 bytes
icons/obj/doors/airlocks/station/overlays.dmi | Bin 9455 -> 10171 bytes
paradise.dme | 2 +
429 files changed, 3487 insertions(+), 3296 deletions(-)
create mode 100644 code/datums/components/emissive_blocker.dm
create mode 100644 code/datums/components/persistent_overlay.dm
diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm
index 3f80482533b..33105bbd8c7 100644
--- a/code/__DEFINES/dcs/signals.dm
+++ b/code/__DEFINES/dcs/signals.dm
@@ -70,13 +70,29 @@
#define EXAMINE_POSITION_BEFORE (1<<1)
//End positions
#define COMPONENT_EXNAME_CHANGED (1<<0)
-///from base of atom/update_icon(): ()
+ ///from base of [/atom/proc/update_appearance]: (updates)
+ #define COMSIG_ATOM_UPDATE_APPEARANCE "atom_update_appearance"
+ /// If returned from [COMSIG_ATOM_UPDATE_APPEARANCE] it prevents the atom from updating its name.
+ #define COMSIG_ATOM_NO_UPDATE_NAME UPDATE_NAME
+ /// If returned from [COMSIG_ATOM_UPDATE_APPEARANCE] it prevents the atom from updating its desc.
+ #define COMSIG_ATOM_NO_UPDATE_DESC UPDATE_DESC
+ /// If returned from [COMSIG_ATOM_UPDATE_APPEARANCE] it prevents the atom from updating its icon.
+ #define COMSIG_ATOM_NO_UPDATE_ICON UPDATE_ICON
+///from base of [/atom/proc/update_name]: (updates)
+#define COMSIG_ATOM_UPDATE_NAME "atom_update_name"
+///from base of [/atom/proc/update_desc]: (updates)
+#define COMSIG_ATOM_UPDATE_DESC "atom_update_desc"
+///from base of [/atom/update_icon]: ()
#define COMSIG_ATOM_UPDATE_ICON "atom_update_icon"
- #define COMSIG_ATOM_NO_UPDATE_ICON_STATE (1<<0)
- #define COMSIG_ATOM_NO_UPDATE_OVERLAYS (1<<1)
-///from base of atom/update_overlays(): (list/new_overlays)
+ /// If returned from [COMSIG_ATOM_UPDATE_ICON] it prevents the atom from updating its icon state.
+ #define COMSIG_ATOM_NO_UPDATE_ICON_STATE UPDATE_ICON_STATE
+ /// If returned from [COMSIG_ATOM_UPDATE_ICON] it prevents the atom from updating its overlays.
+ #define COMSIG_ATOM_NO_UPDATE_OVERLAYS UPDATE_OVERLAYS
+///Sent after [atom/update_icon_state] is called by [/atom/update_icon]: ()
+#define COMSIG_ATOM_UPDATE_ICON_STATE "atom_update_icon_state"
+///Sent after [atom/update_overlays] is called by [/atom/update_icon]: (list/new_overlays)
#define COMSIG_ATOM_UPDATE_OVERLAYS "atom_update_overlays"
-///from base of atom/update_icon(): (signalOut, did_anything)
+///from base of [/atom/update_icon]: (signalOut, did_anything)
#define COMSIG_ATOM_UPDATED_ICON "atom_updated_icon"
///from base of atom/Entered(): (atom/movable/entering, /atom)
#define COMSIG_ATOM_ENTERED "atom_entered"
diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm
index b4c7fade59a..62b6b9c8a23 100644
--- a/code/__DEFINES/flags.dm
+++ b/code/__DEFINES/flags.dm
@@ -27,6 +27,17 @@
///Whether or not this atom shows screentips when hovered over
#define NO_SCREENTIPS 32768
+// Update flags for [/atom/proc/update_appearance]
+/// Update the atom's name
+#define UPDATE_NAME (1<<0)
+/// Update the atom's desc
+#define UPDATE_DESC (1<<1)
+/// Update the atom's icon state
+#define UPDATE_ICON_STATE (1<<2)
+/// Update the atom's overlays
+#define UPDATE_OVERLAYS (1<<3)
+/// Update the atom's icon
+#define UPDATE_ICON (UPDATE_ICON_STATE|UPDATE_OVERLAYS)
/* Secondary atom flags, for the flags_2 var, denoted with a _2 */
diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm
index f20a2193029..01d0721c3d9 100644
--- a/code/__HELPERS/unsorted.dm
+++ b/code/__HELPERS/unsorted.dm
@@ -855,7 +855,7 @@ Returns 1 if the chain up to the area contains the given typepath
if(perfectcopy)
if((O) && (original))
- var/static/list/forbidden_vars = list("type","loc","locs","vars", "parent","parent_type", "verbs","ckey","key","power_supply","contents","reagents","stat","x","y","z","group")
+ var/static/list/forbidden_vars = list("type","loc","locs","vars", "parent","parent_type", "verbs","ckey","key","power_supply","contents","reagents","stat","x","y","z","group", "comp_lookup", "datum_components")
for(var/V in original.vars - forbidden_vars)
if(istype(original.vars[V],/list))
@@ -869,7 +869,7 @@ Returns 1 if the chain up to the area contains the given typepath
O.update_icon()
return O
-/area/proc/copy_contents_to(area/A , platingRequired = 0 )
+/area/proc/copy_contents_to(area/A , platingRequired = 0, perfect_copy = TRUE)
//Takes: Area. Optional: If it should copy to areas that don't have plating
//Returns: Nothing.
//Notes: Attempts to move the contents of one area to another area.
@@ -949,7 +949,7 @@ Returns 1 if the chain up to the area contains the given typepath
for(var/obj/O in objs)
- newobjs += DuplicateObject(O , 1)
+ newobjs += DuplicateObject(O , perfect_copy)
for(var/obj/O in newobjs)
diff --git a/code/_onclick/hud/action_button.dm b/code/_onclick/hud/action_button.dm
index 8d836571086..d62e1ecb545 100644
--- a/code/_onclick/hud/action_button.dm
+++ b/code/_onclick/hud/action_button.dm
@@ -88,7 +88,7 @@
name = "Show Buttons"
else
name = "Hide Buttons"
- UpdateIcon()
+ update_icon(UPDATE_OVERLAYS)
usr.update_action_buttons()
/obj/screen/movable/action_button/hide_toggle/AltClick(mob/user)
@@ -114,13 +114,13 @@
if(user.client)
alpha = user.client.prefs.UI_style_alpha
color = user.client.prefs.UI_style_color
- UpdateIcon()
+ update_icon(UPDATE_OVERLAYS)
-/obj/screen/movable/action_button/hide_toggle/proc/UpdateIcon()
- cut_overlays()
+/obj/screen/movable/action_button/hide_toggle/update_overlays()
+ . = ..()
var/image/img = image(initial(icon), src, hidden ? "show" : "hide")
img.appearance_flags = RESET_COLOR | RESET_ALPHA
- overlays += img
+ . += img
/obj/screen/movable/action_button/MouseEntered(location, control, params)
. = ..()
diff --git a/code/_onclick/hud/alien.dm b/code/_onclick/hud/alien.dm
index a825cadb8d3..e7edc06d70a 100644
--- a/code/_onclick/hud/alien.dm
+++ b/code/_onclick/hud/alien.dm
@@ -119,7 +119,8 @@
mymob.pullin = new /obj/screen/pull()
mymob.pullin.icon = 'icons/mob/screen_alien.dmi'
- mymob.pullin.update_icon(mymob)
+ mymob.pullin.hud = src
+ mymob.pullin.update_icon(UPDATE_ICON_STATE)
mymob.pullin.screen_loc = ui_pull_resist
hotkeybuttons += mymob.pullin
@@ -127,7 +128,8 @@
infodisplay += alien_plasma_display
zone_select = new /obj/screen/zone_sel/alien()
- zone_select.update_icon(mymob)
+ zone_select.hud = src
+ zone_select.update_icon(UPDATE_OVERLAYS)
static_inventory += zone_select
for(var/obj/screen/inventory/inv in (static_inventory + toggleable_inventory))
diff --git a/code/_onclick/hud/alien_larva.dm b/code/_onclick/hud/alien_larva.dm
index 68a2826fca3..f97e593d088 100644
--- a/code/_onclick/hud/alien_larva.dm
+++ b/code/_onclick/hud/alien_larva.dm
@@ -26,7 +26,8 @@
mymob.pullin = new /obj/screen/pull()
mymob.pullin.icon = 'icons/mob/screen_alien.dmi'
- mymob.pullin.update_icon(mymob)
+ mymob.pullin.hud = src
+ mymob.pullin.update_icon(UPDATE_ICON_STATE)
mymob.pullin.screen_loc = ui_pull_resist
hotkeybuttons += mymob.pullin
@@ -35,5 +36,6 @@
static_inventory += using
zone_select = new /obj/screen/zone_sel/alien()
- zone_select.update_icon(mymob)
+ zone_select.hud = src
+ zone_select.update_icon(UPDATE_OVERLAYS)
static_inventory += zone_select
diff --git a/code/_onclick/hud/bot.dm b/code/_onclick/hud/bot.dm
index 12320f2da3e..7370454bf96 100644
--- a/code/_onclick/hud/bot.dm
+++ b/code/_onclick/hud/bot.dm
@@ -28,6 +28,7 @@
mymob.pullin = new /obj/screen/pull()
mymob.pullin.icon = 'icons/mob/screen_bot.dmi'
- mymob.pullin.update_icon(mymob)
+ mymob.pullin.hud = src
+ mymob.pullin.update_icon(UPDATE_ICON_STATE)
mymob.pullin.screen_loc = ui_bot_pull
static_inventory += mymob.pullin
diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm
index 3d885f81c24..40116b4d5c7 100644
--- a/code/_onclick/hud/human.dm
+++ b/code/_onclick/hud/human.dm
@@ -333,7 +333,8 @@
mymob.pullin = new /obj/screen/pull()
mymob.pullin.icon = ui_style
- mymob.pullin.update_icon(mymob)
+ mymob.pullin.hud = src
+ mymob.pullin.update_icon(UPDATE_ICON_STATE)
mymob.pullin.screen_loc = ui_pull_resist
static_inventory += mymob.pullin
@@ -347,7 +348,8 @@
zone_select.color = ui_color
zone_select.icon = ui_style
zone_select.alpha = ui_alpha
- zone_select.update_icon(mymob)
+ zone_select.hud = src
+ zone_select.update_icon(UPDATE_OVERLAYS)
static_inventory += zone_select
inventory_shown = FALSE
diff --git a/code/_onclick/hud/other_mobs.dm b/code/_onclick/hud/other_mobs.dm
index 8f243dfcdc1..0472a34dbef 100644
--- a/code/_onclick/hud/other_mobs.dm
+++ b/code/_onclick/hud/other_mobs.dm
@@ -26,6 +26,7 @@
mymob.pullin = new /obj/screen/pull()
mymob.pullin.icon = 'icons/mob/screen_corgi.dmi'
- mymob.pullin.update_icon(mymob)
+ mymob.pullin.hud = src
+ mymob.pullin.update_icon(UPDATE_ICON_STATE)
mymob.pullin.screen_loc = ui_construct_pull
static_inventory += mymob.pullin
diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm
index ad7794d2ae0..38e05cab03c 100644
--- a/code/_onclick/hud/robot.dm
+++ b/code/_onclick/hud/robot.dm
@@ -157,12 +157,14 @@
mymob.pullin = new /obj/screen/pull()
mymob.pullin.icon = 'icons/mob/screen_robot.dmi'
- mymob.pullin.update_icon(mymob)
+ mymob.pullin.hud = src
+ mymob.pullin.update_icon(UPDATE_ICON_STATE)
mymob.pullin.screen_loc = ui_borg_pull
hotkeybuttons += mymob.pullin
zone_select = new /obj/screen/zone_sel/robot()
- zone_select.update_icon(mymob)
+ zone_select.hud = src
+ zone_select.update_icon(UPDATE_OVERLAYS)
static_inventory += zone_select
//Headlamp
diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm
index d7b047e6b2a..83424370862 100644
--- a/code/_onclick/hud/screen_objects.dm
+++ b/code/_onclick/hud/screen_objects.dm
@@ -22,6 +22,7 @@
/obj/screen/Destroy()
master = null
+ hud = null
return ..()
/obj/screen/proc/component_click(obj/screen/component_button/component, params)
@@ -120,10 +121,8 @@
/obj/screen/pull/Click()
usr.stop_pulling()
-/obj/screen/pull/update_icon(mob/mymob)
- if(!mymob)
- return
- if(mymob.pulling)
+/obj/screen/pull/update_icon_state()
+ if(hud?.mymob?.pulling)
icon_state = "pull"
else
icon_state = "pull0"
@@ -223,6 +222,7 @@
name = "damage zone"
icon_state = "zone_sel"
screen_loc = ui_zonesel
+ var/overlay_file = 'icons/mob/zone_sel.dmi'
var/selecting = "chest"
var/static/list/hover_overlays_cache = list()
var/hovering
@@ -323,32 +323,27 @@
return "eyes"
return "head"
-/obj/screen/zone_sel/proc/set_selected_zone(choice, mob/user)
- if(isobserver(user))
+/obj/screen/zone_sel/proc/set_selected_zone(choice)
+ if(!hud)
+ return
+ if(isobserver(hud.mymob))
return
if(choice != selecting)
selecting = choice
- update_icon(user)
+ update_icon(UPDATE_OVERLAYS)
return 1
-/obj/screen/zone_sel/update_icon(mob/user)
- overlays.Cut()
- var/image/human = image('icons/mob/zone_sel.dmi', "human")
- human.appearance_flags = RESET_COLOR
- overlays += human
- var/image/sel = image('icons/mob/zone_sel.dmi', "[selecting]")
+/obj/screen/zone_sel/update_overlays()
+ . = ..()
+ var/image/sel = image(overlay_file, "[selecting]")
sel.appearance_flags = RESET_COLOR
- overlays += sel
- user.zone_selected = selecting
+ . += sel
+ hud.mymob.zone_selected = selecting
/obj/screen/zone_sel/alien
icon = 'icons/mob/screen_alien.dmi'
-
-/obj/screen/zone_sel/alien/update_icon(mob/user)
- overlays.Cut()
- overlays += image('icons/mob/screen_alien.dmi', "[selecting]")
- user.zone_selected = selecting
+ overlay_file = 'icons/mob/screen_alien.dmi'
/obj/screen/zone_sel/robot
icon = 'icons/mob/screen_robot.dmi'
@@ -432,26 +427,24 @@
var/image/active_overlay
var/image/handcuff_overlay
-/obj/screen/inventory/hand/update_icon()
- ..()
+/obj/screen/inventory/hand/update_overlays()
+ . = ..()
if(!active_overlay)
active_overlay = image("icon"=icon, "icon_state"="hand_active")
if(!handcuff_overlay)
var/state = (slot_id == slot_r_hand) ? "markus" : "gabrielle"
handcuff_overlay = image("icon"='icons/mob/screen_gen.dmi', "icon_state"=state)
- overlays.Cut()
-
if(hud && hud.mymob)
if(iscarbon(hud.mymob))
var/mob/living/carbon/C = hud.mymob
if(C.handcuffed)
- overlays += handcuff_overlay
+ . += handcuff_overlay
if(slot_id == slot_l_hand && hud.mymob.hand)
- overlays += active_overlay
+ . += active_overlay
else if(slot_id == slot_r_hand && !hud.mymob.hand)
- overlays += active_overlay
+ . += active_overlay
/obj/screen/inventory/hand/Click()
// At this point in client Click() code we have passed the 1/10 sec check and little else
diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm
index 531f39182e2..71258f40080 100644
--- a/code/_onclick/telekinesis.dm
+++ b/code/_onclick/telekinesis.dm
@@ -68,6 +68,7 @@
layer = ABOVE_HUD_LAYER
plane = ABOVE_HUD_PLANE
+ blocks_emissive = FALSE
var/last_throw = 0
var/atom/movable/focus = null
var/mob/living/host = null
@@ -164,7 +165,7 @@
qdel(src)
return
focus = target
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
apply_focus_overlay()
// Make it behave like other equipment
if(istype(target, /obj/item))
@@ -180,7 +181,7 @@
// Delete the key/value pair of item to TK grab
host.tkgrabbed_objects -= focus
focus = null
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/tk_grab/proc/apply_focus_overlay()
if(!focus)
@@ -193,9 +194,9 @@
focus_object(target, user)
-/obj/item/tk_grab/update_icon()
- overlays.Cut()
+/obj/item/tk_grab/update_overlays()
+ . = ..()
if(focus && focus.icon && focus.icon_state)
- overlays += icon(focus.icon,focus.icon_state)
+ . += icon(focus.icon,focus.icon_state)
#undef TK_COOLDOWN
diff --git a/code/datums/components/ducttape.dm b/code/datums/components/ducttape.dm
index 06a882dbcf7..5a5f206d28f 100644
--- a/code/datums/components/ducttape.dm
+++ b/code/datums/components/ducttape.dm
@@ -8,7 +8,7 @@
if(!istype(I)) //Something went wrong
return
if(!hide_tape) //if TRUE this hides the tape overlay and added examine text
- RegisterSignal(parent, COMSIG_OBJ_UPDATE_ICON, .proc/add_tape_overlay)
+ RegisterSignal(parent, COMSIG_ATOM_UPDATE_OVERLAYS, .proc/add_tape_overlay)
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/add_tape_text)
x_offset = x
y_offset = y
@@ -27,7 +27,7 @@
tape_overlay = new('icons/obj/bureaucracy.dmi', "tape")
tape_overlay.Shift(EAST, x_offset - 2)
tape_overlay.Shift(NORTH, y_offset - 2)
- O.overlays += tape_overlay
+ O.add_overlay(tape_overlay)
/datum/component/ducttape/proc/remove_tape(obj/item/I, mob/user)
to_chat(user, "You tear the tape off [I]!")
@@ -38,7 +38,7 @@
for(var/datum/action/item_action/remove_tape/RT in I.actions)
RT.Remove(user)
qdel(RT)
- I.overlays.Cut(tape_overlay)
+ I.cut_overlay(tape_overlay)
user.transfer_fingerprints_to(I)
qdel(src)
diff --git a/code/datums/components/emissive_blocker.dm b/code/datums/components/emissive_blocker.dm
new file mode 100644
index 00000000000..f54058f5e60
--- /dev/null
+++ b/code/datums/components/emissive_blocker.dm
@@ -0,0 +1,29 @@
+/datum/component/emissive_blocker
+ /// Stores either the mutable_appearance or a list of them
+ var/stored_blocker
+
+/datum/component/emissive_blocker/Initialize(_stored_blocker)
+ var/atom/movable/A = parent
+ stored_blocker = _stored_blocker
+ RegisterSignal(parent, COMSIG_ATOM_UPDATE_ICON_STATE, .proc/update_generic_block)
+ A.add_overlay(stored_blocker)
+
+/datum/component/emissive_blocker/Destroy()
+ stored_blocker = null
+ return ..()
+
+/// Updates the generic blocker when the icon_state is changed
+/datum/component/emissive_blocker/proc/update_generic_block(datum/source)
+ var/atom/movable/A = parent
+ if(!A.blocks_emissive && stored_blocker)
+ A.cut_overlay(stored_blocker)
+ stored_blocker = null
+ return
+ if(!A.blocks_emissive)
+ return
+ var/mutable_appearance/gen_emissive_blocker = emissive_blocker(A.icon, A.icon_state, alpha = A.alpha, appearance_flags = A.appearance_flags)
+ gen_emissive_blocker.dir = A.dir
+ if(gen_emissive_blocker != stored_blocker || !A.overlays)
+ A.cut_overlay(stored_blocker)
+ stored_blocker = gen_emissive_blocker
+ A.add_overlay(stored_blocker)
diff --git a/code/datums/components/persistent_overlay.dm b/code/datums/components/persistent_overlay.dm
new file mode 100644
index 00000000000..419d6a8b301
--- /dev/null
+++ b/code/datums/components/persistent_overlay.dm
@@ -0,0 +1,35 @@
+/datum/component/persistent_overlay
+ var/image/persistent_overlay = null
+ var/atom/target = null
+
+/datum/component/persistent_overlay/Initialize(image_overlay, _target, timer)
+ persistent_overlay = image_overlay
+ target = _target
+ if(timer)
+ addtimer(CALLBACK(src, .proc/remove_persistent_overlay), timer)
+ if(target)
+ RegisterSignal(target, COMSIG_PARENT_QDELETING, .proc/remove_persistent_overlay)
+ RegisterSignal(parent, COMSIG_PARENT_QDELETING, .proc/remove_persistent_overlay)
+ add_persistent_overlay()
+
+/datum/component/persistent_overlay/Destroy()
+ persistent_overlay = null
+ target = null
+ return ..()
+
+/datum/component/persistent_overlay/proc/remove_persistent_overlay(datum/source)
+ var/atom/movable/A
+ if(target)
+ A = target
+ else
+ A = parent
+ A.cut_overlay(persistent_overlay, priority = TRUE)
+ qdel(src)
+
+/datum/component/persistent_overlay/proc/add_persistent_overlay(datum/source)
+ var/atom/movable/A
+ if(target)
+ A = target
+ else
+ A = parent
+ A.add_overlay(persistent_overlay, priority = TRUE)
diff --git a/code/datums/spells/wizard.dm b/code/datums/spells/wizard.dm
index fb05d3afd9f..6454ae3ab01 100644
--- a/code/datums/spells/wizard.dm
+++ b/code/datums/spells/wizard.dm
@@ -364,7 +364,7 @@
C.range = 20
return C
-/obj/effect/proc_holder/spell/fireball/update_icon()
+/obj/effect/proc_holder/spell/fireball/update_icon_state()
if(!action)
return
action.button_icon_state = "fireball[active]"
diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm
index c9e292f629b..2519224062e 100644
--- a/code/game/area/areas.dm
+++ b/code/game/area/areas.dm
@@ -370,7 +370,7 @@
L.fire_mode = FALSE
L.update(TRUE, TRUE, FALSE)
-/area/proc/updateicon()
+/area/update_icon_state()
var/weather_icon
for(var/V in SSweather.processing)
var/datum/weather/W = V
@@ -380,7 +380,7 @@
if(!weather_icon)
icon_state = null
-/area/space/updateicon()
+/area/space/update_icon_state()
icon_state = null
/*
@@ -417,7 +417,7 @@
for(var/obj/machinery/M in src) // for each machine in the area
M.power_change() // reverify power status (to update icons etc.)
SEND_SIGNAL(src, COMSIG_AREA_POWER_CHANGE)
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
/area/proc/usage(chan)
var/used = 0
diff --git a/code/game/area/areas/depot-areas.dm b/code/game/area/areas/depot-areas.dm
index 691a5d99d48..8b9790d2d7e 100644
--- a/code/game/area/areas/depot-areas.dm
+++ b/code/game/area/areas/depot-areas.dm
@@ -36,25 +36,33 @@
var/obj/machinery/computer/syndicate_depot/syndiecomms/comms_computer = null
var/obj/structure/fusionreactor/reactor
-/area/syndicate_depot/core/updateicon()
+/area/syndicate_depot/core/proc/update_state()
if(destroyed)
- icon_state = null
invisibility = INVISIBILITY_MAXIMUM
else if(on_peaceful)
- icon_state = "green"
invisibility = INVISIBILITY_LIGHTING
else if(used_self_destruct)
- icon_state = "radiation"
invisibility = INVISIBILITY_LIGHTING
else if(called_backup)
- icon_state = "red"
invisibility = INVISIBILITY_LIGHTING
else if(local_alarm)
- icon_state = "bluenew"
invisibility = INVISIBILITY_LIGHTING
else
- icon_state = null
invisibility = INVISIBILITY_MAXIMUM
+ update_icon(UPDATE_ICON_STATE)
+
+/area/syndicate_depot/core/update_icon_state()
+ if(invisibility == INVISIBILITY_MAXIMUM)
+ icon_state = null
+ return
+ else if(on_peaceful)
+ icon_state = "green"
+ else if(used_self_destruct)
+ icon_state = "radiation"
+ else if(called_backup)
+ icon_state = "red"
+ else if(local_alarm)
+ icon_state = "bluenew"
/area/syndicate_depot/core/proc/reset_alert()
@@ -84,7 +92,7 @@
detected_pod = FALSE
detected_double_agent = FALSE
mine_trigger_count = 0
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
if(!istype(reactor))
for(var/obj/structure/fusionreactor/R in src)
@@ -112,7 +120,7 @@
return
if(!used_self_destruct)
activate_self_destruct(reason, FALSE, null)
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
/area/syndicate_depot/core/proc/locker_looted()
if(!something_looted)
@@ -197,7 +205,7 @@
message_admins("- SYNDI DEPOT VISITOR: [ADMIN_FULLMONTY(M)]")
list_add(M, hostile_list)
peaceful_list = list()
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
/area/syndicate_depot/core/proc/local_alarm(reason, silent)
if(local_alarm)
@@ -219,7 +227,7 @@
var/mob/living/simple_animal/bot/ed209/syndicate/B = new /mob/living/simple_animal/bot/ed209/syndicate(get_turf(S))
list_add(B, guard_list)
B.depotarea = src
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
/area/syndicate_depot/core/proc/call_backup(reason, silent)
if(called_backup || used_self_destruct)
@@ -252,7 +260,7 @@
list_add(S, guard_list)
else if(!silent)
announce_here("Depot Communications Offline", "Comms computer is damaged, destroyed or depowered. Unable to call in backup from Syndicate HQ.")
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
/area/syndicate_depot/core/proc/activate_self_destruct(reason, containment_failure, mob/user)
if(used_self_destruct)
@@ -265,7 +273,7 @@
called_backup = TRUE
activate_lockdown(TRUE)
lockout_computers()
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
despawn_guards()
if(containment_failure)
announce_here("Depot Code DELTA", reason)
@@ -287,7 +295,7 @@
else
log_debug("Depot: [src] called activate_self_destruct with no reactor.")
message_admins("Syndicate Depot lacks reactor to initiate self-destruct. Must be destroyed manually.")
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
/area/syndicate_depot/core/proc/activate_lockdown()
if(used_lockdown)
@@ -312,7 +320,7 @@
if(istype(A, /obj/machinery/door/airlock/hatch/syndicate/vault))
continue
A.emergency = !!openaccess
- A.update_icon()
+ A.update_appearance()
/area/syndicate_depot/core/proc/toggle_falsewalls()
for(var/obj/structure/falsewall/plastitanium/F in src)
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index 3e7c505e2ca..1db152a98ec 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -45,6 +45,8 @@
var/list/priority_overlays //overlays that should remain on top and not normally removed when using cut_overlay functions, like c4.
var/list/remove_overlays // a very temporary list of overlays to remove
var/list/add_overlays // a very temporary list of overlays to add
+ ///overlays managed by [update_overlays][/atom/proc/update_overlays] to prevent removing overlays that weren't added by the same proc. Single items are stored on their own, not in a list.
+ var/list/managed_overlays
var/list/atom_colours //used to store the different colors on an atom
//its inherent color, the colored paint applied on it, special color effect etc...
@@ -189,6 +191,8 @@
LAZYCLEARLIST(overlays)
LAZYCLEARLIST(priority_overlays)
+ managed_overlays = null
+
QDEL_NULL(light)
return ..()
@@ -391,6 +395,70 @@
SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user, .)
+/**
+ * Updates the appearence of the icon
+ *
+ * Mostly delegates to update_name, update_desc, and update_icon
+ *
+ * Arguments:
+ * - updates: A set of bitflags dictating what should be updated. Defaults to [ALL]
+ */
+/atom/proc/update_appearance(updates=ALL)
+ SHOULD_NOT_SLEEP(TRUE)
+ SHOULD_CALL_PARENT(TRUE)
+
+ /// Signal sent should the appearance be updated. This is more broad if listening to a more specific signal doesn't cut it
+ updates &= ~SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_APPEARANCE, updates)
+ if(updates & UPDATE_NAME)
+ update_name(updates)
+ if(updates & UPDATE_DESC)
+ update_desc(updates)
+ if(updates & UPDATE_ICON)
+ update_icon(updates)
+
+/// Updates the name of the atom
+/atom/proc/update_name(updates=ALL)
+ SHOULD_CALL_PARENT(TRUE)
+ return SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_NAME, updates)
+
+/// Updates the description of the atom
+/atom/proc/update_desc(updates=ALL)
+ SHOULD_CALL_PARENT(TRUE)
+ return SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_DESC, updates)
+
+/// Updates the icon of the atom
+/atom/proc/update_icon(updates=ALL)
+ SIGNAL_HANDLER
+ SHOULD_CALL_PARENT(TRUE)
+
+ updates &= ~SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_ICON, updates)
+ if(updates & UPDATE_ICON_STATE)
+ update_icon_state()
+ SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_ICON_STATE)
+
+ if(updates & UPDATE_OVERLAYS)
+ var/list/new_overlays = update_overlays(updates)
+ if(managed_overlays)
+ cut_overlay(managed_overlays)
+ managed_overlays = null
+ if(length(new_overlays))
+ if(length(new_overlays) == 1)
+ managed_overlays = new_overlays[1]
+ else
+ managed_overlays = new_overlays
+ add_overlay(new_overlays)
+ SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_OVERLAYS)
+
+ SEND_SIGNAL(src, COMSIG_ATOM_UPDATED_ICON, updates)
+
+/// Updates the icon state of the atom
+/atom/proc/update_icon_state()
+ return
+
+/// Updates the overlays of the atom. It has to return a list of overlays if it can't call the parent to create one. The list can contain anything that would be valid for the add_overlay proc: Images, mutable appearances, icon states...
+/atom/proc/update_overlays()
+ return list()
+
/atom/proc/relaymove()
return
diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm
index cdae41e26b6..6357fe9fea9 100644
--- a/code/game/atoms_movable.dm
+++ b/code/game/atoms_movable.dm
@@ -51,24 +51,17 @@
gen_emissive_blocker.color = EM_BLOCK_COLOR
gen_emissive_blocker.dir = dir
gen_emissive_blocker.appearance_flags |= appearance_flags
- add_overlay(list(gen_emissive_blocker))
+ AddComponent(/datum/component/emissive_blocker, gen_emissive_blocker)
if(EMISSIVE_BLOCK_UNIQUE)
render_target = ref(src)
em_block = new(src, render_target)
add_overlay(list(em_block))
/atom/movable/proc/update_emissive_block()
- if(!blocks_emissive)
- return
- else if (blocks_emissive == EMISSIVE_BLOCK_GENERIC)
- var/mutable_appearance/gen_emissive_blocker = emissive_blocker(icon, icon_state, alpha = src.alpha, appearance_flags = src.appearance_flags)
- gen_emissive_blocker.dir = dir
- return gen_emissive_blocker
- else if(blocks_emissive == EMISSIVE_BLOCK_UNIQUE)
- if(!em_block && !QDELETED(src))
- render_target = ref(src)
- em_block = new(src, render_target)
- add_overlay(list(em_block))
+ if(!em_block && !QDELETED(src))
+ render_target = ref(src)
+ em_block = new(src, render_target)
+ add_overlay(list(em_block))
/atom/movable/Destroy()
unbuckle_all_mobs(force = TRUE)
diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm
index ba93dca1f57..bb35e7f6a52 100644
--- a/code/game/data_huds.dm
+++ b/code/game/data_huds.dm
@@ -20,11 +20,11 @@
/datum/atom_hud/data/human/medical/basic
/datum/atom_hud/data/human/medical/basic/proc/check_sensors(mob/living/carbon/human/H)
- if(!istype(H)) return 0
+ if(!istype(H)) return
var/obj/item/clothing/under/U = H.w_uniform
- if(!istype(U)) return 0
- if(U.sensor_mode <= 2) return 0
- return 1
+ if(!istype(U)) return
+ if(U.sensor_mode <= SENSOR_VITALS) return
+ return TRUE
/datum/atom_hud/data/human/medical/basic/add_to_single_hud(mob/M, mob/living/carbon/H)
if(check_sensors(H) || istype(M,/mob/dead/observer) )
diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm
index 4bf9acf2390..217f22b5fc3 100644
--- a/code/game/dna/dna_modifier.dm
+++ b/code/game/dna/dna_modifier.dm
@@ -168,6 +168,12 @@
add_fingerprint(usr)
SStgui.update_uis(src)
+/obj/machinery/dna_scannernew/update_icon_state()
+ if(occupant)
+ icon_state = "scanner_occupied"
+ else
+ icon_state = "scanner_open"
+
/obj/machinery/dna_scannernew/MouseDrop_T(atom/movable/O, mob/user)
if(!istype(O))
return
@@ -266,7 +272,7 @@
/obj/machinery/dna_scannernew/proc/put_in(mob/M)
M.forceMove(src)
occupant = M
- icon_state = "scanner_occupied"
+ update_icon(UPDATE_ICON_STATE)
SStgui.update_uis(src)
// search for ghosts, if the corpse is empty and the scanner is connected to a cloner
@@ -288,7 +294,7 @@
return
occupant.forceMove(loc)
occupant = null
- icon_state = "scanner_open"
+ update_icon(UPDATE_ICON_STATE)
SStgui.update_uis(src)
/obj/machinery/dna_scannernew/force_eject_occupant(mob/target)
@@ -304,7 +310,7 @@
if(A == occupant)
occupant = null
updateUsrDialog()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
SStgui.update_uis(src)
// Checks if occupants can be irradiated/mutated - prevents exploits where wearing full rad protection would still let you gain mutations
diff --git a/code/game/dna/mutations/powers.dm b/code/game/dna/mutations/powers.dm
index 9cf2fd88304..daf3636557f 100644
--- a/code/game/dna/mutations/powers.dm
+++ b/code/game/dna/mutations/powers.dm
@@ -394,7 +394,7 @@
var/can_eat = TRUE
if(iscarbon(user))
var/mob/living/carbon/C = user
- if((C.head && (C.head.flags_cover & HEADCOVERSMOUTH)) || (C.wear_mask && (C.wear_mask.flags_cover & MASKCOVERSMOUTH) && !C.wear_mask.mask_adjusted))
+ if((C.head && (C.head.flags_cover & HEADCOVERSMOUTH)) || (C.wear_mask && (C.wear_mask.flags_cover & MASKCOVERSMOUTH) && !C.wear_mask.up))
if(show_message)
to_chat(C, "Your mouth is covered, preventing you from eating!")
can_eat = FALSE
diff --git a/code/game/gamemodes/blob/blobs/captured_nuke.dm b/code/game/gamemodes/blob/blobs/captured_nuke.dm
index 1ed4620903a..15cbba514a8 100644
--- a/code/game/gamemodes/blob/blobs/captured_nuke.dm
+++ b/code/game/gamemodes/blob/blobs/captured_nuke.dm
@@ -11,12 +11,11 @@
START_PROCESSING(SSobj, src)
N?.forceMove(src)
-/obj/structure/blob/captured_nuke/update_icon()
- ..()
- cut_overlays()
+/obj/structure/blob/captured_nuke/update_overlays()
+ . = ..()
var/image/nuke_overlay = image('icons/mob/blob.dmi', "blob_nuke_overlay")
nuke_overlay.appearance_flags = RESET_COLOR
- add_overlay(nuke_overlay)
+ . += nuke_overlay
/obj/structure/blob/captured_nuke/Destroy()
for(var/obj/machinery/nuclearbomb/O in contents)
diff --git a/code/game/gamemodes/blob/blobs/shield.dm b/code/game/gamemodes/blob/blobs/shield.dm
index 323a8eb6b86..cada8996ad9 100644
--- a/code/game/gamemodes/blob/blobs/shield.dm
+++ b/code/game/gamemodes/blob/blobs/shield.dm
@@ -12,20 +12,43 @@
/obj/structure/blob/shield/core
point_return = 0
-/obj/structure/blob/shield/update_icon()
- ..()
+/obj/structure/blob/shield/check_integrity()
+ var/old_compromised_integrity = compromised_integrity
if(obj_integrity < max_integrity * 0.5)
- icon_state = "[initial(icon_state)]_damaged"
- name = "weakened [initial(name)]"
- desc = "A wall of twitching tendrils."
+ compromised_integrity = TRUE
+ else
+ compromised_integrity = FALSE
+ if(old_compromised_integrity != compromised_integrity)
+ update_state()
+ update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_ICON_STATE)
+
+/obj/structure/blob/shield/update_state()
+ if(compromised_integrity)
atmosblock = FALSE
else
- icon_state = initial(icon_state)
- name = initial(name)
- desc = initial(desc)
atmosblock = TRUE
air_update_turf(1)
+/obj/structure/blob/shield/update_name()
+ . = ..()
+ if(compromised_integrity)
+ name = "weakened [initial(name)]"
+ else
+ name = initial(name)
+
+/obj/structure/blob/shield/update_desc()
+ . = ..()
+ if(compromised_integrity)
+ desc = "A wall of twitching tendrils."
+ else
+ desc = initial(desc)
+
+/obj/structure/blob/shield/update_icon_state()
+ if(compromised_integrity)
+ icon_state = "[initial(icon_state)]_damaged"
+ else
+ icon_state = initial(icon_state)
+
/obj/structure/blob/shield/CanPass(atom/movable/mover, turf/target, height=0)
if(istype(mover) && mover.checkpass(PASSBLOB)) return 1
return 0
diff --git a/code/game/gamemodes/blob/theblob.dm b/code/game/gamemodes/blob/theblob.dm
index 1408db828da..048d478a080 100644
--- a/code/game/gamemodes/blob/theblob.dm
+++ b/code/game/gamemodes/blob/theblob.dm
@@ -14,13 +14,15 @@
var/brute_resist = 0.5 //multiplies brute damage by this
var/fire_resist = 1 //multiplies burn damage by this
var/atmosblock = FALSE //if the blob blocks atmos and heat spread
+ /// If a threshold is reached, resulting in shifting variables
+ var/compromised_integrity = FALSE
var/mob/camera/blob/overmind
/obj/structure/blob/Initialize(mapload)
. = ..()
GLOB.blobs += src
setDir(pick(GLOB.cardinal))
- update_icon()
+ check_integrity()
if(atmosblock)
air_update_turf(TRUE)
ConsumeTile()
@@ -63,13 +65,19 @@
/obj/structure/blob/proc/Life()
return
+/obj/structure/blob/proc/check_integrity()
+ return
+
+/obj/structure/blob/proc/update_state()
+ return
+
/obj/structure/blob/proc/RegenHealth()
// All blobs heal over time when pulsed, but it has a cool down
if(health_timestamp > world.time)
return 0
if(obj_integrity < max_integrity)
obj_integrity = min(max_integrity, obj_integrity + 1)
- update_icon()
+ check_integrity()
health_timestamp = world.time + 10 // 1 seconds
@@ -186,7 +194,7 @@
/obj/structure/blob/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
. = ..()
if(. && obj_integrity > 0)
- update_icon()
+ check_integrity()
/obj/structure/blob/proc/change_to(type)
if(!ispath(type))
@@ -219,6 +227,7 @@
if(lowertext(B.blob_reagent_datum.color) == lowertext(src.color)) // Goddamit why we use strings for these
return B.blob_reagent_datum.description
return "something unknown"
+
/obj/structure/blob/normal
icon_state = "blob"
light_range = 0
@@ -226,20 +235,38 @@
max_integrity = 25
brute_resist = 0.25
-/obj/structure/blob/normal/update_icon()
- ..()
+/obj/structure/blob/normal/check_integrity()
+ var/old_compromised_integrity = compromised_integrity
if(obj_integrity <= 15)
- icon_state = "blob_damaged"
- name = "fragile blob"
- desc = "A thin lattice of slightly twitching tendrils."
+ compromised_integrity = TRUE
+ else
+ compromised_integrity = FALSE
+ if(old_compromised_integrity != compromised_integrity)
+ update_state()
+ update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_ICON_STATE)
+
+/obj/structure/blob/normal/update_state()
+ if(compromised_integrity)
brute_resist = 0.5
- else if(overmind)
- icon_state = "blob"
- name = "blob"
- desc = "A thick wall of writhing tendrils."
+ else
brute_resist = 0.25
+
+/obj/structure/blob/normal/update_name()
+ . = ..()
+ if(compromised_integrity)
+ name = "fragile blob"
+ else
+ name = "[overmind ? "blob" : "dead blob"]"
+
+/obj/structure/blob/normal/update_desc()
+ . = ..()
+ if(compromised_integrity)
+ desc = "A thin lattice of slightly twitching tendrils."
+ else
+ desc = "A thick wall of [overmind ? "writhing" : "lifeless"] tendrils."
+
+/obj/structure/blob/normal/update_icon_state()
+ if(compromised_integrity)
+ icon_state = "blob_damaged"
else
icon_state = "blob"
- name = "dead blob"
- desc = "A thick wall of lifeless tendrils."
- brute_resist = 0.25
diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm
index 9d6f9919f05..87e168731ed 100644
--- a/code/game/gamemodes/cult/cult_items.dm
+++ b/code/game/gamemodes/cult/cult_items.dm
@@ -249,7 +249,7 @@
prefix = "darkened"
claw_damage_increase = 4
-/obj/item/whetstone/cult/update_icon()
+/obj/item/whetstone/cult/update_icon_state()
icon_state = "cult_sharpener[used ? "_used" : ""]"
/obj/item/whetstone/cult/attackby(obj/item/I, mob/user, params)
@@ -571,7 +571,7 @@
qdel(spear_act)
..()
-/obj/item/twohanded/cult_spear/update_icon()
+/obj/item/twohanded/cult_spear/update_icon_state()
icon_state = "bloodspear[wielded]"
/obj/item/twohanded/cult_spear/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
diff --git a/code/game/gamemodes/miniantags/abduction/abduction_gear.dm b/code/game/gamemodes/miniantags/abduction/abduction_gear.dm
index 342a4636fa6..ade2681afba 100644
--- a/code/game/gamemodes/miniantags/abduction/abduction_gear.dm
+++ b/code/game/gamemodes/miniantags/abduction/abduction_gear.dm
@@ -384,7 +384,7 @@
Congratulations! You are now trained for invasive xenobiology research!"}
-/obj/item/paper/abductor/update_icon()
+/obj/item/paper/abductor/update_icon_state()
return
/obj/item/paper/abductor/AltClick()
@@ -422,12 +422,12 @@ Congratulations! You are now trained for invasive xenobiology research!"}
txt = "probing"
to_chat(usr, "You switch the baton to [txt] mode.")
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
-/obj/item/abductor_baton/update_icon()
+/obj/item/abductor_baton/update_icon_state()
switch(mode)
if(BATON_STUN)
icon_state = "wonderprodStun"
diff --git a/code/game/gamemodes/miniantags/abduction/gland.dm b/code/game/gamemodes/miniantags/abduction/gland.dm
index cc2b60262c0..1bc5f5eb727 100644
--- a/code/game/gamemodes/miniantags/abduction/gland.dm
+++ b/code/game/gamemodes/miniantags/abduction/gland.dm
@@ -19,7 +19,7 @@
var/mind_control_duration = 1800
var/active_mind_control = FALSE
-/obj/item/organ/internal/heart/gland/update_icon()
+/obj/item/organ/internal/heart/gland/update_icon_state()
return
/obj/item/organ/internal/heart/gland/proc/ownerCheck()
diff --git a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm
index d97669ca7d9..c034cf88a7c 100644
--- a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm
+++ b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm
@@ -17,6 +17,12 @@
eject_abductee()
return ..()
+/obj/machinery/abductor/experiment/update_icon_state()
+ if(occupant)
+ icon_state = "experiment"
+ else
+ icon_state = "experiment-open"
+
/obj/machinery/abductor/experiment/MouseDrop_T(mob/living/carbon/human/target, mob/user)
if(user.stat || HAS_TRAIT(user, TRAIT_UI_BLOCKED) || !Adjacent(user) || !target.Adjacent(user) || !ishuman(target))
return
@@ -34,7 +40,7 @@
target.forceMove(src)
occupant = target
- icon_state = "experiment"
+ update_icon(UPDATE_ICON_STATE)
add_fingerprint(user)
/obj/machinery/abductor/experiment/attack_hand(mob/user)
@@ -196,7 +202,7 @@
var/mob/living/carbon/human/H = grabbed.affecting
H.forceMove(src)
occupant = H
- icon_state = "experiment"
+ update_icon(UPDATE_ICON_STATE)
add_fingerprint(user)
qdel(G)
return
@@ -212,11 +218,11 @@
if(A == occupant)
occupant = null
updateUsrDialog()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/abductor/experiment/proc/eject_abductee()
if(!occupant)
return
occupant.forceMove(get_turf(src))
occupant = null
- icon_state = "experiment-open"
+ update_icon(UPDATE_ICON_STATE)
diff --git a/code/game/gamemodes/miniantags/guardian/guardian.dm b/code/game/gamemodes/miniantags/guardian/guardian.dm
index 07c43498fa5..7a5b110a9b2 100644
--- a/code/game/gamemodes/miniantags/guardian/guardian.dm
+++ b/code/game/gamemodes/miniantags/guardian/guardian.dm
@@ -465,10 +465,9 @@
Protector: You will become leashed to your holoparasite instead of them to you. Has two modes, a medium attack/defense mode and a protection mode which greatly reduces incoming damage to the holoparasite.
"}
-/obj/item/paper/guardian/update_icon()
+/obj/item/paper/guardian/update_icon_state()
return
-
/obj/item/storage/box/syndie_kit/guardian
name = "holoparasite injector kit"
diff --git a/code/game/gamemodes/miniantags/slaughter/slaughter.dm b/code/game/gamemodes/miniantags/slaughter/slaughter.dm
index 57c3ee43ef4..79de9ac744a 100644
--- a/code/game/gamemodes/miniantags/slaughter/slaughter.dm
+++ b/code/game/gamemodes/miniantags/slaughter/slaughter.dm
@@ -248,7 +248,7 @@
icon_state = "demon_heart"
origin_tech = "combat=5;biotech=7"
-/obj/item/organ/internal/heart/demon/update_icon()
+/obj/item/organ/internal/heart/demon/update_icon_state()
return //always beating visually
/obj/item/organ/internal/heart/demon/prepare_eat()
diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm
index 13206a58df3..8555a33b04a 100644
--- a/code/game/gamemodes/nuclear/nuclearbomb.dm
+++ b/code/game/gamemodes/nuclear/nuclearbomb.dm
@@ -73,6 +73,11 @@ GLOBAL_VAR(bomb_set)
INVOKE_ASYNC(src, .proc/explode)
return
+/obj/machinery/nuclearbomb/update_overlays()
+ . = ..()
+ if(panel_open)
+ . += "npanel_open"
+
/obj/machinery/nuclearbomb/attackby(obj/item/O as obj, mob/user as mob, params)
if(istype(O, /obj/item/disk/nuclear))
if(extended)
@@ -184,13 +189,11 @@ GLOBAL_VAR(bomb_set)
if(auth || (istype(I, /obj/item/screwdriver/nuke)))
if(!panel_open)
panel_open = TRUE
- overlays += image(icon, "npanel_open")
to_chat(user, "You unscrew the control panel of [src].")
anchor_stage = removal_stage
removal_stage = core_stage
else
panel_open = FALSE
- overlays -= image(icon, "npanel_open")
to_chat(user, "You screw the control panel of [src] back on.")
core_stage = removal_stage
removal_stage = anchor_stage
@@ -199,11 +202,11 @@ GLOBAL_VAR(bomb_set)
to_chat(user, "[src] emits a buzzing noise, the panel staying locked in.")
if(panel_open == TRUE)
panel_open = FALSE
- overlays -= image(icon, "npanel_open")
to_chat(user, "You screw the control panel of [src] back on.")
core_stage = removal_stage
removal_stage = anchor_stage
flick("nuclearbombc", src)
+ update_icon(UPDATE_OVERLAYS)
/obj/machinery/nuclearbomb/wirecutter_act(mob/user, obj/item/I)
if(!panel_open)
diff --git a/code/game/machinery/Beacon.dm b/code/game/machinery/Beacon.dm
index b3516470bdc..3107cb97cf0 100644
--- a/code/game/machinery/Beacon.dm
+++ b/code/game/machinery/Beacon.dm
@@ -43,10 +43,10 @@
/obj/machinery/bluespace_beacon/hide(intact)
invisibility = intact ? INVISIBILITY_MAXIMUM : 0
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
// update the icon_state
-/obj/machinery/bluespace_beacon/update_icon()
+/obj/machinery/bluespace_beacon/update_icon_state()
var/state="floor_beacon"
if(invisibility)
icon_state = "[state]f"
@@ -60,11 +60,11 @@
Beacon.loc = loc
else
create_beacon()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
else
if(Beacon)
destroy_beacon()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/bluespace_beacon/syndicate
diff --git a/code/game/machinery/PDApainter.dm b/code/game/machinery/PDApainter.dm
index 1eca027330f..7184de2558e 100644
--- a/code/game/machinery/PDApainter.dm
+++ b/code/game/machinery/PDApainter.dm
@@ -9,23 +9,21 @@
var/obj/item/pda/storedpda = null
var/list/colorlist = list()
-
-/obj/machinery/pdapainter/update_icon()
- cut_overlays()
-
+/obj/machinery/pdapainter/update_icon_state()
if(stat & BROKEN)
icon_state = "[initial(icon_state)]-broken"
return
-
- if(storedpda)
- add_overlay("[initial(icon_state)]-closed")
-
if(powered())
icon_state = initial(icon_state)
else
icon_state = "[initial(icon_state)]-off"
- return
+/obj/machinery/pdapainter/update_overlays()
+ . = ..()
+ if(stat & BROKEN)
+ return
+ if(storedpda)
+ . += "[initial(icon_state)]-closed"
/obj/machinery/pdapainter/Initialize(mapload)
. = ..()
diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm
index 17825dac64e..c0c5850768a 100644
--- a/code/game/machinery/Sleeper.dm
+++ b/code/game/machinery/Sleeper.dm
@@ -50,6 +50,12 @@
else
set_light(0)
+/obj/machinery/sleeper/update_icon_state()
+ if(occupant)
+ icon_state = base_icon
+ else
+ icon_state = "[base_icon]-open"
+
/obj/machinery/sleeper/Initialize(mapload)
. = ..()
component_parts = list()
@@ -346,7 +352,7 @@
var/mob/M = G.affecting
M.forceMove(src)
occupant = M
- icon_state = "[base_icon]"
+ update_icon(UPDATE_ICON_STATE)
to_chat(M, "You feel cool air surround you. You go numb as your senses turn inward.")
add_fingerprint(user)
qdel(G)
@@ -396,7 +402,7 @@
if(A == occupant)
occupant = null
updateUsrDialog()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
SStgui.update_uis(src)
if(A == beaker)
beaker = null
@@ -431,7 +437,7 @@
return
occupant.forceMove(loc)
occupant = null
- icon_state = "[base_icon]-open"
+ update_icon(UPDATE_ICON_STATE)
// eject trash the occupant dropped
for(var/atom/movable/A in contents - component_parts - list(beaker))
A.forceMove(loc)
@@ -468,7 +474,6 @@
if(usr.incapacitated()) //are you cuffed, dying, lying, stunned or other
return
- icon_state = "[base_icon]-open"
go_out()
add_fingerprint(usr)
return
@@ -504,7 +509,7 @@
return
L.forceMove(src)
occupant = L
- icon_state = "[base_icon]"
+ update_icon(UPDATE_ICON_STATE)
to_chat(L, "You feel cool air surround you. You go numb as your senses turn inward.")
add_fingerprint(user)
if(user.pulling == L)
@@ -575,7 +580,7 @@
usr.stop_pulling()
usr.forceMove(src)
occupant = usr
- icon_state = "[base_icon]"
+ update_icon(UPDATE_ICON_STATE)
for(var/obj/O in src)
qdel(O)
diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm
index 4d8e95967fc..30f782f8238 100644
--- a/code/game/machinery/adv_med.dm
+++ b/code/game/machinery/adv_med.dm
@@ -48,6 +48,12 @@
component_parts += new /obj/item/stack/cable_coil(null, 2)
RefreshParts()
+/obj/machinery/bodyscanner/update_icon_state()
+ if(occupant)
+ icon_state = "bodyscanner"
+ else
+ icon_state = "bodyscanner-open"
+
/obj/machinery/bodyscanner/attackby(obj/item/I, mob/user)
if(exchange_parts(user, I))
return
@@ -71,7 +77,7 @@
return
M.forceMove(src)
occupant = M
- icon_state = "bodyscanner"
+ update_icon(UPDATE_ICON_STATE)
add_fingerprint(user)
qdel(TYPECAST_YOUR_SHIT)
SStgui.update_uis(src)
@@ -135,7 +141,7 @@
H.forceMove(src)
occupant = H
- icon_state = "bodyscanner"
+ update_icon(UPDATE_ICON_STATE)
add_fingerprint(user)
SStgui.update_uis(src)
@@ -178,7 +184,7 @@
return
occupant.forceMove(loc)
occupant = null
- icon_state = "bodyscanner-open"
+ update_icon(UPDATE_ICON_STATE)
// eject trash the occupant dropped
for(var/atom/movable/A in contents - component_parts)
A.forceMove(loc)
@@ -197,7 +203,7 @@
if(A == occupant)
occupant = null
updateUsrDialog()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/bodyscanner/narsie_act()
go_out()
diff --git a/code/game/machinery/ai_slipper.dm b/code/game/machinery/ai_slipper.dm
index a9cc35874bb..d6874027ff8 100644
--- a/code/game/machinery/ai_slipper.dm
+++ b/code/game/machinery/ai_slipper.dm
@@ -21,7 +21,7 @@
stat &= ~NOPOWER
else
stat |= NOPOWER
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/ai_slipper/attack_ai(mob/user)
add_hiddenprint(user)
@@ -56,7 +56,7 @@
power_change()
addtimer(CALLBACK(src, .proc/recharge), cooldown_time)
-/obj/machinery/ai_slipper/update_icon()
+/obj/machinery/ai_slipper/update_icon_state()
if(stat & (NOPOWER|BROKEN) || cooldown_on || !uses)
icon_state = "liquid_dispenser"
else
diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm
index ee129fbb73f..31ddd360f16 100644
--- a/code/game/machinery/camera/camera.dm
+++ b/code/game/machinery/camera/camera.dm
@@ -74,21 +74,21 @@
return
if(!isEmpProof())
if(prob(150/severity))
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
var/list/previous_network = network
network = list()
GLOB.cameranet.removeCamera(src)
stat |= EMPED
set_light(0)
emped = emped+1 //Increase the number of consecutive EMP's
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
var/thisemp = emped //Take note of which EMP this proc is for
spawn(900)
if(!QDELETED(src))
if(emped == thisemp) //Only fix it if the camera hasn't been EMP'd again
network = previous_network
stat &= ~EMPED
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
if(can_use())
GLOB.cameranet.addCamera(src)
emped = 0 //Resets the consecutive EMP count
@@ -243,7 +243,7 @@
new /obj/item/stack/cable_coil(loc, 2)
qdel(src)
-/obj/machinery/camera/update_icon()
+/obj/machinery/camera/update_icon_state()
if(!status)
icon_state = "[initial(icon_state)]1"
else if(stat & EMPED)
@@ -277,7 +277,7 @@
visible_message("\The [src] [change_msg]!")
playsound(loc, toggle_sound, 100, 1)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
// now disconnect anyone using the camera
//Apparently, this will disconnect anyone even if the camera was re-activated.
diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm
index a375e2d929b..1e3d9154d86 100644
--- a/code/game/machinery/camera/camera_assembly.dm
+++ b/code/game/machinery/camera/camera_assembly.dm
@@ -127,12 +127,12 @@
WRENCH_ANCHOR_TO_WALL_MESSAGE
anchored = TRUE
state = ASSEMBLY_WRENCHED
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
auto_turn()
else if(state == ASSEMBLY_WRENCHED)
WRENCH_UNANCHOR_WALL_MESSAGE
anchored = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
state = ASSEMBLY_UNBUILT
else
to_chat(user, "[src] can't fit here!")
@@ -155,7 +155,7 @@
to_chat(user, "You unweld [src] from its place.")
state = ASSEMBLY_WRENCHED
-/obj/item/camera_assembly/update_icon()
+/obj/item/camera_assembly/update_icon_state()
if(anchored)
icon_state = "camera1"
else
diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm
index 6e8c7f4e094..4ca074556e3 100644
--- a/code/game/machinery/cell_charger.dm
+++ b/code/game/machinery/cell_charger.dm
@@ -21,20 +21,13 @@
QDEL_NULL(charging)
return ..()
-/obj/machinery/cell_charger/proc/updateicon()
+/obj/machinery/cell_charger/update_icon_state()
icon_state = "ccharger[charging ? 1 : 0]"
+/obj/machinery/cell_charger/update_overlays()
+ . = ..()
if(charging && !(stat & (BROKEN|NOPOWER)))
- var/newlevel = round(charging.percent() * 4 / 100)
-
- if(chargelevel != newlevel)
- chargelevel = newlevel
-
- overlays.Cut()
- overlays += "ccharger-o[newlevel]"
-
- else
- overlays.Cut()
+ . += "ccharger-o[chargelevel]"
/obj/machinery/cell_charger/examine(mob/user)
. = ..()
@@ -66,8 +59,8 @@
I.forceMove(src)
charging = I
user.visible_message("[user] inserts a cell into the charger.", "You insert a cell into the charger.")
- chargelevel = -1
- updateicon()
+ check_level()
+ update_icon()
else
return ..()
@@ -89,7 +82,7 @@
charging.update_icon()
charging = null
chargelevel = -1
- updateicon()
+ update_icon()
/obj/machinery/cell_charger/attack_hand(mob/user)
if(!charging)
@@ -134,4 +127,11 @@
use_power(200) //this used to use CELLRATE, but CELLRATE is fucking awful. feel free to fix this properly!
charging.give(175) //inefficiency.
- updateicon()
+ if(check_level())
+ update_icon(UPDATE_OVERLAYS)
+
+/obj/machinery/cell_charger/proc/check_level()
+ var/newlevel = round(charging.percent() * 4 / 100)
+ if(chargelevel != newlevel)
+ chargelevel = newlevel
+ return TRUE
diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm
index 599fa5ad2b4..c697a11308a 100644
--- a/code/game/machinery/cloning.dm
+++ b/code/game/machinery/cloning.dm
@@ -523,13 +523,7 @@ GLOBAL_LIST_INIT(cloner_biomass_items, list(\
mess = TRUE
update_icon()
-/obj/machinery/clonepod/update_icon()
- ..()
- cut_overlays()
-
- if(panel_open)
- add_overlay("panel_open")
-
+/obj/machinery/clonepod/update_icon_state()
if(occupant && !(stat & NOPOWER))
icon_state = "pod_cloning"
else if(mess)
@@ -537,6 +531,11 @@ GLOBAL_LIST_INIT(cloner_biomass_items, list(\
else
icon_state = "pod_idle"
+/obj/machinery/clonepod/update_overlays()
+ . = ..()
+ if(panel_open)
+ . += "panel_open"
+
/obj/machinery/clonepod/relaymove(mob/user)
if(user.stat == CONSCIOUS)
go_out()
diff --git a/code/game/machinery/computer/HolodeckControl.dm b/code/game/machinery/computer/HolodeckControl.dm
index 4a6401cce10..90f12c37946 100644
--- a/code/game/machinery/computer/HolodeckControl.dm
+++ b/code/game/machinery/computer/HolodeckControl.dm
@@ -289,7 +289,7 @@
for(var/mob/living/simple_animal/hostile/carp/C in linkedholodeck)
qdel(C)
- holographic_items = A.copy_contents_to(linkedholodeck , 1)
+ holographic_items = A.copy_contents_to(linkedholodeck , 1, perfect_copy = FALSE)
if(emagged)
for(var/obj/item/holo/H in linkedholodeck)
@@ -343,9 +343,9 @@
/turf/simulated/floor/holofloor/carpet/Initialize(mapload)
. = ..()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
-/turf/simulated/floor/holofloor/carpet/update_icon()
+/turf/simulated/floor/holofloor/carpet/update_icon_state()
if(!..())
return 0
if(smoothing_flags & (SMOOTH_CORNERS|SMOOTH_BITMASK))
@@ -594,7 +594,7 @@
ready = !ready
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
var/numbuttons = 0
var/numready = 0
@@ -606,7 +606,7 @@
if(numbuttons == numready)
begin_event()
-/obj/machinery/readybutton/update_icon()
+/obj/machinery/readybutton/update_icon_state()
if(ready)
icon_state = "auth_on"
else
diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm
index e020c89c3b6..0d84fc0d726 100644
--- a/code/game/machinery/computer/ai_core.dm
+++ b/code/game/machinery/computer/ai_core.dm
@@ -24,7 +24,7 @@
return
playsound(loc, P.usesound, 50, 1)
to_chat(user, "You place the circuit board inside the frame.")
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
state = CIRCUIT_CORE
P.forceMove(src)
circuit = P
@@ -38,7 +38,7 @@
if(do_after(user, 20, target = src) && state == SCREWED_CORE && C.use(5))
to_chat(user, "You add cables to the frame.")
state = CABLED_CORE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
else
to_chat(user, "You need five lengths of cable to wire the AI core!")
return
@@ -51,7 +51,7 @@
if(do_after(user, 20, target = src) && state == CABLED_CORE && G.use(2))
to_chat(user, "You put in the glass panel.")
state = GLASS_CORE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
else
to_chat(user, "You need two sheets of reinforced glass to insert them into the AI core!")
return
@@ -119,7 +119,7 @@
M.forceMove(src)
brain = M
to_chat(user, "You add [M.name] to the frame.")
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return
return ..()
@@ -147,7 +147,7 @@
to_chat(user, "You remove the brain.")
brain.forceMove(loc)
brain = null
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/structure/AIcore/screwdriver_act(mob/living/user, obj/item/I)
if(!(state in list(SCREWED_CORE, CIRCUIT_CORE, GLASS_CORE, AI_READY_CORE)))
@@ -185,7 +185,7 @@
if(AI_READY_CORE)
to_chat(user, "You disconnect the monitor.")
state = GLASS_CORE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/structure/AIcore/wirecutter_act(mob/living/user, obj/item/I)
@@ -199,7 +199,7 @@
else
to_chat(user, "You remove the cables.")
state = SCREWED_CORE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( loc )
A.amount = 5
@@ -209,7 +209,7 @@
return
default_unfasten_wrench(user, I, 20)
-/obj/structure/AIcore/update_icon()
+/obj/structure/AIcore/update_icon_state()
switch(state)
if(EMPTY_CORE)
icon_state = "0"
diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm
index 4a558d8eb27..a695b5d4ff0 100644
--- a/code/game/machinery/computer/aifixer.dm
+++ b/code/game/machinery/computer/aifixer.dm
@@ -74,7 +74,7 @@
if("radio")
occupant.aiRadio.disabledAi = !occupant.aiRadio.disabledAi
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
return TRUE
/obj/machinery/computer/aifixer/proc/fix_ai() // Can we fix it? Probrably.
@@ -86,26 +86,22 @@
occupant.updatehealth()
if(occupant.health >= 0 && occupant.stat == DEAD)
occupant.update_revive()
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
sleep(10)
active = FALSE
-/obj/machinery/computer/aifixer/update_icon()
- ..()
- if(stat & (NOPOWER|BROKEN))
- return
+/obj/machinery/computer/aifixer/update_overlays()
+ . = ..()
+ if(active)
+ . += "ai-fixer-on"
+ if(occupant)
+ switch(occupant.stat)
+ if(0)
+ . += "ai-fixer-full"
+ if(2)
+ . += "ai-fixer-404"
else
- var/overlay_layer = LIGHTING_LAYER+0.2 // +0.1 from the default computer overlays
- if(active)
- overlays += image(icon,"ai-fixer-on",overlay_layer)
- if(occupant)
- switch(occupant.stat)
- if(0)
- overlays += image(icon,"ai-fixer-full",overlay_layer)
- if(2)
- overlays += image(icon,"ai-fixer-404",overlay_layer)
- else
- overlays += image(icon,"ai-fixer-empty",overlay_layer)
+ . += "ai-fixer-empty"
/obj/machinery/computer/aifixer/transfer_ai(interaction, mob/user, mob/living/silicon/ai/AI, obj/item/aicard/card)
if(!..())
@@ -121,7 +117,7 @@
AI.aiRadio.disabledAi = TRUE
to_chat(AI, "You have been uploaded to a stationary terminal. Sadly, there is no remote access from here.")
to_chat(user, "Transfer successful: [AI.name] ([rand(1000,9999)].exe) installed and executed successfully. Local copy has been removed.")
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
else //Uploading AI from terminal to card
if(occupant && !active)
@@ -129,7 +125,7 @@
to_chat(user, "Transfer successful: [occupant.name] ([rand(1000,9999)].exe) removed from host terminal and stored within local memory.")
occupant.forceMove(card)
occupant = null
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
else if(active)
to_chat(user, "ERROR: Reconstruction in progress.")
else if(!occupant)
diff --git a/code/game/machinery/computer/atmos_alert.dm b/code/game/machinery/computer/atmos_alert.dm
index 8d54f21ad0f..6394bcf0757 100644
--- a/code/game/machinery/computer/atmos_alert.dm
+++ b/code/game/machinery/computer/atmos_alert.dm
@@ -79,7 +79,7 @@
minor_alarms += zone
update_icon()
-/obj/machinery/computer/atmos_alert/update_icon()
+/obj/machinery/computer/atmos_alert/update_icon_state()
if(length(priority_alarms))
icon_screen = "alert:2"
else if(length(minor_alarms))
diff --git a/code/game/machinery/computer/atmos_control.dm b/code/game/machinery/computer/atmos_control.dm
index 6be347e34e8..762cdfaf05e 100644
--- a/code/game/machinery/computer/atmos_control.dm
+++ b/code/game/machinery/computer/atmos_control.dm
@@ -25,7 +25,7 @@
// 16 for nitrogen concentration
// 32 for carbon dioxide concentration
-/obj/machinery/air_sensor/update_icon()
+/obj/machinery/air_sensor/update_icon_state()
icon_state = "gsensor[on]"
/obj/machinery/air_sensor/multitool_menu(mob/user, obj/item/multitool/P)
diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm
index dc52ca7aab1..59a12849629 100644
--- a/code/game/machinery/computer/buildandrepair.dm
+++ b/code/game/machinery/computer/buildandrepair.dm
@@ -457,8 +457,7 @@
if(state == STATE_GLASS)
new /obj/item/stack/sheet/glass(location, 2)
-/obj/structure/computerframe/update_icon()
- . = ..()
+/obj/structure/computerframe/update_icon_state()
icon_state = "comp_frame_[state]"
/obj/structure/computerframe/welder_act(mob/user, obj/item/I)
diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm
index 715c136a004..ab3716ca83f 100644
--- a/code/game/machinery/computer/computer.dm
+++ b/code/game/machinery/computer/computer.dm
@@ -67,24 +67,24 @@
update_icon()
flickering = FALSE
-/obj/machinery/computer/update_icon()
- cut_overlays()
+/obj/machinery/computer/update_overlays()
+ . = ..()
underlays.Cut()
if((stat & NOPOWER) || force_no_power_icon_state)
if(icon_keyboard)
- add_overlay("[icon_keyboard]_off")
+ . += "[icon_keyboard]_off"
return
// This whole block lets screens and keyboards ignore lighting and be visible even in the darkest room
var/overlay_state = icon_screen
if(stat & BROKEN)
overlay_state = "[icon_state]_broken"
- add_overlay("[overlay_state]")
+ . += "[overlay_state]"
if(!(stat & BROKEN) && light)
underlays += emissive_appearance(icon, "[icon_state]_lightmask")
if(icon_keyboard)
- add_overlay("[icon_keyboard]")
+ . += "[icon_keyboard]"
underlays += emissive_appearance(icon, "[icon_keyboard]_lightmask")
/obj/machinery/computer/power_change()
diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm
index 51bf18716dc..2f33ea3fac0 100644
--- a/code/game/machinery/computer/message.dm
+++ b/code/game/machinery/computer/message.dm
@@ -81,14 +81,12 @@
else
to_chat(user, "A no server error appears on the screen.")
-/obj/machinery/computer/message_monitor/update_icon()
+/obj/machinery/computer/message_monitor/update_icon_state()
if(emag || hacking)
icon_screen = hack_icon
else
icon_screen = normal_icon
- ..()
-
/obj/machinery/computer/message_monitor/attack_hand(mob/user as mob)
if(..())
return
diff --git a/code/game/machinery/computer/station_alert.dm b/code/game/machinery/computer/station_alert.dm
index e3abb5b4842..61b7b2e8e0e 100644
--- a/code/game/machinery/computer/station_alert.dm
+++ b/code/game/machinery/computer/station_alert.dm
@@ -72,7 +72,7 @@
return
update_icon()
-/obj/machinery/computer/station_alert/update_icon()
+/obj/machinery/computer/station_alert/update_icon_state()
var/active_alarms = FALSE
var/list/list/temp_alarm_list = SSalarm.alarms.Copy()
for(var/cat in temp_alarm_list)
@@ -92,5 +92,3 @@
icon_screen = "alert:2"
else
icon_screen = "alert:0"
-
- ..()
diff --git a/code/game/machinery/dance_machine.dm b/code/game/machinery/dance_machine.dm
index da1f02f00ba..5bed31038cc 100644
--- a/code/game/machinery/dance_machine.dm
+++ b/code/game/machinery/dance_machine.dm
@@ -70,13 +70,11 @@
WRENCH_UNANCHOR_MESSAGE
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
-/obj/machinery/disco/update_icon()
+/obj/machinery/disco/update_icon_state()
if(active)
icon_state = "disco1"
else
icon_state = "disco0"
- ..()
-
/obj/machinery/disco/attack_hand(mob/user)
if(..())
@@ -127,7 +125,7 @@
playsound(src, 'sound/misc/compiler-failure.ogg', 50, 1)
return
active = TRUE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
dance_setup()
START_PROCESSING(SSobj, src)
lights_spin()
diff --git a/code/game/machinery/defib_mount.dm b/code/game/machinery/defib_mount.dm
index fe333ebf4ef..e64d443a9c6 100644
--- a/code/game/machinery/defib_mount.dm
+++ b/code/game/machinery/defib_mount.dm
@@ -37,7 +37,7 @@
/obj/machinery/defibrillator_mount/loaded/Initialize(mapload) //loaded subtype for mapping use
. = ..()
defib = new/obj/item/defibrillator/loaded(src)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/machinery/defibrillator_mount/Destroy()
QDEL_NULL(defib)
@@ -58,19 +58,19 @@
if(defib && defib.cell && defib.cell.charge < defib.cell.maxcharge && is_operational())
use_power(200)
defib.cell.give(180) //90% efficiency, slightly better than the cell charger's 87.5%
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
-/obj/machinery/defibrillator_mount/update_icon()
- cut_overlays()
+/obj/machinery/defibrillator_mount/update_overlays()
+ . = ..()
if(defib)
- add_overlay("defib")
+ . += "defib"
if(defib.powered)
- add_overlay(defib.safety ? "online" : "emagged")
+ . += "[defib.safety ? "online" : "emagged"]"
var/ratio = defib.cell.charge / defib.cell.maxcharge
ratio = CEILING(ratio * 4, 1) * 25
- add_overlay("charge[ratio]")
+ . += "charge[ratio]"
if(clamps_locked)
- add_overlay("clamps")
+ . += "clamps"
//defib interaction
/obj/machinery/defibrillator_mount/attack_hand(mob/living/user)
@@ -95,7 +95,7 @@
"You press [I] into the mount, and it clicks into place.")
playsound(src, 'sound/machines/click.ogg', 50, TRUE)
defib = I
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
return
else if(defib && I == defib.paddles)
user.drop_item()
@@ -108,7 +108,7 @@
return
clamps_locked = !clamps_locked
to_chat(user, "Clamps [clamps_locked ? "" : "dis"]engaged.")
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
else
to_chat(user, "Insufficient access.")
return
@@ -143,7 +143,7 @@
"You slide out [defib] from [src] and unhook the charging cables.")
playsound(src, 'sound/items/deconstruct.ogg', 50, TRUE)
defib = null
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
//wallframe, for attaching the mounts easily
/obj/item/mounted/frame/defib_mount
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 336e33aa68f..8af106feae7 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -330,8 +330,14 @@ GLOBAL_LIST_EMPTY(airlock_overlays)
if(AIRLOCK_OPEN, AIRLOCK_CLOSED)
if(AIRLOCK_DENY, AIRLOCK_OPENING, AIRLOCK_CLOSING, AIRLOCK_EMAG)
icon_state = "nonexistenticonstate" //MADNESS
+
+ . = ..(UPDATE_ICON_STATE) // Sent after the icon_state is changed
+
set_airlock_overlays(state)
+/obj/machinery/door/airlock/update_icon_state()
+ return
+
/obj/machinery/door/airlock/proc/set_airlock_overlays(state)
var/image/frame_overlay
var/image/filling_overlay
@@ -1380,9 +1386,13 @@ GLOBAL_LIST_EMPTY(airlock_overlays)
/obj/machinery/door/airlock/proc/note_type() //Returns a string representing the type of note pinned to this airlock
if(!note)
return
- else if(istype(note, /obj/item/paper))
- return "note"
- else if(istype(note, /obj/item/photo))
+ if(istype(note, /obj/item/paper))
+ var/obj/item/paper/pinned_paper = note
+ if(pinned_paper.info)
+ return "note_words"
+ else
+ return "note"
+ if(istype(note, /obj/item/photo))
return "photo"
//Removes the current note on the door if any. Returns if a note is removed
diff --git a/code/game/machinery/doors/airlock_control.dm b/code/game/machinery/doors/airlock_control.dm
index 6df716b4664..7f23df56feb 100644
--- a/code/game/machinery/doors/airlock_control.dm
+++ b/code/game/machinery/doors/airlock_control.dm
@@ -155,7 +155,7 @@
var/alert = 0
var/previousPressure
-/obj/machinery/airlock_sensor/update_icon()
+/obj/machinery/airlock_sensor/update_icon_state()
if(on)
if(alert)
icon_state = "airlock_sensor_alert"
@@ -191,7 +191,7 @@
alert = (pressure < ONE_ATMOSPHERE*0.8)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/airlock_sensor/set_frequency(new_frequency)
SSradio.remove_object(src, frequency)
@@ -226,7 +226,7 @@
var/command = "cycle"
var/on = TRUE
-/obj/machinery/access_button/update_icon()
+/obj/machinery/access_button/update_icon_state()
if(on)
icon_state = "access_button_standby"
else
diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm
index 1693af08f6f..0163edf9f24 100644
--- a/code/game/machinery/doors/brigdoors.dm
+++ b/code/game/machinery/doors/brigdoors.dm
@@ -142,9 +142,9 @@
if(T.id == id)
targets += T
- if(targets.len==0)
+ if(!length(targets))
stat |= BROKEN
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/door_timer/Destroy()
QDEL_NULL(Radio)
@@ -165,7 +165,7 @@
timer_end() // open doors, reset timer, clear status screen
timing = FALSE
. = PROCESS_KILL
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
else
timer_end()
return PROCESS_KILL
@@ -173,7 +173,7 @@
// has the door power situation changed, if so update icon.
/obj/machinery/door_timer/power_change()
..()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
// open/closedoor checks if door_timer has power, if so it checks if the
@@ -358,7 +358,7 @@
prisoner_time = null
timing = TRUE
timer_start()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
if("restart_timer")
if(timing)
var/reset_reason = sanitize(copytext(input(usr, "Reason for resetting timer:", name, "") as text|null, 1, MAX_MESSAGE_LEN))
@@ -395,7 +395,7 @@
// if NOPOWER, display blank
// if BROKEN, display blue screen of death icon AI uses
// if timing=true, run update display function
-/obj/machinery/door_timer/update_icon()
+/obj/machinery/door_timer/update_icon_state()
if(stat & (NOPOWER))
icon_state = "frame"
return
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index 558e4ab8aa4..b679b848007 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -149,26 +149,34 @@
var/mob/living/simple_animal/bot/B = user
B.door_opened(src)
else
+ if(pry_open_check(user))
+ return
do_animate("deny")
- if(HAS_TRAIT(user, TRAIT_FORCE_DOORS))
- var/datum/antagonist/vampire/V = user.mind.has_antag_datum(/datum/antagonist/vampire)
- if(V && HAS_TRAIT_FROM(user, TRAIT_FORCE_DOORS, VAMPIRE_TRAIT))
- if(!V.bloodusable)
- REMOVE_TRAIT(user, TRAIT_FORCE_DOORS, VAMPIRE_TRAIT)
- return
- if(welded)
- to_chat(user, "The door is welded.")
- return
- if(locked)
- to_chat(user, "The door is bolted.")
- return
- if(density)
- visible_message("[user] forces the door open!")
- playsound(loc, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
- open(TRUE)
- if(V && HAS_TRAIT_FROM(user, TRAIT_FORCE_DOORS, VAMPIRE_TRAIT))
- V.bloodusable = max(V.bloodusable - 5, 0)
+/obj/machinery/door/proc/pry_open_check(mob/user)
+ . = TRUE
+ if(isterrorspider(user))
+ return
+
+ if(!HAS_TRAIT(user, TRAIT_FORCE_DOORS))
+ return FALSE
+ var/datum/antagonist/vampire/V = user.mind?.has_antag_datum(/datum/antagonist/vampire)
+ if(V && HAS_TRAIT_FROM(user, TRAIT_FORCE_DOORS, VAMPIRE_TRAIT))
+ if(!V.bloodusable)
+ REMOVE_TRAIT(user, TRAIT_FORCE_DOORS, VAMPIRE_TRAIT)
+ return FALSE
+ if(welded)
+ to_chat(user, "The door is welded.")
+ return FALSE
+ if(locked)
+ to_chat(user, "The door is bolted.")
+ return FALSE
+ if(density)
+ visible_message("[user] forces the door open!")
+ playsound(loc, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
+ open(TRUE)
+ if(V && HAS_TRAIT_FROM(user, TRAIT_FORCE_DOORS, VAMPIRE_TRAIT))
+ V.bloodusable = max(V.bloodusable - 5, 0)
/obj/machinery/door/attack_ai(mob/user)
return attack_hand(user)
@@ -194,7 +202,7 @@
open()
else
close()
- return
+ return TRUE
if(density)
do_animate("deny")
@@ -259,11 +267,8 @@
emagged = TRUE
return TRUE
-/obj/machinery/door/update_icon()
- if(density)
- icon_state = "door1"
- else
- icon_state = "door0"
+/obj/machinery/door/update_icon_state()
+ icon_state = "door[density]"
/obj/machinery/door/proc/do_animate(animation)
switch(animation)
diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm
index f1d09a69a07..407287e54e6 100644
--- a/code/game/machinery/doors/firedoor.dm
+++ b/code/game/machinery/doors/firedoor.dm
@@ -200,18 +200,21 @@
flick("door_closing", src)
playsound(src, 'sound/machines/airlock_ext_close.ogg', 30, 1)
-/obj/machinery/door/firedoor/update_icon()
- overlays.Cut()
- if(active_alarm && hasPower())
- overlays += image('icons/obj/doors/doorfire.dmi', "alarmlights")
+/obj/machinery/door/firedoor/update_icon_state()
if(density)
icon_state = "door_closed"
- if(welded)
- overlays += "welded"
else
icon_state = "door_open"
- if(welded)
- overlays += "welded_open"
+
+/obj/machinery/door/firedoor/update_overlays()
+ . = ..()
+ if(active_alarm && hasPower())
+ . += image('icons/obj/doors/doorfire.dmi', "alarmlights")
+ if(density && welded)
+ . += "welded"
+ return
+ if(welded)
+ . += "welded_open"
/obj/machinery/door/firedoor/proc/activate_alarm()
active_alarm = TRUE
@@ -344,8 +347,7 @@
if(CONSTRUCTION_NOCIRCUIT)
. += "There are no firelock electronics in the frame. The frame could be cut apart."
-/obj/structure/firelock_frame/update_icon()
- ..()
+/obj/structure/firelock_frame/update_icon_state()
icon_state = "frame[constructionStep]"
/obj/structure/firelock_frame/attackby(obj/item/C, mob/user)
diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm
index be6880f5a3c..cb6318e930f 100644
--- a/code/game/machinery/doors/poddoor.dm
+++ b/code/game/machinery/doors/poddoor.dm
@@ -50,7 +50,7 @@
flick("closing", src)
playsound(src, 'sound/machines/blastdoor.ogg', 30, 1)
-/obj/machinery/door/poddoor/update_icon()
+/obj/machinery/door/poddoor/update_icon_state()
if(density)
icon_state = "closed"
else
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm
index 39d8fc9bbf1..4b213746a73 100644
--- a/code/game/machinery/doors/windowdoor.dm
+++ b/code/game/machinery/doors/windowdoor.dm
@@ -28,7 +28,6 @@
/obj/machinery/door/window/Initialize(mapload)
. = ..()
if(req_access && req_access.len)
- icon_state = "[icon_state]"
base_state = icon_state
/obj/machinery/door/window/Destroy()
@@ -38,7 +37,7 @@
QDEL_NULL(electronics)
return ..()
-/obj/machinery/door/window/update_icon()
+/obj/machinery/door/window/update_icon_state()
if(density)
icon_state = base_state
else
diff --git a/code/game/machinery/dye_generator.dm b/code/game/machinery/dye_generator.dm
index 47bdbd80385..fb2551c3e45 100644
--- a/code/game/machinery/dye_generator.dm
+++ b/code/game/machinery/dye_generator.dm
@@ -24,19 +24,19 @@
else
stat |= NOPOWER
set_light(0)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/machinery/dye_generator/extinguish_light()
set_light(0)
underlays.Cut()
-/obj/machinery/dye_generator/update_icon()
- cut_overlays()
+/obj/machinery/dye_generator/update_overlays()
+ . = ..()
underlays.Cut()
if(stat & (BROKEN|NOPOWER))
- add_overlay("barbervend_off")
+ . += "barbervend_off"
if(stat & BROKEN)
- add_overlay("barbervend_broken")
+ . += "barbervend_broken"
if(light)
underlays += emissive_appearance(icon, "barbervend_lightmask")
@@ -58,14 +58,14 @@
var/obj/item/hair_dye_bottle/HD = I
user.visible_message("[user] fills [HD] up with some dye.","You fill [HD] up with some hair dye.")
HD.dye_color = dye_color
- HD.update_dye_overlay()
+ HD.update_icon()
return
return ..()
/obj/machinery/dye_generator/obj_break(damage_flag)
if(!(stat & BROKEN))
stat |= BROKEN
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
//Hair Dye Bottle
@@ -83,13 +83,13 @@
/obj/item/hair_dye_bottle/New()
..()
- update_dye_overlay()
+ update_icon(UPDATE_OVERLAYS)
-/obj/item/hair_dye_bottle/proc/update_dye_overlay()
- overlays.Cut()
+/obj/item/hair_dye_bottle/update_overlays()
+ . = ..()
var/image/I = new('icons/obj/items.dmi', "hairdyebottle-overlay")
I.color = dye_color
- overlays += I
+ . += I
/obj/item/hair_dye_bottle/attack(mob/living/carbon/M, mob/user)
if(user.a_intent != INTENT_HELP)
diff --git a/code/game/machinery/embedded_controller/airlock_controllers.dm b/code/game/machinery/embedded_controller/airlock_controllers.dm
index 8766864bdc1..51e2a632a93 100644
--- a/code/game/machinery/embedded_controller/airlock_controllers.dm
+++ b/code/game/machinery/embedded_controller/airlock_controllers.dm
@@ -75,7 +75,7 @@
name = "Access Controller"
tag_secure = 1
-/obj/machinery/embedded_controller/radio/airlock/access_controller/update_icon()
+/obj/machinery/embedded_controller/radio/airlock/access_controller/update_icon_state()
if(on && program)
if(program.memory["processing"])
icon_state = "access_control_process"
diff --git a/code/game/machinery/embedded_controller/embedded_controller_base.dm b/code/game/machinery/embedded_controller/embedded_controller_base.dm
index 8e12c17bf7e..36d75590e09 100644
--- a/code/game/machinery/embedded_controller/embedded_controller_base.dm
+++ b/code/game/machinery/embedded_controller/embedded_controller_base.dm
@@ -10,7 +10,7 @@
var/on = TRUE
/obj/machinery/embedded_controller/proc/post_signal(datum/signal/signal, comm_line)
- return 0
+ return FALSE
/obj/machinery/embedded_controller/receive_signal(datum/signal/signal, receive_method, receive_param)
if(!signal || signal.encryption) return
@@ -23,7 +23,7 @@
if(program)
program.process()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
src.updateDialog()
/obj/machinery/embedded_controller/attack_ghost(mob/user as mob)
@@ -60,7 +60,7 @@
radio_connection = null
return ..()
-/obj/machinery/embedded_controller/radio/update_icon()
+/obj/machinery/embedded_controller/radio/update_icon_state()
if(on && program)
if(program.memory["processing"])
icon_state = "airlock_control_process"
diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm
index 21a9bbff988..3a42aabf1af 100644
--- a/code/game/machinery/firealarm.dm
+++ b/code/game/machinery/firealarm.dm
@@ -44,13 +44,7 @@ FIRE ALARM
report_fire_alarms = FALSE
show_alert_level = FALSE
-/obj/machinery/firealarm/update_icon()
- underlays.Cut()
- if(light)
- if(overlays)
- underlays += emissive_appearance(icon, "firealarm_overlay_lightmask")
- if(!wiresexposed)
- underlays += emissive_appearance(icon, "firealarm_lightmask")
+/obj/machinery/firealarm/update_icon_state()
if(wiresexposed)
icon_state = "firealarm_b[buildstage]"
return
@@ -63,6 +57,17 @@ FIRE ALARM
else
icon_state = "firealarm_on"
+/obj/machinery/firealarm/update_overlays()
+ . = ..()
+ underlays.Cut()
+ if(is_station_contact(z) && show_alert_level)
+ if(GLOB.security_level)
+ . += "overlay_[get_security_level()]"
+ if(light)
+ underlays += emissive_appearance(icon, "firealarm_overlay_lightmask")
+ if(light && !wiresexposed)
+ underlays += emissive_appearance(icon, "firealarm_lightmask")
+
/obj/machinery/firealarm/emag_act(mob/user)
if(!emagged)
emagged = TRUE
@@ -271,12 +276,6 @@ FIRE ALARM
setDir(direction)
set_pixel_offsets_from_dir(26, -26, 26, -26)
- if(is_station_contact(z) && show_alert_level)
- if(GLOB.security_level)
- overlays += image('icons/obj/monitors.dmi', "overlay_[get_security_level()]")
- else
- overlays += image('icons/obj/monitors.dmi', "overlay_green")
-
myArea = get_area(src)
LAZYADD(myArea.firealarms, src)
diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm
index 8c4df9e9efa..4ed612a9cf2 100644
--- a/code/game/machinery/floodlight.dm
+++ b/code/game/machinery/floodlight.dm
@@ -26,20 +26,21 @@
QDEL_NULL(cell)
return ..()
-/obj/machinery/floodlight/proc/updateicon()
+/obj/machinery/floodlight/update_icon_state()
icon_state = "flood[open ? "o" : ""][open && cell ? "b" : ""]0[on]"
/obj/machinery/floodlight/process()
if(!cell && on)
on = FALSE
visible_message("[src] shuts down due to lack of power!")
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
set_light(0)
+ return
if(on)
cell.charge -= use
if(cell.charge <= 0)
on = FALSE
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
set_light(0)
visible_message("[src] shuts down due to lack of power!")
@@ -55,7 +56,7 @@
cell.loc = loc
cell.add_fingerprint(user)
- cell.update_icon()
+ cell.update_icon(UPDATE_ICON_STATE)
cell = null
to_chat(user, "You remove the power cell.")
@@ -63,7 +64,7 @@
on = FALSE
visible_message("[src] shuts down due to lack of power!")
set_light(0)
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
return
if(on)
@@ -79,7 +80,7 @@
to_chat(user, "You turn on the light.")
set_light(brightness_on)
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/floodlight/proc/mapVarInit()
if(on)
@@ -88,7 +89,7 @@
if(cell.charge <= 0)
return
set_light(brightness_on)
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/floodlight/attackby(obj/item/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/wrench))
@@ -106,7 +107,7 @@
" You have loosened \the [src]'s casters.", \
"You hear ratchet.")
anchored = FALSE
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
return
if(istype(W, /obj/item/screwdriver))
if(!open)
@@ -116,19 +117,18 @@
else
unlocked = TRUE
to_chat(user, "You unscrew the battery panel.")
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
return
if(istype(W, /obj/item/crowbar))
if(unlocked)
if(open)
open = FALSE
- overlays = null
to_chat(user, "You crowbar the battery panel in place.")
else
if(unlocked)
open = TRUE
to_chat(user, "You remove the battery panel.")
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
return
if(istype(W, /obj/item/stock_parts/cell))
if(open)
@@ -139,11 +139,11 @@
W.loc = src
cell = W
to_chat(user, "You insert the power cell.")
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
return
return ..()
/obj/machinery/floodlight/extinguish_light()
on = FALSE
set_light(0)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
diff --git a/code/game/machinery/gameboard.dm b/code/game/machinery/gameboard.dm
index e631d30dcb6..8c289849eeb 100644
--- a/code/game/machinery/gameboard.dm
+++ b/code/game/machinery/gameboard.dm
@@ -20,13 +20,13 @@
/obj/machinery/gameboard/power_change()
. = ..()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
if(stat & NOPOWER)
set_light(0)
else
set_light(3, 3)
-/obj/machinery/gameboard/update_icon()
+/obj/machinery/gameboard/update_icon_state()
if(stat & NOPOWER)
icon_state = "gboard_off"
else
diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm
index ec2fdbfcf88..18037dd5b28 100644
--- a/code/game/machinery/hologram.dm
+++ b/code/game/machinery/hologram.dm
@@ -290,7 +290,7 @@ GLOBAL_LIST_EMPTY(holopads)
playsound(src, 'sound/machines/twobeep.ogg', 100) //bring, bring!
ringing = TRUE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
//Try to transfer hologram to another pad that can project on T
@@ -405,13 +405,11 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
active_power_usage = HOLOPAD_PASSIVE_POWER_USAGE + (HOLOGRAM_POWER_USAGE * total_users)
if(total_users)
set_light(2)
- icon_state = "holopad1"
else
set_light(0)
- icon_state = "holopad0"
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
-/obj/machinery/hologram/holopad/update_icon()
+/obj/machinery/hologram/holopad/update_icon_state()
var/total_users = LAZYLEN(masters) + LAZYLEN(holo_calls)
if(icon_state == "holopad_open")
return
diff --git a/code/game/machinery/holosign.dm b/code/game/machinery/holosign.dm
index ca62fab70ad..e5a30cf9733 100644
--- a/code/game/machinery/holosign.dm
+++ b/code/game/machinery/holosign.dm
@@ -14,9 +14,9 @@
if(stat & (BROKEN|NOPOWER))
return
lit = !lit
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
-/obj/machinery/holosign/update_icon()
+/obj/machinery/holosign/update_icon_state()
if(!lit)
icon_state = "sign_off"
else
@@ -25,7 +25,7 @@
/obj/machinery/holosign/power_change()
if(stat & NOPOWER)
lit = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/holosign/surgery
name = "surgery holosign"
diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm
index 344bca5167a..c9bd1ab6360 100644
--- a/code/game/machinery/iv_drip.dm
+++ b/code/game/machinery/iv_drip.dm
@@ -11,19 +11,18 @@
/obj/machinery/iv_drip/process()
if(istype(bag) && bag.injection_target)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
return
return PROCESS_KILL
-/obj/machinery/iv_drip/update_icon()
- cut_overlays()
-
+/obj/machinery/iv_drip/update_overlays()
+ . = ..()
if(bag)
- add_overlay("hangingbag")
+ . += "hangingbag"
if(bag.reagents.total_volume)
var/image/filling = image('icons/goonstation/objects/iv.dmi', src, "hangingbag-fluid")
filling.icon += mix_color_from_reagents(bag.reagents.reagent_list)
- add_overlay(filling)
+ . += filling
/obj/machinery/iv_drip/MouseDrop(mob/living/target)
if(usr.incapacitated())
@@ -39,9 +38,9 @@
/obj/machinery/iv_drip/attack_hand(mob/user)
if(bag)
user.put_in_hands(bag)
- bag.update_icon()
+ bag.update_icon(UPDATE_OVERLAYS)
bag = null
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/machinery/iv_drip/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/reagent_containers/iv_bag))
@@ -54,12 +53,12 @@
I.forceMove(src)
bag = I
to_chat(user, "You attach [I] to [src].")
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
START_PROCESSING(SSmachines, src)
else if (bag && istype(I, /obj/item/reagent_containers))
bag.attackby(I)
I.afterattack(bag, usr, TRUE)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
else
return ..()
diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm
index 68304cdedec..f48c3451a1c 100644
--- a/code/game/machinery/lightswitch.dm
+++ b/code/game/machinery/lightswitch.dm
@@ -44,7 +44,7 @@
name = "light switch([area.name])"
src.on = src.area.lightswitch
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/light_switch/Initialize()
..()
@@ -63,18 +63,15 @@
radio_connection = null
return ..()
-/obj/machinery/light_switch/proc/updateicon()
+/obj/machinery/light_switch/update_icon_state()
if(stat & NOPOWER)
icon_state = "light-p"
- else
- if(on)
- icon_state = "light1"
- else
- icon_state = "light0"
+ return
+ icon_state = "light[on]"
/obj/machinery/light_switch/examine(mob/user)
. = ..()
- . += "A light switch. It is [on? "on" : "off"]."
+ . += "A light switch. It is [on ? "on" : "off"]."
/obj/machinery/light_switch/attack_ghost(mob/user)
if(user.can_advanced_admin_interact())
@@ -83,11 +80,11 @@
/obj/machinery/light_switch/attack_hand(mob/user)
on = !on
playsound(src, 'sound/machines/lightswitch.ogg', 10, TRUE)
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
if(light_connect)
area.lightswitch = on
- area.updateicon()
+ area.update_icon(UPDATE_ICON_STATE)
if(logic_connect && powered(LIGHT)) //Don't bother sending a signal if we aren't set to send them or we have no power to send with.
handle_output()
@@ -95,7 +92,7 @@
if(light_connect)
for(var/obj/machinery/light_switch/L in area)
L.on = on
- L.updateicon()
+ L.update_icon(UPDATE_ICON_STATE)
area.power_change()
@@ -135,7 +132,7 @@
else
stat |= NOPOWER
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/light_switch/emp_act(severity)
if(stat & (BROKEN|NOPOWER))
diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm
index 15636bb9383..ff2757a707e 100644
--- a/code/game/machinery/magnet.dm
+++ b/code/game/machinery/magnet.dm
@@ -44,20 +44,11 @@
// update the invisibility and icon
/obj/machinery/magnetic_module/hide(intact)
invisibility = intact ? INVISIBILITY_MAXIMUM : 0
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
- // update the icon_state
-/obj/machinery/magnetic_module/proc/updateicon()
- var/state="floor_magnet"
- var/onstate=""
- if(!on)
- onstate="0"
-
- if(invisibility)
- icon_state = "[state][onstate]-f" // if invisible, set icon to faded version
+/obj/machinery/magnetic_module/update_icon_state()
+ icon_state = "floor_magnet[on ? "" : "0"][invisibility ? "-f" : ""]" // if invisible, set icon to faded version
// in case of being revealed by T-scanner
- else
- icon_state = "[state][onstate]"
/obj/machinery/magnetic_module/receive_signal(datum/signal/signal)
var/command = signal.data["command"]
@@ -149,7 +140,7 @@
active_power_usage = electricity_level*15
else
use_power = 0
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/magnetic_module/proc/magnetic_process() // proc that actually does the pulling
diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm
index 7cfa60344e3..70256099b9e 100644
--- a/code/game/machinery/navbeacon.dm
+++ b/code/game/machinery/navbeacon.dm
@@ -76,17 +76,11 @@
// hide the object if turf is intact
/obj/machinery/navbeacon/hide(intact)
invisibility = intact ? INVISIBILITY_MAXIMUM : 0
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
-// update the icon_state
-/obj/machinery/navbeacon/proc/updateicon()
- var/state="navbeacon[open]"
-
- if(invisibility)
- icon_state = "[state]-f" // if invisible, set icon to faded version
- // in case revealed by T-scanner
- else
- icon_state = "[state]"
+/obj/machinery/navbeacon/update_icon_state()
+ icon_state = "navbeacon[open][invisibility ? "-f" : ""]" // if invisible, set icon to faded version
+ // in case revealed by T-scanner
/obj/machinery/navbeacon/attackby(obj/item/I, mob/user, params)
var/turf/T = loc
@@ -98,7 +92,7 @@
user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.")
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
else if(istype(I, /obj/item/card/id) || istype(I, /obj/item/pda))
if(open)
@@ -221,4 +215,4 @@ Transponder Codes:
"}
/obj/machinery/navbeacon/invisible/hide(intact)
invisibility = INVISIBILITY_MAXIMUM
- updateicon()
+ update_icon(UPDATE_ICON_STATE)
diff --git a/code/game/machinery/portable_tag_turret.dm b/code/game/machinery/portable_tag_turret.dm
index ce00bb3fe27..7a9e1e88dbf 100644
--- a/code/game/machinery/portable_tag_turret.dm
+++ b/code/game/machinery/portable_tag_turret.dm
@@ -37,7 +37,7 @@
)
return data
-/obj/machinery/porta_turret/tag/update_icon()
+/obj/machinery/porta_turret/tag/update_icon_state()
if(!anchored)
icon_state = "turretCover"
return
diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm
index 03a6c76ea17..ab4c5362ba2 100644
--- a/code/game/machinery/portable_turret.dm
+++ b/code/game/machinery/portable_turret.dm
@@ -147,7 +147,7 @@
eshot_sound = 'sound/weapons/pulse.ogg'
GLOBAL_LIST_EMPTY(turret_icons)
-/obj/machinery/porta_turret/update_icon()
+/obj/machinery/porta_turret/update_icon_state()
if(!GLOB.turret_icons)
GLOB.turret_icons = list()
GLOB.turret_icons["open"] = image(icon, "openTurretCover")
@@ -321,7 +321,7 @@ GLOBAL_LIST_EMPTY(turret_icons)
stat &= ~NOPOWER
else
stat |= NOPOWER
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/porta_turret/attackby(obj/item/I, mob/user)
@@ -364,16 +364,10 @@ GLOBAL_LIST_EMPTY(turret_icons)
wrenching = TRUE
if(do_after(user, 50 * I.toolspeed, target = src))
//This code handles moving the turret around. After all, it's a portable turret!
- if(!anchored)
- playsound(loc, I.usesound, 100, 1)
- anchored = TRUE
- update_icon()
- to_chat(user, "You secure the exterior bolts on the turret.")
- else if(anchored)
- playsound(loc, I.usesound, 100, 1)
- anchored = FALSE
- to_chat(user, "You unsecure the exterior bolts on the turret.")
- update_icon()
+ playsound(loc, I.usesound, 100, 1)
+ anchored = !anchored
+ update_icon(UPDATE_ICON_STATE)
+ to_chat(user, "You [anchored ? "" : "un"]secure the exterior bolts on the turret.")
wrenching = FALSE
else if(istype(I, /obj/item/card/id) || istype(I, /obj/item/pda))
@@ -499,7 +493,7 @@ GLOBAL_LIST_EMPTY(turret_icons)
stat |= BROKEN //enables the BROKEN bit
if(spark_system)
spark_system.start() //creates some sparks because they look cool
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/porta_turret/process()
//the main machinery process
@@ -651,7 +645,7 @@ GLOBAL_LIST_EMPTY(turret_icons)
/obj/machinery/porta_turret/proc/pop_up() //pops the turret up
set_raised_raising(raised, TRUE)
playsound(get_turf(src), 'sound/effects/turret/open.wav', 60, 1)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
var/atom/flick_holder = new /atom/movable/porta_turret_cover(loc)
flick_holder.layer = layer + 0.1
@@ -660,7 +654,7 @@ GLOBAL_LIST_EMPTY(turret_icons)
qdel(flick_holder)
set_raised_raising(TRUE, FALSE)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/porta_turret/proc/pop_down() //pops the turret down
last_target = null
@@ -672,7 +666,7 @@ GLOBAL_LIST_EMPTY(turret_icons)
return
set_raised_raising(raised, TRUE)
playsound(get_turf(src), 'sound/effects/turret/open.wav', 60, 1)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
var/atom/flick_holder = new /atom/movable/porta_turret_cover(loc)
flick_holder.layer = layer + 0.1
@@ -682,7 +676,7 @@ GLOBAL_LIST_EMPTY(turret_icons)
set_raised_raising(FALSE, FALSE)
set_angle(0)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/porta_turret/on_assess_perp(mob/living/carbon/human/perp)
if((check_access || attacked) && !allowed(perp))
@@ -722,7 +716,7 @@ GLOBAL_LIST_EMPTY(turret_icons)
if(!istype(T) || !istype(U))
return
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
var/obj/item/projectile/A
if(emagged || lethal)
if(eprojectile)
@@ -1059,7 +1053,7 @@ GLOBAL_LIST_EMPTY(turret_icons)
req_access = list(ACCESS_SYNDICATE)
one_access = FALSE
-/obj/machinery/porta_turret/syndicate/update_icon()
+/obj/machinery/porta_turret/syndicate/update_icon_state()
if(stat & BROKEN)
icon_state = icon_state_destroyed
else if(enabled)
diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm
index d5a7f5bf8a7..03649e3f82e 100644
--- a/code/game/machinery/recharger.dm
+++ b/code/game/machinery/recharger.dm
@@ -59,7 +59,7 @@
charging = G
use_power = ACTIVE_POWER_USE
using_power = check_cell_needs_recharging(get_cell_from(G))
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
else
to_chat(user, "[src] isn't connected to anything!")
return TRUE
@@ -97,7 +97,7 @@
user.put_in_hands(charging)
charging = null
use_power = IDLE_POWER_USE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/recharger/attack_tk(mob/user)
if(charging)
@@ -105,14 +105,14 @@
charging.forceMove(loc)
charging = null
use_power = IDLE_POWER_USE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/recharger/process()
if(stat & (NOPOWER|BROKEN) || !anchored)
return
using_power = try_recharging_if_possible()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/recharger/emp_act(severity)
if(stat & (NOPOWER|BROKEN) || !anchored)
@@ -132,9 +132,9 @@
/obj/machinery/recharger/power_change()
..()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
-/obj/machinery/recharger/update_icon() //we have an update_icon() in addition to the stuff in process to make it feel a tiny bit snappier.
+/obj/machinery/recharger/update_icon_state()
if(stat & (NOPOWER|BROKEN) || !anchored)
icon_state = icon_state_off
return
diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm
index 5caf5558b55..ffcef83b661 100644
--- a/code/game/machinery/rechargestation.dm
+++ b/code/game/machinery/rechargestation.dm
@@ -33,7 +33,7 @@
component_parts += new /obj/item/stock_parts/manipulator(null)
component_parts += new /obj/item/stock_parts/cell/high(null)
RefreshParts()
- build_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/recharge_station/upgraded/Initialize(mapload)
. = ..()
@@ -87,7 +87,7 @@
if(A == occupant)
occupant = null
updateUsrDialog()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/recharge_station/narsie_act()
go_out()
@@ -116,9 +116,9 @@
go_out()
..(severity)
-/obj/machinery/recharge_station/proc/build_icon()
+/obj/machinery/recharge_station/update_icon_state()
if(NOPOWER|BROKEN)
- if(src.occupant)
+ if(occupant)
icon_state = "borgcharger1"
else
icon_state = "borgcharger0"
@@ -164,7 +164,7 @@
return
occupant.forceMove(loc)
occupant = null
- build_icon()
+ update_icon(UPDATE_ICON_STATE)
use_power = IDLE_POWER_USE
return
@@ -234,6 +234,6 @@
occupant = user
add_fingerprint(user)
- build_icon()
+ update_icon(UPDATE_ICON_STATE)
update_use_power(1)
return
diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm
index 212ae457c99..57f2d42893a 100644
--- a/code/game/machinery/recycler.dm
+++ b/code/game/machinery/recycler.dm
@@ -27,7 +27,7 @@
component_parts += new /obj/item/stock_parts/matter_bin(null)
component_parts += new /obj/item/stock_parts/manipulator(null)
RefreshParts()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/recycler/ComponentInitialize()
..()
@@ -53,7 +53,7 @@
/obj/machinery/recycler/power_change()
..()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/recycler/attackby(obj/item/I, mob/user, params)
add_fingerprint(user)
@@ -80,15 +80,14 @@
emagged = TRUE
if(emergency_mode)
emergency_mode = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
playsound(src, "sparks", 75, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
to_chat(user, "You use the cryptographic sequencer on [src].")
-/obj/machinery/recycler/update_icon()
- ..()
+/obj/machinery/recycler/update_icon_state()
var/is_powered = !(stat & (BROKEN|NOPOWER))
if(emergency_mode)
- is_powered = 0
+ is_powered = FALSE
icon_state = icon_name + "[is_powered]" + "[(blood ? "bld" : "")]" // add the blood tag at the end
// This is purely for admin possession !FUN!.
@@ -151,14 +150,14 @@
/obj/machinery/recycler/proc/emergency_stop(mob/living/L)
playsound(loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
emergency_mode = TRUE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
L.loc = loc
addtimer(CALLBACK(src, .proc/reboot), SAFETY_COOLDOWN)
/obj/machinery/recycler/proc/reboot()
playsound(loc, 'sound/machines/ping.ogg', 50, 0)
emergency_mode = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/recycler/proc/crush_living(mob/living/L)
@@ -169,17 +168,17 @@
else
playsound(loc, 'sound/effects/splat.ogg', 50, 1)
- var/gib = 1
+ var/gib = TRUE
// By default, the emagged recycler will gib all non-carbons. (human simple animal mobs don't count)
if(iscarbon(L))
- gib = 0
+ gib = FALSE
if(L.stat == CONSCIOUS)
L.say("ARRRRRRRRRRRGH!!!")
add_mob_blood(L)
if(!blood && !issilicon(L))
blood = TRUE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
// Remove and recycle the equipped items
if(eat_victim_items)
diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm
index a0790a08cb1..b366c283e92 100644
--- a/code/game/machinery/requests_console.dm
+++ b/code/game/machinery/requests_console.dm
@@ -73,9 +73,9 @@ GLOBAL_LIST_EMPTY(allRequestConsoles)
/obj/machinery/requests_console/power_change()
..()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
-/obj/machinery/requests_console/update_icon()
+/obj/machinery/requests_console/update_icon_state()
if(stat & NOPOWER)
if(icon_state != "req_comp_off")
icon_state = "req_comp_off"
@@ -336,7 +336,7 @@ GLOBAL_LIST_EMPTY(allRequestConsoles)
capitalize(title)
if(newmessagepriority < priority)
newmessagepriority = priority
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
if(!silent)
playsound(loc, 'sound/machines/twobeep.ogg', 50, TRUE)
atom_say(title)
diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm
index 886b2e6f9e1..2f2a5ef85f8 100644
--- a/code/game/machinery/shieldgen.dm
+++ b/code/game/machinery/shieldgen.dm
@@ -152,7 +152,7 @@
return //If it's already turned on, how did this get called?
active = TRUE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
anchored = TRUE
for(var/turf/target_tile in range(2, src))
@@ -170,7 +170,7 @@
return //If it's already off, how did this get called?
active = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
QDEL_LIST(deployed_shields)
@@ -184,7 +184,7 @@
malfunction = TRUE
if(health <= 0)
qdel(src)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return
/obj/machinery/shieldgen/ex_act(severity)
@@ -239,7 +239,7 @@
/obj/machinery/shieldgen/attackby(obj/item/I as obj, mob/user as mob, params)
if(istype(I, /obj/item/card/emag))
malfunction = TRUE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
else if(istype(I, /obj/item/stack/cable_coil) && malfunction && is_open)
var/obj/item/stack/cable_coil/coil = I
@@ -249,10 +249,10 @@
return
coil.use(1)
health = max_health
- malfunction = TRUE
+ malfunction = FALSE
playsound(loc, coil.usesound, 50, 1)
to_chat(user, "You repair [src]!")
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
else if(istype(I, /obj/item/card/id) || istype(I, /obj/item/pda))
if(allowed(user))
@@ -286,48 +286,41 @@
if(active)
visible_message("[src] shuts off!")
shields_down()
- anchored = FALSE
else
if(istype(get_turf(src), /turf/space))
return //No wrenching these in space!
WRENCH_ANCHOR_MESSAGE
- anchored = TRUE
-
-/obj/machinery/shieldgen/update_icon()
- if(active)
- icon_state = malfunction ? "shieldonbr":"shieldon"
- else
- icon_state = malfunction ? "shieldoffbr":"shieldoff"
- return
+ anchored = !anchored
+/obj/machinery/shieldgen/update_icon_state()
+ icon_state = "shield[active ? "on" : "off"][malfunction ? "br" : ""]"
////FIELD GEN START //shameless copypasta from fieldgen, powersink, and grille
#define maxstoredpower 500
/obj/machinery/shieldwallgen
- name = "Shield Generator"
- desc = "A shield generator."
- icon = 'icons/obj/stationobjs.dmi'
- icon_state = "Shield_Gen"
- anchored = FALSE
- density = TRUE
- req_access = list(ACCESS_TELEPORTER)
- var/active = 0
- var/power = 0
- var/state = 0
- var/steps = 0
- var/last_check = 0
- var/check_delay = 10
- var/locked = TRUE
- var/directwired = 1
- var/obj/structure/cable/attached // the attached cable
- var/storedpower = 0
- flags = CONDUCT
- use_power = NO_POWER_USE
+ name = "Shield Generator"
+ desc = "A shield generator."
+ icon = 'icons/obj/stationobjs.dmi'
+ icon_state = "Shield_Gen"
+ anchored = FALSE
+ density = TRUE
+ req_access = list(ACCESS_TELEPORTER)
+ var/active = FALSE
+ var/power = FALSE
+ var/state = FALSE
+ var/steps = 0
+ var/locked = TRUE
+ var/storedpower = 0
+ flags = CONDUCT
+ use_power = NO_POWER_USE
+
+/obj/machinery/shieldwallgen/update_icon_state()
+ icon_state = "Shield_Gen[active ? " +a" : ""]"
/obj/machinery/shieldwallgen/proc/power()
if(!anchored)
- power = 0
- return 0
+ power = FALSE
+ return
var/turf/T = loc
var/obj/structure/cable/C = T.get_cable_node()
@@ -336,16 +329,16 @@
PN = C.powernet // find the powernet of the connected cable
if(!PN)
- power = 0
- return 0
+ power = FALSE
+ return
var/surplus = max(PN.avail-PN.load, 0)
var/shieldload = min(rand(50,200), surplus)
- if(shieldload==0 && !storedpower) // no cable or no power, and no power stored
- power = 0
- return 0
+ if(shieldload == 0 && !storedpower) // no cable or no power, and no power stored
+ power = FALSE
+ return
else
- power = 1 // IVE GOT THE POWER!
+ power = TRUE // IVE GOT THE POWER!
if(PN) //runtime errors fixer. They were caused by PN.load trying to access missing network in case of working on stored power.
storedpower += shieldload
PN.load += shieldload //uses powernet power.
@@ -355,29 +348,22 @@
/obj/machinery/shieldwallgen/attack_hand(mob/user)
if(state != 1)
to_chat(user, "The shield generator needs to be firmly secured to the floor first.")
- return 1
+ return TRUE
if(locked && !issilicon(user))
to_chat(user, "The controls are locked!")
- return 1
- if(power != 1)
+ return TRUE
+ if(!power)
to_chat(user, "The shield generator needs to be powered by wire underneath.")
- return 1
+ return TRUE
- if(active >= 1)
- active = 0
- icon_state = "Shield_Gen"
-
- user.visible_message("[user] turned the shield generator off.", \
- "You turn off the shield generator.", \
- "You hear heavy droning fade out.")
+ active = !active
+ user.visible_message("[user] turned the shield generator [active ? "on" : "off"].", \
+ "You turn [active ? "on" : "off"] the shield generator.", \
+ "You hear heavy droning [active ? "" : "fade out"].")
+ if(active)
for(var/dir in list(NORTH, SOUTH, EAST, WEST))
cleanup(dir)
- else
- active = 1
- icon_state = "Shield_Gen +a"
- user.visible_message("[user] turned the shield generator on.", \
- "You turn on the shield generator.", \
- "You hear heavy droning.")
+ update_icon(UPDATE_ICON_STATE)
add_fingerprint(user)
/obj/machinery/shieldwallgen/process()
@@ -390,9 +376,9 @@
if(storedpower <= 0)
storedpower = 0
- if(active == 1)
- if(!state == 1)
- active = 0
+ if(active)
+ if(state)
+ active = FALSE
return
spawn(1)
setup_field(1)
@@ -402,15 +388,14 @@
setup_field(4)
spawn(4)
setup_field(8)
- active = 2
- if(active >= 1)
- if(power == 0)
+ if(active)
+ if(!power)
visible_message("[name] shuts down due to lack of power!", \
"You hear heavy droning fade out")
- icon_state = "Shield_Gen"
- active = 0
+ active = FALSE
for(var/dir in list(NORTH, SOUTH, EAST, WEST))
cleanup(dir)
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/shieldwallgen/proc/setup_field(NSEW = 0)
var/turf/T = loc
@@ -458,25 +443,6 @@
/obj/machinery/shieldwallgen/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wrench))
- if(active)
- to_chat(user, "Turn off the field generator first.")
- return
-
- else if(state == 0)
- state = 1
- playsound(loc, I.usesound, 75, 1)
- to_chat(user, "You secure the external reinforcing bolts to the floor.")
- anchored = TRUE
- return
-
- else if(state == 1)
- state = 0
- playsound(loc, I.usesound, 75, 1)
- to_chat(user, "You undo the external reinforcing bolts.")
- anchored = FALSE
- return
-
if(istype(I, /obj/item/card/id)||istype(I, /obj/item/pda))
if(allowed(user))
locked = !locked
@@ -488,6 +454,17 @@
add_fingerprint(user)
..()
+/obj/machinery/shieldwallgen/wrench_act(mob/user, obj/item/I)
+ . = TRUE
+ if(active)
+ to_chat(user, "Turn off the field generator first.")
+ return
+ if(!I.use_tool(src, user, 0, volume = I.tool_volume))
+ return
+ state = !state
+ anchored = !anchored
+ to_chat(user, anchored ? "You secure the external reinforcing bolts to the floor." : "You undo the external reinforcing bolts.")
+
/obj/machinery/shieldwallgen/proc/cleanup(NSEW)
var/obj/machinery/shieldwall/F
var/obj/machinery/shieldwallgen/G
@@ -522,29 +499,26 @@
////////////// Containment Field START
/obj/machinery/shieldwall
- name = "Shield"
- desc = "An energy shield."
- icon = 'icons/effects/effects.dmi'
- icon_state = "shieldwall"
- anchored = TRUE
- density = TRUE
- move_resist = INFINITY
- resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
- light_range = 3
- var/needs_power = 0
- var/active = TRUE
- var/delay = 5
- var/last_active
- var/mob/U
- var/obj/machinery/shieldwallgen/gen_primary
- var/obj/machinery/shieldwallgen/gen_secondary
+ name = "Shield"
+ desc = "An energy shield."
+ icon = 'icons/effects/effects.dmi'
+ icon_state = "shieldwall"
+ anchored = TRUE
+ density = TRUE
+ move_resist = INFINITY
+ resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
+ light_range = 3
+ var/needs_power = FALSE
+ var/active = TRUE
+ var/obj/machinery/shieldwallgen/gen_primary
+ var/obj/machinery/shieldwallgen/gen_secondary
/obj/machinery/shieldwall/New(obj/machinery/shieldwallgen/A, obj/machinery/shieldwallgen/B)
..()
gen_primary = A
gen_secondary = B
if(A && B)
- needs_power = 1
+ needs_power = TRUE
/obj/machinery/shieldwall/attack_hand(mob/user)
return
@@ -629,16 +603,16 @@
if(isliving(mover))
var/mob/living/M = mover
if("syndicate" in M.faction)
- return 1
+ return TRUE
if(istype(mover, /obj/item/projectile))
- return 0
+ return FALSE
return ..(mover, target, height)
/obj/machinery/shieldwall/syndicate/CanAStarPass(ID, to_dir, caller)
if(isliving(caller))
var/mob/living/M = caller
if("syndicate" in M.faction)
- return 1
+ return TRUE
return ..(ID, to_dir, caller)
/obj/machinery/shieldwall/syndicate/proc/phaseout()
diff --git a/code/game/machinery/snow_machine.dm b/code/game/machinery/snow_machine.dm
index b31e71b6c29..1a5688ff429 100644
--- a/code/game/machinery/snow_machine.dm
+++ b/code/game/machinery/snow_machine.dm
@@ -87,10 +87,9 @@
..()
if(!powered())
turn_on_or_off(FALSE, TRUE)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
-/obj/machinery/snow_machine/update_icon()
- ..()
+/obj/machinery/snow_machine/update_icon_state()
if(panel_open)
icon_state = "snow_machine_openpanel"
else
@@ -131,5 +130,5 @@
if(!active && give_message)
visible_message("[src] switches off!")
playsound(loc, 'sound/machines/buzz-sigh.ogg', 50, FALSE)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return TRUE
diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm
index bf53a9685b2..dca414ef5d6 100644
--- a/code/game/machinery/spaceheater.dm
+++ b/code/game/machinery/spaceheater.dm
@@ -26,12 +26,13 @@
QDEL_NULL(cell)
return ..()
-/obj/machinery/space_heater/update_icon()
- overlays.Cut()
+/obj/machinery/space_heater/update_icon_state()
icon_state = "sheater[on]"
+
+/obj/machinery/space_heater/update_overlays()
+ . = ..()
if(open)
- overlays += "sheater-open"
- return
+ . += "sheater-open"
/obj/machinery/space_heater/examine(mob/user)
. = ..()
diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm
index 113e9b05c9e..9d4f7f74426 100644
--- a/code/game/machinery/suit_storage_unit.dm
+++ b/code/game/machinery/suit_storage_unit.dm
@@ -289,7 +289,7 @@
boots = new boots_type(src)
if(storage_type)
storage = new storage_type(src)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
//move this into machinery eventually...
if(occupant_typecache)
@@ -300,32 +300,32 @@
QDEL_NULL(wires)
return ..()
-/obj/machinery/suit_storage_unit/update_icon()
- cut_overlays()
+/obj/machinery/suit_storage_unit/update_overlays()
+ . = ..()
if(panel_open)
- add_overlay("[base_icon_state]_panel")
+ . += "[base_icon_state]_panel"
if(uv)
if(uv_super)
- add_overlay("[base_icon_state]_super")
- add_overlay("[base_icon_state]_[occupant ? "body" : "uvstrong"]")
+ . += "[base_icon_state]_super"
+ . += "[base_icon_state]_[occupant ? "body" : "uvstrong"]"
else
- add_overlay("[base_icon_state]_[occupant ? "body" : "uv"]")
- add_overlay("[base_icon_state]_lights_red")
+ . += "[base_icon_state]_[occupant ? "body" : "uv"]"
+ . += "[base_icon_state]_lights_red"
return
if(state_open)
- add_overlay("[base_icon_state]_open")
+ . += "[base_icon_state]_open"
if(suit)
- add_overlay("[base_icon_state]_suit")
+ . += "[base_icon_state]_suit"
if(helmet)
- add_overlay("[base_icon_state]_helm")
+ . += "[base_icon_state]_helm"
if(storage)
- add_overlay("[base_icon_state]_storage")
+ . += "[base_icon_state]_storage"
else
- add_overlay("[base_icon_state]_lights_closed")
+ . += "[base_icon_state]_lights_closed"
- add_overlay("[base_icon_state]_[occupant ? "body" : "ready"]")
+ . += "[base_icon_state]_[occupant ? "body" : "ready"]"
/obj/machinery/suit_storage_unit/attackby(obj/item/I, mob/user, params)
if(shocked)
@@ -344,7 +344,7 @@
return
if(state_open)
if(store_item(I, user))
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
SStgui.update_uis(src)
to_chat(user, "You load [I] into the storage compartment.")
else
@@ -360,7 +360,7 @@
if(shock(user, 100))
return
if(default_deconstruction_screwdriver(user, "[base_icon_state]", "[base_icon_state]", I))
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/**
* Tries to store the item into whatever slot it can go, returns true if the item is stored successfully.
@@ -405,7 +405,7 @@
if(!is_operational() && state_open)
open_machine()
dump_contents()
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/machinery/suit_storage_unit/proc/dump_contents()
@@ -498,7 +498,7 @@
playsound(src, 'sound/machines/airlock_close.ogg', 25, 1)
if(occupant)
dump_contents()
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
SStgui.update_uis(src)
/obj/machinery/suit_storage_unit/relaymove(mob/user)
@@ -547,7 +547,7 @@
state_open = TRUE
if(drop)
dropContents()
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
SStgui.update_uis(src)
/obj/machinery/suit_storage_unit/dropContents()
@@ -576,7 +576,7 @@
occupant = target
target.forceMove(src)
SStgui.update_uis(src)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
////////
@@ -649,7 +649,7 @@
cook()
if("eject_occupant")
eject_occupant(usr)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/machinery/suit_storage_unit/proc/toggleUV()
if(!panel_open)
@@ -731,7 +731,7 @@
occupant = null
if(!state_open)
state_open = 1
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
return
/obj/machinery/suit_storage_unit/force_eject_occupant(mob/target)
@@ -747,7 +747,7 @@
eject_occupant(usr)
add_fingerprint(usr)
SStgui.update_uis(src)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
return
/obj/machinery/suit_storage_unit/verb/move_inside()
@@ -774,7 +774,7 @@
usr.forceMove(src)
occupant = usr
state_open = FALSE //Close the thing after the guy gets inside
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
add_fingerprint(usr)
SStgui.update_uis(src)
diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm
index 76e0690f78d..39f58b1e43e 100644
--- a/code/game/machinery/syndicatebomb.dm
+++ b/code/game/machinery/syndicatebomb.dm
@@ -74,7 +74,7 @@
if(active && !defused && ((detonation_timer <= world.time) || explode_now))
active = FALSE
timer_set = initial(timer_set)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
try_detonate(TRUE)
//Counter terrorists win
else if(defused)
@@ -87,7 +87,7 @@
wires = new(src)
if(payload)
payload = new payload(src)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
countdown = new(src)
/obj/machinery/syndicatebomb/Destroy()
@@ -101,7 +101,7 @@
. = ..()
. += "A digital display on it reads \"[seconds_remaining()]\"."
-/obj/machinery/syndicatebomb/update_icon()
+/obj/machinery/syndicatebomb/update_icon_state()
icon_state = "[initial(icon_state)][active ? "-active" : "-inactive"][open_panel ? "-wires" : ""]"
/obj/machinery/syndicatebomb/proc/seconds_remaining()
@@ -152,7 +152,7 @@
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
open_panel = !open_panel
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
to_chat(user, "You [open_panel ? "open" : "close"] the wire panel.")
/obj/machinery/syndicatebomb/wirecutter_act(mob/user, obj/item/I)
@@ -254,7 +254,7 @@
else
loc.visible_message("[bicon(src)] [timer_set] seconds until detonation, please clear the area.")
activate()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
add_fingerprint(user)
var/turf/bombturf = get_turf(src)
@@ -362,7 +362,7 @@
holder.delayedbig = FALSE
holder.delayedlittle = FALSE
holder.explode_now = FALSE
- holder.update_icon()
+ holder.update_icon(UPDATE_ICON_STATE)
holder.updateDialog()
/obj/item/bombcore/training/detonate()
diff --git a/code/game/machinery/tcomms/_base.dm b/code/game/machinery/tcomms/_base.dm
index 3fa0c31b559..f02795b0451 100644
--- a/code/game/machinery/tcomms/_base.dm
+++ b/code/game/machinery/tcomms/_base.dm
@@ -51,7 +51,7 @@ GLOBAL_LIST_EMPTY(tcomms_machines)
/obj/machinery/tcomms/Initialize(mapload)
. = ..()
GLOB.tcomms_machines += src
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
if((!mapload) && (usr))
// To the person who asks "Hey affected, why are you using this massive operator when you can use AREACOORD?" Well, ill tell you
// get_area_name is fucking broken and uses a for(x in world) search
@@ -82,8 +82,7 @@ GLOBAL_LIST_EMPTY(tcomms_machines)
*
* Ensures that the icon updates properly based on if the machine is active or not. This removes the need for this check in many other places.
*/
-/obj/machinery/tcomms/update_icon()
- . = ..()
+/obj/machinery/tcomms/update_icon_state()
// Show the off sprite if were inactive, ion'd or unpowered
var/functioning = (active && !(stat & NOPOWER) && !ion)
icon_state = "[initial(icon_state)][panel_open ? "_o" : null][functioning ? null : "_off"]"
@@ -114,7 +113,7 @@ GLOBAL_LIST_EMPTY(tcomms_machines)
*/
/obj/machinery/tcomms/proc/start_ion()
ion = TRUE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/**
* End of Ion Anomaly Event
@@ -123,7 +122,7 @@ GLOBAL_LIST_EMPTY(tcomms_machines)
*/
/obj/machinery/tcomms/proc/end_ion()
ion = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/**
* Z-Level transit change helper
@@ -136,7 +135,7 @@ GLOBAL_LIST_EMPTY(tcomms_machines)
active = FALSE
// This needs a timer because otherwise its on the shuttle Z and the message is missed
addtimer(CALLBACK(src, /atom.proc/visible_message, "Radio equipment on [src] has been overloaded by heavy bluespace interference. Please restart the machine."), 5)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/**
@@ -160,7 +159,7 @@ GLOBAL_LIST_EMPTY(tcomms_machines)
*/
/obj/machinery/tcomms/power_change()
..()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/**
* # Telecommunications Message
@@ -448,7 +447,7 @@ GLOBAL_LIST_EMPTY(tcomms_machines)
if(C.network_id == "STATION-CORE")
info = "Telecommunications Key
\n\t
The station core linkage password is '[C.link_password]'.
Should this paper be misplaced or destroyed, fear not, as the password is visible under the core linkage section. Should you wish to modify this password, it can be modified from the core."
info_links = info
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
// Save time, even though there should only be one STATION-CORE in the world
break
return ..()
diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm
index 5957e133004..2d5e524a3eb 100644
--- a/code/game/machinery/teleporter.dm
+++ b/code/game/machinery/teleporter.dm
@@ -155,7 +155,7 @@
power_station.engaged = FALSE
if(power_station.teleporter_hub.accurate < 3)
power_station.teleporter_hub.calibrated = FALSE
- power_station.teleporter_hub.update_icon()
+ power_station.teleporter_hub.update_icon(UPDATE_ICON_STATE)
/**
* Calibrates the hub. Helper function of ui_act
@@ -288,7 +288,7 @@
trg.stat &= ~NOPOWER
if(trg.teleporter_hub)
trg.teleporter_hub.stat &= ~NOPOWER
- trg.teleporter_hub.update_icon()
+ trg.teleporter_hub.update_icon(UPDATE_ICON_STATE)
if(trg.teleporter_console)
trg.teleporter_console.stat &= ~NOPOWER
trg.teleporter_console.update_icon()
@@ -405,7 +405,7 @@
if(accurate < 3)
calibrated = FALSE
-/obj/machinery/teleport/hub/update_icon()
+/obj/machinery/teleport/hub/update_icon_state()
if(panel_open)
icon_state = "tele-o"
else if(power_station && power_station.engaged)
@@ -432,7 +432,7 @@
for(var/obj/item/stock_parts/matter_bin/M in component_parts)
A -= M.rating * 10
tele_delay = max(A, 0)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/**
Internal helper function
@@ -464,18 +464,18 @@
use_power(5000)
if(tele_delay)
recalibrating = TRUE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
addtimer(CALLBACK(src, .proc/BumpedCallback), tele_delay)
/obj/machinery/teleport/perma/proc/BumpedCallback()
recalibrating = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/teleport/perma/power_change()
..()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
-/obj/machinery/teleport/perma/update_icon()
+/obj/machinery/teleport/perma/update_icon_state()
if(panel_open)
icon_state = "tele-o"
else if(target && !recalibrating && !(stat & (BROKEN|NOPOWER)))
@@ -543,7 +543,7 @@
/obj/machinery/teleport/station/Destroy()
if(teleporter_hub)
teleporter_hub.power_station = null
- teleporter_hub.update_icon()
+ teleporter_hub.update_icon(UPDATE_ICON_STATE)
teleporter_hub = null
if(teleporter_console)
teleporter_console.power_station = null
@@ -584,7 +584,7 @@
/obj/machinery/teleport/station/screwdriver_act(mob/user, obj/item/I)
if(default_deconstruction_screwdriver(user, "controller-o", "controller", I))
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return TRUE
/obj/machinery/teleport/station/wirecutter_act(mob/user, obj/item/I)
@@ -618,17 +618,17 @@
else
visible_message("No target detected.")
engaged = FALSE
- teleporter_hub.update_icon()
+ teleporter_hub.update_icon(UPDATE_ICON_STATE)
if(istype(user))
add_fingerprint(user)
/obj/machinery/teleport/station/power_change()
..()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
if(teleporter_hub)
- teleporter_hub.update_icon()
+ teleporter_hub.update_icon(UPDATE_ICON_STATE)
-/obj/machinery/teleport/station/update_icon()
+/obj/machinery/teleport/station/update_icon_state()
if(panel_open)
icon_state = "controller-o"
else if(stat & NOPOWER)
diff --git a/code/game/machinery/transformer.dm b/code/game/machinery/transformer.dm
index 846c39917b3..910410727c1 100644
--- a/code/game/machinery/transformer.dm
+++ b/code/game/machinery/transformer.dm
@@ -48,10 +48,9 @@
/obj/machinery/transformer/power_change()
..()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
-/obj/machinery/transformer/update_icon()
- ..()
+/obj/machinery/transformer/update_icon_state()
if(is_on_cooldown || stat & (BROKEN|NOPOWER))
icon_state = "separator-AO0"
else
@@ -66,7 +65,7 @@
/// Resets `is_on_cooldown` to `FALSE` and updates our icon. Used in a callback after the transformer does a transformation.
/obj/machinery/transformer/proc/reset_cooldown()
is_on_cooldown = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/transformer/Bumped(atom/movable/AM)
// They have to be human to be transformed.
@@ -94,7 +93,7 @@
// Activate the cooldown
is_on_cooldown = TRUE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
addtimer(CALLBACK(src, .proc/reset_cooldown), cooldown_duration)
addtimer(CALLBACK(null, .proc/playsound, loc, 'sound/machines/ping.ogg', 50, 0), 3 SECONDS)
@@ -141,7 +140,7 @@
// Activate the cooldown
is_on_cooldown = TRUE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
addtimer(CALLBACK(src, .proc/reset_cooldown), cooldown_duration)
/obj/machinery/transformer/xray
@@ -167,10 +166,9 @@
/obj/machinery/transformer/xray/power_change()
..()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
-/obj/machinery/transformer/xray/update_icon()
- ..()
+/obj/machinery/transformer/xray/update_icon_state()
if(stat & (BROKEN|NOPOWER))
icon_state = "separator-AO0"
else
diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm
index a341de01742..888da17489b 100644
--- a/code/game/machinery/turret_control.dm
+++ b/code/game/machinery/turret_control.dm
@@ -215,15 +215,14 @@
if(faction == aTurret.faction)
aTurret.setState(TC)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/turretid/power_change()
..()
updateTurrets()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
-/obj/machinery/turretid/update_icon()
- ..()
+/obj/machinery/turretid/update_icon_state()
if(stat & NOPOWER)
icon_state = "control_off"
set_light(0)
diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm
index 5c8fab85c49..df9e4bdaeb8 100644
--- a/code/game/machinery/vending.dm
+++ b/code/game/machinery/vending.dm
@@ -164,17 +164,17 @@
for(var/obj/item/vending_refill/VR in component_parts)
restock(VR)
-/obj/machinery/vending/update_icon()
- cut_overlays()
+/obj/machinery/vending/update_overlays()
+ . = ..()
underlays.Cut()
if(panel_open)
- add_overlay("[icon_panel ? "[icon_panel]_panel" : "[icon_state]_panel"]")
+ . += "[icon_panel ? "[icon_panel]_panel" : "[icon_state]_panel"]"
if(icon_addon)
- add_overlay("[icon_addon]")
+ . += "[icon_addon]"
if((stat & (BROKEN|NOPOWER)) || force_no_power_icon_state)
- add_overlay("[icon_off ? "[icon_off]_off" : "[icon_state]_off"]")
+ . += "[icon_off ? "[icon_off]_off" : "[icon_state]_off"]"
if(stat & BROKEN)
- add_overlay("[icon_broken ? "[icon_broken]_broken" : "[icon_state]_broken"]")
+ . += "[icon_broken ? "[icon_broken]_broken" : "[icon_state]_broken"]"
return
if(light)
underlays += emissive_appearance(icon, "[icon_lightmask ? "[icon_lightmask]_lightmask" : "[icon_state]_off"]")
@@ -203,14 +203,14 @@
for(var/i in 1 to amount)
force_no_power_icon_state = TRUE
set_light(0)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
sleep(rand(1, 3))
force_no_power_icon_state = FALSE
set_light(light_range_on, light_power_on)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
sleep(rand(1, 10))
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
flickering = FALSE
/**
@@ -363,7 +363,7 @@
if(anchored)
panel_open = !panel_open
panel_open ? SCREWDRIVER_OPEN_PANEL_MESSAGE : SCREWDRIVER_CLOSE_PANEL_MESSAGE
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
SStgui.update_uis(src)
/obj/machinery/vending/wirecutter_act(mob/user, obj/item/I)
@@ -840,13 +840,13 @@
set_light(0)
else
set_light(light_range_on, light_power_on)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/machinery/vending/obj_break(damage_flag)
if(!(stat & BROKEN))
stat |= BROKEN
set_light(0)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
var/dump_amount = 0
var/found_anything = TRUE
diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm
index 5123417bf4d..4ed63a63d1d 100644
--- a/code/game/machinery/washing_machine.dm
+++ b/code/game/machinery/washing_machine.dm
@@ -37,7 +37,7 @@
state = 8
else
state = 5
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
sleep(200)
for(var/atom/A in contents)
A.clean_blood()
@@ -188,7 +188,7 @@
gibs_ready = 1
else
state = 4
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/washing_machine/verb/climb_out()
set name = "Climb out"
@@ -200,7 +200,7 @@
usr.loc = src.loc
-/obj/machinery/washing_machine/update_icon()
+/obj/machinery/washing_machine/update_icon_state()
icon_state = "wm_[state][panel]"
/obj/machinery/washing_machine/attackby(obj/item/W as obj, mob/user as mob, params)
@@ -216,7 +216,7 @@
user.drop_item()
crayon = W
crayon.loc = src
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
else
return ..()
else
@@ -228,7 +228,7 @@
G.affecting.loc = src
qdel(G)
state = 3
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
else
return ..()
else if(istype(W,/obj/item/stack/sheet/hairlesshide) || \
@@ -296,7 +296,7 @@
to_chat(user, "You can't put the item in right now.")
else
to_chat(user, "The washing machine is full.")
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
else
return ..()
@@ -332,7 +332,7 @@
state = 1
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/washing_machine/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/metal(drop_location(), 2)
diff --git a/code/game/mecha/equipment/tools/work_tools.dm b/code/game/mecha/equipment/tools/work_tools.dm
index ef8ca2f09eb..771bfca5a36 100644
--- a/code/game/mecha/equipment/tools/work_tools.dm
+++ b/code/game/mecha/equipment/tools/work_tools.dm
@@ -438,13 +438,13 @@
NC.cable_color("red")
NC.d1 = 0
NC.d2 = fdirn
- NC.updateicon()
+ NC.update_icon()
var/datum/powernet/PN
if(last_piece && last_piece.d2 != Dir)
last_piece.d1 = min(last_piece.d2, Dir)
last_piece.d2 = max(last_piece.d2, Dir)
- last_piece.updateicon()
+ last_piece.update_icon()
PN = last_piece.powernet
if(!PN)
diff --git a/code/game/mecha/mech_bay.dm b/code/game/mecha/mech_bay.dm
index ceb24de45c8..9ad12133cf3 100644
--- a/code/game/mecha/mech_bay.dm
+++ b/code/game/mecha/mech_bay.dm
@@ -122,7 +122,7 @@
var/obj/machinery/mech_bay_recharge_port/recharge_port
-/obj/machinery/computer/mech_bay_power_console/update_icon()
+/obj/machinery/computer/mech_bay_power_console/update_overlays()
if(!recharge_port || !recharge_port.recharging_mecha || !recharge_port.recharging_mecha.cell || !(recharge_port.recharging_mecha.cell.charge < recharge_port.recharging_mecha.cell.maxcharge) || stat & (NOPOWER|BROKEN))
icon_screen = "recharge_comp"
else
diff --git a/code/game/mecha/working/ripley.dm b/code/game/mecha/working/ripley.dm
index 34934baea86..413d2a51be9 100644
--- a/code/game/mecha/working/ripley.dm
+++ b/code/game/mecha/working/ripley.dm
@@ -42,24 +42,34 @@
/obj/mecha/working/ripley/go_out()
..()
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/mecha/working/ripley/moved_inside(mob/living/carbon/human/H)
..()
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/mecha/working/ripley/mmi_moved_inside(obj/item/mmi/mmi_as_oc, mob/user)
..()
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
-/obj/mecha/working/ripley/update_icon()
- ..()
- if(hides)
- cut_overlays()
- if(hides < 3)
- add_overlay(occupant ? "ripley-g" : "ripley-g-open")
- else
- add_overlay(occupant ? "ripley-g-full" : "ripley-g-full-open")
+/obj/mecha/working/ripley/update_desc()
+ . = ..()
+ if(!hides) // Just in case if hides are somehow removed
+ desc = initial(desc)
+ return
+ if(hides == 3)
+ desc = "Autonomous Power Loader Unit. It's wearing a fearsome carapace entirely composed of goliath hide plates - its pilot must be an experienced monster hunter."
+ else
+ desc = "Autonomous Power Loader Unit. Its armour is enhanced with some goliath hide plates."
+
+/obj/mecha/working/ripley/update_overlays()
+ . = ..()
+ if(!hides)
+ return
+ if(hides == 3)
+ . += occupant ? "ripley-g-full" : "ripley-g-full-open"
+ else
+ . += occupant ? "ripley-g" : "ripley-g-open"
/obj/mecha/working/ripley/firefighter
desc = "A standard APLU chassis that was refitted with additional thermal protection and a cistern."
diff --git a/code/game/objects/effects/decals/Cleanable/aliens.dm b/code/game/objects/effects/decals/Cleanable/aliens.dm
index c33969d1f40..4e9041f98a6 100644
--- a/code/game/objects/effects/decals/Cleanable/aliens.dm
+++ b/code/game/objects/effects/decals/Cleanable/aliens.dm
@@ -19,6 +19,7 @@
/obj/effect/decal/cleanable/blood/gibs/xeno/update_icon()
color = "#FFFFFF"
+ . = ..()
/obj/effect/decal/cleanable/blood/gibs/xeno/up
random_icon_states = list("xgib1", "xgib2", "xgib3", "xgib4", "xgib5", "xgib6", "xgibup1", "xgibup1", "xgibup1")
diff --git a/code/game/objects/effects/decals/Cleanable/humans.dm b/code/game/objects/effects/decals/Cleanable/humans.dm
index fc3d74a678e..d6c8cb58af8 100644
--- a/code/game/objects/effects/decals/Cleanable/humans.dm
+++ b/code/game/objects/effects/decals/Cleanable/humans.dm
@@ -50,6 +50,7 @@ GLOBAL_LIST_EMPTY(splatter_cache)
if(basecolor == "rainbow")
basecolor = "#[pick(list("FF0000","FF7F00","FFFF00","00FF00","0000FF","4B0082","8F00FF"))]"
color = basecolor
+ ..()
/obj/effect/decal/cleanable/blood/proc/dry()
name = dryname
@@ -142,21 +143,26 @@ GLOBAL_LIST_EMPTY(splatter_cache)
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6")
no_clear = TRUE
mergeable_decal = FALSE
-
+ var/image/giblets
var/fleshcolor = "#FFFFFF"
+/obj/effect/decal/cleanable/blood/gibs/Destroy()
+ giblets = null
+ return ..()
+
/obj/effect/decal/cleanable/blood/gibs/update_icon()
- var/image/giblets = new(base_icon, "[icon_state]_flesh", dir)
+ giblets = new(base_icon, "[icon_state]_flesh", dir)
if(!fleshcolor || fleshcolor == "rainbow")
fleshcolor = "#[pick(list("FF0000","FF7F00","FFFF00","00FF00","0000FF","4B0082","8F00FF"))]"
giblets.color = fleshcolor
var/icon/blood = new(base_icon,"[icon_state]",dir)
-
icon = blood
- overlays.Cut()
- overlays += giblets
. = ..()
+/obj/effect/decal/cleanable/blood/gibs/update_overlays()
+ . = ..()
+ . += giblets
+
/obj/effect/decal/cleanable/blood/gibs/ex_act(severity)
return
diff --git a/code/game/objects/effects/decals/Cleanable/robots.dm b/code/game/objects/effects/decals/Cleanable/robots.dm
index b3519902a6e..ed14d7c55b9 100644
--- a/code/game/objects/effects/decals/Cleanable/robots.dm
+++ b/code/game/objects/effects/decals/Cleanable/robots.dm
@@ -13,6 +13,7 @@
/obj/effect/decal/cleanable/blood/gibs/robot/update_icon()
color = "#FFFFFF"
+ . = ..()
/obj/effect/decal/cleanable/blood/gibs/robot/dry() //pieces of robots do not dry up like
return
diff --git a/code/game/objects/effects/decals/Cleanable/tracks.dm b/code/game/objects/effects/decals/Cleanable/tracks.dm
index 464d3e5a010..b50635e67a3 100644
--- a/code/game/objects/effects/decals/Cleanable/tracks.dm
+++ b/code/game/objects/effects/decals/Cleanable/tracks.dm
@@ -87,8 +87,8 @@ GLOBAL_LIST_EMPTY(fluidtrack_cache)
update_icon()
-/obj/effect/decal/cleanable/blood/footprints/update_icon()
- overlays.Cut()
+/obj/effect/decal/cleanable/blood/footprints/update_overlays()
+ . = ..()
for(var/Ddir in GLOB.cardinal)
if(entered_dirs & Ddir)
@@ -100,7 +100,7 @@ GLOBAL_LIST_EMPTY(fluidtrack_cache)
GLOB.fluidtrack_cache["entered-[blood_state]-[Ddir]"] = I
if(I)
I.color = basecolor
- overlays += I
+ . += I
if(exited_dirs & Ddir)
var/image/I
if(GLOB.fluidtrack_cache["exited-[blood_state]-[Ddir]"])
@@ -110,7 +110,7 @@ GLOBAL_LIST_EMPTY(fluidtrack_cache)
GLOB.fluidtrack_cache["exited-[blood_state]-[Ddir]"] = I
if(I)
I.color = basecolor
- overlays += I
+ . += I
alpha = base_alpha + bloodiness
diff --git a/code/game/objects/effects/decals/contraband.dm b/code/game/objects/effects/decals/contraband.dm
index 72919ba1fc4..35bfd04b14f 100644
--- a/code/game/objects/effects/decals/contraband.dm
+++ b/code/game/objects/effects/decals/contraband.dm
@@ -62,9 +62,9 @@
var/poster_item_icon_state = "rolled_poster"
/obj/structure/sign/poster/Initialize(mapload)
- . = ..()
if(random_basetype)
randomise(random_basetype)
+ . = ..()
if(!ruined)
original_name = name
name = "poster - [name]"
diff --git a/code/game/objects/effects/effect_system/effects_foam.dm b/code/game/objects/effects/effect_system/effects_foam.dm
index d3350fb5afe..9268b006c45 100644
--- a/code/game/objects/effects/effect_system/effects_foam.dm
+++ b/code/game/objects/effects/effect_system/effects_foam.dm
@@ -36,7 +36,7 @@
var/obj/structure/foamedmetal/M = new(src.loc)
M.metal = metal
- M.updateicon()
+ M.update_state()
flick("[icon_state]-disolve", src)
sleep(5)
@@ -193,15 +193,20 @@
/obj/structure/foamedmetal/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
playsound(src.loc, 'sound/weapons/tap.ogg', 100, TRUE)
-/obj/structure/foamedmetal/proc/updateicon()
+/obj/structure/foamedmetal/proc/update_state()
if(metal == MFOAM_ALUMINUM)
- icon_state = "metalfoam"
max_integrity = 20
obj_integrity = max_integrity
else
- icon_state = "ironfoam"
max_integrity = 50
obj_integrity = max_integrity
+ update_icon(UPDATE_ICON_STATE)
+
+/obj/structure/foamedmetal/update_icon_state()
+ if(metal == MFOAM_ALUMINUM)
+ icon_state = "metalfoam"
+ else
+ icon_state = "ironfoam"
/obj/structure/foamedmetal/attack_hand(mob/user)
user.changeNext_move(CLICK_CD_MELEE)
diff --git a/code/game/objects/items/ashtray.dm b/code/game/objects/items/ashtray.dm
index 40f988e40d2..0b46012b35f 100644
--- a/code/game/objects/items/ashtray.dm
+++ b/code/game/objects/items/ashtray.dm
@@ -30,19 +30,25 @@
visible_message("[user] places [I] in [src].")
add_fingerprint(user)
- update_icon()
+ update_appearance(UPDATE_DESC|UPDATE_ICON_STATE)
else
return ..()
-/obj/item/ashtray/update_icon()
+/obj/item/ashtray/update_icon_state()
if(contents.len == max_butts)
icon_state = icon_full
- desc = initial(desc) + " It's stuffed full."
else if(contents.len > max_butts * 0.5)
icon_state = icon_half
- desc = initial(desc) + " It's half-filled."
else
icon_state = initial(icon_state)
+
+/obj/item/ashtray/update_desc()
+ . = ..()
+ if(contents.len == max_butts)
+ desc = initial(desc) + " It's stuffed full."
+ else if(contents.len > max_butts * 0.5)
+ desc = initial(desc) + " It's half-filled."
+ else
desc = initial(desc)
/obj/item/ashtray/deconstruct()
@@ -52,7 +58,7 @@
/obj/item/ashtray/proc/empty_tray()
for(var/obj/item/I in contents)
I.forceMove(loc)
- update_icon()
+ update_appearance(UPDATE_DESC|UPDATE_ICON_STATE)
/obj/item/ashtray/throw_impact(atom/hit_atom)
if(contents.len)
diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm
index 6b32e1420a4..48d36d9ceac 100644
--- a/code/game/objects/items/bodybag.dm
+++ b/code/game/objects/items/bodybag.dm
@@ -56,7 +56,7 @@
/obj/structure/closet/body_bag/update_overlays()
..()
if(name != initial(name))
- add_overlay("bodybag_label")
+ . += "bodybag_label"
/obj/structure/closet/body_bag/MouseDrop(over_object, src_location, over_location)
. = ..()
diff --git a/code/game/objects/items/candle.dm b/code/game/objects/items/candle.dm
index 366e64ade1e..ce18fe47a01 100644
--- a/code/game/objects/items/candle.dm
+++ b/code/game/objects/items/candle.dm
@@ -22,7 +22,7 @@
STOP_PROCESSING(SSobj, src)
return ..()
-/obj/item/candle/update_icon()
+/obj/item/candle/update_icon_state()
if(flickering)
icon_state = "candle[get_icon_index()]_flicker"
else
@@ -58,7 +58,7 @@
usr.visible_message(show_message)
set_light(CANDLE_LUM)
START_PROCESSING(SSobj, src)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/candle/proc/get_icon_index()
if(wax > 150)
@@ -70,12 +70,12 @@
/obj/item/candle/proc/start_flickering()
flickering = TRUE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
addtimer(CALLBACK(src, .proc/stop_flickering), 4 SECONDS, TIMER_UNIQUE)
/obj/item/candle/proc/stop_flickering()
flickering = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/candle/process()
if(!lit)
@@ -88,7 +88,7 @@
var/mob/M = src.loc
M.unEquip(src, 1) //src is being deleted anyway
qdel(src)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
if(isturf(loc)) //start a fire if possible
var/turf/T = loc
T.hotspot_expose(700, 5)
@@ -98,7 +98,7 @@
if(lit)
user.visible_message("[user] snuffs out [src].")
lit = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
set_light(0)
/obj/item/candle/eternal
diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm
index 929e09592e3..ba336a52aa8 100644
--- a/code/game/objects/items/crayons.dm
+++ b/code/game/objects/items/crayons.dm
@@ -269,13 +269,12 @@
if("Toggle Cap")
to_chat(user, "You [capped ? "remove" : "replace"] the cap of [src].")
capped = !capped
- icon_state = "spraycan[capped ? "_cap" : ""]"
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
if("Change Drawing")
..()
if("Change Color")
colour = input(user,"Choose Color") as color
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/toy/crayon/spraycan/afterattack(atom/target, mob/user as mob, proximity)
if(!proximity)
@@ -300,8 +299,11 @@
playsound(user.loc, 'sound/effects/spray.ogg', 5, 1, 5)
..()
-/obj/item/toy/crayon/spraycan/update_icon()
- overlays.Cut()
+/obj/item/toy/crayon/spraycan/update_icon_state()
+ icon_state = "spraycan[capped ? "_cap" : ""]"
+
+/obj/item/toy/crayon/spraycan/update_overlays()
+ . = ..()
var/image/I = image('icons/obj/crayons.dmi',icon_state = "[capped ? "spraycan_cap_colors" : "spraycan_colors"]")
I.color = colour
- overlays += I
+ . += I
diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm
index 9e96d111a11..5744418df9c 100644
--- a/code/game/objects/items/devices/flashlight.dm
+++ b/code/game/objects/items/devices/flashlight.dm
@@ -15,34 +15,32 @@
/obj/item/flashlight/Initialize()
. = ..()
- if(on)
- icon_state = "[initial(icon_state)]-on"
- set_light(brightness_on)
- else
- icon_state = initial(icon_state)
- set_light(0)
+ update_brightness()
-/obj/item/flashlight/proc/update_brightness(mob/user = null)
+/obj/item/flashlight/update_icon_state()
if(on)
icon_state = "[initial(icon_state)]-on"
+ else
+ icon_state = "[initial(icon_state)]"
+
+/obj/item/flashlight/proc/update_brightness()
+ if(on)
set_light(brightness_on)
else
- icon_state = initial(icon_state)
set_light(0)
+ update_icon()
/obj/item/flashlight/attack_self(mob/user)
if(!isturf(user.loc))
to_chat(user, "You cannot turn the light on while in this [user.loc].")//To prevent some lighting anomalities.
-
- return 0
+ return FALSE
on = !on
playsound(user, togglesound, 100, 1)
- update_brightness(user)
+ update_brightness()
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
- return 1
-
+ return TRUE
/obj/item/flashlight/attack(mob/living/M as mob, mob/living/user as mob)
add_fingerprint(user)
@@ -129,15 +127,12 @@
materials = list()
on = TRUE
-
// green-shaded desk lamp
/obj/item/flashlight/lamp/green
desc = "A classic green-shaded desk lamp."
icon_state = "lampgreen"
item_state = "lampgreen"
-
-
/obj/item/flashlight/lamp/verb/toggle_light()
set name = "Toggle light"
set category = "Object"
@@ -153,7 +148,6 @@
icon_state = "bananalamp"
item_state = "bananalamp"
-
// FLARES
/obj/item/flashlight/flare
@@ -174,6 +168,12 @@
fuel = rand(fuel_lower, fuel_upp)
..()
+/obj/item/flashlight/flare/update_icon_state()
+ if(!fuel)
+ icon_state = "[initial(icon_state)]-empty"
+ return
+ ..()
+
/obj/item/flashlight/flare/process()
var/turf/pos = get_turf(src)
if(pos && produce_heat)
@@ -181,8 +181,6 @@
fuel = max(fuel - 1, 0)
if(!fuel || !on)
turn_off()
- if(!fuel)
- icon_state = "[initial(icon_state)]-empty"
STOP_PROCESSING(SSobj, src)
/obj/item/flashlight/flare/Destroy()
@@ -193,21 +191,9 @@
on = FALSE
force = initial(force)
damtype = initial(damtype)
- if(ismob(loc))
- var/mob/U = loc
- update_brightness(U)
- else
- update_brightness(null)
-
-/obj/item/flashlight/flare/update_brightness(mob/user = null)
- ..()
- if(on)
- item_state = "[initial(item_state)]-on"
- else
- item_state = "[initial(item_state)]"
+ update_brightness()
/obj/item/flashlight/flare/attack_self(mob/user)
-
// Usual checks
if(!fuel)
to_chat(user, "[src] is out of fuel.")
@@ -220,8 +206,9 @@
// All good, turn it on.
if(.)
user.visible_message("[user] activates [src].", "You activate [src].")
- force = on_damage
- damtype = "fire"
+ if(produce_heat)
+ force = on_damage
+ damtype = "fire"
START_PROCESSING(SSobj, src)
// GLOWSTICKS
@@ -234,30 +221,25 @@
icon_state = "glowstick"
item_state = "glowstick"
togglesound = 'sound/effects/bone_break_1.ogg'
- produce_heat = 0
+ produce_heat = FALSE
fuel_lower = 1600
fuel_upp = 2000
+ blocks_emissive = FALSE
/obj/item/flashlight/flare/glowstick/Initialize()
light_color = color
..()
-/obj/item/flashlight/flare/glowstick/update_icon()
- item_state = "glowstick"
- cut_overlays()
+/obj/item/flashlight/flare/glowstick/update_icon_state()
if(!fuel)
icon_state = "glowstick-empty"
- cut_overlays()
- update_brightness(0)
- else if(on)
+
+/obj/item/flashlight/flare/glowstick/update_overlays()
+ . = ..()
+ if(on)
var/mutable_appearance/glowstick_overlay = mutable_appearance(icon, "glowstick-glow")
glowstick_overlay.color = color
- add_overlay(glowstick_overlay)
- item_state = "glowstick-on"
- update_brightness(brightness_on)
- else
- icon_state = "glowstick"
- cut_overlays()
+ . += glowstick_overlay
/obj/item/flashlight/flare/glowstick/red
name = "red glowstick"
diff --git a/code/game/objects/items/devices/geiger_counter.dm b/code/game/objects/items/devices/geiger_counter.dm
index c24d92e7a96..70b3f251d96 100644
--- a/code/game/objects/items/devices/geiger_counter.dm
+++ b/code/game/objects/items/devices/geiger_counter.dm
@@ -53,7 +53,7 @@
current_tick_amount = 0
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
update_sound()
/obj/item/geiger_counter/examine(mob/user)
@@ -80,7 +80,7 @@
. += "The last radiation amount detected was [last_tick_amount]"
-/obj/item/geiger_counter/update_icon()
+/obj/item/geiger_counter/update_icon_state()
if(!scanning)
icon_state = "geiger_off"
else if(emagged)
@@ -113,11 +113,11 @@
if(amount <= RAD_BACKGROUND_RADIATION || !scanning)
return
current_tick_amount += amount
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/geiger_counter/attack_self(mob/user)
scanning = !scanning
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
to_chat(user, "[bicon(src)] You switch [scanning ? "on" : "off"] [src].")
/obj/item/geiger_counter/afterattack(atom/target, mob/user)
@@ -158,7 +158,7 @@
user.visible_message("[user] refastens [src]'s maintenance panel!", "You reset [src] to its factory settings!")
emagged = FALSE
radiation_count = 0
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return TRUE
else
return ..()
@@ -171,7 +171,7 @@
return
radiation_count = 0
to_chat(user, "You flush [src]'s radiation counts, resetting it to normal.")
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/geiger_counter/emag_act(mob/user)
if(emagged)
diff --git a/code/game/objects/items/devices/lightreplacer.dm b/code/game/objects/items/devices/lightreplacer.dm
index f032341c6f6..71585752d8f 100644
--- a/code/game/objects/items/devices/lightreplacer.dm
+++ b/code/game/objects/items/devices/lightreplacer.dm
@@ -147,14 +147,23 @@
/obj/item/lightreplacer/emag_act(user as mob)
if(!emagged)
- Emag()
+ emagged = !emagged
+ playsound(loc, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
+ update_appearance(UPDATE_NAME|UPDATE_ICON_STATE)
/obj/item/lightreplacer/attack_self(mob/user)
for(var/obj/machinery/light/target in user.loc)
ReplaceLight(target, user)
to_chat(user, status_string())
-/obj/item/lightreplacer/update_icon()
+/obj/item/lightreplacer/update_name()
+ . = ..()
+ if(emagged)
+ name = "shortcircuited [initial(name)]"
+ else
+ name = initial(name)
+
+/obj/item/lightreplacer/update_icon_state()
icon_state = "lightreplacer[emagged]"
/obj/item/lightreplacer/proc/status_string()
@@ -214,15 +223,6 @@
to_chat(U, "There is a working [target.fitting] already inserted!")
return
-/obj/item/lightreplacer/proc/Emag()
- emagged = !emagged
- playsound(loc, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
- if(emagged)
- name = "shortcircuited [initial(name)]"
- else
- name = initial(name)
- update_icon()
-
/obj/item/lightreplacer/proc/CanUse(mob/living/user)
add_fingerprint(user)
if(uses > 0)
@@ -249,9 +249,8 @@
to_chat(U, "[src]'s refill light blinks red.")
/obj/item/lightreplacer/proc/janicart_insert(mob/user, obj/structure/janitorialcart/J)
- J.put_in_cart(src, user)
J.myreplacer = src
- J.update_icon()
+ J.put_in_cart(src, user)
/obj/item/lightreplacer/cyborg/janicart_insert(mob/user, obj/structure/janitorialcart/J)
return
diff --git a/code/game/objects/items/devices/painter/airlock_painter.dm b/code/game/objects/items/devices/painter/airlock_painter.dm
index 28d3863553e..a0634da1842 100644
--- a/code/game/objects/items/devices/painter/airlock_painter.dm
+++ b/code/game/objects/items/devices/painter/airlock_painter.dm
@@ -58,5 +58,5 @@
A.icon = initial(airlock.icon)
A.overlays_file = initial(airlock.overlays_file)
A.assemblytype = initial(airlock.assemblytype)
- A.update_icon()
+ A.update_appearance()
return TRUE
diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm
index 7206a4ea24f..5e94b9e02fe 100644
--- a/code/game/objects/items/devices/powersink.dm
+++ b/code/game/objects/items/devices/powersink.dm
@@ -30,7 +30,7 @@
attached = null
return ..()
-/obj/item/powersink/update_icon()
+/obj/item/powersink/update_icon_state()
icon_state = "powersink[mode == OPERATING]"
/obj/item/powersink/proc/set_mode(value)
@@ -60,7 +60,7 @@
density = TRUE
mode = value
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
set_light(0)
/obj/item/powersink/screwdriver_act(mob/user, obj/item/I)
diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm
index 41e2af3f999..2c82e3e2812 100644
--- a/code/game/objects/items/devices/radio/intercom.dm
+++ b/code/game/objects/items/devices/radio/intercom.dm
@@ -61,10 +61,10 @@
if(direction)
setDir(direction)
set_pixel_offsets_from_dir(28, -28, 28, -28)
- b_stat=1
+ b_stat = TRUE
on = FALSE
GLOB.global_intercoms.Add(src)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/radio/intercom/Initialize()
. = ..()
@@ -184,12 +184,12 @@
return
if(!I.use_tool(src, user, 10, volume = I.tool_volume) || buildstage != 2)
return
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
on = TRUE
- b_stat = 0
+ b_stat = FALSE
buildstage = 3
to_chat(user, "You secure the electronics!")
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
update_operating_status()
for(var/i, i<= 5, i++)
wires.on_cut(i, 1)
@@ -203,9 +203,9 @@
WIRECUTTER_SNIP_MESSAGE
new /obj/item/stack/cable_coil(get_turf(src),5)
on = FALSE
- b_stat = 1
+ b_stat = TRUE
buildstage = 1
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
update_operating_status(FALSE)
/obj/item/radio/intercom/welder_act(mob/user, obj/item/I)
@@ -220,11 +220,11 @@
new /obj/item/mounted/frame/intercom(get_turf(src))
qdel(src)
-/obj/item/radio/intercom/update_icon()
+/obj/item/radio/intercom/update_icon_state()
if(!circuitry_installed)
icon_state="intercom-frame"
- return
- icon_state = "intercom[!on?"-p":""][b_stat ? "-open":""]"
+ else
+ icon_state = "intercom[!on?"-p":""][b_stat ? "-open":""]"
/obj/item/radio/intercom/proc/update_operating_status(on = TRUE)
var/area/current_area = get_area(src)
@@ -249,7 +249,7 @@
on = FALSE
else
on = current_area.powered(EQUIP) // set "on" to the equipment power status of our area.
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/intercom_electronics
name = "intercom electronics"
diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm
index 7acc14f1dc3..92253145eeb 100644
--- a/code/game/objects/items/devices/scanners.dm
+++ b/code/game/objects/items/devices/scanners.dm
@@ -596,6 +596,7 @@ REAGENT SCANNER
var/obj/item/stock_parts/cell/cell
var/cell_type = /obj/item/stock_parts/cell/upgraded
var/ready = TRUE // Ready to scan
+ var/printing = FALSE
var/time_to_use = 0 // How much time remaining before next scan is available.
var/usecharge = 750
var/scan_time = 10 SECONDS //how long does it take to scan
@@ -626,20 +627,22 @@ REAGENT SCANNER
playsound(src, 'sound/machines/defib_saftyon.ogg', 50, 0)
update_icon()
-/obj/item/bodyanalyzer/update_icon(printing = FALSE)
- overlays.Cut()
- var/percent = cell.percent()
+/obj/item/bodyanalyzer/update_icon_state()
+ if(!cell)
+ icon_state = "bodyanalyzer_0"
+ return
if(ready)
icon_state = "bodyanalyzer_1"
else
icon_state = "bodyanalyzer_2"
+/obj/item/bodyanalyzer/update_overlays()
+ . = ..()
+ var/percent = cell.percent()
var/overlayid = round(percent / 10)
- overlayid = "bodyanalyzer_charge[overlayid]"
- overlays += icon(icon, overlayid)
-
+ . += "bodyanalyzer_charge[overlayid]"
if(printing)
- overlays += icon(icon, "bodyanalyzer_printing")
+ . += "bodyanalyzer_printing"
/obj/item/bodyanalyzer/attack(mob/living/M, mob/living/carbon/human/user)
if(user.incapacitated() || !user.Adjacent(M))
@@ -686,14 +689,16 @@ REAGENT SCANNER
else
cell.use(usecharge)
ready = FALSE
- update_icon(TRUE)
+ printing = TRUE
+ update_icon()
addtimer(CALLBACK(src, /obj/item/bodyanalyzer/.proc/setReady), scan_cd)
- addtimer(CALLBACK(src, /obj/item/bodyanalyzer/.proc/update_icon), 20)
-
+ addtimer(VARSET_CALLBACK(src, printing, FALSE), 1.4 SECONDS)
+ addtimer(CALLBACK(src, /atom/.proc/update_icon, UPDATE_OVERLAYS), 1.5 SECONDS)
else if(iscorgi(M) && M.stat == DEAD)
to_chat(user, "You wonder if [M.p_they()] was a good dog. [src] tells you they were the best...") // :'(
playsound(loc, 'sound/machines/ping.ogg', 50, 0)
ready = FALSE
+ update_icon(UPDATE_ICON_STATE)
addtimer(CALLBACK(src, /obj/item/bodyanalyzer/.proc/setReady), scan_cd)
time_to_use = world.time + scan_cd
else
diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm
index 22e92f603d5..f39dcceeaaf 100644
--- a/code/game/objects/items/devices/taperecorder.dm
+++ b/code/game/objects/items/devices/taperecorder.dm
@@ -26,7 +26,7 @@
..()
if(starts_with_tape)
mytape = new /obj/item/tape/random(src)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
soundloop = new(list(src))
/obj/item/taperecorder/Destroy()
@@ -53,7 +53,7 @@
mytape = I
to_chat(user, "You insert [I] into [src].")
playsound(src, 'sound/items/taperecorder/taperecorder_close.ogg', 50, FALSE)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/taperecorder/proc/eject(mob/user)
if(mytape)
@@ -62,7 +62,7 @@
stop()
user.put_in_hands(mytape)
mytape = null
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/taperecorder/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
@@ -92,7 +92,7 @@
eject(usr)
-/obj/item/taperecorder/update_icon()
+/obj/item/taperecorder/update_icon_state()
if(!mytape)
icon_state = "taperecorder_empty"
else if(recording)
@@ -102,7 +102,6 @@
else
icon_state = "taperecorder_idle"
-
/obj/item/taperecorder/hear_talk(mob/living/M as mob, list/message_pieces)
var/msg = multilingual_to_message(message_pieces)
if(mytape && recording)
@@ -146,7 +145,7 @@
recording = TRUE
atom_say("Recording started.")
update_sound()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
mytape.timestamp += mytape.used_capacity
mytape.storedinfo += "\[[time2text(mytape.used_capacity * 10,"mm:ss")]\] Recording started."
var/used = mytape.used_capacity //to stop runtimes when you eject the tape
@@ -180,7 +179,7 @@
playsound(src, 'sound/items/taperecorder/taperecorder_stop.ogg', 50, FALSE)
atom_say("Playback stopped.")
playing = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
update_sound()
@@ -198,7 +197,7 @@
return
playing = TRUE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
update_sound()
atom_say("Playback started.")
playsound(src, 'sound/items/taperecorder/taperecorder_play.ogg', 50, FALSE)
@@ -285,7 +284,7 @@
var/used_capacity = 0
var/list/storedinfo = list()
var/list/timestamp = list()
- var/ruined = 0
+ var/ruined = FALSE
/obj/item/tape/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
@@ -308,22 +307,23 @@
to_chat(usr, "You erase the data from [src].")
clear()
+/obj/item/tape/update_overlays()
+ . = ..()
+ if(ruined)
+ . += "ribbonoverlay"
+
/obj/item/tape/proc/clear()
used_capacity = 0
storedinfo.Cut()
timestamp.Cut()
/obj/item/tape/proc/ruin()
- if(!ruined)
- overlays += "ribbonoverlay"
- ruined = 1
-
-
+ ruined = TRUE
+ update_icon(UPDATE_OVERLAYS)
/obj/item/tape/proc/fix()
- overlays -= "ribbonoverlay"
- ruined = 0
-
+ ruined = FALSE
+ update_icon(UPDATE_OVERLAYS)
/obj/item/tape/attackby(obj/item/I, mob/user)
if(ruined && istype(I, /obj/item/screwdriver))
diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm
index 61f2b016a68..e2cfcaf5474 100644
--- a/code/game/objects/items/devices/transfer_valve.dm
+++ b/code/game/objects/items/devices/transfer_valve.dm
@@ -152,23 +152,25 @@
spawn(50) // To stop a signal being spammed from a proxy sensor constantly going off or whatever
toggle = TRUE
-/obj/item/transfer_valve/update_icon()
- overlays.Cut()
- underlays = null
-
+/obj/item/transfer_valve/update_icon_state()
if(!tank_one && !tank_two && !attached_device)
icon_state = "valve_1"
+ else
+ icon_state = "valve"
+
+/obj/item/transfer_valve/update_overlays()
+ . = ..()
+ underlays.Cut()
+ if(!tank_one && !tank_two && !attached_device)
return
- icon_state = "valve"
-
if(tank_one)
- overlays += "[tank_one.icon_state]"
+ . += "[tank_one.icon_state]"
if(tank_two)
var/icon/J = new(icon, icon_state = "[tank_two.icon_state]")
J.Shift(WEST, 13)
underlays += J
if(attached_device)
- overlays += "device"
+ . += "device"
/obj/item/transfer_valve/proc/merge_gases()
tank_two.air_contents.volume += tank_one.air_contents.volume
diff --git a/code/game/objects/items/flag.dm b/code/game/objects/items/flag.dm
index 49931fe1cfa..2b75caed3b4 100644
--- a/code/game/objects/items/flag.dm
+++ b/code/game/objects/items/flag.dm
@@ -8,6 +8,7 @@
w_class = WEIGHT_CLASS_BULKY
max_integrity = 40
resistance_flags = FLAMMABLE
+ custom_fire_overlay = "fire"
var/rolled = FALSE
/obj/item/flag/attackby(obj/item/W, mob/user, params)
@@ -29,18 +30,16 @@
..()
update_icon()
-/obj/item/flag/update_icon()
- overlays.Cut()
+/obj/item/flag/update_icon_state()
updateFlagIcon()
item_state = icon_state
if(rolled)
icon_state = "[icon_state]_rolled"
+ custom_fire_overlay = "fire_rolled"
+ else
+ custom_fire_overlay = initial(custom_fire_overlay)
if(resistance_flags & ON_FIRE)
item_state = "[item_state]_fire"
- if((resistance_flags & ON_FIRE) && rolled)
- overlays += image('icons/obj/flag.dmi', src , "fire_rolled")
- else if((resistance_flags & ON_FIRE) && !rolled)
- overlays += image('icons/obj/flag.dmi', src , "fire")
if(ismob(loc))
var/mob/M = loc
M.update_inv_r_hand()
diff --git a/code/game/objects/items/his_grace.dm b/code/game/objects/items/his_grace.dm
index 1f11a40df33..9c8d79dd60c 100644
--- a/code/game/objects/items/his_grace.dm
+++ b/code/game/objects/items/his_grace.dm
@@ -41,16 +41,18 @@
GLOB.poi_list -= src
return ..()
-/obj/item/his_grace/update_icon()
+/obj/item/his_grace/update_icon_state()
icon_state = ascended ? "gold" : "green"
item_state = ascended ? "toolbox_gold" : "artistic_toolbox"
- cut_overlays()
+
+/obj/item/his_grace/update_overlays()
+ . = ..()
if(ascended)
- add_overlay("triple_latch")
+ . += "triple_latch"
else if(awakened)
- add_overlay("single_latch_open")
+ . += "single_latch_open"
else
- add_overlay("single_latch")
+ . += "single_latch"
/obj/item/his_grace/attack_self(mob/living/user)
if(!awakened)
diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm
index 1ad616cba8d..eb4ba9457e6 100644
--- a/code/game/objects/items/robot/robot_parts.dm
+++ b/code/game/objects/items/robot/robot_parts.dm
@@ -102,7 +102,7 @@
/obj/item/robot_parts/robot_suit/New()
..()
- updateicon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/robot_parts/robot_suit/Destroy()
QDEL_NULL(l_arm)
@@ -117,20 +117,20 @@
/obj/item/robot_parts/robot_suit/attack_self(mob/user)
return
-/obj/item/robot_parts/robot_suit/proc/updateicon()
- overlays.Cut()
+/obj/item/robot_parts/robot_suit/update_overlays()
+ . = ..()
if(l_arm)
- overlays += "l_arm+o"
+ . += "l_arm+o"
if(r_arm)
- overlays += "r_arm+o"
+ . += "r_arm+o"
if(chest)
- overlays += "chest+o"
+ . += "chest+o"
if(l_leg)
- overlays += "l_leg+o"
+ . += "l_leg+o"
if(r_leg)
- overlays += "r_leg+o"
+ . += "r_leg+o"
if(head)
- overlays += "head+o"
+ . += "head+o"
/obj/item/robot_parts/robot_suit/proc/check_completion()
if(l_arm && r_arm)
@@ -158,7 +158,7 @@
user.drop_item()
W.forceMove(src)
l_leg = W
- updateicon()
+ update_icon(UPDATE_OVERLAYS)
if(istype(W, /obj/item/robot_parts/r_leg))
if(r_leg)
@@ -166,7 +166,7 @@
user.drop_item()
W.forceMove(src)
r_leg = W
- updateicon()
+ update_icon(UPDATE_OVERLAYS)
if(istype(W, /obj/item/robot_parts/l_arm))
if(l_arm)
@@ -174,7 +174,7 @@
user.drop_item()
W.forceMove(src)
l_arm = W
- updateicon()
+ update_icon(UPDATE_OVERLAYS)
if(istype(W, /obj/item/robot_parts/r_arm))
if(r_arm)
@@ -182,7 +182,7 @@
user.drop_item()
W.forceMove(src)
r_arm = W
- updateicon()
+ update_icon(UPDATE_OVERLAYS)
if(istype(W, /obj/item/robot_parts/chest))
var/obj/item/robot_parts/chest/CH = W
@@ -192,7 +192,7 @@
user.drop_item()
W.forceMove(src)
chest = W
- updateicon()
+ update_icon(UPDATE_OVERLAYS)
else if(!CH.wired)
to_chat(user, "You need to attach wires to it first!")
else
@@ -206,7 +206,7 @@
user.drop_item()
W.forceMove(src)
head = W
- updateicon()
+ update_icon(UPDATE_OVERLAYS)
else
to_chat(user, "You need to attach a flash to it first!")
diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm
index 40aef78bc3d..7377c6b98a7 100644
--- a/code/game/objects/items/robot/robot_upgrades.dm
+++ b/code/game/objects/items/robot/robot_upgrades.dm
@@ -39,11 +39,11 @@
/obj/item/borg/upgrade/proc/pre_install_checks(mob/living/silicon/robot/R)
if(R.stat == DEAD)
to_chat(usr, "[src] will not function on a deceased cyborg.")
- return FALSE
+ return
if(module_type && !istype(R.module, module_type))
to_chat(R, "Upgrade mounting error! No suitable hardpoint detected!")
to_chat(usr, "There's no mounting point for the module!")
- return FALSE
+ return
return TRUE
/**
@@ -99,7 +99,7 @@
/obj/item/borg/upgrade/rename/do_install(mob/living/silicon/robot/R)
if(!R.allow_rename)
to_chat(R, "Internal diagnostic error: incompatible upgrade module detected.")
- return 0
+ return
R.notify_ai(3, R.name, heldname)
R.name = heldname
R.custom_name = heldname
@@ -116,7 +116,7 @@
/obj/item/borg/upgrade/restart/do_install(mob/living/silicon/robot/R)
if(R.health < 0)
to_chat(usr, "You have to repair the cyborg before using this module!")
- return 0
+ return
if(!R.key)
for(var/mob/dead/observer/ghost in GLOB.player_list)
@@ -286,7 +286,7 @@
var/obj/item/borg/upgrade/selfrepair/U = locate() in R
if(U)
to_chat(usr, "This unit is already equipped with a self-repair module.")
- return 0
+ return
cyborg = R
icon_state = "selfrepair_off"
@@ -308,9 +308,9 @@
else
to_chat(cyborg, "You deactivate the self-repair module.")
STOP_PROCESSING(SSobj, src)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
-/obj/item/borg/upgrade/selfrepair/update_icon()
+/obj/item/borg/upgrade/selfrepair/update_icon_state()
if(cyborg)
icon_state = "selfrepair_[on ? "on" : "off"]"
for(var/X in actions)
@@ -322,7 +322,7 @@
/obj/item/borg/upgrade/selfrepair/proc/deactivate()
STOP_PROCESSING(SSobj, src)
on = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/borg/upgrade/selfrepair/process()
if(!repair_tick)
diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm
index 262c6b53734..2d9a644f3f7 100644
--- a/code/game/objects/items/stacks/rods.dm
+++ b/code/game/objects/items/stacks/rods.dm
@@ -43,7 +43,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
is_cyborg = TRUE
materials = list()
-/obj/item/stack/rods/cyborg/update_icon()
+/obj/item/stack/rods/cyborg/update_icon_state()
return // icon_state should always be a full stack of rods.
/obj/item/stack/rods/ten
@@ -58,9 +58,9 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
/obj/item/stack/rods/New(loc, amount=null)
..()
recipes = GLOB.rod_recipes
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
-/obj/item/stack/rods/update_icon()
+/obj/item/stack/rods/update_icon_state()
var/amount = get_amount()
if((amount <= 5) && (amount > 0))
icon_state = "rods-[amount]"
diff --git a/code/game/objects/items/stacks/sheets/leather.dm b/code/game/objects/items/stacks/sheets/leather.dm
index 38cf37fbc3b..502c0f8d632 100644
--- a/code/game/objects/items/stacks/sheets/leather.dm
+++ b/code/game/objects/items/stacks/sheets/leather.dm
@@ -199,11 +199,7 @@ GLOBAL_LIST_INIT(sinew_recipes, list ( \
D.armor = D.armor.setRating(bullet_value = min(D.armor.getRating(BULLET) + 5, 50))
D.armor = D.armor.setRating(laser_value = min(D.armor.getRating(LASER) + 5, 50))
to_chat(user, "You strengthen [target], improving its resistance against melee attacks.")
- D.update_icon()
- if(D.hides == 3)
- D.desc = "Autonomous Power Loader Unit. It's wearing a fearsome carapace entirely composed of goliath hide plates - its pilot must be an experienced monster hunter."
- else
- D.desc = "Autonomous Power Loader Unit. Its armour is enhanced with some goliath hide plates."
+ D.update_appearance(UPDATE_DESC|UPDATE_OVERLAYS)
use(1)
else
to_chat(user, "You can't improve [D] any further!")
diff --git a/code/game/objects/items/tools/welder.dm b/code/game/objects/items/tools/welder.dm
index aab2826e46d..d8786596fb0 100644
--- a/code/game/objects/items/tools/welder.dm
+++ b/code/game/objects/items/tools/welder.dm
@@ -170,15 +170,7 @@
else
to_chat(user, "There's not enough fuel in [A] to refuel [src]!")
-/obj/item/weldingtool/proc/update_torch()
- overlays.Cut()
- if(tool_enabled)
- overlays += "[initial(icon_state)]-on"
- item_state = "[initial(item_state)]1"
- else
- item_state = "[initial(item_state)]"
-
-/obj/item/weldingtool/update_icon()
+/obj/item/weldingtool/update_icon_state()
if(low_fuel_changes_icon)
var/ratio = GET_FUEL / maximum_fuel
ratio = CEILING(ratio*4, 1) * 25
@@ -186,8 +178,15 @@
icon_state = initial(icon_state)
else
icon_state = "[initial(icon_state)][ratio]"
- update_torch()
- ..()
+ if(tool_enabled)
+ item_state = "[initial(item_state)]1"
+ else
+ item_state = "[initial(item_state)]"
+
+/obj/item/weldingtool/update_overlays()
+ . = ..()
+ if(tool_enabled)
+ . += "[initial(icon_state)]-on"
/obj/item/weldingtool/cyborg_recharge(coeff, emagged)
if(reagents.check_and_add("fuel", maximum_fuel, 2 * coeff))
diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm
index 2a8bd868a93..223a064f525 100644
--- a/code/game/objects/items/toys.dm
+++ b/code/game/objects/items/toys.dm
@@ -96,7 +96,7 @@
qdel(src)
return
-/obj/item/toy/balloon/update_icon()
+/obj/item/toy/balloon/update_icon_state()
if(src.reagents.total_volume >= 1)
icon_state = "waterballoon"
item_state = "waterballoon"
@@ -772,21 +772,20 @@
/obj/item/toy/windup_toolbox/Initialize(mapload)
. = ..()
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
-/obj/item/toy/windup_toolbox/update_icon()
- ..()
- cut_overlays()
+/obj/item/toy/windup_toolbox/update_overlays()
+ . = ..()
if(active)
- add_overlay("single_latch_open")
+ . += "single_latch_open"
else
- add_overlay("single_latch")
+ . += "single_latch"
/obj/item/toy/windup_toolbox/attack_self(mob/user)
if(!active)
to_chat(user, "You wind up [src], it begins to rumble.")
active = TRUE
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
playsound(src, 'sound/effects/pope_entry.ogg', 100)
animate_rumble(src)
addtimer(CALLBACK(src, .proc/stopRumble), 60 SECONDS)
@@ -795,7 +794,7 @@
/obj/item/toy/windup_toolbox/proc/stopRumble()
active = FALSE
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
visible_message("[src] slowly stops rattling and falls still, its latch snapping shut.") //subtle difference
playsound(loc, 'sound/weapons/batonextend.ogg', 100, TRUE)
animate(src, transform = matrix())
@@ -1113,7 +1112,7 @@
wieldsound = 'sound/weapons/chainsawstart.ogg'
attack_verb = list("sawed", "cut", "hacked", "carved", "cleaved", "butchered", "felled", "timbered")
-/obj/item/twohanded/toy/chainsaw/update_icon()
+/obj/item/twohanded/toy/chainsaw/update_icon_state()
if(wielded)
icon_state = "chainsaw[wielded]"
else
diff --git a/code/game/objects/items/weapons/RCL.dm b/code/game/objects/items/weapons/RCL.dm
index 73fbc9eb337..0309a28a0c7 100644
--- a/code/game/objects/items/weapons/RCL.dm
+++ b/code/game/objects/items/weapons/RCL.dm
@@ -34,7 +34,7 @@
loaded.amount = amount
else
return
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
to_chat(user, "You add the cables to [src]. It now contains [loaded.amount].")
else
..()
@@ -58,7 +58,7 @@
loaded.forceMove(user.loc)
user.put_in_hands(loaded)
loaded = null
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/twohanded/rcl/examine(mob/user)
. = ..()
@@ -71,7 +71,7 @@
active = FALSE
return ..()
-/obj/item/twohanded/rcl/update_icon()
+/obj/item/twohanded/rcl/update_icon_state()
if(!loaded)
icon_state = "rcl-0"
item_state = "rcl-0"
@@ -89,10 +89,9 @@
else
icon_state = "rcl-0"
item_state = "rcl-0"
- ..()
/obj/item/twohanded/rcl/proc/is_empty(mob/user, loud = 1)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
if(!loaded || !loaded.amount)
if(loud)
to_chat(user, "The last of the cables unreel from [src].")
@@ -151,4 +150,4 @@
loaded = new()
loaded.max_amount = max_amount
loaded.amount = max_amount
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
diff --git a/code/game/objects/items/weapons/cash.dm b/code/game/objects/items/weapons/cash.dm
index 23aaeb27cbc..8e6e34d8622 100644
--- a/code/game/objects/items/weapons/cash.dm
+++ b/code/game/objects/items/weapons/cash.dm
@@ -16,10 +16,9 @@
/obj/item/stack/spacecash/New(loc, amt = null)
..()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
-/obj/item/stack/spacecash/update_icon()
- ..()
+/obj/item/stack/spacecash/update_icon_state()
name = "[amount == max_amount ? "1000000" : amount] Credit[amount > 1 ? "s" : ""]"
if(amount >= 1 && amount < 10)
icon_state = "cashgreen"
diff --git a/code/game/objects/items/weapons/chrono_eraser.dm b/code/game/objects/items/weapons/chrono_eraser.dm
index c5847f68944..6c2b1b91409 100644
--- a/code/game/objects/items/weapons/chrono_eraser.dm
+++ b/code/game/objects/items/weapons/chrono_eraser.dm
@@ -63,8 +63,8 @@
TED = new(src.loc)
qdel(src)
-/obj/item/gun/energy/chrono_gun/update_icon()
- return
+/obj/item/gun/energy/chrono_gun/update_overlays()
+ return list()
/obj/item/gun/energy/chrono_gun/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override, bonus_spread = 0)
if(field)
@@ -177,7 +177,7 @@
cached_icon.Insert(mob_icon, "frame[i]")
mob_underlay = mutable_appearance(cached_icon, "frame1")
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
desc = initial(desc) + "
It appears to contain [target.name]."
START_PROCESSING(SSobj, src)
@@ -188,7 +188,7 @@
gun.field_disconnect(src)
return ..()
-/obj/structure/chrono_field/update_icon()
+/obj/structure/chrono_field/update_icon_state()
var/ttk_frame = 1 - (tickstokill / initial(tickstokill))
ttk_frame = clamp(CEILING(ttk_frame * CHRONO_FRAME_COUNT, 1), 1, CHRONO_FRAME_COUNT)
if(ttk_frame != RPpos)
@@ -217,7 +217,7 @@
captured.Paralyse(8 SECONDS)
if(captured.loc != src)
captured.forceMove(src)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
if(gun)
if(gun.field_check(src))
tickstokill--
diff --git a/code/game/objects/items/weapons/defib.dm b/code/game/objects/items/weapons/defib.dm
index f581cd50ecd..3d0930b1dc0 100644
--- a/code/game/objects/items/weapons/defib.dm
+++ b/code/game/objects/items/weapons/defib.dm
@@ -33,17 +33,16 @@
/obj/item/defibrillator/Initialize(mapload) //starts without a cell for rnd
. = ..()
paddles = new paddle_type(src)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/defibrillator/loaded/Initialize(mapload) //starts with hicap
. = ..()
cell = new(src)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
-/obj/item/defibrillator/update_icon()
+/obj/item/defibrillator/update_icon(updates=ALL)
update_power()
- update_overlays()
- update_charge()
+ ..()
/obj/item/defibrillator/examine(mob/user)
. = ..()
@@ -58,28 +57,25 @@
else
powered = FALSE
-/obj/item/defibrillator/proc/update_overlays()
- overlays.Cut()
+/obj/item/defibrillator/update_overlays()
+ . = ..()
if(paddles_on_defib)
- overlays += "[icon_state]-paddles"
- if(powered)
- overlays += "[icon_state]-powered"
- if(!cell)
- overlays += "[icon_state]-nocell"
+ . += "[icon_state]-paddles"
if(!safety)
- overlays += "[icon_state]-emagged"
-
-/obj/item/defibrillator/proc/update_charge()
- if(powered) //so it doesn't show charge if it's unpowered
- if(cell)
- var/ratio = cell.charge / cell.maxcharge
- ratio = CEILING(ratio*4, 1) * 25
- overlays += "[icon_state]-charge[ratio]"
+ . += "[icon_state]-emagged"
+ if(powered)
+ . += "[icon_state]-powered"
+ if(powered && cell)
+ var/ratio = cell.charge / cell.maxcharge
+ ratio = CEILING(ratio*4, 1) * 25
+ . += "[icon_state]-charge[ratio]"
+ if(!cell)
+ . += "[icon_state]-nocell"
/obj/item/defibrillator/CheckParts(list/parts_list)
..()
cell = locate(/obj/item/stock_parts/cell) in contents
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/defibrillator/ui_action_click()
toggle_paddles()
@@ -109,7 +105,7 @@
cell = null
to_chat(user, "You remove the cell from [src].")
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
return
/obj/item/defibrillator/emag_act(user as mob)
@@ -131,7 +127,7 @@
safety = TRUE
visible_message("[src] beeps: Safety protocols enabled!")
playsound(get_turf(src), 'sound/machines/defib_saftyon.ogg', 50, 0)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
..()
/obj/item/defibrillator/verb/toggle_paddles()
@@ -146,7 +142,7 @@
if(!usr.put_in_hands(paddles))
to_chat(user, "You need a free hand to hold the paddles!")
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
return
paddles.loc = user
paddles_on_defib = FALSE
@@ -154,7 +150,7 @@
//Remove from their hands and back onto the defib unit
remove_paddles(user)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
@@ -163,7 +159,7 @@
..()
if(slot != slot_back)
remove_paddles(user)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/defibrillator/item_action_slot_check(slot, mob/user)
if(slot == slot_back)
@@ -174,7 +170,7 @@
if(paddles in get_both_hands(M))
M.unEquip(paddles)
paddles_on_defib = TRUE
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
return
/obj/item/defibrillator/Destroy()
@@ -189,12 +185,12 @@
if(cell)
if(cell.charge < (paddles.revivecost+chrgdeductamt))
powered = FALSE
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
if(cell.use(chrgdeductamt))
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
return TRUE
else
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
return FALSE
/obj/item/defibrillator/proc/cooldowncheck(mob/user)
@@ -207,8 +203,8 @@
user.visible_message("[src] beeps: Charge depleted.")
playsound(get_turf(src), 'sound/machines/defib_failed.ogg', 50, 0)
paddles.cooldown = FALSE
- paddles.update_icon()
- update_icon()
+ paddles.update_icon(UPDATE_ICON_STATE)
+ update_icon(UPDATE_OVERLAYS)
/obj/item/defibrillator/compact
name = "compact defibrillator"
@@ -223,7 +219,7 @@
/obj/item/defibrillator/compact/loaded/Initialize(mapload)
. = ..()
cell = new(src)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/defibrillator/compact/item_action_slot_check(slot, mob/user)
if(slot == slot_belt)
@@ -242,7 +238,7 @@
/obj/item/defibrillator/compact/combat/loaded/Initialize(mapload)
. = ..()
cell = new(src)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/defibrillator/compact/advanced
name = "advanced compact defibrillator"
@@ -260,12 +256,12 @@
if(W == paddles)
paddles.unwield()
toggle_paddles()
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/defibrillator/compact/advanced/loaded/Initialize(mapload)
. = ..()
cell = new /obj/item/stock_parts/cell/bluespace/charging(src)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/defibrillator/compact/advanced/emp_act(severity)
if(world.time > next_emp_message)
@@ -277,7 +273,7 @@
if(W == paddles)
paddles.unwield()
toggle_paddles()
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
return
//paddles
@@ -306,10 +302,10 @@
defib = mainunit
loc = defib
busy = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return
-/obj/item/twohanded/shockpaddles/update_icon()
+/obj/item/twohanded/shockpaddles/update_icon_state()
icon_state = "[base_icon_state][wielded]"
item_state = "[base_icon_state][wielded]"
if(cooldown)
@@ -330,8 +326,8 @@
to_chat(user, "The paddles snap back into the main unit.")
defib.paddles_on_defib = TRUE
loc = defib
- defib.update_icon()
- update_icon()
+ defib.update_icon(UPDATE_OVERLAYS)
+ update_icon(UPDATE_ICON_STATE)
unwield(user)
/obj/item/twohanded/shockpaddles/on_mob_move(dir, mob/user)
@@ -384,12 +380,12 @@
defib.deductcharge(revivecost)
cooldown = TRUE
busy = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
defib.cooldowncheck(user)
return
user.visible_message("[user] begins to place [src] on [M.name]'s chest.", "You begin to place [src] on [M.name]'s chest.")
busy = TRUE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
var/mob/dead/observer/ghost = H.get_ghost(TRUE)
if(ghost && ghost.can_reenter_corpse)
to_chat(ghost, "Your heart is being defibrillated. Return to your body if you want to be revived! (Verbs -> Ghost -> Re-enter corpse)")
@@ -415,14 +411,14 @@
user.visible_message("[defib] buzzes: Patient's chest is obscured. Operation aborted.")
playsound(get_turf(src), 'sound/machines/defib_failed.ogg', 50, 0)
busy = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return
if(H.undergoing_cardiac_arrest())
if(!H.get_int_organ(/obj/item/organ/internal/heart) && !H.get_int_organ(/obj/item/organ/internal/brain/slime)) //prevents defibing someone still alive suffering from a heart attack attack if they lack a heart
user.visible_message("[defib] buzzes: Resuscitation failed - Failed to pick up any heart electrical activity.")
playsound(get_turf(src), 'sound/machines/defib_failed.ogg', 50, 0)
busy = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return
else
var/obj/item/organ/internal/heart/heart = H.get_int_organ(/obj/item/organ/internal/heart)
@@ -430,7 +426,7 @@
user.visible_message("[defib] buzzes: Resuscitation failed - Heart necrosis detected.")
playsound(get_turf(src), 'sound/machines/defib_failed.ogg', 50, 0)
busy = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return
H.set_heartattack(FALSE)
SEND_SIGNAL(H, COMSIG_LIVING_MINOR_SHOCK, 100)
@@ -442,7 +438,7 @@
defib.deductcharge(revivecost)
busy = FALSE
cooldown = TRUE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
defib.cooldowncheck(user)
return
if(H.stat == DEAD)
@@ -497,14 +493,14 @@
user.visible_message("[defib] buzzes: Resuscitation failed.")
playsound(get_turf(src), 'sound/machines/defib_failed.ogg', 50, 0)
defib.deductcharge(revivecost)
- update_icon()
cooldown = TRUE
+ update_icon(UPDATE_ICON_STATE)
defib.cooldowncheck(user)
else
user.visible_message("[defib] buzzes: Patient is not in a valid state. Operation aborted.")
playsound(get_turf(src), 'sound/machines/defib_failed.ogg', 50, 0)
busy = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/borg_defib
name = "defibrillator paddles"
@@ -551,10 +547,10 @@
R.cell.use(revivecost)
cooldown = TRUE
busy = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
spawn(50)
cooldown = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return
user.visible_message("[user] begins to place [src] on [M.name]'s chest.", "You begin to place [src] on [M.name]'s chest.")
busy = TRUE
@@ -619,16 +615,16 @@
if(isrobot(user))
var/mob/living/silicon/robot/R = user
R.cell.use(revivecost)
- update_icon()
cooldown = TRUE
+ update_icon(UPDATE_ICON_STATE)
spawn(50)
cooldown = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
else
user.visible_message("[user] buzzes: Patient is not in a valid state. Operation aborted.")
playsound(get_turf(src), 'sound/machines/defib_failed.ogg', 50, 0)
busy = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/twohanded/shockpaddles/syndicate
name = "combat defibrillator paddles"
diff --git a/code/game/objects/items/weapons/dice.dm b/code/game/objects/items/weapons/dice.dm
index 13a347d2c79..0b60332e700 100644
--- a/code/game/objects/items/weapons/dice.dm
+++ b/code/game/objects/items/weapons/dice.dm
@@ -304,8 +304,8 @@
icon_state = "d100"
sides = 100
-/obj/item/dice/d100/update_icon()
- return
+/obj/item/dice/d100/update_overlays()
+ return list()
/obj/item/dice/d20/e20
var/triggered = FALSE
@@ -333,7 +333,7 @@
comment = "NAT 20!"
else if(sides == 20 && result == 1)
comment = "Ouch, bad luck."
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
if(initial(icon_state) == "d00")
result = (result - 1) * 10
if(length(special_faces) == sides)
@@ -375,9 +375,9 @@
log_game("E20 detonated at [A.name] ([epicenter.x],[epicenter.y],[epicenter.z]) with a roll of [actual_result]. Triggered by: [key_name(user)]")
add_attack_logs(user, src, "detonated with a roll of [actual_result]", ATKLOG_FEW)
-/obj/item/dice/update_icon()
- overlays.Cut()
- overlays += "[icon_state][result]"
+/obj/item/dice/update_overlays()
+ . = ..()
+ . += "[icon_state][result]"
/obj/item/storage/box/dice
name = "Box of dice"
diff --git a/code/game/objects/items/weapons/dnascrambler.dm b/code/game/objects/items/weapons/dnascrambler.dm
index 78da396e30e..c726f40e10c 100644
--- a/code/game/objects/items/weapons/dnascrambler.dm
+++ b/code/game/objects/items/weapons/dnascrambler.dm
@@ -6,7 +6,7 @@
icon_state = "lepopen"
var/used = FALSE
-/obj/item/dnascrambler/update_icon()
+/obj/item/dnascrambler/update_icon_state()
if(used)
icon_state = "lepopen0"
else
@@ -52,5 +52,5 @@
add_attack_logs(user, target, "injected with [src]")
used = TRUE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
name = "used " + name
diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm
index 8913b38b262..aea420a3804 100644
--- a/code/game/objects/items/weapons/explosives.dm
+++ b/code/game/objects/items/weapons/explosives.dm
@@ -33,14 +33,14 @@
assemblyattacher = user.ckey
to_chat(user, "You add [A] to [src].")
playsound(src, 'sound/weapons/tap.ogg', 20, 1)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return
if(nadeassembly && istype(I, /obj/item/wirecutters))
playsound(src, I.usesound, 20, 1)
nadeassembly.loc = get_turf(src)
nadeassembly.master = null
nadeassembly = null
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return
..()
@@ -80,16 +80,16 @@
if(do_after(user, 50 * toolspeed, target = AM))
if(!user.unEquip(src))
return
- src.target = AM
+ target = AM
loc = null
message_admins("[key_name_admin(user)]([ADMIN_QUE(user,"?")]) ([ADMIN_FLW(user,"FLW")]) planted [src.name] on [target.name] at ([target.x],[target.y],[target.z] - JMP) with [det_time] second fuse",0,1)
log_game("[key_name(user)] planted [name] on [target.name] at ([target.x],[target.y],[target.z]) with [det_time] second fuse")
- target.overlays += image_overlay
+ AddComponent(/datum/component/persistent_overlay, image_overlay, target)
if(!nadeassembly)
to_chat(user, "You plant the bomb. Timer counting down from [det_time].")
- addtimer(CALLBACK(src, .proc/prime), det_time*10)
+ addtimer(CALLBACK(src, .proc/prime), det_time SECONDS)
/obj/item/grenade/plastic/suicide_act(mob/user)
message_admins("[key_name_admin(user)]([ADMIN_QUE(user,"?")]) ([ADMIN_FLW(user,"FLW")]) suicided with [src.name] at ([user.x],[user.y],[user.z] - JMP)",0,1)
@@ -120,7 +120,7 @@
user.gib()
return OBLITERATION
-/obj/item/grenade/plastic/update_icon()
+/obj/item/grenade/plastic/update_icon_state()
if(nadeassembly)
icon_state = "[item_state]1"
else
@@ -153,7 +153,6 @@
if(target)
if(!QDELETED(target))
location = get_turf(target)
- target.overlays -= image_overlay
if(!ex_breach && istype(target, /turf/simulated/wall)) //Walls get dismantled instead of destroyed to avoid making unwanted holes to space.
var/turf/simulated/wall/W = target
W.dismantle_wall(TRUE, TRUE)
@@ -219,7 +218,6 @@
if(target)
if(!QDELETED(target))
location = get_turf(target)
- target.overlays -= image_overlay
else
location = get_turf(src)
if(location)
diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm
index b28988adc8d..2d6a3da4c6b 100644
--- a/code/game/objects/items/weapons/flamethrower.dm
+++ b/code/game/objects/items/weapons/flamethrower.dm
@@ -48,14 +48,8 @@
igniter.flamethrower_process(location)
-/obj/item/flamethrower/update_icon()
- cut_overlays()
- if(igniter)
- add_overlay("+igniter[status]")
- if(ptank)
- add_overlay("+ptank")
+/obj/item/flamethrower/update_icon_state()
if(lit)
- add_overlay("+lit")
item_state = "flamethrower_1"
else
item_state = "flamethrower_0"
@@ -64,6 +58,15 @@
M.update_inv_l_hand()
M.update_inv_r_hand()
+/obj/item/flamethrower/update_overlays()
+ . = ..()
+ if(igniter)
+ . += "+igniter[status]"
+ if(ptank)
+ . += "+ptank"
+ if(lit)
+ . += "+lit"
+
/obj/item/flamethrower/can_enter_storage(obj/item/storage/S, mob/user)
if(lit)
to_chat(user, "[S] can't hold [src] while it's lit!")
diff --git a/code/game/objects/items/weapons/garrote.dm b/code/game/objects/items/weapons/garrote.dm
index dc9ffcd2bf2..8787c888b38 100644
--- a/code/game/objects/items/weapons/garrote.dm
+++ b/code/game/objects/items/weapons/garrote.dm
@@ -10,32 +10,24 @@
icon_state = "garrot_wrap"
w_class = WEIGHT_CLASS_TINY
var/mob/living/carbon/human/strangling
- var/improvised = 0
+ var/improvised = FALSE
var/garrote_time
/obj/item/twohanded/garrote/Destroy()
strangling = null
return ..()
-/obj/item/twohanded/garrote/update_icon()
+/obj/item/twohanded/garrote/update_icon_state()
if(strangling) // If we're strangling someone we want our icon to stay wielded
- icon_state = "garrot_unwrap"
- return
-
- icon_state = "garrot_[wielded ? "un" : ""]wrap"
+ icon_state = "garrot_[improvised ? "I_" : ""]unwrap"
+ else
+ icon_state = "garrot_[improvised ? "I_" : ""][wielded ? "un" : ""]wrap"
/obj/item/twohanded/garrote/improvised // Made via tablecrafting
name = "garrote"
desc = "A length of cable with a shoddily-carved wooden handle tied to either end.
You suspect you'd have to be behind the target to use this weapon effectively."
icon_state = "garrot_I_wrap"
- improvised = 1
-
-/obj/item/twohanded/garrote/improvised/update_icon()
- if(strangling)
- icon_state = "garrot_I_unwrap"
- return
-
- icon_state = "garrot_I_[wielded ? "un" : ""]wrap"
+ improvised = TRUE
/obj/item/twohanded/garrote/wield(mob/living/carbon/user)
if(strangling)
@@ -43,7 +35,7 @@
"You remove [src] from [strangling]'s neck.")
strangling = null
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
STOP_PROCESSING(SSobj, src)
else
@@ -99,7 +91,7 @@
garrote_time = world.time + 10
START_PROCESSING(SSobj, src)
strangling = M
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
playsound(src.loc, 'sound/weapons/cablecuff.ogg', 15, 1, -1)
@@ -112,14 +104,14 @@
/obj/item/twohanded/garrote/process()
if(!strangling)
// Our mark got gibbed or similar
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
STOP_PROCESSING(SSobj, src)
return
if(!istype(loc, /mob/living/carbon/human))
strangling = null
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
STOP_PROCESSING(SSobj, src)
return
@@ -137,7 +129,7 @@
"You lose your grip on [strangling]'s neck.")
strangling = null
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
STOP_PROCESSING(SSobj, src)
return
@@ -147,7 +139,7 @@
"You lose your grip on [strangling]'s neck.")
strangling = null
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
STOP_PROCESSING(SSobj, src)
return
diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm
index 88a0c8d0954..566372d52db 100644
--- a/code/game/objects/items/weapons/grenades/chem_grenade.dm
+++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm
@@ -50,22 +50,10 @@
return O
return null
-
-/obj/item/grenade/chem_grenade/proc/update_overlays()
- underlays = list()
- if(nadeassembly)
- underlays += "[nadeassembly.a_left.icon_state]_left"
- for(var/O in nadeassembly.a_left.attached_overlays)
- underlays += "[O]_l"
- underlays += "[nadeassembly.a_right.icon_state]_right"
- for(var/O in nadeassembly.a_right.attached_overlays)
- underlays += "[O]_r"
-
-/obj/item/grenade/chem_grenade/update_icon()
+/obj/item/grenade/chem_grenade/update_icon_state()
if(nadeassembly)
icon = 'icons/obj/assemblies/new_assemblies.dmi'
icon_state = bomb_state
- update_overlays()
var/obj/item/assembly/A = get_trigger()
if(stage != READY)
name = "bomb casing[label]"
@@ -90,6 +78,15 @@
else
icon_state += "_locked"
name = payload_name + "grenade" + label
+
+ underlays.Cut()
+ if(nadeassembly)
+ underlays += "[nadeassembly.a_left.icon_state]_left"
+ for(var/O in nadeassembly.a_left.attached_overlays)
+ underlays += "[O]_l"
+ underlays += "[nadeassembly.a_right.icon_state]_right"
+ for(var/O in nadeassembly.a_right.attached_overlays)
+ underlays += "[O]_r"
/obj/item/grenade/chem_grenade/attack_self(mob/user)
@@ -98,7 +95,7 @@
var/area/A = get_area(bombturf)
if(nadeassembly)
nadeassembly.attack_self(user)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
else if(clown_check(user))
// This used to go before the assembly check, but that has absolutely zero to do with priming the damn thing. You could spam the admins with it.
log_game("[key_name(usr)] has primed a [name] for detonation at [A.name] ([bombturf.x],[bombturf.y],[bombturf.z]) [contained].")
@@ -133,7 +130,7 @@
else
if(label)
label = null
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
to_chat(user, "You remove the label from [src].")
return 1
if(istype(I, /obj/item/screwdriver))
@@ -142,7 +139,7 @@
to_chat(user, "You lock the assembly.")
playsound(loc, prime_sound, 25, -3)
stage = READY
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
contained = ""
cores = "" // clear them out so no recursive logging by accidentally
for(var/obj/O in beakers)
@@ -195,7 +192,7 @@
assemblyattacher = user.ckey
stage = WIRED
to_chat(user, "You add [A] to [src]!")
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
else if(stage == EMPTY && istype(I, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = I
@@ -203,12 +200,12 @@
stage = WIRED
to_chat(user, "You rig [src].")
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
else if(stage == READY && istype(I, /obj/item/wirecutters))
to_chat(user, "You unlock the assembly.")
stage = WIRED
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
else if(stage == WIRED && istype(I, /obj/item/wrench))
to_chat(user, "You open the grenade and remove the contents.")
@@ -223,7 +220,7 @@
for(var/obj/O in beakers)
O.forceMove(get_turf(src))
beakers = list()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
//assembly stuff
@@ -286,7 +283,7 @@
O.forceMove(get_turf(src))
beakers = list()
stage = EMPTY
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return
if(nadeassembly)
@@ -448,7 +445,7 @@
beakers += B1
beakers += B2
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/grenade/chem_grenade/firefighting
@@ -466,7 +463,7 @@
beakers += B1
beakers += B2
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/grenade/chem_grenade/incendiary
payload_name = "incendiary"
@@ -485,7 +482,7 @@
beakers += B1
beakers += B2
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/grenade/chem_grenade/antiweed
@@ -506,7 +503,7 @@
beakers += B1
beakers += B2
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/grenade/chem_grenade/cleaner
@@ -526,7 +523,7 @@
beakers += B1
beakers += B2
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/grenade/chem_grenade/teargas
@@ -546,7 +543,7 @@
beakers += B1
beakers += B2
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/grenade/chem_grenade/facid
payload_name = "acid smoke"
@@ -566,7 +563,7 @@
beakers += B1
beakers += B2
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/grenade/chem_grenade/saringas
payload_name = "sarin gas"
@@ -585,7 +582,7 @@
beakers += B1
beakers += B2
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
#undef EMPTY
#undef WIRED
diff --git a/code/game/objects/items/weapons/implants/implant_mindshield.dm b/code/game/objects/items/weapons/implants/implant_mindshield.dm
index 97b02c2546d..9404dd9e275 100644
--- a/code/game/objects/items/weapons/implants/implant_mindshield.dm
+++ b/code/game/objects/items/weapons/implants/implant_mindshield.dm
@@ -42,8 +42,6 @@
/obj/item/implanter/mindshield/New()
imp = new /obj/item/implant/mindshield(src)
..()
- update_icon()
-
/obj/item/implantcase/mindshield
name = "implant case - 'mindshield'"
diff --git a/code/game/objects/items/weapons/implants/implantcase.dm b/code/game/objects/items/weapons/implants/implantcase.dm
index 6f331f2be53..365c73cefaa 100644
--- a/code/game/objects/items/weapons/implants/implantcase.dm
+++ b/code/game/objects/items/weapons/implants/implantcase.dm
@@ -12,18 +12,22 @@
materials = list(MAT_GLASS=500)
var/obj/item/implant/imp = null
-
-/obj/item/implantcase/update_icon()
+/obj/item/implantcase/proc/update_state()
if(imp)
- icon_state = "implantcase-[imp.item_color]"
origin_tech = imp.origin_tech
flags = imp.flags & ~DROPDEL
reagents = imp.reagents
else
- icon_state = "implantcase-0"
origin_tech = initial(origin_tech)
flags = initial(flags)
reagents = null
+ update_icon(UPDATE_ICON_STATE)
+
+/obj/item/implantcase/update_icon_state()
+ if(imp)
+ icon_state = "implantcase-[imp.item_color]"
+ else
+ icon_state = "implantcase-0"
/obj/item/implantcase/attackby(obj/item/W, mob/user, params)
@@ -38,8 +42,8 @@
I.imp.loc = src
imp = I.imp
I.imp = null
- update_icon()
- I.update_icon()
+ update_state()
+ I.update_icon(UPDATE_ICON_STATE)
else
if(imp)
if(I.imp)
@@ -47,8 +51,8 @@
imp.loc = I
I.imp = imp
imp = null
- update_icon()
- I.update_icon()
+ update_state()
+ I.update_icon(UPDATE_ICON_STATE)
/*else if(istype(W, /obj/item/ammo_casing/shotgun/implanter))
var/obj/item/ammo_casing/shotgun/implanter/I = W
@@ -57,7 +61,7 @@
/obj/item/implantcase/New()
..()
- update_icon()
+ update_state()
/obj/item/implantcase/tracking
diff --git a/code/game/objects/items/weapons/implants/implanter.dm b/code/game/objects/items/weapons/implants/implanter.dm
index 5fd031c2b2f..ef9a60f5b66 100644
--- a/code/game/objects/items/weapons/implants/implanter.dm
+++ b/code/game/objects/items/weapons/implants/implanter.dm
@@ -13,7 +13,7 @@
var/obj/item/implant/imp = null
-/obj/item/implanter/update_icon()
+/obj/item/implanter/update_icon_state()
if(imp)
icon_state = "implanter1"
origin_tech = imp.origin_tech
@@ -38,7 +38,7 @@
else
M.visible_message("[user] has implanted [M].", "[user] implants you.")
imp = null
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/implanter/attackby(obj/item/W, mob/user, params)
..()
@@ -48,7 +48,7 @@
/obj/item/implanter/New()
..()
spawn(1)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/implanter/adrenalin
diff --git a/code/game/objects/items/weapons/implants/implantpad.dm b/code/game/objects/items/weapons/implants/implantpad.dm
index 5f1cf0ae103..f80f1d1cda3 100644
--- a/code/game/objects/items/weapons/implants/implantpad.dm
+++ b/code/game/objects/items/weapons/implants/implantpad.dm
@@ -14,12 +14,11 @@
dropcase()
return ..()
-/obj/item/implantpad/update_icon()
+/obj/item/implantpad/update_icon_state()
if(case)
- src.icon_state = "implantpad-1"
+ icon_state = "implantpad-1"
else
- src.icon_state = "implantpad-0"
- return
+ icon_state = "implantpad-0"
/obj/item/implantpad/proc/addcase(mob/user as mob, obj/item/implantcase/C as obj)
if(!user || !C)
@@ -30,7 +29,7 @@
user.unEquip(C)
C.forceMove(src)
case = C
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/implantpad/proc/dropcase(mob/user as mob)
if(!case)
@@ -41,12 +40,12 @@
add_fingerprint(user)
case.add_fingerprint(user)
case = null
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return
case.forceMove(get_turf(src))
case = null
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/implantpad/verb/remove_implant()
set category = "Object"
diff --git a/code/game/objects/items/weapons/legcuffs.dm b/code/game/objects/items/weapons/legcuffs.dm
index 2201ee986e6..2b8d54b973a 100644
--- a/code/game/objects/items/weapons/legcuffs.dm
+++ b/code/game/objects/items/weapons/legcuffs.dm
@@ -26,7 +26,7 @@
/obj/item/restraints/legcuffs/beartrap/New()
..()
-/obj/item/restraints/legcuffs/beartrap/update_icon()
+/obj/item/restraints/legcuffs/beartrap/update_icon_state()
icon_state = "beartrap[armed]"
/obj/item/restraints/legcuffs/beartrap/Destroy()
@@ -43,7 +43,7 @@
..()
if(ishuman(user) && !user.stat && !user.restrained())
armed = !armed
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
to_chat(user, "[src] is now [armed ? "armed" : "disarmed"]")
/obj/item/restraints/legcuffs/beartrap/attackby(obj/item/I, mob/user) //Let's get explosive.
diff --git a/code/game/objects/items/weapons/mop.dm b/code/game/objects/items/weapons/mop.dm
index a833f591972..b25e31d3794 100644
--- a/code/game/objects/items/weapons/mop.dm
+++ b/code/game/objects/items/weapons/mop.dm
@@ -70,9 +70,8 @@
return ..()
/obj/item/mop/proc/janicart_insert(mob/user, obj/structure/janitorialcart/J)
+ J.mymop = src
J.put_in_cart(src, user)
- J.mymop=src
- J.update_icon()
/obj/item/mop/wash(mob/user, atom/source)
reagents.add_reagent("water", 5)
diff --git a/code/game/objects/items/weapons/paint.dm b/code/game/objects/items/weapons/paint.dm
index 1b333078354..f0378fe0316 100644
--- a/code/game/objects/items/weapons/paint.dm
+++ b/code/game/objects/items/weapons/paint.dm
@@ -14,6 +14,7 @@
possible_transfer_amounts = list(5,10,20,30,50,70)
volume = 70
container_type = OPENCONTAINER
+ blocks_emissive = EMISSIVE_BLOCK_GENERIC
/obj/item/reagent_containers/glass/paint/afterattack(turf/simulated/target, mob/user, proximity)
if(!proximity)
diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm
index 38639080270..16989a09521 100644
--- a/code/game/objects/items/weapons/storage/bags.dm
+++ b/code/game/objects/items/weapons/storage/bags.dm
@@ -45,7 +45,7 @@
playsound(loc, 'sound/items/eatfood.ogg', 50, 1, -1)
return TOXLOSS
-/obj/item/storage/bag/trash/update_icon()
+/obj/item/storage/bag/trash/update_icon_state()
switch(contents.len)
if(21 to INFINITY)
icon_state = "[initial(icon_state)]3"
@@ -59,14 +59,12 @@
var/mob/living/carbon/human/H = loc
H.update_inv_l_hand()
H.update_inv_r_hand()
- ..()
/obj/item/storage/bag/trash/cyborg
/obj/item/storage/bag/trash/proc/janicart_insert(mob/user, obj/structure/janitorialcart/J)
+ J.mybag = src
J.put_in_cart(src, user)
- J.mybag=src
- J.update_icon()
/obj/item/storage/bag/trash/cyborg/janicart_insert(mob/user, obj/structure/janitorialcart/J)
return
@@ -405,58 +403,51 @@
if(prob(10))
M.Weaken(4 SECONDS)
-/obj/item/storage/bag/tray/proc/rebuild_overlays()
- overlays.Cut()
+/obj/item/storage/bag/tray/update_icon_state()
+ return
+
+/obj/item/storage/bag/tray/update_overlays()
+ . = ..()
for(var/obj/item/I in contents)
- overlays += image("icon" = I.icon, "icon_state" = I.icon_state, "layer" = -1)
-
-/obj/item/storage/bag/tray/remove_from_storage(obj/item/W as obj, atom/new_location)
- ..()
- rebuild_overlays()
-
-/obj/item/storage/bag/tray/handle_item_insertion(obj/item/I, prevent_warning = 0)
- overlays += image("icon" = I.icon, "icon_state" = I.icon_state, "layer" = -1)
- ..()
+ . += image(icon = I.icon, icon_state = I.icon_state, layer = -1)
/obj/item/storage/bag/tray/cyborg
/obj/item/storage/bag/tray/cyborg/afterattack(atom/target, mob/user as mob)
if( isturf(target) || istype(target,/obj/structure/table) )
- var/foundtable = istype(target,/obj/structure/table/)
- if( !foundtable ) //it must be a turf!
+ var/found_table = istype(target,/obj/structure/table/)
+ if(!found_table) //it must be a turf!
for(var/obj/structure/table/T in target)
- foundtable = 1
+ found_table = TRUE
break
var/turf/dropspot
- if( !foundtable ) // don't unload things onto walls or other silly places.
+ if(!found_table) // don't unload things onto walls or other silly places.
dropspot = user.loc
else if( isturf(target) ) // they clicked on a turf with a table in it
dropspot = target
else // they clicked on a table
dropspot = target.loc
- overlays = null
-
- var/droppedSomething = 0
+ var/dropped_something = FALSE
for(var/obj/item/I in contents)
I.loc = dropspot
contents.Remove(I)
- droppedSomething = 1
- if(!foundtable && isturf(dropspot))
+ dropped_something = TRUE
+ if(!found_table && isturf(dropspot))
// if no table, presume that the person just shittily dropped the tray on the ground and made a mess everywhere!
spawn()
for(var/i = 1, i <= rand(1,2), i++)
if(I)
step(I, pick(NORTH,SOUTH,EAST,WEST))
sleep(rand(2,4))
- if( droppedSomething )
- if( foundtable )
+ if(dropped_something)
+ if(found_table)
user.visible_message("[user] unloads [user.p_their()] service tray.")
else
user.visible_message("[user] drops all the items on [user.p_their()] tray.")
-
+ update_icon(UPDATE_OVERLAYS)
return ..()
@@ -466,8 +457,8 @@
/obj/item/storage/bag/tray/cookies_tray/populate_contents() // By Azule Utama, thank you a lot!
for(var/i in 1 to 6)
var/obj/item/C = new cookie(src)
- handle_item_insertion(C) // Done this way so the tray actually has the cookies visible when spawned
- rebuild_overlays()
+ C.in_inventory = TRUE
+ update_icon(UPDATE_OVERLAYS)
/obj/item/storage/bag/tray/cookies_tray/sugarcookie
cookie = /obj/item/reagent_containers/food/snacks/sugarcookie
diff --git a/code/game/objects/items/weapons/storage/belt.dm b/code/game/objects/items/weapons/storage/belt.dm
index cd791b73751..9e3f30a73e0 100644
--- a/code/game/objects/items/weapons/storage/belt.dm
+++ b/code/game/objects/items/weapons/storage/belt.dm
@@ -13,14 +13,13 @@
/// Do we have overlays for items held inside the belt?
var/use_item_overlays = FALSE
-/obj/item/storage/belt/update_icon()
+/obj/item/storage/belt/update_overlays()
+ . = ..()
if(use_item_overlays)
- cut_overlays()
for(var/obj/item/I in contents)
var/image/belt_image = image(icon, I.belt_icon)
belt_image.color = I.color
- add_overlay(belt_image)
- ..()
+ . += belt_image
/obj/item/storage/belt/proc/can_use()
return is_equipped()
@@ -433,8 +432,7 @@
. = ..()
update_icon()
-/obj/item/storage/belt/lazarus/update_icon()
- ..()
+/obj/item/storage/belt/lazarus/update_icon_state()
icon_state = "[initial(icon_state)]_[length(contents)]"
/obj/item/storage/belt/lazarus/attackby(obj/item/I, mob/user)
@@ -465,8 +463,7 @@
for(var/I in 1 to 8)
new /obj/item/ammo_casing/shotgun/beanbag(src)
-/obj/item/storage/belt/bandolier/update_icon()
- ..()
+/obj/item/storage/belt/bandolier/update_icon_state()
icon_state = "[initial(icon_state)]_[length(contents)]"
/obj/item/storage/belt/bandolier/attackby(obj/item/I, mob/user)
@@ -611,13 +608,13 @@
return
playsound(src, 'sound/weapons/blade_unsheath.ogg', 20)
-/obj/item/storage/belt/rapier/update_icon()
- . = ..()
- icon_state = initial(icon_state)
- item_state = initial(item_state)
+/obj/item/storage/belt/rapier/update_icon_state()
if(length(contents))
icon_state = "[icon_state]-rapier"
item_state = "[item_state]-rapier"
+ else
+ icon_state = initial(icon_state)
+ item_state = initial(item_state)
if(isliving(loc))
var/mob/living/L = loc
L.update_inv_belt()
diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm
index 79136b78137..54c511fae82 100644
--- a/code/game/objects/items/weapons/storage/boxes.dm
+++ b/code/game/objects/items/weapons/storage/boxes.dm
@@ -724,10 +724,26 @@
foldable = null
var/design = NODESIGN
-/obj/item/storage/box/papersack/update_icon()
- if(!contents.len)
+/obj/item/storage/box/papersack/update_desc()
+ . = ..()
+ switch(design)
+ if(NODESIGN)
+ desc = "A sack neatly crafted out of paper."
+ if(NANOTRASEN)
+ desc = "A standard Nanotrasen paper lunch sack for loyal employees on the go."
+ if(SYNDI)
+ desc = "The design on this paper sack is a remnant of the notorious 'SyndieSnacks' program."
+ if(HEART)
+ desc = "A paper sack with a heart etched onto the side."
+ if(SMILE)
+ desc = "A paper sack with a crude smile etched onto the side."
+
+/obj/item/storage/box/papersack/update_icon_state()
+ item_state = "paperbag_[design]"
+ if(!length(contents))
icon_state = "[item_state]"
- else icon_state = "[item_state]_closed"
+ else
+ icon_state = "[item_state]_closed"
/obj/item/storage/box/papersack/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/pen))
@@ -746,19 +762,7 @@
return
to_chat(usr, "You make some modifications to [src] using your pen.")
design = switchDesign
- icon_state = "paperbag_[design]"
- item_state = "paperbag_[design]"
- switch(design)
- if(NODESIGN)
- desc = "A sack neatly crafted out of paper."
- if(NANOTRASEN)
- desc = "A standard Nanotrasen paper lunch sack for loyal employees on the go."
- if(SYNDI)
- desc = "The design on this paper sack is a remnant of the notorious 'SyndieSnacks' program."
- if(HEART)
- desc = "A paper sack with a heart etched onto the side."
- if(SMILE)
- desc = "A paper sack with a crude smile etched onto the side."
+ update_appearance(UPDATE_DESC|UPDATE_ICON_STATE)
return
else if(is_sharp(W))
if(!contents.len)
diff --git a/code/game/objects/items/weapons/storage/fancy.dm b/code/game/objects/items/weapons/storage/fancy.dm
index 044287be2ef..0125f77711c 100644
--- a/code/game/objects/items/weapons/storage/fancy.dm
+++ b/code/game/objects/items/weapons/storage/fancy.dm
@@ -18,10 +18,8 @@
resistance_flags = FLAMMABLE
var/icon_type
-/obj/item/storage/fancy/update_icon(itemremoved = 0)
- var/total_contents = length(contents) - itemremoved
- icon_state = "[icon_type]box[total_contents]"
- return
+/obj/item/storage/fancy/update_icon_state()
+ icon_state = "[icon_type]box[length(contents)]"
/obj/item/storage/fancy/examine(mob/user)
. = ..()
@@ -48,23 +46,23 @@
foldable = /obj/item/stack/sheet/cardboard
foldable_amt = 1
-/obj/item/storage/fancy/donut_box/update_icon()
- overlays.Cut()
-
+/obj/item/storage/fancy/donut_box/update_overlays()
+ . = ..()
for(var/I = 1 to length(contents))
var/obj/item/reagent_containers/food/snacks/donut/donut = contents[I]
var/icon/new_donut_icon = icon('icons/obj/food/containers.dmi', "donut_[donut.donut_sprite_type]")
new_donut_icon.Shift(EAST, 3 * (I-1))
- overlays += new_donut_icon
+ . += new_donut_icon
- overlays += icon('icons/obj/food/containers.dmi', "donutbox_front")
+ . += "donutbox_front"
/obj/item/storage/fancy/donut_box/populate_contents()
for(var/I in 1 to storage_slots)
new /obj/item/reagent_containers/food/snacks/donut(src)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/storage/fancy/donut_box/empty/populate_contents()
+ update_icon(UPDATE_OVERLAYS)
return
/*
@@ -138,11 +136,11 @@
new /obj/item/toy/crayon/black(src)
update_icon()
-/obj/item/storage/fancy/crayons/update_icon()
- overlays = list() //resets list
- overlays += image('icons/obj/crayons.dmi',"crayonbox")
+/obj/item/storage/fancy/crayons/update_overlays()
+ . = ..()
+ . += image('icons/obj/crayons.dmi',"crayonbox")
for(var/obj/item/toy/crayon/crayon in contents)
- overlays += image('icons/obj/crayons.dmi',crayon.colourName)
+ . += image('icons/obj/crayons.dmi',crayon.colourName)
/obj/item/storage/fancy/crayons/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/toy/crayon))
@@ -184,7 +182,7 @@
for(var/I in 1 to storage_slots)
new cigarette_type(src)
-/obj/item/storage/fancy/cigarettes/update_icon()
+/obj/item/storage/fancy/cigarettes/update_icon_state()
icon_state = "[initial(icon_state)][contents.len]"
/obj/item/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
@@ -325,10 +323,10 @@
for(var/I in 1 to storage_slots)
new /obj/item/rollingpaper(src)
-/obj/item/storage/fancy/rollingpapers/update_icon()
- overlays.Cut()
+/obj/item/storage/fancy/rollingpapers/update_overlays()
+ . = ..()
if(!contents.len)
- overlays += "[icon_state]_empty"
+ . += "[icon_state]_empty"
/*
* Vial Box
@@ -364,15 +362,18 @@
. = ..()
update_icon()
-/obj/item/storage/lockbox/vials/update_icon()
+/obj/item/storage/lockbox/vials/update_icon_state()
icon_state = "vialbox[length(contents)]"
cut_overlays()
+
+/obj/item/storage/lockbox/vials/update_overlays()
+ . = ..()
if(!broken)
- overlays += image(icon, src, "led[locked]")
+ . += "led[locked]"
if(locked)
- overlays += image(icon, src, "cover")
+ . += "cover"
else
- overlays += image(icon, src, "ledb")
+ . += "ledb"
/obj/item/storage/lockbox/vials/attackby(obj/item/I, mob/user, params)
..()
diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm
index 6a5301ef461..2fa5a0180c0 100644
--- a/code/game/objects/items/weapons/storage/storage.dm
+++ b/code/game/objects/items/weapons/storage/storage.dm
@@ -460,7 +460,7 @@
if(istype(src, /obj/item/storage/fancy))
var/obj/item/storage/fancy/F = src
- F.update_icon(TRUE)
+ F.update_icon()
for(var/_M in mobs_viewing)
var/mob/M = _M
diff --git a/code/game/objects/items/weapons/storage/toolbox.dm b/code/game/objects/items/weapons/storage/toolbox.dm
index 6e52acb93df..f159d136a02 100644
--- a/code/game/objects/items/weapons/storage/toolbox.dm
+++ b/code/game/objects/items/weapons/storage/toolbox.dm
@@ -24,16 +24,16 @@
. = ..()
if(has_latches)
if(prob(10))
- latches = "double_latch"
if(prob(1))
latches = "triple_latch"
- update_icon()
+ else
+ latches = "double_latch"
+ update_icon(UPDATE_OVERLAYS)
-/obj/item/storage/toolbox/update_icon()
- ..()
- cut_overlays()
+/obj/item/storage/toolbox/update_overlays()
+ . = ..()
if(has_latches)
- add_overlay(latches)
+ . += latches
/obj/item/storage/toolbox/emergency
name = "emergency toolbox"
diff --git a/code/game/objects/items/weapons/storage/wallets.dm b/code/game/objects/items/weapons/storage/wallets.dm
index a2f52ff243b..6e9f1173b76 100644
--- a/code/game/objects/items/weapons/storage/wallets.dm
+++ b/code/game/objects/items/weapons/storage/wallets.dm
@@ -36,17 +36,16 @@
if(.)
if(W == front_id)
front_id = null
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/storage/wallet/handle_item_insertion(obj/item/W as obj, prevent_warning = 0)
. = ..(W, prevent_warning)
if(.)
if(!front_id && istype(W, /obj/item/card/id))
front_id = W
- update_icon()
-
-/obj/item/storage/wallet/update_icon()
+ update_icon(UPDATE_ICON_STATE)
+/obj/item/storage/wallet/update_icon_state()
if(front_id)
switch(front_id.icon_state)
if("silver")
@@ -112,7 +111,7 @@
desc = "A cheap, [item_color] wallet from the arcade."
icon_state = "[item_color]_wallet"
-/obj/item/storage/wallet/color/update_icon()
+/obj/item/storage/wallet/color/update_icon_state()
if(front_id)
switch(front_id.icon_state)
if("silver")
diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm
index e7ce48833f0..327941dc04b 100644
--- a/code/game/objects/items/weapons/stunbaton.dm
+++ b/code/game/objects/items/weapons/stunbaton.dm
@@ -59,7 +59,7 @@
user.visible_message("[user] is putting the live [name] in [user.p_their()] mouth! It looks like [user.p_theyre()] trying to commit suicide.")
return FIRELOSS
-/obj/item/melee/baton/update_icon()
+/obj/item/melee/baton/update_icon_state()
if(turned_on)
icon_state = "[base_icon]_active"
else if(!cell)
@@ -97,7 +97,7 @@
if(cell.rigged)
cell = null
turned_on = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
if(cell.charge < (hitcost)) // If after the deduction the baton doesn't have enough charge for a stun hit it turns off.
turned_on = FALSE
update_icon()
@@ -117,7 +117,7 @@
I.forceMove(src)
cell = I
to_chat(user, "You install [I] into [src].")
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/melee/baton/screwdriver_act(mob/living/user, obj/item/I)
if(!cell)
@@ -131,7 +131,7 @@
cell.update_icon()
cell = null
turned_on = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/melee/baton/attack_self(mob/user)
if(cell?.charge >= hitcost)
diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm
index 62bd83dd263..a5a11491c32 100644
--- a/code/game/objects/items/weapons/tanks/tanks.dm
+++ b/code/game/objects/items/weapons/tanks/tanks.dm
@@ -61,7 +61,7 @@
if(!silent)
to_chat(C, "You are not wearing a suitable mask or helmet.")
return FALSE
- if(M.mask_adjusted) // If the mask is equipped but pushed down
+ if(M.up) // If the mask is equipped but pushed away
M.adjustmask(C) // Adjust it back
if(!silent)
diff --git a/code/game/objects/items/weapons/tape.dm b/code/game/objects/items/weapons/tape.dm
index ccc1a9ddbbd..3a20fd356d7 100644
--- a/code/game/objects/items/weapons/tape.dm
+++ b/code/game/objects/items/weapons/tape.dm
@@ -10,8 +10,7 @@
/obj/item/stack/tape_roll/New(loc, amount=null)
..()
-
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/stack/tape_roll/attack(mob/living/carbon/human/M, mob/living/user)
if(!istype(M)) //What good is a duct tape mask if you are unable to speak?
@@ -42,7 +41,7 @@
M.equip_to_slot(G, slot_wear_mask)
G.add_fingerprint(user)
-/obj/item/stack/tape_roll/update_icon()
+/obj/item/stack/tape_roll/update_icon_state()
var/amount = get_amount()
if((amount <= 2) && (amount > 0))
icon_state = "taperoll"
@@ -54,4 +53,3 @@
icon_state = "taperoll-4"
else
icon_state = "taperoll-4"
- ..()
diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm
index c137568ddad..fa19fd50124 100644
--- a/code/game/objects/items/weapons/twohanded.dm
+++ b/code/game/objects/items/weapons/twohanded.dm
@@ -202,9 +202,8 @@
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 100, ACID = 30)
resistance_flags = FIRE_PROOF
-/obj/item/twohanded/fireaxe/update_icon() //Currently only here to fuck with the on-mob icons.
+/obj/item/twohanded/fireaxe/update_icon_state() //Currently only here to fuck with the on-mob icons.
icon_state = "fireaxe[wielded]"
- ..()
/obj/item/twohanded/fireaxe/afterattack(atom/A, mob/user, proximity)
if(!proximity)
@@ -221,7 +220,7 @@
force_wielded = 23
needs_permit = TRUE
-/obj/item/twohanded/fireaxe/boneaxe/update_icon()
+/obj/item/twohanded/fireaxe/boneaxe/update_icon_state()
icon_state = "bone_axe[wielded]"
/obj/item/twohanded/fireaxe/energized
@@ -231,7 +230,7 @@
var/charge = 30
var/max_charge = 30
-/obj/item/twohanded/fireaxe/energized/update_icon()
+/obj/item/twohanded/fireaxe/energized/update_icon_state()
if(wielded)
icon_state = "fireaxe2"
else
@@ -298,14 +297,13 @@
if(!blade_color)
blade_color = pick("red", "blue", "green", "purple")
-/obj/item/twohanded/dualsaber/update_icon()
+/obj/item/twohanded/dualsaber/update_icon_state()
if(wielded)
icon_state = "dualsaber[blade_color][wielded]"
set_light(brightness_on, l_color=colormap[blade_color])
else
icon_state = "dualsaber0"
set_light(0)
- ..()
/obj/item/twohanded/dualsaber/attack(mob/target, mob/living/user)
if(HAS_TRAIT(user, TRAIT_HULK))
@@ -406,7 +404,7 @@
needs_permit = TRUE
var/icon_prefix = "spearglass"
-/obj/item/twohanded/spear/update_icon()
+/obj/item/twohanded/spear/update_icon_state()
icon_state = "[icon_prefix][wielded]"
/obj/item/twohanded/spear/CheckParts(list/parts_list)
@@ -609,12 +607,11 @@
attack_verb = list("sawed", "cut", "hacked", "carved", "cleaved", "butchered", "felled", "timbered")
sharp = TRUE
-/obj/item/twohanded/chainsaw/update_icon()
+/obj/item/twohanded/chainsaw/update_icon_state()
if(wielded)
icon_state = "chainsaw[wielded]"
else
icon_state = "chainsaw0"
- ..()
/obj/item/twohanded/chainsaw/attack(mob/living/target, mob/living/user)
if(wielded)
@@ -685,9 +682,8 @@
if(charged < 2)
charged++
-/obj/item/twohanded/singularityhammer/update_icon() //Currently only here to fuck with the on-mob icons.
+/obj/item/twohanded/singularityhammer/update_icon_state() //Currently only here to fuck with the on-mob icons.
icon_state = "singulohammer[wielded]"
- ..()
/obj/item/twohanded/singularityhammer/proc/vortex(turf/pull, mob/wielder)
for(var/atom/movable/X in orange(5, pull))
@@ -762,9 +758,8 @@
L.Stun(6 SECONDS)
shock(L)
-/obj/item/twohanded/mjollnir/update_icon() //Currently only here to fuck with the on-mob icons.
+/obj/item/twohanded/mjollnir/update_icon_state() //Currently only here to fuck with the on-mob icons.
icon_state = "mjollnir[wielded]"
- ..()
/obj/item/twohanded/knighthammer
name = "singuloth knight's hammer"
@@ -793,9 +788,8 @@
if(charged < 5)
charged++
-/obj/item/twohanded/knighthammer/update_icon() //Currently only here to fuck with the on-mob icons.
+/obj/item/twohanded/knighthammer/update_icon_state() //Currently only here to fuck with the on-mob icons.
icon_state = "knighthammer[wielded]"
- ..()
/obj/item/twohanded/knighthammer/afterattack(atom/A, mob/user, proximity)
if(!proximity)
diff --git a/code/game/objects/obj_defense.dm b/code/game/objects/obj_defense.dm
index a61e302ddc5..a18ba5038d3 100644
--- a/code/game/objects/obj_defense.dm
+++ b/code/game/objects/obj_defense.dm
@@ -209,8 +209,8 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e
if(!(resistance_flags & ON_FIRE) && (resistance_flags & FLAMMABLE) && !(resistance_flags & FIRE_PROOF))
resistance_flags |= ON_FIRE
SSfires.processing[src] = src
- add_overlay(GLOB.fire_overlay, TRUE)
- return 1
+ add_overlay(custom_fire_overlay ? custom_fire_overlay : GLOB.fire_overlay)
+ return TRUE
///called when the obj is destroyed by fire
/obj/proc/burn()
@@ -222,7 +222,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e
/obj/proc/extinguish()
if(resistance_flags & ON_FIRE)
resistance_flags &= ~ON_FIRE
- cut_overlay(GLOB.fire_overlay, TRUE)
+ cut_overlay(custom_fire_overlay ? custom_fire_overlay : GLOB.fire_overlay, TRUE)
SSfires.processing -= src
///Called when the obj is hit by a tesla bolt.
diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm
index 88e712ebddd..38d1eb303ed 100644
--- a/code/game/objects/objs.dm
+++ b/code/game/objects/objs.dm
@@ -18,6 +18,7 @@
var/damage_deflection = 0
var/resistance_flags = NONE // INDESTRUCTIBLE
+ var/custom_fire_overlay // Update_fire_overlay will check if a different icon state should be used
var/acid_level = 0 //how much acid is on that obj
@@ -168,9 +169,6 @@
/obj/proc/interact(mob/user)
return
-/obj/proc/update_icon()
- SEND_SIGNAL(src, COMSIG_OBJ_UPDATE_ICON)
-
/mob/proc/unset_machine()
if(machine)
UnregisterSignal(machine, COMSIG_PARENT_QDELETING)
diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm
index 4f51f7bf41c..43fb525e1f7 100644
--- a/code/game/objects/structures/bedsheet_bin.dm
+++ b/code/game/objects/structures/bedsheet_bin.dm
@@ -284,7 +284,7 @@ LINEN BINS
. += "There are [amount] bed sheets in the bin."
-/obj/structure/bedsheetbin/update_icon()
+/obj/structure/bedsheetbin/update_icon_state()
switch(amount)
if(0)
icon_state = "linenbin-empty"
@@ -313,6 +313,7 @@ LINEN BINS
I.forceMove(src)
sheets.Add(I)
amount++
+ update_icon(UPDATE_ICON_STATE)
to_chat(user, "You put [I] in [src].")
else if(amount && !hidden && I.w_class < WEIGHT_CLASS_BULKY) //make sure there's sheets to hide it among, make sure nothing else is hidden in there.
if(I.flags & ABSTRACT)
@@ -346,7 +347,7 @@ LINEN BINS
hidden.loc = user.loc
to_chat(user, "[hidden] falls out of [B]!")
hidden = null
-
+ update_icon(UPDATE_ICON_STATE)
add_fingerprint(user)
@@ -365,7 +366,7 @@ LINEN BINS
B.loc = loc
to_chat(user, "You telekinetically remove [B] from [src].")
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
if(hidden)
hidden.loc = loc
diff --git a/code/game/objects/structures/coathanger.dm b/code/game/objects/structures/coathanger.dm
index 59bd99a7e15..21fef42091d 100644
--- a/code/game/objects/structures/coathanger.dm
+++ b/code/game/objects/structures/coathanger.dm
@@ -9,44 +9,42 @@
/obj/structure/coatrack/attack_hand(mob/user as mob)
user.visible_message("[user] takes [coat] off \the [src].", "You take [coat] off the \the [src]")
if(!user.put_in_active_hand(coat))
- coat.loc = get_turf(user)
+ coat.forceMove(get_turf(user))
coat = null
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/structure/coatrack/attackby(obj/item/W as obj, mob/user as mob, params)
- var/can_hang = 0
+ var/can_hang = FALSE
for(var/T in allowed)
if(istype(W,T))
- can_hang = 1
+ can_hang = TRUE
if(can_hang && !coat)
user.visible_message("[user] hangs [W] on \the [src].", "You hang [W] on the \the [src]")
coat = W
user.drop_item(src)
- coat.loc = src
- update_icon()
- else
- return ..()
+ coat.forceMove(src)
+ update_icon(UPDATE_OVERLAYS)
+ return
+ return ..()
/obj/structure/coatrack/CanPass(atom/movable/mover, turf/target, height=0)
- var/can_hang = 0
+ var/can_hang = FALSE
for(var/T in allowed)
if(istype(mover,T))
- can_hang = 1
-
+ can_hang = TRUE
if(can_hang && !coat)
- src.visible_message("[mover] lands on \the [src].")
+ visible_message("[mover] lands on \the [src].")
coat = mover
- coat.loc = src
- update_icon()
- return 0
- else
- return 1
+ coat.forceMove(src)
+ update_icon(UPDATE_OVERLAYS)
+ return
+ return ..()
-/obj/structure/coatrack/update_icon()
- overlays.Cut()
+/obj/structure/coatrack/update_overlays()
+ . = ..()
if(istype(coat, /obj/item/clothing/suit/storage/labcoat))
- overlays += image(icon, icon_state = "coat_lab")
+ . += "coat_lab"
if(istype(coat, /obj/item/clothing/suit/storage/labcoat/cmo))
- overlays += image(icon, icon_state = "coat_cmo")
+ . += "coat_cmo"
if(istype(coat, /obj/item/clothing/suit/storage/det_suit))
- overlays += image(icon, icon_state = "coat_det")
+ . += "coat_det"
diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm
index 6ee9d43978c..1a6773524b5 100644
--- a/code/game/objects/structures/crates_lockers/closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets.dm
@@ -24,6 +24,7 @@
var/storage_capacity = 30 //This is so that someone can't pack hundreds of items in a locker/crate then open it in a populated area to crash clients.
var/material_drop = /obj/item/stack/sheet/metal
var/material_drop_amount = 2
+ var/transparent
// Please dont override this unless you absolutely have to
/obj/structure/closet/Initialize(mapload)
@@ -298,23 +299,22 @@
return
to_chat(usr, "This mob type can't use this verb.")
-/obj/structure/closet/update_icon()//Putting the welded stuff in updateicon() so it's easy to overwrite for special cases (Fridges, cabinets, and whatnot)
+/obj/structure/closet/update_icon_state()
if(!opened)
- icon_state = icon_closed
+ icon_state = "[icon_closed][transparent ? "_trans" : ""]"
else
- icon_state = icon_opened
- update_overlays()
+ icon_state = "[icon_opened][transparent ? "_trans" : ""]"
-/obj/structure/closet/proc/update_overlays(transparent = FALSE)
- cut_overlays()
+/obj/structure/closet/update_overlays()
+ . = ..()
if(transparent && opened)
- add_overlay("[open_door_sprite]_trans")
+ . += "[open_door_sprite]_trans"
return
if(opened)
- add_overlay(open_door_sprite)
+ . += open_door_sprite
return
if(welded)
- add_overlay("welded")
+ . += "welded"
// Objects that try to exit a locker by stepping were doing so successfully,
// and due to an oversight in turf/Enter() were going through walls. That
@@ -399,20 +399,17 @@
return TRUE
/obj/structure/closet/bluespace/proc/UpdateTransparency(atom/movable/AM, atom/location)
- var/transparent = FALSE
+ transparent = FALSE
for(var/atom/A in location)
if(A.density && A != src && A != AM)
transparent = TRUE
break
- icon_opened = transparent ? "bluespace_open_trans" : "bluespace_open"
- icon_closed = transparent ? "bluespace_trans" : "bluespace"
- icon_state = opened ? icon_opened : icon_closed
- update_overlays(transparent)
+ update_icon()
/obj/structure/closet/bluespace/Crossed(atom/movable/AM, oldloc)
if(AM.density)
- icon_state = opened ? "bluespace_open_trans" : "bluespace_trans"
- update_overlays(TRUE)
+ transparent = TRUE
+ update_icon()
/obj/structure/closet/bluespace/Move(NewLoc, direct) // Allows for "phasing" throug objects but doesn't allow you to stuff your EOC homebois in one of these and push them through walls.
var/turf/T = get_turf(NewLoc)
diff --git a/code/game/objects/structures/crates_lockers/closets/coffin.dm b/code/game/objects/structures/crates_lockers/closets/coffin.dm
index f0e319ae5c1..bfd0bb4e0bd 100644
--- a/code/game/objects/structures/crates_lockers/closets/coffin.dm
+++ b/code/game/objects/structures/crates_lockers/closets/coffin.dm
@@ -11,12 +11,15 @@
open_sound_volume = 25
close_sound_volume = 50
-/obj/structure/closet/coffin/update_icon()
+/obj/structure/closet/coffin/update_icon_state()
if(!opened)
icon_state = icon_closed
else
icon_state = icon_opened
+/obj/structure/closet/coffin/update_overlays()
+ return list()
+
/obj/structure/closet/coffin/sarcophagus
name = "sarcophagus"
icon_state = "sarc"
diff --git a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm
index f7985d9636c..8f93ccfe7da 100644
--- a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm
+++ b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm
@@ -20,7 +20,7 @@
/obj/structure/closet/fireaxecabinet/populate_contents()
fireaxe = new/obj/item/twohanded/fireaxe(src)
has_axe = "full"
- update_icon() // So its initial icon doesn't show it without the fireaxe
+ update_icon(UPDATE_ICON_STATE) // So its initial icon doesn't show it without the fireaxe
/obj/structure/closet/fireaxecabinet/examine(mob/user)
. = ..()
@@ -37,7 +37,7 @@
if(do_after(user, 20 * O.toolspeed, target = src))
locked = FALSE
to_chat(user, " You disable the locking modules.")
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return
else if(istype(O, /obj/item))
user.changeNext_move(CLICK_CD_MELEE)
@@ -58,7 +58,7 @@
smashed = TRUE
locked = FALSE
localopened = TRUE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return
if(istype(O, /obj/item/twohanded/fireaxe) && localopened)
if(!fireaxe)
@@ -73,7 +73,7 @@
has_axe = "full"
contents += F
to_chat(user, "You place \the [F] back in the [name].")
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
else
if(smashed)
return
@@ -107,7 +107,7 @@
fireaxe = null
add_fingerprint(user)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return
if(smashed)
return
@@ -119,7 +119,7 @@
to_chat(user, "You telekinetically remove \the [fireaxe].")
has_axe = "empty"
fireaxe = null
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return
attack_hand(user)
@@ -153,7 +153,7 @@
to_chat(usr, "[src] is empty.")
else
to_chat(usr, "[src] is closed.")
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/structure/closet/fireaxecabinet/attack_ai(mob/user as mob)
if(smashed)
@@ -180,14 +180,17 @@
else
flick("fireaxe_[has_axe]_opening", src)
sleep(10)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
-/obj/structure/closet/fireaxecabinet/update_icon()
+/obj/structure/closet/fireaxecabinet/update_icon_state()
if(localopened && !smashed)
icon_state = "fireaxe_[has_axe]_open"
- return
- icon_state = "fireaxe_[has_axe]_[hitstaken]hits"
+ else
+ icon_state = "fireaxe_[has_axe]_[hitstaken]hits"
+
+/obj/structure/closet/fireaxecabinet/update_overlays()
+ return list()
/obj/structure/closet/fireaxecabinet/open()
return
diff --git a/code/game/objects/structures/crates_lockers/closets/gimmick.dm b/code/game/objects/structures/crates_lockers/closets/gimmick.dm
index c7d992c8c13..f9df8a47b96 100644
--- a/code/game/objects/structures/crates_lockers/closets/gimmick.dm
+++ b/code/game/objects/structures/crates_lockers/closets/gimmick.dm
@@ -10,12 +10,15 @@
close_sound_volume = 50
max_integrity = 70
-/obj/structure/closet/cabinet/update_icon()
+/obj/structure/closet/cabinet/update_icon_state()
if(!opened)
icon_state = icon_closed
else
icon_state = icon_opened
+/obj/structure/closet/cabinet/update_overlays()
+ return list()
+
/obj/structure/closet/acloset
name = "strange closet"
desc = "It looks alien!"
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/guncabinet.dm b/code/game/objects/structures/crates_lockers/closets/secure/guncabinet.dm
index a3141815a2b..ab0ba13a026 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/guncabinet.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/guncabinet.dm
@@ -21,7 +21,7 @@
update_icon()
/obj/structure/closet/secure_closet/guncabinet/update_overlays()
- cut_overlays()
+ . = list()
if(!opened)
var/lasers = 0
var/ballistics = 0
@@ -43,10 +43,10 @@
gun.icon_state = "projectile"
gun.pixel_x = i*4
- add_overlay(gun)
+ . += gun
- add_overlay("door")
+ . += "door"
if(broken)
- add_overlay("off")
+ . += "off"
else if(locked)
- add_overlay("locked")
+ . += "locked"
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm
index 55ad93a743d..d6cb82c095b 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm
@@ -73,7 +73,7 @@
locked = FALSE
add_overlay("sparking")
to_chat(user, "You break the lock on [src].")
- addtimer(CALLBACK(src, .proc/update_icon), 1 SECONDS)
+ addtimer(CALLBACK(src, /atom/.proc/update_icon), 1 SECONDS)
/obj/structure/closet/secure_closet/attack_hand(mob/user)
add_fingerprint(user)
diff --git a/code/game/objects/structures/crates_lockers/closets/statue.dm b/code/game/objects/structures/crates_lockers/closets/statue.dm
index dff70c677cc..a18dd3c2842 100644
--- a/code/game/objects/structures/crates_lockers/closets/statue.dm
+++ b/code/game/objects/structures/crates_lockers/closets/statue.dm
@@ -105,9 +105,12 @@
/obj/structure/closet/statue/verb_toggleopen()
return
-/obj/structure/closet/statue/update_icon()
+/obj/structure/closet/statue/update_icon_state()
return
+/obj/structure/closet/statue/update_overlays()
+ return list()
+
/obj/structure/closet/statue/proc/shatter(mob/user)
if(user)
user.dust()
diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm
index 30ac9743a3a..0b05438aa51 100644
--- a/code/game/objects/structures/crates_lockers/crates.dm
+++ b/code/game/objects/structures/crates_lockers/crates.dm
@@ -15,11 +15,10 @@
// A list of beacon names that the crate will announce the arrival of, when delivered.
var/list/announce_beacons = list()
-/obj/structure/closet/crate/update_icon()
- ..()
- cut_overlays()
+/obj/structure/closet/crate/update_overlays()
+ . = ..()
if(manifest)
- add_overlay("manifest")
+ . += "manifest"
/obj/structure/closet/crate/can_open()
return TRUE
@@ -175,15 +174,15 @@
locked = TRUE
can_be_emaged = TRUE
-/obj/structure/closet/crate/secure/update_icon()
- ..()
+/obj/structure/closet/crate/secure/update_overlays()
+ . = ..()
if(broken)
- add_overlay(emag)
+ . += emag
return
if(locked)
- add_overlay(redlight)
+ . += redlight
else
- add_overlay(greenlight)
+ . += greenlight
/obj/structure/closet/crate/secure/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1)
if(prob(tamperproof) && damage_amount >= DAMAGE_PRECISION)
diff --git a/code/game/objects/structures/crates_lockers/largecrate.dm b/code/game/objects/structures/crates_lockers/largecrate.dm
index ca2f8f762ad..8b97aefeb3a 100644
--- a/code/game/objects/structures/crates_lockers/largecrate.dm
+++ b/code/game/objects/structures/crates_lockers/largecrate.dm
@@ -10,11 +10,10 @@
. = ..()
update_icon()
-/obj/structure/largecrate/update_icon()
- ..()
- overlays.Cut()
+/obj/structure/largecrate/update_overlays()
+ . = ..()
if(manifest)
- overlays += "manifest"
+ . += "manifest"
/obj/structure/largecrate/attack_hand(mob/user as mob)
if(manifest)
diff --git a/code/game/objects/structures/depot.dm b/code/game/objects/structures/depot.dm
index 919d8c2ea70..b64bcbc2c98 100644
--- a/code/game/objects/structures/depot.dm
+++ b/code/game/objects/structures/depot.dm
@@ -86,7 +86,7 @@
if(istype(depotarea))
if(!depotarea.used_self_destruct)
depotarea.used_self_destruct = TRUE // Silences all further alerts from this point onwards.
- depotarea.updateicon()
+ depotarea.update_state()
depotarea.shields_down()
else
log_debug("[src] at [x],[y],[z] failed depotarea istype check during Initialize()! Either it was spawned outside the depot area (bad idea), or a bug is happening.")
@@ -103,7 +103,7 @@
depotarea = get_area(src)
if(istype(depotarea))
depotarea.destroyed = TRUE
- depotarea.updateicon()
+ depotarea.update_state()
for(var/obj/structure/closet/L in range(30, T))
for(var/obj/O in L)
diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm
index f9771f51d67..63b8da19f48 100644
--- a/code/game/objects/structures/displaycase.dm
+++ b/code/game/objects/structures/displaycase.dm
@@ -28,7 +28,7 @@
trophy_message = showpiece_entry["trophy_message"]
if(start_showpiece_type)
showpiece = new start_showpiece_type (src)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/structure/displaycase/Destroy()
QDEL_NULL(electronics)
@@ -81,7 +81,7 @@
open = TRUE
new /obj/item/shard(drop_location())
playsound(src, "shatter", 70, TRUE)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
trigger_alarm()
/obj/structure/displaycase/proc/trigger_alarm()
@@ -95,17 +95,17 @@
playsound(src, 'sound/machines/burglar_alarm.ogg', 50, 0)
sleep(74) // 7.4 seconds long
-/obj/structure/displaycase/update_icon()
- cut_overlays()
+/obj/structure/displaycase/update_overlays()
+ . = ..()
if(broken)
- add_overlay("glassbox_broken")
+ . += "glassbox_broken"
if(showpiece)
var/mutable_appearance/showpiece_overlay = mutable_appearance(showpiece.icon, showpiece.icon_state)
showpiece_overlay.copy_overlays(showpiece)
showpiece_overlay.transform *= 0.6
- add_overlay(showpiece_overlay)
+ . += showpiece_overlay
if(!open && !broken)
- add_overlay("glassbox_closed")
+ . += "glassbox_closed"
/obj/structure/displaycase/attackby(obj/item/I, mob/user, params)
if(I.GetID() && !broken && openable)
@@ -131,7 +131,7 @@
broken = FALSE
open = FALSE
obj_integrity = max_integrity
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
else
return ..()
@@ -174,7 +174,7 @@
/obj/structure/displaycase/proc/toggle_lock()
open = !open
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/structure/displaycase/attack_hand(mob/user)
user.changeNext_move(CLICK_CD_MELEE)
@@ -182,7 +182,7 @@
to_chat(user, "You deactivate the hover field built into the case.")
dump()
add_fingerprint(user)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
return
else
//prevents remote "kicks" with TK
diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm
index 0ba1faa2033..c63db29ec37 100644
--- a/code/game/objects/structures/door_assembly.dm
+++ b/code/game/objects/structures/door_assembly.dm
@@ -22,7 +22,7 @@
/obj/structure/door_assembly/Initialize(mapload)
. = ..()
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
update_name()
/obj/structure/door_assembly/Destroy()
@@ -131,7 +131,7 @@
else
return ..()
update_name()
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/structure/door_assembly/crowbar_act(mob/user, obj/item/I)
if(state != AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER )
@@ -152,7 +152,7 @@
ae = electronics
electronics = null
ae.forceMove(loc)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
update_name()
/obj/structure/door_assembly/screwdriver_act(mob/user, obj/item/I)
@@ -189,7 +189,7 @@
electronics.forceMove(door)
electronics = null
qdel(src)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/structure/door_assembly/wirecutter_act(mob/user, obj/item/I)
if(state != AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS)
@@ -203,7 +203,7 @@
to_chat(user, "You cut the wires from the airlock assembly.")
new/obj/item/stack/cable_coil(get_turf(user), 1)
state = AIRLOCK_ASSEMBLY_NEEDS_WIRES
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/structure/door_assembly/wrench_act(mob/user, obj/item/I)
if(state != AIRLOCK_ASSEMBLY_NEEDS_WIRES)
@@ -256,17 +256,18 @@
return
to_chat(user, "You disassemble the airlock assembly.")
deconstruct(TRUE)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
-/obj/structure/door_assembly/update_icon()
- overlays.Cut()
+/obj/structure/door_assembly/update_overlays()
+ . = ..()
if(!glass)
- overlays += get_airlock_overlay("fill_construction", icon)
+ . += get_airlock_overlay("fill_construction", icon)
else if(glass)
- overlays += get_airlock_overlay("glass_construction", overlays_file)
- overlays += get_airlock_overlay("panel_c[state+1]", overlays_file)
+ . += get_airlock_overlay("glass_construction", overlays_file)
+ . += get_airlock_overlay("panel_c[state+1]", overlays_file)
-/obj/structure/door_assembly/proc/update_name()
+/obj/structure/door_assembly/update_name()
+ . = ..()
name = ""
switch(state)
if(AIRLOCK_ASSEMBLY_NEEDS_WIRES)
@@ -289,7 +290,7 @@
if(electronics)
target.electronics = source.electronics
source.electronics.forceMove(target)
- target.update_icon()
+ target.update_icon(UPDATE_OVERLAYS)
target.update_name()
qdel(source)
diff --git a/code/game/objects/structures/electricchair.dm b/code/game/objects/structures/electricchair.dm
index c83d06f6550..27e1e2670bb 100644
--- a/code/game/objects/structures/electricchair.dm
+++ b/code/game/objects/structures/electricchair.dm
@@ -6,10 +6,11 @@
var/obj/item/assembly/shock_kit/part = null
var/last_time = 1.0
var/delay_time = 50
+ var/shocking = FALSE
/obj/structure/chair/e_chair/Initialize(mapload, obj/item/assembly/shock_kit/sk)
. = ..()
- overlays += image('icons/obj/chairs.dmi', src, "echair_over", MOB_LAYER + 1, dir)
+ update_icon(UPDATE_OVERLAYS)
if(sk)
part = sk
@@ -50,17 +51,25 @@
/obj/structure/chair/e_chair/rotate()
..()
- overlays.Cut()
- overlays += image('icons/obj/chairs.dmi', src, "echair_over", MOB_LAYER + 1, dir) //there's probably a better way of handling this, but eh. -Pete
+ update_icon(UPDATE_OVERLAYS)
+
+/obj/structure/chair/e_chair/update_icon_state()
+ icon_state = "echair[shocking]"
+
+/obj/structure/chair/e_chair/update_overlays()
+ . = ..()
+ . += image('icons/obj/chairs.dmi', src, "echair_over", MOB_LAYER + 1, dir)
/obj/structure/chair/e_chair/proc/shock()
if(last_time + delay_time > world.time)
return
last_time = world.time
- icon_state = "echair1"
+ shocking = TRUE
+ update_icon(UPDATE_ICON_STATE)
spawn(delay_time)
- icon_state = "echair0"
+ shocking = FALSE
+ update_icon(UPDATE_ICON_STATE)
// special power handling
var/area/A = get_area(src)
@@ -70,7 +79,7 @@
return
A.use_power(5000, EQUIP)
var/light = A.power_light
- A.updateicon()
+ A.update_icon(UPDATE_ICON_STATE)
flick("echair_shock", src)
do_sparks(12, 1, src)
@@ -83,4 +92,4 @@
spawn(1)
buckled_mob.electrocute_act(110, src, 1)
A.power_light = light
- A.updateicon()
+ A.update_icon(UPDATE_ICON_STATE)
diff --git a/code/game/objects/structures/engicart.dm b/code/game/objects/structures/engicart.dm
index 1ed5c86fa83..f36e8da0aa1 100644
--- a/code/game/objects/structures/engicart.dm
+++ b/code/game/objects/structures/engicart.dm
@@ -37,49 +37,49 @@
if(!myglass)
put_in_cart(I, user)
myglass=I
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
else
to_chat(user, fail_msg)
else if(istype(I, /obj/item/stack/sheet/metal))
if(!mymetal)
put_in_cart(I, user)
mymetal=I
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
else
to_chat(user, fail_msg)
else if(istype(I, /obj/item/stack/sheet/plasteel))
if(!myplasteel)
put_in_cart(I, user)
myplasteel=I
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
else
to_chat(user, fail_msg)
else if(istype(I, /obj/item/flashlight))
if(!myflashlight)
put_in_cart(I, user)
myflashlight=I
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
else
to_chat(user, fail_msg)
else if(istype(I, /obj/item/storage/toolbox/mechanical))
if(!mybluetoolbox)
put_in_cart(I, user)
mybluetoolbox=I
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
else
to_chat(user, fail_msg)
else if(istype(I, /obj/item/storage/toolbox/electrical))
if(!myyellowtoolbox)
put_in_cart(I, user)
myyellowtoolbox=I
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
else
to_chat(user, fail_msg)
else if(istype(I, /obj/item/storage/toolbox))
if(!myredtoolbox)
put_in_cart(I, user)
myredtoolbox=I
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
else
to_chat(user, fail_msg)
else if(istype(I, /obj/item/wrench))
@@ -120,6 +120,7 @@
var/datum/browser/popup = new(user, "engicart", name, 240, 160)
popup.set_content(dat)
popup.open()
+
/obj/structure/engineeringcart/Topic(href, href_list)
if(!in_range(src, usr))
return
@@ -162,22 +163,22 @@
to_chat(user, "You take [myyellowtoolbox] from [src].")
myyellowtoolbox = null
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
updateUsrDialog()
-/obj/structure/engineeringcart/update_icon()
- overlays.Cut()
+/obj/structure/engineeringcart/update_overlays()
+ . = ..()
if(myglass)
- overlays += "cart_glass"
+ . += "cart_glass"
if(mymetal)
- overlays += "cart_metal"
+ . += "cart_metal"
if(myplasteel)
- overlays += "cart_plasteel"
+ . += "cart_plasteel"
if(myflashlight)
- overlays += "cart_flashlight"
+ . += "cart_flashlight"
if(mybluetoolbox)
- overlays += "cart_bluetoolbox"
+ . += "cart_bluetoolbox"
if(myredtoolbox)
- overlays += "cart_redtoolbox"
+ . += "cart_redtoolbox"
if(myyellowtoolbox)
- overlays += "cart_yellowtoolbox"
+ . += "cart_yellowtoolbox"
diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm
index 360342384a3..5231d659687 100644
--- a/code/game/objects/structures/extinguisher.dm
+++ b/code/game/objects/structures/extinguisher.dm
@@ -45,7 +45,7 @@
return
playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3)
opened = !opened
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/structure/extinguisher_cabinet/Destroy()
QDEL_NULL(has_extinguisher)
@@ -59,7 +59,7 @@
/obj/structure/extinguisher_cabinet/handle_atom_del(atom/A)
if(A == has_extinguisher)
has_extinguisher = null
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/structure/extinguisher_cabinet/attackby(obj/item/O, mob/user, params)
if(isrobot(user) || isalien(user))
@@ -71,17 +71,17 @@
user.drop_item(O)
contents += O
has_extinguisher = O
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
to_chat(user, "You place [O] in [src].")
return TRUE
else
playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3)
opened = !opened
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
else if(user.a_intent != INTENT_HARM)
playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3)
opened = !opened
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
else
return ..()
@@ -122,7 +122,7 @@
else
playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3)
opened = !opened
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/structure/extinguisher_cabinet/attack_tk(mob/user)
if(has_extinguisher)
@@ -135,7 +135,7 @@
else
playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3)
opened = !opened
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/structure/extinguisher_cabinet/obj_break(damage_flag)
if(!broken && !(flags & NODECONSTRUCT))
@@ -144,7 +144,7 @@
if(has_extinguisher)
has_extinguisher.forceMove(loc)
has_extinguisher = null
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/structure/extinguisher_cabinet/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
@@ -154,7 +154,7 @@
has_extinguisher = null
qdel(src)
-/obj/structure/extinguisher_cabinet/update_icon()
+/obj/structure/extinguisher_cabinet/update_icon_state()
if(!opened)
icon_state = "extinguisher_closed"
return
diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm
index 853a1bf3310..091e8cfdd6b 100644
--- a/code/game/objects/structures/false_walls.dm
+++ b/code/game/objects/structures/false_walls.dm
@@ -84,7 +84,7 @@
opening = FALSE
update_icon()
-/obj/structure/falsewall/update_icon()
+/obj/structure/falsewall/update_icon_state()
if(opening)
smoothing_flags = NONE
clear_smooth_overlays()
diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm
index 172f92c9bf9..a2bb074fd75 100644
--- a/code/game/objects/structures/grille.dm
+++ b/code/game/objects/structures/grille.dm
@@ -50,9 +50,9 @@
/obj/structure/grille/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
. = ..()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
-/obj/structure/grille/update_icon()
+/obj/structure/grille/update_icon_state()
if(QDELETED(src) || broken)
return
diff --git a/code/game/objects/structures/inflatable.dm b/code/game/objects/structures/inflatable.dm
index bbbedfec433..9dc455fa8dc 100644
--- a/code/game/objects/structures/inflatable.dm
+++ b/code/game/objects/structures/inflatable.dm
@@ -41,7 +41,7 @@
T.air_update_turf(TRUE)
/obj/structure/inflatable/CanPass(atom/movable/mover, turf/target, height=0)
- return 0
+ return
/obj/structure/inflatable/CanAtmosPass(turf/T)
return !density
@@ -105,14 +105,12 @@
/obj/structure/inflatable/door //Based on mineral door code
name = "inflatable door"
-
- icon = 'icons/obj/inflatable.dmi'
icon_state = "door_closed"
torn = /obj/item/inflatable/door/torn
intact = /obj/item/inflatable/door
var/state_open = FALSE
- var/isSwitchingStates = FALSE
+ var/is_operating = FALSE
/obj/structure/inflatable/door/detailed_examine()
return "Click the door to open or close it. It only stops air while closed.
\
@@ -123,10 +121,10 @@
return
else if(isrobot(user)) //but cyborgs can
if(get_dist(user,src) <= 1) //not remotely though
- return TryToSwitchState(user)
+ return try_to_operate(user)
/obj/structure/inflatable/door/attack_hand(mob/user as mob)
- return TryToSwitchState(user)
+ return try_to_operate(user)
/obj/structure/inflatable/door/CanPass(atom/movable/mover, turf/target, height=0)
if(istype(mover, /obj/effect/beam))
@@ -136,8 +134,8 @@
/obj/structure/inflatable/door/CanAtmosPass(turf/T)
return !density
-/obj/structure/inflatable/door/proc/TryToSwitchState(atom/user)
- if(isSwitchingStates)
+/obj/structure/inflatable/door/proc/try_to_operate(atom/user)
+ if(is_operating)
return
if(ismob(user))
var/mob/M = user
@@ -147,42 +145,28 @@
if(iscarbon(M))
var/mob/living/carbon/C = M
if(!C.handcuffed)
- SwitchState()
+ operate()
else
- SwitchState()
+ operate()
else if(istype(user, /obj/mecha))
- SwitchState()
+ operate()
-/obj/structure/inflatable/door/proc/SwitchState()
- if(state_open)
- Close()
+/obj/structure/inflatable/door/proc/operate()
+ is_operating = TRUE
+ //playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 100, 1)
+ if(!state_open)
+ flick("door_opening",src)
else
- Open()
+ flick("door_closing",src)
+ sleep(10)
+ density = !density
+ opacity = !opacity
+ state_open = !state_open
+ update_icon(UPDATE_ICON_STATE)
+ is_operating = FALSE
air_update_turf(1)
-/obj/structure/inflatable/door/proc/Open()
- isSwitchingStates = TRUE
- //playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 100, 1)
- flick("door_opening",src)
- sleep(10)
- density = FALSE
- opacity = FALSE
- state_open = TRUE
- update_icon()
- isSwitchingStates = FALSE
-
-/obj/structure/inflatable/door/proc/Close()
- isSwitchingStates = TRUE
- //playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 100, 1)
- flick("door_closing",src)
- sleep(10)
- density = TRUE
- opacity = FALSE
- state_open = FALSE
- update_icon()
- isSwitchingStates = FALSE
-
-/obj/structure/inflatable/door/update_icon()
+/obj/structure/inflatable/door/update_icon_state()
if(state_open)
icon_state = "door_open"
else
diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm
index bfae20cf65c..0c0ce95a705 100644
--- a/code/game/objects/structures/janicart.dm
+++ b/code/game/objects/structures/janicart.dm
@@ -40,7 +40,7 @@
return
/obj/structure/janitorialcart/on_reagent_change()
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/structure/janitorialcart/attackby(obj/item/I, mob/user, params)
var/fail_msg = "There is already one of those in [src]."
@@ -66,7 +66,7 @@
if(!myspray)
put_in_cart(I, user)
myspray=I
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
else
to_chat(user, fail_msg)
else if(istype(I, /obj/item/lightreplacer))
@@ -79,7 +79,7 @@
if(signs < max_signs)
put_in_cart(I, user)
signs++
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
else
to_chat(user, "[src] can't hold any more signs.")
else if(istype(I, /obj/item/crowbar))
@@ -163,22 +163,22 @@
WARNING("Signs ([signs]) didn't match contents")
signs = 0
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
updateUsrDialog()
-/obj/structure/janitorialcart/update_icon()
- overlays = null
+/obj/structure/janitorialcart/update_overlays()
+ . = ..()
if(mybag)
- overlays += "cart_garbage"
+ . += "cart_garbage"
if(mymop)
- overlays += "cart_mop"
+ . += "cart_mop"
if(myspray)
- overlays += "cart_spray"
+ . += "cart_spray"
if(myreplacer)
- overlays += "cart_replacer"
+ . += "cart_replacer"
if(signs)
- overlays += "cart_sign[signs]"
+ . += "cart_sign[signs]"
if(reagents.total_volume > 0)
var/image/reagentsImage = image(icon,src,"cart_reagents0")
reagentsImage.alpha = 150
@@ -192,4 +192,4 @@
if(76 to 100)
reagentsImage.icon_state = "cart_reagents4"
reagentsImage.icon += mix_color_from_reagents(reagents.reagent_list)
- add_overlay(reagentsImage)
+ . += reagentsImage
diff --git a/code/game/objects/structures/ladders.dm b/code/game/objects/structures/ladders.dm
index cb093c9521a..bcc7a7e0515 100644
--- a/code/game/objects/structures/ladders.dm
+++ b/code/game/objects/structures/ladders.dm
@@ -55,7 +55,7 @@
down.update_icon()
up = down = null
-/obj/structure/ladder/update_icon()
+/obj/structure/ladder/update_icon_state()
if(up && down)
icon_state = "ladder11"
@@ -198,5 +198,5 @@
. = ..()
set_light(light_range, light_power) //magical glowing anchor
-/obj/structure/ladder/unbreakable/dive_point/update_icon()
+/obj/structure/ladder/unbreakable/dive_point/update_icon_state()
return
diff --git a/code/game/objects/structures/mineral_doors.dm b/code/game/objects/structures/mineral_doors.dm
index 41f568e6a54..1a8ad73211c 100644
--- a/code/game/objects/structures/mineral_doors.dm
+++ b/code/game/objects/structures/mineral_doors.dm
@@ -13,7 +13,7 @@
rad_insulation = RAD_MEDIUM_INSULATION
var/initial_state
var/state_open = FALSE
- var/isSwitchingStates = FALSE
+ var/is_operating = FALSE
var/close_delay = -1 //-1 if does not auto close.
var/hardness = 1
@@ -41,20 +41,20 @@
/obj/structure/mineral_door/Bumped(atom/user)
..()
if(!state_open)
- return TryToSwitchState(user)
+ return try_to_operate(user)
/obj/structure/mineral_door/attack_ai(mob/user) //those aren't machinery, they're just big fucking slabs of a mineral
if(isAI(user)) //so the AI can't open it
return
else if(isrobot(user) && Adjacent(user)) //but cyborgs can, but not remotely
- return TryToSwitchState(user)
+ return try_to_operate(user)
/obj/structure/mineral_door/attack_hand(mob/user)
- return TryToSwitchState(user)
+ return try_to_operate(user)
/obj/structure/mineral_door/attack_ghost(mob/user)
if(user.can_advanced_admin_interact())
- SwitchState()
+ operate()
/obj/structure/mineral_door/CanPass(atom/movable/mover, turf/target, height = 0)
if(istype(mover, /obj/effect/beam))
@@ -64,8 +64,8 @@
/obj/structure/mineral_door/CanAtmosPass(turf/T)
return !density
-/obj/structure/mineral_door/proc/TryToSwitchState(atom/user)
- if(isSwitchingStates)
+/obj/structure/mineral_door/proc/try_to_operate(atom/user)
+ if(is_operating)
return
if(isliving(user))
var/mob/living/M = user
@@ -75,52 +75,35 @@
if(iscarbon(M))
var/mob/living/carbon/C = M
if(!C.handcuffed)
- SwitchState()
+ operate()
else
- SwitchState()
+ operate()
else if(istype(user, /obj/mecha))
- SwitchState()
+ operate()
-/obj/structure/mineral_door/proc/SwitchState()
- if(state_open)
- Close()
+/obj/structure/mineral_door/proc/operate()
+ is_operating = TRUE
+ if(!state_open)
+ playsound(loc, openSound, 100, 1)
+ flick("[initial_state]opening",src)
else
- Open()
-
-/obj/structure/mineral_door/proc/Open()
- isSwitchingStates = TRUE
- playsound(loc, openSound, 100, 1)
- flick("[initial_state]opening",src)
+ var/turf/T = get_turf(src)
+ for(var/mob/living/L in T)
+ return
+ playsound(loc, closeSound, 100, 1)
+ flick("[initial_state]closing",src)
sleep(10)
- density = FALSE
- opacity = FALSE
- state_open = TRUE
+ density = !density
+ opacity = !opacity
+ state_open = !state_open
air_update_turf(1)
- update_icon()
- isSwitchingStates = FALSE
+ update_icon(UPDATE_ICON_STATE)
+ is_operating = FALSE
- if(close_delay != -1)
- spawn(close_delay)
- Close()
+ if(state_open && close_delay != -1)
+ addtimer(CALLBACK(src, .proc/operate), close_delay)
-/obj/structure/mineral_door/proc/Close()
- if(isSwitchingStates || !state_open)
- return
- var/turf/T = get_turf(src)
- for(var/mob/living/L in T)
- return
- isSwitchingStates = TRUE
- playsound(loc, closeSound, 100, 1)
- flick("[initial_state]closing",src)
- sleep(10)
- density = TRUE
- opacity = TRUE
- state_open = FALSE
- air_update_turf(1)
- update_icon()
- isSwitchingStates = FALSE
-
-/obj/structure/mineral_door/update_icon()
+/obj/structure/mineral_door/update_icon_state()
if(state_open)
icon_state = "[initial_state]open"
else
@@ -180,7 +163,7 @@
opacity = FALSE
rad_insulation = RAD_VERY_LIGHT_INSULATION
-/obj/structure/mineral_door/transparent/Close()
+/obj/structure/mineral_door/transparent/operate()
..()
set_opacity(0)
@@ -235,6 +218,6 @@
damageSound = 'sound/effects/attackblob.ogg'
sheetType = null
-/obj/structure/mineral_door/resin/TryToSwitchState(atom/user)
+/obj/structure/mineral_door/resin/try_to_operate(atom/user)
if(isalien(user))
return ..()
diff --git a/code/game/objects/structures/mop_bucket.dm b/code/game/objects/structures/mop_bucket.dm
index a1bc67571ae..326d8380dd5 100644
--- a/code/game/objects/structures/mop_bucket.dm
+++ b/code/game/objects/structures/mop_bucket.dm
@@ -6,7 +6,7 @@
density = TRUE
container_type = OPENCONTAINER
face_while_pulling = FALSE
- var/obj/item/mop/mymop = null
+ var/obj/item/mop/stored_mop = null
var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite
/obj/structure/mopbucket/Initialize(mapload)
@@ -29,12 +29,12 @@
/obj/structure/mopbucket/attackby(obj/item/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/mop))
- var/obj/item/mop/m = W
- if(m.reagents.total_volume < m.reagents.maximum_volume)
- m.wet_mop(src, user)
+ var/obj/item/mop/M = W
+ if(M.reagents.total_volume < M.reagents.maximum_volume)
+ M.wet_mop(src, user)
return
- if(!mymop)
- m.janicart_insert(user, src)
+ if(!stored_mop)
+ M.janicart_insert(user, src)
return
to_chat(user, "Theres already a mop in the mopbucket.")
return
@@ -47,12 +47,12 @@
return
/obj/structure/mopbucket/on_reagent_change()
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
-/obj/structure/mopbucket/update_icon()
- overlays.Cut()
- if(mymop)
- overlays += image(icon,"mopbucket_mop")
+/obj/structure/mopbucket/update_overlays()
+ . = ..()
+ if(stored_mop)
+ . += "mopbucket_mop"
if(reagents.total_volume > 0)
var/image/reagentsImage = image(icon, src, "mopbucket_reagents0")
reagentsImage.alpha = 150
@@ -66,15 +66,15 @@
if(76 to 100)
reagentsImage.icon_state = "mopbucket_reagents4"
reagentsImage.icon += mix_color_from_reagents(reagents.reagent_list)
- add_overlay(reagentsImage)
+ . += reagentsImage
/obj/structure/mopbucket/attack_hand(mob/living/user)
. = ..()
- if(mymop)
- user.put_in_hands(mymop)
- to_chat(user, "You take [mymop] from [src].")
- mymop = null
- update_icon()
+ if(stored_mop)
+ user.put_in_hands(stored_mop)
+ to_chat(user, "You take [stored_mop] from [src].")
+ stored_mop = null
+ update_icon(UPDATE_OVERLAYS)
return
diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm
index 5b1df6272fe..869c19e5448 100644
--- a/code/game/objects/structures/morgue.dm
+++ b/code/game/objects/structures/morgue.dm
@@ -40,36 +40,39 @@
/obj/structure/morgue/Initialize()
. = ..()
- update()
+ update_icon(update_state())
-/obj/structure/morgue/proc/update()
- cut_overlays()
- if(!connected)
- if(contents.len)
- var/mob/living/M = locate() in contents
- var/obj/structure/closet/body_bag/B = locate() in contents
- if(M==null) M = locate() in B
-
- if(M)
- var/mob/dead/observer/G = M.get_ghost()
- if(M.mind && !M.mind.suicided)
- if(M.client)
- status = REVIVABLE
- else if(G && G.client) //There is a ghost and it is connected to the server
- status = GHOST_CONNECTED
- else
- status = UNREVIVABLE
- else
- status = UNREVIVABLE
- else
- status = NOT_BODY
- else
- status = EMPTY_MORGUE
- add_overlay("morgue_[status]")
- else
+/obj/structure/morgue/proc/update_state()
+ . = UPDATE_OVERLAYS
+ if(connected)
status = EXTENDED_TRAY
+ return
+ if(!length(contents))
+ status = EMPTY_MORGUE
+ return
+ var/mob/living/M = locate() in contents
+ var/obj/structure/closet/body_bag/B = locate() in contents
+ if(!M)
+ M = locate() in B
+ if(!M)
+ status = NOT_BODY
+ return
+ var/mob/dead/observer/G = M.get_ghost()
+ if(M.mind && !M.mind.suicided)
+ if(M.client)
+ status = REVIVABLE
+ return
+ if(G && G.client) //There is a ghost and it is connected to the server
+ status = GHOST_CONNECTED
+ return
+ status = UNREVIVABLE
+
+/obj/structure/morgue/update_overlays()
+ . = ..()
+ if(!connected)
+ . += "morgue_[status]"
if(name != initial(name))
- add_overlay("morgue_label")
+ . += "morgue_label"
/obj/structure/morgue/examine(mob/user)
. = ..()
@@ -110,7 +113,7 @@
playsound(loc, open_sound, 50, 1)
connect()
add_fingerprint(user)
- update()
+ update_icon(update_state())
return
/obj/structure/morgue/attackby(P as obj, mob/user as mob, params)
@@ -118,7 +121,7 @@
var/t = rename_interactive(user, P)
if(isnull(t))
return
- update()
+ update_icon(UPDATE_OVERLAYS)
add_fingerprint(user)
return
return ..()
@@ -127,7 +130,7 @@
if(name != initial(name))
to_chat(user, "You cut the tag off the morgue.")
name = initial(name)
- update()
+ update_icon(UPDATE_OVERLAYS)
return TRUE
/obj/structure/morgue/relaymove(mob/user as mob)
@@ -196,7 +199,7 @@
if(!( A.anchored ))
A.forceMove(connected)
connected.connected = null
- connected.update()
+ connected.update_icon(UPDATE_OVERLAYS)
add_fingerprint(user)
qdel(src)
return
@@ -256,17 +259,18 @@
/obj/structure/crematorium/Initialize(mapload)
. = ..()
- update()
+ update_icon(UPDATE_OVERLAYS)
-/obj/structure/crematorium/proc/update()
- cut_overlays()
- if(!connected)
- add_overlay("crema_closed")
- if(cremating)
- add_overlay("crema_active")
- return
- if(contents.len)
- add_overlay("crema_full")
+/obj/structure/crematorium/update_overlays()
+ . = ..()
+ if(connected)
+ return
+ . += "crema_closed"
+ if(cremating)
+ . += "crema_active"
+ return
+ if(length(contents))
+ . += "crema_full"
/obj/structure/crematorium/ex_act(severity)
switch(severity)
@@ -306,7 +310,7 @@
playsound(loc, open_sound, 50, 1)
connect()
add_fingerprint(user)
- update()
+ update_icon(UPDATE_OVERLAYS)
/obj/structure/crematorium/attackby(P as obj, mob/user as mob, params)
if(istype(P, /obj/item/pen))
@@ -327,7 +331,7 @@
var/turf/T = get_step(src, SOUTH)
if(T.contents.Find(connected))
connected.connected = src
- update()
+ update_icon(UPDATE_OVERLAYS)
for(var/atom/movable/A in src)
A.forceMove(connected.loc)
connected.icon_state = "crema_tray"
@@ -349,7 +353,7 @@
cremating = TRUE
locked = TRUE
- update()
+ update_icon(UPDATE_OVERLAYS)
for(var/mob/living/M in search_contents_for(/mob/living))
if(QDELETED(M))
@@ -371,7 +375,7 @@
sleep(30)
cremating = FALSE
locked = FALSE
- update()
+ update_icon(UPDATE_OVERLAYS)
playsound(loc, 'sound/machines/ding.ogg', 50, 1)
return
@@ -419,7 +423,7 @@
A.forceMove(connected)
//Foreach goto(26)
connected.connected = null
- connected.update()
+ connected.update_icon(UPDATE_OVERLAYS)
add_fingerprint(user)
qdel(src)
return
@@ -488,7 +492,7 @@
if(istype(C)) //We found our corpse, is it inside a morgue?
morgue = get(C.loc, /obj/structure/morgue)
if(morgue)
- morgue.update()
+ morgue.update_icon(UPDATE_OVERLAYS)
#undef EXTENDED_TRAY
#undef EMPTY_MORGUE
diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm
index 36f33388f50..737894bd880 100644
--- a/code/game/objects/structures/safe.dm
+++ b/code/game/objects/structures/safe.dm
@@ -112,7 +112,7 @@ GLOBAL_LIST_EMPTY(safes)
/obj/structure/safe/examine_status(mob/user)
return
-/obj/structure/safe/update_icon()
+/obj/structure/safe/update_icon_state()
if(open)
if(broken)
icon_state = "[initial(icon_state)]-open-broken"
@@ -124,17 +124,13 @@ GLOBAL_LIST_EMPTY(safes)
else
icon_state = initial(icon_state)
- var/list/overlays_to_cut = list(drill_overlay)
- if(!drill_timer)
- overlays_to_cut += progress_bar
-
- cut_overlay(overlays_to_cut)
-
+/obj/structure/safe/update_overlays()
+ . = ..()
if(istype(drill, /obj/item/thermal_drill))
var/drill_icon = istype(drill, /obj/item/thermal_drill/diamond_drill) ? "d" : "h"
var/state = "[initial(icon_state)]_[drill_icon]-drill-[drill_timer ? "on" : "off"]"
drill_overlay = image(icon = 'icons/effects/drill.dmi', icon_state = state, pixel_x = drill_x_offset, pixel_y = drill_y_offset)
- add_overlay(drill_overlay)
+ . += drill_overlay
/obj/structure/safe/attack_ghost(mob/user)
if(..() || drill)
diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm
index a861fec8d4a..712bc602826 100644
--- a/code/game/objects/structures/tables_racks.dm
+++ b/code/game/objects/structures/tables_racks.dm
@@ -49,15 +49,15 @@
/obj/structure/table/proc/deconstruction_hints(mob/user)
return "The top is screwed on, but the main bolts are also visible."
-/obj/structure/table/update_icon()
+/obj/structure/table/update_icon(updates=ALL)
+ . = ..()
+ update_smoothing()
+
+/obj/structure/table/update_icon_state()
if((smoothing_flags & (SMOOTH_CORNERS|SMOOTH_BITMASK)) && !flipped)
icon_state = ""
- QUEUE_SMOOTH(src)
- QUEUE_SMOOTH_NEIGHBORS(src)
if(flipped)
- clear_smooth_overlays()
-
var/type = 0
var/subtype = null
for(var/direction in list(turn(dir,90), turn(dir,-90)) )
@@ -80,7 +80,13 @@
icon_state = "[base]flip[type][type == 1 ? subtype : ""]"
- return 1
+/obj/structure/table/proc/update_smoothing()
+ if((smoothing_flags & (SMOOTH_CORNERS|SMOOTH_BITMASK)) && !flipped)
+ QUEUE_SMOOTH(src)
+ QUEUE_SMOOTH_NEIGHBORS(src)
+
+ if(flipped)
+ clear_smooth_overlays()
/obj/structure/table/narsie_act()
new /obj/structure/table/wood(loc)
diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm
index 3413f97a732..20cf24e52ac 100644
--- a/code/game/objects/structures/tank_dispenser.dm
+++ b/code/game/objects/structures/tank_dispenser.dm
@@ -21,7 +21,7 @@
/obj/structure/dispenser/Initialize(mapload)
. = ..()
initialize_tanks()
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/structure/dispenser/Destroy()
QDEL_LIST(stored_plasma_tanks)
@@ -37,21 +37,21 @@
var/obj/item/tank/internals/oxygen/O = new(src)
stored_oxygen_tanks.Add(O)
-/obj/structure/dispenser/update_icon()
- cut_overlays()
+/obj/structure/dispenser/update_overlays()
+ . = ..()
var/oxy_tank_amount = LAZYLEN(stored_oxygen_tanks)
switch(oxy_tank_amount)
if(1 to 3)
- overlays += "oxygen-[oxy_tank_amount]"
+ . += "oxygen-[oxy_tank_amount]"
if(4 to INFINITY)
- overlays += "oxygen-4"
+ . += "oxygen-4"
var/pla_tank_amount = LAZYLEN(stored_plasma_tanks)
switch(pla_tank_amount)
if(1 to 4)
- overlays += "plasma-[pla_tank_amount]"
+ . += "plasma-[pla_tank_amount]"
if(5 to INFINITY)
- overlays += "plasma-5"
+ . += "plasma-5"
/obj/structure/dispenser/attack_hand(mob/user)
if(..())
@@ -119,7 +119,7 @@
T.forceMove(loc) // If the user's hands are full, place it on the tile of the dispenser.
to_chat(user, "You take [T] out of [src].")
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/// Called when the user clicks on the dispenser with a tank. Tries to insert the tank into the dispenser, and updates the UI if successful.
/obj/structure/dispenser/proc/try_insert_tank(mob/living/user, list/tank_list, obj/item/tank/T)
@@ -133,7 +133,7 @@
T.forceMove(src)
tank_list.Add(T)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
to_chat(user, "You put [T] in [src].")
SStgui.update_uis(src)
diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm
index d82862fd8d1..71139809b96 100644
--- a/code/game/objects/structures/watercloset.dm
+++ b/code/game/objects/structures/watercloset.dm
@@ -47,7 +47,7 @@
open = !open
update_icon()
-/obj/structure/toilet/update_icon()
+/obj/structure/toilet/update_icon_state()
icon_state = "toilet[open][cistern]"
if(!anchored)
pixel_x = 0
@@ -340,11 +340,11 @@
transfer_prints_to(S, TRUE)
qdel(src)
-/obj/machinery/shower/update_icon()
- cut_overlays()
+/obj/machinery/shower/update_overlays()
+ . = ..()
if(on)
var/mutable_appearance/water_falling = mutable_appearance('icons/obj/watercloset.dmi', "water", ABOVE_MOB_LAYER)
- add_overlay(water_falling)
+ . += water_falling
/obj/machinery/shower/proc/handle_mist()
// If there is no mist, and the shower was turned on (on a non-freezing temp): make mist in 5 seconds
@@ -565,8 +565,7 @@
dir = dir_choices[selected]
update_icon() //is this necessary? probably not
-/obj/structure/sink/update_icon()
- ..()
+/obj/structure/sink/update_icon_state()
layer = OBJ_LAYER
if(!anchored)
pixel_x = 0
diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm
index 46cb419af2f..a7d176e6060 100644
--- a/code/game/objects/structures/windoor_assembly.dm
+++ b/code/game/objects/structures/windoor_assembly.dm
@@ -50,7 +50,7 @@
setDir(ini_dir)
move_update_air(T)
-/obj/structure/windoor_assembly/update_icon()
+/obj/structure/windoor_assembly/update_icon_state()
icon_state = "[facing]_[secure ? "secure_" : ""]windoor_assembly[state]"
/obj/structure/windoor_assembly/CanPass(atom/movable/mover, turf/target, height=0)
@@ -156,7 +156,7 @@
return ..()
//Update to reflect changes(if applicable)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/structure/windoor_assembly/crowbar_act(mob/user, obj/item/I) //Crowbar to complete the assembly, Step 7 complete.
if(state != "02")
@@ -244,7 +244,7 @@
name = "secure anchored windoor assembly"
else
name = "anchored windoor assembly"
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/structure/windoor_assembly/wrench_act(mob/user, obj/item/I)
if(state != "01")
@@ -282,7 +282,7 @@
name = "secure windoor assembly"
else
name = "windoor assembly"
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/structure/windoor_assembly/welder_act(mob/user, obj/item/I)
if(state != "01")
@@ -320,7 +320,7 @@
setDir(target_dir)
ini_dir = dir
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return TRUE
/obj/structure/windoor_assembly/AltClick(mob/user)
@@ -348,5 +348,5 @@
facing = "l"
to_chat(usr, "The windoor will now slide to the left.")
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index 2b56830ef29..1408f79c218 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -454,7 +454,8 @@
if(smoothing_flags & (SMOOTH_CORNERS|SMOOTH_BITMASK))
QUEUE_SMOOTH_NEIGHBORS(src)
-/obj/structure/window/update_icon()
+/obj/structure/window/update_overlays()
+ . = ..()
if(!QDELETED(src))
if(!fulltile)
return
@@ -464,11 +465,10 @@
if(smoothing_flags & (SMOOTH_CORNERS|SMOOTH_BITMASK))
QUEUE_SMOOTH(src)
- cut_overlay(crack_overlay)
if(ratio > 75)
return
crack_overlay = mutable_appearance('icons/obj/structures.dmi', "damage[ratio]", -(layer+0.1))
- add_overlay(crack_overlay)
+ . += crack_overlay
/obj/structure/window/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
@@ -569,7 +569,7 @@
if(active && !powered(power_channel))
toggle_tint()
-/obj/machinery/button/windowtint/update_icon()
+/obj/machinery/button/windowtint/update_icon_state()
icon_state = "light[active]"
/obj/structure/window/plasmabasic
diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm
index fd8c106d369..b71c5542802 100644
--- a/code/game/turfs/simulated/floor.dm
+++ b/code/game/turfs/simulated/floor.dm
@@ -106,12 +106,11 @@ GLOBAL_LIST_INIT(icons_to_ignore_at_floor_init, list("damaged1","damaged2","dama
/turf/simulated/floor/blob_act(obj/structure/blob/B)
return
-/turf/simulated/floor/proc/update_icon()
+/turf/simulated/floor/update_overlays()
+ . = ..()
update_visuals()
- overlays -= current_overlay
if(current_overlay)
- overlays.Add(current_overlay)
- return 1
+ . += current_overlay
/turf/simulated/floor/proc/break_tile_to_plating()
var/turf/simulated/floor/plating/T = make_plating()
diff --git a/code/game/turfs/simulated/floor/fancy_floor.dm b/code/game/turfs/simulated/floor/fancy_floor.dm
index d2128887f04..7b71867ff4c 100644
--- a/code/game/turfs/simulated/floor/fancy_floor.dm
+++ b/code/game/turfs/simulated/floor/fancy_floor.dm
@@ -110,9 +110,7 @@
. = ..()
update_icon()
-/turf/simulated/floor/carpet/update_icon()
- if(!..())
- return 0
+/turf/simulated/floor/carpet/update_icon_state()
if(!broken && !burnt)
if(smoothing_flags & (SMOOTH_CORNERS|SMOOTH_BITMASK))
QUEUE_SMOOTH(src)
diff --git a/code/game/turfs/simulated/floor/light_floor.dm b/code/game/turfs/simulated/floor/light_floor.dm
index 4c4e3e44a15..9bbb817459f 100644
--- a/code/game/turfs/simulated/floor/light_floor.dm
+++ b/code/game/turfs/simulated/floor/light_floor.dm
@@ -15,8 +15,7 @@
. = ..()
update_icon()
-/turf/simulated/floor/light/update_icon()
- ..()
+/turf/simulated/floor/light/update_icon_state()
if(on)
icon_state = "light_on"
set_light(5, null, color)
diff --git a/code/game/turfs/simulated/floor/mineral.dm b/code/game/turfs/simulated/floor/mineral.dm
index 6a3a7e5902d..20d87446a5e 100644
--- a/code/game/turfs/simulated/floor/mineral.dm
+++ b/code/game/turfs/simulated/floor/mineral.dm
@@ -18,9 +18,7 @@
. = ..()
broken_states = list("[initial(icon_state)]_dam")
-/turf/simulated/floor/mineral/update_icon()
- if(!..())
- return 0
+/turf/simulated/floor/mineral/update_icon_state()
if(!broken && !burnt)
if(!(icon_state in icons))
icon_state = initial(icon_state)
diff --git a/code/game/turfs/simulated/floor/plasteel_floor.dm b/code/game/turfs/simulated/floor/plasteel_floor.dm
index 59701bb7738..8c937b64fca 100644
--- a/code/game/turfs/simulated/floor/plasteel_floor.dm
+++ b/code/game/turfs/simulated/floor/plasteel_floor.dm
@@ -4,9 +4,7 @@
broken_states = list("damaged1", "damaged2", "damaged3", "damaged4", "damaged5")
burnt_states = list("floorscorched1", "floorscorched2")
-/turf/simulated/floor/plasteel/update_icon()
- if(!..())
- return 0
+/turf/simulated/floor/plasteel/update_icon_state()
if(!broken && !burnt)
icon_state = icon_regular_floor
diff --git a/code/game/turfs/simulated/floor/plating.dm b/code/game/turfs/simulated/floor/plating.dm
index 453d051e374..c486a3b589f 100644
--- a/code/game/turfs/simulated/floor/plating.dm
+++ b/code/game/turfs/simulated/floor/plating.dm
@@ -26,9 +26,7 @@
. = ..()
burn_tile()
-/turf/simulated/floor/plating/update_icon()
- if(!..())
- return
+/turf/simulated/floor/plating/update_icon_state()
if(!broken && !burnt)
icon_state = icon_plating //Because asteroids are 'platings' too.
@@ -321,7 +319,7 @@
icon_state = "ironfoam"
metal = MFOAM_IRON
-/turf/simulated/floor/plating/metalfoam/update_icon()
+/turf/simulated/floor/plating/metalfoam/update_icon_state()
switch(metal)
if(MFOAM_ALUMINUM)
icon_state = "metalfoam"
diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm
index 307995a57e7..5fe8c077ec8 100644
--- a/code/game/turfs/simulated/walls.dm
+++ b/code/game/turfs/simulated/walls.dm
@@ -17,7 +17,6 @@
var/damage = 0
var/damage_cap = 100 //Wall will break down to girders if damage reaches this point
- var/damage_overlay
var/global/damage_overlays[8]
opacity = TRUE
@@ -90,35 +89,36 @@
/turf/simulated/wall/proc/rust()
if(rusted)
return
- name = "rusted [name]"
rusted = TRUE
- update_icon()
+ update_appearance(UPDATE_NAME|UPDATE_OVERLAYS)
-/turf/simulated/wall/proc/update_icon()
+/turf/simulated/wall/update_name()
+ . = ..()
+ name = "[rusted ? "rusted " : ""][name]"
+
+/turf/simulated/wall/update_overlays()
+ . = ..()
if(!damage_overlays[1]) //list hasn't been populated
generate_overlays()
QUEUE_SMOOTH(src)
if(rusted && !rusted_overlay)
rusted_overlay = icon('icons/turf/overlays.dmi', pick("rust", "rust2"), pick(NORTH, SOUTH, EAST, WEST))
- add_overlay(rusted_overlay)
+ . += rusted_overlay
if(!damage)
- if(damage_overlay)
- overlays -= damage_overlays[damage_overlay]
- damage_overlay = null
+ . += dent_decals
return
var/overlay = round(damage / damage_cap * damage_overlays.len) + 1
if(overlay > damage_overlays.len)
overlay = damage_overlays.len
- if(damage_overlay && overlay == damage_overlay) //No need to update.
- return
- if(damage_overlay)
- overlays -= damage_overlays[damage_overlay]
- overlays += damage_overlays[overlay]
- damage_overlay = overlay
+ if(length(dent_decals))
+ . += dent_decals
+
+ . += damage_overlays[overlay]
+ . += dent_decals
/turf/simulated/wall/proc/generate_overlays()
var/alpha_inc = 256 / damage_overlays.len
@@ -386,8 +386,8 @@
if(I.use_tool(src, user, time, volume = I.tool_volume))
if(repairing)
WELDER_REPAIR_SUCCESS_MESSAGE
- cut_overlay(dent_decals)
dent_decals?.Cut() // I feel like this isn't needed but it can't hurt to keep it in anyway
+ update_icon()
take_damage(-damage)
else
WELDER_SLICING_SUCCESS_MESSAGE
@@ -516,11 +516,10 @@
decal.pixel_y = y
if(LAZYLEN(dent_decals))
- cut_overlay(dent_decals)
dent_decals += decal
else
dent_decals = list(decal)
- add_overlay(dent_decals)
+ update_icon()
#undef MAX_DENT_DECALS
diff --git a/code/game/turfs/simulated/walls_reinforced.dm b/code/game/turfs/simulated/walls_reinforced.dm
index 94f5350ba34..6f59080ef50 100644
--- a/code/game/turfs/simulated/walls_reinforced.dm
+++ b/code/game/turfs/simulated/walls_reinforced.dm
@@ -210,9 +210,7 @@
if(prob(30))
dismantle_wall()
-/turf/simulated/wall/r_wall/update_icon()
- . = ..()
-
+/turf/simulated/wall/r_wall/update_icon_state()
if(d_state)
icon_state = "r_wall-[d_state]"
smoothing_flags = NONE
diff --git a/code/game/turfs/space/transit.dm b/code/game/turfs/space/transit.dm
index b8110cf2b54..eca15970870 100644
--- a/code/game/turfs/space/transit.dm
+++ b/code/game/turfs/space/transit.dm
@@ -152,9 +152,9 @@
/turf/space/transit/Initialize(mapload)
. = ..()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
-/turf/space/transit/proc/update_icon()
+/turf/space/transit/update_icon_state()
var/p = 9
var/angle = 0
var/state = 1
diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm
index b12cb1cf83b..0edc3c3aba5 100644
--- a/code/modules/admin/topic.dm
+++ b/code/modules/admin/topic.dm
@@ -1863,7 +1863,7 @@
if(!P.ico)
P.ico = new
P.ico += "paper_stamp-[stampvalue]"
- P.overlays += stampoverlay
+ P.stamp_overlays += stampoverlay
P.stamps += "
"
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 += "
"
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 += "
"
else if(stamptype == "text")
if(!P.stamped)
P.stamped = new
P.stamped += /obj/item/stamp
- P.overlays += stampoverlay
+ P.stamp_overlays += stampoverlay
P.stamps += "
[stampvalue]"
if(destination != "All Departments")
diff --git a/code/modules/antagonists/vampire/vampire_powers/umbrae_powers.dm b/code/modules/antagonists/vampire/vampire_powers/umbrae_powers.dm
index c0f49838b95..b1df1a74551 100644
--- a/code/modules/antagonists/vampire/vampire_powers/umbrae_powers.dm
+++ b/code/modules/antagonists/vampire/vampire_powers/umbrae_powers.dm
@@ -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
diff --git a/code/modules/arcade/arcade_base.dm b/code/modules/arcade/arcade_base.dm
index 1d1cdcc4641..fb7b891f3be 100644
--- a/code/modules/arcade/arcade_base.dm
+++ b/code/modules/arcade/arcade_base.dm
@@ -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)] That is not enough money.")
diff --git a/code/modules/arcade/arcade_prize.dm b/code/modules/arcade/arcade_prize.dm
index 18d149b39e9..85d2b657852 100644
--- a/code/modules/arcade/arcade_prize.dm
+++ b/code/modules/arcade/arcade_prize.dm
@@ -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
diff --git a/code/modules/arcade/claw_game.dm b/code/modules/arcade/claw_game.dm
index f9bc2da5b5e..a0429c7cdbc 100644
--- a/code/modules/arcade/claw_game.dm
+++ b/code/modules/arcade/claw_game.dm
@@ -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)
..()
diff --git a/code/modules/arcade/mob_hunt/battle_computer.dm b/code/modules/arcade/mob_hunt/battle_computer.dm
index 8155eb50d7e..75221766619 100644
--- a/code/modules/arcade/mob_hunt/battle_computer.dm
+++ b/code/modules/arcade/mob_hunt/battle_computer.dm
@@ -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)
diff --git a/code/modules/arcade/prize_counter.dm b/code/modules/arcade/prize_counter.dm
index ece858500e1..0a561c7bd64 100644
--- a/code/modules/arcade/prize_counter.dm
+++ b/code/modules/arcade/prize_counter.dm
@@ -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))
diff --git a/code/modules/assembly/bomb.dm b/code/modules/assembly/bomb.dm
index 6da7af91d36..b1161d8b247 100644
--- a/code/modules/assembly/bomb.dm
+++ b/code/modules/assembly/bomb.dm
@@ -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))
diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm
index 895d74f25b4..fa4efa9f02b 100644
--- a/code/modules/assembly/holder.dm
+++ b/code/modules/assembly/holder.dm
@@ -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()
diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm
index 267d054f9f0..694ca59f6ce 100644
--- a/code/modules/assembly/infrared.dm
+++ b/code/modules/assembly/infrared.dm
@@ -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()
diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm
index 758b4b48468..e6168b3b3ae 100644
--- a/code/modules/assembly/mousetrap.dm
+++ b/code/modules/assembly/mousetrap.dm
@@ -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
diff --git a/code/modules/assembly/proximity.dm b/code/modules/assembly/proximity.dm
index 7784b81e127..c8213dbab8f 100644
--- a/code/modules/assembly/proximity.dm
+++ b/code/modules/assembly/proximity.dm
@@ -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()
diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm
index 0521f95951f..8530ff1fe3c 100644
--- a/code/modules/assembly/signaler.dm
+++ b/code/modules/assembly/signaler.dm
@@ -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 = "-------"
diff --git a/code/modules/assembly/timer.dm b/code/modules/assembly/timer.dm
index 11907e84d78..187423190ae 100644
--- a/code/modules/assembly/timer.dm
+++ b/code/modules/assembly/timer.dm
@@ -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()
diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm
index fd8a4646df5..e3f483b881e 100644
--- a/code/modules/atmospherics/machinery/airalarm.dm
+++ b/code/modules/atmospherics/machinery/airalarm.dm
@@ -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)
diff --git a/code/modules/atmospherics/machinery/atmospherics.dm b/code/modules/atmospherics/machinery/atmospherics.dm
index 7bfa0644458..f0c6e57f55d 100644
--- a/code/modules/atmospherics/machinery/atmospherics.dm
+++ b/code/modules/atmospherics/machinery/atmospherics.dm
@@ -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)
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/circulator.dm b/code/modules/atmospherics/machinery/components/binary_devices/circulator.dm
index 7111d4ef4e5..f67836341bb 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/circulator.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/circulator.dm
@@ -106,39 +106,47 @@
return
side_inverted = !side_inverted
to_chat(user, "You reverse the circulator's valve settings. The inlet of the circulator is now on the [get_inlet_side(dir)] side.")
+ 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()
. = ..()
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm
index 1a8e1a9c5fc..28da8931a3d 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm
@@ -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(..())
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm
index ad13f06dbe2..ff228a46cb2 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm
@@ -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()
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm
index 2b8ccb022aa..a7632626783 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm
@@ -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
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/valve.dm b/code/modules/atmospherics/machinery/components/binary_devices/valve.dm
index 283aca14f91..91d9ced59ba 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/valve.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/valve.dm
@@ -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()
..()
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm
index 5929225ea16..54416c051e8 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm
@@ -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
diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm
index f27d01c8969..d73d71eb6ec 100644
--- a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm
+++ b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm
@@ -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
diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm
index f1568410eb9..d5a5bab08ea 100644
--- a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm
+++ b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm
@@ -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
diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/tvalve.dm b/code/modules/atmospherics/machinery/components/trinary_devices/tvalve.dm
index d59a206d000..12452b53db8 100644
--- a/code/modules/atmospherics/machinery/components/trinary_devices/tvalve.dm
+++ b/code/modules/atmospherics/machinery/components/trinary_devices/tvalve.dm
@@ -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"
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm
index a00fa5296a2..d58a72e4937 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm
@@ -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
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/generator_input.dm b/code/modules/atmospherics/machinery/components/unary_devices/generator_input.dm
index ae4cb9d270b..74bd027998e 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/generator_input.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/generator_input.dm
@@ -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
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/heat_exchanger.dm b/code/modules/atmospherics/machinery/components/unary_devices/heat_exchanger.dm
index 45167b81bbd..15ef6b5437c 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/heat_exchanger.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/heat_exchanger.dm
@@ -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
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm
index 80d4f7bc4ca..df7c8752832 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm
@@ -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
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/oxygen_generator.dm b/code/modules/atmospherics/machinery/components/unary_devices/oxygen_generator.dm
index ac223678e69..c043e75ff00 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/oxygen_generator.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/oxygen_generator.dm
@@ -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
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm b/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm
index 5f032649e40..f55de1ee8c8 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm
@@ -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()
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/thermal_plate.dm b/code/modules/atmospherics/machinery/components/unary_devices/thermal_plate.dm
index e27754d25c9..a9667859d62 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/thermal_plate.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/thermal_plate.dm
@@ -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))
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm
index b5aa0382327..c5353ab1e92 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm
@@ -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)
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm
index 57dde255b5a..42cb39ceec0 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm
@@ -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()
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm
index c82e9ff3710..bac3f2e4f01 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm
@@ -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()
diff --git a/code/modules/atmospherics/machinery/other/meter.dm b/code/modules/atmospherics/machinery/other/meter.dm
index acd46cc8e13..a3efee164c2 100644
--- a/code/modules/atmospherics/machinery/other/meter.dm
+++ b/code/modules/atmospherics/machinery/other/meter.dm
@@ -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 = ""
diff --git a/code/modules/atmospherics/machinery/pipes/cap.dm b/code/modules/atmospherics/machinery/pipes/cap.dm
index 4cfa2efb450..67e9ed9a9a5 100644
--- a/code/modules/atmospherics/machinery/pipes/cap.dm
+++ b/code/modules/atmospherics/machinery/pipes/cap.dm
@@ -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()
..()
diff --git a/code/modules/atmospherics/machinery/pipes/manifold.dm b/code/modules/atmospherics/machinery/pipes/manifold.dm
index 20dd2990888..8459b7dea3e 100644
--- a/code/modules/atmospherics/machinery/pipes/manifold.dm
+++ b/code/modules/atmospherics/machinery/pipes/manifold.dm
@@ -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)
diff --git a/code/modules/atmospherics/machinery/pipes/manifold4w.dm b/code/modules/atmospherics/machinery/pipes/manifold4w.dm
index 5cefc6f723c..e75d4f4b842 100644
--- a/code/modules/atmospherics/machinery/pipes/manifold4w.dm
+++ b/code/modules/atmospherics/machinery/pipes/manifold4w.dm
@@ -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)
diff --git a/code/modules/atmospherics/machinery/pipes/simple/pipe_simple.dm b/code/modules/atmospherics/machinery/pipes/simple/pipe_simple.dm
index deec621d34c..340dd2ff880 100644
--- a/code/modules/atmospherics/machinery/pipes/simple/pipe_simple.dm
+++ b/code/modules/atmospherics/machinery/pipes/simple/pipe_simple.dm
@@ -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()
diff --git a/code/modules/atmospherics/machinery/pipes/simple/pipe_simple_hidden.dm b/code/modules/atmospherics/machinery/pipes/simple/pipe_simple_hidden.dm
index d3fafe950c0..a020519dd8f 100644
--- a/code/modules/atmospherics/machinery/pipes/simple/pipe_simple_hidden.dm
+++ b/code/modules/atmospherics/machinery/pipes/simple/pipe_simple_hidden.dm
@@ -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
diff --git a/code/modules/atmospherics/machinery/pipes/simple/pipe_simple_visible.dm b/code/modules/atmospherics/machinery/pipes/simple/pipe_simple_visible.dm
index 348453e758f..0706d592d63 100644
--- a/code/modules/atmospherics/machinery/pipes/simple/pipe_simple_visible.dm
+++ b/code/modules/atmospherics/machinery/pipes/simple/pipe_simple_visible.dm
@@ -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()
diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm
index 4bf43e7f369..177be11324b 100644
--- a/code/modules/atmospherics/machinery/portable/canister.dm
+++ b/code/modules/atmospherics/machinery/portable/canister.dm
@@ -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 closed by [key_name(user)].
", "atmos")
- else if(valve_open && holding)
- investigate_log("[key_name(user)] started a transfer into [holding].
", "atmos")
+ else if(valve_open && holding_tank)
+ investigate_log("[key_name(user)] started a transfer into [holding_tank].
", "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 opened by [key_name(usr)], starting a transfer into the [holding || "air"].
"
- if(!holding)
+ logmsg = "Valve was opened by [key_name(usr)], starting a transfer into the [holding_tank || "air"].
"
+ if(!holding_tank)
logmsg = "Valve was opened by [key_name(usr)], starting a transfer into the air.
"
if(air_contents.toxins > 0)
message_admins("[key_name_admin(usr)] opened a canister that contains plasma in [get_area(src)]! (JMP)")
@@ -367,14 +369,14 @@ update_flag
message_admins("[key_name_admin(usr)] opened a canister that contains N2O in [get_area(src)]! (JMP)")
log_admin("[key_name(usr)] opened a canister that contains N2O at [get_area(src)]: [x], [y], [z]")
else
- logmsg = "Valve was closed by [key_name(usr)], stopping the transfer into the [holding || "air"].
"
+ logmsg = "Valve was closed by [key_name(usr)], stopping the transfer into the [holding_tank || "air"].
"
investigate_log(logmsg, "atmos")
release_log += logmsg
if("eject")
- if(holding)
+ if(holding_tank)
if(valve_open)
valve_open = FALSE
- release_log += "Valve was closed by [key_name(usr)], stopping the transfer into the [holding]
"
+ release_log += "Valve was closed by [key_name(usr)], stopping the transfer into the [holding_tank]
"
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, "You salvage whats left of [src]!")
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
diff --git a/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm b/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm
index 6e8f23f7f98..04a14229d5b 100644
--- a/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm
+++ b/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm
@@ -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, "You remove [holding] from [src].")
+ if(holding_tank)
+ to_chat(user, "You remove [holding_tank] from [src].")
replace_tank(user, TRUE)
/obj/machinery/portable_atmospherics/examine(mob/user)
. = ..()
- if(holding)
- . += "\The [src] contains [holding]. Alt-click [src] to remove it."
+ if(holding_tank)
+ . += "\The [src] contains [holding_tank]. Alt-click [src] to remove it."
/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, "[holding ? "In one smooth motion you pop [holding] out of [src]'s connector and replace it with [T]" : "You insert [T] into [src]"].")
+ if(holding_tank)
+ to_chat(user, "[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]"].")
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)
diff --git a/code/modules/atmospherics/machinery/portable/pump.dm b/code/modules/atmospherics/machinery/portable/pump.dm
index 49383c09bea..4fd3c2a3805 100644
--- a/code/modules/atmospherics/machinery/portable/pump.dm
+++ b/code/modules/atmospherics/machinery/portable/pump.dm
@@ -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].
", "atmos")
+ else if(on && holding_tank && direction == DIRECTION_OUT)
+ investigate_log("[key_name(user)] started a transfer into [holding_tank].
", "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].
", "atmos")
+ investigate_log("[key_name(usr)] started a transfer into [holding_tank].
", "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].
", "atmos")
+ if(on && holding_tank)
+ investigate_log("[key_name(usr)] started a transfer into [holding_tank].
", "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
diff --git a/code/modules/atmospherics/machinery/portable/scrubber.dm b/code/modules/atmospherics/machinery/portable/scrubber.dm
index 0904fd72a55..012a7e70444 100644
--- a/code/modules/atmospherics/machinery/portable/scrubber.dm
+++ b/code/modules/atmospherics/machinery/portable/scrubber.dm
@@ -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, "You can't directly interact with this machine. Use the area atmos computer.")
-/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)
diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm
index 01444cd6c57..8a4db58ddb4 100644
--- a/code/modules/awaymissions/gateway.dm
+++ b/code/modules/awaymissions/gateway.dm
@@ -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)
diff --git a/code/modules/awaymissions/mission_code/ruins/oldstation.dm b/code/modules/awaymissions/mission_code/ruins/oldstation.dm
index 6165d75d1d5..6addd22877a 100644
--- a/code/modules/awaymissions/mission_code/ruins/oldstation.dm
+++ b/code/modules/awaymissions/mission_code/ruins/oldstation.dm
@@ -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"
diff --git a/code/modules/awaymissions/pamphlet.dm b/code/modules/awaymissions/pamphlet.dm
index ffbb188ada2..77e3f053ef1 100644
--- a/code/modules/awaymissions/pamphlet.dm
+++ b/code/modules/awaymissions/pamphlet.dm
@@ -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
diff --git a/code/modules/buildmode/buttons.dm b/code/modules/buildmode/buttons.dm
index 9f74ac9aeff..7c18de6be90 100644
--- a/code/modules/buildmode/buttons.dm
+++ b/code/modules/buildmode/buttons.dm
@@ -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()
diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm
index 3f071e22665..381a993ac5c 100644
--- a/code/modules/clothing/chameleon.dm
+++ b/code/modules/clothing/chameleon.dm
@@ -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)
diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm
index 17525d0f52d..fe2a9ffaa53 100644
--- a/code/modules/clothing/clothing.dm
+++ b/code/modules/clothing/clothing.dm
@@ -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("[user] snips the fingertips off [src].","You snip the fingertips off [src].")
- 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, "You push \the [src] back into place.")
- 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, "You push \the [src] out of the way.")
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("[user] cuts open the toes of [src].","You cut open the toes of [src].")
- 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, "[src] have already had [p_their()] toes cut open!")
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("[user] bellows, [pick("shredding", "ripping open", "tearing off")] [user.p_their()] jacket in a fit of rage!","You accidentally [pick("shred", "rend", "tear apart")] [src] with your [pick("excessive", "extreme", "insane", "monstrous", "ridiculous", "unreal", "stupendous")] [pick("power", "strength")]!")
- 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, "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!")//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, "You attempt to button up the velcro on \the [src], before promptly realising how foolish you are.")
+ 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("[user] bellows, [pick("shredding", "ripping open", "tearing off")] [user.p_their()] jacket in a fit of rage!","You accidentally [pick("shred", "rend", "tear apart")] [src] with your [pick("excessive", "extreme", "insane", "monstrous", "ridiculous", "unreal", "stupendous")] [pick("power", "strength")]!")
+ 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, "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!")//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
diff --git a/code/modules/clothing/glasses/engine_goggles.dm b/code/modules/clothing/glasses/engine_goggles.dm
index a17cd7a897b..2d9db5d9d1a 100644
--- a/code/modules/clothing/glasses/engine_goggles.dm
+++ b/code/modules/clothing/glasses/engine_goggles.dm
@@ -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()
diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm
index ee031f9f622..54d0e0193b4 100644
--- a/code/modules/clothing/glasses/glasses.dm
+++ b/code/modules/clothing/glasses/glasses.dm
@@ -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()
diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm
index b6ad033fb45..adae31e51b7 100644
--- a/code/modules/clothing/glasses/hud.dm
+++ b/code/modules/clothing/glasses/hud.dm
@@ -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',
diff --git a/code/modules/clothing/gloves/miscellaneous.dm b/code/modules/clothing/gloves/miscellaneous.dm
index afd2bea4d7e..62fdb63a927 100644
--- a/code/modules/clothing/gloves/miscellaneous.dm
+++ b/code/modules/clothing/gloves/miscellaneous.dm
@@ -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, "You attach [W] to [src].")
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
else
to_chat(user, "[src] already has a cell.")
else
@@ -153,7 +152,7 @@
to_chat(user, "You cut [cell] away from [src].")
cell.forceMove(get_turf(loc))
cell = null
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/clothing/gloves/color/yellow/fake/examine(mob/user)
. = ..()
diff --git a/code/modules/clothing/gloves/rings.dm b/code/modules/clothing/gloves/rings.dm
index acae9edbea9..1a608b31af7 100644
--- a/code/modules/clothing/gloves/rings.dm
+++ b/code/modules/clothing/gloves/rings.dm
@@ -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, "You socket the diamond into [src].")
// s'pensive
diff --git a/code/modules/clothing/head/hardhat.dm b/code/modules/clothing/head/hardhat.dm
index 5462a209a53..5e50da79b76 100644
--- a/code/modules/clothing/head/hardhat.dm
+++ b/code/modules/clothing/head/hardhat.dm
@@ -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("[src]'s light fades and turns off.")
/obj/item/clothing/head/hardhat/orange
diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm
index 936fe1f0b0f..6facbd827be 100644
--- a/code/modules/clothing/head/helmet.dm
+++ b/code/modules/clothing/head/helmet.dm
@@ -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!"
diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm
index 061da93fe9e..5c09f1b5584 100644
--- a/code/modules/clothing/head/misc_special.dm
+++ b/code/modules/clothing/head/misc_special.dm
@@ -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."
diff --git a/code/modules/clothing/masks/breath.dm b/code/modules/clothing/masks/breath.dm
index 895b0214f71..44bf65214db 100644
--- a/code/modules/clothing/masks/breath.dm
+++ b/code/modules/clothing/masks/breath.dm
@@ -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
diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm
index 0410fe45e81..f0163d8753b 100644
--- a/code/modules/clothing/masks/gasmask.dm
+++ b/code/modules/clothing/masks/gasmask.dm
@@ -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)
diff --git a/code/modules/clothing/masks/miscellaneous.dm b/code/modules/clothing/masks/miscellaneous.dm
index b1ef8680a4f..3b7823de94f 100644
--- a/code/modules/clothing/masks/miscellaneous.dm
+++ b/code/modules/clothing/masks/miscellaneous.dm
@@ -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)
diff --git a/code/modules/clothing/spacesuits/alien.dm b/code/modules/clothing/spacesuits/alien.dm
index 5cab13e9447..9297fa2d12c 100644
--- a/code/modules/clothing/spacesuits/alien.dm
+++ b/code/modules/clothing/spacesuits/alien.dm
@@ -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(
diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm
index de2f2263b98..4030d17e10a 100644
--- a/code/modules/clothing/spacesuits/hardsuit.dm
+++ b/code/modules/clothing/spacesuits/hardsuit.dm
@@ -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
diff --git a/code/modules/clothing/spacesuits/plasmamen.dm b/code/modules/clothing/spacesuits/plasmamen.dm
index debdb7e5ffe..a871eb5171a 100644
--- a/code/modules/clothing/spacesuits/plasmamen.dm
+++ b/code/modules/clothing/spacesuits/plasmamen.dm
@@ -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)
diff --git a/code/modules/clothing/suits/toggles.dm b/code/modules/clothing/suits/toggles.dm
index 7e1a993fca4..398ea9d959b 100644
--- a/code/modules/clothing/suits/toggles.dm
+++ b/code/modules/clothing/suits/toggles.dm
@@ -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, "You must be wearing [src] to engage the helmet!")
@@ -70,7 +70,7 @@
return
else if(H.equip_to_slot_if_possible(helmet, slot_head, FALSE, FALSE))
to_chat(H, "You engage the helmet on the hardsuit.")
- suittoggled = TRUE
+ suit_toggled = TRUE
H.update_inv_wear_suit()
playsound(src.loc, 'sound/mecha/mechmove03.ogg', 50, 1)
else
diff --git a/code/modules/clothing/under/color.dm b/code/modules/clothing/under/color.dm
index 16c0940b479..1d2cf1b2da9 100644
--- a/code/modules/clothing/under/color.dm
+++ b/code/modules/clothing/under/color.dm
@@ -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"
diff --git a/code/modules/clothing/under/miscellaneous.dm b/code/modules/clothing/under/miscellaneous.dm
index 3ce1d20ff3e..877e44f00ba 100644
--- a/code/modules/clothing/under/miscellaneous.dm
+++ b/code/modules/clothing/under/miscellaneous.dm
@@ -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"
diff --git a/code/modules/clothing/under/oldstation_uni.dm b/code/modules/clothing/under/oldstation_uni.dm
index c39add82a3d..d5c281a8132 100644
--- a/code/modules/clothing/under/oldstation_uni.dm
+++ b/code/modules/clothing/under/oldstation_uni.dm
@@ -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
diff --git a/code/modules/clothing/under/shorts.dm b/code/modules/clothing/under/shorts.dm
index 3cd2ddef84c..e7302261c06 100644
--- a/code/modules/clothing/under/shorts.dm
+++ b/code/modules/clothing/under/shorts.dm
@@ -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"
diff --git a/code/modules/clothing/under/syndicate.dm b/code/modules/clothing/under/syndicate.dm
index 8641d0d3d69..e5d0532ac0a 100644
--- a/code/modules/clothing/under/syndicate.dm
+++ b/code/modules/clothing/under/syndicate.dm
@@ -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
diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm
index c705a0fa709..db464598e0c 100644
--- a/code/modules/customitems/item_defines.dm
+++ b/code/modules/customitems/item_defines.dm
@@ -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)
diff --git a/code/modules/detective_work/footprints_and_rag.dm b/code/modules/detective_work/footprints_and_rag.dm
index a8cb4fcf021..07e20fae128 100644
--- a/code/modules/detective_work/footprints_and_rag.dm
+++ b/code/modules/detective_work/footprints_and_rag.dm
@@ -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)
diff --git a/code/modules/fish/fishtank.dm b/code/modules/fish/fishtank.dm
index 380a9981b17..8b3ba274836 100644
--- a/code/modules/fish/fishtank.dm
+++ b/code/modules/fish/fishtank.dm
@@ -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 @@
. += "[examine_message]"
//////////////////////////////
-// ATACK PROCS //
+// ATTACK PROCS //
//////////////////////////////
/obj/machinery/fishtank/attack_animal(mob/living/simple_animal/M)
diff --git a/code/modules/food_and_drinks/drinks/bottler/bottler.dm b/code/modules/food_and_drinks/drinks/bottler/bottler.dm
index 667c64be053..2e5e2ac8e3b 100644
--- a/code/modules/food_and_drinks/drinks/bottler/bottler.dm
+++ b/code/modules/food_and_drinks/drinks/bottler/bottler.dm
@@ -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, "Only unopened cans and bottles can be processed to ensure product integrity.")
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)
diff --git a/code/modules/food_and_drinks/drinks/drinks/bottle.dm b/code/modules/food_and_drinks/drinks/drinks/bottle.dm
index 0ebb8bcfd75..03f88bdf238 100644
--- a/code/modules/food_and_drinks/drinks/drinks/bottle.dm
+++ b/code/modules/food_and_drinks/drinks/drinks/bottle.dm
@@ -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, "You light [src] on fire.")
- 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, "The flame's spread too far on it!")
return
to_chat(user, "You snuff out the flame on \the [src].")
- overlays -= GLOB.fire_overlay
active = FALSE
+ update_icon(UPDATE_OVERLAYS)
diff --git a/code/modules/food_and_drinks/drinks/drinks/cans.dm b/code/modules/food_and_drinks/drinks/drinks/cans.dm
index e373fa7f78e..3f139e6a509 100644
--- a/code/modules/food_and_drinks/drinks/drinks/cans.dm
+++ b/code/modules/food_and_drinks/drinks/drinks/cans.dm
@@ -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)
. += "It has been opened."
else
. += "Alt-click to shake it up!"
/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, "You open the drink with an audible pop!")
return ..()
@@ -46,7 +46,7 @@
if(!can_shake || !ishuman(user))
return ..()
H = user
- if(canopened)
+ if(can_opened)
to_chat(H, "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, "You need to open the drink!")
return
else if(M == user && !reagents.total_volume && user.a_intent == INTENT_HARM && user.zone_selected == "head")
@@ -83,16 +83,16 @@
user.visible_message("[user] crushes [src] in [user.p_their()] trash compactor.", "You crush [src] in your trash compactor.")
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, "You need to open the drink!")
return
- else if(target.is_open_container() && !canopened)
+ else if(target.is_open_container() && !can_opened)
to_chat(user, "You need to open the drink!")
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 EXTREME 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"
diff --git a/code/modules/food_and_drinks/drinks/drinks/shotglass.dm b/code/modules/food_and_drinks/drinks/drinks/shotglass.dm
index 144e280da40..e5c5d749965 100644
--- a/code/modules/food_and_drinks/drinks/drinks/shotglass.dm
+++ b/code/modules/food_and_drinks/drinks/drinks/shotglass.dm
@@ -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("[src] begins to burn with a blue hue!")
- 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("The dancing flame on [src] dies out.")
- 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
diff --git a/code/modules/food_and_drinks/food/foods/desserts.dm b/code/modules/food_and_drinks/food/foods/desserts.dm
index b49b3ef7253..103af89f8fd 100644
--- a/code/modules/food_and_drinks/food/foods/desserts.dm
+++ b/code/modules/food_and_drinks/food/foods/desserts.dm
@@ -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"
diff --git a/code/modules/food_and_drinks/food/foods/ingredients.dm b/code/modules/food_and_drinks/food/foods/ingredients.dm
index 2d84035879a..89cac389f27 100644
--- a/code/modules/food_and_drinks/food/foods/ingredients.dm
+++ b/code/modules/food_and_drinks/food/foods/ingredients.dm
@@ -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, "You flatten [src].")
flat = TRUE
- update_icon()
+ update_appearance(UPDATE_NAME|UPDATE_ICON_STATE)
else
to_chat(user, "You need to put [src] on a surface to roll it out!")
else if(istype(I, /obj/item/kitchen/cutter) && flat)
diff --git a/code/modules/food_and_drinks/food/foods/pizza.dm b/code/modules/food_and_drinks/food/foods/pizza.dm
index cdd8dfe3e64..b14ac7b2f5e 100644
--- a/code/modules/food_and_drinks/food/foods/pizza.dm
+++ b/code/modules/food_and_drinks/food/foods/pizza.dm
@@ -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, "You take [pizza] out of [src].")
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, "You remove the topmost [src] from your hand.")
- 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, "You put [box] on top of [src]!")
else
to_chat(user, "The stack is too high!")
@@ -228,7 +233,7 @@
I.loc = src
pizza = I
- update_icon()
+ update_appearance(UPDATE_DESC|UPDATE_ICON)
to_chat(user, "You put [I] in [src]!")
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 ..()
diff --git a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm
index 8467bb05abd..2aa386438a8 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm
@@ -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("You hear a loud squelchy grinding sound.")
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
diff --git a/code/modules/food_and_drinks/kitchen_machinery/juicer.dm b/code/modules/food_and_drinks/kitchen_machinery/juicer.dm
index b17b2cfe0f0..3055e0b1802 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/juicer.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/juicer.dm
@@ -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, "\the [O] is stuck to your hand, you cannot put it in \the [src]")
- 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, "\the [O] is stuck to your hand, you cannot put it in \the [src]")
- 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 [O]
"
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)
diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm
index 84d05afb61e..874eb61aac4 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm
@@ -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("[user] has added \the [O] to \the [src].", "You add \the [O] to \the [src].")
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("[user] loads \the [src] with \the [P].", "You load \the [src] with \the [P].")
SStgui.update_uis(src)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
var/failed = length(P.contents)
if(failed)
to_chat(user, "[failed] item\s [failed == 1 ? "is" : "are"] refused.")
@@ -237,7 +237,7 @@
items_loaded++
if(items_loaded)
user.visible_message("[user] empties \the [P] into \the [src].", "You empty \the [P] into \the [src].")
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
var/failed = length(P.contents)
if(failed)
to_chat(user, "[failed] item\s [failed == 1 ? "is" : "are"] refused.")
@@ -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.
diff --git a/code/modules/games/52card.dm b/code/modules/games/52card.dm
index dae75a924a1..2eb4ff83e0d 100644
--- a/code/modules/games/52card.dm
+++ b/code/modules/games/52card.dm
@@ -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
diff --git a/code/modules/games/cards.dm b/code/modules/games/cards.dm
index 18b564e94b1..96c71bae97d 100644
--- a/code/modules/games/cards.dm
+++ b/code/modules/games/cards.dm
@@ -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,"You place your cards on the bottom of [src].")
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return
else
to_chat(user,"You can't mix cards from different decks!")
@@ -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("[user] draws a card.","You draw a card.")
to_chat(user,"It's the [P].")
@@ -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("[user] deals [dcard] card(s) to \himself.")
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,"You cannot mix cards from other deck!")
@@ -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("[user] [concealed ? "conceals" : "reveals"] their hand.")
/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("[user] plays the [discarding].", "You play the [discarding].")
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)
diff --git a/code/modules/hydroponics/beekeeping/honeycomb.dm b/code/modules/hydroponics/beekeeping/honeycomb.dm
index 1d086bae0f0..9e04f39f843 100644
--- a/code/modules/hydroponics/beekeeping/honeycomb.dm
+++ b/code/modules/hydroponics/beekeeping/honeycomb.dm
@@ -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)
diff --git a/code/modules/hydroponics/biogenerator.dm b/code/modules/hydroponics/biogenerator.dm
index e1ac2f3dd10..ad3855103f8 100644
--- a/code/modules/hydroponics/biogenerator.dm
+++ b/code/modules/hydroponics/biogenerator.dm
@@ -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, "You add the [container] to [src].")
- 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
diff --git a/code/modules/hydroponics/fermenting_barrel.dm b/code/modules/hydroponics/fermenting_barrel.dm
index 22a7ebb8fa0..224e4a62386 100644
--- a/code/modules/hydroponics/fermenting_barrel.dm
+++ b/code/modules/hydroponics/fermenting_barrel.dm
@@ -63,7 +63,7 @@
else
container_type = DRAINABLE | AMOUNT_VISIBLE
to_chat(user, "You close [src], letting you draw from its tap.")
- 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
diff --git a/code/modules/hydroponics/gene_modder.dm b/code/modules/hydroponics/gene_modder.dm
index 89521b41ac8..2ffeec2e297 100644
--- a/code/modules/hydroponics/gene_modder.dm
+++ b/code/modules/hydroponics/gene_modder.dm
@@ -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, "You add [I] to the machine.")
- 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
diff --git a/code/modules/hydroponics/hydroitemdefines.dm b/code/modules/hydroponics/hydroitemdefines.dm
index 2c6e24b6f75..6a75e915b37 100644
--- a/code/modules/hydroponics/hydroitemdefines.dm
+++ b/code/modules/hydroponics/hydroitemdefines.dm
@@ -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, "With a flick of your wrist, you extend the scythe. It's reaping time!")
- 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, "You collapse the scythe, folding it away for easy storage.")
- 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
diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm
index 65fef36546b..dc01129dc8f 100644
--- a/code/modules/hydroponics/hydroponics.dm
+++ b/code/modules/hydroponics/hydroponics.dm
@@ -125,7 +125,7 @@
lid_closed = !lid_closed
to_chat(user, "You [lid_closed ? "close" : "open"] the tray's lid.")
- 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("The [oldPlantName] is overtaken by some [myseed.plantname]!")
@@ -441,7 +440,7 @@
adjustWeeds(-10) // Reset
sleep(5) // Wait a while
- update_icon()
+ update_state()
visible_message("[oldPlantName] suddenly mutates into [myseed.plantname]!")
@@ -461,7 +460,7 @@
adjustWeeds(-10) // Reset
sleep(5) // Wait a while
- update_icon()
+ update_state()
visible_message("The mutated weeds in [src] spawn some [myseed.plantname]!")
else
to_chat(usr, "The few weeds in [src] seem to react, but only for a moment...")
@@ -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, "[src] already has seeds in it!")
@@ -845,7 +844,7 @@
if(weedlevel > 0)
user.visible_message("[user] uproots the weeds.", "You remove the weeds from [src].")
adjustWeeds(-10)
- update_icon()
+ update_state()
else
to_chat(user, "This plot is completely devoid of weeds! It doesn't need uprooting.")
@@ -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("[user] [using_irrigation ? "" : "dis"]connects [src]'s irrigation hoses.", \
"You [using_irrigation ? "" : "dis"]connect [src]'s irrigation hoses.")
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, "You remove the dead plant from [src].")
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("[src] begins to glow with a beautiful light!")
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("[user] begins rooting through [src], ripping out weeds and eating them noisily.","You begin rooting through [src], ripping out weeds and eating them noisily.")
else if(nutrilevel < 10)
user.adjust_nutrition(-((10 - nutrilevel) * 5))
adjustNutri(10)
- update_icon()
+ update_state()
visible_message("[user] secretes a trickle of green liquid from its tail, refilling [src]'s nutrient tray.","You secrete a trickle of green liquid from your tail, refilling [src]'s nutrient tray.")
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()
diff --git a/code/modules/instruments/objs/items/headphones.dm b/code/modules/instruments/objs/items/headphones.dm
index a4f4fcd7c1e..484cc21bec7 100644
--- a/code/modules/instruments/objs/items/headphones.dm
+++ b/code/modules/instruments/objs/items/headphones.dm
@@ -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
diff --git a/code/modules/library/library_equipment.dm b/code/modules/library/library_equipment.dm
index 5e10191b304..ea411dbd3ac 100644
--- a/code/modules/library/library_equipment.dm
+++ b/code/modules/library/library_equipment.dm
@@ -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, "You empty [O] into [src].")
- 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
diff --git a/code/modules/martial_arts/martial.dm b/code/modules/martial_arts/martial.dm
index 9c67fcc7407..2000e9af89e 100644
--- a/code/modules/martial_arts/martial.dm
+++ b/code/modules/martial_arts/martial.dm
@@ -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)
diff --git a/code/modules/mining/equipment/explorer_gear.dm b/code/modules/mining/equipment/explorer_gear.dm
index d0568b1fa4c..ccdbcf4d885 100644
--- a/code/modules/mining/equipment/explorer_gear.dm
+++ b/code/modules/mining/equipment/explorer_gear.dm
@@ -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
diff --git a/code/modules/mining/equipment/kinetic_crusher.dm b/code/modules/mining/equipment/kinetic_crusher.dm
index 1b14e8d52b1..bd3326f6c95 100644
--- a/code/modules/mining/equipment/kinetic_crusher.dm
+++ b/code/modules/mining/equipment/kinetic_crusher.dm
@@ -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
diff --git a/code/modules/mining/equipment/lazarus_injector.dm b/code/modules/mining/equipment/lazarus_injector.dm
index f1e06a9f203..a4cab8cd780 100644
--- a/code/modules/mining/equipment/lazarus_injector.dm
+++ b/code/modules/mining/equipment/lazarus_injector.dm
@@ -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()
diff --git a/code/modules/mining/equipment/marker_beacons.dm b/code/modules/mining/equipment/marker_beacons.dm
index 77c1e66a926..30c3db2d3c8 100644
--- a/code/modules/mining/equipment/marker_beacons.dm
+++ b/code/modules/mining/equipment/marker_beacons.dm
@@ -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)
. = ..()
. += "Use in-hand to place a [singular_name]."
. += "Alt-click to select a color. Current color is [picked_color]."
-/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)
. += "Alt-click to select a color. Current color is [picked_color]."
-/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
diff --git a/code/modules/mining/equipment/regenerative_core.dm b/code/modules/mining/equipment/regenerative_core.dm
index 4731d8134e9..b1f1dc94af5 100644
--- a/code/modules/mining/equipment/regenerative_core.dm
+++ b/code/modules/mining/equipment/regenerative_core.dm
@@ -120,11 +120,13 @@
. = ..()
update_icon()
-/obj/item/organ/internal/regenerative_core/legion/update_icon()
+/obj/item/organ/internal/regenerative_core/legion/update_icon_state()
icon_state = inert ? "legion_soul_inert" : "legion_soul"
- cut_overlays()
+
+/obj/item/organ/internal/regenerative_core/legion/update_overlays()
+ . = ..()
if(!inert && !preserved)
- add_overlay("legion_soul_crackle")
+ . += "legion_soul_crackle"
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
diff --git a/code/modules/mining/equipment/survival_pod.dm b/code/modules/mining/equipment/survival_pod.dm
index 3c8122695bc..92e454d007f 100644
--- a/code/modules/mining/equipment/survival_pod.dm
+++ b/code/modules/mining/equipment/survival_pod.dm
@@ -232,9 +232,12 @@
var/obj/item/instrument/guitar/G = new(src)
load(G)
-/obj/machinery/smartfridge/survival_pod/update_icon()
+/obj/machinery/smartfridge/survival_pod/update_icon_state()
return
+/obj/machinery/smartfridge/survival_pod/update_overlays()
+ return list()
+
/obj/machinery/smartfridge/survival_pod/accept_check(obj/item/O)
return isitem(O)
diff --git a/code/modules/mining/lavaland/loot/hierophant_loot.dm b/code/modules/mining/lavaland/loot/hierophant_loot.dm
index eddef1ac65a..484e4d1bc3b 100644
--- a/code/modules/mining/lavaland/loot/hierophant_loot.dm
+++ b/code/modules/mining/lavaland/loot/hierophant_loot.dm
@@ -108,7 +108,7 @@
chaser_speed = max(chaser_speed + health_percent, 0.5) //one tenth of a second faster for each missing 10% of health
blast_range -= round(health_percent * 10) //one additional range for each missing 10% of health
-/obj/item/hierophant_club/update_icon()
+/obj/item/hierophant_club/update_icon_state()
icon_state = "hierophant_club[timer <= world.time ? "_ready":""][(beacon && !QDELETED(beacon)) ? "":"_beacon"]"
item_state = icon_state
if(ismob(loc))
diff --git a/code/modules/mining/lavaland/loot/tendril_loot.dm b/code/modules/mining/lavaland/loot/tendril_loot.dm
index 30547259bd6..1bb61d48b89 100644
--- a/code/modules/mining/lavaland/loot/tendril_loot.dm
+++ b/code/modules/mining/lavaland/loot/tendril_loot.dm
@@ -104,7 +104,7 @@
desc = "A flask with an almost-holy aura emitting from it. The label on the bottle says: 'erqo'hyy tvi'rf lbh jv'atf'."
list_reagents = list("flightpotion" = 5)
-/obj/item/reagent_containers/glass/bottle/potion/update_icon()
+/obj/item/reagent_containers/glass/bottle/potion/update_icon_state()
if(reagents.total_volume)
icon_state = "potionflask"
else
diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm
index cd3ae4fe68e..3c9cb4f00b3 100644
--- a/code/modules/mining/machine_redemption.dm
+++ b/code/modules/mining/machine_redemption.dm
@@ -156,13 +156,13 @@
/obj/machinery/mineral/ore_redemption/power_change()
..()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
if(inserted_id && !powered())
visible_message("The ID slot indicator light flickers on [src] as it spits out a card before powering down.")
inserted_id.forceMove(get_turf(src))
inserted_id = null
-/obj/machinery/mineral/ore_redemption/update_icon()
+/obj/machinery/mineral/ore_redemption/update_icon_state()
if(powered())
icon_state = initial(icon_state)
else
diff --git a/code/modules/mining/machine_vending.dm b/code/modules/mining/machine_vending.dm
index 7dac9a56101..f5608be41cd 100644
--- a/code/modules/mining/machine_vending.dm
+++ b/code/modules/mining/machine_vending.dm
@@ -95,12 +95,12 @@
/obj/machinery/mineral/equipment_vendor/power_change()
..()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
if(inserted_id && !powered())
visible_message("The ID slot indicator light flickers on \the [src] as it spits out a card before powering down.")
inserted_id.forceMove(loc)
-/obj/machinery/mineral/equipment_vendor/update_icon()
+/obj/machinery/mineral/equipment_vendor/update_icon_state()
if(powered())
icon_state = initial(icon_state)
else
diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm
index 353f47a8352..58a23a655f5 100644
--- a/code/modules/mob/dead/observer/observer.dm
+++ b/code/modules/mob/dead/observer/observer.dm
@@ -16,6 +16,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
alpha = 127
move_resist = INFINITY // don't get pushed around
invisibility = INVISIBILITY_OBSERVER
+ blocks_emissive = FALSE // Ghosts are transparent, duh
var/can_reenter_corpse
var/bootime = FALSE
var/started_as_observer //This variable is set to 1 when you enter the game as an observer.
@@ -230,7 +231,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(istype(M.loc, /obj/structure/morgue))
Morgue = M.loc
if(Morgue)
- Morgue.update()
+ Morgue.update_state()
// If mob in cryopod, despawn mob
if(P)
@@ -296,7 +297,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(istype(mind.current.loc,/obj/structure/morgue))
Morgue = mind.current.loc
if(Morgue)
- Morgue.update()
+ Morgue.update_state()
return 1
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index c665305e99b..f144f2e6b81 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -235,7 +235,7 @@
/mob/living/stop_pulling()
..()
if(pullin)
- pullin.update_icon(src)
+ pullin.update_icon(UPDATE_ICON_STATE)
/mob/living/verb/stop_pulling1()
set name = "Stop Pulling"
@@ -1022,7 +1022,7 @@
pulling = AM
AM.pulledby = src
if(pullin)
- pullin.update_icon(src)
+ pullin.update_icon(UPDATE_ICON_STATE)
if(ismob(AM))
var/mob/M = AM
if(!iscarbon(src))
diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm
index 9f5f68be054..eb978f33272 100644
--- a/code/modules/mob/living/silicon/robot/drone/drone.dm
+++ b/code/modules/mob/living/silicon/robot/drone/drone.dm
@@ -323,7 +323,6 @@
var/icontype
icontype = input(player,"Pick an icon") in sprite
icon_state = sprite[icontype]
- updateicon()
choose_icon(6,sprite)
*/
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index ee322a70ef7..6cef54df830 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -1118,7 +1118,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
robot_suit.head.flash2.burn_out()
robot_suit.head.flash2 = null
robot_suit.head = null
- robot_suit.updateicon()
+ robot_suit.update_icon(UPDATE_OVERLAYS)
else
new /obj/item/robot_parts/robot_suit(T)
new /obj/item/robot_parts/l_leg(T)
diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm
index f6fb357c841..c5c09ca6bd6 100644
--- a/code/modules/mob/living/simple_animal/bot/bot.dm
+++ b/code/modules/mob/living/simple_animal/bot/bot.dm
@@ -128,7 +128,7 @@
on = TRUE
REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, "depowered")
set_light(initial(light_range))
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
update_controls()
diag_hud_set_botstat()
return 1
@@ -138,7 +138,7 @@
ADD_TRAIT(src, TRAIT_IMMOBILIZED, "depowered")
set_light(0)
bot_reset() //Resets an AI's call, should it exist.
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
update_controls()
/mob/living/simple_animal/bot/New()
@@ -909,7 +909,7 @@ Pass a positive integer as an argument to override a bot's default speed.
bot_reset()
add_attack_logs(M, src, "Dehacked")
-/mob/living/simple_animal/bot/proc/update_icon()
+/mob/living/simple_animal/bot/update_icon_state()
icon_state = "[initial(icon_state)][on]"
// Machinery to simplify topic and access calls
@@ -1001,7 +1001,7 @@ Pass a positive integer as an argument to override a bot's default speed.
/mob/living/simple_animal/bot/revive(full_heal = 0, admin_revive = 0)
if(..())
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
. = 1
/mob/living/simple_animal/bot/ghost()
diff --git a/code/modules/mob/living/simple_animal/bot/construction.dm b/code/modules/mob/living/simple_animal/bot/construction.dm
index 208e6876dfb..b02fd890803 100644
--- a/code/modules/mob/living/simple_animal/bot/construction.dm
+++ b/code/modules/mob/living/simple_animal/bot/construction.dm
@@ -45,6 +45,7 @@
var/build_step = 0
var/created_name = "\improper ED-209 Security Robot" //To preserve the name if it's a unique securitron I guess
var/lasercolor = ""
+ var/new_name = ""
/obj/item/ed209_assembly/attackby(obj/item/W, mob/user, params)
..()
@@ -64,13 +65,7 @@
qdel(W)
build_step++
to_chat(user, "You add the robot leg to [src].")
- name = "legs/frame assembly"
- if(build_step == 1)
- item_state = "ed209_leg"
- icon_state = "ed209_leg"
- else
- item_state = "ed209_legs"
- icon_state = "ed209_legs"
+ update_appearance(UPDATE_NAME|UPDATE_ICON_STATE)
if(2)
var/newcolor = ""
@@ -85,14 +80,12 @@
qdel(W)
build_step++
to_chat(user, "You add the armor to [src].")
- name = "vest/legs/frame assembly"
- item_state = "[lasercolor]ed209_shell"
- icon_state = "[lasercolor]ed209_shell"
+ update_appearance(UPDATE_NAME|UPDATE_ICON_STATE)
if(3)
if(W.tool_behaviour == TOOL_WELDER && W.use_tool(src, user, volume = W.tool_volume))
build_step++
- name = "shielded frame assembly"
+ update_appearance(UPDATE_NAME|UPDATE_ICON_STATE)
to_chat(user, "You weld the vest to [src].")
if(4)
switch(lasercolor)
@@ -113,9 +106,7 @@
qdel(W)
build_step++
to_chat(user, "You add the helmet to [src].")
- name = "covered and shielded frame assembly"
- item_state = "[lasercolor]ed209_hat"
- icon_state = "[lasercolor]ed209_hat"
+ update_appearance(UPDATE_NAME|UPDATE_ICON_STATE)
if(5)
if(isprox(W))
@@ -124,9 +115,7 @@
qdel(W)
build_step++
to_chat(user, "You add the prox sensor to [src].")
- name = "covered, shielded and sensored frame assembly"
- item_state = "[lasercolor]ed209_prox"
- icon_state = "[lasercolor]ed209_prox"
+ update_appearance(UPDATE_NAME|UPDATE_ICON_STATE)
if(6)
if(istype(W, /obj/item/stack/cable_coil))
@@ -141,32 +130,30 @@
build_step = 7
playsound(loc, W.usesound, 50, 1)
to_chat(user, "You wire the ED-209 assembly.")
- name = "wired ED-209 assembly"
+ update_appearance(UPDATE_NAME)
if(7)
- var/newname = ""
+ new_name = ""
switch(lasercolor)
if("b")
if(!istype(W, /obj/item/gun/energy/laser/tag/blue))
return
- newname = "bluetag ED-209 assembly"
+ new_name = "bluetag ED-209 assembly"
if("r")
if(!istype(W, /obj/item/gun/energy/laser/tag/red))
return
- newname = "redtag ED-209 assembly"
+ new_name = "redtag ED-209 assembly"
if("")
if(!istype(W, /obj/item/gun/energy/disabler))
return
- newname = "disabler ED-209 assembly"
+ new_name = "disabler ED-209 assembly"
else
return
if(!user.unEquip(W))
return
- name = newname
build_step++
to_chat(user, "You add [W] to [src].")
- item_state = "[lasercolor]ed209_taser"
- icon_state = "[lasercolor]ed209_taser"
+ update_appearance(UPDATE_NAME|UPDATE_ICON_STATE)
qdel(W)
if(8)
@@ -175,7 +162,7 @@
to_chat(user, "You start attaching the gun to the frame...")
if(do_after(user, 40 * W.toolspeed, target = src))
build_step++
- name = "armed [name]"
+ update_appearance(UPDATE_NAME)
to_chat(user, "Taser gun attached.")
if(9)
@@ -190,6 +177,47 @@
user.unEquip(src, 1)
qdel(src)
+/obj/item/ed209_assembly/update_name()
+ . = ..()
+ switch(build_step)
+ if(1,2)
+ name = "legs/frame assembly"
+ if(3)
+ name = "vest/legs/frame assembly"
+ if(4)
+ name = "shielded frame assembly"
+ if(5)
+ name = "covered and shielded frame assembly"
+ if(6)
+ name = "covered, shielded and sensored frame assembly"
+ if(7)
+ name = "wired ED-209 assembly"
+ if(8)
+ name = new_name
+ if(9)
+ name = "armed [name]"
+
+/obj/item/ed209_assembly/update_icon_state()
+ switch(build_step)
+ if(1)
+ item_state = "ed209_leg"
+ icon_state = "ed209_leg"
+ if(2)
+ item_state = "ed209_legs"
+ icon_state = "ed209_legs"
+ if(3,4)
+ item_state = "[lasercolor]ed209_shell"
+ icon_state = "[lasercolor]ed209_shell"
+ if(5)
+ item_state = "[lasercolor]ed209_hat"
+ icon_state = "[lasercolor]ed209_hat"
+ if(6,7)
+ item_state = "[lasercolor]ed209_prox"
+ icon_state = "[lasercolor]ed209_prox"
+ if(8,9)
+ item_state = "[lasercolor]ed209_taser"
+ icon_state = "[lasercolor]ed209_taser"
+
//Floorbot assemblies
/obj/item/toolbox_tiles
desc = "It's a toolbox with tiles sticking out the top"
@@ -239,7 +267,7 @@
B.toolbox_color = "s"
if(/obj/item/storage/toolbox/fakesyndi)
B.toolbox_color = "s"
- B.icon_state = "[B.toolbox_color]toolbox_tiles"
+ B.update_icon(UPDATE_ICON_STATE)
user.put_in_hands(B)
to_chat(user, "You add the tiles into the empty toolbox. They protrude from the top.")
user.unEquip(src, 1)
@@ -248,6 +276,9 @@
to_chat(user, "You need 10 floor tiles to start building a floorbot.")
return
+/obj/item/toolbox_tiles/update_icon_state()
+ icon_state = "[toolbox_color]toolbox_tiles"
+
/obj/item/toolbox_tiles/attackby(obj/item/W, mob/user, params)
..()
if(isprox(W))
@@ -255,7 +286,7 @@
var/obj/item/toolbox_tiles/sensor/B = new /obj/item/toolbox_tiles/sensor()
B.created_name = created_name
B.toolbox_color = src.toolbox_color
- B.icon_state = "[B.toolbox_color]toolbox_tiles_sensor"
+ B.update_icon(UPDATE_ICON_STATE)
user.put_in_hands(B)
to_chat(user, "You add the sensor to the toolbox and tiles.")
user.unEquip(src, 1)
@@ -267,6 +298,9 @@
created_name = t
log_game("[key_name(user)] has renamed a robot to [t]")
+/obj/item/toolbox_tiles/sensor/update_icon_state()
+ icon_state = "[toolbox_color]toolbox_tiles_sensor"
+
/obj/item/toolbox_tiles/sensor/attackby(obj/item/W, mob/user, params)
..()
if(istype(W, /obj/item/robot_parts/l_arm) || istype(W, /obj/item/robot_parts/r_arm))
@@ -333,15 +367,14 @@
..()
if(new_skin)
skin = new_skin
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
-/obj/item/firstaid_arm_assembly/update_icon()
- overlays.Cut()
+/obj/item/firstaid_arm_assembly/update_overlays()
+ . = ..()
if(skin)
- overlays += image('icons/obj/aibots.dmi', "kit_skin_[skin]")
+ . += "kit_skin_[skin]"
if(build_step > 0)
- overlays += image('icons/obj/aibots.dmi', "na_scanner")
-
+ . += "na_scanner"
/obj/item/firstaid_arm_assembly/attackby(obj/item/I, mob/user, params)
..()
@@ -359,8 +392,7 @@
qdel(I)
build_step++
to_chat(user, "You add the health sensor to [src].")
- name = "First aid/robot arm/health analyzer assembly"
- update_icon()
+ update_appearance(UPDATE_NAME)
if(1)
if(isprox(I))
@@ -385,6 +417,11 @@
user.unEquip(src, 1)
qdel(src)
+/obj/item/firstaid_arm_assembly/update_name()
+ . = ..()
+ if(build_step == 1)
+ name = "First aid/robot arm/health analyzer assembly"
+
//Secbot Assembly
/obj/item/secbot_assembly
name = "incomplete securitron assembly"
@@ -417,11 +454,9 @@
if(I.tool_behaviour == TOOL_WELDER && I.use_tool(src, user, volume = I.tool_volume))
if(!build_step)
build_step++
- overlays += "hs_hole"
to_chat(user, "You weld a hole in [src]!")
else if(build_step == 1)
build_step--
- overlays -= "hs_hole"
to_chat(user, "You weld the hole in [src] shut!")
else if(isprox(I) && (build_step == 1))
@@ -429,8 +464,6 @@
return
build_step++
to_chat(user, "You add the prox sensor to [src]!")
- overlays += "hs_eye"
- name = "helmet/signaler/prox sensor assembly"
qdel(I)
else if(((istype(I, /obj/item/robot_parts/l_arm)) || (istype(I, /obj/item/robot_parts/r_arm))) && (build_step == 2))
@@ -438,8 +471,6 @@
return
build_step++
to_chat(user, "You add the robot arm to [src]!")
- name = "helmet/signaler/prox sensor/robot arm assembly"
- overlays += "hs_arm"
robot_arm = I.type
qdel(I)
@@ -468,13 +499,11 @@
qdel(src)
else if(build_step == 2)
- overlays -= "hs_eye"
new /obj/item/assembly/prox_sensor(get_turf(src))
to_chat(user, "You detach the proximity sensor from [src].")
build_step--
else if(build_step == 3)
- overlays -= "hs_arm"
new /obj/item/robot_parts/l_arm(get_turf(src))
to_chat(user, "You remove the robot arm from [src].")
build_step--
@@ -488,6 +517,26 @@
user.unEquip(src, 1)
qdel(src)
+ update_appearance(UPDATE_NAME|UPDATE_OVERLAYS)
+
+/obj/item/secbot_assembly/update_name()
+ . = ..()
+ switch(build_step)
+ if(2)
+ name = "helmet/signaler/prox sensor assembly"
+ if(3)
+ name = "helmet/signaler/prox sensor/robot arm assembly"
+
+/obj/item/secbot_assembly/update_overlays()
+ . = ..()
+ switch(build_step)
+ if(1)
+ . += "hs_hole"
+ if(2)
+ . += "hs_eye"
+ if(3)
+ . += "hs_arm"
+
/obj/item/griefsky_assembly
name = "\improper Griefsky assembly"
desc = "Some sort of bizarre assembly."
@@ -576,7 +625,6 @@
return
build_step++
to_chat(user, "You add the proximity sensor to [src].")
- icon_state = "honkbot_proxy"
qdel(W)
else if(build_step == 1)
if(istype(W, /obj/item/bikehorn))
@@ -584,7 +632,6 @@
return
build_step++
to_chat(user, "You add the bikehorn to [src]! Honk!")
- desc = "A clown box with a robot arm and a bikehorn permanently grafted to it. It needs a trombone to be finished"
qdel(W)
else if(build_step == 2)
if(istype(W, /obj/item/instrument/trombone))
@@ -595,3 +642,13 @@
var/mob/living/simple_animal/bot/honkbot/A = new /mob/living/simple_animal/bot/honkbot(get_turf(src))
A.robot_arm = robot_arm
qdel(src)
+ update_appearance(UPDATE_DESC|UPDATE_ICON_STATE)
+
+/obj/item/honkbot_arm_assembly/update_icon_state()
+ if(build_step == 1)
+ icon_state = "honkbot_proxy"
+
+/obj/item/honkbot_arm_assembly/update_desc()
+ . = ..()
+ if(build_step == 2)
+ desc = "A clown box with a robot arm and a bikehorn permanently grafted to it. It needs a trombone to be finished"
diff --git a/code/modules/mob/living/simple_animal/bot/floorbot.dm b/code/modules/mob/living/simple_animal/bot/floorbot.dm
index f6986117760..36174f02b72 100644
--- a/code/modules/mob/living/simple_animal/bot/floorbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/floorbot.dm
@@ -312,11 +312,10 @@
target = null
return
anchored = TRUE
- icon_state = "[toolbox_color]floorbot-c"
if(istype(target_turf, /turf/space/)) //If we are fixing an area not part of pure space, it is
- icon_state = "[toolbox_color]floorbot-c"
visible_message("[targetdirection ? "[src] begins installing a bridge plating." : "[src] begins to repair the hole."] ")
mode = BOT_REPAIRING
+ update_icon(UPDATE_ICON_STATE)
spawn(50)
if(mode == BOT_REPAIRING)
if(autotile) //Build the floor and include a tile.
@@ -325,13 +324,13 @@
target_turf.ChangeTurf(/turf/simulated/floor/plating)
mode = BOT_IDLE
amount -= 1
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
anchored = FALSE
target = null
else
var/turf/simulated/floor/F = target_turf
mode = BOT_REPAIRING
- icon_state = "[toolbox_color]floorbot-c"
+ update_icon(UPDATE_ICON_STATE)
visible_message("[src] begins repairing the floor.")
spawn(50)
if(mode == BOT_REPAIRING)
@@ -340,7 +339,7 @@
F.ChangeTurf(/turf/simulated/floor/plasteel)
mode = BOT_IDLE
amount -= 1
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
anchored = FALSE
target = null
@@ -361,9 +360,9 @@
else
amount += T.amount
qdel(T)
- update_icon()
target = null
mode = BOT_IDLE
+ update_icon(UPDATE_ICON_STATE)
/mob/living/simple_animal/bot/floorbot/proc/maketile(obj/item/stack/sheet/metal/M)
if(!istype(M, /obj/item/stack/sheet/metal))
@@ -385,7 +384,10 @@
target = null
mode = BOT_IDLE
-/mob/living/simple_animal/bot/floorbot/update_icon()
+/mob/living/simple_animal/bot/floorbot/update_icon_state()
+ if(mode == BOT_REPAIRING)
+ icon_state = "[toolbox_color]floorbot-c"
+ return
if(amount > 0)
icon_state = "[toolbox_color]floorbot[on]"
else
diff --git a/code/modules/mob/living/simple_animal/bot/honkbot.dm b/code/modules/mob/living/simple_animal/bot/honkbot.dm
index 526577c82fe..da88e66272b 100644
--- a/code/modules/mob/living/simple_animal/bot/honkbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/honkbot.dm
@@ -46,7 +46,7 @@
/mob/living/simple_animal/bot/honkbot/proc/sensor_blink()
icon_state = "honkbot-c"
- addtimer(CALLBACK(src, .proc/update_icon), 5, TIMER_OVERRIDE|TIMER_UNIQUE)
+ addtimer(CALLBACK(src, /atom/.proc/update_icon), 5, TIMER_OVERRIDE|TIMER_UNIQUE)
//honkbots react with sounds.
/mob/living/simple_animal/bot/honkbot/proc/react_ping()
@@ -159,7 +159,7 @@
playsound(src, "honkbot_e", 50, 0)
spam_flag = TRUE // prevent spam
icon_state = "honkbot-e"
- addtimer(CALLBACK(src, .proc/update_icon), 30, TIMER_OVERRIDE|TIMER_UNIQUE)
+ addtimer(CALLBACK(src, /atom/.proc/update_icon), 30, TIMER_OVERRIDE|TIMER_UNIQUE)
addtimer(CALLBACK(src, .proc/spam_flag_false), cooldowntimehorn)
/mob/living/simple_animal/bot/honkbot/proc/honk_attack(mob/living/carbon/C) // horn attack
diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm
index b66d2b1323e..d915ffcbe50 100644
--- a/code/modules/mob/living/simple_animal/bot/medbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/medbot.dm
@@ -101,10 +101,7 @@
declare_crit = 0
drops_parts = FALSE
-/mob/living/simple_animal/bot/medbot/update_icon()
- overlays.Cut()
- if(skin)
- overlays += "medskin_[skin]"
+/mob/living/simple_animal/bot/medbot/update_icon_state()
if(!on)
icon_state = "medibot0"
return
@@ -116,6 +113,11 @@
else
icon_state = "medibot1"
+/mob/living/simple_animal/bot/medbot/update_overlays()
+ . = ..()
+ if(skin)
+ . += "medskin_[skin]"
+
/mob/living/simple_animal/bot/medbot/New(loc, new_skin)
..()
var/datum/job/doctor/J = new /datum/job/doctor
diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm
index d7cc0b8f58e..6a0f09230fd 100644
--- a/code/modules/mob/living/simple_animal/bot/mulebot.dm
+++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm
@@ -143,18 +143,19 @@
flick("mulebot-emagged", src)
playsound(loc, 'sound/effects/sparks1.ogg', 100, 0)
-/mob/living/simple_animal/bot/mulebot/update_icon()
+/mob/living/simple_animal/bot/mulebot/update_icon_state()
if(open)
icon_state="mulebot-hatch"
else
icon_state = "mulebot[wires.is_cut(WIRE_MOB_AVOIDANCE)]"
- overlays.Cut()
+
+/mob/living/simple_animal/bot/mulebot/update_overlays()
+ . = ..()
if(load && !ismob(load))//buckling handles the mob offsets
load.pixel_y = initial(load.pixel_y) + 9
if(load.layer < layer)
load.layer = layer + 0.1
- overlays += load
- return
+ . += load
/mob/living/simple_animal/bot/mulebot/ex_act(severity)
unload(0)
diff --git a/code/modules/mob/living/simple_animal/bot/syndicate.dm b/code/modules/mob/living/simple_animal/bot/syndicate.dm
index 9eeb101feca..94855a636ce 100644
--- a/code/modules/mob/living/simple_animal/bot/syndicate.dm
+++ b/code/modules/mob/living/simple_animal/bot/syndicate.dm
@@ -36,7 +36,7 @@
access_card.access = list(ACCESS_SYNDICATE, ACCESS_SYNDICATE_LEADER)
prev_access = access_card.access
-/mob/living/simple_animal/bot/ed209/syndicate/update_icon()
+/mob/living/simple_animal/bot/ed209/syndicate/update_icon_state()
icon_state = initial(icon_state)
/mob/living/simple_animal/bot/ed209/syndicate/turn_on()
diff --git a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm
index ffb7d10f397..8c8c7e266eb 100644
--- a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm
+++ b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm
@@ -155,7 +155,7 @@
if(emagged)
to_chat(src, "You have been emagged; you are now completely loyal to [emagged_master] and [emagged_master.p_their()] every order!")
-/mob/living/simple_animal/spiderbot/proc/update_icon()
+/mob/living/simple_animal/spiderbot/update_icon_state()
if(mmi)
if(istype(mmi, /obj/item/mmi))
icon_state = "spiderbot-chassis-mmi"
diff --git a/code/modules/mob/living/simple_animal/hostile/spaceworms.dm b/code/modules/mob/living/simple_animal/hostile/spaceworms.dm
index 082cee74232..0fe79aa1da4 100644
--- a/code/modules/mob/living/simple_animal/hostile/spaceworms.dm
+++ b/code/modules/mob/living/simple_animal/hostile/spaceworms.dm
@@ -102,7 +102,7 @@
for(var/mob/living/simple_animal/hostile/spaceWorm/SW in totalWormSegments)
SW.update_icon()
-/mob/living/simple_animal/hostile/spaceWorm/wormHead/update_icon()
+/mob/living/simple_animal/hostile/spaceWorm/wormHead/update_icon_state()
if(stat == CONSCIOUS || stat == UNCONSCIOUS)
icon_state = "spacewormhead[previousWorm ? 1 : 0]"
if(previousWorm)
@@ -115,7 +115,6 @@
continue
SW.update_icon()
-
//Try to move onto target's turf and eat them
/mob/living/simple_animal/hostile/spaceWorm/wormHead/AttackingTarget()
. = ..()
@@ -230,19 +229,16 @@
//Update the appearence of this big weird chain-worm-thingy
-/mob/living/simple_animal/hostile/spaceWorm/proc/update_icon()
+/mob/living/simple_animal/hostile/spaceWorm/update_icon_state()
if(stat != DEAD)
if(previousWorm)
icon_state = "spaceworm[get_dir(src,previousWorm) | get_dir(src,nextWorm)]"
else
icon_state = "spacewormtail"//end of rine
dir = get_dir(src,nextWorm)
-
else
icon_state = "spacewormdead"
-
-
//Add a new worm segment
/mob/living/simple_animal/hostile/spaceWorm/proc/Attach(mob/living/simple_animal/hostile/spaceWorm/toAttach)
if(!toAttach)
diff --git a/code/modules/mob/living/simple_animal/posessed_object.dm b/code/modules/mob/living/simple_animal/posessed_object.dm
index 32868f09099..66ffa4be9ac 100644
--- a/code/modules/mob/living/simple_animal/posessed_object.dm
+++ b/code/modules/mob/living/simple_animal/posessed_object.dm
@@ -140,7 +140,7 @@
update_icon()
-/mob/living/simple_animal/possessed_object/proc/update_icon(update_pixel_xy = 0)
+/mob/living/simple_animal/possessed_object/update_icon(update_pixel_xy = 0)
name = possessed_item.name // Take on all the attributes of the item we've possessed.
real_name = name
desc = possessed_item.desc
@@ -154,3 +154,4 @@
color = possessed_item.color
overlays = possessed_item.overlays
set_opacity(possessed_item.opacity)
+ return ..(NONE)
diff --git a/code/modules/mob/living/simple_animal/slime/slime.dm b/code/modules/mob/living/simple_animal/slime/slime.dm
index ffa25e581a1..96fac4bdd19 100644
--- a/code/modules/mob/living/simple_animal/slime/slime.dm
+++ b/code/modules/mob/living/simple_animal/slime/slime.dm
@@ -114,7 +114,8 @@
coretype = text2path("/obj/item/slime_extract/[sanitizedcolour]")
regenerate_icons()
-/mob/living/simple_animal/slime/proc/update_name()
+/mob/living/simple_animal/slime/update_name()
+ . = ..()
if(slime_name_regex.Find(name))
number = rand(1, 1000)
name = "[colour] [is_adult ? "adult" : "baby"] slime ([number])"
diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm
index c080593c4a2..01d064e9268 100644
--- a/code/modules/mob/mob_movement.dm
+++ b/code/modules/mob/mob_movement.dm
@@ -507,4 +507,4 @@
if(hud_used && hud_used.move_intent && hud_used.static_inventory)
hud_used.move_intent.icon_state = icon_toggle
for(var/obj/screen/mov_intent/selector in hud_used.static_inventory)
- selector.update_icon(src)
+ selector.update_icon()
diff --git a/code/modules/newscaster/obj/newscaster.dm b/code/modules/newscaster/obj/newscaster.dm
index 2920ef625f1..30b235fa2f9 100644
--- a/code/modules/newscaster/obj/newscaster.dm
+++ b/code/modules/newscaster/obj/newscaster.dm
@@ -91,25 +91,29 @@
QDEL_NULL(photo)
return ..()
-/obj/machinery/newscaster/update_icon()
- cut_overlays()
+/obj/machinery/newscaster/update_icon_state()
if(inoperable())
icon_state = "newscaster_off"
+ return
+ if(GLOB.news_network.wanted_issue)
+ icon_state = "newscaster_wanted"
else
- if(!GLOB.news_network.wanted_issue) //wanted icon state, there can be no overlays on it as it's a priority message
- icon_state = "newscaster_normal"
- if(alert) //new message alert overlay
- add_overlay("newscaster_alert")
+ icon_state = "newscaster_normal"
+
+/obj/machinery/newscaster/update_overlays()
+ . = ..()
+ if(!GLOB.news_network.wanted_issue && alert) //wanted icon state, there can be no overlays on it as it's a priority message
+ . += "newscaster_alert"
var/hp_percent = obj_integrity * 100 / max_integrity
switch(hp_percent)
if(75 to INFINITY)
return
if(50 to 75)
- add_overlay("crack1")
+ . += "crack1"
if(25 to 50)
- add_overlay("crack2")
+ . += "crack2"
else
- add_overlay("crack3")
+ . += "crack3"
/obj/machinery/newscaster/power_change()
..()
diff --git a/code/modules/ninja/suit/n_suit_verbs/ninja_stars.dm b/code/modules/ninja/suit/n_suit_verbs/ninja_stars.dm
index 54a7f4e4206..179fc04431d 100644
--- a/code/modules/ninja/suit/n_suit_verbs/ninja_stars.dm
+++ b/code/modules/ninja/suit/n_suit_verbs/ninja_stars.dm
@@ -12,7 +12,7 @@
/obj/item/gun/energy/shuriken/update_icon()
qdel(src)
- return
+ return ..(NONE)
/obj/item/gun/energy/shuriken/dropped()
qdel(src)
diff --git a/code/modules/ninja/suit/suit_attackby.dm b/code/modules/ninja/suit/suit_attackby.dm
index 2a2683a2826..ceb4045f48e 100644
--- a/code/modules/ninja/suit/suit_attackby.dm
+++ b/code/modules/ninja/suit/suit_attackby.dm
@@ -13,7 +13,7 @@
U.put_in_hands(old_cell)
old_cell.add_fingerprint(U)
old_cell.corrupt()
- old_cell.updateicon()
+ old_cell.update_icon(UPDATE_ICON_STATE)
cell = CELL
to_chat(U, "Upgrade complete. Maximum capacity: [round(cell.maxcharge/100)]%")
else
diff --git a/code/modules/paperwork/carbonpaper.dm b/code/modules/paperwork/carbonpaper.dm
index ce9be619fb6..6084d14e97f 100644
--- a/code/modules/paperwork/carbonpaper.dm
+++ b/code/modules/paperwork/carbonpaper.dm
@@ -6,7 +6,7 @@
var/iscopy = 0
-/obj/item/paper/carbon/update_icon()
+/obj/item/paper/carbon/update_icon_state()
if(iscopy)
if(info)
icon_state = "cpaper_words"
diff --git a/code/modules/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm
index ca0039d9a0b..3eb65204d5e 100644
--- a/code/modules/paperwork/clipboard.dm
+++ b/code/modules/paperwork/clipboard.dm
@@ -70,15 +70,14 @@
popup.set_content(dat)
popup.open()
-/obj/item/clipboard/update_icon()
- overlays.Cut()
+/obj/item/clipboard/update_overlays()
+ . = ..()
if(toppaper)
- overlays += toppaper.icon_state
- overlays += toppaper.overlays
+ . += toppaper.icon_state
+ . += toppaper.overlays
if(containedpen)
- overlays += "clipboard_pen"
- overlays += "clipboard_over"
- ..()
+ . += "clipboard_pen"
+ . += "clipboard_over"
/obj/item/clipboard/attackby(obj/item/W, mob/user)
if(isPaperwork(W)) //If it's a photo, paper bundle, or piece of paper, place it on the clipboard.
diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm
index 24f3026a7d0..de5987d8f73 100644
--- a/code/modules/paperwork/folders.dm
+++ b/code/modules/paperwork/folders.dm
@@ -29,18 +29,17 @@
desc = "A white folder."
icon_state = "folder_white"
-/obj/item/folder/update_icon()
- overlays.Cut()
+/obj/item/folder/update_overlays()
+ . = ..()
if(contents.len)
- overlays += "folder_paper"
- ..()
+ . += "folder_paper"
/obj/item/folder/attackby(obj/item/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/paper) || istype(W, /obj/item/photo) || istype(W, /obj/item/paper_bundle) || istype(W, /obj/item/documents))
user.drop_item()
W.loc = src
to_chat(user, "You put [W] into [src].")
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
else if(istype(W, /obj/item/pen))
rename_interactive(user, W)
else
@@ -91,7 +90,7 @@
//Update everything
attack_self(usr)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
return
/obj/item/folder/documents
@@ -101,7 +100,7 @@
/obj/item/folder/documents/New()
..()
new /obj/item/documents/nanotrasen(src)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/folder/syndicate
name = "folder- 'TOP SECRET'"
@@ -113,7 +112,7 @@
/obj/item/folder/syndicate/red/New()
..()
new /obj/item/documents/syndicate/red(src)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/folder/syndicate/blue
icon_state = "folder_sblue"
@@ -121,7 +120,7 @@
/obj/item/folder/syndicate/blue/New()
..()
new /obj/item/documents/syndicate/blue(src)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/folder/syndicate/yellow
icon_state = "folder_syellow"
@@ -129,11 +128,11 @@
/obj/item/folder/syndicate/yellow/full/New()
..()
new /obj/item/documents/syndicate/yellow(src)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/folder/syndicate/mining/New()
. = ..()
new /obj/item/documents/syndicate/mining(src)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
diff --git a/code/modules/paperwork/frames.dm b/code/modules/paperwork/frames.dm
index a34773f4fd1..fc251e89104 100644
--- a/code/modules/paperwork/frames.dm
+++ b/code/modules/paperwork/frames.dm
@@ -25,12 +25,7 @@
qdel(A)
return ..()
-/obj/item/picture_frame/update_icon()
- overlays.Cut()
-
- if(displayed)
- overlays |= getFlatIcon(displayed)
-
+/obj/item/picture_frame/update_icon_state()
if(istype(displayed, /obj/item/photo))
icon_state = "[icon_base]-photo"
else if(istype(displayed, /obj/structure/sign/poster))
@@ -38,7 +33,11 @@
else
icon_state = "[icon_base]-paper"
- overlays |= icon_state
+/obj/item/picture_frame/update_overlays()
+ . = ..()
+ if(displayed)
+ . |= getFlatIcon(displayed)
+ . |= icon_state
/obj/item/picture_frame/proc/insert(obj/D)
if(istype(D, /obj/item/poster))
@@ -199,16 +198,19 @@
QDEL_NULL(frame)
return ..()
-/obj/structure/sign/picture_frame/update_icon()
- overlays.Cut()
+/obj/structure/sign/picture_frame/update_icon_state()
if(frame)
icon = null
icon_state = null
- overlays |= getFlatIcon(frame)
else
icon = initial(icon)
icon_state = initial(icon_state)
+/obj/structure/sign/picture_frame/update_overlays()
+ . += ..()
+ if(frame)
+ overlays |= getFlatIcon(frame)
+
/obj/structure/sign/picture_frame/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/screwdriver))
playsound(src, I.usesound, 100, 1)
diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm
index 665a6e86175..01ff88ee915 100644
--- a/code/modules/paperwork/paper.dm
+++ b/code/modules/paperwork/paper.dm
@@ -19,6 +19,7 @@
body_parts_covered = HEAD
resistance_flags = FLAMMABLE
max_integrity = 50
+ blocks_emissive = null
attack_verb = list("bapped")
dog_fashion = /datum/dog_fashion/head
drop_sound = 'sound/items/handling/paper_drop.ogg'
@@ -28,6 +29,7 @@
var/footer //The bottom stuff before the stamp but after the body
var/info_links //A different version of the paper which includes html links at fields and EOF
var/stamps //The (text for the) stamps on the paper.
+ var/list/stamp_overlays = list()
var/fields //Amount of user created fields
var/list/stamped
var/ico[0] //Icons and
@@ -56,8 +58,7 @@
update_icon()
updateinfolinks()
-/obj/item/paper/update_icon()
- ..()
+/obj/item/paper/update_icon_state()
if(info)
icon_state = "paper_words"
return
@@ -260,11 +261,10 @@
info = null
stamps = null
stamped = list()
- overlays.Cut()
+ stamp_overlays = list()
updateinfolinks()
update_icon()
-
/obj/item/paper/proc/parsepencode(t, obj/item/pen/P, mob/user as mob)
t = pencode_to_html(html_encode(t), usr, P, TRUE, TRUE, TRUE, deffont, signfont, crayonfont)
return t
@@ -484,7 +484,11 @@
if(!stamped)
stamped = new
stamped += S.type
- overlays += stampoverlay
+ stamp_overlays += stampoverlay
+ update_icon(UPDATE_OVERLAYS)
+
+/obj/item/paper/update_overlays()
+ return stamp_overlays
/*
* Premade paper
@@ -531,7 +535,7 @@
name = "paper scrap"
icon_state = "scrap"
-/obj/item/paper/crumpled/update_icon()
+/obj/item/paper/crumpled/update_icon_state()
if(info)
icon_state = "scrap_words"
@@ -549,9 +553,9 @@
info = "[fortunemessage]
"
info += "Lucky numbers: [rand(1,49)], [rand(1,49)], [rand(1,49)], [rand(1,49)], [rand(1,49)]
"
-/obj/item/paper/fortune/update_icon()
- ..()
+/obj/item/paper/fortune/update_icon_state()
icon_state = initial(icon_state)
+
/*
* Premade paper
*/
diff --git a/code/modules/paperwork/paper_bundle.dm b/code/modules/paperwork/paper_bundle.dm
index 73b980e8f53..4a4679468b7 100644
--- a/code/modules/paperwork/paper_bundle.dm
+++ b/code/modules/paperwork/paper_bundle.dm
@@ -218,36 +218,36 @@
qdel(src)
return
-
-/obj/item/paper_bundle/update_icon()
- ..()
- if(contents.len)
- var/obj/item/paper/P = src[1]
- icon_state = P.icon_state
- overlays = P.overlays
- underlays = 0
- var/i = 0
- var/photo
- for(var/obj/O in src)
- var/image/img = image('icons/obj/bureaucracy.dmi')
- if(istype(O, /obj/item/paper))
- img.icon_state = O.icon_state
- img.pixel_x -= min(1*i, 2)
- img.pixel_y -= min(1*i, 2)
- pixel_x = min(0.5*i, 1)
- pixel_y = min( 1*i, 2)
- underlays += img
- i++
- else if(istype(O, /obj/item/photo))
- var/obj/item/photo/Ph = O
- img = Ph.tiny
- photo = 1
- overlays += img
- if(i>1)
- desc = "[i] papers clipped to each other."
+/obj/item/paper_bundle/update_desc()
+ . = ..()
+ if(amount > 1)
+ desc = "[amount] papers clipped to each other."
else
desc = "A single sheet of paper."
- if(photo)
+ if(locate(/obj/item/photo) in src)
desc += "\nThere is a photo attached to it."
- overlays += image('icons/obj/bureaucracy.dmi', "clip")
- return
+
+/obj/item/paper_bundle/update_icon_state()
+ if(contents.len)
+ var/obj/item/paper/P = src[1]
+ icon_state = P.overlays
+
+/obj/item/paper_bundle/update_overlays()
+ . = ..()
+ underlays.Cut()
+ if(contents.len)
+ var/obj/item/paper/P = src[1]
+ . += P.overlays
+ for(var/obj/O in src)
+ var/image/sheet = image('icons/obj/bureaucracy.dmi')
+ if(istype(O, /obj/item/paper))
+ sheet.icon_state = O.icon_state
+ sheet.pixel_x -= min(1 * amount, 2)
+ sheet.pixel_y -= min(1 * amount, 2)
+ pixel_x = min(0.5 * amount, 1)
+ pixel_y = min(1 * amount, 2)
+ underlays += sheet
+ else if(istype(O, /obj/item/photo))
+ var/obj/item/photo/picture = O
+ . += picture.tiny
+ . += "clip"
diff --git a/code/modules/paperwork/paperbin.dm b/code/modules/paperwork/paperbin.dm
index 7c9a04efc7d..cde2a7dda0e 100644
--- a/code/modules/paperwork/paperbin.dm
+++ b/code/modules/paperwork/paperbin.dm
@@ -113,12 +113,11 @@
. += "There are no papers in the bin."
-/obj/item/paper_bin/update_icon()
+/obj/item/paper_bin/update_icon_state()
if(amount < 1)
icon_state = "paper_bin0"
else
icon_state = "paper_bin1"
- ..()
/obj/item/paper_bin/carbon
name = "carbonless paper bin"
diff --git a/code/modules/paperwork/paperplane.dm b/code/modules/paperwork/paperplane.dm
index d642b3a99eb..d4b40ea7c85 100644
--- a/code/modules/paperwork/paperplane.dm
+++ b/code/modules/paperwork/paperplane.dm
@@ -41,16 +41,15 @@
sleep(10)
return BRUTELOSS
-/obj/item/paperplane/update_icon()
- overlays.Cut()
+/obj/item/paperplane/update_overlays()
+ . = ..()
var/list/stamped = internal_paper.stamped
if(!stamped)
stamped = new
else if(stamped)
for(var/S in stamped)
var/obj/item/stamp = S
- var/image/stampoverlay = image('icons/obj/bureaucracy.dmi', "paperplane_[initial(stamp.icon_state)]")
- overlays += stampoverlay
+ . += "paperplane_[initial(stamp.icon_state)]"
/obj/item/paperplane/attack_self(mob/user) // Unfold the paper plane
to_chat(user, "You unfold [src].")
diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm
index 12cc7957b42..edf6a1261e4 100644
--- a/code/modules/paperwork/pen.dm
+++ b/code/modules/paperwork/pen.dm
@@ -61,8 +61,8 @@
"green" = list(0, 1, 0),
"blue" = list(0.5, 0.5, 1),
"yellow" = list(1, 1, 0))
- var/pen_color_iconstate = "pencolor"
- var/pen_color_shift = 3
+ var/pen_colour_iconstate = "pencolor"
+ var/pen_colour_shift = 3
/obj/item/pen/multi/Initialize(mapload)
..()
@@ -78,14 +78,14 @@
/obj/item/pen/multi/attack_self(mob/living/user as mob)
select_colour(user)
-/obj/item/pen/multi/update_icon()
- overlays.Cut()
- var/icon/o = new(icon, pen_color_iconstate)
- var/list/c = colour_choices[colour]
- o.SetIntensity(c[1], c[2], c[3])
- if(pen_color_shift)
- o.Shift(SOUTH, pen_color_shift)
- overlays += o
+/obj/item/pen/multi/update_overlays()
+ . = ..()
+ var/icon/colour_overlay = new(icon, pen_colour_iconstate)
+ var/list/colours = colour_choices[colour]
+ colour_overlay.SetIntensity(colours[1], colours[2], colours[3])
+ if(pen_colour_shift)
+ colour_overlay.Shift(SOUTH, pen_colour_shift)
+ . += colour_overlay
/obj/item/pen/fancy
name = "fancy pen"
@@ -96,13 +96,13 @@
name = "Gilded Pen"
desc = "A golden pen that is gilded with a meager amount of gold material. The word 'Nanotrasen' is etched on the clip of the pen."
icon_state = "goldpen"
- pen_color_shift = 0
+ pen_colour_shift = 0
/obj/item/pen/multi/fountain
name = "Engraved Fountain Pen"
desc = "An expensive looking pen."
icon_state = "fountainpen"
- pen_color_shift = 0
+ pen_colour_shift = 0
/*
* Sleepypens
@@ -171,7 +171,7 @@
set_light(brightness_on, 1)
update_icon()
-/obj/item/pen/edagger/update_icon()
+/obj/item/pen/edagger/update_icon_state()
if(on)
icon_state = "edagger"
item_state = "edagger"
diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm
index 7d058a0fd24..b2bb089310a 100644
--- a/code/modules/paperwork/photocopier.dm
+++ b/code/modules/paperwork/photocopier.dm
@@ -83,7 +83,7 @@
c.ico = copy.ico
c.offset_x = copy.offset_x
c.offset_y = copy.offset_y
- var/list/temp_overlays = copy.overlays //Iterates through stamps
+ var/list/temp_overlays = copy.stamp_overlays //Iterates through stamps
var/image/img //and puts a matching
for(var/j = 1, j <= temp_overlays.len, j++) //gray overlay onto the copy
if(copy.ico.len)
@@ -95,7 +95,7 @@
img = image('icons/obj/bureaucracy.dmi', "paper_stamp-dots")
img.pixel_x = copy.offset_x[j]
img.pixel_y = copy.offset_y[j]
- c.overlays += img
+ c.stamp_overlays += img
c.updateinfolinks()
return c
diff --git a/code/modules/paperwork/ticketmachine.dm b/code/modules/paperwork/ticketmachine.dm
index c0d121c2177..5e95ed1a3c4 100644
--- a/code/modules/paperwork/ticketmachine.dm
+++ b/code/modules/paperwork/ticketmachine.dm
@@ -77,7 +77,7 @@
/obj/machinery/door_control/ticket_machine_button/attack_hand(mob/user)
if(allowed(usr) || user.can_advanced_admin_interact())
icon_state = "doorctrl1"
- addtimer(CALLBACK(src, /obj/machinery/door_control/ticket_machine_button/.proc/update_icon), 15)
+ addtimer(CALLBACK(src, /atom/.proc/update_icon), 15)
for(var/obj/machinery/ticket_machine/M in GLOB.machines)
if(M.id == id)
if(cooldown)
@@ -89,11 +89,11 @@
to_chat(usr, "Access denied.")
flick("doorctrl-denied", src)
-/obj/machinery/door_control/ticket_machine_button/update_icon()
+/obj/machinery/door_control/ticket_machine_button/update_icon_state()
if(!(stat & NOPOWER))
icon_state = "doorctrl0"
-/obj/machinery/ticket_machine/update_icon()
+/obj/machinery/ticket_machine/update_icon_state()
switch(ticket_number) //Gives you an idea of how many tickets are left
if(0 to 49)
icon_state = "ticketmachine_100"
diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm
index 857b5772eb9..ca76140c39b 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -322,8 +322,6 @@
status_overlays_environ[3] = image(icon, "apco2-2")
status_overlays_environ[4] = image(icon, "apco2-3")
-
-
var/update = check_updates() //returns 0 if no need to update icons.
// 1 if we need to update the icon_state
// 2 if we need to update the overlays
@@ -331,53 +329,54 @@
return
if(force_update || update & 1) // Updating the icon state
- if(update_state & UPSTATE_ALLGOOD)
- icon_state = "apc0"
- else if(update_state & (UPSTATE_OPENED1|UPSTATE_OPENED2))
- var/basestate = "apc[ cell ? "2" : "1" ]"
- if(update_state & UPSTATE_OPENED1)
- if(update_state & (UPSTATE_MAINT|UPSTATE_BROKE))
- icon_state = "apcmaint" //disabled APC cannot hold cell
- else
- icon_state = basestate
- else if(update_state & UPSTATE_OPENED2)
- icon_state = "[basestate]-nocover"
- else if(update_state & UPSTATE_BROKE)
- icon_state = "apc-b"
- else if(update_state & UPSTATE_BLUESCREEN)
- icon_state = "apcemag"
- else if(update_state & UPSTATE_WIREEXP)
- icon_state = "apcewires"
-
-
-
+ ..(UPDATE_ICON_STATE)
+
if(!(update_state & UPSTATE_ALLGOOD))
- if(overlays.len)
- overlays = 0
- return
-
-
+ if(managed_overlays)
+ ..(UPDATE_OVERLAYS)
+ return
if(force_update || update & 2)
+ ..(UPDATE_OVERLAYS)
- if(overlays.len)
- overlays.len = 0
+/obj/machinery/power/apc/update_icon_state()
+ if(update_state & UPSTATE_ALLGOOD)
+ icon_state = "apc0"
+ else if(update_state & (UPSTATE_OPENED1|UPSTATE_OPENED2))
+ var/basestate = "apc[ cell ? "2" : "1" ]"
+ if(update_state & UPSTATE_OPENED1)
+ if(update_state & (UPSTATE_MAINT|UPSTATE_BROKE))
+ icon_state = "apcmaint" //disabled APC cannot hold cell
+ else
+ icon_state = basestate
+ else if(update_state & UPSTATE_OPENED2)
+ icon_state = "[basestate]-nocover"
+ else if(update_state & UPSTATE_BROKE)
+ icon_state = "apc-b"
+ else if(update_state & UPSTATE_BLUESCREEN)
+ icon_state = "apcemag"
+ else if(update_state & UPSTATE_WIREEXP)
+ icon_state = "apcewires"
- if(!(stat & (BROKEN|MAINT)) && update_state & UPSTATE_ALLGOOD)
- overlays += status_overlays_lock[locked+1]
- overlays += status_overlays_charging[charging+1]
- if(operating)
- overlays += status_overlays_equipment[equipment+1]
- overlays += status_overlays_lighting[lighting+1]
- overlays += status_overlays_environ[environ+1]
+/obj/machinery/power/apc/update_overlays()
+ . = ..()
+ if(!(update_state & UPSTATE_ALLGOOD))
+ return
+ if(!(stat & (BROKEN|MAINT)) && update_state & UPSTATE_ALLGOOD)
+ . += status_overlays_lock[locked+1]
+ . += status_overlays_charging[charging+1]
+ if(operating)
+ . += status_overlays_equipment[equipment+1]
+ . += status_overlays_lighting[lighting+1]
+ . += status_overlays_environ[environ+1]
/obj/machinery/power/apc/proc/check_updates()
var/last_update_state = update_state
var/last_update_overlay = update_overlay
- update_state = 0
- update_overlay = 0
+ update_state = NONE
+ update_overlay = NONE
if(cell)
update_state |= UPSTATE_CELL_IN
@@ -456,6 +455,7 @@
if(!second_pass) //The first time, we just cut overlays
addtimer(CALLBACK(src, /obj/machinery/power/apc/proc.flicker, TRUE), 1)
cut_overlays()
+ managed_overlays = null
// APC power distruptions have a chance to propogate to other machines on its network
for(var/obj/machinery/M in area)
// Please don't cascade, thanks
@@ -763,7 +763,7 @@
user.visible_message("[user.name] removes [cell] from [src]!", "You remove [cell].")
user.put_in_hands(cell)
cell.add_fingerprint(user)
- cell.update_icon()
+ cell.update_icon(UPDATE_OVERLAYS)
cell = null
charging = APC_NOT_CHARGING
update_icon()
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index 8e9b353a55e..0f3fe650084 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -107,15 +107,14 @@ By design, d1 is the smallest direction and d2 is the highest
if(level == 1 && isturf(loc))
invisibility = i ? INVISIBILITY_MAXIMUM : 0
- updateicon()
+ update_icon()
-/obj/structure/cable/proc/updateicon()
+/obj/structure/cable/update_icon_state()
if(invisibility)
icon_state = "[d1]-[d2]-f"
else
icon_state = "[d1]-[d2]"
-
////////////////////////////////////////////
// Power related
///////////////////////////////////////////
@@ -587,19 +586,22 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe/cable_restrain
C.color = color
return C
-/obj/item/stack/cable_coil/update_icon()
+/obj/item/stack/cable_coil/update_name()
+ . = ..()
+ if(amount > 2)
+ name = "cable coil"
+ else
+ name = "cable piece"
+
+/obj/item/stack/cable_coil/update_icon_state()
if(!color)
color = pick(COLOR_RED, COLOR_BLUE, COLOR_GREEN, COLOR_ORANGE, COLOR_WHITE, COLOR_PINK, COLOR_YELLOW, COLOR_CYAN)
if(amount == 1)
icon_state = "coil1"
- name = "cable piece"
else if(amount == 2)
icon_state = "coil2"
- name = "cable piece"
else
icon_state = "coil"
- name = "cable coil"
- ..()
/obj/item/stack/cable_coil/proc/update_wclass()
if(amount == 1)
@@ -686,7 +688,7 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe/cable_restrain
C.d1 = 0 //it's a O-X node cable
C.d2 = dirn
C.add_fingerprint(user)
- C.updateicon()
+ C.update_icon()
//create a new powernet with the cable, if needed it will be merged later
var/datum/powernet/PN = new()
@@ -796,7 +798,7 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe/cable_restrain
C.d2 = nd2
C.add_fingerprint()
- C.updateicon()
+ C.update_icon()
C.mergeConnectedNetworks(C.d1) //merge the powernets...
@@ -831,7 +833,7 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe/cable_restrain
src.amount = rand(1,2)
pixel_x = rand(-2,2)
pixel_y = rand(-2,2)
- update_icon()
+ update_appearance(UPDATE_NAME|UPDATE_ICON_STATE)
update_wclass()
/obj/item/stack/cable_coil/yellow
@@ -877,7 +879,7 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe/cable_restrain
energy_type = /datum/robot_energy_storage/cable
is_cyborg = TRUE
-/obj/item/stack/cable_coil/cyborg/update_icon()
+/obj/item/stack/cable_coil/cyborg/update_icon_state()
return // icon_state should always be a full cable
/obj/item/stack/cable_coil/cyborg/attack_self(mob/user)
diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm
index 0d1e53c1b1d..f42e243c45c 100644
--- a/code/modules/power/cell.dm
+++ b/code/modules/power/cell.dm
@@ -28,7 +28,7 @@
charge = maxcharge
if(ratingdesc)
desc += " This one has a power rating of [DisplayPower(maxcharge)], and you should not swallow it."
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/stock_parts/cell/Destroy()
STOP_PROCESSING(SSobj, src)
@@ -49,16 +49,16 @@
else
return PROCESS_KILL
-/obj/item/stock_parts/cell/update_icon()
- overlays.Cut()
+/obj/item/stock_parts/cell/update_overlays()
+ . = ..()
if(grown_battery)
- overlays += image('icons/obj/power.dmi', "grown_wires")
+ . += image('icons/obj/power.dmi', "grown_wires")
if(charge < 0.01)
return
else if(charge/maxcharge >=0.995)
- overlays += "cell-o2"
+ . += "cell-o2"
else
- overlays += "cell-o1"
+ . += "cell-o1"
/obj/item/stock_parts/cell/proc/percent() // return % charge of cell
return 100 * charge / maxcharge
@@ -179,7 +179,7 @@
/obj/item/stock_parts/cell/crap/empty/New()
..()
charge = 0
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/stock_parts/cell/upgraded
name = "upgraded power cell"
@@ -204,7 +204,7 @@
/obj/item/stock_parts/cell/secborg/empty/New()
..()
charge = 0
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/stock_parts/cell/hos_gun
name = "\improper X-01 multiphase energy gun power cell"
@@ -243,7 +243,7 @@
/obj/item/stock_parts/cell/high/empty/New()
..()
charge = 0
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/stock_parts/cell/super
name = "super-capacity power cell"
@@ -257,7 +257,7 @@
/obj/item/stock_parts/cell/super/empty/New()
..()
charge = 0
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/stock_parts/cell/hyper
name = "hyper-capacity power cell"
@@ -271,7 +271,7 @@
/obj/item/stock_parts/cell/hyper/empty/New()
..()
charge = 0
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/stock_parts/cell/bluespace
name = "bluespace power cell"
@@ -286,7 +286,7 @@
/obj/item/stock_parts/cell/bluespace/empty/New()
..()
charge = 0
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/stock_parts/cell/bluespace/charging
name = "self-charging bluespace power cell"
@@ -315,9 +315,8 @@
rating = 12
ratingdesc = FALSE
-/obj/item/stock_parts/cell/infinite/abductor/update_icon()
- return
-
+/obj/item/stock_parts/cell/infinite/abductor/update_overlays()
+ return list()
/obj/item/stock_parts/cell/potato
name = "potato battery"
@@ -351,7 +350,7 @@
/obj/item/stock_parts/cell/emproof/empty/New()
..()
charge = 0
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/stock_parts/cell/emproof/emp_act(severity)
return
diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm
index b0dc421164c..8f7ca7d303d 100644
--- a/code/modules/power/generator.dm
+++ b/code/modules/power/generator.dm
@@ -21,10 +21,11 @@
/obj/machinery/power/generator/Initialize(mapload)
. = ..()
- update_desc()
+ update_appearance(UPDATE_DESC)
connect()
-/obj/machinery/power/generator/proc/update_desc()
+/obj/machinery/power/generator/update_desc()
+ . = ..()
desc = initial(desc) + " Its cold circulator is located on the [dir2text(cold_dir)] side, and its heat circulator is located on the [dir2text(hot_dir)] side."
/obj/machinery/power/generator/Destroy()
@@ -74,22 +75,21 @@
set_light(0)
else
set_light(light_range_on, light_power_on)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
-
-/obj/machinery/power/generator/update_icon()
+/obj/machinery/power/generator/update_overlays()
+ . = ..()
if(stat & (NOPOWER|BROKEN))
- cut_overlays()
- underlays.Cut()
return
- else
- cut_overlays()
- if(lastgenlev != 0)
- add_overlay(mutable_appearance('icons/obj/power.dmi', "teg-op[lastgenlev]"))
- underlays += emissive_appearance(icon, "teg-op[lastgenlev]")
- add_overlay(mutable_appearance('icons/obj/power.dmi', "teg-oc[lastcirc]"))
- underlays += emissive_appearance(icon, "teg-oc[lastcirc]")
+ if(lastgenlev != 0)
+ . += "teg-op[lastgenlev]"
+ if(light)
+ . += emissive_appearance(icon, "teg-op[lastgenlev]")
+
+ . += "teg-oc[lastcirc]"
+ if(light)
+ . += emissive_appearance(icon, "teg-oc[lastcirc]")
/obj/machinery/power/generator/process()
if(stat & (NOPOWER|BROKEN))
@@ -152,7 +152,7 @@
if((genlev != lastgenlev) || (circ != lastcirc))
lastgenlev = genlev
lastcirc = circ
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
updateDialog()
@@ -188,7 +188,7 @@
hot_dir = SOUTH
connect()
to_chat(user, "You reverse the generator's circulator settings. The cold circulator is now on the [dir2text(cold_dir)] side, and the heat circulator is now on the [dir2text(hot_dir)] side.")
- update_desc()
+ update_appearance(UPDATE_DESC)
/obj/machinery/power/generator/wrench_act(mob/user, obj/item/I)
. = TRUE
diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm
index 7cb831343d2..e921d6e1b45 100644
--- a/code/modules/power/gravitygenerator.dm
+++ b/code/modules/power/gravitygenerator.dm
@@ -250,15 +250,14 @@ GLOBAL_LIST_EMPTY(gravity_generators)
else
return "off"
-/obj/machinery/gravity_generator/main/update_icon()
- ..()
- cut_overlays()
+/obj/machinery/gravity_generator/main/update_overlays()
+ . = ..()
if(get_status() != "generator_welding" && get_status() != "generator_plasteel")
- add_overlay("generator_part")
+ . += "generator_part"
if(get_status() == "off")
return
- add_overlay("[get_status()]")
- add_overlay("[overlay_state]")
+ . += "[get_status()]"
+ . += "[overlay_state]"
/**
* Set the charging state based on external power and the breaker state.
diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm
index c7051772dfb..5edab32a23b 100644
--- a/code/modules/power/lighting.dm
+++ b/code/modules/power/lighting.dm
@@ -279,8 +279,7 @@
// A.update_lights()
return ..()
-/obj/machinery/light/update_icon()
-
+/obj/machinery/light/update_icon_state()
switch(status) // set icon_states
if(LIGHT_OK)
if(emergency_mode)
@@ -296,7 +295,6 @@
if(LIGHT_BROKEN)
icon_state = "[base_state]-broken"
on = FALSE
- return
/**
* Updates the light's 'on' state and power consumption based on [/obj/machinery/light/var/on].
diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm
index 31684a9583a..76c78afa518 100644
--- a/code/modules/power/port_gen.dm
+++ b/code/modules/power/port_gen.dm
@@ -30,7 +30,7 @@
/obj/machinery/power/port_gen/proc/handleInactive()
return
-/obj/machinery/power/port_gen/update_icon()
+/obj/machinery/power/port_gen/update_icon_state()
icon_state = "[base_icon]_[active]"
/obj/machinery/power/port_gen/process()
diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm
index 6757ee090ea..beaf1034315 100644
--- a/code/modules/power/singularity/emitter.dm
+++ b/code/modules/power/singularity/emitter.dm
@@ -97,13 +97,12 @@
QDEL_NULL(sparks)
return ..()
-/obj/machinery/power/emitter/update_icon()
+/obj/machinery/power/emitter/update_icon_state()
if(active && powernet && avail(active_power_usage))
icon_state = "emitter_+a"
else
icon_state = "emitter"
-
/obj/machinery/power/emitter/emag_act(mob/living/user)
if(!emagged)
locked = FALSE
diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm
index d4a2464dae1..5d8692173e6 100644
--- a/code/modules/power/singularity/field_generator.dm
+++ b/code/modules/power/singularity/field_generator.dm
@@ -40,15 +40,14 @@ field_generator power level display
var/list/obj/machinery/field/generator/connected_gens
var/clean_up = FALSE
-/obj/machinery/field/generator/update_icon()
- overlays.Cut()
+/obj/machinery/field/generator/update_overlays()
+ . = ..()
if(warming_up)
- overlays += "+a[warming_up]"
+ . += "+a[warming_up]"
if(fields.len)
- overlays += "+on"
+ . += "+on"
if(power_level)
- overlays += "+p[power_level]"
-
+ . += "+p[power_level]"
/obj/machinery/field/generator/Initialize(mapload)
. = ..()
diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
index 5d383f90a09..7fabc07bfb2 100644
--- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
@@ -87,11 +87,6 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
icon_state = "end_cap"
reference = "end_cap"
-/obj/structure/particle_accelerator/update_icon()
- ..()
- return
-
-
/obj/structure/particle_accelerator/verb/rotate()
set name = "Rotate Clockwise"
set category = "Object"
@@ -155,7 +150,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
if(prob(50))
qdel(src)
-/obj/structure/particle_accelerator/update_icon()
+/obj/structure/particle_accelerator/update_icon_state()
switch(construction_state)
if(0,1)
icon_state="[reference]"
@@ -166,7 +161,6 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
icon_state="[reference]p[strength]"
else
icon_state="[reference]c"
- return
/obj/structure/particle_accelerator/proc/update_state()
if(master)
@@ -292,9 +286,6 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
dir = turn(dir, 90)
return 1
-/obj/machinery/particle_accelerator/update_icon()
- return
-
/obj/machinery/particle_accelerator/attackby(obj/item/W, mob/user, params)
if(!iscoil(W))
return ..()
diff --git a/code/modules/power/singularity/particle_accelerator/particle_chamber.dm b/code/modules/power/singularity/particle_accelerator/particle_chamber.dm
index c3c058a5289..78410e02d96 100644
--- a/code/modules/power/singularity/particle_accelerator/particle_chamber.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle_chamber.dm
@@ -4,7 +4,3 @@
icon = 'icons/obj/machines/particle_accelerator.dmi'
icon_state = "fuel_chamber"
reference = "fuel_chamber"
-
-/obj/structure/particle_accelerator/fuel_chamber/update_icon()
- ..()
- return
diff --git a/code/modules/power/singularity/particle_accelerator/particle_control.dm b/code/modules/power/singularity/particle_accelerator/particle_control.dm
index ebbd0aa34c2..badc288f2c7 100644
--- a/code/modules/power/singularity/particle_accelerator/particle_control.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle_control.dm
@@ -64,7 +64,7 @@
return
-/obj/machinery/particle_accelerator/control_box/update_icon()
+/obj/machinery/particle_accelerator/control_box/update_icon_state()
if(active)
icon_state = "[reference]p[strength]"
else
@@ -83,7 +83,6 @@
icon_state = "[reference]w"
else
icon_state = "[reference]c"
- return
/obj/machinery/particle_accelerator/control_box/Topic(href, href_list)
if(..(href, href_list))
diff --git a/code/modules/power/singularity/particle_accelerator/particle_emitter.dm b/code/modules/power/singularity/particle_accelerator/particle_emitter.dm
index c598e5cb74d..7e6753b2c4a 100644
--- a/code/modules/power/singularity/particle_accelerator/particle_emitter.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle_emitter.dm
@@ -18,10 +18,6 @@
icon_state = "emitter_right"
reference = "emitter_right"
-/obj/structure/particle_accelerator/particle_emitter/update_icon()
- ..()
- return
-
/obj/structure/particle_accelerator/particle_emitter/proc/set_delay(delay)
if(delay && delay >= 0)
fire_delay = delay
diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm
index 501e53d2c9b..8aa7a7a2444 100644
--- a/code/modules/power/smes.dm
+++ b/code/modules/power/smes.dm
@@ -83,17 +83,17 @@
C += PC.maxcharge
capacity = C / (15000) * 1e6
-/obj/machinery/power/smes/update_icon()
- cut_overlays()
+/obj/machinery/power/smes/update_overlays()
+ . = ..()
if(stat & BROKEN)
return
- add_overlay("smes-op[outputting ? 1 : 0]")
- add_overlay("smes-oc[inputting ? 1 : 0]")
+ . += "smes-op[outputting ? 1 : 0]"
+ . += "smes-oc[inputting ? 1 : 0]"
- var/clevel = chargedisplay()
- if(clevel > 0)
- add_overlay("smes-og[clevel]")
+ var/charge_level = chargedisplay()
+ if(charge_level > 0)
+ . += "smes-og[charge_level]"
/obj/machinery/power/smes/attackby(obj/item/I, mob/user, params)
//opening using screwdriver
diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm
index 7da3df614de..2bad3dcc1d6 100644
--- a/code/modules/power/solar.dm
+++ b/code/modules/power/solar.dm
@@ -93,15 +93,13 @@
new /obj/item/shard(src.loc)
qdel(src)
-/obj/machinery/power/solar/update_icon()
- ..()
- overlays.Cut()
+/obj/machinery/power/solar/update_overlays()
+ . = ..()
if(stat & BROKEN)
- overlays += image('icons/goonstation/objects/power.dmi', icon_state = "solar_panel-b", layer = FLY_LAYER)
+ . += image('icons/goonstation/objects/power.dmi', icon_state = "solar_panel-b", layer = FLY_LAYER)
else
- overlays += image('icons/goonstation/objects/power.dmi', icon_state = "solar_panel", layer = FLY_LAYER)
+ . += image('icons/goonstation/objects/power.dmi', icon_state = "solar_panel", layer = FLY_LAYER)
set_angle(adir)
- return
//calculates the fraction of the sunlight that the panel recieves
/obj/machinery/power/solar/proc/update_solar_exposure()
@@ -340,16 +338,16 @@
set_panels(cdir)
updateDialog()
-/obj/machinery/power/solar_control/update_icon()
- overlays.Cut()
+/obj/machinery/power/solar_control/update_overlays()
+ . = ..()
if(stat & NOPOWER)
- overlays += "[icon_keyboard]_off"
+ . += "[icon_keyboard]_off"
return
- overlays += icon_keyboard
+ . += icon_keyboard
if(stat & BROKEN)
- overlays += "[icon_state]_broken"
+ . += "[icon_state]_broken"
else
- overlays += icon_screen
+ . += icon_screen
/obj/machinery/power/solar_control/attack_ai(mob/user as mob)
add_hiddenprint(user)
diff --git a/code/modules/power/treadmill.dm b/code/modules/power/treadmill.dm
index 70f3ab44c50..6c1ade9e7e6 100644
--- a/code/modules/power/treadmill.dm
+++ b/code/modules/power/treadmill.dm
@@ -22,7 +22,7 @@
if(anchored)
connect_to_network()
-/obj/machinery/power/treadmill/update_icon()
+/obj/machinery/power/treadmill/update_icon_state()
icon_state = speed ? "conveyor-1" : "conveyor0"
/obj/machinery/power/treadmill/Crossed(mob/living/M, oldloc)
@@ -171,13 +171,13 @@
. = ..()
. += "The display reads:[line1]
[line2]
"
-/obj/machinery/treadmill_monitor/update_icon()
- overlays.Cut()
+/obj/machinery/treadmill_monitor/update_overlays()
+ . = ..()
if(stat & NOPOWER || !total_joules || !on)
line1 = ""
line2 = ""
else if(stat & BROKEN)
- overlays += image('icons/obj/status_display.dmi', icon_state = "ai_bsod")
+ . += image('icons/obj/status_display.dmi', icon_state = "ai_bsod")
line1 = "A@#$A"
line2 = "729%!"
else
diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm
index 04315eb6f2f..a1e3422f34c 100644
--- a/code/modules/projectiles/ammunition.dm
+++ b/code/modules/projectiles/ammunition.dm
@@ -35,13 +35,15 @@
pixel_x = rand(-10.0, 10)
pixel_y = rand(-10.0, 10)
dir = pick(GLOB.alldirs)
- update_icon()
+ update_appearance(UPDATE_DESC|UPDATE_ICON_STATE)
-/obj/item/ammo_casing/update_icon()
- ..()
- icon_state = "[initial(icon_state)][BB ? "-live" : ""]"
+/obj/item/ammo_casing/update_desc()
+ . = ..()
desc = "[initial(desc)][BB ? "" : " This one is spent."]"
+/obj/item/ammo_casing/update_icon_state()
+ icon_state = "[initial(icon_state)][BB ? "-live" : ""]"
+
/obj/item/ammo_casing/proc/newshot(params) //For energy weapons, shotgun shells and wands (!).
if(!BB)
BB = new projectile_type(src, params)
@@ -61,7 +63,7 @@
else
continue
if(boolets > 0)
- box.update_icon()
+ box.update_appearance(UPDATE_DESC|UPDATE_ICON_STATE)
to_chat(user, "You collect [boolets] shell\s. [box] now contains [length(box.stored_ammo)] shell\s.")
playsound(src, 'sound/weapons/gun_interactions/bulletinsert.ogg', 50, 1)
else
@@ -115,7 +117,7 @@
var/list/stored_ammo = list()
var/ammo_type = /obj/item/ammo_casing
var/max_ammo = 7
- var/multi_sprite_step = AMMO_MULTI_SPRITE_STEP_NONE // see update_icon() for details
+ var/multi_sprite_step = AMMO_MULTI_SPRITE_STEP_NONE // see update_icon_state() for details
var/caliber
var/multiload = 1
var/list/initial_mats //For calculating refund values.
@@ -124,7 +126,7 @@
..()
for(var/i in 1 to max_ammo)
stored_ammo += new ammo_type(src)
- update_icon()
+ update_appearance(UPDATE_DESC|UPDATE_ICON)
/obj/item/ammo_box/Destroy()
QDEL_LIST(stored_ammo)
@@ -142,7 +144,7 @@
if(!initial_mats)
initial_mats = materials.Copy()
update_mat_value()
- update_icon()
+ update_appearance(UPDATE_DESC|UPDATE_ICON_STATE)
return b
/obj/item/ammo_box/proc/give_round(obj/item/ammo_casing/R, replace_spent = 0)
@@ -197,8 +199,8 @@
if(!silent)
to_chat(user, "You load [num_loaded] shell\s into \the [src]!")
playsound(src, 'sound/weapons/gun_interactions/shotguninsert.ogg', 50, 1)
- A.update_icon()
- update_icon()
+ A.update_appearance(UPDATE_DESC|UPDATE_ICON_STATE)
+ update_appearance(UPDATE_DESC|UPDATE_ICON_STATE)
return num_loaded
@@ -208,7 +210,7 @@
user.put_in_hands(A)
playsound(src, 'sound/weapons/gun_interactions/remove_bullet.ogg', 50, 1)
to_chat(user, "You remove a round from \the [src]!")
- update_icon()
+ update_appearance(UPDATE_DESC|UPDATE_ICON_STATE)
// `multi_sprite_step` governs whether there are different sprites for different degrees of being loaded.
// AMMO_MULTI_SPRITE_STEP_NONE - just a single `icon_state`, no shenanigans
@@ -216,7 +218,7 @@
// (positive integer) - sprites for intermediate degrees of being loaded are present in the .dmi
// and are named `[icon_state]-[ammo_count]`, with `ammo_count` being incremented in steps of `multi_sprite_step`
// ... except the very final full mag sprite with is just `[icon_state]`
-/obj/item/ammo_box/update_icon()
+/obj/item/ammo_box/update_icon_state()
var/icon_base = initial(icon_state)
switch(multi_sprite_step)
if(AMMO_MULTI_SPRITE_STEP_NONE)
@@ -229,6 +231,9 @@
icon_state = icon_base
else
icon_state = "[icon_base]-[shown_ammo]"
+
+/obj/item/ammo_box/update_desc()
+ . = ..()
desc = "[initial(desc)] There are [length(stored_ammo)] shell\s left!"
/obj/item/ammo_box/proc/update_mat_value()
diff --git a/code/modules/projectiles/ammunition/ammo_casings.dm b/code/modules/projectiles/ammunition/ammo_casings.dm
index 16d16144c9e..270df98a036 100644
--- a/code/modules/projectiles/ammunition/ammo_casings.dm
+++ b/code/modules/projectiles/ammunition/ammo_casings.dm
@@ -359,11 +359,14 @@
var/modified = 0
harmful = FALSE
-/obj/item/ammo_casing/caseless/foam_dart/update_icon()
- ..()
+/obj/item/ammo_casing/caseless/foam_dart/update_desc()
+ . = ..()
+ if(modified)
+ desc = "Its nerf or nothing! ... Although, this one doesn't look too safe."
+
+/obj/item/ammo_casing/caseless/foam_dart/update_icon_state()
if(modified)
icon_state = "foamdart_empty"
- desc = "Its nerf or nothing! ... Although, this one doesn't look too safe."
if(BB)
BB.icon_state = "foamdart_empty"
else
@@ -416,11 +419,15 @@
projectile_type = /obj/item/projectile/bullet/reusable/foam_dart/sniper
icon_state = "foamdartsniper"
-/obj/item/ammo_casing/caseless/foam_dart/sniper/update_icon()
- ..()
+
+/obj/item/ammo_casing/caseless/foam_dart/sniper/update_desc()
+ . = ..()
+ if(modified)
+ desc = "Its nerf or nothing! ... Although, this one doesn't look too safe."
+
+/obj/item/ammo_casing/caseless/foam_dart/sniper/update_icon_state()
if(modified)
icon_state = "foamdartsniper_empty"
- desc = "Its nerf or nothing! ... Although, this one doesn't look too safe."
if(BB)
BB.icon_state = "foamdartsniper_empty"
else
diff --git a/code/modules/projectiles/ammunition/magazines.dm b/code/modules/projectiles/ammunition/magazines.dm
index af6ec80673d..8321f240b7b 100644
--- a/code/modules/projectiles/ammunition/magazines.dm
+++ b/code/modules/projectiles/ammunition/magazines.dm
@@ -228,13 +228,11 @@
multi_sprite_step = 1
caliber = "9mm"
-/obj/item/ammo_box/magazine/enforcer/update_icon()
- ..()
- overlays.Cut()
-
+/obj/item/ammo_box/magazine/enforcer/update_overlays()
+ . = ..()
var/ammo = ammo_count()
if(ammo && is_rubber())
- overlays += image('icons/obj/ammo.dmi', icon_state = "enforcer-r")
+ . += image('icons/obj/ammo.dmi', icon_state = "enforcer-r")
/obj/item/ammo_box/magazine/enforcer/examine(mob/user)
. = ..()
@@ -446,15 +444,13 @@
multi_sprite_step = 1
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
-/obj/item/ammo_box/magazine/toy/enforcer/update_icon()
- ..()
- overlays.Cut()
-
+/obj/item/ammo_box/magazine/toy/enforcer/update_overlays()
+ . = ..()
var/ammo = ammo_count()
if(ammo && is_riot())
- overlays += image('icons/obj/ammo.dmi', icon_state = "enforcer-rd")
+ . += image('icons/obj/ammo.dmi', icon_state = "enforcer-rd")
else if(ammo)
- overlays += image('icons/obj/ammo.dmi', icon_state = "enforcer-bd")
+ . += image('icons/obj/ammo.dmi', icon_state = "enforcer-bd")
/obj/item/ammo_box/magazine/toy/enforcer/proc/is_riot()//if the topmost bullet is a riot dart
var/ammo = ammo_count()
@@ -500,11 +496,14 @@
icon_state = "handgun_ammo_battery"
var/charge = 1000
-/obj/item/ammo_box/magazine/detective/speedcharger/update_icon()
+/obj/item/ammo_box/magazine/detective/speedcharger/update_icon_state()
+ return
+
+/obj/item/ammo_box/magazine/detective/speedcharger/update_overlays()
+ . = ..()
var/charge_percent_rounded = round(charge_percent(), 20) // to the nearest 20%
- cut_overlays()
if(charge_percent_rounded)
- add_overlay("hab_charge_[charge_percent_rounded]")
+ . += "hab_charge_[charge_percent_rounded]"
/obj/item/ammo_box/magazine/detective/speedcharger/proc/charge_percent()
return (charge / initial(charge) * 100)
diff --git a/code/modules/projectiles/guns/alien.dm b/code/modules/projectiles/guns/alien.dm
index 4d662c11a9f..9c757931a71 100644
--- a/code/modules/projectiles/guns/alien.dm
+++ b/code/modules/projectiles/guns/alien.dm
@@ -11,9 +11,12 @@
restricted_species = list(/datum/species/vox/armalis)
sprite_sheets_inhand = list("Vox Armalis" = 'icons/mob/clothing/species/armalis/held.dmi') //Big guns big birds.
-/obj/item/gun/energy/noisecannon/update_icon()
+/obj/item/gun/energy/noisecannon/update_icon_state()
return
+/obj/item/gun/energy/noisecannon/update_overlays()
+ return list()
+
//Casing
/obj/item/ammo_casing/energy/sonic
projectile_type = /obj/item/projectile/energy/sonic
diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm
index 94e846e86ad..8ecd0b07e29 100644
--- a/code/modules/projectiles/guns/energy.dm
+++ b/code/modules/projectiles/guns/energy.dm
@@ -20,6 +20,9 @@
var/charge_delay = 4
/// Do you want the gun to fit into a turret, defaults to true, used for if a energy gun is too strong to be in a turret, or does not make sense to be in one.
var/can_fit_in_turrets = TRUE
+ var/new_icon_state
+ /// Used when updating icon and overlays to determine the energy pips
+ var/ratio
/obj/item/gun/energy/examine(mob/user)
. = ..()
@@ -141,41 +144,8 @@
update_icon()
return
-/obj/item/gun/energy/update_icon()
- cut_overlays()
- icon_state = initial(icon_state)
- var/ratio = CEILING((cell.charge / cell.maxcharge) * charge_sections, 1)
- var/inhand_ratio = CEILING((cell.charge / cell.maxcharge) * inhand_charge_sections, 1)
- var/obj/item/ammo_casing/energy/shot = ammo_type[select]
- var/iconState = "[icon_state]_charge"
- var/itemState = null
- if(!initial(item_state))
- itemState = icon_state
- if(modifystate)
- add_overlay("[icon_state]_[shot.select_name]")
- iconState += "_[shot.select_name]"
- if(itemState)
- itemState += "[shot.select_name]"
- if(cell.charge < shot.e_cost)
- overlays += "[icon_state]_empty"
- else
- if(!shaded_charge)
- for(var/i = ratio, i >= 1, i--)
- add_overlay(image(icon = icon, icon_state = iconState, pixel_x = ammo_x_offset * (i -1)))
- else
- add_overlay(image(icon = icon, icon_state = "[icon_state]_[modifystate ? "[shot.select_name]_" : ""]charge[ratio]"))
- if(gun_light && can_flashlight)
- var/iconF = "flight"
- if(gun_light.on)
- iconF = "flight_on"
- add_overlay(image(icon = icon, icon_state = iconF, pixel_x = flight_x_offset, pixel_y = flight_y_offset))
- if(bayonet && can_bayonet)
- add_overlay(knife_overlay)
- if(itemState)
- itemState += "[inhand_ratio]"
- item_state = itemState
- if(current_skin)
- icon_state = current_skin
+/obj/item/gun/energy/update_icon(updates=ALL)
+ ..()
var/mob/living/carbon/human/user = loc
if(istype(user))
if(user.hand) //this is kinda ew but whatever
@@ -183,6 +153,46 @@
else
user.update_inv_l_hand()
+/obj/item/gun/energy/update_icon_state()
+ icon_state = initial(icon_state)
+ ratio = CEILING((cell.charge / cell.maxcharge) * charge_sections, 1)
+ var/inhand_ratio = CEILING((cell.charge / cell.maxcharge) * inhand_charge_sections, 1)
+ var/obj/item/ammo_casing/energy/shot = ammo_type[select]
+ new_icon_state = "[icon_state]_charge"
+ var/new_item_state = null
+ if(!initial(item_state))
+ new_item_state = icon_state
+ if(modifystate)
+ new_icon_state += "_[shot.select_name]"
+ if(new_item_state)
+ new_item_state += "[shot.select_name]"
+ if(new_item_state)
+ new_item_state += "[inhand_ratio]"
+ item_state = new_item_state
+ if(current_skin)
+ icon_state = current_skin
+
+/obj/item/gun/energy/update_overlays()
+ . = ..()
+ var/obj/item/ammo_casing/energy/shot = ammo_type[select]
+ if(modifystate)
+ . += "[icon_state]_[shot.select_name]"
+ if(cell.charge < shot.e_cost)
+ . += "[icon_state]_empty"
+ else
+ if(!shaded_charge)
+ for(var/i = ratio, i >= 1, i--)
+ . += image(icon = icon, icon_state = new_icon_state, pixel_x = ammo_x_offset * (i -1))
+ else
+ . += image(icon = icon, icon_state = "[icon_state]_[modifystate ? "[shot.select_name]_" : ""]charge[ratio]")
+ if(gun_light && can_flashlight)
+ var/iconF = "flight"
+ if(gun_light.on)
+ iconF = "flight_on"
+ . += image(icon = icon, icon_state = iconF, pixel_x = flight_x_offset, pixel_y = flight_y_offset)
+ if(bayonet && can_bayonet)
+ . += knife_overlay
+
/obj/item/gun/energy/ui_action_click()
toggle_gunlight()
diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
index ec3e0bd05f8..5355cac315c 100644
--- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
+++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
@@ -149,19 +149,18 @@
update_icon()
overheat = FALSE
-/obj/item/gun/energy/kinetic_accelerator/update_icon()
- cut_overlays()
+/obj/item/gun/energy/kinetic_accelerator/update_overlays()
+ . = ..()
if(empty_state && !can_shoot())
- add_overlay(empty_state)
+ . += empty_state
if(gun_light && can_flashlight)
var/iconF = "flight"
if(gun_light.on)
iconF = "flight_on"
- add_overlay(image(icon = icon, icon_state = iconF, pixel_x = flight_x_offset, pixel_y = flight_y_offset))
+ . += image(icon = icon, icon_state = iconF, pixel_x = flight_x_offset, pixel_y = flight_y_offset)
if(bayonet && can_bayonet)
- add_overlay(knife_overlay)
-
+ . += knife_overlay
/obj/item/gun/energy/kinetic_accelerator/experimental
name = "experimental kinetic accelerator"
diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm
index 723e56608e0..6cfeb3e53ce 100644
--- a/code/modules/projectiles/guns/energy/laser.dm
+++ b/code/modules/projectiles/guns/energy/laser.dm
@@ -130,12 +130,11 @@
ammo_type = list(/obj/item/ammo_casing/energy/immolator/strong, /obj/item/ammo_casing/energy/immolator/scatter)
origin_tech = "combat=5;magnets=5;powerstorage=4"
-/obj/item/gun/energy/immolator/multi/update_icon()
- ..()
+/obj/item/gun/energy/immolator/multi/update_overlays()
+ . = ..()
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
var/append = shot.select_name
- overlays += image(icon = icon, icon_state = "multilensimmolator-[append]")
-
+ . += image(icon = icon, icon_state = "multilensimmolator-[append]")
/obj/item/gun/energy/immolator/multi/cyborg
name = "cyborg immolator cannon"
diff --git a/code/modules/projectiles/guns/energy/nuclear.dm b/code/modules/projectiles/guns/energy/nuclear.dm
index 8ef30631949..dd92016cbfe 100644
--- a/code/modules/projectiles/guns/energy/nuclear.dm
+++ b/code/modules/projectiles/guns/energy/nuclear.dm
@@ -44,10 +44,10 @@
cell.maxcharge = 600
cell.charge = 600
-/obj/item/gun/energy/gun/mini/update_icon()
- ..()
+/obj/item/gun/energy/gun/mini/update_overlays()
+ . = ..()
if(gun_light && gun_light.on)
- overlays += "mini-light"
+ . += "mini-light"
/obj/item/gun/energy/gun/hos
name = "\improper X-01 MultiPhase Energy Gun"
diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm
index bd9361c3e52..d7d9309fc90 100644
--- a/code/modules/projectiles/guns/energy/special.dm
+++ b/code/modules/projectiles/guns/energy/special.dm
@@ -43,11 +43,14 @@
ammo_x_offset = 1
can_holster = TRUE
-/obj/item/gun/energy/decloner/update_icon()
- ..()
+/obj/item/gun/energy/decloner/update_icon_state()
+ return
+
+/obj/item/gun/energy/decloner/update_overlays()
+ . = list()
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
if(cell.charge > shot.e_cost)
- add_overlay("decloner_spin")
+ . += "decloner_spin"
// Flora Gun //
/obj/item/gun/energy/floragun
@@ -191,8 +194,8 @@
else
return ..()
-/obj/item/gun/energy/plasmacutter/update_icon()
- return
+/obj/item/gun/energy/plasmacutter/update_overlays()
+ return list()
/obj/item/gun/energy/plasmacutter/adv
name = "advanced plasma cutter"
@@ -217,10 +220,9 @@
var/obj/effect/portal/orange
-/obj/item/gun/energy/wormhole_projector/update_icon()
+/obj/item/gun/energy/wormhole_projector/update_icon_state()
icon_state = "wormhole_projector[select]"
item_state = icon_state
- return
/obj/item/gun/energy/wormhole_projector/process_chamber()
..()
@@ -262,8 +264,8 @@
ammo_type = list(/obj/item/ammo_casing/energy/c3dbullet)
can_charge = FALSE
-/obj/item/gun/energy/printer/update_icon()
- return
+/obj/item/gun/energy/printer/update_overlays()
+ return list()
/obj/item/gun/energy/printer/emp_act()
return
@@ -519,8 +521,7 @@
..()
update_icon()
-/obj/item/gun/energy/bsg/update_icon()
- . = ..()
+/obj/item/gun/energy/bsg/update_icon_state()
if(core)
if(has_bluespace_crystal)
icon_state = "bsg_finished"
@@ -691,7 +692,7 @@
dat += "Power cost: "
dat += "[powercost]"
-/obj/item/gun/energy/temperature/proc/update_temperature()
+/obj/item/gun/energy/temperature/update_icon_state()
switch(temperature)
if(501 to INFINITY)
item_state = "tempgun_8"
@@ -713,32 +714,26 @@
item_state = "tempgun_0"
icon_state = item_state
-/obj/item/gun/energy/temperature/update_icon()
- overlays = 0
- update_temperature()
- update_user()
- update_charge()
-
-/obj/item/gun/energy/temperature/proc/update_user()
if(istype(loc,/mob/living/carbon))
var/mob/living/carbon/M = loc
M.update_inv_back()
M.update_inv_l_hand()
M.update_inv_r_hand()
-/obj/item/gun/energy/temperature/proc/update_charge()
+/obj/item/gun/energy/temperature/update_overlays()
+ . = ..()
var/charge = cell.charge
switch(charge)
- if(900 to INFINITY) overlays += "900"
- if(800 to 900) overlays += "800"
- if(700 to 800) overlays += "700"
- if(600 to 700) overlays += "600"
- if(500 to 600) overlays += "500"
- if(400 to 500) overlays += "400"
- if(300 to 400) overlays += "300"
- if(200 to 300) overlays += "200"
- if(100 to 202) overlays += "100"
- if(-INFINITY to 100) overlays += "0"
+ if(900 to INFINITY) . += "900"
+ if(800 to 900) . += "800"
+ if(700 to 800) . += "700"
+ if(600 to 700) . += "600"
+ if(500 to 600) . += "500"
+ if(400 to 500) . += "400"
+ if(300 to 400) . += "300"
+ if(200 to 300) . += "200"
+ if(100 to 200) . += "100"
+ if(-INFINITY to 100) . += "0"
// Mimic Gun //
/obj/item/gun/energy/mimicgun
@@ -850,7 +845,7 @@
return
var/new_speedcharger_charge = cell.give(S.charge)
S.charge -= new_speedcharger_charge
- S.update_icon()
+ S.update_icon(UPDATE_OVERLAYS)
update_icon()
/obj/item/gun/energy/detective/process_fire(atom/target, mob/living/user, message, params, zone_override, bonus_spread)
diff --git a/code/modules/projectiles/guns/magic.dm b/code/modules/projectiles/guns/magic.dm
index 330dd8864ec..2b24510e4ec 100644
--- a/code/modules/projectiles/guns/magic.dm
+++ b/code/modules/projectiles/guns/magic.dm
@@ -72,7 +72,7 @@
charges++
return 1
-/obj/item/gun/magic/update_icon()
+/obj/item/gun/magic/update_icon_state()
return
/obj/item/gun/magic/shoot_with_empty_chamber(mob/living/user as mob|obj)
diff --git a/code/modules/projectiles/guns/magic/wand.dm b/code/modules/projectiles/guns/magic/wand.dm
index 3fa985e1b0d..0dc8e3c8e82 100644
--- a/code/modules/projectiles/guns/magic/wand.dm
+++ b/code/modules/projectiles/guns/magic/wand.dm
@@ -22,7 +22,7 @@
. = ..()
. += "Has [charges] charge\s remaining."
-/obj/item/gun/magic/wand/update_icon()
+/obj/item/gun/magic/wand/update_icon_state()
icon_state = "[initial(icon_state)][charges ? "" : "-drained"]"
diff --git a/code/modules/projectiles/guns/misc/blastcannon.dm b/code/modules/projectiles/guns/misc/blastcannon.dm
index ffbcfe9dd1c..9aad9847084 100644
--- a/code/modules/projectiles/guns/misc/blastcannon.dm
+++ b/code/modules/projectiles/guns/misc/blastcannon.dm
@@ -22,19 +22,29 @@
user.put_in_hands(bomb)
user.visible_message("[user] detaches [bomb] from [src].")
bomb = null
- update_icon()
+ update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_ICON_STATE)
return ..()
-/obj/item/gun/blastcannon/update_icon()
+/obj/item/gun/blastcannon/update_name()
+ . = ..()
if(bomb)
- icon_state = icon_state_loaded
name = "blast cannon"
+ else
+ name = initial(name)
+
+/obj/item/gun/blastcannon/update_desc()
+ . = ..()
+ if(bomb)
desc = "A makeshift device used to concentrate a bomb's blast energy to a narrow wave."
else
- icon_state = initial(icon_state)
- name = initial(name)
desc = initial(desc)
+/obj/item/gun/blastcannon/update_icon_state()
+ if(bomb)
+ icon_state = icon_state_loaded
+ else
+ icon_state = initial(icon_state)
+
/obj/item/gun/blastcannon/attackby(obj/O, mob/user)
if(istype(O, /obj/item/transfer_valve))
var/obj/item/transfer_valve/T = O
@@ -47,7 +57,7 @@
user.visible_message("[user] attaches [T] to [src]!")
T.forceMove(src)
bomb = T
- update_icon()
+ update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_ICON_STATE)
return TRUE
return ..()
@@ -71,7 +81,7 @@
return ..()
var/power = calculate_bomb()
QDEL_NULL(bomb)
- update_icon()
+ update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_ICON_STATE)
var/heavy = power * 0.2
var/medium = power * 0.5
var/light = power
diff --git a/code/modules/projectiles/guns/projectile.dm b/code/modules/projectiles/guns/projectile.dm
index 7c0dc177b84..44208240bf3 100644
--- a/code/modules/projectiles/guns/projectile.dm
+++ b/code/modules/projectiles/guns/projectile.dm
@@ -22,14 +22,30 @@
return "This is a ballistic weapon. To reload, click the weapon in your hand to unload (if needed), then add the appropriate ammo. The description \
will tell you what caliber you need."
-/obj/item/gun/projectile/update_icon()
- ..()
+/obj/item/gun/projectile/update_name()
+ . = ..()
+ if(sawn_state)
+ name = "sawn-off [name]"
+ else
+ name = initial(name)
+
+/obj/item/gun/projectile/update_desc()
+ . = ..()
+ if(sawn_state)
+ desc = sawn_desc
+ else
+ desc = initial(desc)
+
+/obj/item/gun/projectile/update_icon_state()
if(current_skin)
icon_state = "[current_skin][suppressed ? "-suppressed" : ""][sawn_state ? "_sawn" : ""]"
else
icon_state = "[initial(icon_state)][suppressed ? "-suppressed" : ""][sawn_state ? "_sawn" : ""]"
+
+/obj/item/gun/projectile/update_overlays()
+ . = ..()
if(bayonet && can_bayonet)
- overlays += knife_overlay
+ . += knife_overlay
/obj/item/gun/projectile/process_chamber(eject_casing = 1, empty_chamber = 1)
var/obj/item/ammo_casing/AC = chambered //Find chambered round
@@ -201,14 +217,12 @@
if(sawn_state == SAWN_OFF)
return
user.visible_message("[user] shortens \the [src]!", "You shorten \the [src].")
- name = "sawn-off [name]"
- desc = sawn_desc
w_class = WEIGHT_CLASS_NORMAL
item_state = "gun"//phil235 is it different with different skin?
slot_flags &= ~SLOT_BACK //you can't sling it on your back
slot_flags |= SLOT_BELT //but you can wear it on your belt (poorly concealed under a trenchcoat, ideally)
sawn_state = SAWN_OFF
- update_icon()
+ update_appearance()
return 1
// Sawing guns related proc
diff --git a/code/modules/projectiles/guns/projectile/automatic.dm b/code/modules/projectiles/guns/projectile/automatic.dm
index 9c763b65ead..2a47c99c8ad 100644
--- a/code/modules/projectiles/guns/projectile/automatic.dm
+++ b/code/modules/projectiles/guns/projectile/automatic.dm
@@ -8,16 +8,15 @@
fire_delay = 2
actions_types = list(/datum/action/item_action/toggle_firemode)
-/obj/item/gun/projectile/automatic/update_icon()
- ..()
- overlays.Cut()
- if(!select)
- overlays += "[initial(icon_state)]semi"
- if(select == 1)
- overlays += "[initial(icon_state)]burst"
+/obj/item/gun/projectile/automatic/update_icon_state()
icon_state = "[initial(icon_state)][magazine ? "-[magazine.max_ammo]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
- if(bayonet && can_bayonet)
- overlays += knife_overlay
+
+/obj/item/gun/projectile/automatic/update_overlays()
+ . = ..()
+ if(!select)
+ . += "[initial(icon_state)]semi"
+ if(select == 1)
+ . += "[initial(icon_state)]burst"
/obj/item/gun/projectile/automatic/attackby(obj/item/A as obj, mob/user as mob, params)
. = ..()
@@ -108,8 +107,7 @@
..()
empty_alarm()
-/obj/item/gun/projectile/automatic/c20r/update_icon()
- ..()
+/obj/item/gun/projectile/automatic/c20r/update_icon_state()
icon_state = "c20r[magazine ? "-[CEILING(get_ammo(0)/4, 1)*4]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
//WT550//
@@ -130,8 +128,7 @@
knife_x_offset = 25
knife_y_offset = 12
-/obj/item/gun/projectile/automatic/wt550/update_icon()
- ..()
+/obj/item/gun/projectile/automatic/wt550/update_icon_state()
icon_state = "wt550[magazine ? "-[CEILING(get_ammo(0)/4, 1)*4]" : ""]"
//Type-U3 Uzi//
@@ -181,23 +178,24 @@
else
return ..()
-/obj/item/gun/projectile/automatic/m90/update_icon()
- ..()
- overlays.Cut()
- switch(select)
- if(0)
- overlays += "[initial(icon_state)]semi"
- if(1)
- overlays += "[initial(icon_state)]burst"
- if(2)
- overlays += "[initial(icon_state)]gren"
+/obj/item/gun/projectile/automatic/m90/update_icon_state()
icon_state = "[initial(icon_state)][magazine ? "" : "-e"]"
if(magazine)
- overlays += image(icon = icon, icon_state = "m90-[CEILING(get_ammo(0)/6, 1)*6]")
item_state = "m90-[CEILING(get_ammo(0)/7.5, 1)]"
else
item_state = "m90-0"
- return
+
+/obj/item/gun/projectile/automatic/m90/update_overlays()
+ . = ..()
+ switch(select)
+ if(0)
+ . += "[initial(icon_state)]semi"
+ if(1)
+ . += "[initial(icon_state)]burst"
+ if(2)
+ . += "[initial(icon_state)]gren"
+ if(magazine)
+ . += image(icon = icon, icon_state = "m90-[CEILING(get_ammo(0)/6, 1)*6]")
/obj/item/gun/projectile/automatic/m90/burst_select()
var/mob/living/carbon/human/user = usr
@@ -270,10 +268,10 @@
..()
update_icon()
-/obj/item/gun/projectile/automatic/shotgun/bulldog/proc/update_magazine()
+/obj/item/gun/projectile/automatic/shotgun/bulldog/update_overlays()
+ . = ..()
if(magazine)
- overlays.Cut()
- overlays += "[magazine.icon_state]"
+ . += "[magazine.icon_state]"
if(istype(magazine, /obj/item/ammo_box/magazine/m12g/XtrLrg))
w_class = WEIGHT_CLASS_BULKY
else
@@ -281,9 +279,7 @@
else
w_class = WEIGHT_CLASS_NORMAL
-/obj/item/gun/projectile/automatic/shotgun/bulldog/update_icon()
- overlays.Cut()
- update_magazine()
+/obj/item/gun/projectile/automatic/shotgun/bulldog/update_icon_state()
icon_state = "bulldog[chambered ? "" : "-e"]"
/obj/item/gun/projectile/automatic/shotgun/bulldog/attackby(obj/item/A as obj, mob/user as mob, params)
@@ -314,6 +310,5 @@
can_suppress = FALSE
burst_size = 2
-/obj/item/gun/projectile/automatic/lasercarbine/update_icon()
- ..()
+/obj/item/gun/projectile/automatic/lasercarbine/update_icon_state()
icon_state = "lasercarbine[magazine ? "-[CEILING(get_ammo(0)/5, 1)*5]" : ""]"
diff --git a/code/modules/projectiles/guns/projectile/bow.dm b/code/modules/projectiles/guns/projectile/bow.dm
index 638f750d1dd..b6e572c8769 100644
--- a/code/modules/projectiles/guns/projectile/bow.dm
+++ b/code/modules/projectiles/guns/projectile/bow.dm
@@ -11,7 +11,7 @@
var/ready_to_fire = 0
var/slowdown_when_ready = 2
-/obj/item/gun/projectile/bow/update_icon()
+/obj/item/gun/projectile/bow/update_icon_state()
if(magazine.ammo_count() && !ready_to_fire)
icon_state = "bow_loaded"
else if(ready_to_fire)
diff --git a/code/modules/projectiles/guns/projectile/launchers.dm b/code/modules/projectiles/guns/projectile/launchers.dm
index 8f04c5c58fd..7956084b707 100644
--- a/code/modules/projectiles/guns/projectile/launchers.dm
+++ b/code/modules/projectiles/guns/projectile/launchers.dm
@@ -47,10 +47,8 @@
/obj/item/gun/projectile/automatic/gyropistol/process_chamber(eject_casing = 0, empty_chamber = 1)
..()
-/obj/item/gun/projectile/automatic/gyropistol/update_icon()
- ..()
+/obj/item/gun/projectile/automatic/gyropistol/update_icon_state()
icon_state = "[initial(icon_state)][magazine ? "loaded" : ""]"
- return
/obj/item/gun/projectile/automatic/speargun
name = "kinetic speargun"
@@ -69,7 +67,7 @@
select = 0
actions_types = list()
-/obj/item/gun/projectile/automatic/speargun/update_icon()
+/obj/item/gun/projectile/automatic/speargun/update_icon_state()
return
/obj/item/gun/projectile/automatic/speargun/attack_self()
diff --git a/code/modules/projectiles/guns/projectile/pistol.dm b/code/modules/projectiles/guns/projectile/pistol.dm
index 5c1f15677bb..0f56d9ddd5c 100644
--- a/code/modules/projectiles/guns/projectile/pistol.dm
+++ b/code/modules/projectiles/guns/projectile/pistol.dm
@@ -15,10 +15,8 @@
fire_delay = 0
actions_types = list()
-/obj/item/gun/projectile/automatic/pistol/update_icon()
- ..()
+/obj/item/gun/projectile/automatic/pistol/update_icon_state()
icon_state = "[initial(icon_state)][magazine ? "-[magazine.max_ammo]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
- return
//M1911//
/obj/item/gun/projectile/automatic/pistol/m1911
@@ -52,20 +50,21 @@
options["Red Handle"] = "enforcer_redgrip"
options["Cancel"] = null
-/obj/item/gun/projectile/automatic/pistol/enforcer/update_icon()
- ..()
+/obj/item/gun/projectile/automatic/pistol/enforcer/update_icon_state()
if(current_skin)
icon_state = "[current_skin][chambered ? "" : "-e"]"
else
icon_state = "[initial(icon_state)][chambered ? "" : "-e"]"
- overlays.Cut()
+
+/obj/item/gun/projectile/automatic/pistol/enforcer/update_overlays()
+ . = list()
if(suppressed)
- overlays += image(icon = icon, icon_state = "enforcer_supp", pixel_x = 4)
+ . += image(icon = icon, icon_state = "enforcer_supp", pixel_x = 4)
if(gun_light)
- var/iconF = "Enforcer_light"
+ var/flashlight = "Enforcer_light"
if(gun_light.on)
- iconF = "Enforcer_light-on"
- overlays += image(icon = icon, icon_state = iconF, pixel_x = 0)
+ flashlight = "Enforcer_light-on"
+ . += image(icon = icon, icon_state = flashlight, pixel_x = 0)
/obj/item/gun/projectile/automatic/pistol/enforcer/ui_action_click()
toggle_gunlight()
diff --git a/code/modules/projectiles/guns/projectile/revolver.dm b/code/modules/projectiles/guns/projectile/revolver.dm
index cd7f3b9e5f6..626e50a91db 100644
--- a/code/modules/projectiles/guns/projectile/revolver.dm
+++ b/code/modules/projectiles/guns/projectile/revolver.dm
@@ -367,18 +367,16 @@
else
to_chat(user, "You need at least ten lengths of cable if you want to make a sling!")
-/obj/item/gun/projectile/revolver/doublebarrel/improvised/update_icon()
- ..()
- if(sling)
- icon_state = "ishotgun_sling"
- item_state = "ishotgun_sling"
+/obj/item/gun/projectile/revolver/doublebarrel/improvised/update_icon_state()
+ icon_state = "ishotgun[sling ? "_sling" : ""]"
+ item_state = "ishotgun[sling ? "_sling" : ""]"
/obj/item/gun/projectile/revolver/doublebarrel/improvised/sawoff(mob/user)
. = ..()
if(. && sling) //sawing off the gun removes the sling
new /obj/item/stack/cable_coil(get_turf(src), 10)
sling = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
//caneshotgun
@@ -408,9 +406,12 @@
/obj/item/gun/projectile/revolver/doublebarrel/improvised/cane/is_crutch()
return 1
-/obj/item/gun/projectile/revolver/doublebarrel/improvised/cane/update_icon()
+/obj/item/gun/projectile/revolver/doublebarrel/improvised/cane/update_icon_state()
return
+/obj/item/gun/projectile/revolver/doublebarrel/improvised/cane/update_overlays()
+ return list()
+
/obj/item/gun/projectile/revolver/doublebarrel/improvised/cane/attackby(obj/item/A, mob/user, params)
if(istype(A, /obj/item/stack/cable_coil))
return
diff --git a/code/modules/projectiles/guns/projectile/saw.dm b/code/modules/projectiles/guns/projectile/saw.dm
index 37d173e09a1..b1fe9c909ff 100644
--- a/code/modules/projectiles/guns/projectile/saw.dm
+++ b/code/modules/projectiles/guns/projectile/saw.dm
@@ -22,7 +22,7 @@
playsound(src, cover_open ? 'sound/weapons/gun_interactions/sawopen.ogg' : 'sound/weapons/gun_interactions/sawclose.ogg', 50, 1)
update_icon()
-/obj/item/gun/projectile/automatic/l6_saw/update_icon()
+/obj/item/gun/projectile/automatic/l6_saw/update_icon_state()
icon_state = "l6[cover_open ? "open" : "closed"][magazine ? CEILING(get_ammo(0)/12.5, 1)*25 : "-empty"][suppressed ? "-suppressed" : ""]"
item_state = "l6[cover_open ? "openmag" : "closedmag"]"
diff --git a/code/modules/projectiles/guns/projectile/shotgun.dm b/code/modules/projectiles/guns/projectile/shotgun.dm
index 8fbfcfd1186..3126cc695f0 100644
--- a/code/modules/projectiles/guns/projectile/shotgun.dm
+++ b/code/modules/projectiles/guns/projectile/shotgun.dm
@@ -58,7 +58,6 @@
playsound(M, 'sound/weapons/gun_interactions/shotgunpump.ogg', 60, 1)
pump_unload(M)
pump_reload(M)
- update_icon() //I.E. fix the desc
return 1
/obj/item/gun/projectile/shotgun/proc/pump_unload(mob/M)
@@ -136,8 +135,6 @@
/obj/item/gun/projectile/shotgun/riot/proc/post_sawoff()
- name = "sawn-off riot shotgun"
- desc = sawn_desc
w_class = WEIGHT_CLASS_NORMAL
current_skin = "riotshotgun_sawn"
item_state = "riotshotgun_sawn" //phil235 is it different with different skin?
@@ -145,7 +142,7 @@
slot_flags |= SLOT_BELT //but you can wear it on your belt (poorly concealed under a trenchcoat, ideally)
sawn_state = SAWN_OFF
magazine.max_ammo = 3
- update_icon()
+ update_appearance()
/obj/item/gun/projectile/shotgun/riot/proc/unsaw(obj/item/A, mob/user)
@@ -179,8 +176,6 @@
return 1
/obj/item/gun/projectile/shotgun/riot/proc/post_unsaw()
- name = initial(name)
- desc = initial(desc)
w_class = initial(w_class)
current_skin = "riotshotgun"
item_state = initial(item_state)
@@ -188,10 +183,9 @@
slot_flags |= SLOT_BACK
sawn_state = SAWN_INTACT
magazine.max_ammo = 6
- update_icon()
+ update_appearance()
-/obj/item/gun/projectile/shotgun/riot/update_icon() //Can't use the old proc as it makes it go to riotshotgun-short_sawn
- ..()
+/obj/item/gun/projectile/shotgun/riot/update_icon_state() //Can't use the old proc as it makes it go to riotshotgun-short_sawn
if(current_skin)
icon_state = "[current_skin]"
else
@@ -231,7 +225,6 @@
else
pump_unload(M)
bolt_open = !bolt_open
- update_icon() //I.E. fix the desc
return 1
/obj/item/gun/projectile/shotgun/blow_up(mob/user)
diff --git a/code/modules/projectiles/guns/projectile/sniper.dm b/code/modules/projectiles/guns/projectile/sniper.dm
index 0ae34930234..abb833221c8 100644
--- a/code/modules/projectiles/guns/projectile/sniper.dm
+++ b/code/modules/projectiles/guns/projectile/sniper.dm
@@ -35,7 +35,7 @@
QDEL_NULL(magazine)
magazine = new /obj/item/ammo_box/magazine/sniper_rounds/penetrator(src)
-/obj/item/gun/projectile/automatic/sniper_rifle/update_icon()
+/obj/item/gun/projectile/automatic/sniper_rifle/update_icon_state()
if(magazine)
icon_state = "sniper-mag"
else
@@ -50,7 +50,7 @@
max_ammo = 6
caliber = ".50"
-/obj/item/ammo_box/magazine/sniper_rounds/update_icon()
+/obj/item/ammo_box/magazine/sniper_rounds/update_icon_state()
if(ammo_count())
icon_state = "[initial(icon_state)]-ammo"
else
@@ -178,13 +178,13 @@
max_ammo = 6
caliber = "foam_force_sniper"
-/obj/item/ammo_box/magazine/toy/sniper_rounds/update_icon()
- overlays.Cut()
+/obj/item/ammo_box/magazine/toy/sniper_rounds/update_icon_state()
+ return
+/obj/item/ammo_box/magazine/toy/sniper_rounds/update_overlays()
+ . = ..()
var/ammo = ammo_count()
if(ammo && istype(contents[contents.len], /obj/item/ammo_casing/caseless/foam_dart/sniper/riot))
- overlays += image('icons/obj/ammo.dmi', icon_state = ".50mag-r")
+ . += ".50mag-r"
else if(ammo)
- overlays += image('icons/obj/ammo.dmi', icon_state = ".50mag-f")
- else
- icon_state = "[initial(icon_state)]"
+ . += ".50mag-f"
diff --git a/code/modules/projectiles/guns/projectile/toy.dm b/code/modules/projectiles/guns/projectile/toy.dm
index 4fe035d9a66..1fa508948e4 100644
--- a/code/modules/projectiles/guns/projectile/toy.dm
+++ b/code/modules/projectiles/guns/projectile/toy.dm
@@ -30,8 +30,7 @@
can_holster = TRUE
actions_types = list()
-/obj/item/gun/projectile/automatic/toy/pistol/update_icon()
- ..()
+/obj/item/gun/projectile/automatic/toy/pistol/update_icon_state()
icon_state = "[initial(icon_state)][magazine ? "-[magazine.max_ammo]" : ""][chambered ? "" : "-e"]"
/obj/item/gun/projectile/automatic/toy/pistol/riot
@@ -50,18 +49,16 @@
mag_type = /obj/item/ammo_box/magazine/toy/enforcer
can_flashlight = TRUE
-/obj/item/gun/projectile/automatic/toy/pistol/enforcer/update_icon()
- ..()
+/obj/item/gun/projectile/automatic/toy/pistol/enforcer/update_icon_state()
icon_state = "[initial(icon_state)][chambered ? "" : "-e"]"
-/obj/item/gun/projectile/automatic/toy/pistol/enforcer/update_icon()
- ..()
- overlays.Cut()
+/obj/item/gun/projectile/automatic/toy/pistol/enforcer/update_overlays()
+ . = ..()
if(gun_light)
- var/iconF = "Enforcer_light"
+ var/flashlight = "Enforcer_light"
if(gun_light.on)
- iconF = "Enforcer_light-on"
- overlays += image(icon = 'icons/obj/guns/projectile.dmi', icon_state = iconF, pixel_x = 0)
+ flashlight = "Enforcer_light-on"
+ . += image(icon = 'icons/obj/guns/projectile.dmi', icon_state = flashlight, pixel_x = 0)
/obj/item/gun/projectile/automatic/toy/pistol/enforcer/ui_action_click()
toggle_gunlight()
diff --git a/code/modules/projectiles/guns/rocket.dm b/code/modules/projectiles/guns/rocket.dm
index 96a97c8fe1a..8a47db4a50f 100644
--- a/code/modules/projectiles/guns/rocket.dm
+++ b/code/modules/projectiles/guns/rocket.dm
@@ -24,9 +24,6 @@
rockets = null
return ..()
-/obj/item/gun/rocketlauncher/update_icon()
- return
-
/obj/item/gun/rocketlauncher/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/ammo_casing/rocket))
if(rockets.len < max_rockets)
diff --git a/code/modules/projectiles/guns/throw.dm b/code/modules/projectiles/guns/throw.dm
index 58f3db026e1..7e24fc66146 100644
--- a/code/modules/projectiles/guns/throw.dm
+++ b/code/modules/projectiles/guns/throw.dm
@@ -41,9 +41,12 @@
loaded_projectiles = null
return ..()
-/obj/item/gun/throw/update_icon()
+/obj/item/gun/throw/update_icon_state()
return
+/obj/item/gun/throw/update_overlays()
+ return list()
+
/obj/item/gun/throw/attackby(obj/item/I, mob/user, params)
if(istype(I, valid_projectile_type) && !(I.flags & NODROP))
if(get_ammocount() < max_capacity)
diff --git a/code/modules/projectiles/guns/throw/crossbow.dm b/code/modules/projectiles/guns/throw/crossbow.dm
index 156c5b60625..e8fc799362a 100644
--- a/code/modules/projectiles/guns/throw/crossbow.dm
+++ b/code/modules/projectiles/guns/throw/crossbow.dm
@@ -29,7 +29,7 @@
if(cell && severity)
emp_act(severity)
-/obj/item/gun/throw/crossbow/update_icon()
+/obj/item/gun/throw/crossbow/update_icon_state()
if(!tension)
if(!to_launch)
icon_state = "[initial(icon_state)]"
@@ -63,7 +63,7 @@
..()
if(to_launch)
modify_projectile(to_launch, 1)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/gun/throw/crossbow/attack_self(mob/living/user)
if(tension)
@@ -77,7 +77,7 @@
else
user.visible_message("[user] relaxes the tension on [src]'s string.","You relax the tension on [src]'s string.")
tension = 0
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
else
draw(user)
@@ -92,7 +92,7 @@
if(do_after(user, 25 * drawtension, target = user))
tension = drawtension
user.visible_message("[usr] draws back the string of [src]!","[src] clunks as you draw the string to its maximum tension!!")
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/gun/throw/crossbow/attackby(obj/item/I, mob/user, params)
if(!istype(I, /obj/item/stock_parts/cell))
@@ -145,7 +145,8 @@
/obj/item/gun/throw/crossbow/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override)
..()
tension = 0
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
+
/obj/item/gun/throw/crossbow/french
name = "french powered crossbow"
icon_state = "fcrossbow"
diff --git a/code/modules/projectiles/guns/throw/pielauncher.dm b/code/modules/projectiles/guns/throw/pielauncher.dm
index 6df067f45d6..a10b69ead09 100644
--- a/code/modules/projectiles/guns/throw/pielauncher.dm
+++ b/code/modules/projectiles/guns/throw/pielauncher.dm
@@ -24,7 +24,7 @@
/obj/item/gun/throw/piecannon/notify_ammo_count()
return "[src] has [get_ammocount()] of [max_capacity] pies left."
-/obj/item/gun/throw/piecannon/update_icon()
+/obj/item/gun/throw/piecannon/update_icon_state()
if(to_launch)
icon_state = "piecannon1"
else
@@ -33,4 +33,4 @@
/obj/item/gun/throw/piecannon/process_chamber()
..()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm
index b70a7bad280..9dd5b57e700 100644
--- a/code/modules/projectiles/projectile/magic.dm
+++ b/code/modules/projectiles/projectile/magic.dm
@@ -144,7 +144,7 @@
var/door_type = pick(door_types)
var/obj/structure/mineral_door/D = new door_type(T)
T.ChangeTurf(/turf/simulated/floor/plasteel)
- D.Open()
+ D.operate()
/obj/item/projectile/magic/door/proc/OpenDoor(obj/machinery/door/D)
if(istype(D,/obj/machinery/door/airlock))
diff --git a/code/modules/projectiles/projectile/reusable.dm b/code/modules/projectiles/projectile/reusable.dm
index 3e0272f9f29..5a43025a9ec 100644
--- a/code/modules/projectiles/projectile/reusable.dm
+++ b/code/modules/projectiles/projectile/reusable.dm
@@ -49,7 +49,7 @@
if(pen)
newdart.add_pen(pen)
pen = null
- newdart.update_icon()
+ newdart.update_appearance(UPDATE_DESC|UPDATE_ICON_STATE)
/obj/item/projectile/bullet/reusable/foam_dart/Destroy()
QDEL_NULL(pen)
diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm
index ca9b1f08214..0f1de2105f5 100644
--- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm
+++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm
@@ -129,7 +129,7 @@
else
stat |= NOPOWER
-/obj/machinery/chem_dispenser/update_icon()
+/obj/machinery/chem_dispenser/update_icon_state()
if(panel_open)
icon_state = "[initial(icon_state)]-o"
return
@@ -228,7 +228,7 @@
if(Adjacent(usr) && !issilicon(usr))
usr.put_in_hands(beaker)
beaker = null
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
else
return FALSE
@@ -257,7 +257,7 @@
I.forceMove(src)
to_chat(user, "You set [I] on the machine.")
SStgui.update_uis(src) // update all UIs attached to src
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return
return ..()
@@ -429,7 +429,7 @@
cell = new(src)
dispensable_reagents = sortList(dispensable_reagents)
current_reagent = pick(dispensable_reagents)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
START_PROCESSING(SSobj, src)
/obj/item/handheld_chem_dispenser/Destroy()
@@ -453,7 +453,7 @@
target.reagents.add_reagent(current_reagent, actual)
cell.charge -= actual / efficiency
to_chat(user, "You dispense [actual] unit\s of [current_reagent] into [target].")
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
else if(free) // If actual is nil and there's still free space, it means we're out of juice
to_chat(user, "Insufficient energy to complete operation.")
if("remove")
@@ -511,7 +511,7 @@
if("dispense")
if(params["reagent"] in dispensable_reagents)
current_reagent = params["reagent"]
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
if("mode")
switch(params["mode"])
if("remove")
@@ -520,15 +520,14 @@
mode = "dispense"
if("isolate")
mode = "isolate"
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
else
return FALSE
add_fingerprint(usr)
-/obj/item/handheld_chem_dispenser/update_icon()
- cut_overlays()
-
+/obj/item/handheld_chem_dispenser/update_overlays()
+ . = ..()
if(cell && cell.charge)
var/image/power_light = image('icons/obj/chemical.dmi', src, "light_low")
var/percent = round((cell.charge / cell.maxcharge) * 100)
@@ -539,17 +538,16 @@
power_light.icon_state = "light_mid"
if(67 to INFINITY)
power_light.icon_state = "light_full"
- add_overlay(power_light)
+ . += power_light
var/image/mode_light = image('icons/obj/chemical.dmi', src, "light_remove")
mode_light.icon_state = "light_[mode]"
- add_overlay(mode_light)
+ . += mode_light
var/image/chamber_contents = image('icons/obj/chemical.dmi', src, "reagent_filling")
var/datum/reagent/R = GLOB.chemical_reagents_list[current_reagent]
chamber_contents.icon += R.color
- add_overlay(chamber_contents)
- ..()
+ . += chamber_contents
/obj/item/handheld_chem_dispenser/process() //Every [recharge_time] seconds, recharge some reagents for the cyborg
if(isrobot(loc) && cell.charge < cell.maxcharge)
@@ -559,7 +557,7 @@
R.cell.charge -= actual
cell.charge += actual
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
return TRUE
/obj/item/handheld_chem_dispenser/attackby(obj/item/W, mob/user, params)
@@ -576,7 +574,7 @@
W.loc = src
cell = W
to_chat(user, "You install a cell in [src].")
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/handheld_chem_dispenser/screwdriver_act(mob/user, obj/item/I)
if(!isrobot(loc) && cell)
@@ -584,7 +582,7 @@
cell.loc = get_turf(src)
cell = null
to_chat(user, "You remove the cell from [src].")
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
return
..()
diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm
index c731f4ff2a8..11f33f44351 100644
--- a/code/modules/reagents/chemistry/machinery/chem_master.dm
+++ b/code/modules/reagents/chemistry/machinery/chem_master.dm
@@ -66,11 +66,13 @@
else if(A == loaded_pill_bottle)
loaded_pill_bottle = null
-/obj/machinery/chem_master/update_icon()
- overlays.Cut()
+/obj/machinery/chem_master/update_icon_state()
icon_state = "mixer[beaker ? "1" : "0"][powered() ? "" : "_nopower"]"
+
+/obj/machinery/chem_master/update_overlays()
+ . = ..()
if(powered())
- overlays += "waitlight"
+ . += "waitlight"
/obj/machinery/chem_master/blob_act(obj/structure/blob/B)
if(prob(50))
diff --git a/code/modules/reagents/chemistry/machinery/pandemic.dm b/code/modules/reagents/chemistry/machinery/pandemic.dm
index ef259ee0b4c..f6d578c2dca 100644
--- a/code/modules/reagents/chemistry/machinery/pandemic.dm
+++ b/code/modules/reagents/chemistry/machinery/pandemic.dm
@@ -19,9 +19,8 @@
update_icon()
/obj/machinery/computer/pandemic/set_broken()
- icon_state = (beaker ? "mixer1_b" : "mixer0_b")
- overlays.Cut()
stat |= BROKEN
+ update_icon()
/obj/machinery/computer/pandemic/proc/GetVirusByIndex(index)
if(beaker && beaker.reagents)
@@ -54,17 +53,16 @@
update_icon()
playsound(loc, 'sound/machines/ping.ogg', 30, 1)
-/obj/machinery/computer/pandemic/update_icon()
+/obj/machinery/computer/pandemic/update_icon_state()
if(stat & BROKEN)
icon_state = (beaker ? "mixer1_b" : "mixer0_b")
return
-
icon_state = "mixer[(beaker)?"1":"0"][(powered()) ? "" : "_nopower"]"
- if(wait)
- overlays.Cut()
- else
- overlays += "waitlight"
+/obj/machinery/computer/pandemic/update_overlays()
+ . = list()
+ if(!wait)
+ . += "waitlight"
/obj/machinery/computer/pandemic/Topic(href, href_list)
if(..())
diff --git a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm
index 8cd01f38795..d236b9d476f 100644
--- a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm
+++ b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm
@@ -126,9 +126,9 @@
/obj/machinery/reagentgrinder/handle_atom_del(atom/A)
if(A == beaker)
beaker = null
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
-/obj/machinery/reagentgrinder/update_icon()
+/obj/machinery/reagentgrinder/update_icon_state()
if(beaker)
icon_state = "juicer1"
else
@@ -173,7 +173,7 @@
return FALSE
beaker = I
beaker.loc = src
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
updateUsrDialog()
return TRUE //no afterattack
@@ -310,7 +310,7 @@
return
beaker.loc = src.loc
beaker = null
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
updateUsrDialog()
/obj/machinery/reagentgrinder/proc/eject()
diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm
index bf5e78f04e3..310ba687365 100644
--- a/code/modules/reagents/reagent_containers.dm
+++ b/code/modules/reagents/reagent_containers.dm
@@ -66,12 +66,12 @@
/obj/item/reagent_containers/proc/add_lid()
if(has_lid)
container_type ^= REFILLABLE | DRAINABLE
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/reagent_containers/proc/remove_lid()
if(has_lid)
container_type |= REFILLABLE | DRAINABLE
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/reagent_containers/attack_self(mob/user)
if(has_lid)
diff --git a/code/modules/reagents/reagent_containers/applicator.dm b/code/modules/reagents/reagent_containers/applicator.dm
index d7c53f1f5a3..5725225ea1e 100644
--- a/code/modules/reagents/reagent_containers/applicator.dm
+++ b/code/modules/reagents/reagent_containers/applicator.dm
@@ -36,14 +36,20 @@
to_chat(loc, "[src] identifies and removes a harmful substance.")
else
visible_message("[src] identifies and removes a harmful substance.")
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
-/obj/item/reagent_containers/applicator/update_icon()
- cut_overlays()
+/obj/item/reagent_containers/applicator/update_icon_state()
+ if(applying)
+ icon_state = "mender-active"
+ else
+ icon_state = "mender"
+
+/obj/item/reagent_containers/applicator/update_overlays()
+ . = ..()
if(reagents.total_volume)
var/mutable_appearance/filling = mutable_appearance('icons/goonstation/objects/objects.dmi', "mender-fluid")
filling.color = mix_color_from_reagents(reagents.reagent_list)
- add_overlay(filling)
+ . += filling
var/reag_pct = round((reagents.total_volume / volume) * 100)
var/mutable_appearance/applicator_bar = mutable_appearance('icons/goonstation/objects/objects.dmi', "app_e")
switch(reag_pct)
@@ -53,7 +59,7 @@
applicator_bar.icon_state = "app_he"
if(0)
applicator_bar.icon_state = "app_e"
- add_overlay(applicator_bar)
+ . += applicator_bar
/obj/item/reagent_containers/applicator/attack(mob/living/M, mob/user)
if(!reagents.total_volume)
@@ -72,7 +78,7 @@
user.visible_message("[user] begins mending [M] with [src].", "You begin mending [M] with [src].")
if(M.reagents)
applying = TRUE
- icon_state = "mender-active"
+ update_icon(UPDATE_ICON_STATE)
apply_to(M, user, 0.2) // We apply a very weak application up front, then loop.
while(do_after(user, 10, target = M))
measured_health = M.health
@@ -84,7 +90,7 @@
to_chat(user, "[src] is out of reagents and powers down automatically.")
break
applying = FALSE
- icon_state = "mender"
+ update_icon()
user.changeNext_move(CLICK_CD_MELEE)
diff --git a/code/modules/reagents/reagent_containers/bottle.dm b/code/modules/reagents/reagent_containers/bottle.dm
index effeb05d1a4..fb1f992a429 100644
--- a/code/modules/reagents/reagent_containers/bottle.dm
+++ b/code/modules/reagents/reagent_containers/bottle.dm
@@ -13,12 +13,11 @@
volume = 30
/obj/item/reagent_containers/glass/bottle/on_reagent_change()
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
-/obj/item/reagent_containers/glass/bottle/update_icon()
- overlays.Cut()
+/obj/item/reagent_containers/glass/bottle/update_overlays()
+ . = ..()
underlays.Cut()
-
if(reagents.total_volume)
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]10")
@@ -39,8 +38,7 @@
underlays += filling
if(!is_open_container())
- var/image/lid = image(icon, src, "lid_[icon_state]")
- overlays += lid
+ . += "lid_[icon_state]"
/obj/item/reagent_containers/glass/bottle/decompile_act(obj/item/matter_decompiler/C, mob/user)
if(!reagents.total_volume)
diff --git a/code/modules/reagents/reagent_containers/glass_containers.dm b/code/modules/reagents/reagent_containers/glass_containers.dm
index 15d3769e4bc..61fc34f2ea3 100644
--- a/code/modules/reagents/reagent_containers/glass_containers.dm
+++ b/code/modules/reagents/reagent_containers/glass_containers.dm
@@ -14,6 +14,7 @@
container_type = OPENCONTAINER
has_lid = TRUE
resistance_flags = ACID_PROOF
+ blocks_emissive = FALSE
var/label_text = ""
/obj/item/reagent_containers/glass/New()
@@ -128,11 +129,10 @@
var/can_assembly = 1
/obj/item/reagent_containers/glass/beaker/on_reagent_change()
- update_icon()
-
-/obj/item/reagent_containers/glass/beaker/update_icon()
- overlays.Cut()
+ update_icon(UPDATE_OVERLAYS)
+/obj/item/reagent_containers/glass/beaker/update_overlays()
+ . = ..()
if(reagents.total_volume)
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]10")
@@ -154,14 +154,14 @@
filling.icon_state = "[icon_state]100"
filling.icon += mix_color_from_reagents(reagents.reagent_list)
- overlays += filling
+ . += filling
if(!is_open_container())
- var/image/lid = image(icon, src, "lid_[initial(icon_state)]")
- overlays += lid
+ . += "lid_[initial(icon_state)]"
+ if(blocks_emissive == FALSE)
+ . += emissive_blocker(icon, "lid_[initial(icon_state)]")
if(assembly)
- overlays += "assembly"
- ..()
+ . += "assembly"
/obj/item/reagent_containers/glass/beaker/verb/remove_assembly()
set name = "Remove Assembly"
@@ -173,7 +173,7 @@
to_chat(usr, "You detach [assembly] from [src]")
usr.put_in_hands(assembly)
assembly = null
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
else
to_chat(usr, "There is no assembly to remove.")
@@ -189,7 +189,7 @@
assembly = W
user.drop_item()
W.forceMove(src)
- overlays += "assembly"
+ update_icon(UPDATE_OVERLAYS)
else
..()
@@ -254,6 +254,7 @@
amount_per_transfer_from_this = 10
origin_tech = "materials=2;engineering=3;plasmatech=3"
container_type = OPENCONTAINER
+ blocks_emissive = EMISSIVE_BLOCK_GENERIC
/obj/item/reagent_containers/glass/beaker/noreact/New()
..()
@@ -268,6 +269,7 @@
amount_per_transfer_from_this = 10
possible_transfer_amounts = list(5,10,15,25,30,50,100,300)
container_type = OPENCONTAINER
+ blocks_emissive = EMISSIVE_BLOCK_GENERIC
origin_tech = "bluespace=5;materials=4;plasmatech=4"
/obj/item/reagent_containers/glass/beaker/cryoxadone
@@ -297,6 +299,7 @@
armor = list(MELEE = 10, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 75, ACID = 50) //Weak melee protection, because you can wear it on your head
slot_flags = SLOT_HEAD
resistance_flags = NONE
+ blocks_emissive = EMISSIVE_BLOCK_GENERIC
container_type = OPENCONTAINER
dog_fashion = /datum/dog_fashion/head/bucket
diff --git a/code/modules/reagents/reagent_containers/hypospray.dm b/code/modules/reagents/reagent_containers/hypospray.dm
index 0a99cb2561a..3fbef587723 100644
--- a/code/modules/reagents/reagent_containers/hypospray.dm
+++ b/code/modules/reagents/reagent_containers/hypospray.dm
@@ -116,10 +116,10 @@
to_chat(user, "[src] is empty!")
return
..()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return TRUE
-/obj/item/reagent_containers/hypospray/autoinjector/update_icon()
+/obj/item/reagent_containers/hypospray/autoinjector/update_icon_state()
if(reagents.total_volume > 0)
icon_state = initial(icon_state)
else
diff --git a/code/modules/reagents/reagent_containers/iv_bag.dm b/code/modules/reagents/reagent_containers/iv_bag.dm
index e6db62b18ba..989a234fcc8 100644
--- a/code/modules/reagents/reagent_containers/iv_bag.dm
+++ b/code/modules/reagents/reagent_containers/iv_bag.dm
@@ -22,24 +22,24 @@
return ..()
/obj/item/reagent_containers/iv_bag/on_reagent_change()
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/reagent_containers/iv_bag/pickup(mob/user)
. = ..()
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/reagent_containers/iv_bag/dropped(mob/user)
..()
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/reagent_containers/iv_bag/attack_self(mob/user)
..()
mode = !mode
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/reagent_containers/iv_bag/attack_hand()
..()
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/reagent_containers/iv_bag/proc/begin_processing(mob/target)
injection_target = target
@@ -70,13 +70,13 @@
var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1) //The amount of reagents we'll transfer to the person
reagents.reaction(injection_target, REAGENT_INGEST, fraction) //React the amount we're transfering.
reagents.trans_to(injection_target, amount_per_transfer_from_this)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
else // Drawing
if(reagents.total_volume < reagents.maximum_volume)
injection_target.transfer_blood_to(src, amount_per_transfer_from_this)
for(var/datum/reagent/x in injection_target.reagents.reagent_list) // Pull small amounts of reagents from the person while drawing blood
injection_target.reagents.trans_to(src, amount_per_transfer_from_this/10)
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/reagent_containers/iv_bag/attack(mob/living/M, mob/living/user, def_zone)
return
@@ -133,21 +133,20 @@
return
-/obj/item/reagent_containers/iv_bag/update_icon()
- overlays.Cut()
-
+/obj/item/reagent_containers/iv_bag/update_overlays()
+ . = ..()
if(reagents.total_volume)
var/percent = round((reagents.total_volume / volume) * 10) // We round the 1's place off of our percent for easy image processing.
var/image/filling = image('icons/goonstation/objects/iv.dmi', src, "[icon_state][percent]")
filling.icon += mix_color_from_reagents(reagents.reagent_list)
- overlays += filling
+ . += filling
if(ismob(loc))
switch(mode)
if(IV_DRAW)
- overlays += "draw"
+ . += "draw"
if(IV_INJECT)
- overlays += "inject"
+ . += "inject"
/obj/item/reagent_containers/iv_bag/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/pen) || istype(I, /obj/item/flashlight/pen))
@@ -171,7 +170,7 @@
if(blood_type != null)
name = "[initial(name)] - [blood_type]"
reagents.add_reagent("blood", 200, list("donor"=null,"viruses"=null,"blood_DNA"=null,"blood_type"=blood_type,"resistances"=null,"trace_chem"=null))
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/reagent_containers/iv_bag/blood/random/Initialize()
diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm
index bcfec88aeaa..12978b7eb8d 100644
--- a/code/modules/reagents/reagent_containers/syringes.dm
+++ b/code/modules/reagents/reagent_containers/syringes.dm
@@ -149,18 +149,23 @@
mode = SYRINGE_DRAW
update_icon()
-/obj/item/reagent_containers/syringe/update_icon()
- cut_overlays()
+/obj/item/reagent_containers/syringe/update_icon_state()
+ var/rounded_vol
+ if(reagents && reagents.total_volume)
+ rounded_vol = clamp(round((reagents.total_volume / volume * 15), 5), 1, 15)
+ else
+ rounded_vol = 0
+ icon_state = "[rounded_vol]"
+ item_state = "syringe_[rounded_vol]"
+
+/obj/item/reagent_containers/syringe/update_overlays()
+ . = ..()
var/rounded_vol
if(reagents && reagents.total_volume)
rounded_vol = clamp(round((reagents.total_volume / volume * 15), 5), 1, 15)
var/image/filling_overlay = mutable_appearance('icons/obj/reagentfillings.dmi', "syringe[rounded_vol]")
filling_overlay.icon += mix_color_from_reagents(reagents.reagent_list)
- add_overlay(filling_overlay)
- else
- rounded_vol = 0
- icon_state = "[rounded_vol]"
- item_state = "syringe_[rounded_vol]"
+ . += filling_overlay
if(ismob(loc))
var/mob/M = loc
var/injoverlay
@@ -169,7 +174,7 @@
injoverlay = "draw"
if(SYRINGE_INJECT)
injoverlay = "inject"
- add_overlay(injoverlay)
+ . += injoverlay
M.update_inv_l_hand()
M.update_inv_r_hand()
diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm
index 987eea8f3f9..9f8a5ea3558 100644
--- a/code/modules/recycling/conveyor2.dm
+++ b/code/modules/recycling/conveyor2.dm
@@ -93,8 +93,7 @@ GLOBAL_LIST_INIT(conveyor_switches, list())
/obj/machinery/conveyor/attack_hand(mob/user as mob)
user.Move_Pulled(src)
-/obj/machinery/conveyor/update_icon()
- ..()
+/obj/machinery/conveyor/update_icon_state()
if(IS_OPERATING)
icon_state = "conveyor_started_[clockwise ? "cw" : "ccw"]"
if(reversed)
@@ -286,18 +285,20 @@ GLOBAL_LIST_INIT(conveyor_switches, list())
// update the icon depending on the position
-/obj/machinery/conveyor_switch/update_icon()
- overlays.Cut()
+/obj/machinery/conveyor_switch/update_icon_state()
if(!position)
icon_state = "switch-off"
else if(position == DIRECTION_REVERSED)
icon_state = "switch-rev"
- if(!(stat & NOPOWER))
- overlays += "redlight"
else if(position == DIRECTION_FORWARDS)
icon_state = "switch-fwd"
- if(!(stat & NOPOWER))
- overlays += "greenlight"
+
+/obj/machinery/conveyor_switch/update_overlays()
+ . = ..()
+ if(position == DIRECTION_REVERSED && !(stat & NOPOWER))
+ . += "redlight"
+ if(position == DIRECTION_FORWARDS && !(stat & NOPOWER))
+ . += "greenlight"
/obj/machinery/conveyor_switch/oneway
one_way = TRUE
diff --git a/code/modules/recycling/disposal-construction.dm b/code/modules/recycling/disposal-construction.dm
index a864a4f07ab..f0172fb7ecb 100644
--- a/code/modules/recycling/disposal-construction.dm
+++ b/code/modules/recycling/disposal-construction.dm
@@ -222,7 +222,7 @@
P.base_icon_state = base_state
P.dir = dir
P.dpdir = dpdir
- P.update_icon()
+ P.update_icon(UPDATE_ICON_STATE)
//Needs some special treatment ;)
if(ptype == PIPE_DISPOSALS_SORT_RIGHT || ptype == PIPE_DISPOSALS_SORT_LEFT)
diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm
index e89dfabfcd7..39635cad224 100644
--- a/code/modules/recycling/disposal.dm
+++ b/code/modules/recycling/disposal.dm
@@ -742,22 +742,22 @@
/obj/structure/disposalpipe/proc/update()
var/turf/T = get_turf(src)
if(T.transparent_floor)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return
hide(T.intact && !istype(T, /turf/space)) // space never hides pipes
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
// hide called by levelupdate if turf intact status changes
// change visibility status and force update of icon
/obj/structure/disposalpipe/hide(intact)
invisibility = intact ? INVISIBILITY_MAXIMUM: 0 // hide if floor is intact
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
// update actual icon_state depending on visibility
// if invisible, append "f" to icon_state to show faded version
// this will be revealed if a T-scanner is used
// if visible, use regular icon_state
-/obj/structure/disposalpipe/update_icon()
+/obj/structure/disposalpipe/update_icon_state()
if(invisibility)
icon_state = "[base_icon_state]f"
else
diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm
index 9c55cd8adda..46436093bb1 100755
--- a/code/modules/recycling/sortingmachinery.dm
+++ b/code/modules/recycling/sortingmachinery.dm
@@ -442,7 +442,8 @@
user.unEquip(src)
qdel(src)
-/obj/item/shippingPackage/proc/update_desc()
+/obj/item/shippingPackage/update_desc()
+ . = ..()
desc = "A pre-labeled package for shipping an item to coworkers."
if(sortTag)
desc += " The label says \"Deliver to [GLOB.TAGGERLOCATIONS[sortTag]]\"."
diff --git a/code/modules/research/message_server.dm b/code/modules/research/message_server.dm
index 4ceacf94301..fb3fc5fdeb7 100644
--- a/code/modules/research/message_server.dm
+++ b/code/modules/research/message_server.dm
@@ -75,7 +75,7 @@ GLOBAL_LIST_EMPTY(message_servers)
/obj/machinery/message_server/process()
if(active && (stat & (BROKEN | NOPOWER)))
active = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return
if(prob(3))
playsound(loc, "computer_ambience", 50, 1)
@@ -115,10 +115,9 @@ GLOBAL_LIST_EMPTY(message_servers)
/obj/machinery/message_server/attack_hand(user as mob)
to_chat(user, "You toggle PDA message passing from [active ? "On" : "Off"] to [active ? "Off" : "On"]")
active = !active
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
-/obj/machinery/message_server/update_icon()
- ..()
+/obj/machinery/message_server/update_icon_state()
icon_state = "[initial(icon_state)][panel_open ? "_o" : null][active ? null : "_off"]"
/obj/machinery/blackbox_recorder
diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm
index 4cef4b49853..620a1462e23 100644
--- a/code/modules/research/server.dm
+++ b/code/modules/research/server.dm
@@ -44,7 +44,7 @@
tot_rating += SP.rating
heat_gen /= max(1, tot_rating)
-/obj/machinery/r_n_d/server/update_icon()
+/obj/machinery/r_n_d/server/update_icon_state()
if(stat & NOPOWER)
icon_state = "RD-server-off"
else
@@ -52,7 +52,7 @@
/obj/machinery/r_n_d/server/power_change()
. = ..()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/r_n_d/server/proc/initialize_serv()
if(!files)
diff --git a/code/modules/ruins/lavalandruin_code/fountain_hall.dm b/code/modules/ruins/lavalandruin_code/fountain_hall.dm
index 26c8ebca7c6..cba077e34ef 100644
--- a/code/modules/ruins/lavalandruin_code/fountain_hall.dm
+++ b/code/modules/ruins/lavalandruin_code/fountain_hall.dm
@@ -39,10 +39,10 @@
last_process = world.time
to_chat(user, "The water feels warm and soothing as you touch it. The fountain immediately dries up shortly afterwards.")
user.reagents.add_reagent("godblood", 20)
- update_icon()
- addtimer(CALLBACK(src, .proc/update_icon), time_between_uses)
+ update_icon(UPDATE_ICON_STATE)
+ addtimer(CALLBACK(src, /atom/.proc/update_icon), time_between_uses)
-/obj/structure/healingfountain/update_icon()
+/obj/structure/healingfountain/update_icon_state()
if(last_process + time_between_uses > world.time)
icon_state = "fountain"
else
diff --git a/code/modules/security_levels/keycard_authentication.dm b/code/modules/security_levels/keycard_authentication.dm
index 9d6604a38f3..209fe687b0c 100644
--- a/code/modules/security_levels/keycard_authentication.dm
+++ b/code/modules/security_levels/keycard_authentication.dm
@@ -197,7 +197,7 @@ GLOBAL_VAR_INIT(station_all_access, 0)
for(var/area/maintenance/A in world) // Why are these global lists? AAAAAAAAAAAAAA
for(var/obj/machinery/door/airlock/D in A)
D.emergency = 1
- D.update_icon(0)
+ D.update_appearance()
GLOB.minor_announcement.Announce("Access restrictions on maintenance and external airlocks have been removed.")
GLOB.maint_all_access = 1
SSblackbox.record_feedback("nested tally", "keycard_auths", 1, list("emergency maintenance access", "enabled"))
@@ -206,7 +206,7 @@ GLOBAL_VAR_INIT(station_all_access, 0)
for(var/area/maintenance/A in world)
for(var/obj/machinery/door/airlock/D in A)
D.emergency = 0
- D.update_icon(0)
+ D.update_appearance()
GLOB.minor_announcement.Announce("Access restrictions on maintenance and external airlocks have been re-added.")
GLOB.maint_all_access = 0
SSblackbox.record_feedback("nested tally", "keycard_auths", 1, list("emergency maintenance access", "disabled"))
@@ -215,7 +215,7 @@ GLOBAL_VAR_INIT(station_all_access, 0)
for(var/obj/machinery/door/airlock/D in GLOB.airlocks)
if(is_station_level(D.z))
D.emergency = 1
- D.update_icon(0)
+ D.update_appearance()
GLOB.minor_announcement.Announce("Access restrictions on all station airlocks have been removed due to an ongoing crisis. Trespassing laws still apply unless ordered otherwise by Command staff.")
GLOB.station_all_access = 1
SSblackbox.record_feedback("nested tally", "keycard_auths", 1, list("emergency station access", "enabled"))
@@ -224,7 +224,7 @@ GLOBAL_VAR_INIT(station_all_access, 0)
for(var/obj/machinery/door/airlock/D in GLOB.airlocks)
if(is_station_level(D.z))
D.emergency = 0
- D.update_icon(0)
+ D.update_appearance()
GLOB.minor_announcement.Announce("Access restrictions on all station airlocks have been re-added. Seek station AI or a colleague's assistance if you are stuck.")
GLOB.station_all_access = 0
SSblackbox.record_feedback("nested tally", "keycard_auths", 1, list("emergency station access", "disabled"))
diff --git a/code/modules/security_levels/security_levels.dm b/code/modules/security_levels/security_levels.dm
index c4b160018d7..c3d6c2e53f7 100644
--- a/code/modules/security_levels/security_levels.dm
+++ b/code/modules/security_levels/security_levels.dm
@@ -60,8 +60,7 @@ GLOBAL_DATUM_INIT(security_announcement_down, /datum/announcement/priority/secur
var/obj/machinery/door/airlock/highsecurity/red/R = locate(/obj/machinery/door/airlock/highsecurity/red) in GLOB.airlocks
if(R && is_station_level(R.z))
- R.locked = FALSE
- R.update_icon()
+ R.unlock(TRUE)
post_status("alert", "redalert")
update_firealarms()
@@ -73,8 +72,7 @@ GLOBAL_DATUM_INIT(security_announcement_down, /datum/announcement/priority/secur
if(GLOB.security_level < SEC_LEVEL_RED)
for(var/obj/machinery/door/airlock/highsecurity/red/R in GLOB.airlocks)
if(is_station_level(R.z))
- R.locked = FALSE
- R.update_icon()
+ R.unlock(TRUE)
post_status("alert", "gammaalert")
update_firealarms()
@@ -122,11 +120,9 @@ GLOBAL_DATUM_INIT(security_announcement_down, /datum/announcement/priority/secur
return "delta"
/proc/update_firealarms()
- var/security_level = get_security_level()
for(var/obj/machinery/firealarm/FA in GLOB.machines)
if(is_station_contact(FA.z))
- FA.cut_overlays()
- FA.add_overlay("overlay_[security_level]")
+ FA.update_icon()
/proc/num2seclevel(num)
switch(num)
diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm
index 71a938c3808..858d63c09ac 100644
--- a/code/modules/shuttle/emergency.dm
+++ b/code/modules/shuttle/emergency.dm
@@ -343,9 +343,12 @@
icon_state = "dorm_available"
density = FALSE
-/obj/machinery/computer/shuttle/pod/update_icon()
+/obj/machinery/computer/shuttle/pod/update_icon_state()
return
+/obj/machinery/computer/shuttle/pod/update_overlays()
+ return list()
+
/obj/machinery/computer/shuttle/pod/emag_act(mob/user as mob)
to_chat(user, " Access requirements overridden. The pod may now be launched manually at any time.")
admin_controlled = 0
diff --git a/code/modules/shuttle/shuttle_manipulator.dm b/code/modules/shuttle/shuttle_manipulator.dm
index f0b74af9945..48e6963a75b 100644
--- a/code/modules/shuttle/shuttle_manipulator.dm
+++ b/code/modules/shuttle/shuttle_manipulator.dm
@@ -23,16 +23,16 @@
/obj/machinery/shuttle_manipulator/Initialize(mapload)
. = ..()
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
-/obj/machinery/shuttle_manipulator/update_icon()
- overlays.Cut()
+/obj/machinery/shuttle_manipulator/update_overlays()
+ . = ..()
var/image/hologram_projection = image(icon, "hologram_on")
hologram_projection.pixel_y = 22
var/image/hologram_ship = image(icon, "hologram_whiteship")
hologram_ship.pixel_y = 27
- overlays += hologram_projection
- overlays += hologram_ship
+ . += hologram_projection
+ . += hologram_ship
/obj/machinery/shuttle_manipulator/attack_ghost(user as mob)
attack_hand(user)
diff --git a/code/modules/shuttle/shuttle_rotate.dm b/code/modules/shuttle/shuttle_rotate.dm
index 8822dbc51ce..327b0690839 100644
--- a/code/modules/shuttle/shuttle_rotate.dm
+++ b/code/modules/shuttle/shuttle_rotate.dm
@@ -54,7 +54,7 @@ If ever any of these procs are useful for non-shuttles, rename it to proc/rotate
var/temp = d1
d1 = d2
d2 = temp
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/structure/shuttle/engine/shuttleRotate(rotation, params)
setDir(angle2dir(rotation+dir2angle(dir)))
diff --git a/code/modules/shuttle/supply.dm b/code/modules/shuttle/supply.dm
index 22b1edfeff8..e3f74488933 100644
--- a/code/modules/shuttle/supply.dm
+++ b/code/modules/shuttle/supply.dm
@@ -287,7 +287,7 @@
reqform.info += "
"
reqform.info += "STAMP BELOW TO APPROVE THIS REQUISITION:
"
- reqform.update_icon() //Fix for appearing blank when printed.
+ reqform.update_icon(UPDATE_ICON_STATE) //Fix for appearing blank when printed.
return reqform
diff --git a/code/modules/station_goals/bsa.dm b/code/modules/station_goals/bsa.dm
index 12e74d4c34f..1df3cb4384c 100644
--- a/code/modules/station_goals/bsa.dm
+++ b/code/modules/station_goals/bsa.dm
@@ -288,9 +288,9 @@
/obj/machinery/computer/bsa_control/process()
..()
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
-/obj/machinery/computer/bsa_control/update_icon()
+/obj/machinery/computer/bsa_control/update_icon_state()
if(stat & BROKEN)
icon_state = icon_state_broken
else if(stat & NOPOWER)
@@ -302,6 +302,9 @@
else
icon_state = initial(icon_state)
+/obj/machinery/computer/bsa_control/update_overlays()
+ return list()
+
/obj/machinery/computer/bsa_control/attack_hand(mob/user)
if(..())
return 1
@@ -342,7 +345,7 @@
fire(usr)
if("recalibrate")
calibrate(usr)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return TRUE
/obj/machinery/computer/bsa_control/proc/calibrate(mob/user)
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index e93cfb5a271..d331e85176a 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -188,8 +188,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/m
dna_max = G.human_count
break
-/obj/machinery/dna_vault/update_icon()
- ..()
+/obj/machinery/dna_vault/update_icon_state()
if(stat & NOPOWER)
icon_state = "vaultoff"
return
@@ -200,7 +199,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/m
stat &= ~NOPOWER
else
stat |= NOPOWER
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/dna_vault/Destroy()
diff --git a/code/modules/station_goals/shield.dm b/code/modules/station_goals/shield.dm
index a41025dd062..24f88699a64 100644
--- a/code/modules/station_goals/shield.dm
+++ b/code/modules/station_goals/shield.dm
@@ -134,10 +134,10 @@
else
animate(src, pixel_y = 0, time = 10)
anchored = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return TRUE
-/obj/machinery/satellite/update_icon()
+/obj/machinery/satellite/update_icon_state()
icon_state = active ? "sat_active" : "sat_inactive"
/obj/machinery/satellite/attackby(obj/item/I, mob/user, params)
diff --git a/code/modules/surgery/implant_removal.dm b/code/modules/surgery/implant_removal.dm
index 48d99f4a60b..29aacc66150 100644
--- a/code/modules/surgery/implant_removal.dm
+++ b/code/modules/surgery/implant_removal.dm
@@ -69,7 +69,7 @@
if(case && !case.imp)
case.imp = I
I.forceMove(case)
- case.update_icon()
+ case.update_state()
user.visible_message("[user] places [I] into [case]!", "You place [I] into [case].")
else
qdel(I)
diff --git a/code/modules/surgery/organs/augments_arms.dm b/code/modules/surgery/organs/augments_arms.dm
index ee607defda6..3338807cdd4 100644
--- a/code/modules/surgery/organs/augments_arms.dm
+++ b/code/modules/surgery/organs/augments_arms.dm
@@ -19,11 +19,11 @@
if(ispath(holder))
holder = new holder(src)
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
slot = parent_organ + "_device"
items_list = contents.Copy()
-/obj/item/organ/internal/cyberimp/arm/update_icon()
+/obj/item/organ/internal/cyberimp/arm/update_icon_state()
if(parent_organ == "r_arm")
transform = null
else // Mirroring the icon
@@ -43,7 +43,7 @@
parent_organ = "r_arm"
slot = parent_organ + "_device"
to_chat(user, "You modify [src] to be installed on the [parent_organ == "r_arm" ? "right" : "left"] arm.")
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
/obj/item/organ/internal/cyberimp/arm/remove(mob/living/carbon/M, special = 0)
diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm
index 8e09b37e66b..e178eac9f29 100644
--- a/code/modules/surgery/organs/eyes.dm
+++ b/code/modules/surgery/organs/eyes.dm
@@ -14,7 +14,7 @@
var/vision_flags = 0
var/see_in_dark = 2
- var/tint = 0
+ var/tint = FLASH_PROTECTION_NONE
var/flash_protect = FLASH_PROTECTION_NONE
var/see_invisible = SEE_INVISIBLE_LIVING
var/lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE
diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm
index 870b42d380e..157d1d2afd8 100644
--- a/code/modules/surgery/organs/heart.dm
+++ b/code/modules/surgery/organs/heart.dm
@@ -9,7 +9,7 @@
dead_icon = "heart-off"
var/icon_base = "heart"
-/obj/item/organ/internal/heart/update_icon()
+/obj/item/organ/internal/heart/update_icon_state()
if(beating)
icon_state = "[icon_base]-on"
else
@@ -54,12 +54,12 @@
/obj/item/organ/internal/heart/proc/Stop()
beating = FALSE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return TRUE
/obj/item/organ/internal/heart/proc/Restart()
beating = TRUE
- update_icon()
+ update_icon(UPDATE_ICON_STATE)
return TRUE
/obj/item/organ/internal/heart/prepare_eat()
diff --git a/code/modules/surgery/organs/organ_icon.dm b/code/modules/surgery/organs/organ_icon.dm
index d6c62e54be8..2fc5555a4ee 100644
--- a/code/modules/surgery/organs/organ_icon.dm
+++ b/code/modules/surgery/organs/organ_icon.dm
@@ -185,7 +185,8 @@ GLOBAL_LIST_EMPTY(limb_icon_cache)
// new damage icon system
// adjusted to set damage_state to brute/burn code only (without r_name0 as before)
-/obj/item/organ/external/update_icon()
+/obj/item/organ/external/update_icon(updates=ALL)
+ ..()
var/n_is = damage_state_text()
if(n_is != damage_state)
damage_state = n_is
diff --git a/code/modules/surgery/organs/subtypes/slime.dm b/code/modules/surgery/organs/subtypes/slime.dm
index 752375047fe..d5f1cb8aef5 100644
--- a/code/modules/surgery/organs/subtypes/slime.dm
+++ b/code/modules/surgery/organs/subtypes/slime.dm
@@ -5,7 +5,7 @@
desc = "This is a slime's osmotic pressure regulator, it appears to be some kind of biological pump that uses osmotic pressure to regulate water flow. It seems to work similar to a heart."
dead_icon = null
-/obj/item/organ/internal/heart/slime/update_icon()
+/obj/item/organ/internal/heart/slime/update_icon_state()
return
/obj/item/organ/internal/lungs/slime
diff --git a/code/modules/telesci/gps.dm b/code/modules/telesci/gps.dm
index f67aa5a0195..36f82a7bd84 100644
--- a/code/modules/telesci/gps.dm
+++ b/code/modules/telesci/gps.dm
@@ -34,23 +34,23 @@ GLOBAL_LIST_EMPTY(GPS_list)
GLOB.poi_list.Add(src)
if(name == initial(name))
name = "global positioning system ([gpstag])"
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/gps/Destroy()
GLOB.GPS_list.Remove(src)
GLOB.poi_list.Remove(src)
return ..()
-/obj/item/gps/update_icon()
- cut_overlays()
+/obj/item/gps/update_overlays()
+ . = ..()
if(emped)
- add_overlay("emp")
+ . += "emp"
else if(tracking)
- add_overlay("working")
+ . += "working"
/obj/item/gps/emp_act(severity)
emped = TRUE
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
addtimer(CALLBACK(src, .proc/reboot), EMP_DISABLE_TIME)
/obj/item/gps/AltClick(mob/user)
@@ -61,7 +61,7 @@ GLOBAL_LIST_EMPTY(GPS_list)
return
tracking = !tracking
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
if(tracking)
to_chat(user, "[src] is now tracking, and visible to other GPS devices.")
else
@@ -144,7 +144,7 @@ GLOBAL_LIST_EMPTY(GPS_list)
*/
/obj/item/gps/proc/reboot()
emped = FALSE
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
/obj/item/gps/science
icon_state = "gps-s"
diff --git a/code/modules/vehicle/janicart.dm b/code/modules/vehicle/janicart.dm
index 07187e523ec..ede7ce238be 100644
--- a/code/modules/vehicle/janicart.dm
+++ b/code/modules/vehicle/janicart.dm
@@ -68,22 +68,22 @@
to_chat(user, "You hook [I] onto [src].")
I.forceMove(src)
mybag = I
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
return
if(istype(I, /obj/item/janiupgrade))
floorbuffer = TRUE
qdel(I)
to_chat(user,"You upgrade [src] with [I].")
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
return
return ..()
-/obj/vehicle/janicart/update_icon()
- cut_overlays()
+/obj/vehicle/janicart/update_overlays()
+ . = ..()
if(mybag)
- add_overlay("cart_garbage")
+ . += "cart_garbage"
if(floorbuffer)
- add_overlay("cart_buffer")
+ . += "cart_buffer"
/obj/vehicle/janicart/attack_hand(mob/user)
@@ -93,4 +93,4 @@
mybag.forceMove(get_turf(user))
user.put_in_hands(mybag)
mybag = null
- update_icon()
+ update_icon(UPDATE_OVERLAYS)
diff --git a/code/modules/vehicle/vehicle.dm b/code/modules/vehicle/vehicle.dm
index 35ecfab5621..92b8bcbd7ed 100644
--- a/code/modules/vehicle/vehicle.dm
+++ b/code/modules/vehicle/vehicle.dm
@@ -113,10 +113,9 @@
buckled_mob.pixel_y = generic_pixel_y
-/obj/vehicle/update_icon()
+/obj/vehicle/update_icon_state()
return
-
/obj/item/key
name = "key"
desc = "A small grey key."
diff --git a/icons/mob/clothing/eyes.dmi b/icons/mob/clothing/eyes.dmi
index 07fc7f4ef9e2b823ad98b1e113b457b7ffe16785..e2656110c1a938733a8b803a2e10f31da3d3d3a9 100644
GIT binary patch
delta 364
zcmV-y0h9jwgaQ170gxmCTd^e#0e`fPeUg4b$LLst%&5Y`){`1h`3cuSKr{AhJ)d
zr1Q?VHsiN@uFf&}4Lfsh>Po$PoO!AW^5ywFytuv
zguP)-9Mdc1=<@8y(PdSIlS
z2Q?dJg0ZV$Y%Tf1`joB|P&Womv=7|-ASyBYQLav_kp`6W988t3^8%DM{Z
zh7R>0$@kvnb$CYK&>;@klTZI9$|?6i0Y|1N%#dFqhk#+qX-LIPijQuCtL>s$$(9R$UeQ1
z&O6`QjNk6LI>+NTtjxWsEA_69QHyd>F8=jOAF0pifp%!6acZhQfoANPv5jQHkfZAp
z_J%QWOmCE<%QGWKmsRl&g7Qk)3=s$9k&doibwML_8H)bPnXb3sLPj+jDSubr@i)31
z)NGgu#x8=fwdCvSGqO@Z-54~{K5*}YsKo3?xjHRI8c@!2Fm29u&*+3j9Tbz|pa4QYEFibbc=)mOgL-PmjB63p19ee%C1P`5xTz4@KD+dBKXw!d|yf%Iju
zM|0-Iug0eD&wai;HV_Q#-837_du|-)FeMnWX#!~=nDPAg;_-Pc)=!(_53VQH=T&7Q
J?6Zgh^gl46xGMkv
diff --git a/icons/mob/clothing/head.dmi b/icons/mob/clothing/head.dmi
index 4ae40dd517eb2a2de0809e66770204b646af6ba7..d52d6573de2c817e98c91baa85de9e3ca9ec1284 100644
GIT binary patch
delta 217051
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≀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