Shared: Add player animation code for movement and weapons.

This commit is contained in:
Marco Cawthorne 2023-01-23 13:41:08 -08:00
parent 93c42b06cc
commit d8c42b20ae
Signed by: eukara
GPG key ID: CE2032F0A2882A22
24 changed files with 351 additions and 52 deletions

View file

@ -0,0 +1,52 @@
enum
{
TFCANIM_DIEGUTSHOT = ANIM_DIEGUTSHOT,
TFCANIM_AIMCROWBAR,
TFCANIM_SHOOTCROWBAR,
TFCANIM_CR_AIMCROWBAR,
TFCANIM_CR_SHOOTCROWBAR,
TFCANIM_AIM1HAND,
TFCANIM_SHOOT1HAND,
TFCANIM_CR_AIM1HAND,
TFCANIM_CR_SHOOT1HAND,
TFCANIM_AIMSHOTGUN,
TFCANIM_SHOOTSHOTGUN,
TFCANIM_CR_AIMSHOTGUN,
TFCANIM_CR_SHOOTSHOTGUN,
TFCANIM_AIMGAUSS,
TFCANIM_SHOOTGAUSS,
TFCANIM_CR_AIMGAUSS,
TFCANIM_CR_SHOOTGAUSS,
TFCANIM_AIMMP5,
TFCANIM_SHOOTMP5,
TFCANIM_CR_AIMMP5,
TFCANIM_CR_SHOOTMP5,
TFCANIM_AIMRPG,
TFCANIM_SHOOTRPG,
TFCANIM_CR_AIMRPG,
TFCANIM_CR_SHOOTRPG,
TFCANIM_AIMEGON,
TFCANIM_SHOOTEGON,
TFCANIM_CR_AIMEGON,
TFCANIM_CR_SHOOTEGON,
TFCANIM_AIMSNIPER,
TFCANIM_SHOOTSNIPER,
TFCANIM_CR_AIMSNIPER,
TFCANIM_CR_SHOOTSNIPER,
TFCANIM_AIMAUTOSNIPER,
TFCANIM_SHOOTAUTOSNIPER,
TFCANIM_CR_AIMAUTOSNIPER,
TFCANIM_CR_SHOOTAUTOSNIPER,
TFCANIM_AIMMEDKIT,
TFCANIM_SHOOTMEDKIT,
TFCANIM_CR_AIMMEDKIT,
TFCANIM_CR_SHOOTMEDKIT,
TFCANIM_AIMKNIFE,
TFCANIM_SHOOTKNIFE,
TFCANIM_CR_AIMKNIFE,
TFCANIM_CR_SHOOTKNIFE,
TFCANIM_AIMASSCAN,
TFCANIM_SHOOTASSCAN,
TFCANIM_CR_AIMASSCAN,
TFCANIM_CR_SHOOTASSCAN
};

View file

@ -32,7 +32,7 @@ string g_teammodels[] = {
"models/player/scout/scout2.mdl",
"models/player/sniper/sniper2.mdl",
"models/player/soldier/soldier2.mdl",
"models/player/demo/demo.mdl",
"models/player/demo/demo2.mdl",
"models/player/medic/medic2.mdl",
"models/player/hvyweapon/hvyweapon2.mdl",
"models/player/pyro/pyro2.mdl",

View file

@ -8,6 +8,7 @@ events.h
player.qc
../../../base/src/shared/weapon_common.h
../../../valve/src/shared/animations.h
animations_tfc.h
../../../valve/src/shared/animations.qc
pmove.qc

View file

@ -14,6 +14,89 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef CLIENT
/* Here's a list of bone names that we are aware of on HL player models.
Usually we'd use skeletalobjects to share the same skeleton/anim with
another model - but because FTEQW does not support that for HLMDL we
are forced to manually position the bones of our attachnment
by iterating over them and manually setting their position in 3D-space.
*/
string g_pbones[] =
{
"Bip01",
"Bip01 Footsteps",
"Bip01 Pelvis",
"Bip01 L Leg",
"Bip01 L Leg1",
"Bip01 L Foot",
"Bip01 L Toe0",
"Bip01 L Toe01",
"Bip01 L Toe02",
"Dummy16",
"Bip01 R Leg",
"Bip01 R Leg1",
"Bip01 R Foot",
"Bip01 R Toe0",
"Bip01 R Toe01",
"Bip01 R Toe02",
"Dummy11",
"Bip01 Spine",
"Bip01 Spine1",
"Bip01 Spine2",
"Bip01 Spine3",
"Bip01 Neck",
"Bip01 Head",
"Dummy21",
"Dummy08",
"Bone02",
"Bone03",
"Bone04",
"Dummy05",
"Bone09",
"Bone10",
"Dummy04",
"Bone05",
"Bone06",
"Dummy03",
"Bone07",
"Bone08",
"Dummy09",
"Bone11",
"Bone12",
"Dummy10",
"Bone13",
"Bone14",
"Bone15",
"Bip01 L Arm",
"Bip01 L Arm1",
"Bip01 L Arm2",
"Bip01 L Hand",
"Bip01 L Finger0",
"Bip01 L Finger01",
"Bip01 L Finger02",
"Dummy06",
"Bip01 L Finger1",
"Bip01 L Finger11",
"Bip01 L Finger12",
"Dummy07",
"Bip01 R Arm",
"Bip01 R Arm1",
"Bip01 R Arm2",
"Bip01 R Hand",
"Bip01 R Finger0",
"Bip01 R Finger01",
"Bip01 R Finger02",
"Dummy01",
"Bip01 R Finger1",
"Bip01 R Finger11",
"Bip01 R Finger12",
"Dummy02",
"Box02",
"Bone08",
"Bone15"
};
#endif
/* all potential SendFlags bits we can possibly send */
enumflags
{
@ -65,12 +148,14 @@ class player:NSClientPlayer
nonvirtual void TFC_CookGren2(void);
nonvirtual void TFC_ReleaseGren1(void);
nonvirtual void TFC_ReleaseGren2(void);
virtual void UpdatePlayerAnimation(float);
#ifdef CLIENT
virtual void ReceiveEntity(float,float);
virtual void PredictPreFrame(void);
virtual void PredictPostFrame(void);
virtual void UpdateAliveCam(void);
virtual void UpdatePlayerAttachments(bool);
#else
NSTimer gren1;
@ -98,6 +183,18 @@ class player:NSClientPlayer
#endif
};
void Animation_PlayerUpdate(player);
void Animation_TimerUpdate(player, float);
void
player::UpdatePlayerAnimation(float timelength)
{
/* calculate our skeletal progression */
Animation_PlayerUpdate(this);
/* advance animation timers */
Animation_TimerUpdate(this, timelength);
}
#ifdef SERVER
void TFCNade_ThrowCaltrop(player);
@ -215,6 +312,88 @@ player::ProcessInput(void)
}
#ifdef CLIENT
.string oldmodel;
string Weapons_GetPlayermodel(player, int);
void
player::UpdatePlayerAttachments(bool visible)
{
/* draw the flashlight */
if (gflags & GF_FLASHLIGHT) {
vector src;
vector ang;
if (entnum != player_localentnum) {
src = origin + view_ofs;
ang = v_angle;
} else {
src = pSeat->m_vecPredictedOrigin + [0,0,-8];
ang = view_angles;
}
makevectors(ang);
traceline(src, src + (v_forward * 8096), MOVE_NORMAL, this);
if (serverkeyfloat("*bspversion") == BSPVER_HL) {
dynamiclight_add(trace_endpos + (v_forward * -2), 128, [1,1,1]);
} else {
float p = dynamiclight_add(src, 512, [1,1,1], 0, "textures/flashlight");
dynamiclight_set(p, LFIELD_ANGLES, ang);
dynamiclight_set(p, LFIELD_FLAGS, 3);
}
}
/* FIXME: this needs to be incorporated and simplified, now that we can handle it all in-class */
if (!visible)
return;
/* what's the current weapon model supposed to be anyway? */
p_model.oldmodel = Weapons_GetPlayermodel(this, activeweapon);
/* we changed weapons, update skeletonindex */
if (p_model.model != p_model.oldmodel) {
/* free memory */
if (p_model.skeletonindex)
skel_delete(p_model.skeletonindex);
/* set the new model and mark us updated */
setmodel(p_model, p_model.oldmodel);
p_model.model = p_model.oldmodel;
/* set the new skeletonindex */
p_model.skeletonindex = skel_create(p_model.modelindex);
/* hack this thing in here FIXME: this should be done when popping in/out of a pvs */
if (autocvar(cl_himodels, 1, "Use high-quality thisayer models over lower-definition ones"))
setcustomskin(this, "", "geomset 0 2\n");
else
setcustomskin(this, "", "geomset 0 1\n");
}
/* follow thisayer at all times */
setorigin(p_model, origin);
p_model.angles = angles;
skel_build(p_model.skeletonindex, p_model, p_model.modelindex,0, 0, -1);
/* we have to loop through all valid bones of the weapon model and match them
* to the thisayer one */
for (float i = 0; i < g_pbones.length; i++) {
vector bpos;
float pbone = gettagindex(this, g_pbones[i]);
float wbone = gettagindex(p_model, g_pbones[i]);
/* if the bone doesn't ignore in either skeletal mesh, ignore */
if (wbone <= 0 || pbone <= 0)
continue;
bpos = gettaginfo(this, pbone);
/* the most expensive bit */
skel_set_bone_world(p_model, wbone, bpos, v_forward, v_right, v_up);
}
}
void Weapons_AmmoUpdate(entity);
void HUD_AmmoNotify_Check(player pl);
void HUD_ItemNotify_Check(player pl);

View file

@ -98,7 +98,7 @@ w_asscan_wmodel(void)
string
w_asscan_pmodel(player pl)
{
return "models/p_tfac.mdl";
return "models/p_mini2.mdl";
}
string
@ -177,6 +177,11 @@ w_asscan_primary(player pl)
Weapons_ViewPunchAngle(pl, [random(-2, 2),0,0]);
Weapons_Sound(pl, CHAN_WEAPON, "weapon_asscan.fire");
if (pl.flags & FL_CROUCHING)
Animation_PlayerTop(pl, TFCANIM_CR_SHOOTASSCAN, 0.1f);
else
Animation_PlayerTop(pl, TFCANIM_SHOOTASSCAN, 0.1f);
#ifdef CLIENT
View_AddEvent(w_asscan_ejectshell, 0.0f);
View_SetMuzzleflash(MUZZLE_WEIRD);
@ -207,7 +212,7 @@ w_asscan_hud(player pl)
float
w_asscan_aimanim(player pl)
{
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
return pl.flags & FL_CROUCHING ? TFCANIM_CR_AIMASSCAN : TFCANIM_AIMASSCAN;
}
void

View file

@ -78,7 +78,7 @@ w_autorifle_draw(player pl)
float
w_autorifle_aimanim(player pl)
{
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
return pl.flags & FL_CROUCHING ? TFCANIM_CR_AIMAUTOSNIPER : TFCANIM_AIMAUTOSNIPER;
}
void
@ -93,6 +93,12 @@ w_autorifle_primary(player pl)
case AUTO_FIRED:
case AUTO_LAST:
Weapons_ViewAnimation(pl, SNIPER_AUTOFIRE);
if (pl.flags & FL_CROUCHING)
Animation_PlayerTop(pl, TFCANIM_CR_SHOOTAUTOSNIPER, 0.45f);
else
Animation_PlayerTop(pl, TFCANIM_SHOOTAUTOSNIPER, 0.45f);
#ifdef CLIENT
View_SetMuzzleflash(MUZZLE_RIFLE);
#endif

View file

@ -45,7 +45,7 @@ w_crowbar_precache(void)
Sound_Precache("weapon_crowbar.hitbody");
precache_model("models/w_crowbar.mdl");
#else
precache_model("models/v_crowbar.mdl");
precache_model("models/v_tfc_crowbar.mdl");
precache_model("models/p_crowbar.mdl");
#endif
}
@ -76,7 +76,7 @@ w_crowbar_deathmsg(void)
void
w_crowbar_draw(player pl)
{
Weapons_SetModel("models/v_crowbar.mdl");
Weapons_SetModel("models/v_tfc_crowbar.mdl");
Weapons_ViewAnimation(pl, CBAR_DRAW);
}
@ -124,7 +124,7 @@ w_crowbar_primary(player pl)
Weapons_ViewAnimation(pl, trace_fraction >= 1 ? CBAR_ATTACK3MISS:CBAR_ATTACK3HIT);
}
if (self.flags & FL_CROUCHING)
if (pl.flags & FL_CROUCHING)
Animation_PlayerTop(pl, ANIM_CR_SHOOTCROWBAR, 0.41f);
else
Animation_PlayerTop(pl, ANIM_SHOOTCROWBAR, 0.5f);
@ -169,7 +169,7 @@ w_crowbar_release(player pl)
float
w_crowbar_aimanim(player pl)
{
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
return pl.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
}
void

View file

@ -56,7 +56,7 @@ w_dbs_wmodel(void)
string
w_dbs_pmodel(player pl)
{
return "models/p_shot2.mdl";
return "models/p_shotgun2.mdl";
}
string
@ -106,6 +106,12 @@ w_dbs_primary(player pl)
pl.mag_dbs--;
Weapons_ViewAnimation(pl, DBS_FIRE1);
Weapons_ViewPunchAngle(pl, [-2,0,0]);
if (pl.flags & FL_CROUCHING)
Animation_PlayerTop(pl, TFCANIM_CR_SHOOTSHOTGUN, 0.45f);
else
Animation_PlayerTop(pl, TFCANIM_SHOOTSHOTGUN, 0.45f);
#ifdef CLIENT
View_SetMuzzleflash(MUZZLE_ROUND);
#endif
@ -175,7 +181,7 @@ w_dbs_crosshair(player pl)
float
w_dbs_aimanim(player pl)
{
return self.flags & FL_CROUCHING ? ANIM_CR_AIMSHOTGUN : ANIM_AIMSHOTGUN;
return pl.flags & FL_CROUCHING ? ANIM_CR_AIMSHOTGUN : ANIM_AIMSHOTGUN;
}
void

View file

@ -57,7 +57,7 @@ w_flamer_wmodel(void)
string
w_flamer_pmodel(player pl)
{
return "models/p_egon.mdl";
return "models/p_egon2.mdl";
}
string
@ -163,14 +163,14 @@ w_flamer_crosshair(player pl)
//Cross_DrawSub(g_cross_spr, [24,24], [72/128,48/128], [0.1875, 0.1875]);
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], "sprites/640hud7.spr_0.tga", [0,96/128], [24/256, 24/128], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [0,96/128], [24/256, 24/128], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}
float
w_flamer_aimanim(player pl)
{
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
return pl.flags & FL_CROUCHING ? TFCANIM_CR_AIMEGON : TFCANIM_AIMEGON;
}
void

View file

@ -67,7 +67,7 @@ w_glauncher_wmodel(void)
string
w_glauncher_pmodel(player pl)
{
return "models/p_glauncher.mdl";
return "models/p_glauncher2.mdl";
}
string
@ -173,6 +173,12 @@ w_glauncher_primary(player pl)
case AUTO_LAST:
Weapons_ViewAnimation(pl, GLAUNCHER_GFIRE);
Weapons_ViewPunchAngle(pl, [-1,0,0]);
if (pl.flags & FL_CROUCHING)
Animation_PlayerTop(pl, TFCANIM_CR_SHOOTSHOTGUN, 0.45f);
else
Animation_PlayerTop(pl, TFCANIM_SHOOTSHOTGUN, 0.45f);
pl.w_attack_next = 0.6f;
break;
case AUTO_EMPTY:
@ -214,7 +220,7 @@ w_glauncher_postdraw(player pl)
float
w_glauncher_aimanim(player pl)
{
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
return pl.flags & FL_CROUCHING ? TFCANIM_CR_AIMSHOTGUN : TFCANIM_AIMSHOTGUN;
}
void

View file

@ -57,7 +57,7 @@ w_grapple_draw(player pl)
float
w_grapple_aimanim(player pl)
{
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
return pl.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
}
void

View file

@ -56,7 +56,7 @@ w_incendiary_wmodel(void)
string
w_incendiary_pmodel(player pl)
{
return "models/p_incendiary.mdl";
return "models/p_rpg2.mdl";
}
string
@ -108,15 +108,16 @@ w_incendiary_primary(player pl)
return;
break;
case AUTO_FIRED:
Weapons_ViewAnimation(pl, INC_FIRE);
Weapons_Sound(pl, CHAN_WEAPON, "weapon_incendiary.fire");
Weapons_ViewPunchAngle(pl, [-2,0,0]);
pl.w_attack_next = 0.8f;
break;
case AUTO_LAST:
Weapons_ViewAnimation(pl, INC_FIRE);
Weapons_Sound(pl, CHAN_WEAPON, "weapon_incendiary.fire");
Weapons_ViewPunchAngle(pl, [-2,0,0]);
if (pl.flags & FL_CROUCHING)
Animation_PlayerTop(pl, TFCANIM_CR_SHOOTRPG, 0.45f);
else
Animation_PlayerTop(pl, TFCANIM_SHOOTRPG, 0.45f);
pl.w_attack_next = 0.8f;
break;
case AUTO_EMPTY:
@ -130,7 +131,7 @@ w_incendiary_primary(player pl)
float
w_incendiary_aimanim(player pl)
{
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
return pl.flags & FL_CROUCHING ? TFCANIM_CR_AIMRPG : TFCANIM_AIMRPG;
}
void

View file

@ -99,7 +99,7 @@ w_knife_primary(player pl)
Weapons_ViewAnimation(pl, KNIFE_SLASH);
if (self.flags & FL_CROUCHING)
if (pl.flags & FL_CROUCHING)
Animation_PlayerTop(pl, ANIM_CR_SHOOTCROWBAR, 0.41f);
else
Animation_PlayerTop(pl, ANIM_SHOOTCROWBAR, 0.5f);
@ -144,7 +144,7 @@ w_knife_primary(player pl)
float
w_knife_aimanim(player pl)
{
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
return pl.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
}
void

View file

@ -80,10 +80,10 @@ w_medkit_primary(player pl)
Weapons_ViewAnimation(pl, MEDKIT_USE);
if (self.flags & FL_CROUCHING)
Animation_PlayerTop(pl, ANIM_SHOOT1HAND, 0.45f);
if (pl.flags & FL_CROUCHING)
Animation_PlayerTop(pl, TFCANIM_CR_SHOOTMEDKIT, 0.45f);
else
Animation_PlayerTop(pl, ANIM_CR_SHOOT1HAND, 0.45f);
Animation_PlayerTop(pl, TFCANIM_SHOOTMEDKIT, 0.45f);
if (trace_ent.classname == "player") {
player otherpl = (player) trace_ent;
@ -131,7 +131,7 @@ w_medkit_release(player pl)
float
w_medkit_aimanim(player pl)
{
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
return pl.flags & FL_CROUCHING ? TFCANIM_CR_AIMMEDKIT : TFCANIM_AIMMEDKIT;
}
void

View file

@ -50,7 +50,7 @@ w_nailgun_wmodel(void)
string
w_nailgun_pmodel(player pl)
{
return "models/p_nailgun.mdl";
return "models/p_nailgun2.mdl";
}
string
@ -69,7 +69,7 @@ w_nailgun_draw(player pl)
float
w_nailgun_aimanim(player pl)
{
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
return pl.flags & FL_CROUCHING ? TFCANIM_CR_AIMMP5 : TFCANIM_AIMMP5;
}
void
@ -125,6 +125,12 @@ w_nailgun_primary(player pl)
}
Weapons_ViewAnimation(pl, NAILGUN_SHOOT2);
Weapons_ViewPunchAngle(pl, [-1,0,0]);
if (pl.flags & FL_CROUCHING)
Animation_PlayerTop(pl, TFCANIM_CR_SHOOTMP5, 0.45f);
else
Animation_PlayerTop(pl, TFCANIM_SHOOTMP5, 0.45f);
#ifdef CLIENT
View_SetMuzzleflash(MUZZLE_RIFLE);
#endif

View file

@ -46,12 +46,12 @@ w_pipebomb_pickup(player pl, int new, int startammo)
string
w_pipebomb_wmodel(void)
{
return "models/w_pipebomb.mdl";
return "models/p_glauncher.mdl";
}
string
w_pipebomb_pmodel(player pl)
{
return "models/p_pipebomb.mdl";
return "models/p_glauncher.mdl";
}
string
@ -181,6 +181,12 @@ w_pipebomb_primary(player pl)
case AUTO_LAST:
Weapons_ViewAnimation(pl, GLAUNCHER_PFIRE);
Weapons_ViewPunchAngle(pl, [-1,0,0]);
if (pl.flags & FL_CROUCHING)
Animation_PlayerTop(pl, TFCANIM_CR_SHOOTSHOTGUN, 0.45f);
else
Animation_PlayerTop(pl, TFCANIM_SHOOTSHOTGUN, 0.45f);
pl.w_attack_next = 0.6f;
break;
case AUTO_EMPTY:
@ -244,7 +250,7 @@ w_pipebomb_postdraw(player pl)
float
w_pipebomb_aimanim(player pl)
{
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
return pl.flags & FL_CROUCHING ? TFCANIM_CR_AIMSHOTGUN : TFCANIM_AIMSHOTGUN;
}
void

View file

@ -46,7 +46,7 @@ w_railgun_wmodel(void)
string
w_railgun_pmodel(player pl)
{
return "models/p_railgun.mdl";
return "models/p_9mmhandgun.mdl";
}
string
@ -65,7 +65,7 @@ w_railgun_draw(player pl)
float
w_railgun_aimanim(player pl)
{
return pl.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND;
return pl.flags & FL_CROUCHING ? TFCANIM_CR_AIM1HAND : TFCANIM_AIM1HAND;
}
void
@ -118,6 +118,12 @@ w_railgun_primary(player pl)
int r = (float)input_sequence % 3;
Weapons_ViewAnimation(pl, RAILGUN_SHOOT);
Weapons_ViewPunchAngle(pl, [-1,0,0]);
if (pl.flags & FL_CROUCHING)
Animation_PlayerTop(pl, TFCANIM_CR_SHOOT1HAND, 0.45f);
else
Animation_PlayerTop(pl, TFCANIM_SHOOT1HAND, 0.45f);
Weapons_Sound(pl, CHAN_WEAPON, "weapon_railgun.fire");
pl.w_attack_next = 0.4f;
break;

View file

@ -114,16 +114,17 @@ w_rpg_primary(player pl)
case AUTO_FIRE_FAILED:
return;
break;
case AUTO_LAST:
case AUTO_FIRED:
Weapons_ViewAnimation(pl, RPG_FIRE);
Weapons_ViewPunchAngle(pl, [-2,0,0]);
Weapons_Sound(pl, CHAN_WEAPON, "weapon_rpg.fire");
pl.w_attack_next = 0.8f;
break;
case AUTO_LAST:
Weapons_ViewAnimation(pl, RPG_FIRE);
Weapons_ViewPunchAngle(pl, [-2,0,0]);
Weapons_Sound(pl, CHAN_WEAPON, "weapon_rpg.fire");
if (pl.flags & FL_CROUCHING)
Animation_PlayerTop(pl, TFCANIM_CR_SHOOTRPG, 0.45f);
else
Animation_PlayerTop(pl, TFCANIM_SHOOTRPG, 0.45f);
pl.w_attack_next = 0.8f;
break;
case AUTO_EMPTY:
@ -174,7 +175,7 @@ w_rpg_release(player pl)
float
w_rpg_aimanim(player pl)
{
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
return pl.flags & FL_CROUCHING ? TFCANIM_CR_AIMRPG : TFCANIM_AIMRPG;
}
void

View file

@ -97,6 +97,12 @@ w_sbs_primary(player pl)
#endif
Weapons_ViewAnimation(pl, SBS_FIRE1);
Weapons_ViewPunchAngle(pl, [-2,0,0]);
if (pl.flags & FL_CROUCHING)
Animation_PlayerTop(pl, TFCANIM_CR_SHOOTSHOTGUN, 0.45f);
else
Animation_PlayerTop(pl, TFCANIM_SHOOTSHOTGUN, 0.45f);
Weapons_Sound(pl, CHAN_WEAPON, "weapon_sbs.fire");
pl.w_attack_next = 0.5f;
break;
@ -163,7 +169,7 @@ w_sbs_crosshair(player pl)
float
w_sbs_aimanim(player pl)
{
return self.flags & FL_CROUCHING ? ANIM_CR_AIMSHOTGUN : ANIM_AIMSHOTGUN;
return pl.flags & FL_CROUCHING ? ANIM_CR_AIMSHOTGUN : ANIM_AIMSHOTGUN;
}
void

View file

@ -69,7 +69,7 @@ w_sniper_draw(player pl)
float
w_sniper_aimanim(player pl)
{
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
return pl.flags & FL_CROUCHING ? TFCANIM_CR_AIMSNIPER : TFCANIM_AIMSNIPER;
}
void
@ -82,6 +82,12 @@ w_sniper_release(player pl)
float dmg = bound(75, (pl.mode_tempstate/2) * 75, 375);
w_baseauto_fire(pl, player::m_iAmmoShells, dmg, [0,0]);
Weapons_ViewAnimation(pl, SNIPER_FIRE);
if (pl.flags & FL_CROUCHING)
Animation_PlayerTop(pl, TFCANIM_CR_SHOOTSNIPER, 0.45f);
else
Animation_PlayerTop(pl, TFCANIM_SHOOTSNIPER, 0.45f);
#ifdef CLIENT
View_SetMuzzleflash(MUZZLE_RIFLE);
#endif

View file

@ -48,12 +48,12 @@ w_supernail_updateammo(player pl)
string
w_supernail_wmodel(void)
{
return "models/w_supernail.mdl";
return "models/p_snailgun2.mdl";
}
string
w_supernail_pmodel(player pl)
{
return "models/p_supernail.mdl";
return "models/p_snailgun2.mdl";
}
string
@ -72,7 +72,7 @@ w_supernail_draw(player pl)
float
w_supernail_aimanim(player pl)
{
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
return pl.flags & FL_CROUCHING ? TFCANIM_CR_AIMMP5 : TFCANIM_AIMMP5;
}
void
@ -128,6 +128,12 @@ w_supernail_primary(player pl)
}
Weapons_ViewAnimation(pl, NAILGUN_SHOOT2);
Weapons_ViewPunchAngle(pl, [-1,0,0]);
if (pl.flags & FL_CROUCHING)
Animation_PlayerTop(pl, TFCANIM_CR_SHOOTMP5, 0.45f);
else
Animation_PlayerTop(pl, TFCANIM_SHOOTMP5, 0.45f);
#ifdef CLIENT
View_SetMuzzleflash(MUZZLE_RIFLE);
#endif

View file

@ -50,7 +50,7 @@ w_tranquil_wmodel(void)
string
w_tranquil_pmodel(player pl)
{
return "models/p_tranquil.mdl";
return "models/p_9mmhandgun2.mdl";
}
string
@ -113,6 +113,12 @@ w_tranquil_primary(player pl)
Weapons_ViewAnimation(pl, TRANQUIL_SHOOT);
Weapons_ViewPunchAngle(pl, [-2,0,0]);
Weapons_Sound(pl, CHAN_WEAPON, "weapon_tranquilizer.fire");
if (pl.flags & FL_CROUCHING)
Animation_PlayerTop(pl, TFCANIM_CR_SHOOT1HAND, 0.45f);
else
Animation_PlayerTop(pl, TFCANIM_SHOOT1HAND, 0.45f);
pl.w_attack_next = 1.5f;
break;
case AUTO_EMPTY:
@ -126,7 +132,7 @@ w_tranquil_primary(player pl)
float
w_tranquil_aimanim(player pl)
{
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
return pl.flags & FL_CROUCHING ? TFCANIM_CR_AIM1HAND : TFCANIM_AIM1HAND;
}
void

View file

@ -176,7 +176,7 @@ w_umbrella_release(player pl)
float
w_umbrella_aimanim(player pl)
{
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
return pl.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
}
void

View file

@ -191,7 +191,7 @@ w_wrench_crosshair(player pl)
float
w_wrench_aimanim(player pl)
{
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
return pl.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
}
void