Skip to content

Commit 8fff2c0

Browse files
AbsolucyTheRyeGuyWhoWillNowDieMrMelbert
authored
finally make heart worms not a royal pain in the ass to deal with (#5454)
## About The Pull Request Ports tgstation/tgstation#82738 Fixes #5450 this also makes heart worms self-cure whenever the victim no longer needs a heart ## Why It's Good For The Game this stupid thing is a pain in everyone's ass ## Changelog :cl: fix: (TheRyeGuyWhoWillNowDie) Being revived with a cyber-heart now properly restarts the cyber heart. fix: Heart worms will now self-cure if the victim no longer needs a heart. /:cl: --------- Co-authored-by: TheRyeGuyWhoWillNowDie <[email protected]> Co-authored-by: MrMelbert <[email protected]>
1 parent cd66866 commit 8fff2c0

File tree

3 files changed

+46
-14
lines changed

3 files changed

+46
-14
lines changed

code/modules/mob/living/carbon/life.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@
479479
return TRUE
480480

481481
/mob/living/carbon/proc/set_heartattack(status)
482-
if(!can_heartattack())
482+
if(status && !can_heartattack())
483483
return FALSE
484484

485485
var/obj/item/organ/internal/heart/heart = get_organ_slot(ORGAN_SLOT_HEART)

monkestation/code/modules/virology/disease/premades/heart_attack.dm

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,16 @@
1414
infectionchance_base = 0
1515
stage_variance = 0
1616
severity = DISEASE_SEVERITY_DANGEROUS
17+
18+
/datum/disease/acute/premade/heart_failure/activate(mob/living/mob, starved, seconds_per_tick)
19+
if(iscarbon(mob))
20+
var/mob/living/carbon/carbon_mob = mob
21+
if(!carbon_mob.can_heartattack())
22+
cure(target = mob)
23+
return
24+
return ..()
25+
26+
/datum/disease/acute/premade/heart_failure/cure(add_resistance, mob/living/carbon/target)
27+
if(iscarbon(target))
28+
target.set_heartattack(FALSE)
29+
return ..()

monkestation/code/modules/virology/disease/symtoms/restricted/stage4.dm

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,28 @@
44
restricted = TRUE
55
max_multiplier = 5
66
chance = 6
7-
var/sound = FALSE
87
badness = EFFECT_DANGER_DEADLY
98
severity = 5
9+
var/sound = FALSE
10+
var/final_timer
1011

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)
1219
. = ..()
1320
if(ismouse(affected_mob))
1421
affected_mob.death()
1522
return FALSE
1623

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
2029

2130
switch(round(multiplier))
2231
if(1 to 2)
@@ -29,14 +38,14 @@
2938
to_chat(affected_mob, span_warning("You feel [pick("full", "nauseated", "sweaty", "weak", "tired", "short of breath", "uneasy")]."))
3039
if(3 to 4)
3140
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)
3342
sound = TRUE
3443
if(prob(7.5))
3544
to_chat(affected_mob, span_danger("You feel a sharp pain in your chest!"))
3645
if(prob(30))
3746
affected_mob.vomit(95)
3847
affected_mob.emote("cough")
39-
affected_mob.Paralyze(40)
48+
affected_mob.Paralyze(4 SECONDS)
4049
affected_mob.losebreath += 4
4150
if(prob(7.5))
4251
to_chat(affected_mob, span_danger("You feel very weak and dizzy..."))
@@ -45,16 +54,26 @@
4554
affected_mob.emote("cough")
4655
if(5)
4756
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)
5258
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)
5561
return FALSE
5662
multiplier_tweak(0.1)
5763

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+
5877
/datum/symptom/catapult_sneeze
5978
name = "Sneezing?"
6079
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

Comments
 (0)