Skip to content

Commit

Permalink
Chorus womb fix (#12)
Browse files Browse the repository at this point in the history
* Chorus Spawner Activation Checks Added

Checks Parent Activation Conditions before Checking ghosts as part of child Activation Conditions

* Streamlined Womb Operation

* Removed a Now Redundant Proc

Co-authored-by: Tim <[email protected]>
  • Loading branch information
That0nePerson and DatBoiTim committed Feb 18, 2022
1 parent 184d09d commit 7c55f34
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions code/modules/mob/living/carbon/alien/chorus/buildings/generic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -109,28 +109,28 @@
to_chat(C, SPAN_WARNING("You extend \the [src] [extend_text]."))
a.visible_message(SPAN_DANGER("\The [a] [growth_verb] [through_text]!"))


/obj/structure/chorus/spawner/can_activate()
return TRUE
//Checks for base activation conditions before spawner specifics. Why? Because there's a massive global list of various mobs being iterated through, to check that there's even eligible ghosts.
//This proc used to just outright return TRUE for whatever reason.
/obj/structure/chorus/spawner/can_activate(var/mob/living/carbon/alien/chorus/C, var/warning = TRUE)
if(..())
for(var/mob/observer/ghost/ghost in GLOB.player_list) //No player ghost GLOB :(
if(MODE_DEITY in ghost.client.prefs.be_special_role)
return TRUE

/obj/structure/chorus/spawner/activate()
for(var/mob/observer/ghost/ghost in GLOB.player_list)
if(MODE_DEITY in ghost.client.prefs.be_special_role)
to_chat(ghost, SPAN_NOTICE("A chorus spawn is available! <a href='?src=\ref[src];jump=1'>(Jump)</a>"))

/obj/structure/chorus/spawner/OnTopic(user, href_list)
if(href_list["jump"] && istype(user,/mob/observer/ghost))
var/mob/M = user
M.forceMove(get_turf(src))
return TOPIC_HANDLED
to_chat(ghost, SPAN_NOTICE("A chorus spawn is available! (<a href='?src=\ref[src]'>(Join)</a>)"))

/obj/structure/chorus/spawner/OnTopic(var/mob/user, href_list)
if(href_list["src"] && istype(user,/mob/observer/ghost))
if(GLOB.chorus.can_become_antag(user.mind))
if(!owner.use_resource(activation_cost_resource, activation_cost_amount))
var/datum/chorus_resource/resource = owner.get_resource(activation_cost_resource)
to_chat(user, SPAN_WARNING("\The [src] needs [activation_cost_amount - resource.amount] more [resource.name] in order to spawn."))
return
announce_ghost_joinleave(user, 0, "They have joined a chorus")
var/mob/living/carbon/alien/chorus/sac = new(get_turf(src), owner)
sac.ckey = user.ckey
return TOPIC_HANDLED
. = ..()

/obj/structure/chorus/spawner/attack_ghost(var/mob/observer/ghost/user)
if(GLOB.chorus.can_become_antag(user.mind))
if(!owner.use_resource(activation_cost_resource, activation_cost_amount))
var/datum/chorus_resource/resource = owner.get_resource(activation_cost_resource)
to_chat(user, SPAN_WARNING("\The [src] needs [activation_cost_amount - resource.amount] more [resource.name] in order to spawn."))
return
announce_ghost_joinleave(user, 0, "They have joined a chorus")
var/mob/living/carbon/alien/chorus/sac = new(get_turf(src), owner)
sac.ckey = user.ckey

0 comments on commit 7c55f34

Please sign in to comment.