adding diagonal attack animation.

This commit is contained in:
phil235
2014-11-07 15:42:07 +01:00
parent 74f8a08522
commit bc5754b378
38 changed files with 130 additions and 113 deletions
@@ -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("<span class='danger'>The [M.name] glomps [src]!</span>", \
"<span class='userdanger'>The [M.name] glomps [src]!</span>")
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("<span class='danger'>[M] [M.attacktext] [src]!</span>", \
@@ -232,7 +232,7 @@
visible_message("<span class='warning'>[M] has grabbed [src] passively!</span>")
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("<span class='danger'>[M.name] bites [src]!!</span>", \
@@ -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("<span class='danger'>[L.name] bites [src]!!</span>", \
@@ -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("<span class='danger'>[M] [M.attacktext] [src]!</span>", \
@@ -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("<span class='danger'>The [M.name] glomps [src]!</span>", \
"<span class='userdanger'>The [M.name] glomps [src]!</span>")
var/damage = rand(1, 3)
@@ -214,7 +214,7 @@
visible_message("<span class='warning'>[M] has grabbed [src] passively!</span>")
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("<span class='danger'>[M.name] bites [src]!</span>", \
@@ -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("<span class='danger'>[M] [M.attacktext] [src]!</span>", \
@@ -244,7 +244,7 @@
else
L.do_attack_animation()
L.do_attack_animation(src)
var/damage = rand(1, 3)
visible_message("<span class='danger'>[L] bites [src]!</span>", \
"<span class='userdanger'>[L] bites [src]!</span>")
@@ -262,7 +262,7 @@
if (health > -100)
M.do_attack_animation()
M.do_attack_animation(src)
visible_message("<span class='danger'>The [M.name] glomps [src]!</span>", \
"<span class='userdanger'>The [M.name] glomps [src]!</span>")
@@ -22,7 +22,7 @@
visible_message("<span class='danger'>[M] has grabbed [src] passively!</span>")
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)
@@ -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
@@ -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
@@ -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 = "."
@@ -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("<span class='danger'>[M.name] bites [name]!</span>", \
@@ -99,7 +99,7 @@
else
L.do_attack_animation()
L.do_attack_animation(src)
var/damage = rand(1, 3)
visible_message("<span class='danger'>[L] bites [src]!</span>", \
"<span class='userdanger'>[L] bites [src]!</span>")
@@ -126,7 +126,7 @@
else
if (M.a_intent == "harm")
M.do_attack_animation()
M.do_attack_animation(src)
if (prob(75))
visible_message("<span class='danger'>[M] has punched [name]!</span>", \
"<span class='userdanger'>[M] has punched [name]!</span>")
@@ -190,7 +190,7 @@
visible_message("<span class='notice'> [M] caresses [src] with its scythe like arm.</span>")
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("<span class='warning'>[M] has grabbed [name] passively!</span>")
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("<span class='danger'>[M] [M.attacktext] [src]!</span>", \
@@ -265,7 +265,7 @@
if (health > -100)
M.do_attack_animation()
M.do_attack_animation(src)
visible_message("<span class='danger'>The [M.name] glomps [src]!</span>", \
"<span class='userdanger'>The [M.name] glomps [src]!</span>")
@@ -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))
@@ -249,7 +249,7 @@
if (Victim) return // can't attack while eating!
M.do_attack_animation()
M.do_attack_animation(src)
visible_message("<span class='danger'> The [M.name] has glomped [src]!</span>", \
"<span class='userdanger'> The [M.name] has glomped [src]!</span>")
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("<span class='danger'>[M] [M.attacktext] [src]!</span>", \
@@ -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("<span class='danger'>[L] bites [src]!</span>", \
"<span class='userdanger'>[L] bites [src]!</span>")
@@ -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("<span class='notice'>[M] caresses [src] with its scythe like arm.</span>")
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("<span class='warning'> [M] has grabbed [name] passively!</span>")
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
+23 -6
View File
@@ -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.
+2 -2
View File
@@ -420,7 +420,7 @@ var/list/ai_list = list()
visible_message("<span class='notice'>[M] caresses [src]'s plating with its scythe like arm.</span>")
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("<span class='danger'><B>[M]</B> [M.attacktext] [src]!")
@@ -644,7 +644,7 @@
visible_message("<span class='danger'>[M] has grabbed [src] passively!</span>")
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("<span class='danger'>The [M.name] glomps [src]!</span>",\
"<span class='userdanger'>The [M.name] glomps [src]!</span>")
@@ -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("<span class='danger'><B>[M]</B> [M.attacktext] [src]!</span>")
@@ -92,7 +92,7 @@
if(M.melee_damage_upper <= 0)
M.emote("me", 1, "[M.friendly] \the <EM>[src]</EM>.")
else
M.do_attack_animation()
M.do_attack_animation(src)
if(M.attack_sound)
playsound(loc, M.attack_sound, 50, 1, 1)
visible_message("<span class='danger'>\The <EM>[M]</EM> [M.attacktext] \the <EM>[src]</EM>!</span>", \
@@ -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("<span class='danger'>\The [M] [M.attacktext] [src]!</span>", \
@@ -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("<span class='danger'>[M] [response_harm] [src]!</span>")
playsound(loc, "punch", 25, 1, -1)
adjustBruteLoss(harm_intent_damage)
@@ -322,7 +322,7 @@
visible_message("<span class='notice'> [M] [response_help] [src].</span>")
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("<span class='warning'>[M] has grabbed [src] passively!</span>")
if("harm", "disarm")
M.do_attack_animation()
M.do_attack_animation(src)
var/damage = rand(15, 30)
visible_message("<span class='danger'>[M] has slashed at [src]!</span>", \
"<span class='userdanger'>[M] has slashed at [src]!</span>")
@@ -373,7 +373,7 @@
else
L.do_attack_animation()
L.do_attack_animation(src)
var/damage = rand(5, 10)
visible_message("<span class='danger'>[L] bites [src]!</span>", \
"<span class='userdanger'>[L] bites [src]!</span>")
@@ -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("<span class='danger'>[M.name] glomps [src]!</span>", \
"<span class='userdanger'>[M.name] glomps [src]!</span>")
@@ -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)