Cstrike: Progress towards the grenades.
This commit is contained in:
parent
b2ef0db018
commit
a1b1eca2e5
6 changed files with 414 additions and 80 deletions
|
@ -71,13 +71,40 @@ weapon_glock18.burstfire
|
|||
sample weapons/glock18-1.wav
|
||||
}
|
||||
|
||||
weapon_grenade.bounce
|
||||
weapon_hegrenade.bounce
|
||||
{
|
||||
sample weapons/he_bounce-1.wav
|
||||
}
|
||||
|
||||
weapon_hegrenade.explode
|
||||
{
|
||||
sample weapons/explode3.wav
|
||||
sample weapons/explode4.wav
|
||||
}
|
||||
|
||||
weapon_smokegrenade.bounce
|
||||
{
|
||||
sample weapons/grenade_hit1.wav
|
||||
sample weapons/grenade_hit2.wav
|
||||
sample weapons/grenade_hit3.wav
|
||||
}
|
||||
|
||||
weapon_smokegrenade.explode
|
||||
{
|
||||
sample weapons/sg_explode.wav
|
||||
}
|
||||
|
||||
weapon_flashbang.bounce
|
||||
{
|
||||
sample weapons/grenade_hit1.wav
|
||||
sample weapons/grenade_hit2.wav
|
||||
sample weapons/grenade_hit3.wav
|
||||
}
|
||||
|
||||
weapon_flashbang.explode
|
||||
{
|
||||
sample weapons/flashbang-1.wav
|
||||
sample weapons/flashbang-2.wav
|
||||
}
|
||||
|
||||
weapon_knife.hit
|
||||
|
|
|
@ -118,6 +118,9 @@ class player:CBaseEntity
|
|||
int ammo_45acp;
|
||||
int ammo_357sig;
|
||||
int ammo_57mm;
|
||||
int ammo_hegrenade;
|
||||
int ammo_fbgrenade;
|
||||
int ammo_smokegrenade;
|
||||
|
||||
/* conditional networking */
|
||||
int old_modelindex;
|
||||
|
|
|
@ -30,17 +30,16 @@ Price: $200
|
|||
|
||||
enum {
|
||||
FLASHBANG_IDLE,
|
||||
FLASHBANG_RELOAD,
|
||||
FLASHBANG_PULLPIN,
|
||||
FLASHBANG_THROW,
|
||||
FLASHBANG_DRAW,
|
||||
FLASHBANG_SHOOT1,
|
||||
FLASHBANG_SHOOT2,
|
||||
FLASHBANG_SHOOT3
|
||||
};
|
||||
|
||||
void
|
||||
w_flashbang_precache(void)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Sound_Precache("weapon_flashbang.bounce");
|
||||
Sound_Precache("weapon_flashbang.explode");
|
||||
#endif
|
||||
precache_model("models/v_flashbang.mdl");
|
||||
|
@ -52,10 +51,25 @@ void
|
|||
w_flashbang_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, -1, -1, -1);
|
||||
Weapons_UpdateAmmo(pl, -1, pl.ammo_fbgrenade, pl.a_ammo3);
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
w_flashbang_pickup(int new)
|
||||
{
|
||||
#ifdef SSQC
|
||||
player pl = (player)self;
|
||||
|
||||
if (pl.ammo_fbgrenade < 3) {
|
||||
pl.ammo_fbgrenade = bound(0, pl.ammo_fbgrenade + 1, 3);
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
string
|
||||
w_flashbang_wmodel(void)
|
||||
{
|
||||
|
@ -77,39 +91,125 @@ w_flashbang_deathmsg(void)
|
|||
void
|
||||
w_flashbang_draw(void)
|
||||
{
|
||||
#ifdef CSQC
|
||||
Weapons_SetModel("models/v_flashbang.mdl");
|
||||
Weapons_ViewAnimation(FLASHBANG_DRAW);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef SSQC
|
||||
void w_flashbang_throw(void)
|
||||
{
|
||||
static void flashbang_explode( void )
|
||||
{
|
||||
Sound_Play(self, CHAN_BODY, "weapon_flashbang.explode");
|
||||
remove(self);
|
||||
}
|
||||
|
||||
static void flashbang_touch( void )
|
||||
{
|
||||
if (other.takedamage == DAMAGE_YES) {
|
||||
Damage_Apply(other, self.owner, 15, WEAPON_FLASHBANG, DMG_BLUNT);
|
||||
} else {
|
||||
Sound_Play(self, CHAN_BODY, "weapon_flashbang.bounce");
|
||||
}
|
||||
self.frame = 0;
|
||||
}
|
||||
|
||||
player pl = (player)self;
|
||||
vector vPLAngle = pl.v_angle;
|
||||
if ( vPLAngle[0] < 0 ) {
|
||||
vPLAngle[0] = -10 + vPLAngle[0] * ((90 - 10) / 90.0);
|
||||
} else {
|
||||
vPLAngle[0] = -10 + vPLAngle[0] * ((90 + 10) / 90.0);
|
||||
}
|
||||
|
||||
float flVel = (90 - vPLAngle[0]) * 5;
|
||||
if ( flVel > 1000 ) {
|
||||
flVel = 1000;
|
||||
}
|
||||
|
||||
makevectors( vPLAngle );
|
||||
vector vecSrc = pl.origin + pl.view_ofs + v_forward * 16;
|
||||
vector vecThrow = v_forward * flVel + pl.velocity;
|
||||
|
||||
entity eGrenade = spawn();
|
||||
eGrenade.owner = pl;
|
||||
eGrenade.classname = "remove_me";
|
||||
eGrenade.solid = SOLID_BBOX;
|
||||
eGrenade.frame = 1;
|
||||
eGrenade.velocity = vecThrow;
|
||||
eGrenade.movetype = MOVETYPE_BOUNCE;
|
||||
eGrenade.think = flashbang_explode;
|
||||
eGrenade.touch = flashbang_touch;
|
||||
eGrenade.nextthink = time + 4.0f;
|
||||
setmodel( eGrenade, "models/w_flashbang.mdl" );
|
||||
setsize( eGrenade, [0,0,0], [0,0,0] );
|
||||
setorigin( eGrenade, vecSrc );
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
w_flashbang_primary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
|
||||
if (pl.w_attack_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* We're abusing this network variable for the holding check */
|
||||
if (pl.a_ammo3 > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Ammo check */
|
||||
#ifdef CSQC
|
||||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
|
||||
int r = (float)input_sequence % 3;
|
||||
switch (r) {
|
||||
case 0:
|
||||
Weapons_ViewAnimation(FLASHBANG_SHOOT1);
|
||||
break;
|
||||
case 1:
|
||||
Weapons_ViewAnimation(FLASHBANG_SHOOT2);
|
||||
break;
|
||||
default:
|
||||
Weapons_ViewAnimation(FLASHBANG_SHOOT3);
|
||||
break;
|
||||
if (pl.a_ammo2 <= 0) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
if (pl.ammo_fbgrenade <= 0) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
pl.w_attack_next = 0.0955f;
|
||||
Weapons_ViewAnimation(FLASHBANG_PULLPIN);
|
||||
|
||||
pl.a_ammo3 = 1;
|
||||
pl.w_attack_next = 0.975f;
|
||||
pl.w_idle_next = pl.w_attack_next;
|
||||
}
|
||||
|
||||
void
|
||||
w_flashbang_release(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
|
||||
if (pl.w_idle_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pl.a_ammo3 == 1) {
|
||||
#ifdef CSQC
|
||||
pl.a_ammo2--;
|
||||
Weapons_ViewAnimation(FLASHBANG_THROW);
|
||||
#else
|
||||
pl.ammo_fbgrenade--;
|
||||
w_flashbang_throw();
|
||||
#endif
|
||||
pl.a_ammo3 = 2;
|
||||
pl.w_attack_next = 1.0f;
|
||||
pl.w_idle_next = 0.5f;
|
||||
} else if (pl.a_ammo3 == 2) {
|
||||
#ifdef CSQC
|
||||
Weapons_ViewAnimation(FLASHBANG_DRAW);
|
||||
#else
|
||||
if (!pl.ammo_fbgrenade) {
|
||||
Weapons_RemoveItem(pl, WEAPON_FLASHBANG);
|
||||
}
|
||||
#endif
|
||||
pl.w_attack_next = 0.5f;
|
||||
pl.w_idle_next = 0.5f;
|
||||
pl.a_ammo3 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
float
|
||||
|
@ -170,12 +270,12 @@ weapon_t w_flashbang =
|
|||
w_flashbang_draw,
|
||||
__NULL__,
|
||||
w_flashbang_primary,
|
||||
__NULL__,
|
||||
__NULL__,
|
||||
__NULL__,
|
||||
w_flashbang_release,
|
||||
w_flashbang_release,
|
||||
w_flashbang_release,
|
||||
w_flashbang_hud,
|
||||
w_flashbang_precache,
|
||||
__NULL__,
|
||||
w_flashbang_pickup,
|
||||
w_flashbang_updateammo,
|
||||
w_flashbang_wmodel,
|
||||
w_flashbang_pmodel,
|
||||
|
|
|
@ -30,16 +30,18 @@ Price: $300
|
|||
|
||||
enum {
|
||||
HEGRENADE_IDLE,
|
||||
HEGRENADE_RELOAD,
|
||||
HEGRENADE_PULLPIN,
|
||||
HEGRENADE_THROW,
|
||||
HEGRENADE_DRAW,
|
||||
HEGRENADE_SHOOT1,
|
||||
HEGRENADE_SHOOT2,
|
||||
HEGRENADE_SHOOT3
|
||||
};
|
||||
|
||||
void
|
||||
w_hegrenade_precache(void)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Sound_Precache("weapon_hegrenade.bounce");
|
||||
Sound_Precache("weapon_hegrenade.explode");
|
||||
#endif
|
||||
precache_model("models/v_hegrenade.mdl");
|
||||
precache_model("models/w_hegrenade.mdl");
|
||||
precache_model("models/p_hegrenade.mdl");
|
||||
|
@ -49,10 +51,25 @@ void
|
|||
w_hegrenade_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, -1, -1, -1);
|
||||
Weapons_UpdateAmmo(pl, -1, pl.ammo_hegrenade, pl.a_ammo3);
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
w_hegrenade_pickup(int new)
|
||||
{
|
||||
#ifdef SSQC
|
||||
player pl = (player)self;
|
||||
|
||||
if (pl.ammo_hegrenade < 3) {
|
||||
pl.ammo_hegrenade = bound(0, pl.ammo_hegrenade + 1, 3);
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
string
|
||||
w_hegrenade_wmodel(void)
|
||||
{
|
||||
|
@ -74,39 +91,128 @@ w_hegrenade_deathmsg(void)
|
|||
void
|
||||
w_hegrenade_draw(void)
|
||||
{
|
||||
#ifdef CSQC
|
||||
Weapons_SetModel("models/v_hegrenade.mdl");
|
||||
Weapons_ViewAnimation(HEGRENADE_DRAW);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef SSQC
|
||||
void w_hegrenade_throw(void)
|
||||
{
|
||||
static void hegrenade_explode( void )
|
||||
{
|
||||
float dmg = 100;
|
||||
Effect_CreateExplosion(self.origin);
|
||||
Damage_Radius(self.origin, self.owner, dmg, dmg * 2.5f, TRUE, WEAPON_HEGRENADE);
|
||||
Sound_Play(self, CHAN_BODY, "weapon_hegrenade.explode");
|
||||
remove(self);
|
||||
}
|
||||
|
||||
static void hegrenade_touch( void )
|
||||
{
|
||||
if (other.takedamage == DAMAGE_YES) {
|
||||
Damage_Apply(other, self.owner, 15, WEAPON_HEGRENADE, DMG_BLUNT);
|
||||
} else {
|
||||
Sound_Play(self, CHAN_BODY, "weapon_hegrenade.bounce");
|
||||
}
|
||||
self.frame = 0;
|
||||
}
|
||||
|
||||
player pl = (player)self;
|
||||
vector vPLAngle = pl.v_angle;
|
||||
if ( vPLAngle[0] < 0 ) {
|
||||
vPLAngle[0] = -10 + vPLAngle[0] * ((90 - 10) / 90.0);
|
||||
} else {
|
||||
vPLAngle[0] = -10 + vPLAngle[0] * ((90 + 10) / 90.0);
|
||||
}
|
||||
|
||||
float flVel = (90 - vPLAngle[0]) * 5;
|
||||
if ( flVel > 1000 ) {
|
||||
flVel = 1000;
|
||||
}
|
||||
|
||||
makevectors( vPLAngle );
|
||||
vector vecSrc = pl.origin + pl.view_ofs + v_forward * 16;
|
||||
vector vecThrow = v_forward * flVel + pl.velocity;
|
||||
|
||||
entity eGrenade = spawn();
|
||||
eGrenade.owner = pl;
|
||||
eGrenade.classname = "remove_me";
|
||||
eGrenade.solid = SOLID_BBOX;
|
||||
eGrenade.frame = 1;
|
||||
eGrenade.velocity = vecThrow;
|
||||
eGrenade.movetype = MOVETYPE_BOUNCE;
|
||||
eGrenade.think = hegrenade_explode;
|
||||
eGrenade.touch = hegrenade_touch;
|
||||
eGrenade.nextthink = time + 4.0f;
|
||||
setmodel( eGrenade, "models/w_hegrenade.mdl" );
|
||||
setsize( eGrenade, [0,0,0], [0,0,0] );
|
||||
setorigin( eGrenade, vecSrc );
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
w_hegrenade_primary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
|
||||
if (pl.w_attack_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* We're abusing this network variable for the holding check */
|
||||
if (pl.a_ammo3 > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Ammo check */
|
||||
#ifdef CSQC
|
||||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
|
||||
int r = (float)input_sequence % 3;
|
||||
switch (r) {
|
||||
case 0:
|
||||
Weapons_ViewAnimation(HEGRENADE_SHOOT1);
|
||||
break;
|
||||
case 1:
|
||||
Weapons_ViewAnimation(HEGRENADE_SHOOT2);
|
||||
break;
|
||||
default:
|
||||
Weapons_ViewAnimation(HEGRENADE_SHOOT3);
|
||||
break;
|
||||
if (pl.a_ammo2 <= 0) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
if (pl.ammo_hegrenade <= 0) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
pl.w_attack_next = 0.0955f;
|
||||
Weapons_ViewAnimation(HEGRENADE_PULLPIN);
|
||||
|
||||
pl.a_ammo3 = 1;
|
||||
pl.w_attack_next = 0.975f;
|
||||
pl.w_idle_next = pl.w_attack_next;
|
||||
}
|
||||
|
||||
void
|
||||
w_hegrenade_release(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
|
||||
if (pl.w_idle_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pl.a_ammo3 == 1) {
|
||||
#ifdef CSQC
|
||||
pl.a_ammo2--;
|
||||
Weapons_ViewAnimation(HEGRENADE_THROW);
|
||||
#else
|
||||
pl.ammo_hegrenade--;
|
||||
w_hegrenade_throw();
|
||||
#endif
|
||||
pl.a_ammo3 = 2;
|
||||
pl.w_attack_next = 1.0f;
|
||||
pl.w_idle_next = 0.5f;
|
||||
} else if (pl.a_ammo3 == 2) {
|
||||
#ifdef CSQC
|
||||
Weapons_ViewAnimation(HEGRENADE_DRAW);
|
||||
#else
|
||||
if (!pl.ammo_hegrenade) {
|
||||
Weapons_RemoveItem(pl, WEAPON_HEGRENADE);
|
||||
}
|
||||
#endif
|
||||
pl.w_attack_next = 0.5f;
|
||||
pl.w_idle_next = 0.5f;
|
||||
pl.a_ammo3 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
float
|
||||
|
@ -167,12 +273,12 @@ weapon_t w_hegrenade =
|
|||
w_hegrenade_draw,
|
||||
__NULL__,
|
||||
w_hegrenade_primary,
|
||||
__NULL__,
|
||||
__NULL__,
|
||||
__NULL__,
|
||||
w_hegrenade_release,
|
||||
w_hegrenade_release,
|
||||
w_hegrenade_release,
|
||||
w_hegrenade_hud,
|
||||
w_hegrenade_precache,
|
||||
__NULL__,
|
||||
w_hegrenade_pickup,
|
||||
w_hegrenade_updateammo,
|
||||
w_hegrenade_wmodel,
|
||||
w_hegrenade_pmodel,
|
||||
|
|
|
@ -30,17 +30,16 @@ Price: $300
|
|||
|
||||
enum {
|
||||
SMOKEGRENADE_IDLE,
|
||||
SMOKEGRENADE_RELOAD,
|
||||
SMOKEGRENADE_PULLPIN,
|
||||
SMOKEGRENADE_THROW,
|
||||
SMOKEGRENADE_DRAW,
|
||||
SMOKEGRENADE_SHOOT1,
|
||||
SMOKEGRENADE_SHOOT2,
|
||||
SMOKEGRENADE_SHOOT3
|
||||
};
|
||||
|
||||
void
|
||||
w_smokegrenade_precache(void)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Sound_Precache("weapon_smokegrenade.bounce");
|
||||
Sound_Precache("weapon_smokegrenade.explode");
|
||||
#endif
|
||||
precache_model("models/v_smokegrenade.mdl");
|
||||
|
@ -52,10 +51,25 @@ void
|
|||
w_smokegrenade_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, -1, -1, -1);
|
||||
Weapons_UpdateAmmo(pl, -1, pl.ammo_smokegrenade, pl.a_ammo3);
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
w_smokegrenade_pickup(int new)
|
||||
{
|
||||
#ifdef SSQC
|
||||
player pl = (player)self;
|
||||
|
||||
if (pl.ammo_smokegrenade < 3) {
|
||||
pl.ammo_smokegrenade = bound(0, pl.ammo_smokegrenade + 1, 3);
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
string
|
||||
w_smokegrenade_wmodel(void)
|
||||
{
|
||||
|
@ -77,39 +91,124 @@ w_smokegrenade_deathmsg(void)
|
|||
void
|
||||
w_smokegrenade_draw(void)
|
||||
{
|
||||
#ifdef CSQC
|
||||
Weapons_SetModel("models/v_smokegrenade.mdl");
|
||||
Weapons_ViewAnimation(SMOKEGRENADE_DRAW);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef SSQC
|
||||
void w_smokegrenade_throw(void)
|
||||
{
|
||||
static void smokegrenade_explode( void )
|
||||
{
|
||||
Sound_Play(self, CHAN_BODY, "weapon_smokegrenade.explode");
|
||||
remove(self);
|
||||
}
|
||||
|
||||
static void smokegrenade_touch( void )
|
||||
{
|
||||
if (other.takedamage == DAMAGE_YES) {
|
||||
Damage_Apply(other, self.owner, 15, WEAPON_SMOKEGRENADE, DMG_BLUNT);
|
||||
} else {
|
||||
Sound_Play(self, CHAN_BODY, "weapon_smokegrenade.bounce");
|
||||
}
|
||||
self.frame = 0;
|
||||
}
|
||||
|
||||
player pl = (player)self;
|
||||
vector vPLAngle = pl.v_angle;
|
||||
if ( vPLAngle[0] < 0 ) {
|
||||
vPLAngle[0] = -10 + vPLAngle[0] * ((90 - 10) / 90.0);
|
||||
} else {
|
||||
vPLAngle[0] = -10 + vPLAngle[0] * ((90 + 10) / 90.0);
|
||||
}
|
||||
|
||||
float flVel = (90 - vPLAngle[0]) * 5;
|
||||
if ( flVel > 1000 ) {
|
||||
flVel = 1000;
|
||||
}
|
||||
|
||||
makevectors( vPLAngle );
|
||||
vector vecSrc = pl.origin + pl.view_ofs + v_forward * 16;
|
||||
vector vecThrow = v_forward * flVel + pl.velocity;
|
||||
|
||||
entity eGrenade = spawn();
|
||||
eGrenade.owner = pl;
|
||||
eGrenade.classname = "remove_me";
|
||||
eGrenade.solid = SOLID_BBOX;
|
||||
eGrenade.frame = 1;
|
||||
eGrenade.velocity = vecThrow;
|
||||
eGrenade.movetype = MOVETYPE_BOUNCE;
|
||||
eGrenade.think = smokegrenade_explode;
|
||||
eGrenade.touch = smokegrenade_touch;
|
||||
eGrenade.nextthink = time + 4.0f;
|
||||
setmodel( eGrenade, "models/w_smokegrenade.mdl" );
|
||||
setsize( eGrenade, [0,0,0], [0,0,0] );
|
||||
setorigin( eGrenade, vecSrc );
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
w_smokegrenade_primary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
|
||||
if (pl.w_attack_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* We're abusing this network variable for the holding check */
|
||||
if (pl.a_ammo3 > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Ammo check */
|
||||
#ifdef CSQC
|
||||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
|
||||
int r = (float)input_sequence % 3;
|
||||
switch (r) {
|
||||
case 0:
|
||||
Weapons_ViewAnimation(SMOKEGRENADE_SHOOT1);
|
||||
break;
|
||||
case 1:
|
||||
Weapons_ViewAnimation(SMOKEGRENADE_SHOOT2);
|
||||
break;
|
||||
default:
|
||||
Weapons_ViewAnimation(SMOKEGRENADE_SHOOT3);
|
||||
break;
|
||||
if (pl.a_ammo2 <= 0) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
if (pl.ammo_smokegrenade <= 0) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
pl.w_attack_next = 0.0955f;
|
||||
Weapons_ViewAnimation(SMOKEGRENADE_PULLPIN);
|
||||
pl.a_ammo3 = 1;
|
||||
pl.w_attack_next = 0.975f;
|
||||
pl.w_idle_next = pl.w_attack_next;
|
||||
}
|
||||
|
||||
void
|
||||
w_smokegrenade_release(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
|
||||
if (pl.w_idle_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pl.a_ammo3 == 1) {
|
||||
#ifdef CSQC
|
||||
pl.a_ammo2--;
|
||||
Weapons_ViewAnimation(SMOKEGRENADE_THROW);
|
||||
#else
|
||||
pl.ammo_smokegrenade--;
|
||||
w_smokegrenade_throw();
|
||||
#endif
|
||||
pl.a_ammo3 = 2;
|
||||
pl.w_attack_next = 1.0f;
|
||||
pl.w_idle_next = 0.5f;
|
||||
} else if (pl.a_ammo3 == 2) {
|
||||
#ifdef CSQC
|
||||
Weapons_ViewAnimation(SMOKEGRENADE_DRAW);
|
||||
#else
|
||||
if (!pl.ammo_smokegrenade) {
|
||||
Weapons_RemoveItem(pl, WEAPON_SMOKEGRENADE);
|
||||
}
|
||||
#endif
|
||||
pl.w_attack_next = 0.5f;
|
||||
pl.w_idle_next = 0.5f;
|
||||
pl.a_ammo3 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
float
|
||||
|
@ -169,12 +268,12 @@ weapon_t w_smokegrenade =
|
|||
w_smokegrenade_draw,
|
||||
__NULL__,
|
||||
w_smokegrenade_primary,
|
||||
__NULL__,
|
||||
__NULL__,
|
||||
__NULL__,
|
||||
w_smokegrenade_release,
|
||||
w_smokegrenade_release,
|
||||
w_smokegrenade_release,
|
||||
w_smokegrenade_hud,
|
||||
w_smokegrenade_precache,
|
||||
__NULL__,
|
||||
w_smokegrenade_pickup,
|
||||
w_smokegrenade_updateammo,
|
||||
w_smokegrenade_wmodel,
|
||||
w_smokegrenade_pmodel,
|
||||
|
|
|
@ -186,7 +186,6 @@ void w_handgrenade_hud(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
void w_handgrenade_release(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
|
|
Loading…
Reference in a new issue