From 90f6904f44f2ead2ff7999fc1171d5c0efdbcde7 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Mon, 20 Apr 2020 12:16:42 -0700
Subject: [PATCH] fix
---
code/game/objects/items/shields.dm | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/code/game/objects/items/shields.dm b/code/game/objects/items/shields.dm
index 6d8e582c29..77d24eb80b 100644
--- a/code/game/objects/items/shields.dm
+++ b/code/game/objects/items/shields.dm
@@ -52,13 +52,13 @@
px = 12
if(WEST)
px = -12
- var/oldpx = user.pixel_x
- var/oldpy = user.pixel_y
- animate(user, pixel_x = px, pixel_y = py, time = 3, easing = SINE_EASING | EASE_OUT, flags = ANIMATION_END_NOW)
- animate(user, pixel_x = oldpx, pixel_y = oldpy, time = 3)
- user.visible_message("[user] [harmful? "charges forwards with" : "sweeps"] [src]!")
var/obj/effect/temp_visual/dir_setting/shield_bash/effect = new(user.loc, dir)
- animate(effect, alpha = 0, pixel_x = px + 4, pixel_y = py + 4, time = 3)
+ effect.pixel_x = user.pixel_x
+ effect.pixel_y = user.pixel_y
+ user.visible_message("[user] [harmful? "charges forwards with" : "sweeps"] [src]!")
+ animate(user, pixel_x = px, pixel_y = py, time = 3, easing = SINE_EASING | EASE_OUT, flags = ANIMATION_PARALLEL | ANIMATION_RELATIVE)
+ animate(user, pixel_x = -px, pixel_y = -py, time = 3, flags = ANIMATION_RELATIVE)
+ animate(effect, alpha = 0, pixel_x = px * 1.5, pixel_y = py * 1.5, time = 3, flags = ANIMATION_PARALLEL | ANIMATION_RELATIVE)
/obj/item/shield/proc/bash_target(mob/living/user, mob/living/target, bashdir, harmful)
if(!(target.status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) // should probably add stun absorption check at some point I guess..
@@ -76,7 +76,7 @@
"[user] shoves you with [src]!")
for(var/i in 1 to harmful? shieldbash_knockback : shieldbash_push_distance)
var/turf/new_turf = get_step(target, bashdir)
- var/mob/living/carbon/human/H = locate() in new_turf
+ var/mob/living/carbon/human/H = locate() in (new_turf.contents - target)
if(H && harmful)
H.visible_message("[target] is sent crashing into [H]!",
"[target] is sent crashing into you!")
@@ -113,7 +113,8 @@
if(world.time < last_shieldbash + shieldbash_cooldown)
to_chat(user, "You can't bash with [src] again so soon!")
return FALSE
- if(isliving(target)) //GROUND SLAAAM
+ var/mob/living/livingtarget = target //only access after an isliving check!
+ if(isliving(target) && !CHECK_MOBILITY(targetliving, MOBILITY_STAND)) //GROUND SLAAAM
if(!(shield_flags & SHIELD_BASH_GROUND_SLAM))
to_chat(user, "You can't ground slam with [src]!")
return FALSE
@@ -122,7 +123,7 @@
playsound(src, harmful? "swing_hit" : 'sound/weapons/thudswoosh.ogg', 75, 1)
last_shieldbash = world.time
user.adjustStaminaLossBuffered(shieldbash_stamcost)
- return 1
+ return TRUE
// Directional sweep!
last_shieldbash = world.time
user.adjustStaminaLossBuffered(shieldbash_stamcost)