diff --git a/code/datums/diseases/parrotpossession.dm b/code/datums/diseases/parrotpossession.dm new file mode 100644 index 00000000000..0df7e0f7d37 --- /dev/null +++ b/code/datums/diseases/parrotpossession.dm @@ -0,0 +1,27 @@ +/datum/disease/parrot_possession + name = "Parrot Possession" + max_stages = 1 + spread_text = "Paranormal" + spread_flags = SPECIAL + disease_flags = CURABLE + cure_text = "Holy Water." + cures = list("holywater") + cure_chance = 20 + agent = "Avian Vengence" + viable_mobtypes = list(/mob/living/carbon/human) + desc = "Subject is possesed by the vengeful spirit of a parrot. Call the priest." + severity = MEDIUM + var/mob/living/simple_animal/parrot/Poly/ghost/parrot + +/datum/disease/parrot_possession/stage_act() + ..() + if(!parrot || parrot.loc != affected_mob) + cure() + else if(prob(parrot.speak_chance)) + affected_mob.say(pick(parrot.speech_buffer)) + +/datum/disease/parrot_possession/cure() + if(parrot && parrot.loc == affected_mob) + parrot.loc = affected_mob.loc + affected_mob.visible_message("[parrot] is violently driven out of [affected_mob]!", "[parrot] bursts out of your chest!") + ..() \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index dc9793ae3ab..23455487021 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -34,6 +34,8 @@ icon_living = "parrot_fly" icon_dead = "parrot_dead" density = 0 + health = 80 + maxHealth = 80 pass_flags = PASSTABLE | PASSMOB speak = list("Hi!","Hello!","Cracker?","BAWWWWK george mellons griffing me!") @@ -148,6 +150,8 @@ if(speech_buffer.len >= 500) speech_buffer -= pick(speech_buffer) speech_buffer |= html_decode(raw_message) + if(speaker == src && !client) //If a parrot squawks in the woods and no one is around to hear it, does it make a sound? This code says yes! + return message ..() /mob/living/simple_animal/parrot/radio(message, message_mode, list/spans) //literally copied from human/radio(), but there's no other way to do this. at least it's better than it used to be. @@ -286,7 +290,7 @@ parrot_interest = M parrot_state = PARROT_SWOOP //The parrot just got hit, it WILL move, now to pick a direction.. - if(M.health < 50) //Weakened mob? Fight back! + if(health > 30) //Let's get in there and squawk it up! parrot_state |= PARROT_ATTACK else parrot_state |= PARROT_FLEE //Otherwise, fly like a bat out of hell! @@ -325,8 +329,8 @@ parrot_interest = user parrot_state = PARROT_SWOOP - if (user.health < 50) - parrot_state |= PARROT_ATTACK //weakened mob? fight back! + if(health > 30) //Let's get in there and squawk it up! + parrot_state |= PARROT_ATTACK else parrot_state |= PARROT_FLEE icon_state = "parrot_fly" @@ -902,7 +906,7 @@ /mob/living/simple_animal/parrot/Poly/death(gibbed) if(!memory_saved) var/go_ghost = 0 - if(rounds_survived == longest_survival || rounds_survived == longest_deathstreak) + if(rounds_survived == longest_survival || rounds_survived == longest_deathstreak || prob(0.666)) go_ghost = 1 rounds_survived = min(--rounds_survived,0) if(rounds_survived < longest_deathstreak) @@ -948,7 +952,26 @@ memory_saved = 1 //At this point nothing is saved ..() +/mob/living/simple_animal/parrot/Poly/ghost/handle_automated_speech() + if(ismob(loc)) + return + ..() + /mob/living/simple_animal/parrot/Poly/ghost/handle_automated_movement() if(isliving(parrot_interest)) - parrot_interest = null + if(!ishuman(parrot_interest)) + parrot_interest = null + else if(parrot_state == (PARROT_SWOOP | PARROT_ATTACK) && Adjacent(parrot_interest)) + walk_to(src, parrot_interest, 0, parrot_speed) + Possess(parrot_interest) ..() + +/mob/living/simple_animal/parrot/Poly/ghost/proc/Possess(mob/living/carbon/human/H) + if(!ishuman(H)) + return + var/datum/disease/parrot_possession/P = new + P.parrot = src + loc = H + H.ContractDisease(P) + parrot_interest = null + H.visible_message("[src] dive bombs into [H]'s chest and vanishes!", "[src] dive bombs into your chest, vanishing! This can't be good!") \ No newline at end of file diff --git a/tgstation.dme b/tgstation.dme index e0c5eccf5b3..9d741eeb317 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -195,6 +195,7 @@ #include "code\datums\diseases\fluspanish.dm" #include "code\datums\diseases\gbs.dm" #include "code\datums\diseases\magnitis.dm" +#include "code\datums\diseases\parrotpossession.dm" #include "code\datums\diseases\pierrot_throat.dm" #include "code\datums\diseases\retrovirus.dm" #include "code\datums\diseases\rhumba_beat.dm"