From ebcb701c60373a3f9806b1ec28387ea5084238b9 Mon Sep 17 00:00:00 2001 From: MrMelbert Date: Wed, 24 Jul 2024 22:20:19 -0500 Subject: [PATCH] Fixes --- code/datums/status_effects/debuffs/grabbed.dm | 15 +++++++++--- code/game/atom/_atom.dm | 3 ++- code/modules/mob/living/carbon/human/human.dm | 23 +++++++++++-------- code/modules/mob/mob.dm | 1 + .../code/modules/mob/living/sprint.dm | 5 ++-- 5 files changed, 32 insertions(+), 15 deletions(-) diff --git a/code/datums/status_effects/debuffs/grabbed.dm b/code/datums/status_effects/debuffs/grabbed.dm index e2e0114b4195..bdb4769ce1e8 100644 --- a/code/datums/status_effects/debuffs/grabbed.dm +++ b/code/datums/status_effects/debuffs/grabbed.dm @@ -154,7 +154,7 @@ COMSIG_MOVABLE_SET_GRAB_STATE, COMSIG_QDELETING, )) - grabbing_us.setGrabState(GRAB_PASSIVE) + // grabbing_us.setGrabState(GRAB_PASSIVE) grabbing_us = null UnregisterSignal(owner, list( @@ -432,6 +432,7 @@ pin = FALSE REMOVE_TRAIT(owner, TRAIT_FLOORED, "[id]_pin") REMOVE_TRAIT(owner, TRAIT_NO_MOVE_PULL, "[id]_pin") + UnregisterSignal(grabbing_us, COMSIG_MOVABLE_PRE_MOVE) /datum/status_effect/grabbed/proc/update_state(datum/source, new_state) SIGNAL_HANDLER @@ -461,6 +462,7 @@ owner.Move(grabbing_us.loc) RegisterSignal(grabbing_us, COMSIG_MOVABLE_MOVED, PROC_REF(bring_along)) RegisterSignal(grabbing_us, COMSIG_ATOM_PRE_BULLET_ACT, PROC_REF(bullet_shield)) + RegisterSignal(grabbing_us, COMSIG_ATOM_POST_DIR_CHANGE, PROC_REF(dir_changed)) /datum/status_effect/grabbed/proc/unlink_mobs() if(!linked) @@ -475,13 +477,20 @@ UnregisterSignal(grabbing_us, list( COMSIG_MOVABLE_MOVED, COMSIG_ATOM_PRE_BULLET_ACT, + COMSIG_ATOM_POST_DIR_CHANGE, )) /datum/status_effect/grabbed/proc/bring_along(datum/source, atom/old_loc, movement_dir) SIGNAL_HANDLER - owner.Move(grabbing_us.loc, movement_dir, grabbing_us.glide_size) - owner.setDir(grabbing_us.dir) + if(grabbing_us.loc != old_loc && isturf(grabbing_us.loc)) + owner.Move(grabbing_us.loc, movement_dir, grabbing_us.glide_size) + +/datum/status_effect/grabbed/proc/dir_change(datum/source, old_dir, new_dir) + SIGNAL_HANDLER + + if(old_dir != new_dir) + owner.setDir(new_dir) /datum/status_effect/grabbed/proc/bullet_shield(datum/source, obj/projectile/hitting_projectile, def_zone, piercing_hit) SIGNAL_HANDLER diff --git a/code/game/atom/_atom.dm b/code/game/atom/_atom.dm index 88792f64114b..c3dc7adfe33d 100644 --- a/code/game/atom/_atom.dm +++ b/code/game/atom/_atom.dm @@ -545,8 +545,9 @@ newdir = dir return SEND_SIGNAL(src, COMSIG_ATOM_DIR_CHANGE, dir, newdir) + var/old_dir = dir dir = newdir - SEND_SIGNAL(src, COMSIG_ATOM_POST_DIR_CHANGE, dir, newdir) + SEND_SIGNAL(src, COMSIG_ATOM_POST_DIR_CHANGE, old_dir, dir) if(smoothing_flags & SMOOTH_BORDER_OBJECT) QUEUE_SMOOTH_NEIGHBORS(src) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index e025308b8c4b..d835385f4843 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -901,16 +901,8 @@ to_chat(src, span_warning("You can't fireman carry [target] while [target.p_they()] [target.p_are()] standing!")) return - var/carrydelay = 5 SECONDS //if you have latex you are faster at grabbing var/skills_space - var/fitness_level = mind.get_skill_level(/datum/skill/fitness) - 1 - if(HAS_TRAIT(src, TRAIT_QUICKER_CARRY)) - carrydelay -= 2 SECONDS - else if(HAS_TRAIT(src, TRAIT_QUICK_CARRY)) - carrydelay -= 1 SECONDS - - // can remove up to 2 seconds at legendary - carrydelay -= fitness_level * (1/3) SECONDS + var/carrydelay = max(1 SECONDS, 8 SECONDS - (get_grab_strength() * 1 SECONDS)) if(carrydelay <= 3 SECONDS) skills_space = " very quickly" @@ -954,6 +946,19 @@ return ..() +/mob/living/carbon/human/post_buckle_mob(mob/living/M) + . = ..() + add_movespeed_modifier(/datum/movespeed_modifier/carrying) + +/mob/living/carbon/human/post_unbuckle_mob(mob/living/M) + . = ..() + if(!length(buckled_mobs)) + remove_movespeed_modifier(/datum/movespeed_modifier/carrying) + +/datum/movespeed_modifier/carrying + movetypes = GROUND|UPSIDE_DOWN + multiplicative_slowdown = 0.33 + /mob/living/carbon/human/reagent_check(datum/reagent/chem, seconds_per_tick, times_fired) . = ..() if(. & COMSIG_MOB_STOP_REAGENT_CHECK) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index f83334e93c3d..1cff9bf32181 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1130,6 +1130,7 @@ M.pixel_y = initial(M.pixel_y) + height if(M.layer <= layer) //make sure they stay above our current layer M.layer = layer + 0.1 + ///Call back post unbuckle from a mob, (reset your visual height here) /mob/post_unbuckle_mob(mob/living/M) M.layer = initial(M.layer) diff --git a/maplestation_modules/code/modules/mob/living/sprint.dm b/maplestation_modules/code/modules/mob/living/sprint.dm index 10e1f117f523..f20b2419f7b7 100644 --- a/maplestation_modules/code/modules/mob/living/sprint.dm +++ b/maplestation_modules/code/modules/mob/living/sprint.dm @@ -97,7 +97,8 @@ return /mob/living/carbon/human/drain_sprint() - adjust_sprint_left(-1) + var/sprint_amt = 1 + floor(length(buckled_mobs) * 0.66) + adjust_sprint_left(-1 * sprint_amt) // Sprinting when out of sprint will cost stamina if(sprint_length > 0) return @@ -107,7 +108,7 @@ set_move_intent(MOVE_INTENT_WALK) return - adjustStaminaLoss(1) + adjustStaminaLoss(sprint_amt) /mob/living/carbon/human/fully_heal(heal_flags) . = ..()