|
4 | 4 | restricted = TRUE
|
5 | 5 | max_multiplier = 5
|
6 | 6 | chance = 6
|
7 |
| - var/sound = FALSE |
8 | 7 | badness = EFFECT_DANGER_DEADLY
|
9 | 8 | severity = 5
|
| 9 | + var/sound = FALSE |
| 10 | + var/final_timer |
10 | 11 |
|
11 |
| -/datum/symptom/heart_failure/activate(mob/living/carbon/affected_mob) |
| 12 | +/datum/symptom/heart_failure/Destroy(force) |
| 13 | + if(final_timer) |
| 14 | + deltimer(final_timer) |
| 15 | + final_timer = null |
| 16 | + return ..() |
| 17 | + |
| 18 | +/datum/symptom/heart_failure/activate(mob/living/carbon/affected_mob, datum/disease/acute/disease) |
12 | 19 | . = ..()
|
13 | 20 | if(ismouse(affected_mob))
|
14 | 21 | affected_mob.death()
|
15 | 22 | return FALSE
|
16 | 23 |
|
17 |
| - if(!affected_mob.can_heartattack() && !HAS_TRAIT(affected_mob, TRAIT_STABLEHEART)) //This was so stupid. We had 9 people round removed with no fix other than admins because of this. |
18 |
| - affected_mob.death() |
19 |
| - return FALSE |
| 24 | + if(!affected_mob.can_heartattack()) |
| 25 | + disease?.cure(target = affected_mob) |
| 26 | + return |
| 27 | + else if(final_timer || affected_mob.undergoing_cardiac_arrest()) // don't bother ticking if their heart has already stopped or is getting ready to |
| 28 | + return |
20 | 29 |
|
21 | 30 | switch(round(multiplier))
|
22 | 31 | if(1 to 2)
|
|
29 | 38 | to_chat(affected_mob, span_warning("You feel [pick("full", "nauseated", "sweaty", "weak", "tired", "short of breath", "uneasy")]."))
|
30 | 39 | if(3 to 4)
|
31 | 40 | if(!sound)
|
32 |
| - affected_mob.playsound_local(affected_mob, 'sound/health/slowbeat.ogg', 40, FALSE, channel = CHANNEL_HEARTBEAT, use_reverb = FALSE) |
| 41 | + affected_mob.playsound_local(affected_mob, 'sound/health/slowbeat.ogg', vol = 40, vary = FALSE, channel = CHANNEL_HEARTBEAT, pressure_affected = FALSE, use_reverb = FALSE) |
33 | 42 | sound = TRUE
|
34 | 43 | if(prob(7.5))
|
35 | 44 | to_chat(affected_mob, span_danger("You feel a sharp pain in your chest!"))
|
36 | 45 | if(prob(30))
|
37 | 46 | affected_mob.vomit(95)
|
38 | 47 | affected_mob.emote("cough")
|
39 |
| - affected_mob.Paralyze(40) |
| 48 | + affected_mob.Paralyze(4 SECONDS) |
40 | 49 | affected_mob.losebreath += 4
|
41 | 50 | if(prob(7.5))
|
42 | 51 | to_chat(affected_mob, span_danger("You feel very weak and dizzy..."))
|
|
45 | 54 | affected_mob.emote("cough")
|
46 | 55 | if(5)
|
47 | 56 | affected_mob.stop_sound_channel(CHANNEL_HEARTBEAT)
|
48 |
| - affected_mob.playsound_local(affected_mob, 'sound/effects/singlebeat.ogg', 100, FALSE, use_reverb = FALSE) |
49 |
| - if(affected_mob.stat == CONSCIOUS) |
50 |
| - affected_mob.visible_message(span_danger("[affected_mob] clutches at [affected_mob.p_their()] chest as if [affected_mob.p_their()] heart is stopping!"), \ |
51 |
| - span_userdanger("You feel a terrible pain in your chest, as if your heart has stopped!")) |
| 57 | + affected_mob.playsound_local(affected_mob, 'sound/effects/singlebeat.ogg', vol = 100, vary = FALSE, channel = CHANNEL_HEARTBEAT, pressure_affected = FALSE, use_reverb = FALSE) |
52 | 58 | affected_mob.stamina.adjust(-60, FALSE)
|
53 |
| - affected_mob.set_heartattack(TRUE) |
54 |
| - affected_mob.reagents.add_reagent(/datum/reagent/medicine/c2/penthrite, 3) // To give the victim a final chance to shock their heart before losing consciousness |
| 59 | + // To give the victim a final chance to shock their heart before losing consciousness |
| 60 | + final_timer = addtimer(CALLBACK(src, PROC_REF(finally_stop_heart), affected_mob), 5 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE | TIMER_STOPPABLE) |
55 | 61 | return FALSE
|
56 | 62 | multiplier_tweak(0.1)
|
57 | 63 |
|
| 64 | +/datum/symptom/heart_failure/deactivate(mob/living/carbon/affected_mob, datum/disease/acute/disease) |
| 65 | + . = ..() |
| 66 | + if(final_timer) |
| 67 | + deltimer(final_timer) |
| 68 | + final_timer = null |
| 69 | + if(iscarbon(affected_mob)) |
| 70 | + affected_mob.set_heartattack(FALSE) |
| 71 | + |
| 72 | +/datum/symptom/heart_failure/proc/finally_stop_heart(mob/living/carbon/target) |
| 73 | + final_timer = null |
| 74 | + if(!QDELETED(src) && !QDELETED(target)) |
| 75 | + target.set_heartattack(TRUE) |
| 76 | + |
58 | 77 | /datum/symptom/catapult_sneeze
|
59 | 78 | name = "Sneezing?"
|
60 | 79 | desc = "The virus causes irritation of the nasal cavity, making the host sneeze occasionally. Sneezes from this symptom will spread the virus in a 4 meter cone in front of the host."
|
|
0 commit comments