#endif
#ifdef IMPLEMENTATION
#ifdef SVQC
-void spawnfunc_weapon_electro(void) { weapon_defaultspawnfunc(WEP_ELECTRO.m_id); }
+spawnfunc(weapon_electro) { weapon_defaultspawnfunc(WEP_ELECTRO.m_id); }
void W_Electro_TriggerCombo(vector org, float rad, entity own)
{
}
void W_Electro_ExplodeCombo(void)
-{
+{SELFPARAM();
W_Electro_TriggerCombo(self.origin, WEP_CVAR(electro, combo_comboradius), self.realowner);
self.event_damage = func_null;
}
void W_Electro_Explode(void)
-{
+{SELFPARAM();
if(other.takedamage == DAMAGE_AIM)
if(IS_PLAYER(other))
if(DIFF_TEAM(self.realowner, other))
}
void W_Electro_Bolt_Think(void)
-{
+{SELFPARAM();
if(time >= self.ltime)
{
self.use();
}
void W_Electro_Attack_Bolt(void)
-{
+{SELFPARAM();
entity proj;
W_DecreaseAmmo(WEP_CVAR_PRI(electro, ammo));
'0 0 -3',
false,
2,
- W_Sound("electro_fire"),
+ SND(ELECTRO_FIRE),
CH_WEAPON_A,
WEP_CVAR_PRI(electro, damage)
);
}
void W_Electro_Orb_Touch(void)
-{
+{SELFPARAM();
PROJECTILE_TOUCH;
if(other.takedamage == DAMAGE_AIM)
{ if(WEP_CVAR_SEC(electro, touchexplode)) { W_Electro_Explode(); } }
else
{
//UpdateCSQCProjectile(self);
- spamsound(self, CH_SHOTS, W_Sound("electro_bounce"), VOL_BASE, ATTEN_NORM);
+ spamsound(self, CH_SHOTS, SND(ELECTRO_BOUNCE), VOL_BASE, ATTEN_NORM);
self.projectiledeathtype |= HITTYPE_BOUNCE;
}
}
void W_Electro_Orb_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
-{
+{SELFPARAM();
if(self.health <= 0)
return;
}
void W_Electro_Attack_Orb(void)
-{
+{SELFPARAM();
W_DecreaseAmmo(WEP_CVAR_SEC(electro, ammo));
W_SetupShot_ProjectileSize(
'0 0 -4',
false,
2,
- W_Sound("electro_fire2"),
+ SND(ELECTRO_FIRE2),
CH_WEAPON_A,
WEP_CVAR_SEC(electro, damage)
);
entity p2;
p2 = spawn();
copyentity(proj, p2);
- setmodel(p2, "models/ebomb.mdl");
+ setmodel(p2, MDL_PROJECTILE_ELECTRO);
setsize(p2, proj.mins, proj.maxs);
#endif
}
void W_Electro_CheckAttack(void)
-{
+{SELFPARAM();
if(self.electro_count > 1)
if(self.BUTTON_ATCK2)
if(weapon_prepareattack(1, -1))
.float bot_secondary_electromooth;
bool W_Electro(int req)
-{
+{SELFPARAM();
float ammo_amount;
switch(req)
{
}
case WR_INIT:
{
- precache_model(W_Model("g_electro.md3"));
- precache_model(W_Model("v_electro.md3"));
- precache_model(W_Model("h_electro.iqm"));
- precache_sound(W_Sound("electro_bounce"));
- precache_sound(W_Sound("electro_fire"));
- precache_sound(W_Sound("electro_fire2"));
- precache_sound(W_Sound("electro_impact"));
- precache_sound(W_Sound("electro_impact_combo"));
ELECTRO_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
return true;
}
}
case WR_RELOAD:
{
- W_Reload(min(WEP_CVAR_PRI(electro, ammo), WEP_CVAR_SEC(electro, ammo)), W_Sound("reload"));
+ W_Reload(min(WEP_CVAR_PRI(electro, ammo), WEP_CVAR_SEC(electro, ammo)), SND(RELOAD));
return true;
}
case WR_SUICIDEMESSAGE:
#endif
#ifdef CSQC
bool W_Electro(int req)
-{
+{SELFPARAM();
switch(req)
{
case WR_IMPACTEFFECT:
{
pointparticles(particleeffectnum(EFFECT_ELECTRO_BALLEXPLODE), org2, '0 0 0', 1);
if(!w_issilent)
- sound(self, CH_SHOTS, W_Sound("electro_impact"), VOL_BASE, ATTEN_NORM);
+ sound(self, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_NORM);
}
else
{
// this is sent as "primary (w_deathtype & HITTYPE_BOUNCE)" to distinguish it from (w_deathtype & HITTYPE_SECONDARY) bounced balls
pointparticles(particleeffectnum(EFFECT_ELECTRO_COMBO), org2, '0 0 0', 1);
if(!w_issilent)
- sound(self, CH_SHOTS, W_Sound("electro_impact_combo"), VOL_BASE, ATTEN_NORM);
+ sound(self, CH_SHOTS, SND_ELECTRO_IMPACT_COMBO, VOL_BASE, ATTEN_NORM);
}
else
{
pointparticles(particleeffectnum(EFFECT_ELECTRO_IMPACT), org2, '0 0 0', 1);
if(!w_issilent)
- sound(self, CH_SHOTS, W_Sound("electro_impact"), VOL_BASE, ATTEN_NORM);
+ sound(self, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_NORM);
}
}
}
case WR_INIT:
{
- precache_sound(W_Sound("electro_impact"));
- precache_sound(W_Sound("electro_impact_combo"));
return true;
}
case WR_ZOOMRETICLE: