-#ifdef REGISTER_WEAPON
+#ifndef IMPLEMENTATION
REGISTER_WEAPON(
/* WEP_##id */ VAPORIZER,
/* function */ W_Vaporizer,
.float vaporizer_lasthit;
.float jump_interval;
#endif
-#else
+#endif
+#ifdef IMPLEMENTATION
#ifdef SVQC
-void spawnfunc_weapon_vaporizer(void) { weapon_defaultspawnfunc(WEP_VAPORIZER); }
+void spawnfunc_weapon_vaporizer(void) { weapon_defaultspawnfunc(WEP_VAPORIZER.m_id); }
void spawnfunc_weapon_minstanex(void) { spawnfunc_weapon_vaporizer(); }
void W_Vaporizer_Attack(void)
yoda = 0;
damage_goodhits = 0;
- FireRailgunBullet(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 10000, 800, 0, 0, 0, 0, WEP_VAPORIZER);
+ FireRailgunBullet(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 10000, 800, 0, 0, 0, 0, WEP_VAPORIZER.m_id);
if(yoda && flying)
Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
self.vaporizer_lasthit = damage_goodhits;
- pointparticles(particleeffectnum("nex_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
+ Send_Effect("nex_muzzleflash", w_shotorg, w_shotdir * 1000, 1);
// teamcolor / hit beam effect
vector v;
{
case NUM_TEAM_1: // Red
if(damage_goodhits)
- WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3RED_HIT"), w_shotorg, v);
+ Send_Effect("TE_TEI_G3RED_HIT", w_shotorg, v, 1);
else
- WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3RED"), w_shotorg, v);
+ Send_Effect("TE_TEI_G3RED", w_shotorg, v, 1);
break;
case NUM_TEAM_2: // Blue
if(damage_goodhits)
- WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3BLUE_HIT"), w_shotorg, v);
+ Send_Effect("TE_TEI_G3BLUE_HIT", w_shotorg, v, 1);
else
- WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3BLUE"), w_shotorg, v);
+ Send_Effect("TE_TEI_G3BLUE", w_shotorg, v, 1);
break;
case NUM_TEAM_3: // Yellow
if(damage_goodhits)
- WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3YELLOW_HIT"), w_shotorg, v);
+ Send_Effect("TE_TEI_G3YELLOW_HIT", w_shotorg, v, 1);
else
- WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3YELLOW"), w_shotorg, v);
+ Send_Effect("TE_TEI_G3YELLOW", w_shotorg, v, 1);
break;
case NUM_TEAM_4: // Pink
if(damage_goodhits)
- WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3PINK_HIT"), w_shotorg, v);
+ Send_Effect("TE_TEI_G3PINK_HIT", w_shotorg, v, 1);
else
- WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3PINK"), w_shotorg, v);
+ Send_Effect("TE_TEI_G3PINK", w_shotorg, v, 1);
break;
default:
if(damage_goodhits)
- WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3_HIT"), w_shotorg, v);
+ Send_Effect("TE_TEI_G3_HIT", w_shotorg, v, 1);
else
- WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3"), w_shotorg, v);
+ Send_Effect("TE_TEI_G3", w_shotorg, v, 1);
break;
}
W_DecreaseAmmo(WEP_CVAR_SEC(vaporizer, ammo));
// ugly instagib hack to reuse the fire mode of the laser
+ int oldwep = self.weapon; // we can't avoid this hack
+ self.weapon = WEP_BLASTER.m_id;
W_Blaster_Attack(
- WEP_VAPORIZER | HITTYPE_SECONDARY,
+ WEP_BLASTER.m_id | HITTYPE_SECONDARY,
WEP_CVAR_SEC(vaporizer, shotangle),
WEP_CVAR_SEC(vaporizer, damage),
WEP_CVAR_SEC(vaporizer, edgedamage),
WEP_CVAR_SEC(vaporizer, delay),
WEP_CVAR_SEC(vaporizer, lifetime)
);
+ self.weapon = oldwep;
// now do normal refire
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(vaporizer, animtime), w_ready);
case WR_CHECKAMMO1:
{
ammo_amount = self.WEP_AMMO(VAPORIZER) >= vaporizer_ammo;
- ammo_amount += self.(weapon_load[WEP_VAPORIZER]) >= vaporizer_ammo;
+ ammo_amount += self.(weapon_load[WEP_VAPORIZER.m_id]) >= vaporizer_ammo;
return ammo_amount;
}
case WR_CHECKAMMO2:
if(!WEP_CVAR_SEC(vaporizer, ammo))
return true;
ammo_amount = self.WEP_AMMO(VAPORIZER) >= WEP_CVAR_SEC(vaporizer, ammo);
- ammo_amount += self.(weapon_load[WEP_VAPORIZER]) >= WEP_CVAR_SEC(vaporizer, ammo);
+ ammo_amount += self.(weapon_load[WEP_VAPORIZER.m_id]) >= WEP_CVAR_SEC(vaporizer, ammo);
return ammo_amount;
}
case WR_CONFIG: