Files
Yogstation/code/game/objects/items/laser_level.dm
John Willard 9a89bb674f Adds update_appearance (this is friggin big news) (#19643)
* update icon and update appearance

* update name

* fixes

* Removes double parent calls from many things

* More fixes

* minor fixes

* fuck

* A!

* general annoyances in this PR

* going in specific fixes

* remove remaining update icons and hud fixes

* Mass replace update icon with update icon state/overlays

* compile

* push my work so far

* goes back on things I broke

* a

* goes through like 80 more cases

* going through more update icons

* compile again

* thank you tattax

* Goes through the remaining update icon

* fix CI cries

* Fixes cigs, canisters and guncases

* Fixes airlock unres sides

* Fixes the flash

* Fixes cryo cells

* gun fix

* Egun fixes

* fixes mini eguns

* Update energy.dm

* Fixes MMIs

* Fixes security level interface

* Fixes cigar cases

* Bow & Critter crate fixes

* Fixes signalers

* Fix canisters again

* re-adds blinking red

* Fixes solar panels

* Fixes cryogenics (and forced standing)

* Update cryo.dm

* sechailer fix

* Maybe fixes pitch black roundstart APCs

* Update apc.dm

* yet another egun fix

* Fixes plasmamen helmets among other stuff

* Fixes canisters for good

* Fixes booze dispensers

* Fixes new icon updates people added

* Probably fixes ballistic guns

* i give up lol
2023-07-21 18:49:04 -05:00

50 lines
1.5 KiB
Plaintext

/obj/item/laserlevel
name = "laser level"
desc = "Emits a light grid for easy construction."
icon = 'icons/obj/tools.dmi'
icon_state = "laser-level"
item_state = "laserlevel"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
w_class = WEIGHT_CLASS_SMALL
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT
var/lightlevel = 0;
var/brightness_on = 4 //range of light when on
var/flashlight_power = 1 //strength of the light when on
/obj/item/laserlevel/Initialize(mapload)
. = ..()
update_appearance(UPDATE_ICON)
/obj/item/laserlevel/attack_self(mob/user)
lightlevel--;
if(lightlevel < 0)
lightlevel = 3
playsound(user, lightlevel ? 'sound/weapons/magin.ogg' : 'sound/weapons/magout.ogg', 40, 1)
if(lightlevel)
set_light(l_range = lightlevel / 2, l_power = (lightlevel / 4), l_color = "#00ff00")
else
set_light(0)
update_appearance(UPDATE_ICON)
update_overlay(user)
/obj/item/laserlevel/update_overlays()
. = ..()
. += "[initial(icon_state)][lightlevel]"
/obj/item/laserlevel/proc/update_overlay(mob/user)
user.clear_fullscreen("laser",0)
if(lightlevel)
var/atom/movable/screen/fullscreen/laser/laserscreen = user.overlay_fullscreen("laser", /atom/movable/screen/fullscreen/laser)
laserscreen.alpha = 42 * lightlevel
/obj/item/laserlevel/dropped(mob/user, silent)
. = ..()
user.clear_fullscreen("laser",0)
/obj/item/laserlevel/pickup(mob/user)
. = ..()
update_overlay(user)