From 153c135dabd5a51911e0070a9254ab79084ed6da Mon Sep 17 00:00:00 2001 From: MrMelbert Date: Sun, 1 Dec 2024 21:49:38 -0600 Subject: [PATCH] Tweaks --- code/__DEFINES/living.dm | 5 +---- code/_onclick/hud/screen_objects.dm | 2 +- .../status_effects/_status_effect_helpers.dm | 2 +- code/datums/status_effects/wound_effects.dm | 2 -- code/modules/mob/living/living.dm | 2 -- maplestation_modules/code/datums/pain/pain.dm | 19 ++++++------------- .../code/datums/pain/pain_bodyparts.dm | 6 +++--- .../code/datums/pain/pain_modifiers.dm | 4 ++-- .../pain/pain_status_effects/anesthetic.dm | 2 +- 9 files changed, 15 insertions(+), 29 deletions(-) diff --git a/code/__DEFINES/living.dm b/code/__DEFINES/living.dm index eb3a03c3a0f5..c7feabef0c33 100644 --- a/code/__DEFINES/living.dm +++ b/code/__DEFINES/living.dm @@ -40,7 +40,7 @@ #define MAX_SHOCK 200 /// Checks if a mob can feel pain. -#define CAN_FEEL_PAIN(mob) (mob?.pain_controller && !HAS_TRAIT(mob, TRAIT_NO_PAIN_EFFECTS) && mob.pain_controller.pain_modifier > 0.5) +#define CAN_FEEL_PAIN(mob) (mob?.stat <= SOFT_CRIT && mob?.pain_controller?.pain_modifier > 0.5) // Keys for pain modifiers #define PAIN_MOD_CHEMS "chems" @@ -58,9 +58,6 @@ /// If the mob enters shock, they will have +1 cure condition (helps cure it faster) #define TRAIT_ABATES_SHOCK "shock_abated" -/// Disables pain effects, but without the traditional bonuses numbness gives you -/// such as leaving your consciousness unaffected -#define TRAIT_NO_PAIN_EFFECTS "no_pain_effects" /// Shock buildup does not increase, only decrease. Cannot enter shock if at the threshold. /// No effect if already in shock (unlike abates_shock) #define TRAIT_NO_SHOCK_BUILDUP "no_shock_buildup" diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index fd9d67fd17b6..a5d2feb1401d 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -718,7 +718,7 @@ // NON-MODULE CHANGE var/has_noticable_wound = FALSE for(var/datum/wound/wound as anything in body_part.wounds) - if(!(wound.wound_flags & ALERTS_VICTIM)) + if(wound.wound_flags & ALERTS_VICTIM) has_noticable_wound = TRUE break diff --git a/code/datums/status_effects/_status_effect_helpers.dm b/code/datums/status_effects/_status_effect_helpers.dm index b2a7a3cede76..77d6f965df35 100644 --- a/code/datums/status_effects/_status_effect_helpers.dm +++ b/code/datums/status_effects/_status_effect_helpers.dm @@ -61,7 +61,7 @@ . = FALSE for(var/datum/status_effect/existing_effect as anything in status_effects) - if(existing_effect.id == initial(removed_effect.id) && existing_effect.before_remove(arglist(arguments))) // melbert todo : major bug upstream later + if(existing_effect.id == initial(removed_effect.id) && existing_effect.before_remove(arglist(arguments))) qdel(existing_effect) . = TRUE diff --git a/code/datums/status_effects/wound_effects.dm b/code/datums/status_effects/wound_effects.dm index d25f71873fba..1ad72501e98e 100644 --- a/code/datums/status_effects/wound_effects.dm +++ b/code/datums/status_effects/wound_effects.dm @@ -39,7 +39,6 @@ if(ishuman(owner)) var/mob/living/carbon/human/human_owner = owner human_owner.physiology.bleed_mod *= WOUND_DETERMINATION_BLEED_MOD - ADD_TRAIT(owner, TRAIT_NO_PAIN_EFFECTS, TRAIT_STATUS_EFFECT(id)) ADD_TRAIT(owner, TRAIT_ABATES_SHOCK, TRAIT_STATUS_EFFECT(id)) owner.add_consciousness_multiplier(id, 1.15) if(duration >= WOUND_DETERMINATION_SEVERE) @@ -53,7 +52,6 @@ if(ishuman(owner)) var/mob/living/carbon/human/human_owner = owner human_owner.physiology.bleed_mod /= WOUND_DETERMINATION_BLEED_MOD - REMOVE_TRAIT(owner, TRAIT_NO_PAIN_EFFECTS, TRAIT_STATUS_EFFECT(id)) REMOVE_TRAIT(owner, TRAIT_ABATES_SHOCK, TRAIT_STATUS_EFFECT(id)) owner.remove_consciousness_multiplier(id) owner.clear_alert(id) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index e47bd7a6e04a..19ca973a3f50 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -2180,7 +2180,6 @@ GLOBAL_LIST_EMPTY(fire_appearances) TRAIT_IMMOBILIZED, TRAIT_INCAPACITATED, TRAIT_KNOCKEDOUT, - TRAIT_NO_PAIN_EFFECTS, ) // All the traits associated with the mob's current stat var/list/added_traits = list() @@ -2208,7 +2207,6 @@ GLOBAL_LIST_EMPTY(fire_appearances) TRAIT_IMMOBILIZED, TRAIT_INCAPACITATED, TRAIT_KNOCKEDOUT, - TRAIT_NO_PAIN_EFFECTS, ) remove_from_alive_mob_list() add_to_dead_mob_list() diff --git a/maplestation_modules/code/datums/pain/pain.dm b/maplestation_modules/code/datums/pain/pain.dm index e41648dfdf08..43e4a079e53d 100644 --- a/maplestation_modules/code/datums/pain/pain.dm +++ b/maplestation_modules/code/datums/pain/pain.dm @@ -88,7 +88,6 @@ RegisterSignal(parent, COMSIG_LIVING_POST_FULLY_HEAL, PROC_REF(remove_all_pain)) 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)) RegisterSignal(parent, COMSIG_LIVING_TREAT_MESSAGE, PROC_REF(handle_message)) RegisterSignal(parent, COMSIG_MOB_FIRED_GUN, PROC_REF(on_mob_fired_gun)) RegisterSignal(parent, COMSIG_LIVING_REVIVE, PROC_REF(revived)) @@ -109,8 +108,6 @@ COMSIG_MOB_APPLY_DAMAGE, COMSIG_MOB_FIRED_GUN, COMSIG_MOB_STATCHANGE, - SIGNAL_ADDTRAIT(TRAIT_NO_PAIN_EFFECTS), - SIGNAL_REMOVETRAIT(TRAIT_NO_PAIN_EFFECTS), )) /// Add a bodypart to be tracked. @@ -212,10 +209,6 @@ pain_modifier *= pain_mods[mod] if(old_pain_mod == pain_modifier) return FALSE - if(pain_modifier <= 0.5) - ADD_TRAIT(parent, TRAIT_NO_PAIN_EFFECTS, "pain_mod") - else - REMOVE_TRAIT(parent, TRAIT_NO_PAIN_EFFECTS, "pain_mod") return TRUE /** @@ -470,8 +463,8 @@ if(checked_bodypart.pain_feedback(seconds_per_tick, no_recent_pain)) COOLDOWN_START(src, time_since_last_pain_message, rand(8 SECONDS, 12 SECONDS)) - if(!has_pain) - // no-op if none of our bodyparts are in pain + if(!has_pain && shock_buildup <= 0) + // no-op if none of our bodyparts are in pain and we're not building up shock return var/shock_mod = max(pain_modifier, 0.33) @@ -647,13 +640,13 @@ SIGNAL_HANDLER var/pain = get_total_pain() - // Even if you can't feel pain it still contributes to consciousness loss + // Consciousness penalty from pain is unnaffected by pain modifier if(pain <= 25) parent.remove_consciousness_modifier(PAIN) else parent.add_consciousness_modifier(PAIN, round(-0.5 * (max(pain + shock_buildup, 0) ** 0.8)), 0.01) - // Modify pain by modifier or traits before messing with the modifiers - pain *= CAN_FEEL_PAIN(parent) ? pain_modifier : 0 + // Buuut the other modifiers aren't + pain *= pain_modifier switch(pain) if(0 to 25) @@ -754,7 +747,7 @@ return var/num_repeats = floor(((get_total_pain() / 75) + (shock_buildup / 75)) * pain_modifier) - if(!CAN_FEEL_PAIN(parent) && shock_buildup < 90) + if(shock_buildup < 90) num_repeats *= 0.5 if(num_repeats <= 1) diff --git a/maplestation_modules/code/datums/pain/pain_bodyparts.dm b/maplestation_modules/code/datums/pain/pain_bodyparts.dm index 4f322f6bf451..c66d114145e9 100644 --- a/maplestation_modules/code/datums/pain/pain_bodyparts.dm +++ b/maplestation_modules/code/datums/pain/pain_bodyparts.dm @@ -93,7 +93,7 @@ "but feels faint", ) - switch(pain) + switch(get_modified_pain()) if(10 to 25) owner.flash_pain_overlay(1) feedback_phrases += list("aches", "feels sore", "stings slightly", "tingles", "twinges") @@ -145,7 +145,7 @@ "but it subsides", ) - switch(pain) + switch(get_modified_pain()) if(10 to 40) owner.flash_pain_overlay(1) feedback_phrases += list("aches", "feels sore", "stings slightly", "tingles", "twinges") @@ -210,7 +210,7 @@ "but the pressure fades", ) - switch(pain) + switch(get_modified_pain()) if(10 to 30) owner.flash_pain_overlay(1) feedback_phrases += list("aches", "feels sore", "stings slightly", "tingles", "twinges") diff --git a/maplestation_modules/code/datums/pain/pain_modifiers.dm b/maplestation_modules/code/datums/pain/pain_modifiers.dm index 731eccbeade4..3468beda1a44 100644 --- a/maplestation_modules/code/datums/pain/pain_modifiers.dm +++ b/maplestation_modules/code/datums/pain/pain_modifiers.dm @@ -56,11 +56,11 @@ // Fake healthy is supposed to mimic feeling no pain /datum/status_effect/grouped/screwy_hud/fake_healthy/on_apply() . = ..() - ADD_TRAIT(owner, TRAIT_NO_PAIN_EFFECTS, TRAIT_STATUS_EFFECT(id)) + owner.set_pain_mod(TRAIT_STATUS_EFFECT(id), 0.33) /datum/status_effect/grouped/screwy_hud/fake_healthy/on_remove() . = ..() - REMOVE_TRAIT(owner, TRAIT_NO_PAIN_EFFECTS, TRAIT_STATUS_EFFECT(id)) + owner.unset_pain_mod(TRAIT_STATUS_EFFECT(id)) // Being drunk gives a slight one, note the actual reagent gives one based on its strength /datum/status_effect/inebriated/drunk/on_apply() diff --git a/maplestation_modules/code/datums/pain/pain_status_effects/anesthetic.dm b/maplestation_modules/code/datums/pain/pain_status_effects/anesthetic.dm index 42e551470fc0..da022722a32c 100644 --- a/maplestation_modules/code/datums/pain/pain_status_effects/anesthetic.dm +++ b/maplestation_modules/code/datums/pain/pain_status_effects/anesthetic.dm @@ -39,7 +39,7 @@ return FALSE RegisterSignal(owner, SIGNAL_ADDTRAIT(TRAIT_SLEEPIMMUNE), PROC_REF(qdel_us)) owner.add_max_consciousness_value(type, 10) - owner.set_pain_mod(type, 0.4) + owner.set_pain_mod(type, 0.33) applied_at = world.time return TRUE