//precache_sound ("weapons/W_Arc_Beam_fire.wav");
return TRUE;
}
- case WR_SETUP:
- {
- weapon_setup(WEP_ARC);
- return TRUE;
- }
case WR_CHECKAMMO1:
{
return !WEP_CVAR_PRI(arc, ammo) || (self.ammo_cells > 0);
case WR_SETUP:
{
- weapon_setup(WEP_LASER);
self.current_ammo = ammo_none;
return TRUE;
}
}
case WR_SETUP:
{
- weapon_setup(WEP_CRYLINK);
self.current_ammo = ammo_cells;
return TRUE;
}
}
case WR_SETUP:
{
- weapon_setup(WEP_DEVASTATOR);
self.current_ammo = ammo_rockets;
self.rl_release = 1;
return TRUE;
}
case WR_SETUP:
{
- weapon_setup(WEP_ELECTRO);
self.current_ammo = ammo_cells;
return TRUE;
}
}
case WR_SETUP:
{
- weapon_setup(WEP_FIREBALL);
self.current_ammo = ammo_none;
return TRUE;
}
}
case WR_SETUP:
{
- weapon_setup(WEP_HAGAR);
self.current_ammo = ammo_rockets;
self.hagar_loadblock = FALSE;
}
case WR_SETUP:
{
- weapon_setup(WEP_HLAC);
self.current_ammo = ammo_cells;
return TRUE;
}
}
case WR_SETUP:
{
- weapon_setup(WEP_HOOK);
self.current_ammo = ammo_fuel;
self.hook_state &~= HOOK_WAITING_FOR_RELEASE;
return TRUE;
}
case WR_SETUP:
{
- weapon_setup(WEP_UZI);
self.current_ammo = ammo_nails;
return TRUE;
}
}
case WR_SETUP:
{
- weapon_setup(WEP_MINE_LAYER);
self.current_ammo = ammo_rockets;
return TRUE;
}
}
case WR_SETUP:
{
- weapon_setup(WEP_MINSTANEX);
self.current_ammo = ammo_cells;
self.minstanex_lasthit = 0;
return TRUE;
}
case WR_SETUP:
{
- weapon_setup(WEP_GRENADE_LAUNCHER);
self.current_ammo = ammo_rockets;
return TRUE;
}
}
case WR_SETUP:
{
- weapon_setup(WEP_NEX);
self.current_ammo = ammo_cells;
return TRUE;
}
}
case WR_SETUP:
{
- weapon_setup(WEP_PORTO);
self.current_ammo = ammo_none;
return TRUE;
}
}
case WR_SETUP:
{
- weapon_setup(WEP_RIFLE);
self.current_ammo = ammo_nails;
return TRUE;
}
}
case WR_SETUP:
{
- weapon_setup(WEP_SEEKER);
self.current_ammo = ammo_rockets;
return TRUE;
}
}
case WR_SETUP:
{
- weapon_setup(WEP_SHOTGUN);
self.current_ammo = ammo_shells;
return TRUE;
}
}
case WR_SETUP:
{
- weapon_setup(WEP_TUBA);
self.current_ammo = ammo_none;
self.tuba_instrument = 0;
return TRUE;
}
else if(req == WR_SETUP)
{
- weapon_setup(WEP_PORTO);
+ //weapon_setup(WEP_PORTO);
}
// No need to check WR_CHECKAMMO* or WR_AIM, it should always return TRUE
return TRUE;
{
// end switching!
self.switchingweapon = self.switchweapon;
-
entity newwep = get_weaponinfo(self.switchweapon);
- //setanim(self, self.anim_draw, FALSE, TRUE, TRUE);
- self.weaponentity.state = WS_RAISE;
+ self.items &~= IT_AMMO;
+ self.items = self.items | (newwep.items & IT_AMMO);
+
+ // the two weapon entities will notice this has changed and update their models
+ self.weapon = self.switchweapon;
+ self.weaponname = newwep.mdl;
+ self.bulletcounter = 0; // WEAPONTODO
WEP_ACTION(self.switchweapon, WR_SETUP);
+ self.weaponentity.state = WS_RAISE;
// set our clip load to the load of the weapon we switched to, if it's reloadable
if(newwep.spawnflags & WEP_FLAG_RELOADABLE && cvar(strcat("g_balance_", newwep.netname, "_reload_ammo"))) // prevent accessing undefined cvars
weapon_thinkf(WFRAME_IDLE, 1000000, w_ready);
}
-// Setup weapon for client (after this raise frame will be launched)
-void weapon_setup(float windex)
-{
- entity e;
- e = get_weaponinfo(windex);
- self.items &~= IT_AMMO;
- self.items = self.items | (e.items & IT_AMMO);
-
- // the two weapon entities will notice this has changed and update their models
- self.weapon = windex;
- self.switchingweapon = windex; // to make sure
- self.weaponname = e.mdl;
- self.bulletcounter = 0;
-}
-
// perform weapon to attack (weaponstate and attack_finished check is here)
void W_SwitchToOtherWeapon(entity pl)
{