Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit e893fbe

Browse files
committed
Update stealth.dm
1 parent 7e8f885 commit e893fbe

File tree

1 file changed

+102
-17
lines changed

1 file changed

+102
-17
lines changed

yogstation/code/datums/martial/stealth.dm

Lines changed: 102 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,15 @@
2525
/datum/martial_art/liquidator/proc/check_streak(mob/living/carbon/human/A, mob/living/carbon/human/D)
2626
if(!can_use(A))
2727
return
28-
if(findtext(streak, DAGGER_COMBO))
29-
hidden_knife(A,D)
30-
streak = ""
31-
return TRUE
32-
33-
if(findtext(streak, FINGERGUN_COMBO))
28+
if(findtext(streak, FINGERGUN_COMBO)) //prioritize the gun combo because the dagger combo can combo into itself
3429
fingergun(A,D)
3530
streak = ""
3631
return TRUE //don't upgrade the grab
3732

33+
if(findtext(streak, DAGGER_COMBO))
34+
hidden_knife(A,D)
35+
return TRUE
36+
3837
/datum/martial_art/liquidator/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
3938
if(!can_use(A))
4039
return FALSE
@@ -51,8 +50,9 @@
5150
return FALSE
5251

5352
add_to_streak("H",D)
54-
check_streak(A,D)
55-
return FALSE ///We need it work like a generic, non martial art attack at all times
53+
if(check_streak(A,D)) //stab doesn't seem like anything
54+
return TRUE
55+
return FALSE ///We need it work like a generic, non martial art attack
5656

5757
/datum/martial_art/liquidator/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
5858
if(!(can_use(A)))
@@ -77,14 +77,97 @@
7777
//////////////////////////////////////////////////////////////////////////////////
7878
//------------------------------Hidden knife------------------------------------//
7979
//////////////////////////////////////////////////////////////////////////////////
80-
/datum/martial_art/liquidator/proc/hidden_knife(mob/living/carbon/human/A, mob/living/carbon/human/D)
81-
var/selected_zone = D.get_bodypart(A.zone_selected) ? A.zone_selected : BODY_ZONE_CHEST //check if the zone exists, if not, default to chest
82-
83-
var/armor_block = D.run_armor_check(selected_zone, MELEE, armour_penetration = 40)
84-
D.apply_damage(A.get_punchdamagehigh() * 4, BRUTE, selected_zone, armor_block, sharpness = SHARP_EDGED) //28 damage by default
85-
to_chat(A, span_warning("You stab [D] with a hidden blade!"))
86-
to_chat(D, span_userdanger("You are suddenly stabbed with a blade!"))
87-
A.playsound_local(A, 'sound/weapons/batonextend.ogg', 35, TRUE) //sound only to you as audio feedback that you stabbed them
80+
/datum/martial_art/liquidator/proc/hidden_knife(mob/living/carbon/human/user, mob/living/carbon/human/target)
81+
/**
82+
* Literally just copy pasted all this from /proc/disarm in _species.dm
83+
* we are pretending to be a shove
84+
*/
85+
user.do_attack_animation(target, ATTACK_EFFECT_DISARM)
86+
playsound(target, 'sound/weapons/thudswoosh.ogg', 50, TRUE, -1)
87+
88+
var/shove_dir = get_dir(user.loc, target.loc)
89+
var/turf/target_shove_turf = get_step(target.loc, shove_dir)
90+
var/mob/living/carbon/human/target_collateral_human
91+
var/shove_blocked = FALSE //Used to check if a shove is blocked so that if it is knockdown logic can be applied
92+
93+
//Thank you based whoneedsspace
94+
target_collateral_human = locate(/mob/living/carbon/human) in target_shove_turf.contents
95+
var/bothstanding = target_collateral_human && (target.mobility_flags & MOBILITY_STAND) && (target_collateral_human.mobility_flags & MOBILITY_STAND)
96+
if(target_collateral_human && bothstanding)
97+
shove_blocked = TRUE
98+
else
99+
target.Move(target_shove_turf, shove_dir)
100+
if(get_turf(target) != target_shove_turf)
101+
shove_blocked = TRUE
102+
103+
if(shove_blocked && !target.is_shove_knockdown_blocked() && !target.buckled)
104+
var/directional_blocked = FALSE
105+
if(shove_dir in GLOB.cardinals) //Directional checks to make sure that we're not shoving through a windoor or something like that
106+
var/target_turf = get_turf(target)
107+
for(var/obj/O in target_turf)
108+
if(O.flags_1 & ON_BORDER_1 && O.dir == shove_dir && O.density)
109+
directional_blocked = TRUE
110+
break
111+
if(target_turf != target_shove_turf) //Make sure that we don't run the exact same check twice on the same tile
112+
for(var/obj/O in target_shove_turf)
113+
if(O.flags_1 & ON_BORDER_1 && O.dir == turn(shove_dir, 180) && O.density)
114+
directional_blocked = TRUE
115+
break
116+
if(!bothstanding || directional_blocked)
117+
var/obj/item/I = target.get_active_held_item()
118+
if(target.dropItemToGround(I))
119+
user.visible_message(span_danger("[user.name] shoves [target.name], disarming them!"), span_danger("You shove [target.name], disarming them!"), null, COMBAT_MESSAGE_RANGE)
120+
log_combat(user, target, "liquidator hidden knife shove", "disarming them")
121+
else if(bothstanding)
122+
target.Knockdown(SHOVE_KNOCKDOWN_HUMAN)
123+
if(!target_collateral_human.is_shove_knockdown_blocked())
124+
target_collateral_human.Knockdown(SHOVE_KNOCKDOWN_HUMAN)
125+
user.visible_message(span_danger("[user.name] shoves [target.name] into [target_collateral_human.name]!"), span_danger("You shove [target.name] into [target_collateral_human.name]!"), null, COMBAT_MESSAGE_RANGE)
126+
log_combat(user, target, "liquidator hidden knife shove", "into [target_collateral_human.name]")
127+
else
128+
user.visible_message(span_danger("[user.name] shoves [target.name]!"), null, null, COMBAT_MESSAGE_RANGE)
129+
var/target_held_item = target.get_active_held_item()
130+
var/knocked_item = FALSE
131+
132+
if(!is_type_in_typecache(target_held_item, GLOB.shove_disarming_types))
133+
target_held_item = null
134+
135+
if(!target.has_movespeed_modifier(MOVESPEED_ID_SHOVE))
136+
target.add_movespeed_modifier(MOVESPEED_ID_SHOVE, multiplicative_slowdown = SHOVE_SLOWDOWN_STRENGTH)
137+
if(target_held_item)
138+
target.visible_message(span_danger("[target.name]'s grip on \the [target_held_item] loosens!"), span_danger("Your grip on \the [target_held_item] loosens!"), null, COMBAT_MESSAGE_RANGE)
139+
addtimer(CALLBACK(target, /mob/living/carbon/human/proc/clear_shove_slowdown), SHOVE_SLOWDOWN_LENGTH)
140+
else if(target_held_item)
141+
target.dropItemToGround(target_held_item)
142+
knocked_item = TRUE
143+
target.visible_message(span_danger("[target.name] drops \the [target_held_item]!!"), span_danger("You drop \the [target_held_item]!!"), null, COMBAT_MESSAGE_RANGE)
144+
var/append_message = ""
145+
if(target_held_item)
146+
if(knocked_item)
147+
append_message = "causing them to drop [target_held_item]"
148+
else
149+
append_message = "loosening their grip on [target_held_item]"
150+
log_combat(user, target, "liquidator hidden knife shove", append_message)
151+
152+
153+
154+
/**
155+
* The actual martial art stuff
156+
*/
157+
158+
var/selected_zone = target.get_bodypart(user.zone_selected) ? user.zone_selected : BODY_ZONE_CHEST //check if the zone exists, if not, default to chest
159+
160+
var/armor_block = target.run_armor_check(selected_zone, MELEE, armour_penetration = 40)
161+
target.apply_damage(user.get_punchdamagehigh() * 4, BRUTE, selected_zone, armor_block, -100, 100, SHARP_POINTY) //28 damage by default TWENTY EIGHT STAB WOUNDS (not gonna wound, unless the target has no armour)
162+
if(shove_blocked) //if they're getting pushed into a wall or another person, they're probably down for the count, GET THEM
163+
user.changeNext_move(CLICK_CD_RANGE) //stab stab stab stab stab stab stab stab
164+
165+
// Stab sounds only play to you and the target
166+
user.playsound_local(target, 'sound/weapons/sword2.ogg', 30, FALSE)
167+
target.playsound_local(target, 'sound/weapons/sword2.ogg', 30, FALSE)
168+
169+
to_chat(user, span_warning("You stab [target] with a hidden blade!"))
170+
to_chat(target, span_userdanger("You are suddenly stabbed with a blade!"))
88171

89172
/*---------------------------------------------------------------
90173
@@ -95,9 +178,9 @@
95178
var/obj/item/gun/ballistic/automatic/pistol/martial/gun = new /obj/item/gun/ballistic/automatic/pistol/martial (A) ///I don't check does the user have an item in a hand, because it is a martial art action, and to use it... you need to have a empty hand
96179
gun.gun_owner = A
97180
A.put_in_hands(gun)
98-
A.playsound_local(A, 'sound/items/change_jaws.ogg', 15, TRUE) //sound only to you as audio feedback that you pulled out a gun
99181
to_chat(A, span_notice("You extract a hidden gun from your hand."))
100182
D.Stun(1 SECONDS)
183+
A.changeNext_move(CLICK_CD_RANGE) //it's just pulling out a gun, not actually grabbing them, so have a shorter cooldown
101184

102185
/obj/item/gun/ballistic/automatic/pistol/martial
103186
desc = "A concelated version of a stechkin APS pistol, that comes with special Preternis upgrade modules."
@@ -142,6 +225,8 @@
142225
qdel(src)
143226

144227
/obj/item/gun/ballistic/automatic/pistol/martial/proc/on_drop()
228+
if(QDELETED(src))
229+
return
145230
to_chat(gun_owner, span_notice("You decide that it isn't the best time to use [src]"))
146231
qdel(src)
147232

0 commit comments

Comments
 (0)