Files
Bubberstation/code/game/objects/items/implants/implant_battle_royale.dm
15baf7873a Offsite Deathrattle Implants and Repathed Kheiral Cuffs (#94209)
## About The Pull Request

Updates subdermal implants so that they have `implant_info` and
`implant_lore` variables instead of one unchanging `get_info()`. Also
rewrites/updates/tweaks/etc. lore for every implant that had get_info()
blocks.

Makes beacon implants (the ones you teleport onto) turn off (hide
themselves on prisoner management consoles) after ten minutes, matching
the tracking implant's functionality.

Deathrattle implants are now `allow_multiple = TRUE`, so you can have
multiple deathrattles implanted.

Reworked the implant pad's UI to have collapsible sections for implant
info, implant lore, and also have buttons for configuring deathrattle
implants.

Adds a box of expeditionary deathrattle implants to the mining vendor.
For 900 points (585 points if delivered), you receive a box containing 5
expeditionary deathrattle implants, which **ONLY ALERT TO DEATHS IN
MINING WASTELAND AREAS (e.g. not ruins, not space, not station) (this is
important)**, an implanter, and an implant pad.

The intended workflow is that you initialize one deathrattle implant,
use that network for all the other deathrattles, and implant yourself,
your mining buddies, your QM, and a paramedic, maybe. However since they
start unset you could theoretically make one really big deathrattle
network. Good luck getting people to volunteer for implanting, though,
and as above, it only really works if you die outside of the station.

Also, repaths kheiral cuffs to be accessories, so you can attach them to
uniforms. They're still functional as suit sensor extenders and GPSes
(when off-station).

<details><summary>Screenshots</summary>

<img width="469" height="91" alt="image"
src="https://github.com/user-attachments/assets/2c88b151-e5ab-415a-8c41-0f166f439315"
/><br>
<img width="300" height="350" alt="image"
src="https://github.com/user-attachments/assets/0764983a-1160-48ab-aa6a-d1aaf08a682e"
/><br>
<img width="300" height="350" alt="image"
src="https://github.com/user-attachments/assets/98e84368-300b-453a-89a4-d922c80628e8"
/>

</details>

## Why It's Good For The Game

Deathrattle implants are cool. Being able to know that your coworker
exploded, after a non-negligible amount of setup and wrangling your
fellow spaceman to let you implant them, is probably a good thing.
Introduces a cooperative avenue of "Wait, my coworker just died" instead
of "Hey, they haven't yelled something on comms, did they roll antag?
(No. They died.)"

Kheiral cuffs being uniform attachments is because having to sacrifice
glove slot for them annoyed me a lot.

## Changelog

🆑
add: Nanotrasen has begun rolling out (unconfigured) expeditionary
deathrattle implant kits for their mining teams for 900 points (585
points, if manually delivered). These only alert for deaths on raw
mining wasteland, and will not work in space, ruins, or on-station.
balance: Kheiral cuffs can now be attached to uniforms as accessories.
They retain their suit sensor extension/GPS functionality (still only
when off station Z-levels, though).
fix: Beacon implants now turn off (hide themselves on prisoner
management consoles) after ten minutes, matching the tracking implant's
functionality.
qol: Made the implant pad UI a little nicer to look at, with dropdowns
and demarcated sections.
code: Implants now have separated "immediately useful" information and
"extended lore tidbits" information as variables instead of one
unchangeable get_info() block.
/🆑

---------

Co-authored-by: Hatterhat <Hatterhat@users.noreply.github.com>
2026-01-04 16:55:09 +00:00

140 lines
5.3 KiB
Plaintext

/// Implant used by the traitor Battle Royale objective, is not active immediately
/obj/item/implant/explosive/battle_royale
name = "rumble royale implant"
actions_types = null
instant_explosion = FALSE
master_implant = TRUE
delay = 10 SECONDS
panic_beep_sound = TRUE
announce_activation = FALSE
/// Where is this going to tell us to go to avoid death?
var/target_area_name = ""
/// Is this implant active yet?
var/battle_started = FALSE
/// Are we enforcing a specific area yet?
var/area_limited = FALSE
/// Are we presently exploding?
var/has_exploded = FALSE
/// How likely are we to blow up if removed?
var/removed_explode_chance = 70
/// Reference to our applied camera component
var/camera
/// We will explode if we're not in here after a set time
var/list/limited_areas = list()
implant_info = "Forcibly inducts the host into televised bloodsport by threatening their life via electrically-detonated microexplosive. \
Detonates upon death, expiry of an internal timer, or attempted removal."
implant_lore = "The Donk Co. 'Rumble Royale' Contestant Motivation Implant is a licensed copy of the Robust Corp RX-78 Employee Management Implant, \
featuring the very same microbomb that has provided plausible deniability, evidence disposal, and equipment denial for numerous non-state actors. \
The Rumble Royale variant also features additional nervous system interception functionality, allowing for broadcasting the host's field of view \
to compatible entertainment monitors, and a GPS-compatible tracking beacon for the sake of allowing contestants to locate each other more easily."
/obj/item/implant/explosive/battle_royale/on_death(datum/source, gibbed)
if (!battle_started)
return
return ..()
/obj/item/implant/explosive/battle_royale/implant(mob/living/target, mob/user, silent, force)
. = ..()
if (!.)
return
RegisterSignal(target, COMSIG_LIVING_LIFE, PROC_REF(on_life))
if (!battle_started)
return
name = "[name] - [imp_in.real_name]"
camera = target.AddComponent( \
/datum/component/simple_bodycam, \
camera_name = "rumble royale tracker", \
c_tag = "Competitor [target.real_name]", \
network = BATTLE_ROYALE_CAMERA_NET, \
emp_proof = TRUE, \
)
announce()
if (area_limited)
limit_areas()
/obj/item/implant/explosive/battle_royale/removed(mob/target, silent, special)
. = ..()
UnregisterSignal(target, list(COMSIG_LIVING_LIFE, COMSIG_ENTER_AREA))
QDEL_NULL(camera)
if (has_exploded || QDELETED(src))
return
if (!special && prob(removed_explode_chance))
target.visible_message(span_boldwarning("[src] beeps ominously."))
playsound(loc, 'sound/items/timer.ogg', 50, vary = FALSE)
explode(target)
target?.mind?.remove_antag_datum(/datum/antagonist/survivalist/battle_royale)
/obj/item/implant/explosive/battle_royale/emp_act(severity)
removed_explode_chance = rand(0, 100)
return ..()
/obj/item/implant/explosive/battle_royale/explode(atom/override_explode_target = null)
has_exploded = TRUE
return ..()
/// Give a slight tell
/obj/item/implant/explosive/battle_royale/proc/on_life(mob/living/source)
SIGNAL_HANDLER
if (prob(98))
return
if (!source.itch() || prob(80))
return
to_chat(source, span_boldwarning("You feel a lump which shouldn't be there."))
/// Start the battle royale
/obj/item/implant/explosive/battle_royale/proc/start_battle(target_area_name, list/limited_areas)
if (isnull(imp_in))
explode()
return
src.target_area_name = target_area_name
src.limited_areas = limited_areas
battle_started = TRUE
name = "[name] - [imp_in.real_name]"
imp_in.AddComponent( \
/datum/component/simple_bodycam, \
camera_name = "rumble royale tracker", \
c_tag = "Competitor [imp_in.real_name]", \
network = BATTLE_ROYALE_CAMERA_NET, \
emp_proof = TRUE, \
)
AddComponent(/datum/component/gps, "Rumble Royale - [imp_in.real_name]")
playsound(loc, 'sound/items/timer.ogg', 50, vary = FALSE)
/// Limit the owner to the specified area
/obj/item/implant/explosive/battle_royale/proc/limit_areas()
if (isnull(imp_in))
explode()
return
area_limited = TRUE
RegisterSignal(imp_in, COMSIG_ENTER_AREA, PROC_REF(check_area))
check_area(imp_in)
/// Called when our implantee moves somewhere
/obj/item/implant/explosive/battle_royale/proc/check_area(mob/living/source)
SIGNAL_HANDLER
if (!length(limited_areas))
return
if (is_type_in_list(get_area(source), limited_areas))
return
playsound(imp_in, 'sound/items/timer.ogg', 50, vary = FALSE)
to_chat(imp_in, span_boldwarning("You are out of bounds! Get to the [target_area_name] quickly!"))
addtimer(CALLBACK(src, PROC_REF(check_area_deadly)), 5 SECONDS, TIMER_DELETE_ME)
/// After a grace period they're still out of bounds, killing time
/obj/item/implant/explosive/battle_royale/proc/check_area_deadly()
if (isnull(imp_in) || has_exploded)
return
var/area/our_area = get_area(imp_in)
if (is_type_in_list(our_area, limited_areas))
return
log_combat(src, imp_in, "exploded due to out of bounds", addition = "target area was [target_area_name], area was [our_area]")
explode()
/// Add the antag datum to our new contestant, also printing some flavour text
/obj/item/implant/explosive/battle_royale/proc/announce()
var/datum/antagonist/survivalist/battle_royale/royale = imp_in.mind?.add_antag_datum(/datum/antagonist/survivalist/battle_royale)
royale?.set_target_area(target_area_name)