Skip to content

Commit

Permalink
caches code + code opt
Browse files Browse the repository at this point in the history
  • Loading branch information
san7890 committed Nov 15, 2023
1 parent 271f91a commit ae6d54e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions code/datums/diseases/parrotpossession.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,21 @@
if(!. || isnull(parrot_controller))
return

if(SPT_PROB(speak_chance, seconds_per_tick) && !isnull(parrot_controller.blackboard[BB_PARROT_REPEAT_STRING])) // I'm not going to dive into polycode trying to adjust that probability. Enjoy doubled ghost parrot speach
affected_mob.say(parrot_controller.blackboard[BB_PARROT_REPEAT_STRING], forced = "parrot possession")
var/potential_phrase = parrot_controller.blackboard[BB_PARROT_REPEAT_STRING]

if(SPT_PROB(speak_chance, seconds_per_tick) && !isnull(potential_phrase)) // I'm not going to dive into polycode trying to adjust that probability. Enjoy doubled ghost parrot speach
affected_mob.say(potential_phrase, forced = "parrot possession")


/datum/disease/parrot_possession/cure()
var/atom/movable/inside_parrot = locate(/mob/living/basic/parrot/poly/ghost) in affected_mob
if(inside_parrot)
UnregisterSignal(inside_parrot, list(COMSIG_PREQDELETED, COMSIG_MOVABLE_MOVED))
inside_parrot.forceMove(affected_mob.drop_location())
affected_mob.visible_message(span_danger("[inside_parrot] is violently driven out of [affected_mob]!"), span_userdanger("[inside_parrot] bursts out of your chest!"))
affected_mob.visible_message(
span_danger("[inside_parrot] is violently driven out of [affected_mob]!"),
span_userdanger("[inside_parrot] bursts out of your chest!"),
)
parrot_controller = null
return ..()

Expand Down

0 comments on commit ae6d54e

Please sign in to comment.