From 65be3c3f8b64db08112e6879202a249fe9faff03 Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Fri, 6 Feb 2026 16:59:32 -0700 Subject: [PATCH] [MIRROR] Movement adjustments. (#12386) Co-authored-by: Cameron Lennox --- code/__defines/chemistry.dm | 1 + code/__defines/traits/declarations.dm | 4 +- .../mob/living/carbon/human/human_movement.dm | 104 +++++++++--------- .../mob/living/carbon/human/human_organs.dm | 5 +- code/modules/mob/living/carbon/human/life.dm | 2 +- .../living/carbon/human/species/species.dm | 1 - .../human/species/station/traits/positive.dm | 5 +- code/modules/reagents/reagents/medicine.dm | 1 + 8 files changed, 65 insertions(+), 58 deletions(-) diff --git a/code/__defines/chemistry.dm b/code/__defines/chemistry.dm index 294ea7f329..4b8c699435 100644 --- a/code/__defines/chemistry.dm +++ b/code/__defines/chemistry.dm @@ -37,6 +37,7 @@ #define CE_ALCOHOL_TOXIC "alcotoxic" // Liver damage #define CE_SPEEDBOOST "gofast" // Hyperzine #define CE_SLOWDOWN "goslow" // Slowdown +#define CE_NARCOTICS "narcotics" // Narcotics. Ignore pain slowdown entirely. #define CE_ANTACID "nopuke" // Don't puke. #define CE_ALLERGEN "allergyreaction" // Self explanatory #define CE_DARKSIGHT "darksight" // Gives perfect vision in dark diff --git a/code/__defines/traits/declarations.dm b/code/__defines/traits/declarations.dm index 6512463e5f..928a7dce91 100644 --- a/code/__defines/traits/declarations.dm +++ b/code/__defines/traits/declarations.dm @@ -45,8 +45,10 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_TESLA_SHOCKIMMUNE "tesla_shock_immunity" /// Do we show up as a changeling / the wrong body-mind pair to sleevmates #define UNIQUE_MINDSTRUCTURE "unique_mindstructure" -// Owner is immune to hallucinations +/// Owner is immune to hallucinations #define TRAIT_MADNESS_IMMUNE "supermatter_madness_immune" +/// Owner will move faster when hands are empty. +#define UNUSUAL_RUNNING "unusual_running" /// Owner is corrupted via redspace. Used downstream. SHOULD NOT BE USED LIGHTLY. HORROR THEMES. #define TRAIT_REDSPACE_CORRUPTED "redspace_corrupted" // allows draining of power cells for nutrition diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 1702141f69..3bc79d5108 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -4,40 +4,58 @@ . = 0 - if (istype(loc, /turf/space)) - return ..() - 1 - - if(species.slowdown) - . += species.slowdown - if(force_max_speed) - return ..() + HUMAN_LOWEST_SLOWDOWN + return HUMAN_LOWEST_SLOWDOWN - for(var/datum/modifier/M in modifiers) - if(!isnull(M.haste) && M.haste == TRUE) - return ..() + HUMAN_LOWEST_SLOWDOWN // Returning -1 will actually result in a slowdown for Teshari. + for(var/datum/modifier/M in modifiers) //Do this before space check in case we're hasted (and use max speed) + if(M.haste) + return HUMAN_LOWEST_SLOWDOWN // Per haste documentation 'ignore slowdown and move really fast'. Calling ..() here adds slowdown. if(!isnull(M.slowdown)) . += M.slowdown - var/health_deficiency = (getMaxHealth() - health) - if(ishuman(src)) - var/mob/living/carbon/human/H = src - health_deficiency *= H.species.trauma_mod //Species pain sensitivity does not apply to painkillers, so we apply it before - if(health_deficiency >= 40) - if(chem_effects[CE_PAINKILLER]) //On painkillers? Reduce pain! On anti-painkillers? Increase pain! - health_deficiency = max(0, health_deficiency - src.chem_effects[CE_PAINKILLER]) - if(health_deficiency >= 40) //Still in enough pain for it to be significant? - . += (health_deficiency / 25) + if(istype(loc, /turf/space)) + return ..() - 1 - if(can_feel_pain()) - if(halloss >= 10) . += (halloss / 10) //halloss shouldn't slow you down if you can't even feel it + . += species.slowdown + + //Quick math: + //100 max hp w/ 0 damage = 100/100 * 100 = 100HP + //100 max hp w/ 50 damage = (50/100) * 100 = 50HP + //100 max hp w/ 50 halloss = (50/100) * 100 = 50HP + //100 max hp w/ 75 damage = (25/100) * 100 = 75HP + //200 max hp w/ 50 damage = (50/200) * 100 = 75HP + if(species.pain_mod) + var/health_percent = ((health / getMaxHealth()) * 100) / species.pain_mod //Species pain sensitivity does not apply to painkillers, so we apply it before + + var/hal_pain = getHalLoss() * species.pain_mod //trauma_mod is something entirely differently + //var/hal_pain = can_feel_pain() ? (getHalLoss() * 2) * species.pain_mod : 0 //Variant for if you want pain immune people to not be affected by halloss slowdown. + + if((health_percent <= 60 || hal_pain >= 25) && !chem_effects[CE_NARCOTICS]) //Have taken 40% of our max health in damage OR we have >=25 halloss pain + + if(health_percent < 0) + health_percent = 0 //Crit already has its own negative effects, so + + var/amount_damaged = 100 - health_percent //Get the percent. + + if(chem_effects[CE_PAINKILLER]) //On painkillers? Reduce pain! On anti-painkillers? Increase pain! + var/painkiller_strength = chem_effects[CE_PAINKILLER] + if(hal_pain > 25) + hal_pain = max(0, max(25, hal_pain - (painkiller_strength * 0.33))) //Painkillers are only 33% effective against halloss pain and can never lower your hal_pain below 25. It makes it less noticible at high levels, but it can't completely nullify it (unless on narcotics) + amount_damaged = max(0, amount_damaged - painkiller_strength) + amount_damaged += hal_pain + + if(amount_damaged >= 25) //Still in enough pain for it to be significant? + . += CLAMP((amount_damaged / 25), 0, 4) //Max of 4 slowdown from pain. var/hungry = (500 - nutrition) / 5 //Fixed 500 here instead of our huge MAX_NUTRITION - if (hungry >= 70) . += hungry/50 + if(hungry >= 70) + . += hungry/50 - if (get_feralness() >= 10) //crazy feral animals give less and less of a shit about pain and hunger as they get crazier + if(get_feralness() >= 10) //crazy feral animals give less and less of a shit about pain and hunger as they get crazier . = max(species.slowdown, species.slowdown+((.-species.slowdown)/(get_feralness()/10))) // As feral scales to damage, this amounts to an effective +1 slowdown cap - if(shock_stage >= 10) . -= 1.5 //this gets a +3 later, feral critters take reduced penalty + if(shock_stage >= 10) + . -= CLAMP((shock_stage / 40), 0.25, 1.5) //Feral creatures get halved shock penalty. + if(riding_datum) //Bit of slowdown for taur rides if rider is bigger or fatter than mount. var/datum/riding/R = riding_datum var/mob/living/L = R.ridden @@ -46,8 +64,6 @@ var/mob/living/carbon/human/H = M if(H.size_multiplier > L.size_multiplier) . += 1 - //if(H.weight > L.weight) weight should not have mechanical impact - //. += 1 if(istype(buckled, /obj/structure/bed/chair/wheelchair)) for(var/organ_name in list(BP_L_HAND, BP_R_HAND, BP_L_ARM, BP_R_ARM)) @@ -59,30 +75,17 @@ else if(E.status & ORGAN_BROKEN) . += 1.5 else - for(var/organ_name in list(BP_L_LEG, BP_R_LEG, BP_L_FOOT, BP_R_FOOT)) - var/obj/item/organ/external/E = get_organ(organ_name) - if(!E || E.is_stump()) - . += 4 - else if(E.splinted && E.splinted.loc != E) - . += 0.5 - else if(E.status & ORGAN_BROKEN) - . += 1.5 + . += max(2 * stance_damage, 0) //Handles missing feet/legs - if(shock_stage >= 10) . += 3 + if(shock_stage >= 10) + . += CLAMP((shock_stage / 20), 0.5, 3) //Slowly become slower the longer you're in traumatic shock. Simulates adrenaline wearing off. Entering soft crit immediately sets shock_stage to 61. - if(aiming && aiming.aiming_at) . += 5 // Iron sights make you slower, it's a well-known fact. - - if(FAT in src.mutations) + if(FAT in mutations) . += 1.5 if (bodytemperature < species.cold_level_1) . += (species.cold_level_1 - bodytemperature) / 10 * 1.75 - . += max(2 * stance_damage, 0) //damaged/missing feet or legs is slow - - if(mRun in mutations) - . = 0 - // Turf related slowdown var/turf/T = get_turf(src) . += calculate_turf_slowdown(T, direct) @@ -106,22 +109,21 @@ . += item_tally if(CE_SLOWDOWN in chem_effects) - if (. >= 0 ) + if(. >= 0 ) . *= 1.25 //Add a quarter of penalties on top. . += chem_effects[CE_SLOWDOWN] + //mRun means we don't get slowdown, so we axe the slowdown after all the slowdown stuff has been accounted for, but before speed buffs are applied. + if(mRun in mutations) + . = 0 + if(CE_SPEEDBOOST in chem_effects) if (. >= 0) // cut any penalties in half . *= 0.5 . -= chem_effects[CE_SPEEDBOOST] // give 'em a buff on top. - if(ishuman(src)) //r u human - var/mob/living/carbon/human/H = src //wowie you are, take this badge - if(species.unusual_running == 1) // do you have the trait - var/obj/item/I = H.get_active_hand() // checking their hand - var/obj/item/OH = H.get_inactive_hand() // and their other hand - if(!istype(I,/obj/item) && !istype(OH,/obj/item)) //better not have any items on you mfer - . -= 0.5 // ok vibe check passed, take this small movement buff and leave + if(HAS_TRAIT(src, UNUSUAL_RUNNING) && !get_active_hand() && !get_inactive_hand()) //better not have any items on you mfer + . -= 0.5 // ok vibe check passed, take this small movement buff and leave . = max(HUMAN_LOWEST_SLOWDOWN, . + CONFIG_GET(number/human_delay)) // Minimum return should be the same as force_max_speed . += ..() diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index dd2179d4ad..2f390a8064 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -87,8 +87,7 @@ spark_system.set_up(5, 0, src) spark_system.attach(src) spark_system.start() - spawn(10) - qdel(spark_system) + QDEL_IN(spark_system, 1 SECOND) else if (E.is_broken()) stance_damage += 1 else if (E.is_dislocated()) @@ -117,7 +116,7 @@ emote("scream") automatic_custom_emote(VISIBLE_MESSAGE, "collapses!", check_stat = TRUE) if(!(lying || resting)) // stops permastun with SPINE sdisability - Weaken(5) //can't emote while weakened, apparently. + Weaken(5) /mob/living/carbon/human/proc/handle_grasp() if(!l_hand && !r_hand) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 83d64b7805..98cd5e575c 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1921,7 +1921,7 @@ shock_stage = max(shock_stage-1, 0) if(!can_feel_pain()) return - if(health < (CONFIG_GET(number/health_threshold_softcrit) * species.crit_mod)) + if(health < (CONFIG_GET(number/health_threshold_softcrit) * species.crit_mod) && !chem_effects[CE_NARCOTICS]) shock_stage = max(shock_stage, 61) if(stat) return 0 diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index b331e71d70..122af1c197 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -221,7 +221,6 @@ var/spawn_flags = 0 // Flags that specify who can spawn as this species var/slowdown = 0 // Passive movement speed malus (or boost, if negative) - var/unusual_running = 0 // Trait var to change movement speed in human_movement.dm when nothing in hands var/obj/effect/decal/cleanable/blood/tracks/move_trail = /obj/effect/decal/cleanable/blood/tracks/footprints // What marks are left when walking var/list/skin_overlays = list() var/has_floating_eyes = 0 // Whether the eyes can be shown above other icons diff --git a/code/modules/mob/living/carbon/human/species/station/traits/positive.dm b/code/modules/mob/living/carbon/human/species/station/traits/positive.dm index 3ffbc45ab5..1e0e3a0645 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits/positive.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits/positive.dm @@ -21,12 +21,15 @@ name = "Unusual Gait" desc = "Your method of running is unorthodox, you move faster when not holding things in your hands." cost = 2 - var_changes = list("unusual_running" = 1) custom_only = FALSE //I think this is probably fine since it's half RP trait and half mechanical trait. also you can't have speed and use your hands so this is kinda niche outside of travel time reduction. banned_species = list(SPECIES_ALRAUNE, SPECIES_SHADEKIN_CREW, SPECIES_TESHARI, SPECIES_TAJARAN, SPECIES_DIONA, SPECIES_UNATHI, SPECIES_VASILISSAN, SPECIES_XENOCHIMERA, SPECIES_VOX) //i assume if a dev made your base slowdown different then you shouldn't have this. excludes = list(/datum/trait/positive/speed_fast) // olympic sprinters don't naruto run +/datum/trait/positive/unusual_running/apply(var/datum/species/S,var/mob/living/carbon/human/H) + ..() + ADD_TRAIT(H, UNUSUAL_RUNNING, ROUNDSTART_TRAIT) + /datum/trait/positive/punchdamage name = "Strong Attacks" desc = "Your unarmed attacks deal more damage. (+5 per attack)" diff --git a/code/modules/reagents/reagents/medicine.dm b/code/modules/reagents/reagents/medicine.dm index c1b9445f55..4653918e20 100644 --- a/code/modules/reagents/reagents/medicine.dm +++ b/code/modules/reagents/reagents/medicine.dm @@ -595,6 +595,7 @@ M.stuttering = min(50, max(0, M.stuttering + 5)) //If you can't feel yourself, and your main mode of speech is resonation, there's a problem. M.add_chemical_effect(CE_PAINKILLER, 200 * chem_effective) M.add_chemical_effect(CE_SLOWDOWN, 1) + M.add_chemical_effect(CE_NARCOTICS, 1) M.eye_blurry = min(M.eye_blurry + 10, 250 * chem_effective) /datum/reagent/oxycodone/overdose(var/mob/living/carbon/M, var/alien)