Fixes the roulette wheel (#46853)

* fixes roulette

* woops

* gotem
This commit is contained in:
Qustinnus
2019-10-04 20:22:34 +02:00
committed by moo
parent 8228cb2e47
commit 61bf8d7cd3
2 changed files with 10 additions and 7 deletions

View File

@@ -22,7 +22,7 @@
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 circuit is [R.on ? "on" : "off"]."
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
@@ -34,7 +34,7 @@
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)
if(!R.on)
return
R.anchored = !R.anchored
if(WIRE_RESETOWNER)
@@ -56,11 +56,11 @@
if(isliving(usr))
R.shock(usr, 60)
if(mend)
R.stat &= ~NOPOWER
R.on = TRUE
else
R.stat |= NOPOWER
R.on = FALSE
if(WIRE_BOLTS) // Always drop
if(R.stat & NOPOWER)
if(!R.on)
return
R.anchored = TRUE
if(WIRE_RESETOWNER)

View File

@@ -40,6 +40,7 @@
var/list/coins_to_dispense = list()
var/datum/looping_sound/jackpot/jackpot_loop
var/datum/asset/spritesheet/simple/assets
var/on = TRUE
/obj/machinery/roulette/Initialize()
. = ..()
@@ -112,7 +113,7 @@
if(istype(W, /obj/item/card/id))
playsound(src, 'sound/machines/card_slide.ogg', 50, TRUE)
if(stat & MAINT || stat & NOPOWER || locked)
if(stat & MAINT || !on || locked)
to_chat(user, "<span class='notice'>The machine appears to be disabled.</span>")
return FALSE
@@ -152,6 +153,7 @@
desc = "Owned by [new_card.registered_account.account_holder], draws directly from [user.p_their()] account."
my_card = new_card
to_chat(user, "<span class='notice'>You link the wheel to your account.</span>")
power_change()
return
return ..()
@@ -342,7 +344,7 @@
icon_state = "open"
/obj/machinery/roulette/proc/shock(mob/user, prb)
if(stat & NOPOWER) // unpowered, no shock
if(!on) // unpowered, no shock
return FALSE
if(!prob(prb))
return FALSE //you lucked out, no shock for you
@@ -372,6 +374,7 @@
new /obj/machinery/roulette(toLaunch)
new /obj/effect/DPtarget(drop_location(), toLaunch)
qdel(src)
#undef ROULETTE_SINGLES_PAYOUT
#undef ROULETTE_SIMPLE_PAYOUT