diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index 70c2425f48..5f08bd21a1 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -214,7 +214,7 @@ // /mob/living/carbon signals #define COMSIG_CARBON_SOUNDBANG "carbon_soundbang" //from base of mob/living/carbon/soundbang_act(): (list(intensity)) #define COMSIG_CARBON_IDENTITY_TRANSFERRED_TO "carbon_id_transferred_to" //from datum/dna/transfer_identity(): (datum/dna, transfer_SE) - +#define COMSIG_CARBON_TACKLED "carbon_tackled" //sends from tackle.dm on tackle completion // /mob/living/simple_animal/hostile signals #define COMSIG_HOSTILE_ATTACKINGTARGET "hostile_attackingtarget" #define COMPONENT_HOSTILE_NO_ATTACK 1 diff --git a/code/datums/components/tackle.dm b/code/datums/components/tackle.dm index 28dd469041..17d2773b60 100644 --- a/code/datums/components/tackle.dm +++ b/code/datums/components/tackle.dm @@ -14,9 +14,6 @@ */ /datum/component/tackler dupe_mode = COMPONENT_DUPE_UNIQUE - - ///If we're currently tackling or are on cooldown. Actually, shit, if I use this to handle cooldowns, then getting thrown by something while on cooldown will count as a tackle..... whatever, i'll fix that next commit - var/tackling = TRUE ///How much stamina it takes to launch a tackle var/stamina_cost ///Launching a tackle calls Knockdown on you for this long, so this is your cooldown. Once you stand back up, you can tackle again. @@ -43,14 +40,15 @@ src.skill_mod = skill_mod src.min_distance = min_distance - var/mob/P = parent + var/mob/living/carbon/P = parent to_chat(P, "You are now able to launch tackles! You can do so by activating throw intent, and clicking on your target with an empty hand.") - + P.tackling = TRUE addtimer(CALLBACK(src, .proc/resetTackle), base_knockdown, TIMER_STOPPABLE) /datum/component/tackler/Destroy() - var/mob/P = parent + var/mob/living/carbon/P = parent to_chat(P, "You can no longer tackle.") + P.tackling = FALSE ..() /datum/component/tackler/RegisterWithParent() @@ -82,12 +80,12 @@ to_chat(user, "You must be standing to tackle!") return - if(tackling) + if(user.tackling) to_chat(user, "You're not ready to tackle!") return - if(user.has_movespeed_modifier(MOVESPEED_ID_SHOVE)) // can't tackle if you just got shoved - to_chat(user, "You're too off balance to tackle!") + if(user.has_status_effect(STATUS_EFFECT_TASED)) // can't tackle if you just got shoved + to_chat(user, "You cant tackle while you are tased!") return user.face_atom(A) @@ -96,7 +94,7 @@ if(modifiers["alt"] || modifiers["shift"] || modifiers["ctrl"] || modifiers["middle"]) return - tackling = TRUE + user.tackling = TRUE RegisterSignal(user, COMSIG_MOVABLE_MOVED, .proc/checkObstacle) playsound(user, 'sound/weapons/thudswoosh.ogg', 40, TRUE, -1) @@ -136,7 +134,7 @@ * Finally, we return a bitflag to [COMSIG_MOVABLE_IMPACT] that forces the hitpush to false so that we don't knock them away. */ /datum/component/tackler/proc/sack(mob/living/carbon/user, atom/hit) - if(!tackling || !tackle) + if(!user.tackling || !tackle) return if(!iscarbon(hit)) @@ -149,13 +147,12 @@ var/mob/living/carbon/human/S = user var/roll = rollTackle(target) - tackling = FALSE + user.tackling = FALSE switch(roll) if(-INFINITY to -5) user.visible_message("[user] botches [user.p_their()] tackle and slams [user.p_their()] head into [target], knocking [user.p_them()]self silly!", "You botch your tackle and slam your head into [target], knocking yourself silly!", target) to_chat(target, "[user] botches [user.p_their()] tackle and slams [user.p_their()] head into you, knocking [user.p_them()]self silly!") - user.Paralyze(30) var/obj/item/bodypart/head/hed = user.get_bodypart(BODY_ZONE_HEAD) if(hed) @@ -165,11 +162,8 @@ if(-4 to -2) // glancing blow at best user.visible_message("[user] lands a weak tackle on [target], briefly knocking [target.p_them()] off-balance!", "You land a weak tackle on [target], briefly knocking [target.p_them()] off-balance!", target) to_chat(target, "[user] lands a weak tackle on you, briefly knocking you off-balance!") - user.Knockdown(30) - if(ishuman(target) && !T.has_movespeed_modifier(MOVESPEED_ID_SHOVE)) - T.add_movespeed_modifier(MOVESPEED_ID_SHOVE, multiplicative_slowdown = SHOVE_SLOWDOWN_STRENGTH) // maybe define a slightly more severe/longer slowdown for this - addtimer(CALLBACK(T, /mob/living/carbon/human/proc/clear_shove_slowdown), SHOVE_SLOWDOWN_LENGTH) + target.apply_status_effect(STATUS_EFFECT_TASED_WEAK, 6 SECONDS) if(-1 to 0) // decent hit, both parties are about equally inconvenienced user.visible_message("[user] lands a passable tackle on [target], sending them both tumbling!", "You land a passable tackle on [target], sending you both tumbling!", target) @@ -183,7 +177,6 @@ if(1 to 2) // solid hit, tackler has a slight advantage user.visible_message("[user] lands a solid tackle on [target], knocking them both down hard!", "You land a solid tackle on [target], knocking you both down hard!", target) to_chat(target, "[user] lands a solid tackle on you, knocking you both down hard!") - target.adjustStaminaLoss(30) target.Paralyze(5) user.Knockdown(10) @@ -192,8 +185,8 @@ if(3 to 4) // really good hit, the target is definitely worse off here. Without positive modifiers, this is as good a tackle as you can land user.visible_message("[user] lands an expert tackle on [target], knocking [target.p_them()] down hard while landing on [user.p_their()] feet with a passive grip!", "You land an expert tackle on [target], knocking [target.p_them()] down hard while landing on your feet with a passive grip!", target) to_chat(target, "[user] lands an expert tackle on you, knocking you down hard and maintaining a passive grab!") - user.SetKnockdown(0) + user.set_resting(FALSE, TRUE, FALSE) user.forceMove(get_turf(target)) target.adjustStaminaLoss(40) target.Paralyze(5) @@ -205,8 +198,8 @@ if(5 to INFINITY) // absolutely BODIED user.visible_message("[user] lands a monster tackle on [target], knocking [target.p_them()] senseless and applying an aggressive pin!", "You land a monster tackle on [target], knocking [target.p_them()] senseless and applying an aggressive pin!", target) to_chat(target, "[user] lands a monster tackle on you, knocking you senseless and aggressively pinning you!") - user.SetKnockdown(0) + user.set_resting(FALSE, TRUE, FALSE) user.forceMove(get_turf(target)) target.adjustStaminaLoss(40) target.Paralyze(5) @@ -215,7 +208,7 @@ S.dna.species.grab(S, T) S.setGrabState(GRAB_AGGRESSIVE) - + SEND_SIGNAL(user, COMSIG_CARBON_TACKLED, "tackle completed") return COMPONENT_MOVABLE_IMPACT_FLIP_HITPUSH /** @@ -405,7 +398,8 @@ /datum/component/tackler/proc/resetTackle() - tackling = FALSE + var/mob/living/carbon/P = parent + P.tackling = FALSE QDEL_NULL(tackle) UnregisterSignal(parent, COMSIG_MOVABLE_MOVED) @@ -441,7 +435,7 @@ ///Check to see if we hit a table, and if so, make a big mess! /datum/component/tackler/proc/checkObstacle(mob/living/carbon/owner) - if(!tackling) + if(!owner.tackling) return var/turf/T = get_turf(owner) diff --git a/code/modules/antagonists/bloodsucker/powers/lunge.dm b/code/modules/antagonists/bloodsucker/powers/lunge.dm index e1e8f4363a..d40627f493 100644 --- a/code/modules/antagonists/bloodsucker/powers/lunge.dm +++ b/code/modules/antagonists/bloodsucker/powers/lunge.dm @@ -2,27 +2,37 @@ /datum/action/bloodsucker/lunge name = "Predatory Lunge" - desc = "Spring at your target and aggressively grapple them without warning. Attacks from concealment or the rear may even knock them down." + desc = "Prepare the strenght to grapple your prey." button_icon_state = "power_lunge" bloodcost = 10 cooldown = 30 bloodsucker_can_buy = TRUE warn_constant_cost = TRUE amToggle = TRUE + var/leap_skill_mod = 5 + +/datum/action/bloodsucker/lunge/New() + . = ..() + RegisterSignal(owner, COMSIG_CARBON_TACKLED, .proc/Delayed_DeactivatePower) /datum/action/bloodsucker/lunge/ActivatePower() var/mob/living/user = owner var/datum/antagonist/bloodsucker/B = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) - user.LoadComponent(/datum/component/tackler, stamina_cost = 50, base_knockdown = 3 SECONDS, range = 4, speed = 0.8, skill_mod = 5, min_distance = 2) + var/datum/component/tackler/T = user.LoadComponent(/datum/component/tackler) + T.stamina_cost = 50 + T.base_knockdown = 3 SECONDS + T.range = 4 + T.speed = 0.8 + T.skill_mod = 5 + T.min_distance = 2 active = TRUE - while(B && ContinueActive(user) && CHECK_MOBILITY(user, MOBILITY_STAND)) + while(B && ContinueActive(user)) B.AddBloodVolume(-0.1) sleep(5) - -/datum/action/bloodsucker/lunge/ContinueActive(mob/living/user) - return ..() + +/datum/action/bloodsucker/lunge/proc/Delayed_DeactivatePower() + addtimer(CALLBACK(src, .proc/DeactivatePower), 1 SECONDS, TIMER_UNIQUE) /datum/action/bloodsucker/lunge/DeactivatePower(mob/living/user = owner) - ..() // activate = FALSE - var/datum/component/tackler - tackler.RemoveComponent() + . = ..() + qdel(user.GetComponent(/datum/component/tackler)) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index cb3833b7f6..dcaa1e5b8c 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -98,6 +98,8 @@ /mob/living/carbon/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) . = ..() var/hurt = TRUE + if(src.GetComponent(/datum/component/tackler)) + return if(throwingdatum?.thrower && iscyborg(throwingdatum.thrower)) var/mob/living/silicon/robot/R = throwingdatum.thrower if(!R.emagged) @@ -110,7 +112,7 @@ var/mob/living/carbon/victim = hit_atom if(victim.movement_type & FLYING) return - if(hurt && !GetComponent(/datum/component/tackler)) + if(hurt) victim.take_bodypart_damage(10) take_bodypart_damage(10) victim.DefaultCombatKnockdown(20) diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index 689ab56842..15413f76d4 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -63,3 +63,4 @@ var/damageoverlaytemp = 0 var/drunkenness = 0 //Overall drunkenness - check handle_alcohol() in life.dm for effects + var/tackling = FALSE //Whether or not we are tackling, this will prevent the knock into effects for carbons