diff --git a/code/datums/status_effects/buffs.dm b/code/datums/status_effects/buffs.dm index 8f3d22c4be8..f41dcfb4448 100644 --- a/code/datums/status_effects/buffs.dm +++ b/code/datums/status_effects/buffs.dm @@ -2,7 +2,7 @@ /datum/status_effect/shadow_mend id = "shadow_mend" - duration = 3 + duration = 30 alert_type = /obj/screen/alert/status_effect/shadow_mend /obj/screen/alert/status_effect/shadow_mend @@ -26,8 +26,8 @@ /datum/status_effect/void_price id = "void_price" - duration = 30 - tick_interval = 3 + duration = 300 + tick_interval = 30 alert_type = /obj/screen/alert/status_effect/void_price /obj/screen/alert/status_effect/void_price @@ -40,11 +40,12 @@ owner.adjustBruteLoss(3) - /datum/status_effect/vanguard_shield id = "vanguard" - duration = 20 + duration = 200 + tick_interval = 0 //tick as fast as possible alert_type = /obj/screen/alert/status_effect/vanguard + var/datum/progressbar/progbar /obj/screen/alert/status_effect/vanguard name = "Vanguard" @@ -60,10 +61,21 @@ desc += "
[vanguard["stuns_absorbed"] * 2] seconds of stuns held back.
[round(min(vanguard["stuns_absorbed"] * 0.25, 20)) * 2] seconds of stun will affect you." ..() +/datum/status_effect/vanguard_shield/Destroy() + qdel(progbar) + progbar = null + return ..() + /datum/status_effect/vanguard_shield/on_apply() add_logs(owner, null, "gained Vanguard stun immunity") owner.add_stun_absorption("vanguard", 200, 1, "'s yellow aura momentarily intensifies!", "Your ward absorbs the stun!", " radiating with a soft yellow light!") owner.visible_message("[owner] begins to faintly glow!", "You will absorb all stuns for the next twenty seconds.") + progbar = new(owner, duration, owner) + progbar.bar.color = list("#FAE48C", "#FAE48C", "#FAE48C", rgb(0,0,0)) + progbar.update(duration - world.time) + +/datum/status_effect/vanguard_shield/tick() + progbar.update(duration - world.time) /datum/status_effect/vanguard_shield/on_remove() var/vanguard = owner.stun_absorption["vanguard"] @@ -85,14 +97,15 @@ message_to_owner += "\nYou faint from the exertion!" stuns_blocked *= 2 owner.Paralyse(stuns_blocked) + else + stuns_blocked = 0 //so logging is correct in cases where there were stuns blocked but we didn't stun for other reasons owner.visible_message("[owner]'s glowing aura fades!", message_to_owner) - add_logs(owner, null, "lost Vanguard stun immunity[stuns_blocked ? "and been stunned for [stuns_blocked]":""]") - + add_logs(owner, null, "lost Vanguard stun immunity[stuns_blocked ? "and was stunned for [stuns_blocked]":""]") /datum/status_effect/inathneqs_endowment id = "inathneqs_endowment" - duration = 15 + duration = 150 alert_type = /obj/screen/alert/status_effect/inathneqs_endowment /obj/screen/alert/status_effect/inathneqs_endowment @@ -119,9 +132,10 @@ owner.status_flags &= ~GODMODE playsound(owner, 'sound/magic/Ethereal_Exit.ogg', 50, 1) + /datum/status_effect/cyborg_power_regen id = "power_regen" - duration = 10 + duration = 100 alert_type = /obj/screen/alert/status_effect/power_regen var/power_to_give = 0 //how much power is gained each tick diff --git a/code/datums/status_effects/gas.dm b/code/datums/status_effects/gas.dm index 53a8bb485f6..c87b24ab358 100644 --- a/code/datums/status_effects/gas.dm +++ b/code/datums/status_effects/gas.dm @@ -1,6 +1,6 @@ /datum/status_effect/freon id = "frozen" - duration = 10 + duration = 100 unique = TRUE alert_type = /obj/screen/alert/status_effect/freon var/icon/cube diff --git a/code/datums/status_effects/status_effect.dm b/code/datums/status_effects/status_effect.dm index 7db345d801f..38f3de0b242 100644 --- a/code/datums/status_effects/status_effect.dm +++ b/code/datums/status_effects/status_effect.dm @@ -6,10 +6,9 @@ var/global/list/all_status_effects = list() //a list of all status effects, if f /datum/status_effect var/id = "effect" //Used for screen alerts. - var/duration = -1 //How long the status effect lasts in SECONDS. Enter -1 for an effect that never ends unless removed through some means. - var/tick_interval = 1 //How many seconds between ticks. Leave at 1 for every second. + var/duration = -1 //How long the status effect lasts in DECISECONDS. Enter -1 for an effect that never ends unless removed through some means. + var/tick_interval = 10 //How many deciseconds between ticks, approximately. Leave at 10 for every second. var/mob/living/owner //The mob affected by the status effect. - var/cosmetic = FALSE //If the status effect only exists for flavor. var/unique = TRUE //If there can be multiple status effects of this type on one mob. var/alert_type = /obj/screen/alert/status_effect //the alert thrown by the status effect, contains name and description @@ -22,7 +21,7 @@ var/global/list/all_status_effects = list() //a list of all status effects, if f addtimer(CALLBACK(src, .proc/start_ticking), 1) //Give us time to set any variables /datum/status_effect/Destroy() - STOP_PROCESSING(SSprocessing, src) + STOP_PROCESSING(SSfastprocess, src) if(owner) owner.clear_alert(id) on_remove() @@ -37,22 +36,22 @@ var/global/list/all_status_effects = list() //a list of all status effects, if f qdel(src) return on_apply() + if(duration != -1) + duration = world.time + initial(duration) + tick_interval = world.time + initial(tick_interval) if(alert_type) var/obj/screen/alert/status_effect/A = owner.throw_alert(id, alert_type) A.attached_effect = src //so the alert can reference us, if it needs to - START_PROCESSING(SSprocessing, src) + START_PROCESSING(SSfastprocess, src) /datum/status_effect/process() if(!owner) qdel(src) return - if(duration != -1) - duration-- - tick_interval-- - if(!tick_interval) + if(tick_interval < world.time) tick() - tick_interval = initial(tick_interval) - if(!duration) + tick_interval = world.time + initial(tick_interval) + if(duration != -1 && duration < world.time) qdel(src) /datum/status_effect/proc/on_apply() //Called whenever the buff is applied. diff --git a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_drivers.dm b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_drivers.dm index 7aa219e4059..444bb4a38b5 100644 --- a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_drivers.dm +++ b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_drivers.dm @@ -213,13 +213,12 @@ addtimer(CALLBACK(invoker, /atom/proc/update_atom_colour), flee_time+grace_period) if(chant_number != chant_amount) //if this is the last chant, we don't have a movement period because the chant is over var/endtime = world.time + flee_time - var/starttime = world.time progbar = new(invoker, flee_time, invoker) progbar.bar.color = list("#AF0AAF", "#AF0AAF", "#AF0AAF", rgb(0,0,0)) animate(progbar.bar, color = initial(progbar.bar.color), time = flee_time+grace_period) while(world.time < endtime && can_recite()) sleep(1) - progbar.update(world.time - starttime) + progbar.update(endtime - world.time) qdel(progbar) if(can_recite()) sleep(grace_period)