diff --git a/code/__DEFINES/combat.dm b/code/__DEFINES/combat.dm index d8f8e0ac04d..dfca0aed569 100644 --- a/code/__DEFINES/combat.dm +++ b/code/__DEFINES/combat.dm @@ -32,3 +32,24 @@ #define BULLET_ACT_FORCE_PIERCE "PIERCE" //It pierces through the object regardless of the bullet being piercing by default. #define NICE_SHOT_RICOCHET_BONUS 10 //if the shooter has the NICE_SHOT trait and they fire a ricocheting projectile, add this to the ricochet chance and auto aim angle + +//attack visual effects +#define ATTACK_EFFECT_PUNCH "punch" +#define ATTACK_EFFECT_KICK "kick" +#define ATTACK_EFFECT_SMASH "smash" +#define ATTACK_EFFECT_CLAW "claw" +#define ATTACK_EFFECT_SLASH "slash" +#define ATTACK_EFFECT_DISARM "disarm" +#define ATTACK_EFFECT_BITE "bite" +#define ATTACK_EFFECT_MECHFIRE "mech_fire" +#define ATTACK_EFFECT_MECHTOXIN "mech_toxin" +#define ATTACK_EFFECT_BOOP "boop" //Honk +#define ATTACK_EFFECT_VOID "void" +#define ATTACK_EFFECT_CPR "cpr" + +/// Attack animation for sharp items +#define ATTACK_ANIMATION_SLASH "slash" +/// Attack animation for pointy items +#define ATTACK_ANIMATION_PIERCE "pierce" +/// Animation for blunt attacks +#define ATTACK_ANIMATION_BLUNT "blunt" diff --git a/code/__DEFINES/dcs/signals/signals_object/signals_object.dm b/code/__DEFINES/dcs/signals/signals_object/signals_object.dm index f3ec1a99257..846f51b5939 100644 --- a/code/__DEFINES/dcs/signals/signals_object/signals_object.dm +++ b/code/__DEFINES/dcs/signals/signals_object/signals_object.dm @@ -24,6 +24,8 @@ #define COMSIG_ITEM_ATTACK_SELF "item_attack_self" //from base of obj/item/attack_self_secondary(): (/mob) #define COMSIG_ITEM_ATTACK_SELF_SECONDARY "item_attack_self_secondary" +/// Sent from /obj/item/proc/animate_attack() : (atom/movable/attacker, atom/attacked_atom, animation_type, list/image_override, list/animation_override, list/angle_override) +#define COMSIG_ITEM_ATTACK_ANIMATION "item_attack_animation" ///from base of [obj/item/attack()]: (atom/target, mob/user, proximity_flag, click_parameters) #define COMSIG_ITEM_AFTERATTACK "item_afterattack" diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 4a832647a1d..cfb9545b8c3 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -51,8 +51,6 @@ #define LEFT 1 #define RIGHT 2 -#define FIST_ATTACK_ANIMATION -1 - // Pulse levels, very simplified. #define PULSE_NONE 0 // So !M.pulse checks would be possible. #define PULSE_SLOW 1 // <60 bpm diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 6ee66f8150f..de3344d68d6 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -150,7 +150,7 @@ This calls [atom/proc/tool_act], among others. return 0 user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) - user.do_attack_animation(target_mob, src) + user.do_attack_animation(target_mob, used_item = src) if(!user.aura_check(AURA_TYPE_WEAPON, src, user)) return FALSE diff --git a/code/datums/components/overhead_emote/overhead_emote_singleton.dm b/code/datums/components/overhead_emote/overhead_emote_singleton.dm index 8a89597efce..cc7a187d031 100644 --- a/code/datums/components/overhead_emote/overhead_emote_singleton.dm +++ b/code/datums/components/overhead_emote/overhead_emote_singleton.dm @@ -39,8 +39,8 @@ ABSTRACT_TYPE(/singleton/overhead_emote) var/self_message = SPAN_NOTICE("You lift your hand to meet [original]'s, delivering a stunning [emote_description]!") reciprocator.visible_message(others_message, self_message) - INVOKE_ASYNC(reciprocator, TYPE_PROC_REF(/atom/movable, do_attack_animation), original, FIST_ATTACK_ANIMATION) - INVOKE_ASYNC(original, TYPE_PROC_REF(/atom/movable, do_attack_animation), reciprocator, FIST_ATTACK_ANIMATION) + INVOKE_ASYNC(reciprocator, TYPE_PROC_REF(/atom/movable, do_attack_animation), original) + INVOKE_ASYNC(original, TYPE_PROC_REF(/atom/movable, do_attack_animation), reciprocator) if(emote_sound) playsound(reciprocator.loc, emote_sound, 30, 1) @@ -54,8 +54,8 @@ ABSTRACT_TYPE(/singleton/overhead_emote) var/self_message = SPAN_NOTICE("You lift your hand to meet [original]'s, who was expecting a [original_emote.emote_description], but received a [fail_emote.emote_description] instead.") reciprocator.visible_message(others_message, self_message) - INVOKE_ASYNC(reciprocator, TYPE_PROC_REF(/atom/movable, do_attack_animation), original, FIST_ATTACK_ANIMATION) - INVOKE_ASYNC(original, TYPE_PROC_REF(/atom/movable, do_attack_animation), reciprocator, FIST_ATTACK_ANIMATION) + INVOKE_ASYNC(reciprocator, TYPE_PROC_REF(/atom/movable, do_attack_animation), original) + INVOKE_ASYNC(original, TYPE_PROC_REF(/atom/movable, do_attack_animation), reciprocator) playsound(reciprocator.loc, SFX_PUNCH_MISS, 30, 1) diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index cf44b2ff2e2..6a64545f853 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -215,7 +215,7 @@ target_mob.standard_weapon_hit_effects(src, user, damageamount, armorpercent, target_zone) user.visible_message("[endmessage3rd][punct]", "[endmessage1st][punct]") - user.do_attack_animation(target_mob) + user.do_attack_animation(target_mob, used_item = src) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) if(soundname) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 0d05808d007..ec9f6c8cd35 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -830,6 +830,192 @@ // This is instant on byond's end, but to our clients this looks like a quick drop animate(src, alpha = old_alpha, pixel_x = old_x, pixel_y = old_y, transform = old_transform, time = 3, easing = CUBIC_EASING) +/atom/movable/proc/do_item_attack_animation(atom/attacked_atom, visual_effect_icon, obj/item/used_item, animation_type) + if (!visual_effect_icon) + if (used_item) + used_item.animate_attack(src, attacked_atom, animation_type) + return + + var/image/attack_image = image(icon = 'icons/effects/effects.dmi', icon_state = visual_effect_icon) + attack_image.plane = attacked_atom.plane + 1 + // Scale the icon. + attack_image.transform *= 0.4 + // The icon should not rotate. + attack_image.appearance_flags = APPEARANCE_UI + var/atom/movable/flick_visual/attack = attacked_atom.flick_overlay_view(attack_image, 1 SECONDS) + var/matrix/copy_transform = new(transform) + animate(attack, alpha = 175, transform = copy_transform.Scale(0.75), time = 0.3 SECONDS) + animate(time = 0.1 SECONDS) + animate(alpha = 0, time = 0.3 SECONDS, easing = CIRCULAR_EASING|EASE_OUT) + +/obj/item/proc/animate_attack(atom/movable/attacker, atom/attacked_atom, animation_type) + var/list/image_override = list() + var/list/animation_override = list() + var/used_icon_angle = icon_angle + var/list/angle_override = list() + SEND_SIGNAL(src, COMSIG_ITEM_ATTACK_ANIMATION, attacker, attacked_atom, animation_type, image_override, animation_override, angle_override) + var/image/attack_image = null + if (!length(image_override)) + attack_image = isnull(attack_icon) ? image(icon = src) : image(icon = attack_icon, icon_state = attack_icon_state) + else + attack_image = image_override[1] + + if (length(animation_override)) + animation_type = animation_override[1] + else if (!animation_type) + var/damage_flags = damage_flags() + if(damage_flags & DAMAGE_FLAG_SHARP|DAMAGE_FLAG_EDGE) + animation_type = pick(ATTACK_ANIMATION_SLASH, ATTACK_ANIMATION_PIERCE) + else if(damage_flags & DAMAGE_FLAG_SHARP) + animation_type = ATTACK_ANIMATION_SLASH + else if (damage_flags & DAMAGE_FLAG_EDGE) + animation_type = ATTACK_ANIMATION_PIERCE + else + animation_type = ATTACK_ANIMATION_BLUNT + + if (length(angle_override)) + used_icon_angle = angle_override[1] + + attack_image.plane = attacked_atom.plane + 1 + attack_image.pixel_w = attacker.get_standard_pixel_x() + attacker.pixel_w - attacked_atom.get_standard_pixel_x() - attacked_atom.pixel_w + attack_image.pixel_z = attacker.get_standard_pixel_y() + attacker.pixel_z - attacked_atom.get_standard_pixel_y() - attacked_atom.pixel_z + // Scale the icon. + attack_image.transform *= 0.5 + // The icon should not rotate. + attack_image.appearance_flags = APPEARANCE_UI + + var/atom/movable/flick_visual/attack = attacked_atom.flick_overlay_view(attack_image, 1 SECONDS) + var/matrix/copy_transform = new(attacker.transform) + var/x_sign = 0 + var/y_sign = 0 + var/direction = get_dir(attacker, attacked_atom) + if (direction & NORTH) + y_sign = -1 + else if (direction & SOUTH) + y_sign = 1 + + if (direction & EAST) + x_sign = -1 + else if (direction & WEST) + x_sign = 1 + + // Attacking self, or something on the same turf as us + if (!direction) + y_sign = 1 + // Not a fan of this, but its the "cleanest" way to animate this + x_sign = 0.25 * (prob(50) ? 1 : -1) + // For piercing attacks + direction = SOUTH + + // And animate the attack! + switch (animation_type) + if (ATTACK_ANIMATION_BLUNT) + attack.pixel_x = 14 * x_sign + attack.pixel_y = 12 * y_sign + animate(attack, alpha = 175, transform = copy_transform.Scale(0.75), pixel_x = 4 * x_sign, pixel_y = 3 * y_sign, time = 0.2 SECONDS) + animate(time = 0.1 SECONDS) + animate(alpha = 0, time = 0.1 SECONDS, easing = CIRCULAR_EASING|EASE_OUT) + + if (ATTACK_ANIMATION_PIERCE) + var/attack_angle = dir2angle(direction) + rand(-7, 7) + // Deducting 90 because we're assuming that icon_angle of 0 means an east-facing sprite + var/anim_angle = attack_angle - 90 - used_icon_angle + var/angle_mult = 1 + if (x_sign && y_sign) + angle_mult = 1.4 + attack.pixel_x = 22 * x_sign * angle_mult + attack.pixel_y = 18 * y_sign * angle_mult + attack.transform = attack.transform.Turn(anim_angle) + copy_transform = copy_transform.Turn(anim_angle) + animate( + attack, + pixel_x = (22 * x_sign - 12 * sin(attack_angle)) * angle_mult, + pixel_y = (18 * y_sign - 8 * cos(attack_angle)) * angle_mult, + time = 0.1 SECONDS, + easing = CUBIC_EASING|EASE_IN, + ) + animate( + attack, + alpha = 175, + transform = copy_transform.Scale(0.75), + pixel_x = (22 * x_sign + 26 * sin(attack_angle)) * angle_mult, + pixel_y = (18 * y_sign + 22 * cos(attack_angle)) * angle_mult, + time = 0.3 SECONDS, + easing = CUBIC_EASING|EASE_OUT, + ) + animate( + alpha = 0, + pixel_x = -3 * -(x_sign + sin(attack_angle)), + pixel_y = -2 * -(y_sign + cos(attack_angle)), + time = 0.1 SECONDS, + easing = CIRCULAR_EASING|EASE_OUT + ) + + if (ATTACK_ANIMATION_SLASH) + attack.pixel_x = 18 * x_sign + attack.pixel_y = 14 * y_sign + var/x_rot_sign = 0 + var/y_rot_sign = 0 + var/attack_dir = (prob(50) ? 1 : -1) + var/anim_angle = dir2angle(direction) - 90 - used_icon_angle + + if (x_sign) + y_rot_sign = attack_dir + if (y_sign) + x_rot_sign = attack_dir + + // Animations are flipped, so flip us too! + if (x_sign > 0 || y_sign < 0) + attack_dir *= -1 + + // We're swinging diagonally, use separate logic + var/anim_dir = attack_dir + if (x_sign && y_sign) + if (attack_dir < 0) + x_rot_sign = -x_sign * 1.4 + y_rot_sign = 0 + else + x_rot_sign = 0 + y_rot_sign = -y_sign * 1.4 + + // Flip us if we've been flipped *unless* we're flipped due to both axis + if ((x_sign < 0 && y_sign > 0) || (x_sign > 0 && y_sign < 0)) + anim_dir *= -1 + + attack.pixel_x += 10 * x_rot_sign + attack.pixel_y += 8 * y_rot_sign + attack.transform = attack.transform.Turn(anim_angle - 45 * anim_dir) + copy_transform = copy_transform.Scale(0.75) + animate(attack, alpha = 175, time = 0.3 SECONDS, flags = ANIMATION_PARALLEL) + animate(time = 0.1 SECONDS) + animate(alpha = 0, time = 0.1 SECONDS, easing = CIRCULAR_EASING|EASE_OUT) + + animate(attack, transform = copy_transform.Turn(anim_angle + 45 * anim_dir), time = 0.3 SECONDS, flags = ANIMATION_PARALLEL) + + var/x_return = 10 * -x_rot_sign + var/y_return = 8 * -y_rot_sign + + if (!x_rot_sign) + x_return = 18 * x_sign + if (!y_rot_sign) + y_return = 14 * y_sign + + var/angle_mult = 1 + if (x_sign && y_sign) + angle_mult = 1.4 + if (attack_dir > 0) + x_return = 8 * x_sign + y_return = 14 * y_sign + else + x_return = 18 * x_sign + y_return = 6 * y_sign + + animate(attack, pixel_x = 4 * x_sign * angle_mult, time = 0.2 SECONDS, easing = CIRCULAR_EASING | EASE_IN, flags = ANIMATION_PARALLEL) + animate(pixel_x = x_return, time = 0.2 SECONDS, easing = CIRCULAR_EASING | EASE_OUT) + + animate(attack, pixel_y = 3 * y_sign * angle_mult, time = 0.2 SECONDS, easing = CIRCULAR_EASING | EASE_IN, flags = ANIMATION_PARALLEL) + animate(pixel_y = y_return, time = 0.2 SECONDS, easing = CIRCULAR_EASING | EASE_OUT) + /atom/movable/proc/get_floating_chat_x_offset() return 0 diff --git a/code/game/objects/effects/chem/foam.dm b/code/game/objects/effects/chem/foam.dm index 8d89eed11dc..6b93e7f42e3 100644 --- a/code/game/objects/effects/chem/foam.dm +++ b/code/game/objects/effects/chem/foam.dm @@ -180,7 +180,7 @@ /obj/structure/foamedmetal/attack_hand(var/mob/user) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) - user.do_attack_animation(src, FIST_ATTACK_ANIMATION) + user.do_attack_animation(src) if ((user.mutations & HULK) || (prob(75 - metal * 25))) user.visible_message(SPAN_WARNING("[user] smashes through the foamed metal."), SPAN_NOTICE("You smash through the metal foam wall.")) qdel(src) @@ -238,7 +238,7 @@ qdel(src) return TRUE - user.do_attack_animation(src, attacking_item) + user.do_attack_animation(src, used_item = attacking_item) if(prob(attacking_item.force * 20 - metal * 25)) user.visible_message(SPAN_WARNING("[user] smashes through the foamed metal."), SPAN_NOTICE("You smash through the foamed metal with \the [attacking_item].")) qdel(src) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index a0f440f2516..55db684600b 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -207,6 +207,13 @@ /// Used to override hardcoded clothing dmis in human clothing pr var/icon_override + /// Angle of the icon, used for piercing and slashing attack animations, clockwise from *east-facing* sprites + var/icon_angle = 0 + ///icon file for an alternate attack icon + var/attack_icon + ///icon state for an alternate attack icon + var/attack_icon_state + var/charge_failure_message = " cannot be recharged." var/held_maptext diff --git a/code/game/objects/items/weapons/material/twohanded.dm b/code/game/objects/items/weapons/material/twohanded.dm index 31ac7e91371..3eba17f35fc 100644 --- a/code/game/objects/items/weapons/material/twohanded.dm +++ b/code/game/objects/items/weapons/material/twohanded.dm @@ -200,11 +200,12 @@ /obj/item/material/twohanded/fireaxe // DEM AXES MAN, marker -Agouri icon_state = "fireaxe0" base_icon = "fireaxe" + icon_angle = -180 name = "fire axe" desc = "Truly, the weapon of a madman. Who would think to fight fire with an axe?" unwielded_force_divisor = 0.25 force_divisor = 0.7 // 10/42 with hardness 60 (steel) and 0.25 unwielded divisor - sharp = 1 + sharp = FALSE edge = TRUE w_class = WEIGHT_CLASS_BULKY slot_flags = SLOT_BACK @@ -243,6 +244,7 @@ /obj/item/material/twohanded/spear icon_state = "spearglass0" base_icon = "spearglass" + icon_angle = -45 name = "spear" desc = "A haphazardly-constructed yet still deadly weapon of ancient design." force = 15 diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm index a11c21edc2f..2a2d98f02f5 100644 --- a/code/game/objects/items/weapons/weaponry.dm +++ b/code/game/objects/items/weapons/weaponry.dm @@ -89,7 +89,7 @@ /obj/effect/energy_net/attack_hand(var/mob/user) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) - user.do_attack_animation(src, FIST_ATTACK_ANIMATION) + user.do_attack_animation(src) if(user == affecting) to_chat(user, SPAN_WARNING("You can't claw at \the [src] while trapped inside it! You need to use a weapon.")) return @@ -110,7 +110,7 @@ /obj/effect/energy_net/attackby(obj/item/attacking_item, mob/user) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) - user.do_attack_animation(src, attacking_item) + user.do_attack_animation(src, used_item = attacking_item) var/attack_force = attacking_item.force if(user == affecting) attack_force /= 2 diff --git a/code/game/objects/structures/gore/wall.dm b/code/game/objects/structures/gore/wall.dm index 4b8a45cdfc9..29e55ffb443 100644 --- a/code/game/objects/structures/gore/wall.dm +++ b/code/game/objects/structures/gore/wall.dm @@ -30,7 +30,7 @@ /obj/structure/gore/resin/attack_hand(var/mob/user) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) - user.do_attack_animation(src, FIST_ATTACK_ANIMATION) + user.do_attack_animation(src) if((user.mutations & HULK)) visible_message(SPAN_DANGER("\The [user] destroys \the [src]!")) add_damage(maxhealth) diff --git a/code/game/objects/structures/machinery/atmoalter/canister.dm b/code/game/objects/structures/machinery/atmoalter/canister.dm index 486db49bb92..2a2093a19f3 100644 --- a/code/game/objects/structures/machinery/atmoalter/canister.dm +++ b/code/game/objects/structures/machinery/atmoalter/canister.dm @@ -441,7 +441,7 @@ update_flag if(attacking_item.item_flags & ITEM_FLAG_NO_BLUDGEON) return TRUE visible_message(SPAN_WARNING("\The [user] hits \the [src] with \the [attacking_item]!"), SPAN_NOTICE("You hit \the [src] with \the [attacking_item].")) - user.do_attack_animation(src, attacking_item) + user.do_attack_animation(src, used_item = attacking_item) playsound(src, 'sound/weapons/smash.ogg', 60, 1) add_damage(attacking_item.force) if(!istype(attacking_item, /obj/item/forensics)) diff --git a/code/game/objects/structures/machinery/doors/airlock.dm b/code/game/objects/structures/machinery/doors/airlock.dm index 2047a7b7cdb..f38d1a04bf8 100644 --- a/code/game/objects/structures/machinery/doors/airlock.dm +++ b/code/game/objects/structures/machinery/doors/airlock.dm @@ -1434,7 +1434,7 @@ About the new airlock wires panel: return if(H.default_attack?.attack_door && !(stat & (BROKEN|NOPOWER))) user.visible_message(SPAN_DANGER("\The [user] forcefully strikes \the [src] with their [H.default_attack.attack_name]!")) - user.do_attack_animation(src, null) + user.do_attack_animation(src, H.default_attack.attack_effect) playsound(loc, hitsound, 60, TRUE) add_damage(H.default_attack.attack_door) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) diff --git a/code/game/objects/structures/machinery/telecomms/machine_interactions.dm b/code/game/objects/structures/machinery/telecomms/machine_interactions.dm index f0e0c473ba6..5cedd20603f 100644 --- a/code/game/objects/structures/machinery/telecomms/machine_interactions.dm +++ b/code/game/objects/structures/machinery/telecomms/machine_interactions.dm @@ -29,7 +29,7 @@ if(!istype(user, /mob/living/silicon)) if(user.a_intent == I_HURT) user.visible_message(SPAN_DANGER("\The [user] strikes [src]!")) - user.do_attack_animation(user, attacking_item) + user.do_attack_animation(user, used_item = attacking_item) playsound(loc, hitsound, 60, TRUE) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) integrity = between(0, integrity - round(attacking_item.force / 3), initial(integrity)) diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm index ae52c41ae6e..467fbb568f9 100644 --- a/code/game/turfs/simulated/wall_attacks.dm +++ b/code/game/turfs/simulated/wall_attacks.dm @@ -139,7 +139,7 @@ WR.scrape(user) return else if(attacking_item.force >= 10) - user.do_attack_animation(src, attacking_item) + user.do_attack_animation(src, used_item = attacking_item) to_chat(user, SPAN_NOTICE("\The [src] crumbles away under the force of your [attacking_item].")) dismantle_wall(TRUE) return diff --git a/code/modules/atmospherics/components/unary/vent_pump.dm b/code/modules/atmospherics/components/unary/vent_pump.dm index 0e7fac74aed..845eb2e1de6 100644 --- a/code/modules/atmospherics/components/unary/vent_pump.dm +++ b/code/modules/atmospherics/components/unary/vent_pump.dm @@ -407,13 +407,13 @@ to_chat(user, SPAN_WARNING("\The [attacking_item] can only be used to tear open welded air vents!")) return TRUE user.visible_message(SPAN_WARNING("\The [user] starts using \the [attacking_item] to hack open \the [src]!"), SPAN_NOTICE("You start hacking open \the [src] with \the [attacking_item]...")) - user.do_attack_animation(src, attacking_item) + user.do_attack_animation(src, used_item = attacking_item) playsound(loc, 'sound/weapons/smash.ogg', 60, TRUE) var/cut_amount = 3 for(var/i = 0; i <= cut_amount; i++) if(!attacking_item || !do_after(user, 30, src)) return TRUE - user.do_attack_animation(src, attacking_item) + user.do_attack_animation(src, used_item = attacking_item) user.visible_message(SPAN_WARNING("\The [user] smashes \the [attacking_item] into \the [src]!"), SPAN_NOTICE("You smash \the [attacking_item] into \the [src].")) playsound(loc, 'sound/weapons/smash.ogg', 60, TRUE) if(i == cut_amount) diff --git a/code/modules/atmospherics/components/unary/vent_scrubber.dm b/code/modules/atmospherics/components/unary/vent_scrubber.dm index 88c426d5893..040cfab61b8 100644 --- a/code/modules/atmospherics/components/unary/vent_scrubber.dm +++ b/code/modules/atmospherics/components/unary/vent_scrubber.dm @@ -412,13 +412,13 @@ to_chat(user, SPAN_WARNING("\The [attacking_item] can only be used to tear open welded scrubbers!")) return TRUE user.visible_message(SPAN_WARNING("\The [user] starts using \the [attacking_item] to hack open \the [src]!"), SPAN_NOTICE("You start hacking open \the [src] with \the [attacking_item]...")) - user.do_attack_animation(src, attacking_item) + user.do_attack_animation(src, used_item = attacking_item) playsound(loc, 'sound/weapons/smash.ogg', 60, TRUE) var/cut_amount = 3 for(var/i = 0; i <= cut_amount; i++) if(!attacking_item || !do_after(user, 30, src)) return TRUE - user.do_attack_animation(src, attacking_item) + user.do_attack_animation(src, used_item = attacking_item) user.visible_message(SPAN_WARNING("\The [user] smashes \the [attacking_item] into \the [src]!"), SPAN_NOTICE("You smash \the [attacking_item] into \the [src].")) playsound(loc, 'sound/weapons/smash.ogg', 60, TRUE) if(i == cut_amount) diff --git a/code/modules/atmospherics/vent_passive.dm b/code/modules/atmospherics/vent_passive.dm index 923c79fd50e..abc063626c1 100644 --- a/code/modules/atmospherics/vent_passive.dm +++ b/code/modules/atmospherics/vent_passive.dm @@ -128,13 +128,13 @@ to_chat(user, SPAN_WARNING("\The [attacking_item] can only be used to tear open welded air vents!")) return TRUE user.visible_message(SPAN_WARNING("\The [user] starts using \the [attacking_item] to hack open \the [src]!"), SPAN_NOTICE("You start hacking open \the [src] with \the [attacking_item]...")) - user.do_attack_animation(src, attacking_item) + user.do_attack_animation(src, used_item = attacking_item) playsound(loc, 'sound/weapons/smash.ogg', 60, TRUE) var/cut_amount = 3 for(var/i = 0; i <= cut_amount; i++) if(!attacking_item || !do_after(user, 30, src)) return TRUE - user.do_attack_animation(src, attacking_item) + user.do_attack_animation(src, used_item = attacking_item) user.visible_message(SPAN_WARNING("\The [user] smashes \the [attacking_item] into \the [src]!"), SPAN_NOTICE("You smash \the [attacking_item] into \the [src].")) playsound(loc, 'sound/weapons/smash.ogg', 60, TRUE) if(i == cut_amount) diff --git a/code/modules/games/cards.dm b/code/modules/games/cards.dm index 0b9d55b9fac..9fc6e562778 100644 --- a/code/modules/games/cards.dm +++ b/code/modules/games/cards.dm @@ -205,7 +205,7 @@ cards -= cards[1] H.concealed = TRUE H.update_icon() - user.do_attack_animation(src, null) + user.do_attack_animation(src) balloon_alert_to_viewers("deals a card") H.throw_at(get_step(target,target.dir), 10, 1, user, FALSE) if(!length(cards)) diff --git a/code/modules/martial_arts/martial.dm b/code/modules/martial_arts/martial.dm index 1f0b08dd98b..c9703e275a6 100644 --- a/code/modules/martial_arts/martial.dm +++ b/code/modules/martial_arts/martial.dm @@ -166,7 +166,7 @@ /datum/martial_art/proc/simple_animal_basic_disarm(var/mob/living/carbon/human/A, var/mob/living/simple_animal/D) if(A.a_intent == I_DISARM) A.visible_message("[SPAN_BOLD("\The [A]")] [D.response_disarm] \the [D]") - A.do_attack_animation(D) + A.do_attack_animation(D, ATTACK_EFFECT_DISARM) D.poke(1) D.handle_attack_by(A) diff --git a/code/modules/martial_arts/revenant.dm b/code/modules/martial_arts/revenant.dm index e00e6c79d2a..c24350b58d2 100644 --- a/code/modules/martial_arts/revenant.dm +++ b/code/modules/martial_arts/revenant.dm @@ -21,7 +21,7 @@ return TRUE /datum/martial_art/revenant/proc/bash_slash(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) - A.do_attack_animation(D) + A.do_attack_animation(D, ATTACK_EFFECT_CLAW) D.visible_message(SPAN_DANGER("[A] bashes [D] away!"), SPAN_DANGER("[A] bashes you away!")) D.apply_damage(rand(5, 10), DAMAGE_BRUTE, damage_flags = DAMAGE_FLAG_SHARP) var/throw_range = rand(1, 2) diff --git a/code/modules/martial_arts/skrell.dm b/code/modules/martial_arts/skrell.dm index f0accb2d89a..7eec629c40f 100644 --- a/code/modules/martial_arts/skrell.dm +++ b/code/modules/martial_arts/skrell.dm @@ -22,7 +22,7 @@ return 0 /datum/martial_art/karak_virul/proc/leg_sweep(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) - A.do_attack_animation(D) + A.do_attack_animation(D, ATTACK_EFFECT_KICK) if(D.stat || D.weakened) return 0 D.visible_message(SPAN_WARNING("[A] leg sweeps [D]!")) diff --git a/code/modules/martial_arts/sleeping_carp.dm b/code/modules/martial_arts/sleeping_carp.dm index f8a2e4d6ed7..5dda83f04dc 100644 --- a/code/modules/martial_arts/sleeping_carp.dm +++ b/code/modules/martial_arts/sleeping_carp.dm @@ -37,7 +37,7 @@ /datum/martial_art/the_sleeping_carp/proc/wristWrench(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) if(!D.stat && !D.stunned && !D.weakened) - A.do_attack_animation(D) + A.do_attack_animation(D, ATTACK_EFFECT_DISARM) D.visible_message(SPAN_WARNING("[A] grabs [D]'s wrist and wrenches it sideways!")) playsound(get_turf(A), 'sound/weapons/thudswoosh.ogg', 50, 1, -1) D.drop_item() @@ -48,7 +48,7 @@ /datum/martial_art/the_sleeping_carp/proc/backKick(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) if(A.dir == D.dir && !D.stat && !D.weakened) - A.do_attack_animation(D) + A.do_attack_animation(D, ATTACK_EFFECT_KICK) D.visible_message(SPAN_WARNING("[A] kicks [D] in the back!")) step_to(D,get_step(D,D.dir),1) D.Weaken(4) @@ -59,7 +59,7 @@ /datum/martial_art/the_sleeping_carp/proc/kneeStomach(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) if(!D.stat && !D.weakened) - A.do_attack_animation(D) + A.do_attack_animation(D, ATTACK_EFFECT_KICK) D.visible_message(SPAN_WARNING("[A] knees [D] in the stomach!"), \ SPAN_DANGER("[A] winds you with a knee in the stomach!")) D.audible_message("[D] gags!") @@ -73,7 +73,7 @@ /datum/martial_art/the_sleeping_carp/proc/headKick(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) if(!D.stat && !D.weakened) - A.do_attack_animation(D) + A.do_attack_animation(D, ATTACK_EFFECT_KICK) D.visible_message(SPAN_WARNING("[A] kicks [D] in the head!"), \ SPAN_DANGER("[A] kicks you in the jaw!")) D.apply_damage(20, DAMAGE_BRUTE, BP_HEAD) @@ -86,7 +86,7 @@ /datum/martial_art/the_sleeping_carp/proc/elbowDrop(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) if(D.weakened || D.resting || D.stat) - A.do_attack_animation(D) + A.do_attack_animation(D, ATTACK_EFFECT_SMASH) D.visible_message(SPAN_DANGER("[A] elbow drops [D]!")) if(D.shock_stage >= 60) D.death() //FINISH HIM! diff --git a/code/modules/martial_arts/sol_combat.dm b/code/modules/martial_arts/sol_combat.dm index a96a11da2cf..5efb5a62546 100644 --- a/code/modules/martial_arts/sol_combat.dm +++ b/code/modules/martial_arts/sol_combat.dm @@ -49,7 +49,7 @@ AM.throw_at(sweeptarget, ((clamp((1 - (clamp(distfromcaster - 2, 0, distfromcaster))), 1, 1))), 1) /datum/martial_art/sol_combat/proc/quick_choke(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)//is actually lung punch - A.do_attack_animation(D) + A.do_attack_animation(D, ATTACK_EFFECT_SMASH) A.visible_message(SPAN_WARNING("[A] pounds [D] on the chest!")) playsound(get_turf(A), "punch", 50, 1, -1) if(!(D.species.flags & NO_BREATHE)) @@ -75,12 +75,16 @@ if(check_streak(A,D)) return 1 add_logs(A, D, "punched") - A.do_attack_animation(D) + var/picked_hit_type = pick("punched", "kicked") + var/attack_animation = ATTACK_EFFECT_PUNCH + if(picked_hit_type == "kicked") + attack_animation = ATTACK_EFFECT_KICK + A.do_attack_animation(D, attack_animation) var/bonus_damage = 10 if(D.weakened || D.resting || D.lying) bonus_damage += 5 - picked_hit_type = "stomped on" + picked_hit_type = "stomped" D.apply_damage(bonus_damage, DAMAGE_BRUTE) if(picked_hit_type == "kicked" || picked_hit_type == "stomped") playsound(get_turf(D), SFX_SWING_HIT, 50, 1, -1) @@ -96,7 +100,7 @@ /datum/martial_art/sol_combat/disarm_act(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) add_to_streak("D",D) - A.do_attack_animation(D) + A.do_attack_animation(D, ATTACK_EFFECT_DISARM) if(check_streak(A,D)) return 1 diff --git a/code/modules/martial_arts/tajara.dm b/code/modules/martial_arts/tajara.dm index 50a276879de..fb74e9598b0 100644 --- a/code/modules/martial_arts/tajara.dm +++ b/code/modules/martial_arts/tajara.dm @@ -24,7 +24,7 @@ /datum/martial_art/baghrar/proc/eye_rake(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) if(!istajara(A)) return 0 - A.do_attack_animation(D) + A.do_attack_animation(D, ATTACK_EFFECT_CLAW) playsound(get_turf(A), 'sound/weapons/slice.ogg', 50, 1, -1) if(!D.species.has_limbs[BP_HEAD]) @@ -53,7 +53,7 @@ return 1 /datum/martial_art/baghrar/proc/claw_punch(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)//is actually lung punch - A.do_attack_animation(D) + A.do_attack_animation(D, ATTACK_EFFECT_CLAW) A.visible_message(SPAN_DANGER("[A] lunges forwards and strikes [D] with their claws!")) playsound(get_turf(A), 'sound/weapons/slice.ogg', 50, 1, -1) var/obj/item/organ/external/affecting = D.get_organ(ran_zone(A.zone_sel.selecting)) @@ -65,7 +65,7 @@ /datum/martial_art/baghrar/proc/rraknar_stab(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) if(!istajara(A)) return 0 - A.do_attack_animation(D) + A.do_attack_animation(D, ATTACK_EFFECT_CLAW) var/obj/item/organ/external/organ = D.get_organ(A.zone_sel.selecting) A.visible_message(SPAN_DANGER("[A] stabs [D]'s [organ.name] with their claws!")) D.apply_damage(organ.brute_dam, DAMAGE_BRUTE, organ, damage_flags = DAMAGE_FLAG_SHARP|DAMAGE_FLAG_EDGE) diff --git a/code/modules/martial_arts/unathi.dm b/code/modules/martial_arts/unathi.dm index 1ff7c171d6e..7bb55bf7363 100644 --- a/code/modules/martial_arts/unathi.dm +++ b/code/modules/martial_arts/unathi.dm @@ -54,7 +54,7 @@ /datum/martial_art/kis_khan/simple_animal_basic_disarm(var/mob/living/carbon/human/A, var/mob/living/simple_animal/D) if(!D.paralysis) A.visible_message("[SPAN_BOLD("[A]")] delivers a blow to \the [SPAN_BOLD("[D]")]'s head, making [D.get_pronoun("him")] fall unconscious!") - A.do_attack_animation(D) + A.do_attack_animation(D, ATTACK_EFFECT_DISARM) playsound(D.loc, SFX_PUNCH, 25, TRUE, MEDIUM_RANGE_SOUND_EXTRARANGE+4) D.AdjustParalysis(5) else @@ -74,7 +74,7 @@ return 1 /datum/martial_art/kis_khan/proc/swift_disarm(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) - A.do_attack_animation(D) + A.do_attack_animation(D, ATTACK_EFFECT_DISARM) if(prob(80)) if(D.hand) if(istype(D.l_hand, /obj/item)) @@ -94,7 +94,7 @@ return 1 /datum/martial_art/kis_khan/proc/hammering_strike(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) - A.do_attack_animation(D) + A.do_attack_animation(D, ATTACK_EFFECT_SMASH) A.visible_message(SPAN_DANGER("[A] slams [D] away!")) playsound(D.loc, "punch", 50, 1, -1) D.apply_effect(2, WEAKEN) diff --git a/code/modules/martial_arts/vaurca.dm b/code/modules/martial_arts/vaurca.dm index fba6b1822af..7ab7efcfb3b 100644 --- a/code/modules/martial_arts/vaurca.dm +++ b/code/modules/martial_arts/vaurca.dm @@ -45,7 +45,7 @@ /datum/martial_art/vkutet/proc/piercing_strike(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) if(!isvaurca(A)) return 0 - A.do_attack_animation(D) + A.do_attack_animation(D, ATTACK_EFFECT_CLAW) var/atk_verb = pick("slices", "pinches", "chops", "bites", "claws") D.visible_message(SPAN_DANGER("[A] [atk_verb] [D]!"), \ SPAN_DANGER("[A] [atk_verb] you!")) diff --git a/code/modules/martial_arts/zombie.dm b/code/modules/martial_arts/zombie.dm index f14177fc07c..126ddf13428 100644 --- a/code/modules/martial_arts/zombie.dm +++ b/code/modules/martial_arts/zombie.dm @@ -28,7 +28,7 @@ /datum/martial_art/zombie/proc/strong_bite(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) - A.do_attack_animation(D) + A.do_attack_animation(D, ATTACK_EFFECT_BITE) var/atk_verb = pick("chomps", "bites") D.visible_message(SPAN_DANGER("[A] [atk_verb] down hard on [D]!"), SPAN_DANGER("[A] [atk_verb] down hard on you!")) D.apply_damage(rand(5, 10), DAMAGE_BRUTE, damage_flags = DAMAGE_FLAG_SHARP, armor_pen = 100) diff --git a/code/modules/mob/animations.dm b/code/modules/mob/animations.dm index 80c4bba9af9..7c8105019fb 100644 --- a/code/modules/mob/animations.dm +++ b/code/modules/mob/animations.dm @@ -119,39 +119,23 @@ note dizziness decrements automatically in the mob's Life() proc. //reset the pixel offsets to defaults is_floating = FALSE -/atom/movable/proc/do_attack_animation(atom/A, atom/movable/weapon, var/image/attack_image, var/initial_pixel_x = 0, var/initial_pixel_y = 0) +/atom/movable/proc/do_attack_animation(atom/attacked_atom, visual_effect_icon, obj/item/used_item, no_effect, fov_effect = TRUE, item_animation_override = null) + if(!no_effect && (visual_effect_icon || used_item)) + do_item_attack_animation(attacked_atom, visual_effect_icon, used_item, animation_type = item_animation_override) + + if(attacked_atom == src) + return //don't do an animation if attacking self var/pixel_x_diff = 0 var/pixel_y_diff = 0 var/turn_dir = 1 - var/direction = get_dir(src, A) - switch(direction) - if(NORTH) - pixel_y_diff = 8 - if(SOUTH) - pixel_y_diff = -8 - if(EAST) - pixel_x_diff = 8 - if(WEST) - pixel_x_diff = -8 - if(NORTHEAST) - pixel_x_diff = 8 - pixel_y_diff = 8 - if(NORTHWEST) - pixel_x_diff = -8 - pixel_y_diff = 8 - if(SOUTHEAST) - pixel_x_diff = 8 - pixel_y_diff = -8 - if(SOUTHWEST) - pixel_x_diff = -8 - pixel_y_diff = -8 + var/direction = get_dir(src, attacked_atom) if(direction & NORTH) pixel_y_diff = 8 - turn_dir = rand(50) ? -1 : 1 + turn_dir = prob(50) ? -1 : 1 else if(direction & SOUTH) pixel_y_diff = -8 - turn_dir = rand(50) ? -1 : 1 + turn_dir = prob(50) ? -1 : 1 if(direction & EAST) pixel_x_diff = 8 @@ -159,80 +143,10 @@ note dizziness decrements automatically in the mob's Life() proc. pixel_x_diff = -8 turn_dir = -1 - if(!initial_pixel_x) - initial_pixel_x = initial(pixel_x) - if(!initial_pixel_y) - initial_pixel_y = initial(pixel_y) - - animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff, time = 2) - animate(pixel_x = initial_pixel_x, pixel_y = initial_pixel_y, time = 2) var/matrix/initial_transform = matrix(transform) var/matrix/rotated_transform = transform.Turn(15 * turn_dir) - - animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff, transform = rotated_transform, time = 2, easing = BACK_EASING | EASE_IN) - animate(pixel_x = initial_pixel_x, pixel_y = initial_pixel_y, transform = initial_transform, time = 2, easing = SINE_EASING) - -// either attack_item OR attack_image should be used. if both are used, attack_image will be the one chosen -/mob/do_attack_animation(atom/A, var/atom/attack_item, var/image/attack_image) - set waitfor = FALSE - - var/initial_pixel_x = get_standard_pixel_x() - var/initial_pixel_y = get_standard_pixel_y() - ..(A, attack_item, attack_image, initial_pixel_x, initial_pixel_y) - - if(is_floating) - addtimer(CALLBACK(src, PROC_REF(start_floating)), 4) - - if(attack_item == FIST_ATTACK_ANIMATION) // only play the physical movement - return - // What icon do we use for the attack? - var/image/I - if(attack_image) - I = attack_image - else if(attack_item) - I = image(attack_item.icon, A, attack_item.icon_state, A.layer + 1) - else - if(hand && l_hand) // Attacked with item in left hand. - I = image(l_hand.icon, A, l_hand.icon_state, A.layer + 1) - else if (!hand && r_hand) // Attacked with item in right hand. - I = image(r_hand.icon, A, r_hand.icon_state, A.layer + 1) - else // Attacked with a fist? - return - - // Who can see the attack? - var/list/viewing = list() - for (var/mob/M in viewers(A)) - if (M.client) - viewing |= M.client - flick_overlay(I, viewing, 5) // 5 ticks/half a second - - // Scale the icon. - I.transform *= 0.75 - // Set the direction of the icon animation. - var/direction = get_dir(src, A) - if(direction & NORTH) - I.pixel_y = -16 - else if(direction & SOUTH) - I.pixel_y = 16 - - if(direction & EAST) - I.pixel_x = -16 - else if(direction & WEST) - I.pixel_x = 16 - - if(!direction) // Attacked self?! - I.pixel_z = 16 - - var/matrix/M = new - M.Turn(pick(-20, 20)) - // And animate the attack! - animate(I, alpha = 175, pixel_x = initial_pixel_x, pixel_y = initial_pixel_y, pixel_z = 0, time = 2, easing = CUBIC_EASING) - sleep(2) - animate(I, transform = M, time = 1) // apply the fancy matrix - sleep(1) - animate(I, transform = matrix(), time = 1) // back to a default matrix - sleep(1) - animate(I, alpha = 0, time = 1) + animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff, transform=rotated_transform, time = 1, easing=BACK_EASING|EASE_IN, flags = ANIMATION_PARALLEL) + animate(pixel_x = pixel_x - pixel_x_diff, pixel_y = pixel_y - pixel_y_diff, transform=initial_transform, time = 2, easing=SINE_EASING, flags = ANIMATION_PARALLEL) /mob/proc/spin(spintime, speed) spawn() diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 88e28965ed0..4560ef1e660 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -255,7 +255,7 @@ if(!attack) return 0 - H.do_attack_animation(src) + H.do_attack_animation(src, attack.attack_effect) if(!attack_message) attack.show_attack(H, src, hit_zone, rand_damage) else @@ -363,7 +363,7 @@ src.attack_log += "\[[time_stamp()]\] Has been disarmed by [M.name] ([M.ckey])" msg_admin_attack("[key_name(M)] disarmed [src.name] ([src.ckey]) (JMP)",ckey=key_name(M),ckey_target=key_name(src)) - M.do_attack_animation(src) + M.do_attack_animation(src, ATTACK_EFFECT_DISARM) if(w_uniform) w_uniform.add_fingerprint(M) @@ -512,7 +512,7 @@ to_chat(H, cpr_attempt_message) - H.do_attack_animation(src, null, image('icons/hud/mob/generic.dmi', src, "cpr", src.layer + 1)) + H.do_attack_animation(src, ATTACK_EFFECT_CPR) var/starting_pixel_y = pixel_y animate(src, pixel_y = starting_pixel_y + 4, time = 2) animate(src, pixel_y = starting_pixel_y, time = 2) diff --git a/code/modules/mob/living/carbon/human/species/species_attack.dm b/code/modules/mob/living/carbon/human/species/species_attack.dm index b3b26a3ec9c..fc8b49c97f7 100644 --- a/code/modules/mob/living/carbon/human/species/species_attack.dm +++ b/code/modules/mob/living/carbon/human/species/species_attack.dm @@ -7,6 +7,7 @@ edge = TRUE damage = 5 attack_name = "sharp bite" + attack_effect = ATTACK_EFFECT_BITE /datum/unarmed_attack/diona attack_verb = list("lashed", "bludgeoned") @@ -28,6 +29,7 @@ edge = TRUE damage = 5 attack_name = "claws" + attack_effect = ATTACK_EFFECT_CLAW /datum/unarmed_attack/claws/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) var/obj/item/organ/external/affecting = target.get_organ(zone) @@ -124,6 +126,7 @@ attack_name = "heavy fist" shredding = TRUE sparring_variant_type = /datum/unarmed_attack/pain_strike/heavy + attack_effect = ATTACK_EFFECT_SMASH /datum/unarmed_attack/industrial/heavy damage = 9 @@ -140,6 +143,7 @@ attack_sound = 'sound/weapons/beartrap_shut.ogg' attack_name = "power fist" shredding = TRUE + attack_effect = ATTACK_EFFECT_SMASH /datum/unarmed_attack/terminator/apply_effects(var/mob/living/carbon/human/user,var/mob/living/carbon/human/target,var/armor,var/attack_damage,var/zone) ..() @@ -225,6 +229,7 @@ attack_sound = 'sound/weapons/heavysmash.ogg' attack_name = "crushing fist" shredding = TRUE + attack_effect = ATTACK_EFFECT_SMASH /datum/unarmed_attack/shocking attack_verb = list("prodded", "touched") @@ -265,6 +270,7 @@ attack_door = 20 crowbar_door = TRUE sparring_variant_type = /datum/unarmed_attack/pain_strike/heavy + attack_effect = ATTACK_EFFECT_SMASH /datum/unarmed_attack/vaurca_bulwark/apply_effects(var/mob/living/carbon/human/user,var/mob/living/carbon/human/target,var/armor,var/zone) ..() @@ -290,6 +296,7 @@ attack_sound = 'sound/weapons/beartrap_shut.ogg' attack_name = "industrial claw" shredding = TRUE + attack_effect = ATTACK_EFFECT_SMASH /datum/unarmed_attack/tesla_body/apply_effects(var/mob/living/carbon/human/user,var/mob/living/carbon/human/target,var/armor,var/attack_damage,var/zone) ..() diff --git a/code/modules/mob/living/carbon/human/unarmed_attack.dm b/code/modules/mob/living/carbon/human/unarmed_attack.dm index 8fbc25dd476..04f68afd103 100644 --- a/code/modules/mob/living/carbon/human/unarmed_attack.dm +++ b/code/modules/mob/living/carbon/human/unarmed_attack.dm @@ -9,6 +9,8 @@ GLOBAL_LIST_EMPTY(sparring_attack_cache) var/armor_penetration = 0 var/attack_sound = SFX_PUNCH var/miss_sound = SFX_PUNCH_MISS + /// The attack effect played with this attack. + var/attack_effect = ATTACK_EFFECT_PUNCH var/shredding = 0 // Calls the old attack_alien() behavior on objects/mobs when on harm intent. var/attack_door = 0 // Whether the attack can damage airlocks and how much damage it does var/crowbar_door = FALSE @@ -166,6 +168,7 @@ GLOBAL_LIST_EMPTY(sparring_attack_cache) sharp = 0 edge = FALSE attack_name = "bite" + attack_effect = ATTACK_EFFECT_BITE /datum/unarmed_attack/bite/is_usable(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone) if(user.incapacitated()) @@ -254,6 +257,7 @@ GLOBAL_LIST_EMPTY(sparring_attack_cache) desc = "A high risk, pretty low reward move. It could be useful if your shoes has a knife sticking out the front, or if you're a trained martial arts master. Make sure to target the lower parts of the body, or else you won't be able to reach!" damage = 0 attack_name = "kick" + attack_effect = ATTACK_EFFECT_KICK /datum/unarmed_attack/kick/is_usable(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone) if(user.legcuffed || user.incapacitated()) diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index e661e1d9b44..a7c659175c0 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -86,6 +86,9 @@ var/burn_mod = 1 var/brute_mod = 1 + /// Override for the visual attack effect shown on 'do_attack_animation()'. + var/attack_vis_effect + /// used to limit people from queuing up limb-breaks var/limb_breaking = FALSE /// Basically a catch-all aura/force-field thing. diff --git a/code/modules/mob/living/simple_animal/hostile/adhomai.dm b/code/modules/mob/living/simple_animal/hostile/adhomai.dm index 2e56f87dbf3..bcbd53a258d 100644 --- a/code/modules/mob/living/simple_animal/hostile/adhomai.dm +++ b/code/modules/mob/living/simple_animal/hostile/adhomai.dm @@ -21,6 +21,7 @@ melee_damage_lower = 15 melee_damage_upper = 15 attacktext = "bites" + attack_vis_effect = ATTACK_EFFECT_BITE attack_sound = 'sound/weapons/bite.ogg' environment_smash = 1 @@ -57,6 +58,7 @@ melee_damage_lower = 15 melee_damage_upper = 15 attacktext = "bites" + attack_vis_effect = ATTACK_EFFECT_BITE attack_sound = 'sound/weapons/bite.ogg' faction = "Adhomai" diff --git a/code/modules/mob/living/simple_animal/hostile/alien.dm b/code/modules/mob/living/simple_animal/hostile/alien.dm index c8fd579102a..1872876f7a4 100644 --- a/code/modules/mob/living/simple_animal/hostile/alien.dm +++ b/code/modules/mob/living/simple_animal/hostile/alien.dm @@ -13,6 +13,7 @@ melee_damage_lower = 5 melee_damage_upper = 15 attacktext = "mauls" + attack_vis_effect = ATTACK_EFFECT_CLAW cold_damage_per_tick = 0 speak_chance = 5 speak = list("Hruuugh!","Hrunnph") @@ -34,6 +35,7 @@ melee_damage_lower = 1 melee_damage_upper = 8 attacktext = "gouges" + attack_vis_effect = ATTACK_EFFECT_SLASH cold_damage_per_tick = 0 speak_chance = 5 speak = list("Awrr?","Aowrl!","Worrl") @@ -59,6 +61,7 @@ melee_damage_lower = 3 melee_damage_upper = 12 attacktext = "gouges" + attack_vis_effect = ATTACK_EFFECT_SLASH cold_damage_per_tick = 0 speak_chance = 5 speak = list("Shuhn","Shrunnph?","Shunpf") diff --git a/code/modules/mob/living/simple_animal/hostile/bat.dm b/code/modules/mob/living/simple_animal/hostile/bat.dm index d7ef9f3e938..eb278ca8b02 100644 --- a/code/modules/mob/living/simple_animal/hostile/bat.dm +++ b/code/modules/mob/living/simple_animal/hostile/bat.dm @@ -24,6 +24,7 @@ melee_damage_upper = 10 resist_mod = 10 // can't grab a cloud of bats easily attacktext = "bites" + attack_vis_effect = ATTACK_EFFECT_BITE attack_sound = 'sound/weapons/bite.ogg' //Space carp aren't affected by atmos. diff --git a/code/modules/mob/living/simple_animal/hostile/bear.dm b/code/modules/mob/living/simple_animal/hostile/bear.dm index 8747f50abb2..2396d3ce6c8 100644 --- a/code/modules/mob/living/simple_animal/hostile/bear.dm +++ b/code/modules/mob/living/simple_animal/hostile/bear.dm @@ -35,6 +35,7 @@ var/turns_since_hit = 0//If the bear chases someone too long without hitting them, it will try to change to another nearby target instead attacktext = null//This allows custom attacking emotes + attack_vis_effect = ATTACK_EFFECT_CLAW var/quiet_sounds = list('sound/effects/creatures/bear_quiet_1.ogg', 'sound/effects/creatures/bear_quiet_2.ogg', diff --git a/code/modules/mob/living/simple_animal/hostile/cavern_geist.dm b/code/modules/mob/living/simple_animal/hostile/cavern_geist.dm index 89df833f51c..885925b6c2c 100644 --- a/code/modules/mob/living/simple_animal/hostile/cavern_geist.dm +++ b/code/modules/mob/living/simple_animal/hostile/cavern_geist.dm @@ -31,6 +31,7 @@ mob_size = 25 environment_smash = 2 attacktext = "mangles" + attack_vis_effect = ATTACK_EFFECT_SLASH attack_sound = 'sound/weapons/bloodyslice.ogg' lighting_alpha = LIGHTING_PLANE_ALPHA_SOMEWHAT_INVISIBLE diff --git a/code/modules/mob/living/simple_animal/hostile/changeling.dm b/code/modules/mob/living/simple_animal/hostile/changeling.dm index e4df40d8bf1..b67081bd65d 100644 --- a/code/modules/mob/living/simple_animal/hostile/changeling.dm +++ b/code/modules/mob/living/simple_animal/hostile/changeling.dm @@ -34,6 +34,7 @@ mob_size = 25 environment_smash = 2 attacktext = "mangles" + attack_vis_effect = ATTACK_EFFECT_SLASH attack_sound = 'sound/weapons/bloodyslice.ogg' emote_sounds = list('sound/effects/creatures/bear_loud_1.ogg', 'sound/effects/creatures/bear_loud_2.ogg', 'sound/effects/creatures/bear_loud_3.ogg', 'sound/effects/creatures/bear_loud_4.ogg') @@ -165,6 +166,7 @@ mob_size = 15 attacktext = "mangles" attack_sound = 'sound/weapons/bloodyslice.ogg' + attack_vis_effect = ATTACK_EFFECT_SLASH lighting_alpha = LIGHTING_PLANE_ALPHA_SOMEWHAT_INVISIBLE diff --git a/code/modules/mob/living/simple_animal/hostile/commanded/bear_companion.dm b/code/modules/mob/living/simple_animal/hostile/commanded/bear_companion.dm index e282387782f..15e48a034c9 100644 --- a/code/modules/mob/living/simple_animal/hostile/commanded/bear_companion.dm +++ b/code/modules/mob/living/simple_animal/hostile/commanded/bear_companion.dm @@ -39,6 +39,8 @@ butchering_products = list(/obj/item/clothing/head/bearpelt = 1) meat_amount = 5 + attack_vis_effect = ATTACK_EFFECT_CLAW + /mob/living/simple_animal/hostile/commanded/bear/hit_with_weapon(obj/item/O, mob/living/user, var/effective_force, var/hit_zone) . = ..() if(.) diff --git a/code/modules/mob/living/simple_animal/hostile/commanded/guard_dog.dm b/code/modules/mob/living/simple_animal/hostile/commanded/guard_dog.dm index babcdee9adf..25adb384d55 100644 --- a/code/modules/mob/living/simple_animal/hostile/commanded/guard_dog.dm +++ b/code/modules/mob/living/simple_animal/hostile/commanded/guard_dog.dm @@ -45,6 +45,7 @@ destroy_surroundings = FALSE attack_emote = "growls at" + attack_vis_effect = ATTACK_EFFECT_BITE butchering_products = list(/obj/item/stack/material/animalhide = 2) diff --git a/code/modules/mob/living/simple_animal/hostile/creature.dm b/code/modules/mob/living/simple_animal/hostile/creature.dm index 420a9f07bf7..43ef278efdf 100644 --- a/code/modules/mob/living/simple_animal/hostile/creature.dm +++ b/code/modules/mob/living/simple_animal/hostile/creature.dm @@ -11,6 +11,7 @@ melee_damage_upper = 30 organ_names = list("meaty core") attacktext = "chomps" + attack_vis_effect = ATTACK_EFFECT_BITE attack_sound = 'sound/weapons/bite.ogg' faction = "creature" speed = 4 diff --git a/code/modules/mob/living/simple_animal/hostile/faithless.dm b/code/modules/mob/living/simple_animal/hostile/faithless.dm index 6e437761dca..79046d965ee 100644 --- a/code/modules/mob/living/simple_animal/hostile/faithless.dm +++ b/code/modules/mob/living/simple_animal/hostile/faithless.dm @@ -21,6 +21,7 @@ melee_damage_lower = 15 melee_damage_upper = 15 attacktext = "grips" + attack_vis_effect = ATTACK_EFFECT_SLASH attack_sound = 'sound/hallucinations/growl1.ogg' min_oxy = 0 diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index ae18acf0980..31f17feaf23 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -46,6 +46,7 @@ smart_melee = FALSE attacktext = "bites" + attack_vis_effect = ATTACK_EFFECT_BITE attack_emote = "skitters toward" attack_sound = 'sound/weapons/bite.ogg' emote_sounds = list('sound/effects/creatures/spider_critter.ogg') diff --git a/code/modules/mob/living/simple_animal/hostile/hivebots/hivebot.dm b/code/modules/mob/living/simple_animal/hostile/hivebots/hivebot.dm index b6a483b22b8..f106ba7fba5 100644 --- a/code/modules/mob/living/simple_animal/hostile/hivebots/hivebot.dm +++ b/code/modules/mob/living/simple_animal/hostile/hivebots/hivebot.dm @@ -43,6 +43,8 @@ psi_pingable = FALSE sample_data = null + attack_vis_effect = ATTACK_EFFECT_SLASH + /// Weakref to the beacon that potentially spawned us. var/datum/weakref/parent_beacon diff --git a/code/modules/mob/living/simple_animal/hostile/ipc_zombie.dm b/code/modules/mob/living/simple_animal/hostile/ipc_zombie.dm index 0933467441a..c05d3f75802 100644 --- a/code/modules/mob/living/simple_animal/hostile/ipc_zombie.dm +++ b/code/modules/mob/living/simple_animal/hostile/ipc_zombie.dm @@ -12,6 +12,7 @@ armor_penetration = 20 attack_sound = 'sound/weapons/smash.ogg' attacktext = "smashes" + attack_vis_effect = ATTACK_EFFECT_SMASH faction = "hivebot" min_oxy = 0 max_oxy = 0 diff --git a/code/modules/mob/living/simple_animal/hostile/moghes.dm b/code/modules/mob/living/simple_animal/hostile/moghes.dm index 3a372249719..6a38c625698 100644 --- a/code/modules/mob/living/simple_animal/hostile/moghes.dm +++ b/code/modules/mob/living/simple_animal/hostile/moghes.dm @@ -29,6 +29,7 @@ mob_size = 30 environment_smash = 2 attacktext = "chomps" + attack_vis_effect = ATTACK_EFFECT_BITE attack_sound = 'sound/weapons/bloodyslice.ogg' lighting_alpha = LIGHTING_PLANE_ALPHA_SOMEWHAT_INVISIBLE @@ -159,6 +160,7 @@ melee_damage_lower = 5 melee_damage_upper = 8 attacktext = "rams" + attack_vis_effect = ATTACK_EFFECT_SLASH attack_sound = 'sound/weapons/punch4_bass.ogg' environment_smash = 1 diff --git a/code/modules/mob/living/simple_animal/hostile/phoron_worm.dm b/code/modules/mob/living/simple_animal/hostile/phoron_worm.dm index b6c41c4fb09..8820fe979ae 100644 --- a/code/modules/mob/living/simple_animal/hostile/phoron_worm.dm +++ b/code/modules/mob/living/simple_animal/hostile/phoron_worm.dm @@ -24,6 +24,7 @@ mob_size = 30 environment_smash = 2 attacktext = "chomps" + attack_vis_effect = ATTACK_EFFECT_BITE attack_sound = 'sound/weapons/bite.ogg' faction = "worm" diff --git a/code/modules/mob/living/simple_animal/hostile/pirate.dm b/code/modules/mob/living/simple_animal/hostile/pirate.dm index fffc98ea875..49bc034362d 100644 --- a/code/modules/mob/living/simple_animal/hostile/pirate.dm +++ b/code/modules/mob/living/simple_animal/hostile/pirate.dm @@ -20,6 +20,7 @@ melee_damage_lower = 30 melee_damage_upper = 30 attacktext = "slashes" + attack_vis_effect = ATTACK_EFFECT_SLASH attack_sound = 'sound/weapons/bladeslice.ogg' min_oxy = 5 diff --git a/code/modules/mob/living/simple_animal/hostile/pra.dm b/code/modules/mob/living/simple_animal/hostile/pra.dm index 22e30716ab8..0a98e152bf4 100644 --- a/code/modules/mob/living/simple_animal/hostile/pra.dm +++ b/code/modules/mob/living/simple_animal/hostile/pra.dm @@ -36,6 +36,7 @@ mob_size = 5 attacktext = "slashes" + attack_vis_effect = ATTACK_EFFECT_SLASH attack_sound = 'sound/weapons/bladeslice.ogg' speed = 2 @@ -174,6 +175,7 @@ melee_damage_upper = 5 attacktext = "smashed" attack_sound = 'sound/weapons/genhit1.ogg' + attack_vis_effect = ATTACK_EFFECT_SMASH speed = 1 ranged = TRUE diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/aquatic.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/aquatic.dm index 4d7c3df37a1..0b4b851cdf8 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/aquatic.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/aquatic.dm @@ -47,6 +47,7 @@ ABSTRACT_TYPE(/mob/living/simple_animal/hostile/retaliate/aquatic) melee_damage_lower = 40 melee_damage_upper = 70 armor_penetration = 80 + attack_vis_effect = ATTACK_EFFECT_BITE //Admin shark for admin fun because why not, not meant for normal gameplay /mob/living/simple_animal/hostile/retaliate/aquatic/thresher/deep_water diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/cavern.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/cavern.dm index ca019a5cea9..162e1d5e6b0 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/cavern.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/cavern.dm @@ -24,6 +24,7 @@ melee_damage_lower = 10 melee_damage_upper = 10 attacktext = "chomps" + attack_vis_effect = ATTACK_EFFECT_BITE attack_sound = 'sound/weapons/bite.ogg' speed = 4 projectiletype = /obj/projectile/beam/cavern diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/exoplanet.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/exoplanet.dm index bb43982057b..5a85f93d886 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/exoplanet.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/exoplanet.dm @@ -27,6 +27,7 @@ ) emote_see = list("skitters","oozes liquid from its mouth", "scratches at the ground", "clicks its claws") + attack_vis_effect = ATTACK_EFFECT_CLAW /mob/living/simple_animal/hostile/retaliate/beast/charbaby name = "charbaby" @@ -66,5 +67,6 @@ icon_state = "lavadog" icon_living = "lavadog" icon_dead = "lavadog_dead" + attack_vis_effect = ATTACK_EFFECT_BITE speak = list("Karuph!", "Karump!") diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/konyang.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/konyang.dm index 3e0e1da202f..01f49ea1f7a 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/konyang.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/konyang.dm @@ -21,6 +21,7 @@ melee_damage_upper = 30 armor_penetration = 20 attacktext = "claws" + attack_vis_effect = ATTACK_EFFECT_CLAW attack_sound = 'sound/weapons/slice.ogg' meat_amount = 8 diff --git a/code/modules/mob/living/simple_animal/hostile/rogue_maint_drone.dm b/code/modules/mob/living/simple_animal/hostile/rogue_maint_drone.dm index 7713e2f0bcc..984a48196b6 100644 --- a/code/modules/mob/living/simple_animal/hostile/rogue_maint_drone.dm +++ b/code/modules/mob/living/simple_animal/hostile/rogue_maint_drone.dm @@ -15,6 +15,7 @@ melee_damage_upper = 8 armor_penetration = 5 attacktext = "slices" + attack_vis_effect = ATTACK_EFFECT_SLASH faction = "silicon" min_oxy = 0 minbodytemp = 0 diff --git a/code/modules/mob/living/simple_animal/hostile/space_fauna.dm b/code/modules/mob/living/simple_animal/hostile/space_fauna.dm index 079214b7a7a..a20d846f789 100644 --- a/code/modules/mob/living/simple_animal/hostile/space_fauna.dm +++ b/code/modules/mob/living/simple_animal/hostile/space_fauna.dm @@ -34,6 +34,7 @@ armor_penetration = 5 attack_flags = DAMAGE_FLAG_EDGE attacktext = "bites" + attack_vis_effect = ATTACK_EFFECT_BITE attack_sound = 'sound/weapons/bite.ogg' //Space carp aren't affected by atmos. @@ -299,6 +300,7 @@ melee_damage_lower = 5 melee_damage_upper = 5 attacktext = "bites" + attack_vis_effect = ATTACK_EFFECT_BITE attack_sound = 'sound/weapons/bite.ogg' min_oxy = 0 diff --git a/code/modules/mob/living/simple_animal/hostile/spider_queen.dm b/code/modules/mob/living/simple_animal/hostile/spider_queen.dm index a1f945e356e..ffc05470e29 100644 --- a/code/modules/mob/living/simple_animal/hostile/spider_queen.dm +++ b/code/modules/mob/living/simple_animal/hostile/spider_queen.dm @@ -38,6 +38,7 @@ mob_push_flags = ALLMOBS attacktext = "bites" + attack_vis_effect = ATTACK_EFFECT_BITE attack_sound = 'sound/weapons/bite.ogg' pass_flags = PASSTABLE|PASSRAILING diff --git a/code/modules/mob/living/simple_animal/hostile/tree.dm b/code/modules/mob/living/simple_animal/hostile/tree.dm index 7e8a0173bf5..8d280d8a78f 100644 --- a/code/modules/mob/living/simple_animal/hostile/tree.dm +++ b/code/modules/mob/living/simple_animal/hostile/tree.dm @@ -24,6 +24,7 @@ melee_damage_lower = 8 melee_damage_upper = 12 attacktext = "bites" + attack_vis_effect = ATTACK_EFFECT_BITE //what how attack_sound = 'sound/weapons/bite.ogg' //Space carp aren't affected by atmos. diff --git a/code/modules/mob/living/simple_animal/hostile/vannatusk.dm b/code/modules/mob/living/simple_animal/hostile/vannatusk.dm index 466ec6629c2..7c1987a4ca5 100644 --- a/code/modules/mob/living/simple_animal/hostile/vannatusk.dm +++ b/code/modules/mob/living/simple_animal/hostile/vannatusk.dm @@ -25,6 +25,7 @@ mob_size = 15 environment_smash = 2 attacktext = "mangles" + attack_vis_effect = ATTACK_EFFECT_CLAW attack_emote = "charges toward" attack_sound = 'sound/effects/creatures/vannatusk_attack.ogg' emote_sounds = list('sound/effects/creatures/vannatusk_sound.ogg', 'sound/effects/creatures/vannatusk_sound_2.ogg') diff --git a/code/modules/mob/living/simple_animal/hostile/viscerator.dm b/code/modules/mob/living/simple_animal/hostile/viscerator.dm index 66adfb761cf..af617c7ee7c 100644 --- a/code/modules/mob/living/simple_animal/hostile/viscerator.dm +++ b/code/modules/mob/living/simple_animal/hostile/viscerator.dm @@ -12,6 +12,7 @@ armor_penetration = 20 density = 0 attacktext = "cuts" + attack_vis_effect = ATTACK_EFFECT_SLASH attack_sound = 'sound/weapons/bladeslice.ogg' blood_overlay_icon = null faction = "syndicate" diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 8c63785dac7..b1f58f52965 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -620,14 +620,14 @@ if(!actual_damage) actual_damage = harm_intent_damage ? rand(1, harm_intent_damage) : 0 apply_damage(actual_damage, attack.damage_type) - user.do_attack_animation(src, FIST_ATTACK_ANIMATION) + user.do_attack_animation(src) return simple_harm_attack(user) /mob/living/simple_animal/proc/simple_harm_attack(var/mob/living/user) apply_damage(harm_intent_damage, damage_type, used_weapon = "Attack by [user.name]") user.visible_message(SPAN_WARNING("\The [user] [response_harm] \the [src]!"), SPAN_WARNING("You [response_harm] \the [src]!")) - user.do_attack_animation(src, FIST_ATTACK_ANIMATION) + user.do_attack_animation(src) poke(TRUE) /mob/living/simple_animal/attackby(obj/item/attacking_item, mob/user) @@ -1142,6 +1142,16 @@ return TRUE return FALSE +/mob/living/simple_animal/do_attack_animation(atom/attacked_atom, visual_effect_icon, used_item, no_effect) + if(!no_effect && !visual_effect_icon && melee_damage_upper) + if(attack_vis_effect && !iswall(attacked_atom)) // override the standard visual effect. + visual_effect_icon = attack_vis_effect + else if(melee_damage_upper < 10) + visual_effect_icon = ATTACK_EFFECT_PUNCH + else + visual_effect_icon = ATTACK_EFFECT_SMASH + ..() + #undef BLOOD_NONE #undef BLOOD_LIGHT #undef BLOOD_MEDIUM diff --git a/code/modules/shieldgen/emergency_shield.dm b/code/modules/shieldgen/emergency_shield.dm index 87a611f4c68..356d264fefa 100644 --- a/code/modules/shieldgen/emergency_shield.dm +++ b/code/modules/shieldgen/emergency_shield.dm @@ -334,7 +334,7 @@ /obj/structure/machinery/shield/attackby(obj/item/attacking_item, mob/user) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) - user.do_attack_animation(src, attacking_item) + user.do_attack_animation(src, used_item = attacking_item) //Calculate damage var/aforce = attacking_item.force if(attacking_item.damtype == DAMAGE_BRUTE || attacking_item.damtype == DAMAGE_BURN) diff --git a/code/modules/shieldgen/energy_field.dm b/code/modules/shieldgen/energy_field.dm index 574e13da3b8..d13f073587c 100644 --- a/code/modules/shieldgen/energy_field.dm +++ b/code/modules/shieldgen/energy_field.dm @@ -43,8 +43,8 @@ energy_field.remove_individual_field(src) /obj/effect/energy_field/attackby(obj/item/attacking_item, mob/user) + user.do_attack_animation(src, used_item = attacking_item) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) - user.do_attack_animation(src, attacking_item) if(attacking_item.force < 10) user.visible_message(SPAN_WARNING("[user] harmlessly attacks \the [src] with \the [attacking_item]."), SPAN_WARNING("You attack \the [src] with \the [attacking_item], but it bounces off without doing any damage.")) @@ -57,7 +57,7 @@ if(istype(H)) if(H.species.can_shred(H)) H.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) - H.do_attack_animation(src, FIST_ATTACK_ANIMATION) + H.do_attack_animation(src) H.visible_message(SPAN_WARNING("[H] shreds \the [src]!"), SPAN_WARNING("You shred \the [src]!")) damage_field(1) return diff --git a/html/changelogs/mattatlas-tgattackanims.yml b/html/changelogs/mattatlas-tgattackanims.yml new file mode 100644 index 00000000000..663bb08a194 --- /dev/null +++ b/html/changelogs/mattatlas-tgattackanims.yml @@ -0,0 +1,58 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: MattAtlas (Porting), /tg/station (Original Code) + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Ported attack animations from /tg/station for attacking with items, unarmed attacks, and for simple mobs." diff --git a/icons/effects/effects.dmi b/icons/effects/effects.dmi index 1f224ccd19d..b9791113537 100644 Binary files a/icons/effects/effects.dmi and b/icons/effects/effects.dmi differ