Files
Bubberstation/code/datums/wires/roulette.dm
SkyratBot 23cda1571f [MIRROR] No roundstart playable MULEs / Trampling requires hacking [MDB IGNORE] (#22585)
* No roundstart playable MULEs / Trampling requires hacking (#76837)

## About The Pull Request

Prevailing feedback has been:
- The player base cannot be trusted to control MULEbots.
- It should be clearer what bots can and can't do.

The former is easy to fix.
The latter is sort of a matter for policy but I'm going to investigate
giving bots a rudimentary laws system. Plus that sounds much more
controversial than this so I am going to atomise this outside of that
PR.

MULEbots can still be set to allow sentience by cargo technicians, but
don't start that way.

ADDITIONALLY this PR just changes it so that MULEbots do not crush
people unless:
- They have been emagged.
- Their safety wire has been cut.
Either means works, so it's not too hard to access for nefarious
purposes, but hard to do to yourself.
Otherwise they just slow down for a few seconds instead.

Also fixed an unrelated name bug while I was there.

Closes #76926

## Why It's Good For The Game

Players would take them, not deliver any cargo, and repeatedly ask
people to lie down in front of them.
Plus Tram has 5 of the things which is frankly too many to be wandering
around the bar.

## Changelog

🆑
balance: You can't possess a MULE as soon as the round starts, someone
will have to give you permission.
balance: MULEbots no longer crush prone characters unless they have been
hacked (or emagged).
fix: Bots can put numbers in their names, what with being robots.
admin: Adds attack logging when certain wires are cut (for instance:
MULEbot safeties)
/🆑

* No roundstart playable MULEs / Trampling requires hacking

* add missing arg

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: Pinta <68373373+softcerv@users.noreply.github.com>
Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
2023-07-21 02:02:40 -04:00

79 lines
2.0 KiB
Plaintext

/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)
if(!..())
return FALSE
. = FALSE
var/obj/machinery/roulette/R = holder
if(R.machine_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 engaged!" : "have disengaged."]"
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
/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.on)
return
R.set_anchored(!R.anchored)
if(WIRE_RESETOWNER)
R.my_card = null
R.audible_message(span_warning("Owner reset!"))
R.locked = FALSE
if(WIRE_PRIZEVEND)
if(isliving(usr))
R.shock(usr, 70)
if(R.locked)
return
R.audible_message(span_warning("Unauthorized prize vend detected! Locking down machine!"))
R.prize_theft(0.20)
/datum/wires/roulette/on_cut(wire, mend, source)
var/obj/machinery/roulette/R = holder
switch(wire)
if(WIRE_SHOCK)
if(isliving(usr))
R.shock(usr, 60)
if(mend)
R.on = TRUE
else
R.on = FALSE
if(WIRE_BOLTS) // Always drop
if(!R.on)
return
R.set_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_warning("Unauthorized prize vend detected! Locking down machine!"))
R.prize_theft(0.10)