Files
Bubberstation/code/modules/bitrunning/spawners.dm
Profakos 9f7d6dea62 Outfits that put items in your hand now respect if the outfit is visual only (#87355)
## About The Pull Request

On a downstream, we have an antagonist, that is a less competent
wizards. This antagonist's preview outfit has a beer bottle in their
hand, which has caused runtimes, as the bottle did not have any reagents
instantiated, and it tried check its length for sloshing. After putting
in a check for the `initial` argument of `on_equip`, I have noticed that
the problem goes deeper: the various procs that handle putting something
in your hand do not pass along if the items is put in your hand as a
preview or not. This PR adds a new optional var to these procs, ensuring
that unwanted behaviour during previews won't trigger.

I also swapped `visualsOnly` to snake case, as it looked inconsistent
with the rest of the code style.
 
## Why It's Good For The Game

Making the argument that ensures avoiding side effects during previews
work with all kinds of items is good.

## Changelog

🆑
fix: if an outfit puts a reagent container in the preview dummy's hand,
it will not try to slosh
code: outfits putting items in your hand will respect the visual_only
argument
/🆑
2024-10-24 15:09:50 +02: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?.current) // 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