mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
Merge pull request #41985 from Qustinnus/discomode
[READY]Adds new bar item the "Ethereal Discoball"
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
/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 class='notice'>You deploy the Ethereal Disco Ball.</span>")
|
||||
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()
|
||||
. = ..()
|
||||
update_icon()
|
||||
|
||||
/obj/structure/etherealball/attack_hand(mob/living/carbon/human/user)
|
||||
. = ..()
|
||||
if(TurnedOn)
|
||||
TurnOff()
|
||||
to_chat(user, "<span class='notice'>You turn the disco ball off!</span>")
|
||||
else
|
||||
TurnOn()
|
||||
to_chat(user, "<span class='notice'>You turn the disco ball on!</span>")
|
||||
|
||||
/obj/structure/etherealball/AltClick(mob/living/carbon/human/user)
|
||||
. = ..()
|
||||
if(anchored)
|
||||
to_chat(user, "<span class='notice'>You unlock the disco ball.</span>")
|
||||
anchored = FALSE
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You lock the disco ball.</span>")
|
||||
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_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_icon()
|
||||
TimerID = addtimer(CALLBACK(src, .proc/DiscoFever), 5, TIMER_STOPPABLE) //Call ourselves every 0.5 seconds to change colors
|
||||
|
||||
/obj/structure/etherealball/update_icon()
|
||||
cut_overlays()
|
||||
icon_state = "ethdisco_head_[TurnedOn]"
|
||||
var/mutable_appearance/base_overlay = mutable_appearance(icon, "ethdisco_base")
|
||||
base_overlay.appearance_flags = RESET_COLOR
|
||||
add_overlay(base_overlay)
|
||||
@@ -9,3 +9,4 @@
|
||||
..()
|
||||
for(var/i in 1 to 10)
|
||||
new /obj/item/reagent_containers/food/drinks/beer( src )
|
||||
new /obj/item/etherealballdeployer(src)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 48 KiB |
@@ -793,6 +793,7 @@
|
||||
#include "code\game\objects\items\dna_injector.dm"
|
||||
#include "code\game\objects\items\documents.dm"
|
||||
#include "code\game\objects\items\eightball.dm"
|
||||
#include "code\game\objects\items\etherealdiscoball.dm"
|
||||
#include "code\game\objects\items\extinguisher.dm"
|
||||
#include "code\game\objects\items\flamethrower.dm"
|
||||
#include "code\game\objects\items\gift.dm"
|
||||
|
||||
Reference in New Issue
Block a user