From 4925bfe60a1f3bcd04c8de03bba9304eb1fe426c Mon Sep 17 00:00:00 2001 From: joep van der velden Date: Tue, 27 Oct 2020 20:55:14 +0100 Subject: [PATCH] Floor cluwnes can't get lockered. Open lockers. Don't runtime as often. Limit stage speed increase --- code/__HELPERS/unsorted.dm | 11 +++++++- .../simple_animal/hostile/floorcluwne.dm | 26 ++++++++++++------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 46559eb6b5c..45e8070284e 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -169,7 +169,16 @@ Turf and target are seperate in case you want to teleport some distance from a t ///////////////////////////////////////////////////////////////////////// -/proc/getline(atom/M,atom/N)//Ultra-Fast Bresenham Line-Drawing Algorithm +/** + * Gets the turfs which are between the two given atoms. Including their positions + * Only works for atoms on the same Z level which is not 0. So an atom located in a non turf won't work + * Arguments: + * * M - The source atom + * * N - The target atom + */ +/proc/getline(atom/M, atom/N)//Ultra-Fast Bresenham Line-Drawing Algorithm + if(!M.z || M.z != N.z) // Same Z level and not 0. Else all below breaks + return list() var/px=M.x //starting x var/py=M.y var/line[] = list(locate(px,py,M.z)) diff --git a/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm b/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm index cf55824542a..77fb0cd0c5b 100644 --- a/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm +++ b/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm @@ -15,6 +15,7 @@ health = 200 speed = -1 attacktext = "attacks" + anchored = TRUE attack_sound = 'sound/items/bikehorn.ogg' del_on_death = TRUE pass_flags = PASSTABLE | PASSGRILLE | PASSMOB | LETPASSTHROW | PASSGLASS | PASSBLOB//it's practically a ghost when unmanifested (under the floor) @@ -32,6 +33,7 @@ var/mob/living/carbon/human/current_victim var/manifested = FALSE var/switch_stage = 60 + var/switch_stage_min = 20 var/stage = STAGE_HAUNT var/interest = 0 var/target_area @@ -302,12 +304,12 @@ if(STAGE_ATTACK) if(!eating) - for(var/I in getline(src,H)) + for(var/I in getline(src, get_turf(H))) var/turf/T = I for(var/obj/structure/O in T) if(istype(O, /obj/structure/closet)) var/obj/structure/closet/locker = O - locker.dump_contents() + locker.bust_open() if(O.density || istype(O, /obj/machinery/door/airlock)) forceMove(H.loc) if(T.density) @@ -366,17 +368,12 @@ /mob/living/simple_animal/hostile/floor_cluwne/proc/Kill(mob/living/carbon/human/H) playsound(H, 'sound/spookoween/scary_horn2.ogg', 100, 0) - var/old_color = H.client.color - var/red_splash = list(1,0,0,0.8,0.2,0, 0.8,0,0.2,0.1,0,0) - var/pure_red = list(0,0,0,0,0,0,0,0,0,1,0,0) - H.client.color = pure_red + var/old_color = H.client?.color + client_kill_animation(H) - animate(H.client, color = red_splash, time = 10, easing = SINE_EASING|EASE_OUT) for(var/turf/T in orange(H, 4)) H.add_splatter_floor(T) if(do_after(src, 50, target = H)) - - if(prob(50) || smiting) H.makeCluwne() @@ -400,7 +397,7 @@ eating = FALSE if(prob(2)) - switch_stage = switch_stage * 0.75 //he gets a chance to be faster after each feast + switch_stage = max(switch_stage * 0.75, switch_stage_min) //he gets a chance to be faster after each feast if(smiting) playsound(loc, 'sound/spookoween/scary_horn2.ogg', 100, 0, -4) qdel(src) @@ -409,6 +406,15 @@ interest = 0 +/mob/living/simple_animal/hostile/floor_cluwne/proc/client_kill_animation(mob/living/carbon/human/H) + if(!H.client) + return + var/red_splash = list(1,0,0,0.8,0.2,0, 0.8,0,0.2,0.1,0,0) + var/pure_red = list(0,0,0,0,0,0,0,0,0,1,0,0) + H.client.color = pure_red + + animate(H.client, color = red_splash, time = 10, easing = SINE_EASING|EASE_OUT) + //manifestation animation /obj/effect/temp_visual/fcluwne_manifest icon = 'icons/turf/floors.dmi'