[MIRROR] Bluespace Golems can no longer spam teleport [MDB IGNORE] (#12795)

* Bluespace Golems can no longer spam teleport (#66195)

Co-authored-by: Kylerace <kylerlumpkin1@ gmail.com>

* Bluespace Golems can no longer spam teleport

Co-authored-by: Alex Pynnonen <alexpynnonen01@gmail.com>
Co-authored-by: Kylerace <kylerlumpkin1@ gmail.com>
This commit is contained in:
SkyratBot
2022-04-16 01:57:53 +02:00
committed by GitHub
parent 902f085920
commit c6b3d33b02
@@ -551,18 +551,22 @@
icon_icon = 'icons/mob/actions/actions_spells.dmi'
var/cooldown = 150
var/last_teleport = 0
///Set to true upon action activation to prevent spamming teleport callbacks while the first is still occurring.
var/is_charging = FALSE
/datum/action/innate/unstable_teleport/IsAvailable()
. = ..()
if(!.)
return
if(world.time > last_teleport + cooldown)
if(world.time > last_teleport + cooldown && !is_charging)
return TRUE
return FALSE
/datum/action/innate/unstable_teleport/Activate()
var/mob/living/carbon/human/H = owner
H.visible_message(span_warning("[H] starts vibrating!"), span_danger("You start charging your bluespace core..."))
is_charging = TRUE
UpdateButtons() //action icon looks unavailable
playsound(get_turf(H), 'sound/weapons/flash.ogg', 25, TRUE)
addtimer(CALLBACK(src, .proc/teleport, H), 15)
@@ -574,9 +578,8 @@
spark_system.start()
do_teleport(H, get_turf(H), 12, asoundin = 'sound/weapons/emitter2.ogg', channel = TELEPORT_CHANNEL_BLUESPACE)
last_teleport = world.time
UpdateButtons() //action icon looks unavailable
//action icon looks available again
addtimer(CALLBACK(src, .proc/UpdateButtons), cooldown + 5)
is_charging = FALSE
addtimer(CALLBACK(src, .proc/UpdateButtons), cooldown + 5) //action icon looks available again
//honk