Skip to content

Commit

Permalink
[READY] Roulette wheels (#46418)
Browse files Browse the repository at this point in the history
* Basic roulette interface

* at least it compiles

* roulette

* fixes jackpot sound

* beacon

* epic

* push

* Update code/game/machinery/roulette_machine.dm

Co-Authored-By: spookydonut <[email protected]>

* sprites and more audio

* color

* Woops

* epic

* wires

* sprite

* Nya mergies pwease OwO (#17)

* Moves style to .styl

* test

* Fixed

* da real shiet

* fix

* fix

* fixes

* woops

* assets

* stop github stop

* fix

* static

* nya (#18)
  • Loading branch information
Qustinnus authored and AnturK committed Sep 20, 2019
1 parent eaa00b8 commit 20397d5
Show file tree
Hide file tree
Showing 28 changed files with 651 additions and 15 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/wires.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@
#define WIRE_ZAP "High Voltage Circuit"
#define WIRE_ZAP1 "High Voltage Circuit 1"
#define WIRE_ZAP2 "High Voltage Circuit 2"
#define WIRE_PRIZEVEND "Emergency Prize Vend"
#define WIRE_RESETOWNER "Reset Owner"

8 changes: 8 additions & 0 deletions code/datums/looping_sounds/machinery_sounds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,11 @@
mid_length = 10
end_sound = 'sound/machines/microwave/microwave-end.ogg'
volume = 90

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/datum/looping_sound/jackpot
mid_length = 11
mid_sounds = list('sound/machines/roulettejackpot.ogg')
volume = 85
vary = TRUE
76 changes: 76 additions & 0 deletions code/datums/wires/roulette.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/datum/wires/roulette
holder_type = /obj/machinery/roulette
proper_name = "Roulette Table"
randomize = TRUE

/datum/wires/roulette/New(atom/holder)
wires = list(
WIRE_RESETOWNER,
WIRE_PRIZEVEND,
WIRE_SHOCK,
WIRE_BOLTS
)
..()

/datum/wires/roulette/interactable(mob/user)
. = FALSE
var/obj/machinery/roulette/R = holder
if(R.stat & MAINT)
. = TRUE

/datum/wires/roulette/get_status()
var/obj/machinery/roulette/R = holder
var/list/status = list()
status += "The machines bolts [R.anchored ? "have fallen!" : "look up."]"
status += "The main circuit is [R.stat & NOPOWER ? "off" : "on"]."
status += "The main system lock appears to be [R.locked ? "on" : "off"]."
status += "The account balance system appears to be [R.my_card ? "connected to [R.my_card.registered_account.account_holder]" : "disconnected"]."
return status

/datum/wires/roulette/on_pulse(wire)
var/obj/machinery/roulette/R = holder
switch(wire)
if(WIRE_SHOCK)
if(isliving(usr))
R.shock(usr, 50)
if(WIRE_BOLTS) // Pulse to toggle bolts (but only raise if power is on).
if(R.stat & NOPOWER)
return
R.anchored = !R.anchored
if(WIRE_RESETOWNER)
R.my_card = null
R.audible_message("<span class='warning'>Owner reset!</span>")
R.locked = FALSE
if(WIRE_PRIZEVEND)
if(isliving(usr))
R.shock(usr, 70)
if(R.locked)
return
R.audible_message("<span class='warning'>Unauthorized prize vend detected! Locking down machine!</span>")
R.prize_theft(0.20)

/datum/wires/roulette/on_cut(wire, mend)
var/obj/machinery/roulette/R = holder
switch(wire)
if(WIRE_SHOCK)
if(isliving(usr))
R.shock(usr, 60)
if(mend)
R.stat &= ~NOPOWER
else
R.stat |= NOPOWER
if(WIRE_BOLTS) // Always drop
if(R.stat & NOPOWER)
return
R.anchored = TRUE
if(WIRE_RESETOWNER)
if(isliving(usr))
R.shock(usr, 70)
if(WIRE_PRIZEVEND)
if(isliving(usr))
R.shock(usr, 75)
if(R.locked)
return
R.audible_message("<span class='warning'>Unauthorized prize vend detected! Locking down machine!</span>")
R.prize_theft(0.10)

Loading

0 comments on commit 20397d5

Please sign in to comment.