#ifdef REGISTER_WEAPON
REGISTER_WEAPON(
-/* WEP_##id */ ELECTRO,
-/* function */ W_Electro,
-/* ammotype */ ammo_cells,
-/* impulse */ 5,
-/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
-/* rating */ BOT_PICKUP_RATING_MID,
-/* color */ '0 0.5 1',
-/* model */ "electro",
-/* netname */ "electro",
-/* fullname */ _("Electro")
+/* WEP_##id */ ELECTRO,
+/* function */ W_Electro,
+/* ammotype */ ammo_cells,
+/* impulse */ 5,
+/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
+/* rating */ BOT_PICKUP_RATING_MID,
+/* color */ '0 0.5 1',
+/* modelname */ "electro",
+/* simplemdl */ "foobar",
+/* crosshair */ "gfx/crosshairelectro 0.6",
+/* wepimg */ "weaponelectro",
+/* refname */ "electro",
+/* wepname */ _("Electro")
);
#define ELECTRO_SETTINGS(w_cvar,w_prop) ELECTRO_SETTINGS_LIST(w_cvar, w_prop, ELECTRO, electro)
w_prop(id, sn, float, switchdelay_drop, switchdelay_drop) \
w_prop(id, sn, string, weaponreplace, weaponreplace) \
w_prop(id, sn, float, weaponstart, weaponstart) \
- w_prop(id, sn, float, weaponstartoverride, weaponstartoverride)
+ w_prop(id, sn, float, weaponstartoverride, weaponstartoverride) \
+ w_prop(id, sn, float, weaponthrowable, weaponthrowable)
#ifdef SVQC
ELECTRO_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
#endif
#else
#ifdef SVQC
-void spawnfunc_weapon_electro() { weapon_defaultspawnfunc(WEP_ELECTRO); }
+void spawnfunc_weapon_electro(void) { weapon_defaultspawnfunc(WEP_ELECTRO); }
void W_Electro_TriggerCombo(vector org, float rad, entity own)
{
}
}
}
-
+
// change owner to whoever caused the combo explosion
e.realowner = own;
e.takedamage = DAMAGE_NO;
e.classname = "electro_orb_chain";
-
+
// now set the next one to trigger as well
e.think = W_Electro_ExplodeCombo;
-
+
// delay combo chains, looks cooler
e.nextthink =
(
W_Electro_TriggerCombo(self.origin, WEP_CVAR(electro, combo_comboradius), self.realowner);
self.event_damage = func_null;
-
+
RadiusDamage(
self,
self.realowner,
self.event_damage = func_null;
self.takedamage = DAMAGE_NO;
-
+
if(self.movetype == MOVETYPE_BOUNCE)
{
RadiusDamage(
W_Electro_Explode();
}
-void W_Electro_Bolt_Think()
+void W_Electro_Bolt_Think(void)
{
if(time >= self.ltime)
{
if(WEP_CVAR_PRI(electro, midaircombo_radius))
{
float found = 0;
- entity e = WarpZone_FindRadius(self.origin, WEP_CVAR_PRI(electro, midaircombo_radius), TRUE);
+ entity e = WarpZone_FindRadius(self.origin, WEP_CVAR_PRI(electro, midaircombo_radius), true);
// loop through nearby orbs and trigger them
while(e)
// now set the next one to trigger as well
e.think = W_Electro_ExplodeCombo;
-
+
// delay combo chains, looks cooler
e.nextthink =
(
W_DecreaseAmmo(WEP_CVAR_PRI(electro, ammo));
- W_SetupShot_ProjectileSize(self, '0 0 -3', '0 0 -3', FALSE, 2, "weapons/electro_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(electro, damage));
+ W_SetupShot_ProjectileSize(
+ self,
+ '0 0 -3',
+ '0 0 -3',
+ false,
+ 2,
+ "weapons/electro_fire.wav",
+ CH_WEAPON_A,
+ WEP_CVAR_PRI(electro, damage)
+ );
pointparticles(particleeffectnum("electro_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
- proj = spawn ();
+ proj = spawn();
proj.classname = "electro_bolt";
proj.owner = proj.realowner = self;
- proj.bot_dodge = TRUE;
+ proj.bot_dodge = true;
proj.bot_dodgerating = WEP_CVAR_PRI(electro, damage);
proj.use = W_Electro_Explode;
proj.think = W_Electro_Bolt_Think;
proj.flags = FL_PROJECTILE;
proj.missile_flags = MIF_SPLASH;
- CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO_BEAM, TRUE);
+ CSQCProjectile(proj, true, PROJECTILE_ELECTRO_BEAM, true);
other = proj; MUTATOR_CALLHOOK(EditProjectile);
}
}
}
-void W_Electro_Orb_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void W_Electro_Orb_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(self.health <= 0)
return;
{
W_DecreaseAmmo(WEP_CVAR_SEC(electro, ammo));
- W_SetupShot_ProjectileSize(self, '0 0 -4', '0 0 -4', FALSE, 2, "weapons/electro_fire2.wav", CH_WEAPON_A, WEP_CVAR_SEC(electro, damage));
+ W_SetupShot_ProjectileSize(
+ self,
+ '0 0 -4',
+ '0 0 -4',
+ false,
+ 2,
+ "weapons/electro_fire2.wav",
+ CH_WEAPON_A,
+ WEP_CVAR_SEC(electro, damage)
+ );
w_shotdir = v_forward; // no TrueAim for grenades please
proj.owner = proj.realowner = self;
proj.use = W_Electro_Explode;
proj.think = adaptor_think2use_hittype_splash;
- proj.bot_dodge = TRUE;
+ proj.bot_dodge = true;
proj.bot_dodgerating = WEP_CVAR_SEC(electro, damage);
proj.nextthink = time + WEP_CVAR_SEC(electro, lifetime);
PROJECTILE_MAKETRIGGER(proj);
setsize(p2, proj.mins, proj.maxs);
#endif
- CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO, FALSE); // no culling, it has sound
+ CSQCProjectile(proj, true, PROJECTILE_ELECTRO, false); // no culling, it has sound
other = proj; MUTATOR_CALLHOOK(EditProjectile);
}
-void W_Electro_CheckAttack()
+void W_Electro_CheckAttack(void)
{
if(self.electro_count > 1)
if(self.BUTTON_ATCK2)
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(electro, animtime), W_Electro_CheckAttack);
return;
}
- // WEAPONTODO: when the player releases the button, cut down the length of refire2?
+ // WEAPONTODO: when the player releases the button, cut down the length of refire2?
w_ready();
}
.float bot_secondary_electromooth;
-float W_Electro(float req)
+bool W_Electro(int req)
{
float ammo_amount;
switch(req)
{
case WR_AIM:
{
- self.BUTTON_ATCK = self.BUTTON_ATCK2 = FALSE;
+ self.BUTTON_ATCK = self.BUTTON_ATCK2 = false;
if(vlen(self.origin-self.enemy.origin) > 1000) { self.bot_secondary_electromooth = 0; }
if(self.bot_secondary_electromooth == 0)
{
float shoot;
if(WEP_CVAR_PRI(electro, speed))
- shoot = bot_aim(WEP_CVAR_PRI(electro, speed), 0, WEP_CVAR_PRI(electro, lifetime), FALSE);
+ shoot = bot_aim(WEP_CVAR_PRI(electro, speed), 0, WEP_CVAR_PRI(electro, lifetime), false);
else
- shoot = bot_aim(1000000, 0, 0.001, FALSE);
+ shoot = bot_aim(1000000, 0, 0.001, false);
if(shoot)
{
- self.BUTTON_ATCK = TRUE;
+ self.BUTTON_ATCK = true;
if(random() < 0.01) self.bot_secondary_electromooth = 1;
}
}
else
{
- if(bot_aim(WEP_CVAR_SEC(electro, speed), WEP_CVAR_SEC(electro, speed_up), WEP_CVAR_SEC(electro, lifetime), TRUE))
+ if(bot_aim(WEP_CVAR_SEC(electro, speed), WEP_CVAR_SEC(electro, speed_up), WEP_CVAR_SEC(electro, lifetime), true))
{
- self.BUTTON_ATCK2 = TRUE;
+ self.BUTTON_ATCK2 = true;
if(random() < 0.03) self.bot_secondary_electromooth = 0;
}
}
-
- return TRUE;
+
+ return true;
}
case WR_THINK:
{
if(!ammo_amount)
{
WEP_ACTION(self.weapon, WR_RELOAD);
- return FALSE;
+ return false;
}
-
- return TRUE;
+
+ return true;
}
-
+
if(self.BUTTON_ATCK)
{
if(weapon_prepareattack(0, WEP_CVAR_PRI(electro, refire)))
}
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/electro_fire2.wav");
precache_sound("weapons/electro_impact.wav");
precache_sound("weapons/electro_impact_combo.wav");
- ELECTRO_SETTINGS(WEP_SKIPCVAR, WEP_SET_PROP)
- return TRUE;
+ ELECTRO_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
+ return true;
}
case WR_CHECKAMMO1:
{
}
case WR_CONFIG:
{
- ELECTRO_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ ELECTRO_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
+ return true;
}
case WR_RESETPLAYER:
{
self.electro_secondarytime = time;
- return TRUE;
+ return true;
}
case WR_RELOAD:
{
W_Reload(min(WEP_CVAR_PRI(electro, ammo), WEP_CVAR_SEC(electro, ammo)), "weapons/reload.wav");
- return TRUE;
+ return true;
}
case WR_SUICIDEMESSAGE:
{
}
}
}
- return TRUE;
+ return false;
}
#endif
#ifdef CSQC
-float W_Electro(float req)
+bool W_Electro(int req)
{
switch(req)
{
sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTEN_NORM);
}
}
-
- return TRUE;
+
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/electro_impact.wav");
precache_sound("weapons/electro_impact_combo.wav");
- return TRUE;
+ return true;
}
case WR_ZOOMRETICLE:
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return false;
}
#endif
#endif