mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
Adds ghost visible countdowns for bombs
🆑 coiax rscadd: For extra observer drama, ghosts can now visibly see the countdown of various explosives. /🆑 - Also updates my build script to take account of the move of dm.sh
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
var/beepsound = 'sound/items/timer.ogg'
|
||||
var/delayedbig = FALSE //delay wire pulsed?
|
||||
var/delayedlittle = FALSE //activation wire pulsed?
|
||||
var/obj/effect/countdown/syndicatebomb/countdown
|
||||
|
||||
/obj/machinery/syndicatebomb/process()
|
||||
if(active && !defused && (timer > 0)) //Tick Tock
|
||||
@@ -41,6 +42,7 @@
|
||||
if(src.payload)
|
||||
payload = new payload(src)
|
||||
update_icon()
|
||||
countdown = new(src)
|
||||
..()
|
||||
|
||||
/obj/machinery/syndicatebomb/Destroy()
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/obj/effect/countdown
|
||||
name = "countdown"
|
||||
desc = "We're leaving together\n\
|
||||
But still it's farewell\n\
|
||||
And maybe we'll come back\n\
|
||||
To earth, who can tell?"
|
||||
|
||||
var/last_displayed
|
||||
var/atom/attached_to
|
||||
var/text_color = "#ff0000"
|
||||
invisibility = INVISIBILITY_OBSERVER
|
||||
layer = GHOST_LAYER
|
||||
alpha = 100
|
||||
|
||||
/obj/effect/countdown/New(atom/A)
|
||||
. = ..()
|
||||
attach(A)
|
||||
|
||||
/obj/effect/countdown/proc/attach(atom/A)
|
||||
attached_to = A
|
||||
loc = get_turf(A)
|
||||
SSfastprocess.processing |= src
|
||||
|
||||
/obj/effect/countdown/proc/get_value()
|
||||
// Get the value from our atom
|
||||
return
|
||||
|
||||
/obj/effect/countdown/process()
|
||||
if(!attached_to || qdeleted(attached_to))
|
||||
qdel(src)
|
||||
var/new_val = get_value()
|
||||
if(new_val == last_displayed)
|
||||
return
|
||||
last_displayed = new_val
|
||||
if(new_val)
|
||||
var/image/text_image = new(loc = src)
|
||||
text_image.maptext = "<font size=4>[new_val]</font>"
|
||||
text_image.color = text_color
|
||||
|
||||
overlays.Cut()
|
||||
overlays += text_image
|
||||
else
|
||||
overlays.Cut()
|
||||
|
||||
/obj/effect/countdown/Destroy()
|
||||
attached_to = null
|
||||
SSfastprocess.processing -= src
|
||||
. = ..()
|
||||
|
||||
/obj/effect/countdown/syndicatebomb/get_value()
|
||||
var/obj/machinery/syndicatebomb/S = attached_to
|
||||
if(!istype(S))
|
||||
return
|
||||
else if(S.active)
|
||||
return S.timer
|
||||
@@ -1022,6 +1022,7 @@
|
||||
#include "code\modules\clothing\under\jobs\engineering.dm"
|
||||
#include "code\modules\clothing\under\jobs\medsci.dm"
|
||||
#include "code\modules\clothing\under\jobs\security.dm"
|
||||
#include "code\modules\countdown\countdown.dm"
|
||||
#include "code\modules\crafting\craft.dm"
|
||||
#include "code\modules\crafting\guncrafting.dm"
|
||||
#include "code\modules\crafting\recipes.dm"
|
||||
|
||||
@@ -31,7 +31,7 @@ def stage2(map):
|
||||
txt = "-M{}".format(map)
|
||||
else:
|
||||
txt = ''
|
||||
args = "bash dm.sh {} tgstation.dme".format(txt)
|
||||
args = "bash tools/travis/dm.sh {} tgstation.dme".format(txt)
|
||||
print(args)
|
||||
p = subprocess.Popen(args, shell=True)
|
||||
wait(p)
|
||||
|
||||
Reference in New Issue
Block a user