Files
Bubberstation/code/datums/wires/mulebot.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

65 lines
2.2 KiB
Plaintext

#define FAST_MOTOR_SPEED 1
#define AVERAGE_MOTOR_SPEED 2
#define SLOW_MOTOR_SPEED 3
/datum/wires/mulebot
holder_type = /mob/living/simple_animal/bot/mulebot
proper_name = "Mulebot"
randomize = TRUE
/datum/wires/mulebot/New(atom/holder)
wires = list(
WIRE_POWER1, WIRE_POWER2,
WIRE_AVOIDANCE, WIRE_LOADCHECK,
WIRE_MOTOR1, WIRE_MOTOR2,
WIRE_RX, WIRE_TX, WIRE_BEACON
)
..()
/datum/wires/mulebot/interactable(mob/user)
if(!..())
return FALSE
var/mob/living/simple_animal/bot/mulebot/mule = holder
if(mule.bot_cover_flags & BOT_COVER_OPEN)
return TRUE
/datum/wires/mulebot/on_cut(wire, mend, source)
var/mob/living/simple_animal/bot/mulebot/mule = holder
switch(wire)
if(WIRE_MOTOR1, WIRE_MOTOR2)
if(is_cut(WIRE_MOTOR1) && is_cut(WIRE_MOTOR2))
ADD_TRAIT(mule, TRAIT_IMMOBILIZED, MOTOR_LACK_TRAIT)
else
REMOVE_TRAIT(mule, TRAIT_IMMOBILIZED, MOTOR_LACK_TRAIT)
if(is_cut(WIRE_MOTOR1))
mule.set_varspeed(FAST_MOTOR_SPEED)
else if(is_cut(WIRE_MOTOR2))
mule.set_varspeed(AVERAGE_MOTOR_SPEED)
else
mule.set_varspeed(SLOW_MOTOR_SPEED)
if(WIRE_AVOIDANCE)
if (!isnull(source))
log_combat(source, mule, "[is_cut(WIRE_AVOIDANCE) ? "cut" : "mended"] the MULE safety wire of")
/datum/wires/mulebot/on_pulse(wire)
var/mob/living/simple_animal/bot/mulebot/mule = holder
if(!mule.has_power(TRUE))
return //logically mulebots can't flash and beep if they don't have power.
switch(wire)
if(WIRE_POWER1, WIRE_POWER2)
holder.visible_message(span_notice("[icon2html(mule, viewers(holder))] The charge light flickers."))
if(WIRE_AVOIDANCE)
holder.visible_message(span_notice("[icon2html(mule, viewers(holder))] The external warning lights flash briefly."))
flick("[mule.base_icon]1", mule)
if(WIRE_LOADCHECK)
holder.visible_message(span_notice("[icon2html(mule, viewers(holder))] The load platform clunks."))
if(WIRE_MOTOR1, WIRE_MOTOR2)
holder.visible_message(span_notice("[icon2html(mule, viewers(holder))] The drive motor whines briefly."))
else
holder.visible_message(span_notice("[icon2html(mule, viewers(holder))] You hear a radio crackle."))
#undef FAST_MOTOR_SPEED
#undef AVERAGE_MOTOR_SPEED
#undef SLOW_MOTOR_SPEED