void M_Mage_Attack_Spike(vector dir);
void M_Mage_Attack_Push();
-METHOD(MageSpike, wr_think, bool(MageSpike thiswep, bool fire1, bool fire2)) {
+METHOD(MageSpike, wr_think, void(MageSpike thiswep, bool fire1, bool fire2)) {
SELFPARAM();
if (fire1)
if (!IS_PLAYER(self) || weapon_prepareattack(false, 0.2)) {
M_Mage_Attack_Push();
weapon_thinkf(WFRAME_FIRE2, 0, w_ready);
}
- return true;
}
void M_Mage_Attack_Teleport();
void M_Spider_Attack_Web();
-METHOD(SpiderAttack, wr_think, bool(SpiderAttack thiswep, bool fire1, bool fire2)) {
+METHOD(SpiderAttack, wr_think, void(SpiderAttack thiswep, bool fire1, bool fire2)) {
SELFPARAM();
bool isPlayer = IS_PLAYER(self);
if (fire1)
if (!isPlayer) w_shotdir = normalize((self.enemy.origin + '0 0 10') - self.origin);
M_Spider_Attack_Web();
weapon_thinkf(WFRAME_FIRE1, 0, w_ready);
- return true;
+ return;
}
if (fire2)
if (!isPlayer || weapon_prepareattack(true, 0.5)) {
Monster_Attack_Melee(self.enemy, (autocvar_g_monster_spider_attack_bite_damage), ((random() > 0.5) ? self.anim_melee : self.anim_shoot), self.attack_range, (autocvar_g_monster_spider_attack_bite_delay), DEATH_MONSTER_SPIDER, true);
weapon_thinkf(WFRAME_FIRE2, 0, w_ready);
}
- return true;
}
float autocvar_g_monster_spider_health;
Weapon wep = WEP_SPIDER_ATTACK;
case MONSTER_ATTACK_MELEE:
{
- return wep.wr_think(wep, false, true);
+ wep.wr_think(wep, false, true);
+ return true;
}
case MONSTER_ATTACK_RANGED:
{
- return wep.wr_think(wep, true, false);
+ wep.wr_think(wep, true, false);
+ return true;
}
}
void M_Wyvern_Attack_Fireball_Explode();
void M_Wyvern_Attack_Fireball_Touch();
-METHOD(WyvernAttack, wr_think, bool(WyvernAttack thiswep, bool fire1, bool fire2)) {
+METHOD(WyvernAttack, wr_think, void(WyvernAttack thiswep, bool fire1, bool fire2)) {
SELFPARAM();
if (fire1)
CSQCProjectile(missile, true, PROJECTILE_FIREMINE, true);
weapon_thinkf(WFRAME_FIRE1, 0, w_ready);
- return true;
}
- return true;
}
METHOD(WyvernAttack, wr_checkammo1, bool(WyvernAttack thiswep)) {
#ifdef SVQC
void turret_initparams(entity);
-METHOD(EWheelAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) {
+METHOD(EWheelAttack, wr_think, void(entity thiswep, bool fire1, bool fire2)) {
SELFPARAM();
bool isPlayer = IS_PLAYER(self);
if (fire1)
self.tur_head.frame = 0;
}
}
- return true;
}
#endif
#ifdef SVQC
void turret_flac_projectile_think_explode();
-METHOD(FlacAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) {
+METHOD(FlacAttack, wr_think, void(entity thiswep, bool fire1, bool fire2)) {
SELFPARAM();
bool isPlayer = IS_PLAYER(self);
if (fire1)
self.tur_head.frame = 0;
}
}
- return true;
}
void turret_flac_projectile_think_explode()
float autocvar_g_turrets_unit_hellion_shot_speed_max;
void turret_hellion_missile_think();
-METHOD(HellionAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) {
+METHOD(HellionAttack, wr_think, void(entity thiswep, bool fire1, bool fire2)) {
SELFPARAM();
bool isPlayer = IS_PLAYER(self);
if (fire1)
missile.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_HEAT;
if (!isPlayer) self.tur_head.frame += 1;
}
- return true;
}
void turret_hellion_missile_think()
float autocvar_g_turrets_unit_hk_shot_speed_turnrate;
void turret_hk_missile_think();
-METHOD(HunterKillerAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+METHOD(HunterKillerAttack, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
SELFPARAM();
bool isPlayer = IS_PLAYER(self);
if (self.tur_head.frame == 0)
self.tur_head.frame = self.tur_head.frame + 1;
}
- return true;
}
bool hk_is_valid_target(entity e_target);
void W_MachineGun_MuzzleFlash();
-METHOD(MachineGunTurretAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+METHOD(MachineGunTurretAttack, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
SELFPARAM();
bool isPlayer = IS_PLAYER(self);
W_MachineGun_MuzzleFlash();
setattachment(self.muzzle_flash, self.tur_head, "tag_fire");
}
- return true;
}
#endif
#ifdef SVQC
-METHOD(MLRSTurretAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+METHOD(MLRSTurretAttack, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
SELFPARAM();
bool isPlayer = IS_PLAYER(self);
missile.missile_flags = MIF_SPLASH;
te_explosion (missile.origin);
}
- return true;
}
#endif
.int fireflag;
-METHOD(PhaserTurretAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+METHOD(PhaserTurretAttack, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
SELFPARAM();
bool isPlayer = IS_PLAYER(self);
if (self.tur_head.frame == 0)
self.tur_head.frame = 1;
}
- return true;
}
void beam_think()
#ifdef SVQC
-METHOD(PlasmaAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) {
+METHOD(PlasmaAttack, wr_think, void(entity thiswep, bool fire1, bool fire2)) {
SELFPARAM();
bool isPlayer = IS_PLAYER(self);
if (fire1)
missile.missile_flags = MIF_SPLASH;
Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
}
- return true;
}
#endif
#ifdef SVQC
entity toast(entity from, float range, float damage);
-METHOD(TeslaCoilTurretAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) {
+METHOD(TeslaCoilTurretAttack, wr_think, void(entity thiswep, bool fire1, bool fire2)) {
SELFPARAM();
bool isPlayer = IS_PLAYER(self);
if (fire1)
entity t = toast(e,r,d);
remove(e);
- if (t == NULL) return true;
+ if (t == NULL) return;
self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_MISSILES | TFL_TARGETSELECT_TEAMCHECK;
}
}
- return true;
}
entity toast(entity from, float range, float damage)
#ifdef SVQC
-METHOD(WalkerTurretAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) {
+METHOD(WalkerTurretAttack, wr_think, void(entity thiswep, bool fire1, bool fire2)) {
SELFPARAM();
bool isPlayer = IS_PLAYER(self);
if (fire1)
fireBullet (self.tur_shotorg, self.tur_shotdir_updated, self.shot_spread, 0, self.shot_dmg, self.shot_force, DEATH_TURRET_WALK_GUN, 0);
Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
}
- return true;
}
#endif
float autocvar_g_vehicle_racer_rocket_locked_maxangle;
void racer_fire_rocket(vector org, vector dir, entity trg);
-METHOD(RacerAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+METHOD(RacerAttack, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
SELFPARAM();
bool isPlayer = IS_PLAYER(self);
weapon_thinkf(WFRAME_FIRE2, 0, w_ready);
}
setself(this);
- return true;
}
METHOD(RacerAttack, wr_checkammo1, bool(RacerAttack thiswep))
float autocvar_g_vehicle_raptor_bomblet_force;
float autocvar_g_vehicle_raptor_bomblet_explode_delay;
-METHOD(RaptorCannon, wr_think, bool(entity thiswep, bool fire1, bool fire2)) {
+METHOD(RaptorCannon, wr_think, void(entity thiswep, bool fire1, bool fire2)) {
SELFPARAM();
bool isPlayer = IS_PLAYER(self);
entity player = isPlayer ? self : self.owner;
weapon_thinkf(WFRAME_FIRE1, 0, w_ready);
}
setself(this);
- return true;
}
METHOD(RaptorCannon, wr_checkammo1, bool(RacerAttack thiswep)) {
SELFPARAM();
float autocvar_g_vehicle_raptor_bombs_refire;
void raptor_bombdrop();
-METHOD(RaptorBomb, wr_think, bool(entity thiswep, bool fire1, bool fire2)) {
+METHOD(RaptorBomb, wr_think, void(entity thiswep, bool fire1, bool fire2)) {
SELFPARAM();
bool isPlayer = IS_PLAYER(self);
entity player = isPlayer ? self : self.owner;
weapon_thinkf(WFRAME_FIRE1, 0, w_ready);
}
setself(this);
- return true;
}
float autocvar_g_vehicle_raptor_flare_refire;
void raptor_flare_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
void raptor_flare_touch();
-METHOD(RaptorFlare, wr_think, bool(entity thiswep, bool fire1, bool fire2)) {
+METHOD(RaptorFlare, wr_think, void(entity thiswep, bool fire1, bool fire2)) {
SELFPARAM();
bool isPlayer = IS_PLAYER(self);
entity player = isPlayer ? self : self.owner;
weapon_thinkf(WFRAME_FIRE2, 0, w_ready);
}
setself(this);
- return true;
}
ATTRIB(Weapon, message, string, "AOL CD Thrower");
/** (SERVER) setup weapon data */
- METHOD(Weapon, wr_setup, bool(Weapon this)) {return false;}
+ METHOD(Weapon, wr_setup, void(Weapon this)) {}
/** (SERVER) logic to run every frame */
- METHOD(Weapon, wr_think, bool(Weapon this, bool fire1, bool fire2)) {return false;}
+ METHOD(Weapon, wr_think, void(Weapon this, bool fire1, bool fire2)) {}
/** (SERVER) checks ammo for weapon primary */
METHOD(Weapon, wr_checkammo1, bool(Weapon this)) {return false;}
/** (SERVER) checks ammo for weapon second */
METHOD(Weapon, wr_checkammo2, bool(Weapon this)) {return false;}
/** (SERVER) runs bot aiming code for this weapon */
- METHOD(Weapon, wr_aim, bool(Weapon this)) {return false;}
+ METHOD(Weapon, wr_aim, void(Weapon this)) {}
/** (BOTH) precaches models/sounds used by this weapon, also sets up weapon properties */
- METHOD(Weapon, wr_init, bool(Weapon this)) {return false;}
+ METHOD(Weapon, wr_init, void(Weapon this)) {}
/** (SERVER) notification number for suicide message (may inspect w_deathtype for details) */
- METHOD(Weapon, wr_suicidemessage, bool(Weapon this)) {return false;}
+ METHOD(Weapon, wr_suicidemessage, int(Weapon this)) {return 0;}
/** (SERVER) notification number for kill message (may inspect w_deathtype for details) */
- METHOD(Weapon, wr_killmessage, bool(Weapon this)) {return false;}
+ METHOD(Weapon, wr_killmessage, int(Weapon this)) {return 0;}
/** (SERVER) handles reloading for weapon */
- METHOD(Weapon, wr_reload, bool(Weapon this)) {return false;}
+ METHOD(Weapon, wr_reload, void(Weapon this)) {}
/** (SERVER) clears fields that the weapon may use */
- METHOD(Weapon, wr_resetplayer, bool(Weapon this)) {return false;}
+ METHOD(Weapon, wr_resetplayer, void(Weapon this)) {}
/** (CLIENT) impact effect for weapon explosion */
- METHOD(Weapon, wr_impacteffect, bool(Weapon this)) {return false;}
+ METHOD(Weapon, wr_impacteffect, void(Weapon this)) {}
/** (SERVER) called whenever a player dies */
- METHOD(Weapon, wr_playerdeath, bool(Weapon this)) {return false;}
+ METHOD(Weapon, wr_playerdeath, void(Weapon this)) {}
/** (SERVER) logic to run when weapon is lost */
- METHOD(Weapon, wr_gonethink, bool(Weapon this)) {return false;}
+ METHOD(Weapon, wr_gonethink, void(Weapon this)) {}
/** (ALL) dump weapon cvars to config in data directory (see: sv_cmd dumpweapons) */
- METHOD(Weapon, wr_config, bool(Weapon this)) {return false;}
+ METHOD(Weapon, wr_config, void(Weapon this)) {}
/** (CLIENT) weapon specific zoom reticle */
- METHOD(Weapon, wr_zoomreticle, bool(Weapon this)) {return false;}
+ METHOD(Weapon, wr_zoomreticle, bool(Weapon this)) {
+ // no weapon specific image for this weapon
+ return false;
+ }
/** (SERVER) the weapon is dropped */
- METHOD(Weapon, wr_drop, bool(Weapon this)) {return false;}
+ METHOD(Weapon, wr_drop, void(Weapon this)) {}
/** (SERVER) a weapon is picked up */
- METHOD(Weapon, wr_pickup, bool(Weapon this)) {return false;}
+ METHOD(Weapon, wr_pickup, void(Weapon this)) {}
METHOD(Weapon, display, void(entity this, void(string name, string icon) returns)) {
returns(this.message, this.model2 ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.model2) : string_null);
}
}
- METHOD(Arc, wr_aim, bool(entity thiswep))
+ METHOD(Arc, wr_aim, void(entity thiswep))
{
SELFPARAM();
if(WEP_CVAR(arc, beam_botaimspeed))
false
);
}
- return true;
}
- METHOD(Arc, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(Arc, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
SELFPARAM();
Arc_Player_SetHeat(self);
}
}
- return true;
+ return;
}
if(self.arc_BUTTON_ATCK_prev)
self.arc_secondarytime = time + autocvar_g_balance_arc_secondary_refire2 * W_WeaponRateFactor();
}
#endif
-
- return true;
}
- METHOD(Arc, wr_init, bool(entity thiswep))
+ METHOD(Arc, wr_init, void(entity thiswep))
{
if(!arc_shotorigin[0])
{
arc_shotorigin[3] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC.m_id), false, false, 4);
}
ARC_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
METHOD(Arc, wr_checkammo1, bool(entity thiswep))
{
return WEP_CVAR(arc, overheat_max) > 0 &&
((!WEP_CVAR(arc, burst_ammo)) || (self.WEP_AMMO(ARC) > 0));
}
- METHOD(Arc, wr_config, bool(entity thiswep))
+ METHOD(Arc, wr_config, void(entity thiswep))
{
ARC_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(Arc, wr_killmessage, bool(entity thiswep))
+ METHOD(Arc, wr_killmessage, int(entity thiswep))
{
return WEAPON_ARC_MURDER;
}
- METHOD(Arc, wr_drop, bool(entity thiswep))
+ METHOD(Arc, wr_drop, void(entity thiswep))
{
weapon_dropevent_item.arc_overheat = self.arc_overheat;
weapon_dropevent_item.arc_cooldown = self.arc_cooldown;
self.arc_overheat = 0;
self.arc_cooldown = 0;
- return true;
}
- METHOD(Arc, wr_pickup, bool(entity thiswep))
+ METHOD(Arc, wr_pickup, void(entity thiswep))
{
if ( !client_hasweapon(self, WEP_ARC.m_id, false, false) &&
weapon_dropevent_item.arc_overheat > time )
self.arc_overheat = weapon_dropevent_item.arc_overheat;
self.arc_cooldown = weapon_dropevent_item.arc_cooldown;
}
- return true;
}
#endif
#ifdef CSQC
}
}
- METHOD(Arc, wr_impacteffect, bool(entity thiswep))
- {
- // todo
- return true;
- }
- METHOD(Arc, wr_init, bool(entity thiswep))
- {
- return true;
- }
- METHOD(Arc, wr_zoomreticle, bool(entity thiswep))
- {
- // no weapon specific image for this weapon
- return false;
- }
#endif
#endif
}
}
- METHOD(Blaster, wr_aim, bool(entity thiswep))
+ METHOD(Blaster, wr_aim, void(entity thiswep))
{
if(WEP_CVAR(blaster, secondary))
{
}
else
{ self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); }
-
- return true;
}
- METHOD(Blaster, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(Blaster, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
if(fire1)
{
}
}
}
- return true;
}
- METHOD(Blaster, wr_init, bool(entity thiswep))
+ METHOD(Blaster, wr_init, void(entity thiswep))
{
BLASTER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
- METHOD(Blaster, wr_setup, bool(entity thiswep))
+ METHOD(Blaster, wr_setup, void(entity thiswep))
{
self.ammo_field = ammo_none;
- return true;
}
METHOD(Blaster, wr_checkammo1, bool(entity thiswep))
return true; // blaster has infinite ammo
}
- METHOD(Blaster, wr_config, bool(entity thiswep))
+ METHOD(Blaster, wr_config, void(entity thiswep))
{
BLASTER_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(Blaster, wr_suicidemessage, bool(entity thiswep))
+ METHOD(Blaster, wr_suicidemessage, int(entity thiswep))
{
return WEAPON_BLASTER_SUICIDE;
}
- METHOD(Blaster, wr_killmessage, bool(entity thiswep))
+ METHOD(Blaster, wr_killmessage, int(entity thiswep))
{
return WEAPON_BLASTER_MURDER;
}
#endif
#ifdef CSQC
- METHOD(Blaster, wr_impacteffect, bool(entity thiswep))
+ METHOD(Blaster, wr_impacteffect, void(entity thiswep))
{
vector org2;
org2 = w_org + w_backoff * 6;
pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1);
if(!w_issilent) { sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); }
- return true;
- }
-
- METHOD(Blaster, wr_init, bool(entity thiswep))
- {
- return true;
- }
-
- METHOD(Blaster, wr_zoomreticle, bool(entity thiswep))
- {
- // no weapon specific image for this weapon
- return false;
}
#endif
}
}
- METHOD(Crylink, wr_aim, bool(entity thiswep))
+ METHOD(Crylink, wr_aim, void(entity thiswep))
{
SELFPARAM();
if(random() < 0.10)
self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(crylink, speed), 0, WEP_CVAR_PRI(crylink, middle_lifetime), false);
else
self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(crylink, speed), 0, WEP_CVAR_SEC(crylink, middle_lifetime), false);
-
- return true;
}
- METHOD(Crylink, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(Crylink, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
SELFPARAM();
if(autocvar_g_balance_crylink_reload_ammo && self.clip_load < min(WEP_CVAR_PRI(crylink, ammo), WEP_CVAR_SEC(crylink, ammo))) { // forced reload
}
}
}
-
- return true;
}
- METHOD(Crylink, wr_init, bool(entity thiswep))
+ METHOD(Crylink, wr_init, void(entity thiswep))
{
CRYLINK_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
METHOD(Crylink, wr_checkammo1, bool(entity thiswep))
{
ammo_amount += self.(weapon_load[WEP_CRYLINK.m_id]) >= WEP_CVAR_SEC(crylink, ammo);
return ammo_amount;
}
- METHOD(Crylink, wr_config, bool(entity thiswep))
+ METHOD(Crylink, wr_config, void(entity thiswep))
{
CRYLINK_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(Crylink, wr_reload, bool(entity thiswep))
+ METHOD(Crylink, wr_reload, void(entity thiswep))
{
W_Reload(min(WEP_CVAR_PRI(crylink, ammo), WEP_CVAR_SEC(crylink, ammo)), SND(RELOAD));
- return true;
}
- METHOD(Crylink, wr_suicidemessage, bool(entity thiswep))
+ METHOD(Crylink, wr_suicidemessage, int(entity thiswep))
{
return WEAPON_CRYLINK_SUICIDE;
}
- METHOD(Crylink, wr_killmessage, bool(entity thiswep))
+ METHOD(Crylink, wr_killmessage, int(entity thiswep))
{
return WEAPON_CRYLINK_MURDER;
}
#endif
#ifdef CSQC
- METHOD(Crylink, wr_impacteffect, bool(entity thiswep))
+ METHOD(Crylink, wr_impacteffect, void(entity thiswep))
{
SELFPARAM();
vector org2;
if(!w_issilent)
sound(self, CH_SHOTS, SND_CRYLINK_IMPACT, VOL_BASE, ATTN_NORM);
}
-
- return true;
- }
- METHOD(Crylink, wr_init, bool(entity thiswep))
- {
- return true;
- }
- METHOD(Crylink, wr_zoomreticle, bool(entity thiswep))
- {
- // no weapon specific image for this weapon
- return false;
}
#endif
#endif
}
#if 0
- METHOD(Devastator, wr_aim, bool(entity thiswep))
+ METHOD(Devastator, wr_aim, void(entity thiswep))
{
// aim and decide to fire if appropriate
self.BUTTON_ATCK = bot_aim(WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
if(self.BUTTON_ATCK2) self.BUTTON_ATCK = false;
}
-
- return true;
}
#else
- METHOD(Devastator, wr_aim, bool(entity thiswep))
+ METHOD(Devastator, wr_aim, void(entity thiswep))
{
// aim and decide to fire if appropriate
self.BUTTON_ATCK = bot_aim(WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
// dprint(ftos(desirabledamage),"\n");
if(self.BUTTON_ATCK2 == true) self.BUTTON_ATCK = false;
}
-
- return true;
}
#endif
- METHOD(Devastator, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(Devastator, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
if(WEP_CVAR(devastator, reload_ammo) && self.clip_load < WEP_CVAR(devastator, ammo)) { // forced reload
Weapon w = get_weaponinfo(self.weapon);
sound(self, CH_WEAPON_B, SND_ROCKET_DET, VOL_BASE, ATTN_NORM);
}
}
-
- return true;
}
- METHOD(Devastator, wr_init, bool(entity thiswep))
+ METHOD(Devastator, wr_init, void(entity thiswep))
{
DEVASTATOR_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
- METHOD(Devastator, wr_setup, bool(entity thiswep))
+ METHOD(Devastator, wr_setup, void(entity thiswep))
{
self.rl_release = 1;
- return true;
}
METHOD(Devastator, wr_checkammo1, bool(entity thiswep))
{
{
return false;
}
- METHOD(Devastator, wr_config, bool(entity thiswep))
+ METHOD(Devastator, wr_config, void(entity thiswep))
{
DEVASTATOR_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(Devastator, wr_resetplayer, bool(entity thiswep))
+ METHOD(Devastator, wr_resetplayer, void(entity thiswep))
{
self.rl_release = 0;
- return true;
}
- METHOD(Devastator, wr_reload, bool(entity thiswep))
+ METHOD(Devastator, wr_reload, void(entity thiswep))
{
W_Reload(WEP_CVAR(devastator, ammo), SND(RELOAD));
- return true;
}
- METHOD(Devastator, wr_suicidemessage, bool(entity thiswep))
+ METHOD(Devastator, wr_suicidemessage, int(entity thiswep))
{
return WEAPON_DEVASTATOR_SUICIDE;
}
- METHOD(Devastator, wr_killmessage, bool(entity thiswep))
+ METHOD(Devastator, wr_killmessage, int(entity thiswep))
{
if((w_deathtype & HITTYPE_BOUNCE) || (w_deathtype & HITTYPE_SPLASH))
return WEAPON_DEVASTATOR_MURDER_SPLASH;
#endif
#ifdef CSQC
- METHOD(Devastator, wr_impacteffect, bool(entity thiswep))
+ METHOD(Devastator, wr_impacteffect, void(entity thiswep))
{
vector org2;
org2 = w_org + w_backoff * 12;
pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTN_NORM);
-
- return true;
- }
- METHOD(Devastator, wr_init, bool(entity thiswep))
- {
- return true;
- }
- METHOD(Devastator, wr_zoomreticle, bool(entity thiswep))
- {
- // no weapon specific image for this weapon
- return false;
}
#endif
.float bot_secondary_electromooth;
- METHOD(Electro, wr_aim, bool(entity thiswep))
+ METHOD(Electro, wr_aim, void(entity thiswep))
{
self.BUTTON_ATCK = self.BUTTON_ATCK2 = false;
if(vlen(self.origin-self.enemy.origin) > 1000) { self.bot_secondary_electromooth = 0; }
if(random() < 0.03) self.bot_secondary_electromooth = 0;
}
}
-
- return true;
}
- METHOD(Electro, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(Electro, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
if(autocvar_g_balance_electro_reload_ammo) // forced reload // WEAPONTODO
{
{
Weapon w = get_weaponinfo(self.weapon);
w.wr_reload(w);
- return false;
+ return;
}
-
- return true;
}
if(fire1)
self.electro_secondarytime = time + WEP_CVAR_SEC(electro, refire2) * W_WeaponRateFactor();
}
}
-
- return true;
}
- METHOD(Electro, wr_init, bool(entity thiswep))
+ METHOD(Electro, wr_init, void(entity thiswep))
{
ELECTRO_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
METHOD(Electro, wr_checkammo1, bool(entity thiswep))
{
}
return ammo_amount;
}
- METHOD(Electro, wr_config, bool(entity thiswep))
+ METHOD(Electro, wr_config, void(entity thiswep))
{
ELECTRO_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(Electro, wr_resetplayer, bool(entity thiswep))
+ METHOD(Electro, wr_resetplayer, void(entity thiswep))
{
self.electro_secondarytime = time;
- return true;
}
- METHOD(Electro, wr_reload, bool(entity thiswep))
+ METHOD(Electro, wr_reload, void(entity thiswep))
{
W_Reload(min(WEP_CVAR_PRI(electro, ammo), WEP_CVAR_SEC(electro, ammo)), SND(RELOAD));
- return true;
}
- METHOD(Electro, wr_suicidemessage, bool(entity thiswep))
+ METHOD(Electro, wr_suicidemessage, int(entity thiswep))
{
if(w_deathtype & HITTYPE_SECONDARY)
return WEAPON_ELECTRO_SUICIDE_ORBS;
else
return WEAPON_ELECTRO_SUICIDE_BOLT;
}
- METHOD(Electro, wr_killmessage, bool(entity thiswep))
+ METHOD(Electro, wr_killmessage, int(entity thiswep))
{
if(w_deathtype & HITTYPE_SECONDARY)
{
#endif
#ifdef CSQC
- METHOD(Electro, wr_impacteffect, bool(entity thiswep))
+ METHOD(Electro, wr_impacteffect, void(entity thiswep))
{
vector org2;
org2 = w_org + w_backoff * 6;
sound(self, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_NORM);
}
}
-
- return true;
- }
- METHOD(Electro, wr_init, bool(entity thiswep))
- {
- return true;
- }
- METHOD(Electro, wr_zoomreticle, bool(entity thiswep))
- {
- // no weapon specific image for this weapon
- return false;
}
#endif
MUTATOR_CALLHOOK(EditProjectile, self, proj);
}
- METHOD(Fireball, wr_aim, bool(entity thiswep))
+ METHOD(Fireball, wr_aim, void(entity thiswep))
{
self.BUTTON_ATCK = false;
self.BUTTON_ATCK2 = false;
if(random() < 0.01) self.bot_primary_fireballmooth = 1;
}
}
-
- return true;
}
- METHOD(Fireball, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(Fireball, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
if(fire1)
{
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(fireball, animtime), w_ready);
}
}
-
- return true;
}
- METHOD(Fireball, wr_init, bool(entity thiswep))
+ METHOD(Fireball, wr_init, void(entity thiswep))
{
FIREBALL_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
- METHOD(Fireball, wr_setup, bool(entity thiswep))
+ METHOD(Fireball, wr_setup, void(entity thiswep))
{
self.ammo_field = ammo_none;
- return true;
}
METHOD(Fireball, wr_checkammo1, bool(entity thiswep))
{
{
return true; // fireball has infinite ammo
}
- METHOD(Fireball, wr_config, bool(entity thiswep))
+ METHOD(Fireball, wr_config, void(entity thiswep))
{
FIREBALL_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(Fireball, wr_resetplayer, bool(entity thiswep))
+ METHOD(Fireball, wr_resetplayer, void(entity thiswep))
{
self.fireball_primarytime = time;
- return true;
}
- METHOD(Fireball, wr_suicidemessage, bool(entity thiswep))
+ METHOD(Fireball, wr_suicidemessage, int(entity thiswep))
{
if(w_deathtype & HITTYPE_SECONDARY)
return WEAPON_FIREBALL_SUICIDE_FIREMINE;
else
return WEAPON_FIREBALL_SUICIDE_BLAST;
}
- METHOD(Fireball, wr_killmessage, bool(entity thiswep))
+ METHOD(Fireball, wr_killmessage, int(entity thiswep))
{
if(w_deathtype & HITTYPE_SECONDARY)
return WEAPON_FIREBALL_MURDER_FIREMINE;
#endif
#ifdef CSQC
- METHOD(Fireball, wr_impacteffect, bool(entity thiswep))
+ METHOD(Fireball, wr_impacteffect, void(entity thiswep))
{
vector org2;
if(w_deathtype & HITTYPE_SECONDARY)
if(!w_issilent)
sound(self, CH_SHOTS, SND_FIREBALL_IMPACT2, VOL_BASE, ATTEN_NORM * 0.25); // long range boom
}
-
- return true;
- }
- METHOD(Fireball, wr_init, bool(entity thiswep))
- {
- return true;
- }
- METHOD(Fireball, wr_zoomreticle, bool(entity thiswep))
- {
- // no weapon specific image for this weapon
- return false;
}
#endif
}
}
- METHOD(Hagar, wr_aim, bool(entity thiswep))
+ METHOD(Hagar, wr_aim, void(entity thiswep))
{
if(random()>0.15)
self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
else // not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming
self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
-
- return true;
}
- METHOD(Hagar, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(Hagar, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
float loadable_secondary;
loadable_secondary = (WEP_CVAR_SEC(hagar, load) && WEP_CVAR(hagar, secondary));
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(hagar, refire), w_ready);
}
}
- return true;
}
- METHOD(Hagar, wr_gonethink, bool(entity thiswep))
+ METHOD(Hagar, wr_gonethink, void(entity thiswep))
{
// we lost the weapon and want to prepare switching away
if(self.hagar_load)
self.weaponentity.state = WS_READY;
W_Hagar_Attack2_Load_Release();
}
-
- return true;
}
- METHOD(Hagar, wr_init, bool(entity thiswep))
+ METHOD(Hagar, wr_init, void(entity thiswep))
{
HAGAR_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
- METHOD(Hagar, wr_setup, bool(entity thiswep))
+ METHOD(Hagar, wr_setup, void(entity thiswep))
{
self.hagar_loadblock = false;
W_DecreaseAmmo(thiswep, WEP_CVAR_SEC(hagar, ammo) * self.hagar_load * -1); // give back ammo if necessary
self.hagar_load = 0;
}
-
- return true;
}
METHOD(Hagar, wr_checkammo1, bool(entity thiswep))
{
ammo_amount += self.(weapon_load[WEP_HAGAR.m_id]) >= WEP_CVAR_SEC(hagar, ammo);
return ammo_amount;
}
- METHOD(Hagar, wr_config, bool(entity thiswep))
+ METHOD(Hagar, wr_config, void(entity thiswep))
{
HAGAR_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(Hagar, wr_resetplayer, bool(entity thiswep))
+ METHOD(Hagar, wr_resetplayer, void(entity thiswep))
{
self.hagar_load = 0;
- return true;
}
- METHOD(Hagar, wr_playerdeath, bool(entity thiswep))
+ METHOD(Hagar, wr_playerdeath, void(entity thiswep))
{
// if we have any rockets loaded when we die, release them
if(self.hagar_load && WEP_CVAR_SEC(hagar, load_releasedeath))
W_Hagar_Attack2_Load_Release();
-
- return true;
}
- METHOD(Hagar, wr_reload, bool(entity thiswep))
+ METHOD(Hagar, wr_reload, void(entity thiswep))
{
if(!self.hagar_load) // require releasing loaded rockets first
W_Reload(min(WEP_CVAR_PRI(hagar, ammo), WEP_CVAR_SEC(hagar, ammo)), SND(RELOAD));
-
- return true;
}
- METHOD(Hagar, wr_suicidemessage, bool(entity thiswep))
+ METHOD(Hagar, wr_suicidemessage, int(entity thiswep))
{
return WEAPON_HAGAR_SUICIDE;
}
- METHOD(Hagar, wr_killmessage, bool(entity thiswep))
+ METHOD(Hagar, wr_killmessage, int(entity thiswep))
{
if(w_deathtype & HITTYPE_SECONDARY)
return WEAPON_HAGAR_MURDER_BURST;
#endif
#ifdef CSQC
- METHOD(Hagar, wr_impacteffect, bool(entity thiswep))
+ METHOD(Hagar, wr_impacteffect, void(entity thiswep))
{
vector org2;
org2 = w_org + w_backoff * 6;
else
sound(self, CH_SHOTS, SND_HAGEXP3, VOL_BASE, ATTN_NORM);
}
-
- return true;
- }
- METHOD(Hagar, wr_init, bool(entity thiswep))
- {
- return true;
- }
- METHOD(Hagar, wr_zoomreticle, bool(entity thiswep))
- {
- // no weapon specific image for this weapon
- return false;
}
#endif
}
}
- METHOD(HLAC, wr_aim, bool(entity thiswep))
+ METHOD(HLAC, wr_aim, void(entity thiswep))
{
self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(hlac, speed), 0, WEP_CVAR_PRI(hlac, lifetime), false);
- return true;
}
- METHOD(HLAC, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(HLAC, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
if(autocvar_g_balance_hlac_reload_ammo && self.clip_load < min(WEP_CVAR_PRI(hlac, ammo), WEP_CVAR_SEC(hlac, ammo))) { // forced reload
Weapon w = get_weaponinfo(self.weapon);
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(hlac, animtime), w_ready);
}
}
-
- return true;
}
- METHOD(HLAC, wr_init, bool(entity thiswep))
+ METHOD(HLAC, wr_init, void(entity thiswep))
{
HLAC_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
METHOD(HLAC, wr_checkammo1, bool(entity thiswep))
{
ammo_amount += self.(weapon_load[WEP_HLAC.m_id]) >= WEP_CVAR_SEC(hlac, ammo);
return ammo_amount;
}
- METHOD(HLAC, wr_config, bool(entity thiswep))
+ METHOD(HLAC, wr_config, void(entity thiswep))
{
HLAC_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(HLAC, wr_reload, bool(entity thiswep))
+ METHOD(HLAC, wr_reload, void(entity thiswep))
{
W_Reload(min(WEP_CVAR_PRI(hlac, ammo), WEP_CVAR_SEC(hlac, ammo)), SND(RELOAD));
- return true;
}
- METHOD(HLAC, wr_suicidemessage, bool(entity thiswep))
+ METHOD(HLAC, wr_suicidemessage, int(entity thiswep))
{
return WEAPON_HLAC_SUICIDE;
}
- METHOD(HLAC, wr_killmessage, bool(entity thiswep))
+ METHOD(HLAC, wr_killmessage, int(entity thiswep))
{
return WEAPON_HLAC_MURDER;
}
#endif
#ifdef CSQC
- METHOD(HLAC, wr_impacteffect, bool(entity thiswep))
+ METHOD(HLAC, wr_impacteffect, void(entity thiswep))
{
vector org2;
org2 = w_org + w_backoff * 6;
pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1);
if(!w_issilent)
sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM);
-
- return true;
- }
- METHOD(HLAC, wr_init, bool(entity thiswep))
- {
- return true;
- }
- METHOD(HLAC, wr_zoomreticle, bool(entity thiswep))
- {
- // no weapon specific image for this weapon
- return false;
}
#endif
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR(hmg, refire), W_HeavyMachineGun_Attack_Auto);
}
- METHOD(HeavyMachineGun, wr_aim, bool(entity thiswep))
+ METHOD(HeavyMachineGun, wr_aim, void(entity thiswep))
{
if(vlen(self.origin-self.enemy.origin) < 3000 - bound(0, skill, 10) * 200)
self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false);
else
self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false);
-
- return true;
}
- METHOD(HeavyMachineGun, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(HeavyMachineGun, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
if(WEP_CVAR(hmg, reload_ammo) && self.clip_load < WEP_CVAR(hmg, ammo)) { // forced reload
Weapon w = get_weaponinfo(self.weapon);
W_HeavyMachineGun_Attack_Auto(thiswep, fire1, fire2);
}
}
-
- return true;
}
- METHOD(HeavyMachineGun, wr_init, bool(entity thiswep))
+ METHOD(HeavyMachineGun, wr_init, void(entity thiswep))
{
HMG_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
METHOD(HeavyMachineGun, wr_checkammo1, bool(entity thiswep))
{
return ammo_amount;
}
- METHOD(HeavyMachineGun, wr_config, bool(entity thiswep))
+ METHOD(HeavyMachineGun, wr_config, void(entity thiswep))
{
HMG_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(HeavyMachineGun, wr_reload, bool(entity thiswep))
+ METHOD(HeavyMachineGun, wr_reload, void(entity thiswep))
{
W_Reload(WEP_CVAR(hmg, ammo), SND(RELOAD));
- return true;
}
- METHOD(HeavyMachineGun, wr_suicidemessage, bool(entity thiswep))
+ METHOD(HeavyMachineGun, wr_suicidemessage, int(entity thiswep))
{
return WEAPON_THINKING_WITH_PORTALS;
}
- METHOD(HeavyMachineGun, wr_killmessage, bool(entity thiswep))
+ METHOD(HeavyMachineGun, wr_killmessage, int(entity thiswep))
{
if(w_deathtype & HITTYPE_SECONDARY)
return WEAPON_HMG_MURDER_SNIPE;
#endif
#ifdef CSQC
- METHOD(HeavyMachineGun, wr_impacteffect, bool(entity thiswep))
+ METHOD(HeavyMachineGun, wr_impacteffect, void(entity thiswep))
{
vector org2;
org2 = w_org + w_backoff * 2;
sound(self, CH_SHOTS, SND_RIC2, VOL_BASE, ATTEN_NORM);
else if(w_random < 0.2)
sound(self, CH_SHOTS, SND_RIC3, VOL_BASE, ATTEN_NORM);
-
- return true;
- }
- METHOD(HeavyMachineGun, wr_init, bool(entity thiswep))
- {
- return true;
- }
- METHOD(HeavyMachineGun, wr_zoomreticle, bool(entity thiswep))
- {
- // no weapon specific image for this weapon
- return false;
}
#endif
MUTATOR_CALLHOOK(EditProjectile, self, gren);
}
- METHOD(Hook, wr_aim, bool(entity thiswep))
- {
- // no bot AI for hook (yet?)
- return true;
- }
- METHOD(Hook, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(Hook, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
if(fire1 || self.BUTTON_HOOK)
{
}
_GrapplingHookFrame();
-
- return true;
}
- METHOD(Hook, wr_init, bool(entity thiswep))
+ METHOD(Hook, wr_init, void(entity thiswep))
{
HOOK_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
- METHOD(Hook, wr_setup, bool(entity thiswep))
+ METHOD(Hook, wr_setup, void(entity thiswep))
{
self.hook_state &= ~HOOK_WAITING_FOR_RELEASE;
- return true;
}
METHOD(Hook, wr_checkammo1, bool(entity thiswep))
{
// infinite ammo for now
return true; // self.ammo_cells >= WEP_CVAR_SEC(hook, ammo); // WEAPONTODO: see above
}
- METHOD(Hook, wr_config, bool(entity thiswep))
+ METHOD(Hook, wr_config, void(entity thiswep))
{
HOOK_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(Hook, wr_resetplayer, bool(entity thiswep))
+ METHOD(Hook, wr_resetplayer, void(entity thiswep))
{
self.hook_refire = time;
- return true;
}
- METHOD(Hook, wr_suicidemessage, bool(entity thiswep))
+ METHOD(Hook, wr_suicidemessage, int(entity thiswep))
{
return false;
}
- METHOD(Hook, wr_killmessage, bool(entity thiswep))
+ METHOD(Hook, wr_killmessage, int(entity thiswep))
{
return WEAPON_HOOK_MURDER;
}
#endif
#ifdef CSQC
- METHOD(Hook, wr_impacteffect, bool(entity thiswep))
+ METHOD(Hook, wr_impacteffect, void(entity thiswep))
{
vector org2;
org2 = w_org + w_backoff * 2;
pointparticles(particleeffectnum(EFFECT_HOOK_EXPLODE), org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, SND_HOOKBOMB_IMPACT, VOL_BASE, ATTN_NORM);
-
- return true;
- }
- METHOD(Hook, wr_init, bool(entity thiswep))
- {
- return true;
- }
- METHOD(Hook, wr_zoomreticle, bool(entity thiswep))
- {
- // no weapon specific image for this weapon
- return false;
}
#endif
}
- METHOD(MachineGun, wr_aim, bool(entity thiswep))
+ METHOD(MachineGun, wr_aim, void(entity thiswep))
{
if(vlen(self.origin-self.enemy.origin) < 3000 - bound(0, skill, 10) * 200)
self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false);
else
self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false);
-
- return true;
}
- METHOD(MachineGun, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(MachineGun, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
if(WEP_CVAR(machinegun, reload_ammo) && self.clip_load < min(max(WEP_CVAR(machinegun, sustained_ammo), WEP_CVAR(machinegun, first_ammo)), WEP_CVAR(machinegun, burst_ammo))) { // forced reload
Weapon w = get_weaponinfo(self.weapon);
{
W_SwitchWeapon_Force(self, w_getbestweapon(self));
w_ready(thiswep, fire1, fire2);
- return false;
+ return;
}
W_DecreaseAmmo(thiswep, WEP_CVAR(machinegun, burst_ammo));
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR(machinegun, first_refire), w_ready);
}
}
-
- return true;
}
- METHOD(MachineGun, wr_init, bool(entity thiswep))
+ METHOD(MachineGun, wr_init, void(entity thiswep))
{
MACHINEGUN_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
METHOD(MachineGun, wr_checkammo1, bool(entity thiswep))
{
}
return ammo_amount;
}
- METHOD(MachineGun, wr_config, bool(entity thiswep))
+ METHOD(MachineGun, wr_config, void(entity thiswep))
{
MACHINEGUN_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(MachineGun, wr_reload, bool(entity thiswep))
+ METHOD(MachineGun, wr_reload, void(entity thiswep))
{
W_Reload(min(max(WEP_CVAR(machinegun, sustained_ammo), WEP_CVAR(machinegun, first_ammo)), WEP_CVAR(machinegun, burst_ammo)), SND(RELOAD));
- return true;
}
- METHOD(MachineGun, wr_suicidemessage, bool(entity thiswep))
+ METHOD(MachineGun, wr_suicidemessage, int(entity thiswep))
{
return WEAPON_THINKING_WITH_PORTALS;
}
- METHOD(MachineGun, wr_killmessage, bool(entity thiswep))
+ METHOD(MachineGun, wr_killmessage, int(entity thiswep))
{
if(w_deathtype & HITTYPE_SECONDARY)
return WEAPON_MACHINEGUN_MURDER_SNIPE;
#endif
#ifdef CSQC
- METHOD(MachineGun, wr_impacteffect, bool(entity thiswep))
+ METHOD(MachineGun, wr_impacteffect, void(entity thiswep))
{
vector org2;
org2 = w_org + w_backoff * 2;
sound(self, CH_SHOTS, SND_RIC2, VOL_BASE, ATTN_NORM);
else if(w_random < 0.2)
sound(self, CH_SHOTS, SND_RIC3, VOL_BASE, ATTN_NORM);
-
- return true;
- }
- METHOD(MachineGun, wr_init, bool(entity thiswep))
- {
- return true;
- }
- METHOD(MachineGun, wr_zoomreticle, bool(entity thiswep))
- {
- // no weapon specific image for this weapon
- return false;
}
#endif
return minfound;
}
- METHOD(MineLayer, wr_aim, bool(entity thiswep))
+ METHOD(MineLayer, wr_aim, void(entity thiswep))
{
// aim and decide to fire if appropriate
if(self.minelayer_mines >= WEP_CVAR(minelayer, limit))
// dprint(ftos(desirabledamage),"\n");
if(self.BUTTON_ATCK2 == true) self.BUTTON_ATCK = false;
}
-
- return true;
}
- METHOD(MineLayer, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(MineLayer, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
if(autocvar_g_balance_minelayer_reload_ammo && self.clip_load < WEP_CVAR(minelayer, ammo)) // forced reload
{
if(W_MineLayer_PlacedMines(true))
sound(self, CH_WEAPON_B, SND_MINE_DET, VOL_BASE, ATTN_NORM);
}
-
- return true;
}
- METHOD(MineLayer, wr_init, bool(entity thiswep))
+ METHOD(MineLayer, wr_init, void(entity thiswep))
{
MINELAYER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
METHOD(MineLayer, wr_checkammo1, bool(entity thiswep))
{
else
return false;
}
- METHOD(MineLayer, wr_config, bool(entity thiswep))
+ METHOD(MineLayer, wr_config, void(entity thiswep))
{
MINELAYER_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(MineLayer, wr_resetplayers, bool(entity thiswep))
+ METHOD(MineLayer, wr_resetplayers, void(entity thiswep))
{
self.minelayer_mines = 0;
- return true;
}
- METHOD(MineLayer, wr_reload, bool(entity thiswep))
+ METHOD(MineLayer, wr_reload, void(entity thiswep))
{
W_Reload(WEP_CVAR(minelayer, ammo), SND(RELOAD));
- return true;
}
- METHOD(MineLayer, wr_suicidemessage, bool(entity thiswep))
+ METHOD(MineLayer, wr_suicidemessage, int(entity thiswep))
{
return WEAPON_MINELAYER_SUICIDE;
}
- METHOD(MineLayer, wr_killmessage, bool(entity thiswep))
+ METHOD(MineLayer, wr_killmessage, int(entity thiswep))
{
return WEAPON_MINELAYER_MURDER;
}
#endif
#ifdef CSQC
- METHOD(MineLayer, wr_impacteffect, bool(entity thiswep))
+ METHOD(MineLayer, wr_impacteffect, void(entity thiswep))
{
vector org2;
org2 = w_org + w_backoff * 12;
pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, SND_MINE_EXP, VOL_BASE, ATTN_NORM);
-
- return true;
- }
- METHOD(MineLayer, wr_init, bool(entity thiswep))
- {
- return true;
- }
- METHOD(MineLayer, wr_zoomreticle, bool(entity thiswep))
- {
- // no weapon specific image for this weapon
- return false;
}
#endif
.float bot_secondary_grenademooth;
- METHOD(Mortar, wr_aim, bool(entity thiswep))
+ METHOD(Mortar, wr_aim, void(entity thiswep))
{
self.BUTTON_ATCK = false;
self.BUTTON_ATCK2 = false;
if(random() < 0.02) self.bot_secondary_grenademooth = 0;
}
}
-
- return true;
}
/*case WR_CALCINFO:
{
wepinfo_sec_dps = (WEP_CVAR_SEC(mortar, damage) * (1 / max3(sys_frametime, WEP_CVAR_SEC(mortar, refire), WEP_CVAR_SEC(mortar, animtime))));
wepinfo_ter_dps = 0;
*/
- METHOD(Mortar, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(Mortar, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
if(autocvar_g_balance_mortar_reload_ammo && self.clip_load < min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo))) { // forced reload
Weapon w = get_weaponinfo(self.weapon);
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(mortar, animtime), w_ready);
}
}
-
- return true;
}
- METHOD(Mortar, wr_init, bool(entity thiswep))
+ METHOD(Mortar, wr_init, void(entity thiswep))
{
MORTAR_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
METHOD(Mortar, wr_checkammo1, bool(entity thiswep))
{
ammo_amount += self.(weapon_load[WEP_MORTAR.m_id]) >= WEP_CVAR_SEC(mortar, ammo);
return ammo_amount;
}
- METHOD(Mortar, wr_config, bool(entity thiswep))
+ METHOD(Mortar, wr_config, void(entity thiswep))
{
MORTAR_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(Mortar, wr_reload, bool(entity thiswep))
+ METHOD(Mortar, wr_reload, void(entity thiswep))
{
W_Reload(min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo)), SND(RELOAD)); // WEAPONTODO
- return true;
}
- METHOD(Mortar, wr_suicidemessage, bool(entity thiswep))
+ METHOD(Mortar, wr_suicidemessage, int(entity thiswep))
{
if(w_deathtype & HITTYPE_SECONDARY)
return WEAPON_MORTAR_SUICIDE_BOUNCE;
else
return WEAPON_MORTAR_SUICIDE_EXPLODE;
}
- METHOD(Mortar, wr_killmessage, bool(entity thiswep))
+ METHOD(Mortar, wr_killmessage, int(entity thiswep))
{
if(w_deathtype & HITTYPE_SECONDARY)
return WEAPON_MORTAR_MURDER_BOUNCE;
#endif
#ifdef CSQC
- METHOD(Mortar, wr_impacteffect, bool(entity thiswep))
+ METHOD(Mortar, wr_impacteffect, void(entity thiswep))
{
vector org2;
org2 = w_org + w_backoff * 12;
pointparticles(particleeffectnum(EFFECT_GRENADE_EXPLODE), org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, SND_GRENADE_IMPACT, VOL_BASE, ATTN_NORM);
-
- return true;
- }
- METHOD(Mortar, wr_init, bool(entity thiswep))
- {
- return true;
- }
- METHOD(Mortar, wr_zoomreticle, bool(entity thiswep))
- {
- // no weapon specific image for this weapon
- return false;
}
#endif
MUTATOR_CALLHOOK(EditProjectile, self, gren);
}
- METHOD(PortoLaunch, wr_aim, bool(entity thiswep))
+ METHOD(PortoLaunch, wr_aim, void(entity thiswep))
{
SELFPARAM();
self.BUTTON_ATCK = false;
if(!WEP_CVAR(porto, secondary))
if(bot_aim(WEP_CVAR_PRI(porto, speed), 0, WEP_CVAR_PRI(porto, lifetime), false))
self.BUTTON_ATCK = true;
-
- return true;
}
- METHOD(PortoLaunch, wr_config, bool(entity this))
+ METHOD(PortoLaunch, wr_config, void(entity this))
{
PORTO_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(PortoLaunch, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(PortoLaunch, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
SELFPARAM();
if(WEP_CVAR(porto, secondary))
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(porto, animtime), w_ready);
}
}
-
- return true;
}
METHOD(PortoLaunch, wr_checkammo1, bool(entity this))
{
// always allow infinite ammo
return true;
}
- METHOD(PortoLaunch, wr_init, bool(entity this))
+ METHOD(PortoLaunch, wr_init, void(entity this))
{
PORTO_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
- METHOD(PortoLaunch, wr_setup, bool(entity thiswep))
+ METHOD(PortoLaunch, wr_setup, void(entity thiswep))
{
SELFPARAM();
self.ammo_field = ammo_none;
- return true;
}
- METHOD(PortoLaunch, wr_resetplayer, bool(entity thiswep))
+ METHOD(PortoLaunch, wr_resetplayer, void(entity thiswep))
{
SELFPARAM();
self.porto_current = world;
- return true;
}
#endif
#ifdef CSQC
- METHOD(PortoLaunch, wr_impacteffect, bool(entity this)) {
+ METHOD(PortoLaunch, wr_impacteffect, void(entity this)) {
LOG_WARNING("Since when does Porto send DamageInfo?\n");
- return true;
- }
- METHOD(PortoLaunch, wr_init, bool(entity this)) {
- // nothing to do
- return true;
- }
- METHOD(PortoLaunch, wr_zoomreticle, bool(entity this)) {
- // no weapon specific image for this weapon
- return false;
}
#endif
#endif
.float bot_secondary_riflemooth;
- METHOD(Rifle, wr_aim, bool(entity thiswep))
+ METHOD(Rifle, wr_aim, void(entity thiswep))
{
self.BUTTON_ATCK=false;
self.BUTTON_ATCK2=false;
if(random() < 0.03) self.bot_secondary_riflemooth = 0;
}
}
-
- return true;
}
- METHOD(Rifle, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(Rifle, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
if(autocvar_g_balance_rifle_reload_ammo && self.clip_load < min(WEP_CVAR_PRI(rifle, ammo), WEP_CVAR_SEC(rifle, ammo))) { // forced reload
Weapon w = get_weaponinfo(self.weapon);
}
}
}
-
- return true;
}
- METHOD(Rifle, wr_init, bool(entity thiswep))
+ METHOD(Rifle, wr_init, void(entity thiswep))
{
RIFLE_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
METHOD(Rifle, wr_checkammo1, bool(entity thiswep))
{
ammo_amount += self.(weapon_load[WEP_RIFLE.m_id]) >= WEP_CVAR_SEC(rifle, ammo);
return ammo_amount;
}
- METHOD(Rifle, wr_config, bool(entity thiswep))
+ METHOD(Rifle, wr_config, void(entity thiswep))
{
RIFLE_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(Rifle, wr_resetplayer, bool(entity thiswep))
+ METHOD(Rifle, wr_resetplayer, void(entity thiswep))
{
self.rifle_accumulator = time - WEP_CVAR(rifle, bursttime);
- return true;
}
- METHOD(Rifle, wr_reload, bool(entity thiswep))
+ METHOD(Rifle, wr_reload, void(entity thiswep))
{
W_Reload(min(WEP_CVAR_PRI(rifle, ammo), WEP_CVAR_SEC(rifle, ammo)), SND(RELOAD));
- return true;
}
- METHOD(Rifle, wr_suicidemessage, bool(entity thiswep))
+ METHOD(Rifle, wr_suicidemessage, int(entity thiswep))
{
return WEAPON_THINKING_WITH_PORTALS;
}
- METHOD(Rifle, wr_killmessage, bool(entity thiswep))
+ METHOD(Rifle, wr_killmessage, int(entity thiswep))
{
if(w_deathtype & HITTYPE_SECONDARY)
{
#endif
#ifdef CSQC
- METHOD(Rifle, wr_impacteffect, bool(entity thiswep))
+ METHOD(Rifle, wr_impacteffect, void(entity thiswep))
{
vector org2;
org2 = w_org + w_backoff * 2;
else if(w_random < 0.5)
sound(self, CH_SHOTS, SND_RIC3, VOL_BASE, ATTN_NORM);
}
-
- return true;
}
- METHOD(Rifle, wr_init, bool(entity thiswep))
+ METHOD(Rifle, wr_init, void(entity thiswep))
{
if(autocvar_cl_reticle && autocvar_cl_reticle_weapon)
{
precache_pic("gfx/reticle_nex");
}
- return true;
}
METHOD(Rifle, wr_zoomreticle, bool(entity thiswep))
{
MUTATOR_CALLHOOK(EditProjectile, self, missile);
}
- METHOD(RocketPropelledChainsaw, wr_aim, bool(entity thiswep))
+ METHOD(RocketPropelledChainsaw, wr_aim, void(entity thiswep))
{
self.BUTTON_ATCK = bot_aim(WEP_CVAR(rpc, speed), 0, WEP_CVAR(rpc, lifetime), false);
- return true;
}
- METHOD(RocketPropelledChainsaw, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(RocketPropelledChainsaw, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
if(WEP_CVAR(rpc, reload_ammo) && self.clip_load < WEP_CVAR(rpc, ammo)) {
Weapon w = get_weaponinfo(self.weapon);
// to-do
}
}
-
- return true;
}
- METHOD(RocketPropelledChainsaw, wr_init, bool(entity thiswep))
+ METHOD(RocketPropelledChainsaw, wr_init, void(entity thiswep))
{
RPC_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
METHOD(RocketPropelledChainsaw, wr_checkammo1, bool(entity thiswep))
{
{
return false;
}
- METHOD(RocketPropelledChainsaw, wr_config, bool(entity thiswep))
+ METHOD(RocketPropelledChainsaw, wr_config, void(entity thiswep))
{
RPC_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(RocketPropelledChainsaw, wr_reload, bool(entity thiswep))
+ METHOD(RocketPropelledChainsaw, wr_reload, void(entity thiswep))
{
W_Reload(WEP_CVAR(rpc, ammo), SND(RELOAD));
- return true;
}
- METHOD(RocketPropelledChainsaw, wr_suicidemessage, bool(entity thiswep))
+ METHOD(RocketPropelledChainsaw, wr_suicidemessage, int(entity thiswep))
{
if((w_deathtype & HITTYPE_BOUNCE) || (w_deathtype & HITTYPE_SPLASH))
return WEAPON_RPC_SUICIDE_SPLASH;
else
return WEAPON_RPC_SUICIDE_DIRECT;
}
- METHOD(RocketPropelledChainsaw, wr_killmessage, bool(entity thiswep))
+ METHOD(RocketPropelledChainsaw, wr_killmessage, int(entity thiswep))
{
if(w_deathtype & HITTYPE_SECONDARY)
return WEAPON_BLASTER_MURDER;
#ifdef CSQC
- METHOD(RocketPropelledChainsaw, wr_impacteffect, bool(entity thiswep))
+ METHOD(RocketPropelledChainsaw, wr_impacteffect, void(entity thiswep))
{
vector org2;
org2 = w_org + w_backoff * 12;
pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
-
- return true;
- }
- METHOD(RocketPropelledChainsaw, wr_init, bool(entity thiswep))
- {
- return true;
- }
- METHOD(RocketPropelledChainsaw, wr_zoomreticle, bool(entity thiswep))
- {
- // no weapon specific image for this weapon
- return false;
}
#endif
// Begin: Genereal weapon functions
// ============================
- METHOD(Seeker, wr_aim, bool(entity thiswep))
+ METHOD(Seeker, wr_aim, void(entity thiswep))
{
if(WEP_CVAR(seeker, type) == 1)
if(W_Seeker_Tagged_Info(self, self.enemy) != world)
self.BUTTON_ATCK2 = bot_aim(WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
else
self.BUTTON_ATCK = bot_aim(WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
- return true;
}
- METHOD(Seeker, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(Seeker, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
if(autocvar_g_balance_seeker_reload_ammo && self.clip_load < min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo))) { // forced reload
Weapon w = get_weaponinfo(self.weapon);
}
}
}
-
- return true;
}
- METHOD(Seeker, wr_init, bool(entity thiswep))
+ METHOD(Seeker, wr_init, void(entity thiswep))
{
SEEKER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
METHOD(Seeker, wr_checkammo1, bool(entity thiswep))
{
}
return ammo_amount;
}
- METHOD(Seeker, wr_config, bool(entity thiswep))
+ METHOD(Seeker, wr_config, void(entity thiswep))
{
SEEKER_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(Seeker, wr_reload, bool(entity thiswep))
+ METHOD(Seeker, wr_reload, void(entity thiswep))
{
W_Reload(min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo)), SND(RELOAD));
- return true;
}
- METHOD(Seeker, wr_suicidemessage, bool(entity thiswep))
+ METHOD(Seeker, wr_suicidemessage, int(entity thiswep))
{
return WEAPON_SEEKER_SUICIDE;
}
- METHOD(Seeker, wr_killmessage, bool(entity thiswep))
+ METHOD(Seeker, wr_killmessage, int(entity thiswep))
{
if(w_deathtype & HITTYPE_SECONDARY)
return WEAPON_SEEKER_MURDER_TAG;
#endif
#ifdef CSQC
- METHOD(Seeker, wr_impacteffect, bool(entity thiswep))
+ METHOD(Seeker, wr_impacteffect, void(entity thiswep))
{
vector org2;
org2 = w_org + w_backoff * 6;
sound(self, CH_SHOTS, SND_SEEKEREXP3, 1, ATTEN_NORM);
}
}
- return true;
- }
- METHOD(Seeker, wr_init, bool(entity thiswep))
- {
- return true;
- }
- METHOD(Seeker, wr_zoomreticle, bool(entity thiswep))
- {
- // no weapon specific image for this weapon
- return false;
}
#endif
}
}
- METHOD(Shockwave, wr_aim, bool(entity thiswep))
+ METHOD(Shockwave, wr_aim, void(entity thiswep))
{
if(vlen(self.origin - self.enemy.origin) <= WEP_CVAR(shockwave, melee_range))
{ self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false); }
else
{ self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false); }
-
- return true;
}
- METHOD(Shockwave, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(Shockwave, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
if(fire1)
{
weapon_thinkf(WFRAME_FIRE1, 0, W_Shockwave_Melee);
}
}
-
- return true;
}
- METHOD(Shockwave, wr_init, bool(entity thiswep))
+ METHOD(Shockwave, wr_init, void(entity thiswep))
{
SHOCKWAVE_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
METHOD(Shockwave, wr_checkammo1, bool(entity thiswep))
{
// shockwave has infinite ammo
return true;
}
- METHOD(Shockwave, wr_config, bool(entity thiswep))
+ METHOD(Shockwave, wr_config, void(entity thiswep))
{
SHOCKWAVE_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(Shockwave, wr_suicidemessage, bool(entity thiswep))
+ METHOD(Shockwave, wr_suicidemessage, int(entity thiswep))
{
return WEAPON_THINKING_WITH_PORTALS;
}
- METHOD(Shockwave, wr_killmessage, bool(entity thiswep))
+ METHOD(Shockwave, wr_killmessage, int(entity thiswep))
{
if(w_deathtype & HITTYPE_SECONDARY)
return WEAPON_SHOCKWAVE_MURDER_SLAP;
shockwave.sw_time = time;
}
- METHOD(Shockwave, wr_impacteffect, bool(entity thiswep))
+ METHOD(Shockwave, wr_impacteffect, void(entity thiswep))
{
// handled by Net_ReadShockwaveParticle
//vector org2;
//org2 = w_org + w_backoff * 2;
//pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1);
- return false;
- }
- METHOD(Shockwave, wr_init, bool(entity thiswep))
- {
- return false;
- }
- METHOD(Shockwave, wr_zoomreticle, bool(entity thiswep))
- {
- // no weapon specific image for this weapon
- return false;
}
#endif
.float shotgun_primarytime;
- METHOD(Shotgun, wr_aim, bool(entity thiswep))
+ METHOD(Shotgun, wr_aim, void(entity thiswep))
{
if(vlen(self.origin-self.enemy.origin) <= WEP_CVAR_SEC(shotgun, melee_range))
self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false);
else
self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false);
-
- return true;
}
- METHOD(Shotgun, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(Shotgun, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
if(WEP_CVAR(shotgun, reload_ammo) && self.clip_load < WEP_CVAR_PRI(shotgun, ammo)) // forced reload
{
// attempt forcing playback of the anim by switching to another anim (that we never play) here...
weapon_thinkf(WFRAME_FIRE1, 0, W_Shotgun_Attack2);
}
-
- return true;
}
- METHOD(Shotgun, wr_init, bool(entity thiswep))
+ METHOD(Shotgun, wr_init, void(entity thiswep))
{
SHOTGUN_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
- METHOD(Shotgun, wr_setup, bool(entity thiswep))
+ METHOD(Shotgun, wr_setup, void(entity thiswep))
{
self.ammo_field = ammo_none;
- return true;
}
METHOD(Shotgun, wr_checkammo1, bool(entity thiswep))
{
default: return false; // secondary unavailable
}
}
- METHOD(Shotgun, wr_config, bool(entity thiswep))
+ METHOD(Shotgun, wr_config, void(entity thiswep))
{
SHOTGUN_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(Shotgun, wr_reload, bool(entity thiswep))
+ METHOD(Shotgun, wr_reload, void(entity thiswep))
{
W_Reload(WEP_CVAR_PRI(shotgun, ammo), SND(RELOAD)); // WEAPONTODO
- return true;
}
- METHOD(Shotgun, wr_suicidemessage, bool(entity thiswep))
+ METHOD(Shotgun, wr_suicidemessage, int(entity thiswep))
{
return WEAPON_THINKING_WITH_PORTALS;
}
- METHOD(Shotgun, wr_killmessage, bool(entity thiswep))
+ METHOD(Shotgun, wr_killmessage, int(entity thiswep))
{
if(w_deathtype & HITTYPE_SECONDARY)
return WEAPON_SHOTGUN_MURDER_SLAP;
#ifdef CSQC
.float prevric;
- METHOD(Shotgun, wr_impacteffect, bool(entity thiswep))
+ METHOD(Shotgun, wr_impacteffect, void(entity thiswep))
{
- vector org2;
- org2 = w_org + w_backoff * 2;
+ vector org2 = w_org + w_backoff * 2;
pointparticles(particleeffectnum(EFFECT_SHOTGUN_IMPACT), org2, w_backoff * 1000, 1);
if(!w_issilent && time - self.prevric > 0.25)
{
sound(self, CH_SHOTS, SND_RIC3, VOL_BASE, ATTEN_NORM);
self.prevric = time;
}
-
- return true;
- }
- METHOD(Shotgun, wr_init, bool(entity thiswep))
- {
- return true;
- }
- METHOD(Shotgun, wr_zoomreticle, bool(entity thiswep))
- {
- // no weapon specific image for this weapon
- return false;
}
#endif
}
}
- METHOD(Tuba, wr_aim, bool(entity thiswep))
+ METHOD(Tuba, wr_aim, void(entity thiswep))
{
// bots cannot play the Tuba well yet
// I think they should start with the recorder first
else
self.BUTTON_ATCK2 = 1;
}
-
- return true;
}
- METHOD(Tuba, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(Tuba, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
if(fire1)
if(weapon_prepareattack(false, WEP_CVAR(tuba, refire)))
WITH(entity, self, self.tuba_note, W_Tuba_NoteOff());
}
}
-
- return true;
}
- METHOD(Tuba, wr_init, bool(entity thiswep))
+ METHOD(Tuba, wr_init, void(entity thiswep))
{
TUBA_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
- METHOD(Tuba, wr_setup, bool(entity thiswep))
+ METHOD(Tuba, wr_setup, void(entity thiswep))
{
self.ammo_field = ammo_none;
self.tuba_instrument = 0;
- return true;
}
- METHOD(Tuba, wr_reload, bool(entity thiswep))
+ METHOD(Tuba, wr_reload, void(entity thiswep))
{
// switch to alternate instruments :)
if(self.weaponentity.state == WS_READY)
self.weaponentity.state = WS_INUSE;
weapon_thinkf(WFRAME_RELOAD, 0.5, w_ready);
}
-
- return true;
}
METHOD(Tuba, wr_checkammo1, bool(entity thiswep))
{
{
return true; // tuba has infinite ammo
}
- METHOD(Tuba, wr_config, bool(entity thiswep))
+ METHOD(Tuba, wr_config, void(entity thiswep))
{
TUBA_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(Tuba, wr_suicidemessage, bool(entity thiswep))
+ METHOD(Tuba, wr_suicidemessage, int(entity thiswep))
{
if(w_deathtype & HITTYPE_BOUNCE)
return WEAPON_KLEINBOTTLE_SUICIDE;
else
return WEAPON_TUBA_SUICIDE;
}
- METHOD(Tuba, wr_killmessage, bool(entity thiswep))
+ METHOD(Tuba, wr_killmessage, int(entity thiswep))
{
if(w_deathtype & HITTYPE_BOUNCE)
return WEAPON_KLEINBOTTLE_MURDER;
return WEAPON_TUBA_MURDER;
}
-#endif
-#ifdef CSQC
-
- METHOD(Tuba, wr_zoomreticle, bool(entity thiswep))
- {
- // no weapon specific image for this weapon
- return false;
- }
-
#endif
#endif
}
}
- METHOD(Vaporizer, wr_aim, bool(entity thiswep))
+ METHOD(Vaporizer, wr_aim, void(entity thiswep))
{
if(self.WEP_AMMO(VAPORIZER) > 0)
self.BUTTON_ATCK = bot_aim(1000000, 0, 1, false);
else
self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), false); // WEAPONTODO: replace with proper vaporizer cvars
-
- return true;
}
- METHOD(Vaporizer, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(Vaporizer, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
float vaporizer_ammo = ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo));
// if the laser uses load, we also consider its ammo for reloading
}
else
self.held_down = false;
-
- return true;
}
- METHOD(Vaporizer, wr_init, bool(entity thiswep))
+ METHOD(Vaporizer, wr_init, void(entity thiswep))
{
//W_Blaster(WR_INIT); // Samual: Is this really the proper thing to do? Didn't we already run this previously?
VAPORIZER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
- METHOD(Vaporizer, wr_setup, bool(entity thiswep))
+ METHOD(Vaporizer, wr_setup, void(entity thiswep))
{
self.ammo_field = WEP_AMMO(VAPORIZER);
self.vaporizer_lasthit = 0;
- return true;
}
METHOD(Vaporizer, wr_checkammo1, bool(entity thiswep))
{
ammo_amount += self.(weapon_load[WEP_VAPORIZER.m_id]) >= WEP_CVAR_SEC(vaporizer, ammo);
return ammo_amount;
}
- METHOD(Vaporizer, wr_config, bool(entity thiswep))
+ METHOD(Vaporizer, wr_config, void(entity thiswep))
{
VAPORIZER_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(Vaporizer, wr_resetplayer, bool(entity thiswep))
+ METHOD(Vaporizer, wr_resetplayer, void(entity thiswep))
{
self.vaporizer_lasthit = 0;
- return true;
}
- METHOD(Vaporizer, wr_reload, bool(entity thiswep))
+ METHOD(Vaporizer, wr_reload, void(entity thiswep))
{
float vaporizer_ammo = ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo));
float used_ammo;
used_ammo = vaporizer_ammo;
W_Reload(used_ammo, SND(RELOAD));
- return true;
}
- METHOD(Vaporizer, wr_suicidemessage, bool(entity thiswep))
+ METHOD(Vaporizer, wr_suicidemessage, int(entity thiswep))
{
return WEAPON_THINKING_WITH_PORTALS;
}
- METHOD(Vaporizer, wr_killmessage, bool(entity thiswep))
+ METHOD(Vaporizer, wr_killmessage, int(entity thiswep))
{
return WEAPON_VAPORIZER_MURDER;
}
#endif
#ifdef CSQC
- METHOD(Vaporizer, wr_impacteffect, bool(entity thiswep))
+ METHOD(Vaporizer, wr_impacteffect, void(entity thiswep))
{
vector org2 = w_org + w_backoff * 6;
if(w_deathtype & HITTYPE_SECONDARY)
pointparticles(particleeffectnum(EFFECT_VORTEX_IMPACT), org2, '0 0 0', 1);
if(!w_issilent) { sound(self, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM); }
}
- return true;
}
- METHOD(Vaporizer, wr_init, bool(entity thiswep))
+ METHOD(Vaporizer, wr_init, void(entity thiswep))
{
if(autocvar_cl_reticle && autocvar_cl_reticle_weapon)
{
precache_pic("gfx/reticle_nex");
}
- return true;
}
METHOD(Vaporizer, wr_zoomreticle, bool(entity thiswep))
{
.float vortex_chargepool_pauseregen_finished;
- METHOD(Vortex, wr_aim, bool(entity thiswep))
+ METHOD(Vortex, wr_aim, void(entity thiswep))
{
if(bot_aim(1000000, 0, 1, false))
self.BUTTON_ATCK = true;
if(WEP_CVAR(vortex, charge))
self.BUTTON_ATCK2 = true;
}
- return true;
}
- METHOD(Vortex, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(Vortex, wr_think, void(entity thiswep, bool fire1, bool fire2))
{
if(WEP_CVAR(vortex, charge) && self.vortex_charge < WEP_CVAR(vortex, charge_limit))
self.vortex_charge = min(1, self.vortex_charge + WEP_CVAR(vortex, charge_rate) * frametime / W_TICSPERFRAME);
}
}
}
-
- return true;
}
- METHOD(Vortex, wr_init, bool(entity thiswep))
+ METHOD(Vortex, wr_init, void(entity thiswep))
{
VORTEX_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
- METHOD(Vortex, wr_setup, bool(entity thiswep))
+ METHOD(Vortex, wr_setup, void(entity thiswep))
{
self.vortex_lasthit = 0;
- return true;
}
METHOD(Vortex, wr_checkammo1, bool(entity thiswep))
{
return false; // zoom is not a fire mode
}
}
- METHOD(Vortex, wr_config, bool(entity thiswep))
+ METHOD(Vortex, wr_config, void(entity thiswep))
{
VORTEX_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(Vortex, wr_resetplayer, bool(entity thiswep))
+ METHOD(Vortex, wr_resetplayer, void(entity thiswep))
{
self.vortex_lasthit = 0;
- return true;
}
- METHOD(Vortex, wr_reload, bool(entity thiswep))
+ METHOD(Vortex, wr_reload, void(entity thiswep))
{
W_Reload(min(WEP_CVAR_PRI(vortex, ammo), WEP_CVAR_SEC(vortex, ammo)), SND(RELOAD));
- return true;
}
- METHOD(Vortex, wr_suicidemessage, bool(entity thiswep))
+ METHOD(Vortex, wr_suicidemessage, int(entity thiswep))
{
return WEAPON_THINKING_WITH_PORTALS;
}
- METHOD(Vortex, wr_killmessage, bool(entity thiswep))
+ METHOD(Vortex, wr_killmessage, int(entity thiswep))
{
return WEAPON_VORTEX_MURDER;
}
#ifdef CSQC
float autocvar_g_balance_vortex_secondary = 0; // WEAPONTODO
- METHOD(Vortex, wr_impacteffect, bool(entity thiswep))
+ METHOD(Vortex, wr_impacteffect, void(entity thiswep))
{
- vector org2;
- org2 = w_org + w_backoff * 6;
+ vector org2 = w_org + w_backoff * 6;
pointparticles(particleeffectnum(EFFECT_VORTEX_IMPACT), org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM);
-
- return true;
}
- METHOD(Vortex, wr_init, bool(entity thiswep))
+ METHOD(Vortex, wr_init, void(entity thiswep))
{
if(autocvar_cl_reticle && autocvar_cl_reticle_weapon)
{
precache_pic("gfx/reticle_nex");
}
- return true;
}
METHOD(Vortex, wr_zoomreticle, bool(entity thiswep))
{
return true;
}
- METHOD(BallStealer, wr_think, bool(BallStealer thiswep, bool fire1, bool fire2))
+ METHOD(BallStealer, wr_think, void(BallStealer thiswep, bool fire1, bool fire2))
{
if(fire1)
if(weapon_prepareattack(false, autocvar_g_balance_nexball_primary_refire))
// DropBall or stealing will set metertime back to 0
weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
}
- return true;
- }
- METHOD(BallStealer, wr_init, bool(BallStealer thiswep))
- {
- return true;
}
- METHOD(BallStealer, wr_setup, bool(BallStealer thiswep))
+ METHOD(BallStealer, wr_setup, void(BallStealer thiswep))
{
//weapon_setup(WEP_PORTO.m_id);
- return true;
- }
- METHOD(BallStealer, wr_aim, bool(BallStealer thiswep))
- {
- return true;
}
METHOD(BallStealer, wr_checkammo1, bool(BallStealer thiswep))
{
}
if (w) {
- entity e = get_weaponinfo(self.weapon);
- if (e.wr_think) e.wr_think(e, self.BUTTON_ATCK, self.BUTTON_ATCK2);
+ Weapon e = get_weaponinfo(self.weapon);
+ e.wr_think(e, self.BUTTON_ATCK, self.BUTTON_ATCK2);
} else {
Weapon w = get_weaponinfo(self.weapon);
w.wr_gonethink(w);
self.clip_load = self.(weapon_load[self.weapon]) = -1;
}
-void W_DropEvent(.bool(Weapon) event, entity player, float weapon_type, entity weapon_item)
+void W_DropEvent(.void(Weapon) event, entity player, float weapon_type, entity weapon_item)
{SELFPARAM();
setself(player);
weapon_dropevent_item = weapon_item;
void W_DecreaseAmmo(Weapon wep, float ammo_use);
-void W_DropEvent(.bool(Weapon) event, entity player, float weapon_type, entity weapon_item);
+void W_DropEvent(.void(Weapon) event, entity player, float weapon_type, entity weapon_item);
void W_Reload(float sent_ammo_min, string sent_sound);