mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-13 16:13:19 +01:00
[s] fixes that one baton bug again (#26365)
This commit is contained in:
@@ -183,9 +183,12 @@
|
||||
var/mob/living/L = M
|
||||
|
||||
if(user.a_intent == INTENT_HARM)
|
||||
. = ..() // Whack them too if in harm intent
|
||||
if(!isnull(.)) // Attack returns null when successful
|
||||
return
|
||||
if(turned_on)
|
||||
baton_stun(L, user)
|
||||
return ..() // Whack them too if in harm intent
|
||||
baton_stun(L, user, ignore_shield_check = TRUE)
|
||||
return
|
||||
|
||||
if(!turned_on)
|
||||
user.do_attack_animation(L)
|
||||
@@ -196,11 +199,10 @@
|
||||
if(baton_stun(L, user))
|
||||
user.do_attack_animation(L)
|
||||
|
||||
/// returning false results in no baton attack animation, returning true results in an animation.
|
||||
/obj/item/melee/baton/proc/baton_stun(mob/living/L, mob/user, skip_cooldown = FALSE)
|
||||
/// returning false results in no baton attack animation, returning true results in an animation. If ignore_shield_check is true, the baton will not run check shields, and will hit if not on cooldown.
|
||||
/obj/item/melee/baton/proc/baton_stun(mob/living/L, mob/user, skip_cooldown = FALSE, ignore_shield_check = FALSE)
|
||||
if(cooldown > world.time && !skip_cooldown)
|
||||
return FALSE
|
||||
|
||||
var/user_UID = user.UID()
|
||||
if(HAS_TRAIT_FROM(L, TRAIT_WAS_BATONNED, user_UID)) // prevents double baton cheese.
|
||||
return FALSE
|
||||
@@ -208,7 +210,7 @@
|
||||
cooldown = world.time + initial(cooldown) // tracks the world.time when hitting will be next available.
|
||||
if(ishuman(L))
|
||||
var/mob/living/carbon/human/H = L
|
||||
if(H.check_shields(src, 0, "[user]'s [name]", MELEE_ATTACK)) //No message; check_shields() handles that
|
||||
if(!ignore_shield_check && H.check_shields(src, 0, "[user]'s [name]", MELEE_ATTACK)) //No message; check_shields() handles that
|
||||
playsound(L, 'sound/weapons/genhit.ogg', 50, TRUE)
|
||||
return FALSE
|
||||
H.Confused(10 SECONDS)
|
||||
@@ -311,7 +313,7 @@
|
||||
QDEL_NULL(sparkler)
|
||||
return ..()
|
||||
|
||||
/obj/item/melee/baton/cattleprod/baton_stun(mob/living/L, mob/user, skip_cooldown = FALSE)
|
||||
/obj/item/melee/baton/cattleprod/baton_stun(mob/living/L, mob/user, skip_cooldown = FALSE, ignore_shield_check = FALSE)
|
||||
if(sparkler.activate())
|
||||
return ..()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user