[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
co-authored by SteelSlayer mochi
parent b32fb92770
commit 0f7a8707ef
311 changed files with 2268 additions and 2155 deletions
+4 -2
View File
@@ -76,8 +76,10 @@
if(owner.restrained())
return FALSE
if(check_flags & AB_CHECK_STUNNED)
if(owner.stunned || owner.IsWeakened())
return FALSE
if(isliving(owner))
var/mob/living/L = owner
if(L.IsStunned() || L.IsWeakened())
return FALSE
if(check_flags & AB_CHECK_LYING)
if(owner.lying)
return FALSE
+1 -1
View File
@@ -56,4 +56,4 @@
H.visible_message("<span class='danger'>[H] slides on [A]!</span>", "<span class='userdanger'>You slide on [A]!</span>")
cooldown = world.time
H.Weaken(3)
H.Weaken(6 SECONDS)
+2 -5
View File
@@ -10,8 +10,6 @@
/datum/component/slippery
/// Text that gets displayed in the slip proc, i.e. "user slips on [description]"
var/description
/// The amount of stun to apply after slip.
var/stun
/// The amount of weaken to apply after slip.
var/weaken
/// The chance that walking over the parent will slip you.
@@ -25,12 +23,11 @@
/// The verb that players will see when someone slips on the parent. In the form of "You [slip_verb]ped on".
var/slip_verb
/datum/component/slippery/Initialize(_description, _stun = 0, _weaken = 0, _slip_chance = 100, _slip_tiles = 0, _walking_is_safe = TRUE, _slip_always = FALSE, _slip_verb = "slip")
/datum/component/slippery/Initialize(_description, _weaken = 0, _slip_chance = 100, _slip_tiles = 0, _walking_is_safe = TRUE, _slip_always = FALSE, _slip_verb = "slip")
if(!isatom(parent))
return COMPONENT_INCOMPATIBLE
description = _description
stun = max(0, _stun)
weaken = max(0, _weaken)
slip_chance = max(0, _slip_chance)
slip_tiles = max(0, _slip_tiles)
@@ -51,6 +48,6 @@
Additionally calls the parent's `after_slip()` proc on the `victim`.
*/
/datum/component/slippery/proc/Slip(datum/source, mob/living/carbon/human/victim)
if(istype(victim) && !victim.flying && prob(slip_chance) && victim.slip(description, stun, weaken, slip_tiles, walking_is_safe, slip_always, slip_verb))
if(istype(victim) && !victim.flying && prob(slip_chance) && victim.slip(description, weaken, slip_tiles, walking_is_safe, slip_always, slip_verb))
var/atom/movable/owner = parent
owner.after_slip(victim)
+7 -7
View File
@@ -9,8 +9,8 @@
var/mob/living/carbon/human/U = user
if(!istype(U.dna.species, /datum/species/skeleton))
U.adjustStaminaLoss(35) //Extra Damage
U.Jitter(35)
U.stuttering = 20
U.Jitter(70 SECONDS)
U.SetStuttering(40 SECONDS)
if(U.getStaminaLoss() > 95)
to_chat(U, "<font color='red' size='4'><b>Your ears weren't meant for this spectral sound.</b></font>")
spectral_change(U)
@@ -20,20 +20,20 @@
var/mob/living/carbon/human/H = C
if(istype(H.dna.species, /datum/species/skeleton))
return //undeads are unaffected by the spook-pocalypse.
C.Jitter(35)
C.stuttering = 20
C.Jitter(70 SECONDS)
C.SetStuttering(40 SECONDS)
if(!istype(H.dna.species, /datum/species/diona) && !istype(H.dna.species, /datum/species/machine) && !istype(H.dna.species, /datum/species/slime) && !istype(H.dna.species, /datum/species/golem) && !istype(H.dna.species, /datum/species/plasmaman))
C.adjustStaminaLoss(25) //boneless humanoids don't lose the will to live
to_chat(C, "<font color='red' size='4'><B>DOOT</B></font>")
spectral_change(H)
else //the sound will spook monkeys.
C.Jitter(15)
C.stuttering = 20
C.Jitter(30 SECONDS)
C.SetStuttering(40 SECONDS)
/datum/component/spooky/proc/spectral_change(mob/living/carbon/human/H, mob/user)
if((H.getStaminaLoss() > 95) && (!istype(H.dna.species, /datum/species/diona) && !istype(H.dna.species, /datum/species/machine) && !istype(H.dna.species, /datum/species/slime) && !istype(H.dna.species, /datum/species/golem) && !istype(H.dna.species, /datum/species/plasmaman) && !istype(H.dna.species, /datum/species/skeleton)))
H.Stun(20)
H.Stun(40 SECONDS)
H.set_species(/datum/species/skeleton)
H.visible_message("<span class='warning'>[H] has given up on life as a mortal.</span>")
var/T = get_turf(H)
+3 -2
View File
@@ -754,8 +754,9 @@
var/haltype = input(usr, "Select the hallucination type:", "Hallucinate") as null|anything in subtypesof(/obj/effect/hallucination)
if(!haltype)
return
C.hallucinate(haltype)
C.Hallucinate(20 SECONDS)
var/datum/status_effect/transient/hallucination/H = C.has_status_effect(STATUS_EFFECT_HALLUCINATION)
H.hallucinate(haltype)
message_admins("[key_name(usr)] has given [key_name(C)] the [haltype] hallucination")
log_admin("[key_name_admin(usr)] has given [key_name_admin(C)] the [haltype] hallucination")
href_list["datumrefresh"] = href_list["hallucinate"]
@@ -35,6 +35,6 @@ Bonus
to_chat(M, "<span class='warning'>[pick("Your head hurts.", "Your mind blanks for a moment.")]</span>")
else
to_chat(M, "<span class='userdanger'>You can't think straight!</span>")
M.AdjustConfused(8, bound_lower = 0, bound_upper = 100)
M.AdjustConfused(16 SECONDS, bound_lower = 0, bound_upper = 200 SECONDS)
return
@@ -34,5 +34,5 @@ Bonus
to_chat(M, "<span class='warning'>[pick("You feel dizzy.", "Your head spins.")]</span>")
else
to_chat(M, "<span class='userdanger'>A wave of dizziness washes over you!</span>")
M.Dizzy(5)
M.Dizzy(10 SECONDS)
return
@@ -36,6 +36,6 @@ Bonus
to_chat(M, "<span class='warning'><b>[pick("Something is following you.", "You are being watched.", "You hear a whisper in your ear.", "Thumping footsteps slam toward you from nowhere.")]</b></span>")
else
to_chat(M, "<span class='userdanger'>[pick("Oh, your head...", "Your head pounds.", "They're everywhere! Run!", "Something in the shadows...")]</span>")
M.AdjustHallucinate(5)
M.AdjustHallucinate(5 SECONDS)
return
@@ -31,16 +31,16 @@ Bonus
var/datum/reagents/RD = M.reagents
if(A.stage >= 3)
M.AdjustSlur(-2)
M.AdjustDrunk(-4)
M.AdjustSlur(-4 SECONDS)
M.AdjustDrunk(-8 SECONDS)
M.reagents.remove_all_type(/datum/reagent/consumable/ethanol, 3, 0, 1)
if(A.stage >= 4)
M.AdjustDrowsy(-2)
M.AdjustDrowsy(-4 SECONDS)
if(RD.has_reagent("lsd"))
RD.remove_reagent("lsd", 5)
if(RD.has_reagent("histamine"))
RD.remove_reagent("histamine", 5)
M.AdjustHallucinate(-10)
M.AdjustHallucinate(-10 SECONDS)
if(A.stage >= 5)
RD.check_and_add("mannitol", 10, 10)
@@ -37,15 +37,15 @@ Bonus
to_chat(M, "<span class='warning'>Your eyes itch.</span>")
if(3, 4)
to_chat(M, "<span class='warning'><b>Your eyes burn!</b></span>")
M.EyeBlurry(20)
M.EyeBlurry(40 SECONDS)
eyes.receive_damage(1)
else
to_chat(M, "<span class='userdanger'>Your eyes burn horrificly!</span>")
M.EyeBlurry(30)
M.EyeBlurry(60 SECONDS)
eyes.receive_damage(5)
if(eyes.damage >= 10)
M.become_nearsighted(EYE_DAMAGE)
if(prob(eyes.damage - 10 + 1))
if(!M.eye_blind)
if(!M.AmountBlinded())
to_chat(M, "<span class='userdanger'>You go blind!</span>")
eyes.receive_damage(eyes.max_damage)
@@ -40,5 +40,5 @@ Bonus
M.adjustStaminaLoss(30)
if(M.getStaminaLoss() > 60 && !M.stat)
M.visible_message("<span class='warning'>[M] faints!</span>", "<span class='userdanger'>You swoon and faint...</span>")
M.AdjustSleeping(5)
M.AdjustSleeping(10 SECONDS)
return
+3 -3
View File
@@ -24,15 +24,15 @@
to_chat(affected_mob, "<span class='notice'>You feel panicky.</span>")
if(prob(2))
to_chat(affected_mob, "<span class='danger'>You're overtaken with panic!</span>")
affected_mob.AdjustConfused(rand(2,3))
affected_mob.AdjustConfused(rand(4 SECONDS, 6 SECONDS))
if(4)
if(prob(10))
to_chat(affected_mob, "<span class='danger'>You feel butterflies in your stomach.</span>")
if(prob(5))
affected_mob.visible_message("<span class='danger'>[affected_mob] stumbles around in a panic.</span>", \
"<span class='userdanger'>You have a panic attack!</span>")
affected_mob.AdjustConfused(rand(6,8))
affected_mob.AdjustJitter(rand(6,8))
affected_mob.AdjustConfused(rand(12 SECONDS, 16 SECONDS))
affected_mob.AdjustJitter(rand(12 SECONDS, 16 SECONDS))
if(prob(2))
affected_mob.visible_message("<span class='danger'>[affected_mob] coughs up butterflies!</span>", \
"<span class='userdanger'>You cough up butterflies!</span>")
+1 -1
View File
@@ -28,7 +28,7 @@
A.update_icon()
if(prob(3))
to_chat(affected_mob, "<span class='warning'>You feel a stabbing pain in your abdomen!</span>")
affected_mob.Stun(rand(2,3))
affected_mob.Stun(rand(4 SECONDS, 6 SECONDS))
affected_mob.adjustToxLoss(1)
if(3)
if(prob(1))
+2 -2
View File
@@ -47,10 +47,10 @@
if(prob(3))
to_chat(affected_mob, "<span class='danger'>You lose consciousness...</span>")
affected_mob.visible_message("<span class='warning'>[affected_mob] suddenly collapses</span>")
affected_mob.Paralyse(rand(5,10))
affected_mob.Paralyse(rand(10 SECONDS, 20 SECONDS))
if(prob(1))
affected_mob.emote("snore")
if(prob(15))
affected_mob.stuttering += 3
affected_mob.AdjustStuttering(6 SECONDS)
return
+9 -9
View File
@@ -74,7 +74,7 @@
affected_mob.emote(pick("faint", "collapse", "groan"))
if(prob(7))
to_chat(affected_mob, "<span class='danger'>You can't breathe!</span>")
affected_mob.AdjustLoseBreath(1)
affected_mob.AdjustLoseBreath(2 SECONDS)
if(prob(5))
var/datum/disease/D = new /datum/disease/critical/heart_failure
affected_mob.ForceContractDisease(D)
@@ -126,10 +126,10 @@
affected_mob.emote(pick("pale", "groan"))
if(prob(5))
to_chat(affected_mob, "<span class='danger'>Your heart lurches in your chest!</span>")
affected_mob.AdjustLoseBreath(1)
affected_mob.AdjustLoseBreath(2 SECONDS)
if(prob(3))
to_chat(affected_mob, "<span class='danger'>Your heart stops beating!</span>")
affected_mob.AdjustLoseBreath(3)
affected_mob.AdjustLoseBreath(6 SECONDS)
if(prob(5))
affected_mob.emote(pick("faint", "collapse", "groan"))
if(3)
@@ -183,11 +183,11 @@
if(prob(4))
to_chat(affected_mob, "<span class='warning'>You feel like everything is wrong with your life!</span>")
if(prob(5))
affected_mob.Slowed(rand(4, 16))
affected_mob.Slowed(rand(8 SECONDS, 32 SECONDS))
to_chat(affected_mob, "<span class='warning'>You feel [pick("tired", "exhausted", "sluggish")].</span>")
if(prob(5))
affected_mob.Weaken(6)
affected_mob.Stuttering(10)
affected_mob.Weaken(12 SECONDS)
affected_mob.Stuttering(20 SECONDS)
to_chat(affected_mob, "<span class='warning'>You feel [pick("numb", "confused", "dizzy", "lightheaded")].</span>")
affected_mob.emote("collapse")
if(3)
@@ -195,10 +195,10 @@
var/datum/disease/D = new /datum/disease/critical/shock
affected_mob.ForceContractDisease(D)
if(prob(12))
affected_mob.Weaken(6)
affected_mob.Stuttering(10)
affected_mob.Weaken(12 SECONDS)
affected_mob.Stuttering(20 SECONDS)
to_chat(affected_mob, "<span class='warning'>You feel [pick("numb", "confused", "dizzy", "lightheaded")].</span>")
affected_mob.emote("collapse")
if(prob(12))
to_chat(affected_mob, "<span class='warning'>You feel [pick("tired", "exhausted", "sluggish")].</span>")
affected_mob.Slowed(rand(4, 16))
affected_mob.Slowed(rand(8 SECONDS, 32 SECONDS))
+5 -5
View File
@@ -17,7 +17,7 @@
/datum/disease/food_poisoning/stage_act()
..()
if(affected_mob.sleeping && prob(33))
if(affected_mob.IsSleeping() && prob(33))
to_chat(affected_mob, "<span class='notice'>You feel better.</span>")
cure()
return
@@ -28,7 +28,7 @@
if(prob(5))
to_chat(affected_mob, "<span class='danger'>You feel queasy.</span>")
if(2)
if(affected_mob.sleeping && prob(40))
if(affected_mob.IsSleeping() && prob(40))
to_chat(affected_mob, "<span class='notice'>You feel better.</span>")
cure()
return
@@ -43,7 +43,7 @@
if(prob(5))
to_chat(affected_mob, "<span class='danger'>You feel nauseous.</span>")
if(3)
if(affected_mob.sleeping && prob(25))
if(affected_mob.IsSleeping() && prob(25))
to_chat(affected_mob, "<span class='notice'>You feel better.</span>")
cure()
return
@@ -67,5 +67,5 @@
else
to_chat(affected_mob, "<span class='danger'>Your stomach lurches painfully!</span>")
affected_mob.visible_message("<span class='danger'>[affected_mob] gags and retches!</span>")
affected_mob.Stun(rand(2,4))
affected_mob.Weaken(rand(2,4))
affected_mob.Stun(rand(4 SECONDS, 8 SECONDS))
affected_mob.Weaken(rand(4 SECONDS, 8 SECONDS))
+1 -1
View File
@@ -38,7 +38,7 @@
if(istajaran(affected_mob))
affected_mob.visible_message("<span class='danger'>[affected_mob] coughs up a hairball!</span>", \
"<span class='userdanger'>You cough up a hairball!</span>")
affected_mob.Stun(5)
affected_mob.Stun(10 SECONDS)
else
affected_mob.visible_message("<span class='danger'>[affected_mob]'s form contorts into something more feline!</span>", \
"<span class='userdanger'>YOU TURN INTO A TAJARAN!</span>")
+6 -15
View File
@@ -22,34 +22,25 @@
if(prob(50))
affected_mob.emote("laugh")
if(prob(50))
affected_mob.Jitter(25)
affected_mob.Jitter(50 SECONDS)
if(2)
if(prob(50))
affected_mob.visible_message("<span class='danger'>[affected_mob] laughs uncontrollably!</span>")
affected_mob.Stun(10)
affected_mob.Weaken(10)
affected_mob.Jitter(250)
affected_mob.drop_l_hand()
affected_mob.drop_r_hand()
affected_mob.Weaken(20 SECONDS)
affected_mob.Jitter(500 SECONDS)
if(3)
if(prob(25))
to_chat(affected_mob, "<span class='danger'>You feel like you are about to drop dead!</span>")
to_chat(affected_mob, "<span class='danger'>Your body convulses painfully!</span>")
affected_mob.drop_l_hand()
affected_mob.drop_r_hand()
affected_mob.adjustBruteLoss(5)
affected_mob.adjustOxyLoss(5)
affected_mob.Stun(10)
affected_mob.Weaken(10)
affected_mob.Jitter(250)
affected_mob.Weaken(20 SECONDS)
affected_mob.Jitter(500 SECONDS)
affected_mob.visible_message("<span class='danger'>[affected_mob] laughs uncontrollably!</span>")
if(4)
if(prob(25))
to_chat(affected_mob, "<span class='danger'>You feel like you are going to die!</span>")
affected_mob.adjustOxyLoss(75)
affected_mob.adjustBruteLoss(75)
affected_mob.drop_l_hand()
affected_mob.drop_r_hand()
affected_mob.Stun(10)
affected_mob.Weaken(10)
affected_mob.Weaken(20 SECONDS)
affected_mob.visible_message("<span class='danger'>[affected_mob] laughs uncontrollably!</span>")
+1 -1
View File
@@ -33,7 +33,7 @@
if(prob(5))
affected_mob.visible_message("<span class='danger'>[affected_mob] howls!</span>", \
"<span class='userdanger'>You howl!</span>")
affected_mob.AdjustConfused(rand(6, 8))
affected_mob.AdjustConfused(rand(12 SECONDS, 16 SECONDS))
if(prob(3) && barklimit <= 10)
var/list/puppytype = list(/mob/living/simple_animal/pet/dog/corgi/puppy, /mob/living/simple_animal/pet/dog/pug, /mob/living/simple_animal/pet/dog/fox)
var/mob/living/puppypicked = pick(puppytype)
+1 -1
View File
@@ -52,7 +52,7 @@
to_chat(affected_mob, "You feel very strange.")
if(prob(4))
to_chat(affected_mob, "<span class='danger'>You feel a stabbing pain in your head!</span>")
affected_mob.Paralyse(2)
affected_mob.Paralyse(4 SECONDS)
if(prob(4))
to_chat(affected_mob, "<span class='danger'>Your stomach churns.</span>")
if(3)
+3 -3
View File
@@ -112,7 +112,7 @@
if(3)
if(prob(4))
to_chat(affected_mob, "<span class='danger'>You feel a stabbing pain in your head.</span>")
affected_mob.AdjustConfused(10)
affected_mob.AdjustConfused(20 SECONDS)
if(4)
if(prob(3))
affected_mob.say(pick("Eeek, ook ook!", "Eee-eeek!", "Eeee!", "Ungh, ungh."))
@@ -145,7 +145,7 @@
affected_mob.say(pick("Beep, boop", "beep, beep!", "Boop...bop"))
if(prob(4))
to_chat(affected_mob, "<span class='danger'>You feel a stabbing pain in your head.</span>")
affected_mob.Paralyse(2)
affected_mob.Paralyse(4 SECONDS)
if(4)
if(prob(20))
affected_mob.say(pick("beep, beep!", "Boop bop boop beep.", "kkkiiiill mmme", "I wwwaaannntt tttoo dddiiieeee..."))
@@ -175,7 +175,7 @@
if(3)
if(prob(4))
to_chat(affected_mob, "<span class='danger'>You feel a stabbing pain in your head.</span>")
affected_mob.Paralyse(2)
affected_mob.Paralyse(4 SECONDS)
if(4)
if(prob(20))
affected_mob.say(pick("You look delicious.", "Going to... devour you...", "Hsssshhhhh!"))
+3 -3
View File
@@ -27,7 +27,7 @@
if(4)
if(prob(2))
to_chat(affected_mob, "<span class='userdanger'>You see four of everything</span>")
affected_mob.Dizzy(5)
affected_mob.Dizzy(10 SECONDS)
if(prob(2))
to_chat(affected_mob, "<span class='danger'>You feel a sharp pain from your lower chest!</span>")
affected_mob.adjustOxyLoss(5)
@@ -43,10 +43,10 @@
if(prob(10))
affected_mob.adjustStaminaLoss(100)
affected_mob.visible_message("<span class='warning'>[affected_mob] faints!</span>", "<span class='userdanger'>You surrender yourself and feel at peace...</span>")
affected_mob.AdjustSleeping(5)
affected_mob.AdjustSleeping(10 SECONDS)
if(prob(2))
to_chat(affected_mob, "<span class='userdanger'>You feel your mind relax and your thoughts drift!</span>")
affected_mob.AdjustConfused(8, bound_lower = 0, bound_upper = 100)
affected_mob.AdjustConfused(16 SECONDS, bound_lower = 0, bound_upper = 200 SECONDS)
if(prob(10))
affected_mob.vomit(20)
if(prob(3))
-34
View File
@@ -1,34 +0,0 @@
/datum/disease/vampire
name = "Grave Fever"
max_stages = 3
stage_prob = 5
spread_text = "Non-Contagious"
spread_flags = SPECIAL
cure_text = "Antibiotics"
cures = list("spaceacillin")
agent = "Grave Dust"
cure_chance = 20
viable_mobtypes = list(/mob/living/carbon/human)
severity = DANGEROUS
disease_flags = CURABLE
spread_flags = NON_CONTAGIOUS
/datum/disease/vampire/stage_act()
..()
var/toxdamage = stage * 2
var/stuntime = stage * 2
if(prob(10))
affected_mob.emote(pick("cough","groan", "gasp"))
affected_mob.AdjustLoseBreath(1)
if(prob(15))
if(prob(33))
to_chat(affected_mob, "<span class='danger'>You feel sickly and weak.</span>")
affected_mob.AdjustSlowed(3)
affected_mob.adjustToxLoss(toxdamage)
if(prob(5))
to_chat(affected_mob, "<span class='danger'>Your joints ache horribly!</span>")
affected_mob.Weaken(stuntime)
affected_mob.Stun(stuntime)
+3 -4
View File
@@ -34,10 +34,9 @@
/mob/living/carbon/human/proc/bananatouched()
to_chat(src, "<font color='red' size='6'>HONK</font>")
Weaken(7)
Stun(7)
Stuttering(15)
do_jitter_animation(15)
Weaken(14 SECONDS)
Stuttering(30 SECONDS)
do_jitter_animation(30 SECONDS)
if(iswizard(src) || (mind && mind.special_role == SPECIAL_ROLE_WIZARD_APPRENTICE)) //Wizards get non-cursed clown robes and magical mask.
unEquip(shoes, TRUE)
+1 -1
View File
@@ -20,7 +20,7 @@
setBrainLoss(80, use_brain_mod = FALSE)
set_nutrition(9000)
overeatduration = 9000
Confused(30)
Confused(60 SECONDS)
if(mind)
mind.assigned_role = "Cluwne"
+2 -1
View File
@@ -75,7 +75,8 @@
var/mob/old_body = current_body
var/turf/body_turf = get_turf(old_body)
current_body = lich
lich.Weaken(10 + 10 * resurrections)
var/stun_time = (1 + resurrections) * 20 SECONDS
lich.Weaken(stun_time)
++resurrections
equip_lich(lich)
+4 -5
View File
@@ -42,8 +42,7 @@
if(damaging)
target.electrocute_act(energy, "Lightning Bolt", flags = SHOCK_NOGLOVES)
else
target.AdjustJitter(1000) //High numbers for violent convulsions
target.do_jitter_animation(target.jitteriness)
target.AdjustStuttering(2)
target.Slowed(3)
addtimer(CALLBACK(target, /mob/.proc/AdjustJitter, -1000, 10), 2 SECONDS) //Still jittery, but vastly less
target.AdjustJitter(2000 SECONDS) //High numbers for violent convulsions
target.AdjustStuttering(4 SECONDS)
target.Slowed(6 SECONDS)
addtimer(CALLBACK(target, /mob/living.proc/AdjustJitter, -2000 SECONDS, 10), 2 SECONDS) //Still jittery, but vastly less
+2 -3
View File
@@ -32,8 +32,7 @@
..()
/mob/living/carbon/human/proc/mimetouched()
Weaken(7)
Stun(7)
Weaken(14 SECONDS)
if(iswizard(src) || (mind && mind.special_role == SPECIAL_ROLE_WIZARD_APPRENTICE)) //Wizards get non-cursed mime outfit. Replace with mime robes if we add those.
unEquip(wear_mask, TRUE)
unEquip(w_uniform, TRUE)
@@ -41,7 +40,7 @@
equip_to_slot_if_possible(new /obj/item/clothing/mask/gas/mime, slot_wear_mask, TRUE, TRUE)
equip_to_slot_if_possible(new /obj/item/clothing/under/mime, slot_w_uniform, TRUE, TRUE)
equip_to_slot_if_possible(new /obj/item/clothing/suit/suspenders, slot_wear_suit, TRUE, TRUE)
Silence(7)
Silence(14 SECONDS)
else
qdel(wear_mask)
qdel(w_uniform)
+3 -3
View File
@@ -11,8 +11,8 @@
selection_deactivated_message = "<span class='notice'>You decide that your current form is good enough.</span>"
cooldown_min = 200 //100 deciseconds reduction per rank
var/list/protected_roles = list("Wizard","Changeling","Cultist") //which roles are immune to the spell
var/paralysis_amount_caster = 20 //how much the caster is paralysed for after the spell
var/paralysis_amount_victim = 20 //how much the victim is paralysed for after the spell
var/paralysis_amount_caster = 40 SECONDS //how much the caster is paralysed for after the spell
var/paralysis_amount_victim = 40 SECONDS //how much the victim is paralysed for after the spell
action_icon_state = "mindswap"
/obj/effect/proc_holder/spell/mind_transfer/create_new_targeting()
@@ -47,7 +47,7 @@ Also, you never added distance checking after target is selected. I've went ahea
return
var/mob/living/victim = target//The target of the spell whos body will be transferred to.
var/mob/caster = user//The wizard/whomever doing the body transferring.
var/mob/living/caster = user//The wizard/whomever doing the body transferring.
//MIND TRANSFER BEGIN
if(caster.mind.special_verbs.len)//If the caster had any special verbs, remove them from the mob verb list.
+2 -2
View File
@@ -26,14 +26,14 @@
A.throw_at(get_edge_target_turf(H, pick(GLOB.alldirs)), rand(1, 10), 5)
H.visible_message("<span class='danger'>[H]'s [A.name] flies out of their body in a magical explosion!</span>",\
"<span class='danger'>Your [A.name] flies out of your body in a magical explosion!</span>")
H.Weaken(2)
H.Weaken(4 SECONDS)
else
var/obj/effect/decal/cleanable/blood/gibs/G = new/obj/effect/decal/cleanable/blood/gibs(get_turf(H))
spawn()
G.throw_at(get_edge_target_turf(H, pick(GLOB.alldirs)), rand(1, 10), 5)
H.apply_damage(10, BRUTE, "chest")
to_chat(H, "<span class='userdanger'>You have no appendix, but something had to give! Holy shit, what was that?</span>")
H.Weaken(3)
H.Weaken(6 SECONDS)
for(var/obj/item/organ/external/E in H.bodyparts)
if(istype(E, /obj/item/organ/external/head))
continue
+2 -2
View File
@@ -403,7 +403,7 @@
T.range = 5
return T
/obj/effect/proc_holder/spell/aoe_turf/repulse/cast(list/targets, mob/user = usr, stun_amt = 2)
/obj/effect/proc_holder/spell/aoe_turf/repulse/cast(list/targets, mob/user = usr, stun_amt = 4 SECONDS)
var/list/thrownatoms = list()
var/atom/throwtarget
var/distfromcaster
@@ -422,7 +422,7 @@
if(distfromcaster == 0)
if(isliving(AM))
var/mob/living/M = AM
M.Weaken(5)
M.Weaken(10 SECONDS)
M.adjustBruteLoss(5)
to_chat(M, "<span class='userdanger'>You're slammed into the floor by a mystical force!</span>")
else
+3 -3
View File
@@ -336,7 +336,7 @@
/datum/status_effect/speedlegs/tick()
if(owner.stat || owner.staminaloss >= 90 || owner.mind.changeling.chem_charges <= (stacks + 1) * 3)
to_chat(owner, "<span class='danger'>Our muscles relax without the energy to strengthen them.</span>")
owner.Weaken(3)
owner.Weaken(6 SECONDS)
owner.remove_status_effect(STATUS_EFFECT_SPEEDLEGS)
else
stacks++
@@ -352,10 +352,10 @@
/datum/status_effect/speedlegs/on_remove()
REMOVE_TRAIT(owner, TRAIT_GOTTAGOFAST, "changeling")
if(!owner.weakened)
if(!owner.IsWeakened())
to_chat(owner, "<span class='notice'>Our muscles relax.</span>")
if(stacks >= 7)
to_chat(owner, "<span class='danger'>We collapse in exhaustion.</span>")
owner.Weaken(3)
owner.Weaken(6 SECONDS)
owner.emote("gasp")
owner.mind.changeling.geneticdamage += stacks
+455
View File
@@ -148,3 +148,458 @@
/datum/status_effect/pacifism/on_remove()
REMOVE_TRAIT(owner, TRAIT_PACIFISM, id)
// start of `living` level status procs.
/**
* # Confusion
*
* Prevents moving straight, sometimes changing movement direction at random.
* Decays at a rate of 1 per second.
*/
/datum/status_effect/transient/confusion
id = "confusion"
var/image/overlay
/datum/status_effect/transient/confusion/tick()
. = ..()
if(!.)
return
if(!owner.stat) //add or remove the overlay if they are alive or unconscious/dead
add_overlay()
else if(overlay)
owner.cut_overlay(overlay)
overlay = null
/datum/status_effect/transient/confusion/proc/add_overlay()
if(overlay)
return
var/matrix/M = matrix()
M.Scale(0.6)
overlay = image('icons/effects/effects.dmi', "confusion", pixel_y = 20)
overlay.transform = M
owner.add_overlay(overlay)
/datum/status_effect/transient/confusion/on_remove()
owner.cut_overlay(overlay)
overlay = null
return ..()
/**
* # Dizziness
*
* Slightly offsets the client's screen randomly every tick.
* Decays at a rate of 1 per second, or 5 when resting.
*/
/datum/status_effect/transient/dizziness
id = "dizziness"
var/px_diff = 0
var/py_diff = 0
/datum/status_effect/transient/dizziness/on_remove()
if(owner.client)
// smoothly back to normal
animate(owner.client, 0.2 SECONDS, pixel_x = -px_diff, pixel_y = -py_diff, flags = ANIMATION_PARALLEL)
return ..()
/datum/status_effect/transient/dizziness/tick()
. = ..()
if(!.)
return
var/dir = sin(world.time)
px_diff = cos(world.time * 3) * min(strength * 0.2, 32) * dir
py_diff = sin(world.time * 3) * min(strength * 0.2, 32) * dir
owner.client?.pixel_x = px_diff
owner.client?.pixel_y = py_diff
/datum/status_effect/transient/dizziness/calc_decay()
return (-0.2 + (owner.resting ? -0.8 : 0)) SECONDS
/**
* # Drowsiness
*
* Slows down and causes eye blur, with a 5% chance of falling asleep for a short time.
* Decays at a rate of 1 per second, or 5 when resting.
*/
/datum/status_effect/transient/drowsiness
id = "drowsiness"
/datum/status_effect/transient/drowsiness/tick()
. = ..()
if(!.)
return
owner.EyeBlurry(4 SECONDS)
if(prob(5))
owner.AdjustSleeping(2 SECONDS)
owner.Paralyse(10 SECONDS)
/datum/status_effect/transient/drowsiness/calc_decay()
return (-0.2 + (owner.resting ? -0.8 : 0)) SECONDS
/**
* # Drukenness
*
* Causes a myriad of status effects and other afflictions the stronger it is.
* Decays at a rate of 1 per second if no alcohol remains inside.
*/
/datum/status_effect/transient/drunkenness
id = "drunkenness"
var/alert_thrown = FALSE
// the number of seconds of the status effect required for each effect to kick in.
#define THRESHOLD_SLUR 60 SECONDS
#define THRESHOLD_BRAWLING 60 SECONDS
#define THRESHOLD_CONFUSION 80 SECONDS
#define THRESHOLD_SPARK 100 SECONDS
#define THRESHOLD_VOMIT 120 SECONDS
#define THRESHOLD_BLUR 150 SECONDS
#define THRESHOLD_COLLAPSE 150 SECONDS
#define THRESHOLD_FAINT 180 SECONDS
#define THRESHOLD_BRAIN_DAMAGE 240 SECONDS
#define DRUNK_BRAWLING /datum/martial_art/drunk_brawling
/datum/status_effect/transient/drunkenness/on_remove()
if(alert_thrown)
alert_thrown = FALSE
owner.clear_alert("drunk")
owner.sound_environment_override = SOUND_ENVIRONMENT_NONE
return ..()
/datum/status_effect/transient/drunkenness/tick()
. = ..()
if(!.)
return
// Adjust actual drunkenness based on trait and organ presence
var/alcohol_resistance = 1
var/actual_strength = strength
var/datum/mind/M = owner.mind
var/is_ipc = ismachineperson(owner)
if(HAS_TRAIT(owner, TRAIT_ALCOHOL_TOLERANCE))
alcohol_resistance = 2
actual_strength /= alcohol_resistance
var/obj/item/organ/internal/liver/L
if(!is_ipc)
L = owner.get_int_organ(/obj/item/organ/internal/liver)
var/liver_multiplier = 5 // no liver? get shitfaced
if(L)
liver_multiplier = L.alcohol_intensity
actual_strength *= liver_multiplier
// THRESHOLD_SLUR (60 SECONDS)
if(actual_strength >= THRESHOLD_SLUR)
owner.Slur(actual_strength)
if(!alert_thrown)
alert_thrown = TRUE
owner.throw_alert("drunk", /obj/screen/alert/drunk)
owner.sound_environment_override = SOUND_ENVIRONMENT_PSYCHOTIC
// THRESHOLD_BRAWLING (60 SECONDS)
if(M)
if(actual_strength >= THRESHOLD_BRAWLING)
if(!istype(M.martial_art, DRUNK_BRAWLING))
var/datum/martial_art/MA = new
MA.teach(owner, TRUE)
else if(istype(M.martial_art, DRUNK_BRAWLING))
M.martial_art.remove(src)
// THRESHOLD_CONFUSION (80 SECONDS)
if(actual_strength >= THRESHOLD_CONFUSION && prob(3.3))
owner.AdjustConfused(6 SECONDS / alcohol_resistance, bound_lower = 2 SECONDS, bound_upper = 1 MINUTES)
owner.AdjustDizzy(6 SECONDS / alcohol_resistance, bound_lower = 2 SECONDS, bound_upper = 2 MINUTES)
// THRESHOLD_SPARK (100 SECONDS)
if(is_ipc && actual_strength >= THRESHOLD_SPARK && prob(2.5))
do_sparks(3, 1, owner)
// THRESHOLD_VOMIT (120 SECONDS)
if(!is_ipc && actual_strength >= THRESHOLD_VOMIT && prob(0.8))
owner.fakevomit()
// THRESHOLD_BLUR (150 SECONDS)
if(actual_strength >= THRESHOLD_BLUR)
owner.EyeBlurry(20 SECONDS / alcohol_resistance)
// THRESHOLD_COLLAPSE (150 SECONDS)
if(actual_strength >= THRESHOLD_COLLAPSE && prob(1))
owner.emote("collapse")
do_sparks(3, 1, src)
// THRESHOLD_FAINT (180 SECONDS)
if(actual_strength >= THRESHOLD_FAINT && prob(1))
owner.Paralyse(10 SECONDS / alcohol_resistance)
owner.Drowsy(60 SECONDS / alcohol_resistance)
if(L)
L.receive_damage(1, TRUE)
if(!is_ipc)
owner.adjustToxLoss(1)
// THRESHOLD_BRAIN_DAMAGE (240 SECONDS)
if(actual_strength >= THRESHOLD_BRAIN_DAMAGE && prob(1))
owner.adjustBrainLoss(1)
#undef THRESHOLD_SLUR
#undef THRESHOLD_BRAWLING
#undef THRESHOLD_CONFUSION
#undef THRESHOLD_SPARK
#undef THRESHOLD_VOMIT
#undef THRESHOLD_BLUR
#undef THRESHOLD_COLLAPSE
#undef THRESHOLD_FAINT
#undef THRESHOLD_BRAIN_DAMAGE
#undef DRUNK_BRAWLING
/datum/status_effect/transient/drunkenness/calc_decay()
if(ishuman(owner))
var/mob/living/carbon/human/H = owner
if(H.has_booze())
return 0
return -0.2 SECONDS
/datum/status_effect/transient/cult_slurring
id = "cult_slurring"
/datum/status_effect/incapacitating
tick_interval = 0
status_type = STATUS_EFFECT_REPLACE
alert_type = null
var/needs_update_stat = FALSE
/datum/status_effect/incapacitating/on_creation(mob/living/new_owner, set_duration)
if(isnum(set_duration))
if(ishuman(new_owner))
var/mob/living/carbon/human/H = new_owner
set_duration = H.dna.species.spec_stun(H, set_duration)
duration = set_duration
if(!duration)
return FALSE
. = ..()
if(. && (needs_update_stat || issilicon(owner)))
owner.update_stat()
owner.update_canmove()
/datum/status_effect/incapacitating/on_remove()
if(needs_update_stat || issilicon(owner)) //silicons need stat updates in addition to normal canmove updates
owner.update_stat()
owner.update_canmove()
return ..()
//STUN - prevents movement and actions, victim stays standing
/datum/status_effect/incapacitating/stun
id = "stun"
//IMMOBILIZED - prevents movement, victim can still stand and act
/datum/status_effect/incapacitating/immobilized
id = "immobilized"
//WEAKENED - prevents movement and action, victim falls over
/datum/status_effect/incapacitating/weakened
id = "weakened"
//PARALYZED - prevents movement and action, victim falls over, victim cannot hear or see.
/datum/status_effect/incapacitating/paralyzed
id = "paralyzed"
needs_update_stat = TRUE
//SLEEPING - victim falls over, cannot act, cannot see or hear, heals under certain conditions.
/datum/status_effect/incapacitating/sleeping
id = "sleeping"
tick_interval = 2 SECONDS
needs_update_stat = TRUE
/datum/status_effect/incapacitating/sleeping/tick()
if(!iscarbon(owner))
return
var/mob/living/carbon/dreamer = owner
if(dreamer.mind?.has_antag_datum(/datum/antagonist/vampire))
if(istype(dreamer.loc, /obj/structure/closet/coffin))
dreamer.adjustBruteLoss(-1, FALSE)
dreamer.adjustFireLoss(-1, FALSE)
dreamer.adjustToxLoss(-1)
dreamer.handle_dreams()
dreamer.adjustStaminaLoss(-10)
var/comfort = 1
if(istype(dreamer.buckled, /obj/structure/bed))
var/obj/structure/bed/bed = dreamer.buckled
comfort += bed.comfort
for(var/obj/item/bedsheet/bedsheet in range(dreamer.loc,0))
if(bedsheet.loc != dreamer.loc) //bedsheets in your backpack/neck don't give you comfort
continue
comfort += bedsheet.comfort
break //Only count the first bedsheet
if(dreamer.get_drunkenness() > 0)
comfort += 1 //Aren't naps SO much better when drunk?
dreamer.AdjustDrunk(-0.4 SECONDS * comfort) //reduce drunkenness while sleeping.
if(comfort > 1 && prob(3))//You don't heal if you're just sleeping on the floor without a blanket.
dreamer.adjustBruteLoss(-1 * comfort, FALSE)
dreamer.adjustFireLoss(-1 * comfort)
if(prob(10) && dreamer.health && dreamer.health_hud_override != HEALTH_HUD_OVERRIDE_CRIT)
dreamer.emote("snore")
//SLOWED - slows down the victim for a duration and a given slowdown value.
/datum/status_effect/incapacitating/slowed
id = "slowed"
var/slowdown_value = 10 // defaults to this value if none is specified
/datum/status_effect/incapacitating/slowed/on_creation(mob/living/new_owner, set_duration, _slowdown_value)
. = ..()
if(isnum(_slowdown_value))
slowdown_value = _slowdown_value
/datum/status_effect/transient/silence
id = "silenced"
/datum/status_effect/transient/silence/on_apply()
. = ..()
ADD_TRAIT(owner, TRAIT_MUTE, id)
/datum/status_effect/transient/silence/on_remove()
. = ..()
REMOVE_TRAIT(owner, TRAIT_MUTE, id)
/datum/status_effect/transient/jittery
id = "jittering"
/datum/status_effect/transient/jittery/on_apply()
. = ..()
owner.do_jitter_animation(strength / 20, 1)
/datum/status_effect/transient/jittery/tick()
. = ..()
if(!.)
return
owner.do_jitter_animation(strength / 20, 1)
/datum/status_effect/transient/jittery/calc_decay()
return (-0.2 + (owner.resting ? -0.8 : 0)) SECONDS
/datum/status_effect/transient/stammering
id = "stammer"
/datum/status_effect/transient/slurring
id = "slurring"
/datum/status_effect/transient/lose_breath
id = "lose_breath"
#define HALLUCINATE_COOLDOWN_MIN 20 SECONDS
#define HALLUCINATE_COOLDOWN_MAX 50 SECONDS
/// This is multiplied with [/mob/var/hallucination] to determine the final cooldown. A higher hallucination value means shorter cooldown.
#define HALLUCINATE_COOLDOWN_FACTOR 0.003
/// Percentage defining the chance at which an hallucination may spawn past the cooldown.
#define HALLUCINATE_CHANCE 8
// Severity weights, should sum up to 100!
#define HALLUCINATE_MINOR_WEIGHT 60
#define HALLUCINATE_MODERATE_WEIGHT 30
#define HALLUCINATE_MAJOR_WEIGHT 10
/datum/status_effect/transient/hallucination
id = "hallucination"
var/next_hallucination = 0
/datum/status_effect/transient/hallucination/tick()
. = ..()
if(!.)
return
if(next_hallucination > world.time)
return
next_hallucination = world.time + rand(HALLUCINATE_COOLDOWN_MIN, HALLUCINATE_COOLDOWN_MAX) / (strength * HALLUCINATE_COOLDOWN_FACTOR)
if(!prob(HALLUCINATE_CHANCE))
return
// Pick a severity
var/severity = HALLUCINATE_MINOR
switch(rand(100))
if(0 to HALLUCINATE_MINOR_WEIGHT)
severity = HALLUCINATE_MINOR
if((HALLUCINATE_MINOR_WEIGHT + 1) to (HALLUCINATE_MINOR_WEIGHT + HALLUCINATE_MODERATE_WEIGHT))
severity = HALLUCINATE_MODERATE
if((HALLUCINATE_MINOR_WEIGHT + HALLUCINATE_MODERATE_WEIGHT + 1) to 100)
severity = HALLUCINATE_MAJOR
hallucinate(pickweight(GLOB.hallucinations[severity]))
/**
* Spawns an hallucination for the mob.
*
* Arguments:
* * H - The type path of the hallucination to spawn.
*/
/datum/status_effect/transient/hallucination/proc/hallucinate(hallucination_type)
ASSERT(ispath(hallucination_type))
if(owner.ckey)
add_attack_logs(null, owner, "Received hallucination [hallucination_type]", ATKLOG_ALL)
return new hallucination_type(get_turf(owner), owner)
#undef HALLUCINATE_COOLDOWN_MIN
#undef HALLUCINATE_COOLDOWN_MAX
#undef HALLUCINATE_COOLDOWN_FACTOR
#undef HALLUCINATE_CHANCE
#undef HALLUCINATE_MINOR_WEIGHT
#undef HALLUCINATE_MODERATE_WEIGHT
#undef HALLUCINATE_MAJOR_WEIGHT
/datum/status_effect/transient/eye_blurry
id = "eye_blurry"
/datum/status_effect/transient/eye_blurry/on_apply()
owner.update_blurry_effects()
. = ..()
/datum/status_effect/transient/eye_blurry/on_remove()
owner.update_blurry_effects()
/datum/status_effect/transient/eye_blurry/calc_decay()
if(ishuman(owner))
var/mob/living/carbon/human/H = owner
if(isnull(H.dna.species.vision_organ)) //species has no eyes
return ..()
var/obj/item/organ/vision = H.get_int_organ(H.dna.species.vision_organ)
if(!vision || vision.is_bruised() || vision.is_broken()) // doesn't decay if you have damaged eyesight.
return 0
if(istype(H.glasses, /obj/item/clothing/glasses/sunglasses/blindfold)) // decays faster if you rest your eyes with a blindfold.
return -1 SECONDS
return ..() //default decay rate
/datum/status_effect/transient/blindness
id = "blindness"
/datum/status_effect/transient/blindness/on_apply()
. = ..()
owner.update_blind_effects()
/datum/status_effect/transient/blindness/on_remove()
owner.update_blind_effects()
/datum/status_effect/transient/blindness/calc_decay()
if(ishuman(owner))
var/mob/living/carbon/human/H = owner
if(HAS_TRAIT(owner, TRAIT_BLIND))
return 0
if(isnull(H.dna.species.vision_organ)) // species that have no eyes
return ..()
var/obj/item/organ/vision = H.get_int_organ(H.dna.species.vision_organ)
if(!vision || vision.is_broken() || vision.is_bruised()) //got no eyes or broken eyes
return 0
return ..() //default decay rate
/datum/status_effect/transient/drugged
id = "drugged"
/datum/status_effect/transient/drugged/on_apply()
. = ..()
owner.update_druggy_effects()
/datum/status_effect/transient/drugged/on_remove()
owner.update_druggy_effects()
+33 -1
View File
@@ -51,7 +51,7 @@
if(!owner)
qdel(src)
return
if(tick_interval < world.time)
if(tick_interval <= world.time)
tick()
tick_interval = world.time + initial(tick_interval)
if(duration != -1 && duration < world.time)
@@ -272,3 +272,35 @@
/datum/status_effect/grouped/before_remove(source)
sources -= source
return !length(sources)
/**
* # Transient Status Effect (basetype)
*
* A status effect that works off a (possibly decimal) counter before expiring, rather than a specified world.time.
* This allows for a more precise tweaking of status durations at runtime (e.g. paralysis).
*/
/datum/status_effect/transient
tick_interval = 0.2 SECONDS // SSfastprocess interval
alert_type = null
/// How much strength left before expiring? time in deciseconds.
var/strength = 0
/datum/status_effect/transient/on_creation(mob/living/new_owner, set_duration)
if(isnum(set_duration))
strength = set_duration
. = ..()
/datum/status_effect/transient/tick()
if(QDELETED(src) || QDELETED(owner))
return FALSE
. = TRUE
strength += calc_decay()
if(strength <= 0)
qdel(src)
return FALSE
/**
* Returns how much strength should be adjusted per tick.
*/
/datum/status_effect/transient/proc/calc_decay()
return -0.2 SECONDS // 1 per second by default