[READY] Venus human trap fix 3.0: Allow ghosts to possess them even when obscured, use better spawning system (#67418)

Moves venus human traps to use the /obj/effect/mob_spawn/ghost_role/ system of spawning similar to things like spiders. Effects of this include: Having a notification to ghosts when one is ready to be spawned, having venus human traps respect role bans, and allowing them to be possessed from the ghost role menu.
Also adds poll ignore and role defines for venus human traps.

To clarify in more detail: Venus human traps spawn by flowering kudzu (with a 10% chance). However, they spawn immediately under the kudzu and can't be clicked on (even with the alt-click menu), so they can only be possessed by a ghost only if the kudzu above them gets destroyed or they get moved out of the kudzu.
Instead of just fiddling around with layers, moving venus human traps to the same ghost role system used by other ghost roles helps centralize them and make it more obvious that a) you can possess them to begin with, and b) how to possess them
This commit is contained in:
RandomGamer123
2022-07-21 02:22:14 -07:00
committed by GitHub
parent 967e80a37c
commit 32e84471a9
7 changed files with 80 additions and 41 deletions
@@ -0,0 +1,54 @@
/// Handles logic for ghost spawning code, visible object in game is handled by /obj/structure/alien/resin/flower_bud
/obj/effect/mob_spawn/ghost_role/venus_human_trap
name = "flower bud"
desc = "A large pulsating plant..."
icon = 'icons/effects/spacevines.dmi'
icon_state = "bud0"
mob_type = /mob/living/simple_animal/hostile/venus_human_trap
prompt_name = "venus human trap"
you_are_text = "You are a venus human trap."
flavour_text = "You are a venus human trap! Protect the kudzu at all costs, and feast on those who oppose you!"
faction = list("hostile","vines","plants")
spawner_job_path = /datum/job/venus_human_trap
/// Physical structure housing the spawner
var/obj/structure/alien/resin/flower_bud/flower_bud
/// Used to determine when to notify ghosts
var/ready = FALSE
/obj/effect/mob_spawn/ghost_role/venus_human_trap/Destroy()
if(flower_bud) // anti harddel checks
if(!QDELETED(flower_bud))
qdel(flower_bud)
flower_bud = null
return ..()
/obj/effect/mob_spawn/ghost_role/venus_human_trap/equip(mob/living/simple_animal/hostile/venus_human_trap/spawned_human_trap)
if(spawned_human_trap && flower_bud)
if(flower_bud.trait_flags & SPACEVINE_HEAT_RESISTANT)
spawned_human_trap.unsuitable_heat_damage = 0
if(flower_bud.trait_flags & SPACEVINE_COLD_RESISTANT)
spawned_human_trap.unsuitable_cold_damage = 0
/// Called when the attached flower bud has borne fruit (ie. is ready)
/obj/effect/mob_spawn/ghost_role/venus_human_trap/proc/bear_fruit()
ready = TRUE
notify_ghosts("[src] has borne fruit!", null, enter_link = "<a href=?src=[REF(src)];activate=1>(Click to play)</a>", source = src, action = NOTIFY_ATTACK, ignore_key = POLL_IGNORE_VENUSHUMANTRAP)
/obj/effect/mob_spawn/ghost_role/venus_human_trap/Topic(href, href_list)
. = ..()
if(.)
return
if(href_list["activate"])
var/mob/dead/observer/ghost = usr
if(istype(ghost))
ghost.ManualFollow(src)
attack_ghost(ghost)
/obj/effect/mob_spawn/ghost_role/venus_human_trap/allow_spawn(mob/user, silent = FALSE)
. = ..()
if(!.)
return FALSE
if(!ready)
if(!silent)
to_chat(user, span_warning("\The [src] has not borne fruit yet!"))
return FALSE