diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 69e7ac99fc..b4735cd0d8 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -289,4 +289,5 @@ #define HUMAN_FIRE_STACK_ICON_NUM 3 #define PULL_PRONE_SLOWDOWN 0.6 -#define HUMAN_CARRY_SLOWDOWN 0 +#define FIREMAN_CARRY_SLOWDOWN 0 +#define PIGGYBACK_CARRY_SLOWDOWN 1 diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index e8a57bb257..46c2c919f4 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -152,10 +152,10 @@ else if(ismob(A)) changeNext_move(CLICK_CD_MELEE) - UnarmedAttack(A,1) + UnarmedAttack(A, 1) else if(W) - W.afterattack(A,src,0,params) + W.ranged_attack_chain(src, A, params) else RangedAttack(A,params) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 13940e94e7..f422e073b2 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -8,12 +8,15 @@ *afterattack. The return value does not matter. */ /obj/item/proc/melee_attack_chain(mob/user, atom/target, params) - if(item_flags & NO_ATTACK_CHAIN_SOFT_STAMCRIT) - if(isliving(user)) - var/mob/living/L = user + if(isliving(user)) + var/mob/living/L = user + if(item_flags & NO_ATTACK_CHAIN_SOFT_STAMCRIT) if(IS_STAMCRIT(L)) to_chat(L, "You are too exhausted to swing [src]!") return + if(!CHECK_MOBILITY(L, MOBILITY_USE)) + to_chat(L, "You are unable to swing [src] right now!") + return if(tool_behaviour && target.tool_act(user, src, tool_behaviour)) return if(pre_attack(target, user, params)) @@ -24,6 +27,15 @@ return afterattack(target, user, TRUE, params) +/// Like melee_attack_chain but for ranged. +/obj/item/proc/ranged_attack_chain(mob/user, atom/target, params) + if(isliving(user)) + var/mob/living/L = user + if(!CHECK_MOBILITY(L, MOBILITY_USE)) + to_chat(L, "You are unable to raise [src] right now!") + return + afterattack(target, user, FALSE, params) + // Called when the item is in the active hand, and clicked; alternately, there is an 'activate held object' verb or you can hit pagedown. /obj/item/proc/attack_self(mob/user) if(SEND_SIGNAL(src, COMSIG_ITEM_ATTACK_SELF, user) & COMPONENT_NO_INTERACT) diff --git a/code/datums/components/riding.dm b/code/datums/components/riding.dm index e7f25a7724..b22d2e09a2 100644 --- a/code/datums/components/riding.dm +++ b/code/datums/components/riding.dm @@ -191,20 +191,28 @@ ///////Yes, I said humans. No, this won't end well...////////// /datum/component/riding/human + var/fireman_carrying = FALSE /datum/component/riding/human/Initialize() . = ..() RegisterSignal(parent, COMSIG_HUMAN_MELEE_UNARMED_ATTACK, .proc/on_host_unarmed_melee) /datum/component/riding/human/vehicle_mob_unbuckle(datum/source, mob/living/M, force = FALSE) - var/mob/living/carbon/human/H = parent - H.remove_movespeed_modifier(MOVESPEED_ID_HUMAN_CARRYING) . = ..() + var/mob/living/carbon/human/H = parent + if(!length(H.buckled_mobs)) + H.remove_movespeed_modifier(MOVESPEED_ID_HUMAN_CARRYING) + if(!fireman_carrying) + M.Daze(25) + REMOVE_TRAIT(M, TRAIT_MOBILITY_NOUSE, src) /datum/component/riding/human/vehicle_mob_buckle(datum/source, mob/living/M, force = FALSE) . = ..() var/mob/living/carbon/human/H = parent - H.add_movespeed_modifier(MOVESPEED_ID_HUMAN_CARRYING, multiplicative_slowdown = HUMAN_CARRY_SLOWDOWN) + if(length(H.buckled_mobs)) + H.add_movespeed_modifier(MOVESPEED_ID_HUMAN_CARRYING, multiplicative_slowdown = fireman_carrying? FIREMAN_CARRY_SLOWDOWN : PIGGYBACK_CARRY_SLOWDOWN) + if(fireman_carrying) + ADD_TRAIT(M, TRAIT_MOBILITY_NOUSE, src) /datum/component/riding/human/proc/on_host_unarmed_melee(atom/target) var/mob/living/carbon/human/H = parent @@ -236,11 +244,11 @@ else return list(TEXT_NORTH = list(0, 6), TEXT_SOUTH = list(0, 6), TEXT_EAST = list(-6, 4), TEXT_WEST = list( 6, 4)) - /datum/component/riding/human/force_dismount(mob/living/user) var/atom/movable/AM = parent AM.unbuckle_mob(user) user.DefaultCombatKnockdown(60) + user.Daze(50) user.visible_message("[AM] pushes [user] off of [AM.p_them()]!") /datum/component/riding/cyborg diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index f12ac14ece..90a3d628dc 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -898,7 +898,7 @@ //Second check to make sure they're still valid to be carried if(can_be_firemanned(target) && !incapacitated(FALSE, TRUE)) target.set_resting(FALSE, TRUE) - buckle_mob(target, TRUE, TRUE, 90, 1, 0) + buckle_mob(target, TRUE, TRUE, 90, 1, 0, TRUE) return visible_message("[src] fails to fireman carry [target]!") else @@ -915,13 +915,13 @@ if(target.incapacitated(FALSE, TRUE) || incapacitated(FALSE, TRUE)) target.visible_message("[target] can't hang onto [src]!") return - buckle_mob(target, TRUE, TRUE, FALSE, 0, 2) + buckle_mob(target, TRUE, TRUE, FALSE, 0, 2, FALSE) else visible_message("[target] fails to climb onto [src]!") else to_chat(target, "You can't piggyback ride [src] right now!") -/mob/living/carbon/human/buckle_mob(mob/living/target, force = FALSE, check_loc = TRUE, lying_buckle = FALSE, hands_needed = 0, target_hands_needed = 0) +/mob/living/carbon/human/buckle_mob(mob/living/target, force = FALSE, check_loc = TRUE, lying_buckle = FALSE, hands_needed = 0, target_hands_needed = 0, fireman = FALSE) if(!force)//humans are only meant to be ridden through piggybacking and special cases return if(!is_type_in_typecache(target, can_ride_typecache)) @@ -952,6 +952,7 @@ stop_pulling() riding_datum.handle_vehicle_layer() + riding_datum.fireman_carrying = fireman . = ..(target, force, check_loc) /mob/living/carbon/human/proc/is_shove_knockdown_blocked() //If you want to add more things that block shove knockdown, extend this