Skip to content

Commit

Permalink
Bloodsuckers now heal pain during torpor, and feel 50% MORE pain when…
Browse files Browse the repository at this point in the history
… out during Sol.

Also added some sanity checks.
  • Loading branch information
Absolucy committed Dec 15, 2024
1 parent 1ded0b7 commit 8a983f6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,24 +124,31 @@
return HAS_TRAIT_FROM(owner.current, TRAIT_NODEATH, TORPOR_TRAIT)

/datum/antagonist/bloodsucker/proc/torpor_begin()
to_chat(owner.current, span_notice("You enter the horrible slumber of deathless Torpor. You will heal until you are renewed."))
var/mob/living/current = owner.current
if(QDELETED(current))
return
to_chat(current, span_notice("You enter the horrible slumber of deathless Torpor. You will heal until you are renewed."))
// Force them to go to sleep
REMOVE_TRAIT(owner.current, TRAIT_SLEEPIMMUNE, BLOODSUCKER_TRAIT)
REMOVE_TRAIT(current, TRAIT_SLEEPIMMUNE, BLOODSUCKER_TRAIT)
// Without this, you'll just keep dying while you recover.
owner.current.add_traits(torpor_traits, TORPOR_TRAIT)
owner.current.set_timed_status_effect(0 SECONDS, /datum/status_effect/jitter, only_if_higher = TRUE)
current.add_traits(torpor_traits, TORPOR_TRAIT)
current.set_timed_status_effect(0 SECONDS, /datum/status_effect/jitter, only_if_higher = TRUE)
// Disable ALL Powers
DisableAllPowers()

/datum/antagonist/bloodsucker/proc/torpor_end()
owner.current.remove_status_effect(/datum/status_effect/bloodsucker_sol)
owner.current.grab_ghost()
to_chat(owner.current, span_warning("You have recovered from Torpor."))
owner.current.remove_traits(torpor_traits, TORPOR_TRAIT)
if(!HAS_TRAIT(owner.current, TRAIT_MASQUERADE))
ADD_TRAIT(owner.current, TRAIT_SLEEPIMMUNE, BLOODSUCKER_TRAIT)
var/mob/living/current = owner.current
if(QDELETED(current))
return
current.remove_status_effect(/datum/status_effect/bloodsucker_sol)
current.grab_ghost()
to_chat(current, span_warning("You have recovered from Torpor."))
current.remove_traits(torpor_traits, TORPOR_TRAIT)
if(!HAS_TRAIT(current, TRAIT_MASQUERADE))
ADD_TRAIT(current, TRAIT_SLEEPIMMUNE, BLOODSUCKER_TRAIT)
heal_vampire_organs()
owner.current.update_stat()
current.pain_controller?.remove_all_pain()
current.update_stat()
SEND_SIGNAL(src, BLOODSUCKER_EXIT_TORPOR)

/datum/status_effect/bloodsucker_sol
Expand All @@ -159,6 +166,7 @@
return FALSE
RegisterSignal(SSsunlight, COMSIG_SOL_END, PROC_REF(on_sol_end))
RegisterSignal(owner, COMSIG_MOVABLE_MOVED, PROC_REF(on_owner_moved))
owner.set_pain_mod(id, 1.5)
owner.add_traits(sol_traits, id)
owner.remove_filter(id)
owner.add_filter(id, 2, drop_shadow_filter(x = 0, y = 0, size = 3, offset = 1.5, color = "#ee7440"))
Expand All @@ -182,6 +190,7 @@
/datum/status_effect/bloodsucker_sol/on_remove()
UnregisterSignal(SSsunlight, COMSIG_SOL_END)
UnregisterSignal(owner, COMSIG_MOVABLE_MOVED)
owner.unset_pain_mod(id)
owner.remove_traits(sol_traits, id)
owner.remove_filter(id)
owner.remove_movespeed_modifier(/datum/movespeed_modifier/bloodsucker_sol)
Expand Down
14 changes: 8 additions & 6 deletions monkestation/code/modules/can_spessmen_feel_pain/pain/_base.dm
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
RegisterSignal(parent, COMSIG_CARBON_LOSE_WOUND, PROC_REF(remove_wound_pain))
RegisterSignal(parent, COMSIG_CARBON_REMOVE_LIMB, PROC_REF(remove_bodypart))
RegisterSignal(parent, COMSIG_LIVING_HEALTHSCAN, PROC_REF(on_analyzed))
RegisterSignal(parent, COMSIG_LIVING_POST_FULLY_HEAL, PROC_REF(remove_all_pain))
RegisterSignal(parent, COMSIG_LIVING_POST_FULLY_HEAL, PROC_REF(on_fully_healed))
RegisterSignal(parent, COMSIG_MOB_APPLY_DAMAGE, PROC_REF(add_damage_pain))
RegisterSignal(parent, COMSIG_MOB_STATCHANGE, PROC_REF(on_parent_statchance))
RegisterSignals(parent, list(SIGNAL_ADDTRAIT(TRAIT_NO_PAIN_EFFECTS), SIGNAL_REMOVETRAIT(TRAIT_NO_PAIN_EFFECTS)), PROC_REF(refresh_pain_attributes))
Expand Down Expand Up @@ -913,16 +913,18 @@

message_args[TREAT_MESSAGE_MESSAGE] = sanitize(final_phrase)

/datum/pain/proc/on_fully_healed(datum/source, heal_flags)
SIGNAL_HANDLER
// Ideally pain would have its own heal flag but we live in a society
if(heal_flags & (HEAL_ADMIN|HEAL_WOUNDS|HEAL_STATUS))
remove_all_pain()

/**
* Remove all pain, pain paralysis, side effects, etc. from our mob after we're fully healed by something (like an adminheal)
*/
/datum/pain/proc/remove_all_pain(datum/source, heal_flags)
/datum/pain/proc/remove_all_pain()
SIGNAL_HANDLER

// Ideally pain would have its own heal flag but we live in a society
if(!(heal_flags & (HEAL_ADMIN|HEAL_WOUNDS|HEAL_STATUS)))
return

for(var/zone in body_zones)
var/obj/item/bodypart/healed_bodypart = body_zones[zone]
if(QDELETED(healed_bodypart))
Expand Down

0 comments on commit 8a983f6

Please sign in to comment.