mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-14 19:51:59 +00:00
* Makes the "Ian's Adventure" station trait more interesting by making the dog deadchat controllable plus extra lives. (#62617) About The Pull Request Makes the "Ian Adventure" station trait more interesting by giving him deadchat control (democracy mode, 3 seconds cooldown on inputs) and a couple extra lives* to survive early round tiding. *Basically, a new component that respawns the critter when he dies. The component itself is simple enough, but it sends a signal each respawn to allow other datums to expand this behavior how they want. I've contemplated adding a signal that can stop death, dusting and gibbing instead of respawning the mob at first but because death(), dust() and gib() were made with the assertion that the mob is always going to die I've quickly realized it'd require a refactor that's way too big and out of scope. The deadchat control of corgis only include commands to change and drop hats, "speak" (random lines from the speak list of the mob) and spin (other than cardinal movement) for now. I'd have loved to add more complex commands (like, argumented) that can potentially be relayed to the AI controller, but I guess that'll have to wait until the thing gets refactored a little. Why It's Good For The Game "Ian's Adventure" is a really bland station trait at the moment. All it does is move Ian somewhere else at the start of the round. Even by the station traits standard of being small things this is insignificant, and also pretty bad considering Ian is not actually going on an adventure since he lacks the initiative to do anything being an npc dog. This PR aims to breath fresh air into this station trait and push it toward a slighty more engaging direction, though it relies on observers to work, while still being a small """"cute"""" station trait. Changelog cl expansion: The "Ian's Adventure" station trait now makes Ian deadchat controllable and gives him a couple extra lives (to survive early round tiding) /cl * Makes the "Ian's Adventure" station trait more interesting by making the dog deadchat controllable plus extra lives. Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
48 lines
1.7 KiB
Plaintext
48 lines
1.7 KiB
Plaintext
/**
|
|
* A simple component that spawns a mob of the same type and transfers itself to it when parent dies.
|
|
* For more complex behaviors, use the COMSIG_ON_MULTIPLE_LIVES_RESPAWN comsig.
|
|
*/
|
|
/datum/component/multiple_lives
|
|
can_transfer = TRUE
|
|
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
|
|
/// The number of respawns the living mob has left.
|
|
var/lives_left
|
|
|
|
/datum/component/multiple_lives/Initialize(lives_left)
|
|
if(!isliving(parent))
|
|
return COMPONENT_INCOMPATIBLE
|
|
|
|
src.lives_left = lives_left
|
|
|
|
/datum/component/multiple_lives/RegisterWithParent()
|
|
RegisterSignal(parent, COMSIG_LIVING_DEATH, .proc/respawn)
|
|
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/on_examine)
|
|
|
|
/datum/component/multiple_lives/UnregisterFromParent()
|
|
UnregisterSignal(parent, list(COMSIG_LIVING_DEATH, COMSIG_PARENT_EXAMINE))
|
|
|
|
/datum/component/multiple_lives/proc/respawn(mob/living/source, gibbed)
|
|
SIGNAL_HANDLER
|
|
if(source.suiciding) //Freed from this mortail coil.
|
|
qdel(src)
|
|
return
|
|
var/mob/living/respawned_mob = new source.type (source.drop_location())
|
|
source.mind?.transfer_to(respawned_mob)
|
|
lives_left--
|
|
if(lives_left <= 0)
|
|
qdel(src)
|
|
source.TransferComponents(respawned_mob)
|
|
SEND_SIGNAL(source, COMSIG_ON_MULTIPLE_LIVES_RESPAWN, respawned_mob, gibbed, lives_left)
|
|
|
|
/datum/component/multiple_lives/proc/on_examine(mob/living/source, mob/user, list/examine_list)
|
|
SIGNAL_HANDLER
|
|
if(isobserver(user) || source == user)
|
|
examine_list += "[source.p_theyve(TRUE)] [lives_left] extra lives left."
|
|
|
|
/datum/component/multiple_lives/InheritComponent(datum/component/multiple_lives/new_comp , lives_left)
|
|
src.lives_left += new_comp ? new_comp.lives_left : lives_left
|
|
|
|
/datum/component/multiple_lives/PostTransfer()
|
|
if(!isliving(parent))
|
|
return COMPONENT_INCOMPATIBLE
|