Combo streaks (not just the hud icons) now reset after half a dozen seconds (amount subject to change). (#57167)

Co-authored-by: Ghommie <425422238+Ghommie@users.noreply.github.com>
This commit is contained in:
Ghom
2021-02-26 00:13:35 -08:00
committed by GitHub
co-authored by Ghommie
parent b62ed6f447
commit 6554334e33
2 changed files with 18 additions and 7 deletions
+8 -3
View File
@@ -742,16 +742,21 @@
var/timerid
/atom/movable/screen/combo/proc/clear_streak()
animate(src, alpha = 0, 2 SECONDS, SINE_EASING)
timerid = addtimer(CALLBACK(src, .proc/reset_icons), 2 SECONDS, TIMER_UNIQUE | TIMER_STOPPABLE)
/atom/movable/screen/combo/proc/reset_icons()
cut_overlays()
icon_state = ""
/atom/movable/screen/combo/update_icon_state(streak = "")
clear_streak()
/atom/movable/screen/combo/update_icon_state(streak = "", time = 2 SECONDS)
reset_icons()
if(timerid)
deltimer(timerid)
alpha = 255
if(!streak)
return ..()
timerid = addtimer(CALLBACK(src, .proc/clear_streak), 20, TIMER_UNIQUE | TIMER_STOPPABLE)
timerid = addtimer(CALLBACK(src, .proc/clear_streak), time, TIMER_UNIQUE | TIMER_STOPPABLE)
icon_state = "combo"
for(var/i = 1; i <= length(streak); ++i)
var/intent_text = copytext(streak, i, i + 1)
+10 -4
View File
@@ -11,6 +11,8 @@
var/smashes_tables = FALSE //If the martial art smashes tables when performing table slams and head smashes
var/datum/weakref/holder //owner of the martial art
var/display_combos = FALSE //shows combo meter if true
var/combo_timer = 6 SECONDS // period of time after which the combo streak is reset.
var/timerid
/datum/martial_art/proc/help_act(mob/living/A, mob/living/D)
return FALSE
@@ -35,13 +37,17 @@
streak = copytext(streak, 1 + length(streak[1]))
if (display_combos)
var/mob/living/holder_living = holder.resolve()
holder_living?.hud_used?.combo_display.update_icon_state(streak)
timerid = addtimer(CALLBACK(src, .proc/reset_streak, null, FALSE), combo_timer, TIMER_UNIQUE | TIMER_STOPPABLE)
holder_living?.hud_used?.combo_display.update_icon_state(streak, combo_timer - 2 SECONDS)
/datum/martial_art/proc/reset_streak(mob/living/new_target)
/datum/martial_art/proc/reset_streak(mob/living/new_target, update_icon = TRUE)
if(timerid)
deltimer(timerid)
current_target = new_target
streak = ""
var/mob/living/holder_living = holder.resolve()
holder_living?.hud_used?.combo_display.update_icon_state(streak)
if(update_icon)
var/mob/living/holder_living = holder?.resolve()
holder_living?.hud_used?.combo_display.update_icon_state(streak)
/datum/martial_art/proc/teach(mob/living/holder_living, make_temporary=FALSE)
if(!istype(holder_living) || !holder_living.mind)