[Ready] Refactors stuns and status effects. (#17579)

* Fixes reviver runtime

* Confusion status effect

* Dizzy status effect

* Drowsiness status effect

* decaying -> transient

* Drunkenness status effect

* why use timer when SSfastprocessing work good

* stuns (mostly)

* weaken and immobalise

* stun/weaken times

* update_flags redundancies.

* Slowed()

* Silence + fixes transient decay

* Jittery

* sleeping

* Paralyze -> weaken

* Cult sluring

* paralyse

* Stammer

* slurring + projectile cleanups

* losebreath

* Hallucination

* forgor this

* eyeblurry

* eye blind

* Druggy

* affected didn't like my spacing

* review pass

* second review pass

* some cleanups

* documentation and signal framework

* confusion fix

* Fixes spec_stun

* rejuv fix

* removes a TODO

* conflicted myself

* fixes

* self review

* review

* removes TODOs

* adminfreeze

* TM fixes

* hallucination fix + others

* tones down alchol and runtime fixes

* confusion overlay suggestion

* more fixes

* runtime fix

* losebreath fix

* clamp => directional bounded sum

* steel review

* oops

Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>

* reduces the dizziness cycle rate

* borg hotfix

* sanctified decursening

Co-authored-by: mochi <1496804+dearmochi@users.noreply.github.com>
Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>
This commit is contained in:
Charlie
2022-05-24 16:35:26 +01:00
committed by GitHub
parent b32fb92770
commit 0f7a8707ef
311 changed files with 2268 additions and 2155 deletions
+6 -6
View File
@@ -16,11 +16,11 @@
// Settings
/// Whether the baton can stun silicon mobs
var/affect_silicon = FALSE
/// The stun time (in life cycles) for non-silicons
var/stun_time = 6 SECONDS_TO_LIFE_CYCLES
/// The stun time (in life cycles) for silicons
var/stun_time_silicon = 10 SECONDS_TO_LIFE_CYCLES
/// Cooldown in deciseconds between two knockdowns
/// The stun time (in seconds) for non-silicons
var/stun_time = 6 SECONDS
/// The stun time (in seconds) for silicons
var/stun_time_silicon = 10 SECONDS
/// Cooldown in seconds between two knockdowns
var/cooldown = 4 SECONDS
/// Sound to play when knocking someone down
var/stun_sound = 'sound/effects/woodhit.ogg'
@@ -38,7 +38,7 @@
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
user.visible_message("<span class='danger'>[user] accidentally clubs [user.p_them()]self with [src]!</span>", \
"<span class='userdanger'>You accidentally club yourself with [src]!</span>")
user.Weaken(force * 3)
user.Weaken(stun_time)
if(ishuman(user))
var/mob/living/carbon/human/H = user
H.apply_damage(force * 2, BRUTE, "head")
@@ -214,7 +214,7 @@
qdel(captured)
qdel(src)
else
captured.Paralyse(4)
captured.Paralyse(8 SECONDS)
if(captured.loc != src)
captured.forceMove(src)
update_icon()
+4 -4
View File
@@ -374,7 +374,7 @@
H.visible_message("<span class='danger'>[user] has touched [H.name] with [src]!</span>", \
"<span class='userdanger'>[user] has touched [H.name] with [src]!</span>")
H.adjustStaminaLoss(50)
H.Weaken(5)
H.Weaken(10 SECONDS)
playsound(get_turf(src), 'sound/machines/defib_zap.ogg', 50, 1, -1)
H.emote("gasp")
if(!H.undergoing_cardiac_arrest() && (prob(10) || (defib.combat && defib.heart_attack) || prob(10) && (defib.combat))) // If the victim is not having a heart attack, and a 10% chance passes, or the defib has heart attack variable to TRUE while being a combat defib, or if another 10% chance passes with combat being TRUE
@@ -471,7 +471,7 @@
user.visible_message("<span class='boldnotice'>[defib] pings: Resuscitation successful.</span>")
H.update_revive()
H.KnockOut()
H.Paralyse(5)
H.Paralyse(10 SECONDS)
H.emote("gasp")
if(tplus > tloss)
H.setBrainLoss( max(0, min(99, ((tlimit - tplus) / tlimit * 100))))
@@ -540,7 +540,7 @@
H.visible_message("<span class='danger'>[user] has touched [H.name] with [src]!</span>", \
"<span class='userdanger'>[user] has touched [H.name] with [src]!</span>")
H.adjustStaminaLoss(50)
H.Weaken(5)
H.Weaken(10 SECONDS)
if(!H.undergoing_cardiac_arrest() && prob(10)) // Your heart explodes.
H.set_heartattack(TRUE)
SEND_SIGNAL(H, COMSIG_LIVING_MINOR_SHOCK, 100)
@@ -595,7 +595,7 @@
playsound(get_turf(src), 'sound/machines/defib_success.ogg', 50, 0)
H.update_revive(FALSE)
H.KnockOut(FALSE)
H.Paralyse(5)
H.Paralyse(10 SECONDS)
H.emote("gasp")
if(tplus > tloss)
H.setBrainLoss( max(0, min(99, ((tlimit - tplus) / tlimit * 100))))
+1 -1
View File
@@ -203,7 +203,7 @@
if(7)
//Throw
T.visible_message("<span class='userdanger'>Unseen forces throw [user]!</span>")
user.Stun(6)
user.Stun(12 SECONDS)
user.adjustBruteLoss(50)
var/throw_dir = GLOB.cardinal
var/atom/throw_target = get_edge_target_turf(user, throw_dir)
+5 -5
View File
@@ -89,12 +89,12 @@
if(G && istype(G))
if(improvised) // Improvised garrotes start you off with a passive grab, but keep you stunned like an agressive grab.
M.Stun(1)
M.Stun(2 SECONDS)
else
G.state = GRAB_NECK
G.hud.icon_state = "kill"
G.hud.name = "kill"
M.AdjustSilence(1)
M.AdjustSilence(2 SECONDS)
garrote_time = world.time + 10
START_PROCESSING(SSobj, src)
@@ -153,15 +153,15 @@
return
if(G.state < GRAB_NECK) // Only possible with improvised garrotes, essentially this will stun people as if they were aggressively grabbed. Allows for resisting out if you're quick, but not running away.
strangling.Stun(3)
strangling.Stun(6 SECONDS)
if(improvised)
strangling.stuttering = max(strangling.stuttering, 3)
strangling.Stuttering(6 SECONDS)
strangling.apply_damage(2, OXY, "head")
return
strangling.Silence(3) // Non-improvised effects
strangling.Silence(6 SECONDS) // Non-improvised effects
strangling.apply_damage(4, OXY, "head")
@@ -33,7 +33,7 @@
. = ..()
// The reason this AddComponent is here and not in ComponentInitialize() is because if it's put there, it will be ran before the parent New proc for /grown types.
// And then be overriden by the generic component placed onto it by the `/datum/plant_gene/trait/slip`.
AddComponent(/datum/component/slippery, src, 0, 7, 100, 4, FALSE)
AddComponent(/datum/component/slippery, src, 14 SECONDS, 100, 4, FALSE)
/obj/item/grown/bananapeel/traitorpeel/after_slip(mob/living/carbon/human/H)
to_chat(H, "<span class='warning'>Your feet feel like they're on fire!</span>")
@@ -47,22 +47,19 @@
M.show_message("<span class='warning'>BANG</span>", 2)
var/distance = max(1, get_dist(source_turf, get_turf(M)))
var/stun_amount = max(10 / distance, 3)
var/stun_amount = max(20 SECONDS / distance, 6 SECONDS)
// Flash
if(flash)
if(M.flash_eyes(affect_silicon = TRUE))
M.Stun(stun_amount)
M.Weaken(stun_amount)
// Bang
var/ear_safety = M.check_ear_prot()
if(bang)
if(!distance || A.loc == M || A.loc == M.loc) // Holding on person or being exactly where lies is significantly more dangerous and voids protection
M.Stun(10)
M.Weaken(10)
M.Weaken(20 SECONDS)
if(!ear_safety)
M.Stun(stun_amount)
M.Weaken(stun_amount)
M.AdjustEarDamage(5, 15)
if(iscarbon(M))
@@ -48,7 +48,7 @@
if(!user.mind || !user.mind.isholy)
user.adjustBruteLoss(force)
user.adjustFireLoss(sanctify_force)
user.Weaken(5)
user.Weaken(10 SECONDS)
user.unEquip(src, 1)
user.visible_message("<span class='warning'>[src] slips out of the grip of [user] as they try to pick it up, bouncing upwards and smacking [user.p_them()] in the face!</span>", \
"<span class='warning'>[src] slips out of your grip as you pick it up, bouncing upwards and smacking you in the face!</span>")
@@ -515,7 +515,7 @@
if(src == holder.l_hand || src == holder.r_hand)
for(var/mob/living/carbon/human/H in range(5, loc))
if(H.mind.assigned_role == "Clown")
H.Silence(10)
H.Silence(20 SECONDS)
animate_fade_grayscale(H,20)
if(prob(10))
to_chat(H, "<span class='userdanger'>Being in the presence of [holder]'s [src] is interfering with your honk!</span>")
@@ -65,7 +65,7 @@
sleep(delay/4)
if(imp_in && imp_in.stat)
imp_in.visible_message("<span class = 'warning'>[imp_in] doubles over in pain!</span>")
imp_in.Weaken(7)
imp_in.Weaken(14 SECONDS)
playsound(loc, 'sound/items/timer.ogg', 30, 0)
sleep(delay/4)
playsound(loc, 'sound/items/timer.ogg', 30, 0)
@@ -16,7 +16,7 @@
for(var/obj/item/grab/G in C_imp_in.grabbed_by)
var/mob/living/carbon/M = G.assailant
C_imp_in.visible_message("<span class='warning'>[C_imp_in] suddenly shocks [M] from their wrists and slips out of their grab!</span>")
M.Stun(1) //Drops the grab
M.Stun(2 SECONDS) //Drops the grab
M.apply_damage(2, BURN, "r_hand", M.run_armor_check("r_hand", "energy"))
M.apply_damage(2, BURN, "l_hand", M.run_armor_check("l_hand", "energy"))
C_imp_in.SetStunned(0) //This only triggers if they are grabbed, to have them break out of the grab, without the large stun time.
+2 -1
View File
@@ -158,6 +158,7 @@
gender = NEUTER
origin_tech = "engineering=3;combat=1"
hitsound = 'sound/effects/snap.ogg'
///the duration of the stun in seconds
var/weaken = 0
/obj/item/restraints/legcuffs/bola/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback)
@@ -186,7 +187,7 @@
item_state = "bola_r"
breakouttime = 70
origin_tech = "engineering=4;combat=3"
weaken = 1
weaken = 2 SECONDS
/obj/item/restraints/legcuffs/bola/energy //For Security
name = "energy bola"
@@ -5,7 +5,7 @@
if(target.check_block())
target.visible_message("<span class='danger'>[target.name] blocks [src] and twists [user]'s arm behind [user.p_their()] back!</span>",
"<span class='userdanger'>You block the attack!</span>")
user.Stun(2)
user.Stun(4 SECONDS)
return TRUE
/obj/item/melee/chainofcommand
+1 -1
View File
@@ -69,7 +69,7 @@
if(do_after(user, 50 * toolspeed, target = H))
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
user.visible_message("<span class='danger'>[user] abruptly stops cutting [M]'s hair and slices [M.p_their()] throat!</span>", "<span class='danger'>You stop cutting [M]'s hair and slice [M.p_their()] throat!</span>") //Just a little off the top.
H.AdjustLoseBreath(10) //30 Oxy damage over time
H.AdjustLoseBreath(20 SECONDS) //30 Oxy damage over time
H.apply_damage(18, BRUTE, "head", sharp =1, used_weapon = "scissors")
var/turf/location = get_turf(src)
H.add_splatter_floor(location)
+1 -1
View File
@@ -14,7 +14,7 @@
var/cleanspeed = 50 //slower than mop
/obj/item/soap/ComponentInitialize()
AddComponent(/datum/component/slippery, src, 4, 2, 100, 0, FALSE)
AddComponent(/datum/component/slippery, src, 8 SECONDS, 100, 0, FALSE)
/obj/item/soap/afterattack(atom/target, mob/user, proximity)
if(!proximity) return
@@ -121,7 +121,7 @@
if(H.get_item_by_slot(slot_head) == src)
if(H.internal)
return
H.AdjustLoseBreath(1)
H.AdjustLoseBreath(2 SECONDS)
else
storage_slots = 7
STOP_PROCESSING(SSobj, src)
@@ -403,7 +403,7 @@
if(ishuman(M))
if(prob(10))
M.Weaken(2)
M.Weaken(4 SECONDS)
/obj/item/storage/bag/tray/proc/rebuild_overlays()
overlays.Cut()
@@ -86,7 +86,7 @@
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
to_chat(user, "<span class='warning'>[src] slips out of your hand and hits your head.</span>")
user.take_organ_damage(10)
user.Paralyse(20)
user.Paralyse(40 SECONDS)
return
if(M.stat != DEAD && ishuman(M))
+3 -4
View File
@@ -12,7 +12,7 @@
attack_verb = list("beaten")
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 50, BIO = 0, RAD = 0, FIRE = 80, ACID = 80)
/// How many life ticks does the stun last for
var/stunforce = 7
var/stunforce = 14 SECONDS
/// Is the baton currently turned on
var/turned_on = FALSE
/// How much power does it cost to stun someone
@@ -194,7 +194,6 @@
SEND_SIGNAL(L, COMSIG_LIVING_MINOR_SHOCK, 33)
L.Stun(stunforce)
L.Weaken(stunforce)
L.Stuttering(stunforce)
@@ -213,7 +212,7 @@
if(cell)
deductcharge(1000 / severity)
/obj/item/melee/baton/wash(mob/user, atom/source)
/obj/item/melee/baton/wash(mob/living/user, atom/source)
if(turned_on && cell?.charge)
flick("baton_active", source)
user.Stun(stunforce)
@@ -235,7 +234,7 @@
item_state = "prod"
force = 3
throwforce = 5
stunforce = 5
stunforce = 10 SECONDS
hitcost = 2000
throw_hit_chance = 10
slot_flags = SLOT_BACK
+9 -9
View File
@@ -252,11 +252,12 @@
. = ..()
if(wielded && charge == max_charge)
if(isliving(M))
var/mob/living/target = M
charge = 0
playsound(loc, 'sound/magic/lightningbolt.ogg', 5, 1)
user.visible_message("<span class='danger'>[user] slams the charged axe into [M.name] with all [user.p_their()] might!</span>")
do_sparks(1, 1, src)
M.Weaken(4)
target.Weaken(8 SECONDS)
var/atom/throw_target = get_edge_target_turf(M, get_dir(src, get_step_away(M, src)))
M.throw_at(throw_target, 5, 1)
@@ -615,7 +616,7 @@
icon_state = "chainsaw0"
..()
/obj/item/twohanded/chainsaw/attack(mob/target, mob/living/user)
/obj/item/twohanded/chainsaw/attack(mob/living/target, mob/living/user)
if(wielded)
playsound(loc, 'sound/weapons/chainsaw.ogg', 100, 1, -1) //incredibly loud; you ain't goin' for stealth with this thing. Credit to Lonemonk of Freesound for this sound.
if(isrobot(target))
@@ -624,7 +625,7 @@
if(!isliving(target))
return
else
target.Weaken(4)
target.Weaken(8 SECONDS)
..()
return
else
@@ -695,7 +696,7 @@
var/obj/item/clothing/shoes/magboots/M = H.shoes
if(M.magpulse)
continue
H.Weaken(2)
H.Weaken(4 SECONDS)
step_towards(H, pull)
step_towards(H, pull)
step_towards(H, pull)
@@ -736,21 +737,20 @@
var/atom/throw_target = get_edge_target_turf(target, get_dir(src, get_step_away(target, src)))
target.throw_at(throw_target, 200, 4)
/obj/item/twohanded/mjollnir/attack(mob/M, mob/user)
/obj/item/twohanded/mjollnir/attack(mob/living/M, mob/user)
..()
if(wielded)
//if(charged == 5)
//charged = 0
playsound(loc, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
if(isliving(M))
M.Stun(3)
shock(M)
M.Stun(6 SECONDS)
shock(M)
/obj/item/twohanded/mjollnir/throw_impact(atom/target)
. = ..()
if(isliving(target))
var/mob/living/L = target
L.Stun(3)
L.Stun(6 SECONDS)
shock(L)
/obj/item/twohanded/mjollnir/update_icon() //Currently only here to fuck with the on-mob icons.