Skip to content

Commit

Permalink
Refactor Jukebox Beacons (#1548)
Browse files Browse the repository at this point in the history
* Refactor Jukebox Beacons

Yeah so my last implementation... it was bad. This version entirely foregoes frankensteining code from everywhere and is just a slight modification of Roulette Beacon code. which is MUCH nicer. I also gave it its own custom icon!

* Further Destinkification

2/3 of the requested changes were also originated from roulette beacon code, so that should probably get a quick refactor too someday.

* return
  • Loading branch information
Noot-Toot authored Apr 2, 2024
1 parent 4bb2bee commit d96cd1c
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
new /obj/item/roulette_wheel_beacon(src)
new /obj/item/storage/fancy/candle_box(src)
new /obj/item/storage/fancy/candle_box(src)
new /obj/item/choice_beacon/jukebox(src) //this line is a monkestation edit!
new /obj/item/jukebox_beacon(src) //monkestation edit
10 changes: 0 additions & 10 deletions monkestation/code/game/objects/items/choice_beacon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,3 @@
return

to_chat(user, span_notice("[uses] use[uses > 1 ? "s" : ""] remain[uses > 1 ? "" : "s"] on [src]."))

/obj/item/choice_beacon/jukebox //this is probably a terrible way to do this, but its the first that worked.
name = "jukebox beacon"
desc = "Deploys a jukebox! Also comes wrenched down to the floor for you on delivery! How convenient!"
/obj/item/choice_beacon/jukebox/interact(mob/user)
to_chat(user, span_hear("You hear a crackle before a message plays through [src]: \"Thank you for picking Dave's Instant Jukebox Shipping! This beacon will now self destruct.\""))
new /obj/machinery/media/jukebox(get_turf(user))
playsound(src, 'sound/weapons/emitter2.ogg', 50, extrarange = SILENCED_SOUND_EXTRARANGE)
do_sparks(3, source = src)
qdel(src)
23 changes: 23 additions & 0 deletions monkestation/code/game/objects/items/jukebox_beacon.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/obj/item/jukebox_beacon
name = "jukebox beacon"
desc = "N.T. jukebox beacon, toss it down and you will have a complementary jukebox delivered to you. It comes with a free wrench to move it after deployment."
icon = 'monkestation/icons/obj/items_and_weapons.dmi'
icon_state = "music_beacon"
var/used = FALSE

/obj/item/jukebox_beacon/attack_self()
if(used)
return
loc.visible_message(span_warning("\The [src] begins to beep loudly!"))
used = TRUE
addtimer(CALLBACK(src, PROC_REF(launch_payload)), 4 SECONDS)

/obj/item/jukebox_beacon/proc/launch_payload()
if(QDELETED(src))
return
podspawn(list(
"target" = get_turf(src),
"spawn" = list(/obj/item/wrench, /obj/machinery/media/jukebox),
"style" = STYLE_CENTCOM
))
qdel(src)
2 changes: 1 addition & 1 deletion monkestation/code/modules/cargo/crates/service.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
name = "Jukebox Beacon Crate"
desc = "Last one stolen? Broken? Burnt down in an insurance scam? then this crate is for you. Contains one Jukebox Beacon."
cost = CARGO_CRATE_VALUE * 20 //the crew shouldnt be able to just buy 15 jukeboxes all playing among us at the same time
contains = list(/obj/item/choice_beacon/jukebox)
contains = list(/obj/item/jukebox_beacon)
crate_name = "jukebox beacon crate"

/datum/supply_pack/service/cassettes
Expand Down
Binary file modified monkestation/icons/obj/items_and_weapons.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -5741,6 +5741,7 @@
#include "monkestation\code\game\objects\items\choice_beacon.dm"
#include "monkestation\code\game\objects\items\cirno_plush.dm"
#include "monkestation\code\game\objects\items\gravity_gun.dm"
#include "monkestation\code\game\objects\items\jukebox_beacon.dm"
#include "monkestation\code\game\objects\items\miningweapons.dm"
#include "monkestation\code\game\objects\items\mothlet_grenade.dm"
#include "monkestation\code\game\objects\items\plushies.dm"
Expand Down

0 comments on commit d96cd1c

Please sign in to comment.