mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
* 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
74 lines
2.1 KiB
Plaintext
74 lines
2.1 KiB
Plaintext
/obj/item/etherealballdeployer
|
|
name = "Portable Ethereal Disco Ball"
|
|
desc = "Press the button for a deployment of slightly-unethical PARTY!"
|
|
icon = 'icons/obj/device.dmi'
|
|
icon_state = "ethdisco"
|
|
|
|
/obj/item/etherealballdeployer/attack_self(mob/living/carbon/user)
|
|
.=..()
|
|
to_chat(user, span_notice("You deploy the Ethereal Disco Ball."))
|
|
new /obj/structure/etherealball(user.loc)
|
|
qdel(src)
|
|
|
|
/obj/structure/etherealball
|
|
name = "Ethereal Disco Ball"
|
|
desc = "The ethics of this discoball are questionable."
|
|
icon = 'icons/obj/device.dmi'
|
|
icon_state = "ethdisco_head_0"
|
|
anchored = TRUE
|
|
density = TRUE
|
|
var/TurnedOn = FALSE
|
|
var/current_color
|
|
var/TimerID
|
|
var/range = 7
|
|
var/power = 3
|
|
|
|
/obj/structure/etherealball/Initialize(mapload)
|
|
. = ..()
|
|
update_appearance(UPDATE_ICON)
|
|
|
|
/obj/structure/etherealball/attack_hand(mob/living/carbon/human/user)
|
|
. = ..()
|
|
if(TurnedOn)
|
|
TurnOff()
|
|
to_chat(user, span_notice("You turn the disco ball off!"))
|
|
else
|
|
TurnOn()
|
|
to_chat(user, span_notice("You turn the disco ball on!"))
|
|
|
|
/obj/structure/etherealball/AltClick(mob/living/carbon/human/user)
|
|
. = ..()
|
|
if(anchored)
|
|
to_chat(user, span_notice("You unlock the disco ball."))
|
|
anchored = FALSE
|
|
else
|
|
to_chat(user, span_notice("You lock the disco ball."))
|
|
anchored = TRUE
|
|
|
|
/obj/structure/etherealball/proc/TurnOn()
|
|
TurnedOn = TRUE //Same
|
|
DiscoFever()
|
|
|
|
/obj/structure/etherealball/proc/TurnOff()
|
|
TurnedOn = FALSE
|
|
set_light(0)
|
|
remove_atom_colour(TEMPORARY_COLOUR_PRIORITY)
|
|
update_appearance(UPDATE_ICON)
|
|
if(TimerID)
|
|
deltimer(TimerID)
|
|
|
|
/obj/structure/etherealball/proc/DiscoFever()
|
|
remove_atom_colour(TEMPORARY_COLOUR_PRIORITY)
|
|
current_color = random_color()
|
|
set_light(range, power, current_color)
|
|
add_atom_colour("#[current_color]", FIXED_COLOUR_PRIORITY)
|
|
update_appearance(UPDATE_ICON)
|
|
TimerID = addtimer(CALLBACK(src, PROC_REF(DiscoFever)), 5, TIMER_STOPPABLE) //Call ourselves every 0.5 seconds to change colors
|
|
|
|
/obj/structure/etherealball/update_overlays()
|
|
. = ..()
|
|
icon_state = "ethdisco_head_[TurnedOn]"
|
|
var/mutable_appearance/base_overlay = mutable_appearance(icon, "ethdisco_base")
|
|
base_overlay.appearance_flags = RESET_COLOR
|
|
. += base_overlay
|