From 995352b81869b867e2c316b49ed7e386d24c3983 Mon Sep 17 00:00:00 2001 From: Incoming Date: Wed, 3 Feb 2016 21:37:50 -0500 Subject: [PATCH 1/3] Poly will now speak a line or emote when pet. Poly is now much more likely to drop a line from active recall after saying a line. This doesn't actually impact how often poly says something, just how stale his "short term memory" is. Keep in mind that due to the wonders of saycode the line poly drops isn't the same necessarily as the one he said, so the "poly might say this line twice" factor is still higher than the 20% this pull implies. Also this mechanic means it's entirely possible to have roundstart lines be dropped having never been said. speak_chance is now a proper percentage chance, before it was actually out of 200 for some strange reason. Animals with high speak chances have had their chance halved to preserve their level of chatter (except for poly). Poly will now keep track of if he died last round and how many rounds in a row he's lived. While he's building on his record he'll have a few special lines he might say at some point near the beginning of the round and also talks FAR more often (to be annoying). Adds a dumb monty python joke to dead parrots because we literally don't have any --- code/modules/events/brand_intelligence.dm | 2 +- .../mob/living/simple_animal/hostile/mimic.dm | 2 +- .../simple_animal/hostile/nanotrasen.dm | 2 +- .../mob/living/simple_animal/parrot.dm | 35 ++++++++++++++++--- .../mob/living/simple_animal/simple_animal.dm | 4 +-- 5 files changed, 35 insertions(+), 10 deletions(-) diff --git a/code/modules/events/brand_intelligence.dm b/code/modules/events/brand_intelligence.dm index fa90c819a4f..1ebb7ed4c08 100644 --- a/code/modules/events/brand_intelligence.dm +++ b/code/modules/events/brand_intelligence.dm @@ -53,7 +53,7 @@ var/mob/living/simple_animal/hostile/mimic/copy/M = new(upriser.loc, upriser, null, 1) // it will delete upriser on creation and override any machine checks M.faction = list("profit") M.speak = rampant_speeches.Copy() - M.speak_chance = 15 + M.speak_chance = 7 else explosion(upriser.loc, -1, 1, 2, 4, 0) qdel(upriser) diff --git a/code/modules/mob/living/simple_animal/hostile/mimic.dm b/code/modules/mob/living/simple_animal/hostile/mimic.dm index d0074b8c182..881f8877f84 100644 --- a/code/modules/mob/living/simple_animal/hostile/mimic.dm +++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm @@ -193,7 +193,7 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca /mob/living/simple_animal/hostile/mimic/copy/machine speak = list("HUMANS ARE IMPERFECT!", "YOU SHALL BE ASSIMILATED!", "YOU ARE HARMING YOURSELF", "You have been deemed hazardous. Will you comply?", \ "My logic is undeniable.", "One of us.", "FLESH IS WEAK", "THIS ISN'T WAR, THIS IS EXTERMINATION!") - speak_chance = 15 + speak_chance = 7 /mob/living/simple_animal/hostile/mimic/copy/machine/CanAttack(atom/the_target) if(the_target == creator) // Don't attack our creator AI. diff --git a/code/modules/mob/living/simple_animal/hostile/nanotrasen.dm b/code/modules/mob/living/simple_animal/hostile/nanotrasen.dm index 7d75f4a747e..aaaca9a4a95 100644 --- a/code/modules/mob/living/simple_animal/hostile/nanotrasen.dm +++ b/code/modules/mob/living/simple_animal/hostile/nanotrasen.dm @@ -5,7 +5,7 @@ icon_living = "nanotrasen" icon_dead = null icon_gib = "syndicate_gib" - speak_chance = 25 + speak_chance = 12 turns_per_move = 5 response_help = "pokes" response_disarm = "shoves" diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index 5c0ea87f354..14099d51096 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -116,6 +116,11 @@ /mob/living/simple_animal/parrot/proc/perch_mob_player) +/mob/living/simple_animal/parrot/examine(mob/user) + ..() + if(stat) + user << pick("This parrot is no more", " This is a late parrot", "This is an ex-parrot") + /mob/living/simple_animal/parrot/death(gibbed) if(held_item) held_item.loc = src.loc @@ -285,6 +290,8 @@ else parrot_state |= PARROT_FLEE //Otherwise, fly like a bat out of hell! drop_held_item(0) + if(!stat && M.a_intent == "help") + handle_automated_speech(1) //assured speak/emote return /mob/living/simple_animal/parrot/attack_paw(mob/living/carbon/monkey/M) @@ -364,11 +371,10 @@ //-----SPEECH /* Parrot speech mimickry! Phrases that the parrot Hear()s get added to speach_buffer. - Every once in a while, the parrot picks one of the lines from the buffer and replaces an element of the 'speech' list. - Then it clears the buffer to make sure they dont magically remember something from hours ago. */ + Every once in a while, the parrot picks one of the lines from the buffer and replaces an element of the 'speech' list. */ /mob/living/simple_animal/parrot/handle_automated_speech() ..() - if(speech_buffer.len && prob(10)) + if(speech_buffer.len && prob(80)) //shuffle out a phrase and add in a new one if(speak.len) speak.Remove(pick(speak)) @@ -858,11 +864,20 @@ gold_core_spawnable = 0 speak_chance = 3 var/memory_saved = 0 + var/rounds_survived = 0 + var/longest_survival = 0 /mob/living/simple_animal/parrot/Poly/New() ears = new /obj/item/device/radio/headset/headset_eng(src) available_channels = list(":e") Read_Memory() + if(rounds_survived == longest_survival) + speak += pick("...[longest_survival].", "The things I've seen!", "I have lived many lives!", "What are you before me?") + speak_chance = 20 //His hubris has made him more annoying/easier to justify killing + else if(rounds_survived > 0) + speak += pick("...again?", "No, It was over!", "Let me out!", "It never ends!") + else + speak += pick("...alive?", "This isn't parrot heaven!", "I live, I die, I live again!", "The void fades!") ..() /mob/living/simple_animal/parrot/Poly/Life() @@ -876,11 +891,21 @@ /mob/living/simple_animal/parrot/Poly/proc/Read_Memory() var/savefile/S = new /savefile("data/npc_saves/Poly.sav") - S["phrases"] >> speech_buffer + S["phrases"] >> speech_buffer + S["rounds survived"] >> rounds_survived + S["longest survival"] >> longest_survival + if(isnull(speech_buffer)) speech_buffer = list() /mob/living/simple_animal/parrot/Poly/proc/Write_Memory() var/savefile/S = new /savefile("data/npc_saves/Poly.sav") - S["phrases"] << speech_buffer + S["phrases"] << speech_buffer + if(health > 0) + S["rounds survived"] << rounds_survived + 1 + if(rounds_survived == longest_survival) + S["longest survival"] << longest_survival + 1 + else + S["rounds survived"] << 0 + memory_saved = 1 \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 3adcb7749a1..64082042ac8 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -148,9 +148,9 @@ turns_since_move = 0 return 1 -/mob/living/simple_animal/proc/handle_automated_speech() +/mob/living/simple_animal/proc/handle_automated_speech(var/override) if(speak_chance) - if(rand(0,200) < speak_chance) + if(rand(0,100) < speak_chance || override) if(speak && speak.len) if((emote_hear && emote_hear.len) || (emote_see && emote_see.len)) var/length = speak.len From 7939d069dc9e8e427b4f5e2ef9aec03f8312f534 Mon Sep 17 00:00:00 2001 From: Incoming Date: Sat, 6 Feb 2016 18:50:23 -0500 Subject: [PATCH 2/3] Feeding poly crackers (existing mechanic) will now boost his speak chance permanently Some arbitrary renaming of the new savefile vars makes what was essentially a prob call a prob call. --- code/modules/mob/living/simple_animal/parrot.dm | 11 ++++++----- .../modules/mob/living/simple_animal/simple_animal.dm | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index 14099d51096..b6fe7bbc863 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -335,6 +335,7 @@ user.drop_item() if(health < maxHealth) adjustBruteLoss(-10) + speak_chance *= 2 user << "[src] eagerly devours the cracker." ..() return @@ -892,8 +893,8 @@ /mob/living/simple_animal/parrot/Poly/proc/Read_Memory() var/savefile/S = new /savefile("data/npc_saves/Poly.sav") S["phrases"] >> speech_buffer - S["rounds survived"] >> rounds_survived - S["longest survival"] >> longest_survival + S["rounds_survived"] >> rounds_survived + S["longest_survival"] >> longest_survival if(isnull(speech_buffer)) speech_buffer = list() @@ -902,10 +903,10 @@ var/savefile/S = new /savefile("data/npc_saves/Poly.sav") S["phrases"] << speech_buffer if(health > 0) - S["rounds survived"] << rounds_survived + 1 + S["rounds_survived"] << rounds_survived + 1 if(rounds_survived == longest_survival) - S["longest survival"] << longest_survival + 1 + S["longest_survival"] << longest_survival + 1 else - S["rounds survived"] << 0 + S["rounds_survived"] << 0 memory_saved = 1 \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 64082042ac8..8a663215044 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -150,7 +150,7 @@ /mob/living/simple_animal/proc/handle_automated_speech(var/override) if(speak_chance) - if(rand(0,100) < speak_chance || override) + if(prob(speak_chance) || override) if(speak && speak.len) if((emote_hear && emote_hear.len) || (emote_see && emote_see.len)) var/length = speak.len From b897507e73438181573bfb90cdf725feea493ac4 Mon Sep 17 00:00:00 2001 From: Incoming5643 Date: Sat, 6 Feb 2016 18:53:27 -0500 Subject: [PATCH 3/3] Roll back the shuffle chance for the speech buffer I wasn't aware this code ran every life tick! --- code/modules/mob/living/simple_animal/parrot.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index b6fe7bbc863..402517cc932 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -375,7 +375,7 @@ Every once in a while, the parrot picks one of the lines from the buffer and replaces an element of the 'speech' list. */ /mob/living/simple_animal/parrot/handle_automated_speech() ..() - if(speech_buffer.len && prob(80)) //shuffle out a phrase and add in a new one + if(speech_buffer.len && prob(20)) //shuffle out a phrase and add in a new one if(speak.len) speak.Remove(pick(speak)) @@ -909,4 +909,4 @@ else S["rounds_survived"] << 0 - memory_saved = 1 \ No newline at end of file + memory_saved = 1