From 0a2a9362feb0dd3d4470aebe2564d76d66325eac Mon Sep 17 00:00:00 2001 From: "baloh.matevz" Date: Mon, 29 Oct 2012 19:14:51 +0000 Subject: [PATCH] - Added a speach_probability variable to parrots, which starts out at 10. It decreases over time, meaning that while it's speach chance is initially prob(10) in each life cycle, as soon as it succeeds, it will be prob(9) and so on, until it eventually gets to prob(1). In effect this reduces the amount of Poly spam. - Increased the time between vending machine adverts from 60s to 600s = 10 minutes. In addition, I set it so a newly created vending machine assigns a random time for it's first message to be displayed to ensure that all vending machines don't say their message at the same time. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4981 316c924e-a436-60f5-8080-3fe189b3f50e --- code/defines/obj/vending.dm | 2 +- code/game/machinery/vending.dm | 3 +++ code/modules/mob/living/simple_animal/parrot.dm | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/code/defines/obj/vending.dm b/code/defines/obj/vending.dm index 3ba1f106b9c..7ac52ee11ed 100644 --- a/code/defines/obj/vending.dm +++ b/code/defines/obj/vending.dm @@ -25,7 +25,7 @@ var/vend_reply //Thank you for shopping! var/last_reply = 0 var/last_slogan = 0 //When did we last pitch? - var/slogan_delay = 600 //How long until we can pitch again? + var/slogan_delay = 6000 //How long until we can pitch again? var/icon_vend //Icon_state when vending! var/icon_deny //Icon_state when vending! //var/emagged = 0 //Ignores if somebody doesn't have card access to that machine. diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 66f72ca4ffc..f133ecc0101 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -20,6 +20,9 @@ var/list/temp_hideamt = text2list(src.product_hideamt, ";") var/list/temp_coin = text2list(src.product_coin, ";") var/list/temp_coin_amt = text2list(src.product_coin_amt, ";") + + src.last_slogan = world.time + rand(0, slogan_delay) //So not all machines speak at the exact same time. The first time this machine says something will be at slogantime + this random value, so if slogantime is 10 minutes, it will say it at somewhere between 10 and 20 minutes after the machine is crated. + //Little sanity check here if ((isnull(temp_paths)) || (isnull(temp_amounts)) || (temp_paths.len != temp_amounts.len) || (temp_hidden.len != temp_hideamt.len)) stat |= BROKEN diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index 5938d96ef31..74507f21406 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -56,6 +56,7 @@ var/parrot_speed = 5 //"Delay in world ticks between movement." Yeah, that's BS but it does directly affect movement. Higher number = slower. var/parrot_been_shot = 0 //Parrots get a speed bonus after being shot. This will deincrement every Life() and at 0 the parrot will return to regular speed. + var/speach_probability = 10 //This means it has a 10% chance of speaking the first time, each time it speaks, this is reduced by 1, eventually becoming prob(1) per life tick. var/list/speech_buffer = list() var/list/available_channels = list() @@ -299,12 +300,13 @@ Phrases that the parrot hears in mob/living/say() 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. */ - if(speech_buffer.len && prob(10)) + if(speech_buffer.len && prob(speach_probability)) if(speak.len) speak.Remove(pick(speak)) speak.Add(pick(speech_buffer)) clearlist(speech_buffer) + speach_probability = max(1, speach_probability-1) //This ensures that the amount of parrot spam reduces over time, as each time it speaks, the chance of it speaking again is reduced by 1, eventually reaching a prob(1)