Weapons: Add player model animations for the hammer, shotgun and change the aim animation for the chainsaw to be that of the Egon

This commit is contained in:
Marco Cawthorne 2021-04-10 23:14:28 +02:00
parent a82c6fd12d
commit 629a9c55aa
3 changed files with 32 additions and 12 deletions

View File

@ -144,6 +144,11 @@ w_cannon_primary(void)
Weapons_ViewAnimation(CANNON_FIREBOTH);
pl.w_attack_next = 1.5f;
pl.w_idle_next = 2.5f;
if (self.flags & FL_CROUCHING)
Animation_PlayerTop(pl, ANIM_CR_SHOOTSHOTGUN, 0.41f);
else
Animation_PlayerTop(pl, ANIM_SHOOTSHOTGUN, 0.5f);
}
void
@ -178,6 +183,11 @@ w_cannon_secondary(void)
pl.w_attack_next = 1.5f;
pl.w_idle_next = 2.5f;
if (self.flags & FL_CROUCHING)
Animation_PlayerTop(pl, ANIM_CR_SHOOTSHOTGUN, 0.41f);
else
Animation_PlayerTop(pl, ANIM_SHOOTSHOTGUN, 0.5f);
}
void
w_cannon_release(void)

View File

@ -160,7 +160,7 @@ void w_chainsaw_release(void)
float w_chainsaw_aimanim(void)
{
return self.flags & FL_CROUCHING ? ANIM_CR_AIMSQUEAK : ANIM_AIMSQUEAK;
return self.flags & FL_CROUCHING ? ANIM_CR_AIMEGON : ANIM_AIMEGON;
}
void w_chainsaw_hudpic(int s, vector pos, float a)

View File

@ -145,23 +145,33 @@ void w_hammer_release(void)
#endif
Weapons_ViewAnimation(HAMMER_ATTACK1);
pl.w_attack_next = 1.0f;
if (self.flags & FL_CROUCHING)
Animation_PlayerTop(pl, ANIM_CR_SHOOTCROWBAR, 0.41f);
else
Animation_PlayerTop(pl, ANIM_SHOOTCROWBAR, 0.5f);
} else if (pl.ammo_hammer_state == 2) {
#ifdef SERVER
if (trace_ent.takedamage) {
if (trace_ent.iBleeds) {
FX_Blood(trace_endpos, [1,0,0]);
if (trace_ent.takedamage) {
if (trace_ent.iBleeds) {
FX_Blood(trace_endpos, [1,0,0]);
}
hitsound = floor(random(1, 2));
hdmg = Skill_GetValue("plr_hammeralt", 200);
Damage_Apply(trace_ent, self, hdmg, WEAPON_HAMMER, DMG_BLUNT);
} else {
if (trace_fraction < 1.0) {
hitsound = 2;
}
}
hitsound = floor(random(1, 2));
hdmg = Skill_GetValue("plr_hammeralt", 200);
Damage_Apply(trace_ent, self, hdmg, WEAPON_HAMMER, DMG_BLUNT);
} else {
if (trace_fraction < 1.0) {
hitsound = 2;
}
}
#endif
Weapons_ViewAnimation(HAMMER_ATTACK2);
pl.w_attack_next = 0.75f;
if (self.flags & FL_CROUCHING)
Animation_PlayerTop(pl, ANIM_CR_SHOOTCROWBAR, 0.41f);
else
Animation_PlayerTop(pl, ANIM_SHOOTCROWBAR, 0.5f);
}
#ifdef SERVER