From 7939d069dc9e8e427b4f5e2ef9aec03f8312f534 Mon Sep 17 00:00:00 2001 From: Incoming Date: Sat, 6 Feb 2016 18:50:23 -0500 Subject: [PATCH] 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