Files
Bubberstation/code/game/objects/items/etherealdiscoball.dm
SmArtKar 431bf75d53 Color Code Audition: Human rendering hates me (#89702)
## About The Pull Request

This trainwreck of a PR is (hopefully) a final solution to all rendering
jank stemming from the new filter-based coloring system. I went over
every single instance of RESET_COLOR, either adding KEEP_APART or
rewriting them entirely so they render properly. I've also fixed blood
rendering issues by utilizing alpha filters and adding an abstract
"holder" appearance for worn items, which holds blood overlays on worn
clothing as to avoid coloring it. I've also fixed horrible
inconsistencies with atmos pipe coloring as a result (of getting sucked
down that rabbit hole) and converted all uses of COLOR_VERY_LIGHT_GRAY
in atmos code to ATMOS_COLOR_OMNI to avoid confusion.

MODsuit modules still get colored into MOD unit's color, need to
refactor their rendering for this.

Closes #88989
Closes #87526
Closes #89837

## Changelog
🆑
refactor: Audited all remaining coloring code - among noticeable
changes, blood should no longer get colored or "leak out" of item
bounds, atmos pipes no longer color weirdly and repairbots are white
again.
/🆑
2025-03-24 15:05:33 +01:00

76 lines
2.2 KiB
Plaintext

/obj/item/etherealballdeployer
name = "portable ethereal disco ball"
desc = "Press the button for a deployment of slightly-unethical PARTY!"
icon = 'icons/obj/devices/remote.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/machines/floor.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()
if(TurnedOn)
TurnOn()
/obj/structure/etherealball/attack_hand(mob/living/carbon/human/user, list/modifiers)
. = ..()
if(!can_interact(user))
return
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/click_alt(mob/living/carbon/human/user)
set_anchored(!anchored)
to_chat(user, span_notice("You [anchored ? null : "un"]lock the disco ball."))
return CLICK_ACTION_SUCCESS
/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()
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()
TimerID = addtimer(CALLBACK(src, PROC_REF(DiscoFever)), 5, TIMER_STOPPABLE) //Call ourselves every 0.5 seconds to change colors
/obj/structure/etherealball/update_icon_state()
icon_state = "ethdisco_head_[TurnedOn]"
return ..()
/obj/structure/etherealball/update_overlays()
. = ..()
. += mutable_appearance(icon, "ethdisco_base", appearance_flags = RESET_COLOR|KEEP_APART)