From e44dcc035c2f7fa7d752cfb4a05cd9d16c316fc8 Mon Sep 17 00:00:00 2001 From: tralezab <40974010+tralezab@users.noreply.github.com> Date: Tue, 22 Sep 2020 16:50:26 -0700 Subject: [PATCH] Flower Buds now have a countdown for ghosts for when they're going to hatch (#53648) They're two minute timers with no indication, which makes kudzu kinda annoying to spectate. --- code/game/objects/effects/countdown.dm | 12 ++++++++++++ .../living/simple_animal/hostile/venus_human_trap.dm | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/code/game/objects/effects/countdown.dm b/code/game/objects/effects/countdown.dm index c5575b5f7c3..eeae13dbe7d 100644 --- a/code/game/objects/effects/countdown.dm +++ b/code/game/objects/effects/countdown.dm @@ -157,3 +157,15 @@ var/obj/machinery/computer/arena/C = A.get_controller() var/time_left = max(0, (C.start_time - world.time) / 10) return round(time_left) + +/obj/effect/countdown/flower_bud + name = "flower bud countdown" + +/obj/effect/countdown/flower_bud/get_value() + var/obj/structure/alien/resin/flower_bud_enemy/bud = attached_to + if(!istype(bud)) + return + if(!bud.finish_time) + return -1 + var/time_left = max(0, (bud.finish_time - world.time) / 10) + return time_left diff --git a/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm b/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm index 405e9da2dad..cec82b48642 100644 --- a/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm +++ b/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm @@ -19,9 +19,14 @@ smoothing_flags = NONE /// The amount of time it takes to create a venus human trap. var/growth_time = 120 SECONDS + /// Used by countdown to check time, this is when the timer will complete and the venus trap will spawn. + var/finish_time + /// The countdown ghosts see to when the plant will hatch + var/obj/effect/countdown/flower_bud/countdown /obj/structure/alien/resin/flower_bud_enemy/Initialize() . = ..() + countdown = new(src) var/list/anchors = list() anchors += locate(x-2,y+2,z) anchors += locate(x+2,y+2,z) @@ -31,7 +36,9 @@ for(var/turf/T in anchors) var/datum/beam/B = Beam(T, "vine", time=INFINITY, maxdistance=5, beam_type=/obj/effect/ebeam/vine) B.sleep_time = 10 //these shouldn't move, so let's slow down updates to 1 second (any slower and the deletion of the vines would be too slow) + finish_time = world.time + growth_time addtimer(CALLBACK(src, .proc/bear_fruit), growth_time) + countdown.start() /** * Spawns a venus human trap, then qdels itself.