Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMelbert committed Jul 25, 2024
1 parent 133b35e commit ebcb701
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 15 deletions.
15 changes: 12 additions & 3 deletions code/datums/status_effects/debuffs/grabbed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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))

Check failure on line 465 in code/datums/status_effects/debuffs/grabbed.dm

View workflow job for this annotation

GitHub Actions / Run Linters

failed to resolve path .proc/dir_changed

/datum/status_effect/grabbed/proc/unlink_mobs()
if(!linked)
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion code/game/atom/_atom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
23 changes: 14 additions & 9 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions maplestation_modules/code/modules/mob/living/sprint.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -107,7 +108,7 @@
set_move_intent(MOVE_INTENT_WALK)
return

adjustStaminaLoss(1)
adjustStaminaLoss(sprint_amt)

/mob/living/carbon/human/fully_heal(heal_flags)
. = ..()
Expand Down

0 comments on commit ebcb701

Please sign in to comment.