From bc5754b37869d461ed584a5f33dbfead01783952 Mon Sep 17 00:00:00 2001 From: phil235 Date: Fri, 7 Nov 2014 15:42:07 +0100 Subject: [PATCH] adding diagonal attack animation. --- code/_onclick/item_attack.dm | 4 +-- code/game/gamemodes/blob/theblob.dm | 4 +-- code/game/machinery/Sleeper.dm | 2 +- code/game/machinery/bots/bots.dm | 4 +-- code/game/machinery/camera/camera.dm | 2 +- code/game/machinery/computer/computer.dm | 4 +-- code/game/machinery/doors/windowdoor.dm | 8 ++--- code/game/machinery/newscaster.dm | 2 +- code/game/machinery/turrets.dm | 6 ++-- code/game/mecha/mecha.dm | 8 ++--- code/game/objects/effects/aliens.dm | 4 +-- code/game/objects/effects/effect_system.dm | 2 +- .../structures/crates_lockers/closets.dm | 2 +- .../crates_lockers/closets/fireaxe.dm | 2 +- code/game/objects/structures/grille.dm | 10 +++---- code/game/objects/structures/mirror.dm | 8 ++--- code/game/objects/structures/tables_racks.dm | 16 +++++----- code/game/objects/structures/window.dm | 6 ++-- code/game/turfs/simulated/walls.dm | 4 +-- code/modules/events/ninja.dm | 2 +- code/modules/events/spacevine.dm | 2 +- .../living/carbon/alien/humanoid/humanoid.dm | 12 ++++---- .../mob/living/carbon/alien/larva/larva.dm | 10 +++---- code/modules/mob/living/carbon/human/human.dm | 6 ++-- .../living/carbon/human/human_attackalien.dm | 4 +-- .../living/carbon/human/human_attackpaw.dm | 2 +- .../mob/living/carbon/human/human_defense.dm | 2 +- .../mob/living/carbon/human/species.dm | 6 ++-- .../mob/living/carbon/monkey/monkey.dm | 16 +++++----- code/modules/mob/living/carbon/slime/slime.dm | 14 ++++----- code/modules/mob/living/living.dm | 29 +++++++++++++++---- code/modules/mob/living/silicon/ai/ai.dm | 4 +-- .../modules/mob/living/silicon/robot/robot.dm | 8 ++--- .../mob/living/simple_animal/constructs.dm | 2 +- .../mob/living/simple_animal/simple_animal.dm | 14 ++++----- code/modules/power/apc.dm | 4 +-- code/modules/power/lighting.dm | 6 ++-- code/modules/recycling/disposal.dm | 2 +- 38 files changed, 130 insertions(+), 113 deletions(-) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index fea1a2dcd77..0ba92809470 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -7,7 +7,7 @@ /atom/proc/attackby(obj/item/W, mob/user) return /atom/movable/attackby(obj/item/W, mob/living/user) - user.do_attack_animation() + user.do_attack_animation(src) if(W && !(W.flags&NOBLUDGEON)) visible_message("[src] has been hit by [user] with [W].") @@ -26,7 +26,7 @@ var/showname = "." if(user) showname = " by [user]!" - user.do_attack_animation() + user.do_attack_animation(src) if(!(user in viewers(src, null))) showname = "." if(I.attack_verb && I.attack_verb.len) diff --git a/code/game/gamemodes/blob/theblob.dm b/code/game/gamemodes/blob/theblob.dm index 980d5dcd7bf..bd474f1ca4e 100644 --- a/code/game/gamemodes/blob/theblob.dm +++ b/code/game/gamemodes/blob/theblob.dm @@ -151,7 +151,7 @@ /obj/effect/blob/attackby(var/obj/item/weapon/W, var/mob/living/user) user.changeNext_move(CLICK_CD_MELEE) - user.do_attack_animation() + user.do_attack_animation(src) playsound(src.loc, 'sound/effects/attackblob.ogg', 50, 1) src.visible_message("The [src.name] has been attacked with \the [W][(user ? " by [user]" : "")]!") var/damage = 0 @@ -169,7 +169,7 @@ /obj/effect/blob/attack_animal(mob/living/simple_animal/M as mob) M.changeNext_move(CLICK_CD_MELEE) - M.do_attack_animation() + M.do_attack_animation(src) playsound(src.loc, 'sound/effects/attackblob.ogg', 50, 1) src.visible_message("The [src.name] has been attacked by \the [M]!") var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index f046c5a538f..9e4ab4ad61f 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -66,7 +66,7 @@ /obj/machinery/sleeper/attack_animal(var/mob/living/simple_animal/M)//Stop putting hostile mobs in things guise if(M.environment_smash) - M.do_attack_animation() + M.do_attack_animation(src) visible_message("[M.name] smashes [src] apart!") qdel(src) return diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm index 693363a8577..f3267d39398 100644 --- a/code/game/machinery/bots/bots.dm +++ b/code/game/machinery/bots/bots.dm @@ -144,7 +144,7 @@ /obj/machinery/bot/attack_alien(var/mob/living/carbon/alien/user as mob) user.changeNext_move(CLICK_CD_MELEE) - user.do_attack_animation() + user.do_attack_animation(src) health -= rand(15,30)*brute_dam_coeff visible_message("[user] has slashed [src]!") playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1) @@ -154,7 +154,7 @@ /obj/machinery/bot/attack_animal(var/mob/living/simple_animal/M as mob) - M.do_attack_animation() + M.do_attack_animation(src) if(M.melee_damage_upper == 0) return M.changeNext_move(CLICK_CD_MELEE) diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 19be4d7d273..04113b154b5 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -116,7 +116,7 @@ /obj/machinery/camera/attack_paw(mob/living/carbon/alien/humanoid/user as mob) if(!istype(user)) return - user.do_attack_animation() + user.do_attack_animation(src) status = 0 visible_message("\The [user] slashes at [src]!") playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1) diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index 6f3737e1848..b4ec5461cb0 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -111,7 +111,7 @@ return /obj/machinery/computer/attack_paw(mob/living/user) - user.do_attack_animation() + user.do_attack_animation(src) if(circuit) if(prob(10)) user.visible_message("[user.name] smashes the [src.name] with its paws.",\ @@ -124,7 +124,7 @@ "You hear a clicking sound.") /obj/machinery/computer/attack_alien(mob/living/user) - user.do_attack_animation() + user.do_attack_animation(src) if(circuit) if(prob(80)) user.visible_message("[user.name] smashes the [src.name] with its claws.",\ diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index cbc1c2a64cb..94355ea157b 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -200,7 +200,7 @@ take_damage(damage) /obj/machinery/door/window/attack_alien(mob/living/user as mob) - user.do_attack_animation() + user.do_attack_animation(src) if(islarva(user)) return attack_generic(user, 25) @@ -209,14 +209,14 @@ if(!isanimal(user)) return var/mob/living/simple_animal/M = user - M.do_attack_animation() + M.do_attack_animation(src) if(M.melee_damage_upper <= 0) return attack_generic(M, M.melee_damage_upper) /obj/machinery/door/window/attack_slime(mob/living/carbon/slime/user as mob) - user.do_attack_animation() + user.do_attack_animation(src) if(!user.is_adult) return attack_generic(user, 25) @@ -326,7 +326,7 @@ //If it's a weapon, smash windoor. Unless it's an id card, agent card, ect.. then ignore it (Cards really shouldnt damage a door anyway) if(src.density && istype(I, /obj/item/weapon) && !istype(I, /obj/item/weapon/card) ) user.changeNext_move(CLICK_CD_MELEE) - user.do_attack_animation() + user.do_attack_animation(src) if( (I.flags&NOBLUDGEON) || !I.force ) return var/aforce = I.force diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 0f77735ac02..7eeee8b5f39 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -815,7 +815,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co O.show_message("[user.name] further abuses the shattered [src.name].") else if(istype(I, /obj/item/weapon) ) - user.do_attack_animation() + user.do_attack_animation(src) var/obj/item/weapon/W = I if(W.force <15) for (var/mob/O in hearers(5, src.loc)) diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm index 7d5cfbf2887..b3a5f52f442 100644 --- a/code/game/machinery/turrets.dm +++ b/code/game/machinery/turrets.dm @@ -311,7 +311,7 @@ /obj/machinery/turret/attack_animal(mob/living/simple_animal/M as mob) M.changeNext_move(CLICK_CD_MELEE) - M.do_attack_animation() + M.do_attack_animation(src) if(M.melee_damage_upper == 0) return if(!(stat & BROKEN)) visible_message("[M] [M.attacktext] [src]!") @@ -329,7 +329,7 @@ /obj/machinery/turret/attack_alien(mob/living/carbon/alien/humanoid/M as mob) M.changeNext_move(CLICK_CD_MELEE) - M.do_attack_animation() + M.do_attack_animation(src) if(!(stat & BROKEN)) playsound(src.loc, 'sound/weapons/slash.ogg', 25, 1, -1) visible_message("[M] has slashed at [src]!") @@ -415,7 +415,7 @@ /obj/machinery/gun_turret/attack_alien(mob/living/user as mob) user.changeNext_move(CLICK_CD_MELEE) - user.do_attack_animation() + user.do_attack_animation(src) user.visible_message("[user] slashes at [src]", "You slash at [src]") take_damage(15) return diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index c9edcc339b0..c8eca38b475 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -457,7 +457,7 @@ obj/mecha/proc/can_use(mob/user) /obj/mecha/attack_hand(mob/living/user as mob) user.changeNext_move(CLICK_CD_MELEE) // Ugh. Ideally we shouldn't be setting cooldowns outside of click code. - user.do_attack_animation() + user.do_attack_animation(src) src.log_message("Attack by hand/paw. Attacker - [user].",1) if ((HULK in user.mutations) && !prob(src.deflect_chance)) @@ -477,7 +477,7 @@ obj/mecha/proc/can_use(mob/user) /obj/mecha/attack_alien(mob/living/user as mob) src.log_message("Attack by alien. Attacker - [user].",1) user.changeNext_move(CLICK_CD_MELEE) //Now stompy alien killer mechs are actually scary to aliens! - user.do_attack_animation() + user.do_attack_animation(src) if(!prob(src.deflect_chance)) src.take_damage(15) src.check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST)) @@ -499,7 +499,7 @@ obj/mecha/proc/can_use(mob/user) if(user.melee_damage_upper == 0) user.emote("[user.friendly] [src]") else - user.do_attack_animation() + user.do_attack_animation(src) if(!prob(src.deflect_chance)) var/damage = rand(user.melee_damage_lower, user.melee_damage_upper) src.take_damage(damage) @@ -636,7 +636,7 @@ obj/mecha/proc/can_use(mob/user) /obj/mecha/proc/dynattackby(obj/item/weapon/W as obj, mob/living/user as mob) user.changeNext_move(CLICK_CD_MELEE) // Ugh. Ideally we shouldn't be setting cooldowns outside of click code. - user.do_attack_animation() + user.do_attack_animation(src) src.log_message("Attacked by [W]. Attacker - [user]") if(prob(src.deflect_chance)) user << "The [W] bounces off [src.name] armor." diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm index bf5cd4b83ff..cad7d8fb053 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/effects/aliens.dm @@ -111,7 +111,7 @@ /obj/structure/alien/resin/attack_hand(mob/living/user) if(HULK in user.mutations) - user.do_attack_animation() + user.do_attack_animation(src) user.visible_message("[user] destroys [src]!") health = 0 healthcheck() @@ -123,7 +123,7 @@ /obj/structure/alien/resin/attack_alien(mob/living/user) user.changeNext_move(CLICK_CD_MELEE) - user.do_attack_animation() + user.do_attack_animation(src) if(islarva(user)) return user.visible_message("[user] claws at the resin!") diff --git a/code/game/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm index 8e7689c2c51..e4e84b36b7e 100644 --- a/code/game/objects/effects/effect_system.dm +++ b/code/game/objects/effects/effect_system.dm @@ -957,7 +957,7 @@ steam.start() -- spawns the effect /obj/structure/foamedmetal/attack_animal(var/mob/living/simple_animal/M) if(M.environment_smash >= 1) - M.do_attack_animation() + M.do_attack_animation(src) M << "You smash apart the foam wall." qdel(src) return diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 6b65f8637b5..c9fc9dc3c91 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -159,7 +159,7 @@ /obj/structure/closet/attack_animal(mob/living/simple_animal/user as mob) if(user.environment_smash) - user.do_attack_animation() + user.do_attack_animation(src) visible_message("[user] destroys the [src].") for(var/atom/movable/A as mob|obj in src) A.loc = src.loc diff --git a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm index fec26505e11..137ebfbc8fb 100644 --- a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm +++ b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm @@ -40,7 +40,7 @@ spawn(10) update_icon() return else - user.do_attack_animation() + user.do_attack_animation(src) playsound(user, 'sound/effects/Glasshit.ogg', 100, 1) //We don't want this playing every time if(W.force < 15) user << " The cabinet's protective glass glances off the hit." diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 984780b298c..3240e7b2712 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -27,7 +27,7 @@ /obj/structure/grille/attack_hand(mob/living/user as mob) user.changeNext_move(CLICK_CD_MELEE) - user.do_attack_animation() + user.do_attack_animation(src) playsound(loc, 'sound/effects/grillehit.ogg', 80, 1) user.visible_message("[user] hits [src].", \ "You hit [src].", \ @@ -42,7 +42,7 @@ healthcheck() /obj/structure/grille/attack_alien(mob/living/user as mob) - user.do_attack_animation() + user.do_attack_animation(src) if(istype(user, /mob/living/carbon/alien/larva)) return user.changeNext_move(CLICK_CD_MELEE) playsound(loc, 'sound/effects/grillehit.ogg', 80, 1) @@ -57,7 +57,7 @@ /obj/structure/grille/attack_slime(mob/living/carbon/slime/user as mob) user.changeNext_move(CLICK_CD_MELEE) - user.do_attack_animation() + user.do_attack_animation(src) if(!user.is_adult) return playsound(loc, 'sound/effects/grillehit.ogg', 80, 1) @@ -72,7 +72,7 @@ /obj/structure/grille/attack_animal(var/mob/living/simple_animal/M as mob) M.changeNext_move(CLICK_CD_MELEE) if(M.melee_damage_upper == 0) return - M.do_attack_animation() + M.do_attack_animation(src) playsound(loc, 'sound/effects/grillehit.ogg', 80, 1) M.visible_message("[M] smashes against [src].", \ "You smash against [src].", \ @@ -242,4 +242,4 @@ tforce = I.throwforce - 5 playsound(loc, 'sound/effects/grillehit.ogg', 80, 1) health = max(0, health - tforce) - healthcheck() + healthcheck() diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index de262179005..2b0a63b8499 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -57,7 +57,7 @@ /obj/structure/mirror/attackby(obj/item/I as obj, mob/living/user as mob) - user.do_attack_animation() + user.do_attack_animation(src) if(shattered) playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1) return @@ -71,7 +71,7 @@ /obj/structure/mirror/attack_alien(mob/living/user as mob) - user.do_attack_animation() + user.do_attack_animation(src) if(islarva(user)) return if(shattered) playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1) @@ -84,7 +84,7 @@ if(!isanimal(user)) return var/mob/living/simple_animal/M = user if(M.melee_damage_upper <= 0) return - M.do_attack_animation() + M.do_attack_animation(src) if(shattered) playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1) return @@ -93,7 +93,7 @@ /obj/structure/mirror/attack_slime(mob/living/user as mob) - user.do_attack_animation() + user.do_attack_animation(src) if(shattered) playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1) return diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 30d82ea025e..627c0abb09a 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -205,7 +205,7 @@ /obj/structure/table/attack_paw(mob/living/user) if(HULK in user.mutations) - user.do_attack_animation() + user.do_attack_animation(src) user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" )) visible_message("[user] smashes the table apart!") if(istype(src, /obj/structure/table/reinforced)) @@ -219,7 +219,7 @@ /obj/structure/table/attack_alien(mob/living/user) - user.do_attack_animation() + user.do_attack_animation(src) visible_message("[user] slices [src] apart!") if(istype(src, /obj/structure/table/reinforced)) new /obj/item/weapon/table_parts/reinforced(loc) @@ -233,7 +233,7 @@ /obj/structure/table/attack_animal(mob/living/simple_animal/user) if(user.environment_smash) - user.do_attack_animation() + user.do_attack_animation(src) visible_message("[user] smashes [src] apart!") if(istype(src, /obj/structure/table/reinforced)) new /obj/item/weapon/table_parts/reinforced(loc) @@ -249,7 +249,7 @@ /obj/structure/table/attack_hand(mob/living/user) if(HULK in user.mutations) - user.do_attack_animation() + user.do_attack_animation(src) visible_message("[user] smashes [src] apart!") user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" )) if(istype(src, /obj/structure/table/reinforced)) @@ -511,7 +511,7 @@ Destroy type values: /obj/structure/rack/attack_hand(mob/living/user) if(HULK in user.mutations) - user.do_attack_animation() + user.do_attack_animation(src) visible_message("[user] smashes [src] apart!") user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" )) new /obj/item/weapon/rack_parts(loc) @@ -521,7 +521,7 @@ Destroy type values: /obj/structure/rack/attack_paw(mob/living/user) if(HULK in user.mutations) - user.do_attack_animation() + user.do_attack_animation(src) user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" )) visible_message("[user] smashes [src] apart!") new /obj/item/weapon/rack_parts(loc) @@ -530,7 +530,7 @@ Destroy type values: /obj/structure/rack/attack_alien(mob/living/user) - user.do_attack_animation() + user.do_attack_animation(src) visible_message("[user] slices [src] apart!") new /obj/item/weapon/rack_parts(loc) density = 0 @@ -539,7 +539,7 @@ Destroy type values: /obj/structure/rack/attack_animal(mob/living/simple_animal/user) if(user.environment_smash) - user.do_attack_animation() + user.do_attack_animation(src) visible_message("[user] smashes [src] apart!") new /obj/item/weapon/rack_parts(loc) density = 0 diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index d0e7195490a..c31423e2d85 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -126,20 +126,20 @@ /obj/structure/window/attack_alien(mob/living/user as mob) - user.do_attack_animation() + user.do_attack_animation(src) if(islarva(user)) return attack_generic(user, 15) /obj/structure/window/attack_animal(mob/living/user as mob) if(!isanimal(user)) return var/mob/living/simple_animal/M = user - M.do_attack_animation() + M.do_attack_animation(src) if(M.melee_damage_upper <= 0) return attack_generic(M, M.melee_damage_upper) /obj/structure/window/attack_slime(mob/living/carbon/slime/user as mob) - user.do_attack_animation() + user.do_attack_animation(src) if(!user.is_adult) return attack_generic(user, rand(10, 15)) diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index ee1bd6c9e68..010d45fbaa2 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -95,7 +95,7 @@ /turf/simulated/wall/attack_paw(mob/living/user as mob) user.changeNext_move(CLICK_CD_MELEE) if ((HULK in user.mutations)) - user.do_attack_animation() + user.do_attack_animation(src) if (prob(hardness)) playsound(src, 'sound/effects/meteorimpact.ogg', 100, 1) usr << text("You smash through the wall.") @@ -111,7 +111,7 @@ /turf/simulated/wall/attack_animal(var/mob/living/simple_animal/M) M.changeNext_move(CLICK_CD_MELEE) - M.do_attack_animation() + M.do_attack_animation(src) if(M.environment_smash >= 2) if(istype(src, /turf/simulated/wall/r_wall)) if(M.environment_smash == 3) diff --git a/code/modules/events/ninja.dm b/code/modules/events/ninja.dm index d16688cea88..aa423a69b0c 100644 --- a/code/modules/events/ninja.dm +++ b/code/modules/events/ninja.dm @@ -2722,7 +2722,7 @@ It is possible to destroy the net by the occupant or someone else. return attack_hand() /obj/effect/energy_net/attack_alien(mob/living/user as mob) - user.do_attack_animation() + user.do_attack_animation(src) if (islarva(user)) return playsound(src.loc, 'sound/weapons/slash.ogg', 80, 1) diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm index 9c049f846dc..e9ce64822c5 100644 --- a/code/modules/events/spacevine.dm +++ b/code/modules/events/spacevine.dm @@ -302,7 +302,7 @@ /obj/effect/spacevine/attack_paw(mob/living/user as mob) - user.do_attack_animation() + user.do_attack_animation(src) for(var/datum/spacevine_mutation/SM in mutations) SM.on_hit(src, user) manual_unbuckle(user) diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index 9789f5bca69..a9957e0d397 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -117,7 +117,7 @@ if ("help") help_shake_act(M) else - M.do_attack_animation() + M.do_attack_animation(src) if (M.is_muzzled()) return playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) @@ -138,7 +138,7 @@ if (stat > -100) - M.do_attack_animation() + M.do_attack_animation(src) visible_message("The [M.name] glomps [src]!", \ "The [M.name] glomps [src]!") var/damage = rand(1, 3) @@ -191,7 +191,7 @@ if(M.melee_damage_upper == 0) M.emote("[M.friendly] [src]") else - M.do_attack_animation() + M.do_attack_animation(src) if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) visible_message("[M] [M.attacktext] [src]!", \ @@ -232,7 +232,7 @@ visible_message("[M] has grabbed [src] passively!") if ("harm") - M.do_attack_animation() + M.do_attack_animation(src) var/damage = rand(1, 9) if (prob(90)) if (HULK in M.mutations)//HULK SMASH @@ -302,7 +302,7 @@ In all, this is a lot like the monkey code. /N else if (health > 0) - M.do_attack_animation() + M.do_attack_animation(src) playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) var/damage = rand(1, 3) visible_message("[M.name] bites [src]!!", \ @@ -324,7 +324,7 @@ In all, this is a lot like the monkey code. /N else if (health > 0) - L.do_attack_animation() + L.do_attack_animation(src) playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) var/damage = rand(1, 3) visible_message("[L.name] bites [src]!!", \ diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm index 1d7ae4ebeda..f43eb37296b 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva.dm @@ -118,7 +118,7 @@ if(M.melee_damage_upper == 0) M.emote("[M.friendly] [src]") else - M.do_attack_animation() + M.do_attack_animation(src) if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) visible_message("[M] [M.attacktext] [src]!", \ @@ -146,7 +146,7 @@ if ("help") help_shake_act(M) else - M.do_attack_animation() + M.do_attack_animation(src) if (M.is_muzzled()) return playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) @@ -167,7 +167,7 @@ return // can't attack while eating! if (stat != DEAD) - M.do_attack_animation() + M.do_attack_animation(src) visible_message("The [M.name] glomps [src]!", \ "The [M.name] glomps [src]!") var/damage = rand(1, 3) @@ -214,7 +214,7 @@ visible_message("[M] has grabbed [src] passively!") else - M.do_attack_animation() + M.do_attack_animation(src) var/damage = rand(1, 9) if (prob(90)) if (HULK in M.mutations) @@ -263,7 +263,7 @@ else if (health > 0) - M.do_attack_animation() + M.do_attack_animation(src) playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) var/damage = 1 visible_message("[M.name] bites [src]!", \ diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index b98ad128879..182e0338778 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -222,7 +222,7 @@ if(M.melee_damage_upper == 0) M.emote("[M.friendly] [src]") else - M.do_attack_animation() + M.do_attack_animation(src) if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) visible_message("[M] [M.attacktext] [src]!", \ @@ -244,7 +244,7 @@ else - L.do_attack_animation() + L.do_attack_animation(src) var/damage = rand(1, 3) visible_message("[L] bites [src]!", \ "[L] bites [src]!") @@ -262,7 +262,7 @@ if (health > -100) - M.do_attack_animation() + M.do_attack_animation(src) visible_message("The [M.name] glomps [src]!", \ "The [M.name] glomps [src]!") diff --git a/code/modules/mob/living/carbon/human/human_attackalien.dm b/code/modules/mob/living/carbon/human/human_attackalien.dm index 7d17736deb9..3462d112b88 100644 --- a/code/modules/mob/living/carbon/human/human_attackalien.dm +++ b/code/modules/mob/living/carbon/human/human_attackalien.dm @@ -22,7 +22,7 @@ visible_message("[M] has grabbed [src] passively!") if("harm") - M.do_attack_animation() + M.do_attack_animation(src) if (w_uniform) w_uniform.add_fingerprint(M) var/damage = rand(15, 30) @@ -46,7 +46,7 @@ updatehealth() if("disarm") - M.do_attack_animation() + M.do_attack_animation(src) var/randn = rand(1, 100) if (randn <= 80) playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1) diff --git a/code/modules/mob/living/carbon/human/human_attackpaw.dm b/code/modules/mob/living/carbon/human/human_attackpaw.dm index fd42c47cd5f..531ba5b0ad6 100644 --- a/code/modules/mob/living/carbon/human/human_attackpaw.dm +++ b/code/modules/mob/living/carbon/human/human_attackpaw.dm @@ -3,7 +3,7 @@ if (M.a_intent == "help") help_shake_act(M) else - M.do_attack_animation() + M.do_attack_animation(src) if (M.is_muzzled()) return diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index a54e388c7f6..399b3cbf39b 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -133,7 +133,7 @@ emp_act else if(user != src) - user.do_attack_animation() + user.do_attack_animation(src) if(check_shields(I.force, "the [I.name]")) return 0 diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index e0b7bda8141..451d3888b28 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -722,7 +722,7 @@ if("harm") add_logs(M, H, "punched") - M.do_attack_animation() + M.do_attack_animation(H) var/atk_verb = "punch" if(H.lying) @@ -824,7 +824,7 @@ /datum/species/proc/spec_attacked_by(var/obj/item/I, var/mob/living/user, var/def_zone, var/obj/item/organ/limb/affecting, var/hit_area, var/intent, var/obj/item/organ/limb/target_limb, target_area, var/mob/living/carbon/human/H) // Allows you to put in item-specific reactions based on species if(user != src) - user.do_attack_animation() + user.do_attack_animation(H) if((user != H) && H.check_shields(I.force, "the [I.name]")) return 0 @@ -918,7 +918,7 @@ if(user) showname = " by [user]!" if(user != src) - user.do_attack_animation() + user.do_attack_animation(H) if(!(user in viewers(I, null))) showname = "." diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index 82628f186a9..cc69516a27c 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -75,7 +75,7 @@ help_shake_act(M) else if (M.a_intent == "harm" && !M.is_muzzled()) - M.do_attack_animation() + M.do_attack_animation(src) if (prob(75)) playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) visible_message("[M.name] bites [name]!", \ @@ -99,7 +99,7 @@ else - L.do_attack_animation() + L.do_attack_animation(src) var/damage = rand(1, 3) visible_message("[L] bites [src]!", \ "[L] bites [src]!") @@ -126,7 +126,7 @@ else if (M.a_intent == "harm") - M.do_attack_animation() + M.do_attack_animation(src) if (prob(75)) visible_message("[M] has punched [name]!", \ "[M] has punched [name]!") @@ -190,7 +190,7 @@ visible_message(" [M] caresses [src] with its scythe like arm.") if ("harm") - M.do_attack_animation() + M.do_attack_animation(src) if ((prob(95) && health > 0)) playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1) var/damage = rand(15, 30) @@ -226,7 +226,7 @@ visible_message("[M] has grabbed [name] passively!") if ("disarm") - M.do_attack_animation() + M.do_attack_animation(src) playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1) var/damage = 5 if(prob(95)) @@ -245,7 +245,7 @@ if(M.melee_damage_upper == 0) M.emote("[M.friendly] [src]") else - M.do_attack_animation() + M.do_attack_animation(src) if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) visible_message("[M] [M.attacktext] [src]!", \ @@ -265,7 +265,7 @@ if (health > -100) - M.do_attack_animation() + M.do_attack_animation(src) visible_message("The [M.name] glomps [src]!", \ "The [M.name] glomps [src]!") @@ -422,4 +422,4 @@ return if(!unacidable) - take_organ_damage(min(6*toxpwr, acid_volume * toxpwr)) + take_organ_damage(min(6*toxpwr, acid_volume * toxpwr)) diff --git a/code/modules/mob/living/carbon/slime/slime.dm b/code/modules/mob/living/carbon/slime/slime.dm index 5982e83a054..aaa39939416 100644 --- a/code/modules/mob/living/carbon/slime/slime.dm +++ b/code/modules/mob/living/carbon/slime/slime.dm @@ -249,7 +249,7 @@ if (Victim) return // can't attack while eating! - M.do_attack_animation() + M.do_attack_animation(src) visible_message(" The [M.name] has glomped [src]!", \ " The [M.name] has glomped [src]!") var/damage = rand(1, 3) @@ -267,7 +267,7 @@ if(M.melee_damage_upper == 0) M.emote("[M.friendly] [src]") else - M.do_attack_animation() + M.do_attack_animation(src) if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) visible_message("[M] [M.attacktext] [src]!", \ @@ -297,7 +297,7 @@ if ("help") help_shake_act(M) else - M.do_attack_animation() + M.do_attack_animation(src) if (M.is_muzzled()) return @@ -319,7 +319,7 @@ else - L.do_attack_animation() + L.do_attack_animation(src) attacked += 10 visible_message("[L] bites [src]!", \ "[L] bites [src]!") @@ -416,7 +416,7 @@ else - M.do_attack_animation() + M.do_attack_animation(src) var/damage = rand(1, 9) attacked += 10 @@ -464,7 +464,7 @@ visible_message("[M] caresses [src] with its scythe like arm.") if ("harm") - M.do_attack_animation() + M.do_attack_animation(src) if (prob(95)) attacked += 10 playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1) @@ -500,7 +500,7 @@ visible_message(" [M] has grabbed [name] passively!") if ("disarm") - M.do_attack_animation() + M.do_attack_animation(src) playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1) var/damage = 5 attacked += 10 diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index a566eeea566..018f00b6b8e 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -661,14 +661,31 @@ /mob/living/singularity_pull(S) step_towards(src,S) -/mob/living/proc/do_attack_animation() +/mob/living/proc/do_attack_animation(atom/A) var/pixel_x_diff = 0 var/pixel_y_diff = 0 - switch(src.dir) - if(1) pixel_y_diff = 8 - if(2) pixel_y_diff = -8 - if(4) pixel_x_diff = 8 - if(8) pixel_x_diff = -8 + 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 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) floating = 0 // If we were without gravity, the bouncing animation got stopped, so we make sure we restart the bouncing after the next movement. diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index b70d03a9f31..21aff8a201e 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -420,7 +420,7 @@ var/list/ai_list = list() visible_message("[M] caresses [src]'s plating with its scythe like arm.") else //harm - M.do_attack_animation() + M.do_attack_animation(src) var/damage = rand(10, 20) if (prob(90)) playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1) @@ -441,7 +441,7 @@ var/list/ai_list = list() if(M.melee_damage_upper == 0) M.emote("[M.friendly] [src]") else - M.do_attack_animation() + M.do_attack_animation(src) if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) visible_message("[M] [M.attacktext] [src]!") diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index a721180b723..a2613265e63 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -644,7 +644,7 @@ visible_message("[M] has grabbed [src] passively!") if ("harm") - M.do_attack_animation() + M.do_attack_animation(src) var/damage = rand(10, 20) if (prob(90)) /* @@ -669,7 +669,7 @@ if ("disarm") if(!(lying)) - M.do_attack_animation() + M.do_attack_animation(src) if (rand(1,100) <= 85) Stun(7) step(src,get_dir(M,src)) @@ -693,7 +693,7 @@ if(M.Victim) return // can't attack while eating! if (health > -100) - M.do_attack_animation() + M.do_attack_animation(src) visible_message("The [M.name] glomps [src]!",\ "The [M.name] glomps [src]!") @@ -746,7 +746,7 @@ if(M.melee_damage_upper == 0) M.emote("[M.friendly] [src]") else - M.do_attack_animation() + M.do_attack_animation(src) if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) visible_message("[M] [M.attacktext] [src]!") diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm index e3d523fc683..ef6fc143a23 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -92,7 +92,7 @@ if(M.melee_damage_upper <= 0) M.emote("me", 1, "[M.friendly] \the [src].") else - M.do_attack_animation() + M.do_attack_animation(src) if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) visible_message("\The [M] [M.attacktext] \the [src]!", \ diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 9ee08f4a929..99ef8ccd371 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -257,7 +257,7 @@ if(M.melee_damage_upper == 0) M.emote("me", 1, "[M.friendly] [src]") else - M.do_attack_animation() + M.do_attack_animation(src) if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) visible_message("\The [M] [M.attacktext] [src]!", \ @@ -302,7 +302,7 @@ playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) if("harm", "disarm") - M.do_attack_animation() + M.do_attack_animation(src) visible_message("[M] [response_harm] [src]!") playsound(loc, "punch", 25, 1, -1) adjustBruteLoss(harm_intent_damage) @@ -322,7 +322,7 @@ visible_message(" [M] [response_help] [src].") playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) else - M.do_attack_animation() + M.do_attack_animation(src) if (M.is_muzzled()) return playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) @@ -356,7 +356,7 @@ visible_message("[M] has grabbed [src] passively!") if("harm", "disarm") - M.do_attack_animation() + M.do_attack_animation(src) var/damage = rand(15, 30) visible_message("[M] has slashed at [src]!", \ "[M] has slashed at [src]!") @@ -373,7 +373,7 @@ else - L.do_attack_animation() + L.do_attack_animation(src) var/damage = rand(5, 10) visible_message("[L] bites [src]!", \ "[L] bites [src]!") @@ -392,7 +392,7 @@ if(M.Victim) return // can't attack while eating! if (health > 0) - M.do_attack_animation() + M.do_attack_animation(src) visible_message("[M.name] glomps [src]!", \ "[M.name] glomps [src]!") @@ -437,7 +437,7 @@ harvest() user.changeNext_move(CLICK_CD_MELEE) - user.do_attack_animation() + user.do_attack_animation(src) var/damage = 0 if(O.force) if(O.force >= force_threshold) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 377f5a3cdb1..741f57798cd 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -599,7 +599,7 @@ (istype(W, /obj/item/device/multitool) || \ istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/device/assembly/signaler))) return src.attack_hand(user) - user.do_attack_animation() + user.do_attack_animation(src) user.visible_message("The [src.name] has been hit with the [W.name] by [user.name]!", \ "You hit the [src.name] with your [W.name]!", \ "You hear bang") @@ -633,7 +633,7 @@ /obj/machinery/power/apc/attack_alien(mob/living/carbon/alien/humanoid/user) if(!user) return - user.do_attack_animation() + user.do_attack_animation(src) user.visible_message("[user.name] slashes at the [src.name]!", "You slash at the [src.name]!") playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1) diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 4e3f91b410c..6bcdb21c96e 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -369,7 +369,7 @@ else if(status != LIGHT_BROKEN && status != LIGHT_EMPTY) - user.do_attack_animation() + user.do_attack_animation(src) if(prob(1+W.force * 5)) user.visible_message("[user.name] smashed the light!", \ @@ -449,7 +449,7 @@ user << "\green That object is useless to you." return else if (status == LIGHT_OK||status == LIGHT_BURNED) - user.do_attack_animation() + user.do_attack_animation(src) visible_message("[user.name] smashed the light!", "You hear a tinkle of breaking glass") broken() return @@ -460,7 +460,7 @@ M << "That object is useless to you." return else if (status == LIGHT_OK||status == LIGHT_BURNED) - M.do_attack_animation() + M.do_attack_animation(src) visible_message("[M.name] smashed the light!", "You hear a tinkle of breaking glass") broken() return diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 9189ae8861b..a4aa0528ecf 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -217,7 +217,7 @@ // hostile mob escape from disposals /obj/machinery/disposal/attack_animal(var/mob/living/simple_animal/M) if(M.environment_smash) - M.do_attack_animation() + M.do_attack_animation(src) visible_message("[M.name] smashes \the [src] apart!") qdel(src) return