mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-09 14:15:22 +01:00
[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:
@@ -126,13 +126,14 @@
|
||||
return 0.99
|
||||
if(M.reagents.has_reagent("morphine"))//Just as effective as Hydrocodone, but has an addiction chance
|
||||
return 0.99
|
||||
if(M.drunk >= 80)//really damn drunk
|
||||
var/drunk = M.get_drunkenness()
|
||||
if(drunk >= 80)//really damn drunk
|
||||
return 0.95
|
||||
if(M.drunk >= 40)//pretty drunk
|
||||
if(drunk >= 40)//pretty drunk
|
||||
return 0.9
|
||||
if(M.reagents.has_reagent("sal_acid")) //it's better than nothing, as far as painkillers go.
|
||||
return 0.85
|
||||
if(M.drunk >= 15)//a little drunk
|
||||
if(drunk >= 15)//a little drunk
|
||||
return 0.85
|
||||
return 0.8 //20% failure chance
|
||||
|
||||
@@ -151,9 +152,9 @@
|
||||
/proc/can_operate(mob/living/carbon/M)
|
||||
if(locate(/obj/machinery/optable, M.loc) && (M.lying || M.resting))
|
||||
return TRUE
|
||||
if(locate(/obj/structure/bed, M.loc) && (M.buckled || M.lying || M.IsWeakened() || M.stunned || M.paralysis || M.sleeping || M.stat))
|
||||
if(locate(/obj/structure/bed, M.loc) && (M.buckled || M.lying || M.IsWeakened() || M.IsStunned() || M.IsParalyzed() || M.IsSleeping() || M.stat))
|
||||
return TRUE
|
||||
if(locate(/obj/structure/table, M.loc) && (M.lying || M.IsWeakened() || M.stunned || M.paralysis || M.sleeping || M.stat))
|
||||
if(locate(/obj/structure/table, M.loc) && (M.lying || M.IsWeakened() || M.IsStunned() || M.IsParalyzed() || M.IsSleeping() || M.stat))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
/obj/item/organ/internal/cyberimp/brain/emp_act(severity)
|
||||
if(!owner || emp_proof)
|
||||
return
|
||||
var/stun_amount = 5 + (severity-1 ? 0 : 5)
|
||||
var/stun_amount = (5 + (severity-1 ? 0 : 5)) STATUS_EFFECT_CONSTANT
|
||||
owner.Stun(stun_amount)
|
||||
to_chat(owner, "<span class='warning'>Your body seizes up!</span>")
|
||||
return stun_amount
|
||||
@@ -126,7 +126,7 @@
|
||||
implant_color = "#FFFF00"
|
||||
slot = "brain_antistun"
|
||||
origin_tech = "materials=5;programming=4;biotech=5"
|
||||
var/stun_max_amount = 2
|
||||
var/stun_max_amount = 4 SECONDS
|
||||
|
||||
/obj/item/organ/internal/cyberimp/brain/anti_stun/hardened
|
||||
name = "Hardened CNS Rebooter implant"
|
||||
@@ -140,9 +140,9 @@
|
||||
..()
|
||||
if(crit_fail)
|
||||
return
|
||||
if(owner.stunned > stun_max_amount)
|
||||
if(owner.AmountStun() > stun_max_amount)
|
||||
owner.SetStunned(stun_max_amount)
|
||||
if(owner.weakened > stun_max_amount)
|
||||
if(owner.AmountWeakened() > stun_max_amount)
|
||||
owner.SetWeakened(stun_max_amount)
|
||||
|
||||
/obj/item/organ/internal/cyberimp/brain/anti_stun/emp_act(severity)
|
||||
@@ -174,8 +174,8 @@
|
||||
if(crit_fail)
|
||||
return
|
||||
if(owner.stat == UNCONSCIOUS && cooldown == FALSE)
|
||||
owner.AdjustSleeping(-100, FALSE)
|
||||
owner.AdjustParalysis(-100, FALSE)
|
||||
owner.AdjustSleeping(-200 SECONDS)
|
||||
owner.AdjustParalysis(-200 SECONDS)
|
||||
to_chat(owner, "<span class='notice'>You feel a rush of energy course through your body!</span>")
|
||||
cooldown = TRUE
|
||||
addtimer(CALLBACK(src, .proc/sleepy_timer_end), 50)
|
||||
@@ -189,7 +189,7 @@
|
||||
if(crit_fail || emp_proof)
|
||||
return
|
||||
crit_fail = TRUE
|
||||
owner.AdjustSleeping(200)
|
||||
owner.AdjustSleeping(400 SECONDS)
|
||||
cooldown = TRUE
|
||||
addtimer(CALLBACK(src, .proc/reboot), 90 / severity)
|
||||
|
||||
@@ -283,7 +283,7 @@
|
||||
return
|
||||
if(prob(60/severity) && owner)
|
||||
to_chat(owner, "<span class='warning'>Your breathing tube suddenly closes!</span>")
|
||||
owner.AdjustLoseBreath(2)
|
||||
owner.AdjustLoseBreath(4 SECONDS)
|
||||
|
||||
//[[[[CHEST]]]]
|
||||
/obj/item/organ/internal/cyberimp/chest
|
||||
@@ -397,6 +397,8 @@
|
||||
reviving = TRUE
|
||||
|
||||
/obj/item/organ/internal/cyberimp/chest/reviver/proc/heal()
|
||||
if(QDELETED(owner))
|
||||
return
|
||||
if(prob(90) && owner.getOxyLoss())
|
||||
owner.adjustOxyLoss(-3)
|
||||
revive_cost += 5
|
||||
|
||||
@@ -37,12 +37,12 @@
|
||||
if(BLOOD_VOLUME_BAD to BLOOD_VOLUME_OKAY)
|
||||
apply_damage_type(round((BLOOD_VOLUME_NORMAL - blood_volume) * 0.02, 1), dna.species.blood_damage_type)
|
||||
if(prob(5))
|
||||
EyeBlurry(6)
|
||||
EyeBlurry(12 SECONDS)
|
||||
to_chat(src, "<span class='warning'>You feel very [word].</span>")
|
||||
if(BLOOD_VOLUME_SURVIVE to BLOOD_VOLUME_BAD)
|
||||
apply_damage_type(5, dna.species.blood_damage_type)
|
||||
if(prob(15))
|
||||
Paralyse(rand(1,3))
|
||||
Paralyse(rand(2 SECONDS, 6 SECONDS))
|
||||
to_chat(src, "<span class='warning'>You feel extremely [word].</span>")
|
||||
if(-INFINITY to BLOOD_VOLUME_SURVIVE)
|
||||
death()
|
||||
|
||||
@@ -215,10 +215,10 @@
|
||||
|
||||
if(!(status & ORGAN_DEAD))
|
||||
var/boost = emagged ? 2 : 1
|
||||
owner.AdjustDrowsy(-4 * boost)
|
||||
owner.AdjustParalysis(-1 * boost)
|
||||
owner.AdjustStunned(-1 * boost)
|
||||
owner.AdjustWeakened(-1 * boost)
|
||||
owner.AdjustDrowsy(-8 SECONDS * boost)
|
||||
owner.AdjustParalysis(-2 SECONDS * boost)
|
||||
owner.AdjustStunned(-2 SECONDS * boost)
|
||||
owner.AdjustWeakened(-2 SECONDS * boost)
|
||||
owner.SetSleeping(0)
|
||||
owner.adjustStaminaLoss(-1 * boost)
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
if(!is_robotic() || emp_proof)
|
||||
return
|
||||
if(owner)
|
||||
owner.LoseBreath(20)
|
||||
owner.LoseBreath(40 SECONDS)
|
||||
|
||||
/obj/item/organ/internal/lungs/insert(mob/living/carbon/M, special = 0, dont_remove_slot = 0)
|
||||
..()
|
||||
@@ -81,7 +81,7 @@
|
||||
owner.bleed(1)
|
||||
if(prob(4))
|
||||
owner.custom_emote(1, "gasps for air!")
|
||||
owner.AdjustLoseBreath(5)
|
||||
owner.AdjustLoseBreath(10 SECONDS)
|
||||
|
||||
/obj/item/organ/internal/lungs/proc/check_breath(datum/gas_mixture/breath, mob/living/carbon/human/H)
|
||||
if((H.status_flags & GODMODE))
|
||||
@@ -180,7 +180,7 @@
|
||||
if(!H.co2overloadtime) // If it's the first breath with too much CO2 in it, lets start a counter, then have them pass out after 12s or so.
|
||||
H.co2overloadtime = world.time
|
||||
else if(world.time - H.co2overloadtime > 120)
|
||||
H.Paralyse(3)
|
||||
H.Paralyse(6 SECONDS)
|
||||
H.apply_damage_type(HUMAN_MAX_OXYLOSS, co2_damage_type) // Lets hurt em a little, let them know we mean business
|
||||
if(world.time - H.co2overloadtime > 300) // They've been in here 30s now, lets start to kill them for their own good!
|
||||
H.apply_damage_type(15, co2_damage_type)
|
||||
@@ -240,9 +240,9 @@
|
||||
|
||||
if(breath.sleeping_agent) // If there's some other shit in the air lets deal with it here.
|
||||
if(SA_pp > SA_para_min)
|
||||
H.Paralyse(3) // 3 gives them one second to wake up and run away a bit!
|
||||
H.Paralyse(6 SECONDS) // 6 seconds gives them one second to wake up and run away a bit!
|
||||
if(SA_pp > SA_sleep_min) // Enough to make us sleep as well
|
||||
H.AdjustSleeping(8, bound_lower = 0, bound_upper = 10)
|
||||
H.AdjustSleeping(16 SECONDS, bound_lower = 0, bound_upper = 20 SECONDS)
|
||||
else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
|
||||
if(prob(20))
|
||||
H.emote(pick("giggle", "laugh"))
|
||||
|
||||
@@ -457,7 +457,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
status &= ~ORGAN_SPLINTED //oh no, we actually need surgery now!
|
||||
owner.visible_message("<span class='danger'>[owner] screams in pain as [owner.p_their()] splint pops off their [name]!</span>","<span class='userdanger'>You scream in pain as your splint pops off your [name]!</span>")
|
||||
owner.emote("scream")
|
||||
owner.Stun(2)
|
||||
owner.Stun(4 SECONDS)
|
||||
owner.handle_splints()
|
||||
|
||||
|
||||
|
||||
@@ -232,15 +232,15 @@
|
||||
organhonked = world.time + suffering_delay
|
||||
to_chat(owner, "<font color='red' size='7'>HONK</font>")
|
||||
owner.SetSleeping(0)
|
||||
owner.Stuttering(20)
|
||||
owner.Stuttering(40 SECONDS)
|
||||
owner.AdjustEarDamage(0, 30)
|
||||
owner.Weaken(3)
|
||||
owner.Weaken(6 SECONDS)
|
||||
SEND_SOUND(owner, sound('sound/items/airhorn.ogg'))
|
||||
if(prob(30))
|
||||
owner.Stun(10)
|
||||
owner.Paralyse(4)
|
||||
owner.Stun(20 SECONDS)
|
||||
owner.Paralyse(8 SECONDS)
|
||||
else
|
||||
owner.Jitter(500)
|
||||
owner.Jitter(1000 SECONDS)
|
||||
|
||||
if(ishuman(owner))
|
||||
var/mob/living/carbon/human/H = owner
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
S.immediate_ventcrawl = TRUE
|
||||
eggs_hatched++
|
||||
to_chat(owner, "<span class='warning'>A strange prickling sensation moves across your skin... then suddenly the whole world seems to spin around you!</span>")
|
||||
owner.Paralyse(10)
|
||||
owner.Paralyse(20 SECONDS)
|
||||
if(infection_completed && !QDELETED(src))
|
||||
qdel(src)
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
..()
|
||||
if(!owner || !is_robotic() || emp_proof || !tough) // Augmented legs and feet make the user drop to the floor on EMP.
|
||||
return
|
||||
if(owner.weakened)
|
||||
if(owner.AmountWeakened())
|
||||
to_chat(owner, "<span class='userdanger'>Your [name] malfunctions, preventing you from getting back up!</span>")
|
||||
owner.custom_emote(1, "is unable to get back up, [owner.p_their()] [name] malfunctioning!")
|
||||
else
|
||||
@@ -98,9 +98,9 @@
|
||||
owner.custom_emote(1, "drops to the ground, [owner.p_their()] [name] malfunctioning!")
|
||||
switch(severity)
|
||||
if(1)
|
||||
owner.AdjustWeakened(4)
|
||||
owner.AdjustWeakened(8 SECONDS)
|
||||
if(2)
|
||||
owner.AdjustWeakened(2)
|
||||
owner.AdjustWeakened(4 SECONDS)
|
||||
|
||||
/obj/item/organ/external/leg/right
|
||||
limb_name = "r_leg"
|
||||
@@ -128,7 +128,7 @@
|
||||
..()
|
||||
if(!owner || !is_robotic() || emp_proof || !tough) // Augmented legs and feet make the user drop to the floor on EMP.
|
||||
return
|
||||
if(owner.weakened)
|
||||
if(owner.AmountWeakened())
|
||||
to_chat(owner, "<span class='userdanger'>Your [name] malfunctions, preventing you from getting back up!</span>")
|
||||
owner.custom_emote(1, "is unable to get back up, [owner.p_their()] [name] malfunctioning!")
|
||||
else
|
||||
@@ -136,9 +136,9 @@
|
||||
owner.custom_emote(1, "drops to the ground, [owner.p_their()] [name] malfunctioning!")
|
||||
switch(severity)
|
||||
if(1)
|
||||
owner.AdjustWeakened(4)
|
||||
owner.AdjustWeakened(8 SECONDS)
|
||||
if(2)
|
||||
owner.AdjustWeakened(2)
|
||||
owner.AdjustWeakened(4 SECONDS)
|
||||
|
||||
/obj/item/organ/external/foot/remove()
|
||||
if(owner && owner.shoes) owner.unEquip(owner.shoes)
|
||||
@@ -284,7 +284,7 @@
|
||||
return
|
||||
switch(severity)
|
||||
if(1)
|
||||
owner?.AdjustConfused(30)
|
||||
owner?.AdjustConfused(60 SECONDS)
|
||||
if(2)
|
||||
owner?.AdjustConfused(20)
|
||||
owner?.AdjustConfused(40 SECONDS)
|
||||
to_chat(owner, "<span class='userdanger'>Your [name] malfunctions, overloading your motor control!</span>")
|
||||
|
||||
@@ -217,21 +217,21 @@ GLOBAL_DATUM_INIT(multispin_words, /regex, regex("like a record baby"))
|
||||
if(findtext(message, GLOB.stun_words))
|
||||
for(var/V in listeners)
|
||||
var/mob/living/L = V
|
||||
L.Stun(3 * power_multiplier)
|
||||
L.Stun(6 SECONDS * power_multiplier)
|
||||
next_command = world.time + cooldown_stun
|
||||
|
||||
//WEAKEN
|
||||
else if(findtext(message, GLOB.weaken_words))
|
||||
for(var/V in listeners)
|
||||
var/mob/living/L = V
|
||||
L.Weaken(3 * power_multiplier)
|
||||
L.Weaken(6 SECONDS * power_multiplier)
|
||||
next_command = world.time + cooldown_stun
|
||||
|
||||
//SLEEP
|
||||
else if((findtext(message, GLOB.sleep_words)))
|
||||
for(var/V in listeners)
|
||||
var/mob/living/L = V
|
||||
L.Sleeping(2 * power_multiplier)
|
||||
L.Sleeping(4 SECONDS * power_multiplier)
|
||||
next_command = world.time + cooldown_stun
|
||||
|
||||
//VOMIT
|
||||
@@ -245,7 +245,7 @@ GLOBAL_DATUM_INIT(multispin_words, /regex, regex("like a record baby"))
|
||||
for(var/mob/living/carbon/C in listeners)
|
||||
if(owner.mind && (owner.mind.assigned_role == "Librarian" || owner.mind.assigned_role == "Mime"))
|
||||
power_multiplier *= 3
|
||||
C.silent += (10 * power_multiplier)
|
||||
C.AdjustSilence(20 SECONDS * power_multiplier)
|
||||
next_command = world.time + cooldown_stun
|
||||
|
||||
//HALLUCINATE
|
||||
@@ -470,7 +470,7 @@ GLOBAL_DATUM_INIT(multispin_words, /regex, regex("like a record baby"))
|
||||
playsound(get_turf(owner), 'sound/items/bikehorn.ogg', 300, 1)
|
||||
if(owner.mind && owner.mind.assigned_role == "Clown")
|
||||
for(var/mob/living/carbon/C in listeners)
|
||||
C.slip("your feet", 0, 7 * power_multiplier)
|
||||
C.slip("your feet", 14 SECONDS * power_multiplier)
|
||||
next_command = world.time + cooldown_stun
|
||||
else
|
||||
next_command = world.time + cooldown_meme
|
||||
|
||||
Reference in New Issue
Block a user