Fixing the snore-pocalypse, and another not so critical issue.
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
/datum/status_effect/incapacitating/on_creation(mob/living/new_owner, set_duration, updating_canmove)
|
||||
if(isnum(set_duration))
|
||||
duration = set_duration
|
||||
tick_interval = max(world.tick_lag, round(tick_interval, world.tick_lag))
|
||||
. = ..()
|
||||
if(.)
|
||||
if(updating_canmove)
|
||||
@@ -82,11 +81,10 @@
|
||||
owner.adjustStaminaLoss(-0.5) //reduce stamina loss by 0.5 per tick, 10 per 2 seconds
|
||||
if(human_owner && human_owner.drunkenness)
|
||||
human_owner.drunkenness *= 0.997 //reduce drunkenness by 0.3% per tick, 6% per 2 seconds
|
||||
if(prob(20))
|
||||
if(carbon_owner)
|
||||
carbon_owner.handle_dreams()
|
||||
if(carbon_owner && !carbon_owner.dreaming && prob(2))
|
||||
carbon_owner.dream()
|
||||
// 2% per second, tick interval is in deciseconds
|
||||
if(prob(tick_interval * 0.2) && owner.health > owner.crit_threshold)
|
||||
if(prob((tick_interval+1) * 0.2) && owner.health > owner.crit_threshold)
|
||||
owner.emote("snore")
|
||||
|
||||
/datum/status_effect/staggered
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
var/id = "effect" //Used for screen alerts.
|
||||
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/next_tick //The scheduled time for the next tick.
|
||||
var/mob/living/owner //The mob affected by the status effect.
|
||||
var/on_remove_on_mob_delete = FALSE //if we call on_remove() when the mob is deleted
|
||||
var/examine_text //If defined, this text will appear when the mob is examined - to use he, she etc. use "SUBJECTPRONOUN" and replace it in the examines themselves
|
||||
@@ -31,7 +32,7 @@
|
||||
return
|
||||
if(duration != -1)
|
||||
duration = world.time + duration
|
||||
tick_interval = world.time + tick_interval
|
||||
next_tick = world.time + 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
|
||||
@@ -52,9 +53,9 @@
|
||||
if(!owner)
|
||||
qdel(src)
|
||||
return
|
||||
if(tick_interval < world.time)
|
||||
if(next_tick < world.time)
|
||||
tick()
|
||||
tick_interval = world.time + initial(tick_interval)
|
||||
next_tick = world.time + tick_interval
|
||||
if(duration != -1 && duration < world.time)
|
||||
qdel(src)
|
||||
|
||||
@@ -221,7 +222,7 @@
|
||||
threshold_crossed = FALSE //resets threshold effect if we fall below threshold so threshold effect can trigger again
|
||||
on_threshold_drop()
|
||||
if(stacks_added > 0)
|
||||
tick_interval += delay_before_decay //refreshes time until decay
|
||||
next_tick += delay_before_decay //refreshes time until decay
|
||||
stacks = min(stacks, max_stacks)
|
||||
status_overlay.icon_state = "[overlay_state][stacks]"
|
||||
status_underlay.icon_state = "[underlay_state][stacks]"
|
||||
|
||||
Reference in New Issue
Block a user