Files
Bubberstation/code/modules/bitrunning/spawners.dm
Y0SH1M4S73R 25eb08420a Temporary bodies return players to minds without bodies (#89323)
## About The Pull Request

There are a couple of cases where ghost roles that give the temporary
body component prevent you from returning to the round when they really
shouldn't. The particular cases are:
- You entered a temporary body while you had no body, but could be
recovered via means such as podcloning
- You enter a temporary body, and while in that body, your original body
is permanently removed while your mind could be recovered via means such
as podcloning
- Basketball

This PR addresses those cases by allowing the temporary body component
to operate with a null `old_body`, and allowing the temporary body
component to be given to ghosts whose minds don't have bodies.


## Why It's Good For The Game

Erroneous DNRs caused by code oversights are probably very undesirable
to the playerbase.

## Changelog

🆑
fix: Joining a minigame or taking certain ghost roles, while you have a
mind without a body, will no longer DNR you, just in case you can be
resurrected by some means.
fix: If your old body is permanently destroyed while you are playing a
minigame or as certain ghost roles, you will still return to your
character's original mind, just in case you can be resurrected by some
means.
fix: The basketball minigame now gives its players and referee temporary
bodies.
/🆑
2025-02-05 20:01:42 +01:00

75 lines
3.0 KiB
Plaintext

/obj/effect/mob_spawn/ghost_role/human/virtual_domain
outfit = /datum/outfit/virtual_pirate
prompt_name = "a virtual domain debug entity"
flavour_text = "You probably shouldn't be seeing this, contact a coder!"
you_are_text = "You are NOT supposed to be here. How did you let this happen?"
important_text = "Bitrunning is a crime, and your primary threat."
temp_body = TRUE
/obj/effect/mob_spawn/ghost_role/human/virtual_domain/special(mob/living/spawned_mob, mob/mob_possessor)
var/datum/mind/ghost_mind = mob_possessor.mind
if(ghost_mind) // Preserves any previous bodies before making the switch
spawned_mob.AddComponent(/datum/component/temporary_body, ghost_mind, ghost_mind.current, TRUE)
..()
spawned_mob.mind.add_antag_datum(/datum/antagonist/domain_ghost_actor)
/// Simulates a ghost role spawn without calling special(), ie a bitrunner spawn instead of a ghost.
/obj/effect/mob_spawn/ghost_role/human/virtual_domain/proc/artificial_spawn(mob/living/runner)
SEND_SIGNAL(src, COMSIG_BITRUNNER_SPAWNED, runner)
/obj/effect/mob_spawn/ghost_role/human/virtual_domain/pirate
name = "Virtual Pirate Remains"
desc = "Some inanimate bones. They feel like they could spring to life at any moment!"
density = FALSE
icon = 'icons/effects/blood.dmi'
icon_state = "remains"
prompt_name = "a virtual skeleton pirate"
you_are_text = "You are a virtual pirate. Yarrr!"
flavour_text = " There's a LANDLUBBER after yer booty. Stop them!"
/datum/outfit/virtual_pirate
name = "Virtual Pirate"
id = /obj/item/card/id/advanced
id_trim = /datum/id_trim/pirate
uniform = /obj/item/clothing/under/costume/pirate
suit = /obj/item/clothing/suit/costume/pirate/armored
glasses = /obj/item/clothing/glasses/eyepatch
head = /obj/item/clothing/head/costume/pirate/bandana/armored
shoes = /obj/item/clothing/shoes/pirate/armored
/obj/effect/mob_spawn/ghost_role/human/virtual_domain/pirate/special(mob/living/spawned_mob, mob/mob_possessor)
. = ..()
spawned_mob.fully_replace_character_name(spawned_mob.real_name, "[pick(strings(PIRATE_NAMES_FILE, "generic_beginnings"))][pick(strings(PIRATE_NAMES_FILE, "generic_endings"))]")
/obj/effect/mob_spawn/ghost_role/human/virtual_domain/syndie
name = "Virtual Syndicate Sleeper"
icon = 'icons/obj/machines/sleeper.dmi'
icon_state = "sleeper_s"
prompt_name = "a virtual syndicate operative"
you_are_text = "You are a virtual syndicate operative."
flavour_text = "Alarms blare! We are being boarded!"
outfit = /datum/outfit/virtual_syndicate
spawner_job_path = /datum/job/space_syndicate
/datum/outfit/virtual_syndicate
name = "Virtual Syndie"
id = /obj/item/card/id/advanced/chameleon
id_trim = /datum/id_trim/chameleon/operative
uniform = /obj/item/clothing/under/syndicate
back = /obj/item/storage/backpack
gloves = /obj/item/clothing/gloves/tackler/combat/insulated
shoes = /obj/item/clothing/shoes/combat
implants = list(/obj/item/implant/weapons_auth)
/datum/outfit/virtual_syndicate/post_equip(mob/living/carbon/human/user, visuals_only)
user.faction |= ROLE_SYNDICATE