Skip to content

Commit dee946c

Browse files
authored
Change when hit twitch animations occur (goonstation#25933)
1 parent 7fff1b9 commit dee946c

4 files changed

Lines changed: 29 additions & 7 deletions

File tree

code/mob.dm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,12 @@ TYPEINFO(/mob)
10991099

11001100
// for mobs without organs
11011101
/mob/proc/TakeDamage(zone, brute, burn, tox, damage_type, disallow_limb_loss=FALSE)
1102-
hit_twitch(src)
1102+
if (src.nodamage || QDELETED(src)) return
1103+
1104+
if (brute > 0)
1105+
hit_twitch(src)
1106+
else if((burn > 0 || tox > 0) && isalive(src) && !src.hasStatus("paralysis"))
1107+
hit_twitch(src)
11031108
src.health -= max(0, brute)
11041109
src.health -= max(0, (src.bioHolder?.HasEffect("fire_resist") > 1) ? burn/2 : burn)
11051110

code/mob/living/carbon/human/procs/damage.dm

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,15 @@
316316
/mob/living/carbon/human/TakeDamage(zone, brute, burn, tox, damage_type, disallow_limb_loss, var/bypass_reversal = FALSE)
317317
if (src.nodamage || QDELETED(src)) return
318318

319-
hit_twitch(src)
319+
if (brute > 0)
320+
hit_twitch(src)
321+
else if((burn > 0 || tox > 0) && isalive(src) && !src.hasStatus("paralysis"))
322+
if (ischangeling(src))
323+
var/datum/abilityHolder/changeling/C = get_ability_holder(/datum/abilityHolder/changeling)
324+
if (!C || !C.in_fakedeath)
325+
hit_twitch(src)
326+
else
327+
hit_twitch(src)
320328

321329
if (src.traitHolder && src.traitHolder.hasTrait("reversal") && !bypass_reversal)
322330
src.HealDamage(zone, brute, burn, tox, TRUE)

code/mob/living/carbon/human/procs/emote.dm

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@
1717
if (src.hasStatus("paralysis"))
1818
return //pls stop emoting :((
1919

20-
if (voluntary && (src.hasStatus("unconscious") || isunconscious(src)))
21-
return
20+
if (voluntary)
21+
if (src.hasStatus("unconscious") || isunconscious(src))
22+
return
23+
else if (ischangeling(src))
24+
var/datum/abilityHolder/changeling/C = src.get_ability_holder(/datum/abilityHolder/changeling)
25+
if (C?.in_fakedeath)
26+
return
2227

2328
if (src.bioHolder.HasEffect("revenant"))
2429
src.visible_message(SPAN_ALERT("[src] makes [pick("a rude", "an eldritch", "a", "an eerie", "an otherworldly", "a netherly", "a spooky")] gesture!"), group = "revenant_emote")

code/mob/living/critter.dm

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -918,10 +918,14 @@ ADMIN_INTERACT_PROCS(/mob/living/critter, proc/modify_health, proc/admincmd_atta
918918
src.was_harmed(thr.user, AM)
919919

920920
/mob/living/critter/TakeDamage(zone, brute, burn, tox, damage_type, disallow_limb_loss)
921-
if (brute > 0 || burn > 0 || tox > 0)
922-
hit_twitch(src)
923-
if (nodamage)
921+
if (src.nodamage || QDELETED(src))
924922
return
923+
924+
if (brute > 0)
925+
hit_twitch(src)
926+
else if((burn > 0 || tox > 0) && isalive(src) && !src.hasStatus("paralysis"))
927+
hit_twitch(src)
928+
925929
var/datum/healthHolder/Br = get_health_holder("brute")
926930
if (Br)
927931
Br.TakeDamage(brute)

0 commit comments

Comments
 (0)