From c97b1d4ea489ef716b86b42d98073e5a92aaa7ee Mon Sep 17 00:00:00 2001 From: DelZeta Date: Thu, 20 Aug 2015 01:14:41 -0700 Subject: [PATCH 1/4] Fixes permahallucinations. --- code/modules/mob/living/carbon/human/life.dm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index ac8848dcb1c..ea570e42e12 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -963,6 +963,11 @@ spawn(rand(20,50)) if(C) C.dir = 1 + if(hallucination <= 2) + hallucination = 0 + halloss = 0 + else + hallucination -= 2 else for(var/atom/a in hallucinations) From 81ccf07d809d980e1bf16eef3098314840b159ca Mon Sep 17 00:00:00 2001 From: DelZeta Date: Thu, 20 Aug 2015 02:26:46 -0700 Subject: [PATCH 2/4] Halloss now decays naturally after hallucinations, to avoid edge cases with other sources. --- code/modules/mob/living/carbon/human/life.dm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index ea570e42e12..631be0d51ab 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -963,12 +963,9 @@ spawn(rand(20,50)) if(C) C.dir = 1 - if(hallucination <= 2) + hallucination -= 2 + if(hallucination < 0) hallucination = 0 - halloss = 0 - else - hallucination -= 2 - else for(var/atom/a in hallucinations) qdel(a) From 3baa60465e1fd3cadf96e3514779566aaaf76c19 Mon Sep 17 00:00:00 2001 From: DelZeta Date: Thu, 20 Aug 2015 08:44:32 -0700 Subject: [PATCH 3/4] Removes duplicate hallucination code. --- code/modules/mob/living/carbon/human/life.dm | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 631be0d51ab..4ca19fa57ba 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -951,18 +951,6 @@ spawn(rand(20,50)) client.dir = 1 - if(hallucination) - if(hallucination >= 20) - if(prob(3)) - fake_attack(src) - if(!handling_hal) - spawn handle_hallucinations() //The not boring kind! - if(client && prob(5)) - client.dir = pick(2,4,8) - var/client/C = client - spawn(rand(20,50)) - if(C) - C.dir = 1 hallucination -= 2 if(hallucination < 0) hallucination = 0 From 54dd93997de3a79790bc60e9e47fc6c1df0b9f2c Mon Sep 17 00:00:00 2001 From: DelZeta Date: Thu, 20 Aug 2015 20:24:15 -0700 Subject: [PATCH 4/4] Useful procs are useful. --- code/modules/mob/living/carbon/human/life.dm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 4ca19fa57ba..0cadf6ddff0 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -951,9 +951,7 @@ spawn(rand(20,50)) client.dir = 1 - hallucination -= 2 - if(hallucination < 0) - hallucination = 0 + hallucination = max(0, hallucination - 2) else for(var/atom/a in hallucinations) qdel(a)