Files
Bubberstation/code/datums/elements/orbit_twitcher.dm
Time-Green 05982ba29a Recovered Crew are in spawner menu (#91986)
## About The Pull Request

![image](https://github.com/user-attachments/assets/052ad4ae-45e0-4fd5-b59f-4c659adefee3)

Added recovered crew to the ghost role spawner menu. Clicking spawn will
make you orbit the recovered crew body.


https://github.com/user-attachments/assets/326856c4-e306-43fd-b7d6-a8d5554a0e81

Orbiting the body will make it twitch a little to indicate to
coroners/MD's/roboticists that you're ready to be revived.

## Why It's Good For The Game

Getting people to actually play the recovered crew is kinda hard on most
rounds :( . First on my list is to make the process more convenient for
everyone.

By adding it to the ghostrole spawner menu, ghosts can quickly see if
bodies are available if they wish to play as one. Making them twitch
when orbited makes it so the people reviving them don't have to revive
them every few minutes in the case someone wishes to join as them (they
still might, it does get more attention).

I think the twitching effect is the best natural indicator that someone
wishes to join without being too OOC. I can imagine doctors being a
little confused at first, but it should click pretty quickly.

I am not too concerned about it being used as a ghost communication
medium. The spectroscopic sniffers are a more convenient tool for this,
and I don't think I've seen someone do it with them.
## Changelog
🆑
add: Recovered Crew have been added to the ghostrole spawner menu
add: Orbiting Recovered Crew corpses will make them twitch to indicate a
soul is available
/🆑
Giving them straight up superpowers or more aggressive antag rolls is
still something I'm considering. We'll see if/when I decide to do it

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2025-07-27 12:41:29 +02:00

51 lines
1.5 KiB
Plaintext

/datum/element/orbit_twitcher
element_flags = ELEMENT_BESPOKE | ELEMENT_DETACH_ON_HOST_DESTROY
argument_hash_start_idx = 2
/// Chance we have to twitch per second
var/twitch_chance
/// Those who are being orbited and should twitch
var/list/twitchers = list()
/datum/element/orbit_twitcher/Attach(datum/target, twitch_chance)
. = ..()
if(!isliving(target))
return ELEMENT_INCOMPATIBLE
src.twitch_chance = twitch_chance
RegisterSignal(target, COMSIG_ATOM_ORBIT_BEGIN, PROC_REF(orbit_begin))
RegisterSignal(target, COMSIG_ATOM_ORBIT_STOP, PROC_REF(orbit_stop))
/datum/element/orbit_twitcher/Detach(datum/source, ...)
. = ..()
twitchers.Remove(source)
UnregisterSignal(source, list(COMSIG_ATOM_ORBIT_BEGIN, COMSIG_ATOM_ORBIT_STOP))
/datum/element/orbit_twitcher/process(seconds_per_tick)
for(var/mob/living/living as anything in twitchers)
if(SPT_PROB(twitch_chance, seconds_per_tick))
if(prob(60))
living.emote("twitch_s", forced = TRUE)
else
living.emote("twitch", forced = TRUE)
/datum/element/orbit_twitcher/proc/orbit_begin(atom/source, atom/orbiter)
SIGNAL_HANDLER
twitchers.Add(source)
// It checks if we're already processing so it's fine to always call
START_PROCESSING(SSdcs, src)
/datum/element/orbit_twitcher/proc/orbit_stop(atom/source, atom/orbiter)
SIGNAL_HANDLER
twitchers.Remove(source)
if(!twitchers.len)
STOP_PROCESSING(SSdcs, src)
/datum/element/orbit_twitcher/OnTargetDelete(datum/source)
twitchers.Remove(source)
return ..()