-#ifdef REGISTER_WEAPON
+#ifndef IMPLEMENTATION
REGISTER_WEAPON(
/* WEP_##id */ BLASTER,
/* function */ W_Blaster,
.float blaster_force;
.float blaster_lifetime;
#endif
-#else
+#endif
+#ifdef IMPLEMENTATION
#ifdef SVQC
-void spawnfunc_weapon_blaster(void) { weapon_defaultspawnfunc(WEP_BLASTER); }
+void spawnfunc_weapon_blaster(void) { weapon_defaultspawnfunc(WEP_BLASTER.m_id); }
void spawnfunc_weapon_laser(void) { spawnfunc_weapon_blaster(); }
void W_Blaster_Touch(void)
{
vector s_forward = v_forward * cos(atk_shotangle * DEG2RAD) + v_up * sin(atk_shotangle * DEG2RAD);
- W_SetupShot_Dir(self, s_forward, false, 3, "weapons/lasergun_fire.wav", CH_WEAPON_B, atk_damage);
- pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
+ W_SetupShot_Dir(self, s_forward, false, 3, W_Sound("lasergun_fire"), CH_WEAPON_B, atk_damage);
+ Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
entity missile = spawn();
missile.owner = missile.realowner = self;
missile.think = W_Blaster_Think;
missile.nextthink = time + atk_delay;
- other = missile; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, missile);
if(time >= missile.nextthink)
{
if(weapon_prepareattack(0, WEP_CVAR_PRI(blaster, refire)))
{
W_Blaster_Attack(
- WEP_BLASTER,
+ WEP_BLASTER.m_id,
WEP_CVAR_PRI(blaster, shotangle),
WEP_CVAR_PRI(blaster, damage),
WEP_CVAR_PRI(blaster, edgedamage),
{
case 0: // switch to last used weapon
{
- if(self.switchweapon == WEP_BLASTER) // don't do this if already switching
+ if(self.switchweapon == WEP_BLASTER.m_id) // don't do this if already switching
W_LastWeapon();
break;
}
if(weapon_prepareattack(1, WEP_CVAR_SEC(blaster, refire)))
{
W_Blaster_Attack(
- WEP_BLASTER | HITTYPE_SECONDARY,
+ WEP_BLASTER.m_id | HITTYPE_SECONDARY,
WEP_CVAR_SEC(blaster, shotangle),
WEP_CVAR_SEC(blaster, damage),
WEP_CVAR_SEC(blaster, edgedamage),
case WR_INIT:
{
- precache_model("models/weapons/g_laser.md3");
- precache_model("models/weapons/v_laser.md3");
- precache_model("models/weapons/h_laser.iqm");
- precache_sound("weapons/lasergun_fire.wav");
+ precache_model(W_Model("g_laser.md3"));
+ precache_model(W_Model("v_laser.md3"));
+ precache_model(W_Model("h_laser.iqm"));
+ precache_sound(W_Sound("lasergun_fire"));
BLASTER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
return true;
}
{
vector org2;
org2 = w_org + w_backoff * 6;
- pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1);
- if(!w_issilent) { sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM); }
+ pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1);
+ if(!w_issilent) { sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTN_NORM); }
return true;
}
case WR_INIT:
{
- precache_sound("weapons/laserimpact.wav");
+ precache_sound(W_Sound("laserimpact"));
return true;
}
case WR_ZOOMRETICLE: