float WR_IMPACTEFFECT = 11; // (CSQC) impact effect
float WR_SWITCHABLE = 12; // (CSQC) impact effect
float WR_PLAYERDEATH = 13; // (SVQC) does not need to do anything
+float WR_GONETHINK = 14; // (SVQC) logic to run every frame, also if no longer having the weapon as long as the switch away has not been performed
float HUD_PANEL_WEAPONS = 0;
float HUD_PANEL_AMMO = 1;
if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
self.weapon_load[j] = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));
}
- self.weapon_forbidchange = FALSE;
oldself = self;
self = spot;
w = self.weapon;
if (w == 0)
return; // just in case
- if(self.weapon_forbidchange)
- return;
if(MUTATOR_CALLHOOK(ForbidThrowCurrentWeapon))
return;
if(!autocvar_g_weapon_throwable)
W_SwitchWeapon_Force(self, w_getbestweapon(self));
wb = 0;
}
+
+ v_forward = fo;
+ v_right = ri;
+ v_up = up;
+
if(wb)
- {
- v_forward = fo;
- v_right = ri;
- v_up = up;
weapon_action(self.weapon, WR_THINK);
- }
+ else
+ weapon_action(self.weapon, WR_GONETHINK);
+
if (time + self.weapon_frametime * 0.5 >= self.weapon_nextthink)
{
if(self.weapon_think)
void W_SwitchWeapon_Force(entity e, float w)
{
- // don't switch to another weapon if we're not allowed to
- if(e.weapon_forbidchange)
- return;
-
e.cnt = e.switchweapon;
e.switchweapon = w;
e.selectweapon = w;
void w_ready();
// VorteX: standalone think for weapons, so normal think on weaponentity can be reserved by weaponflashes (which needs update even player dies)
.float weapon_nextthink;
-.float weapon_forbidchange;
.void() weapon_think;
//float PLAYER_WEAPONSELECTION_DELAY = );
Send_CSQC_Centerprint_Generic(self, CPID_NIX_WPNCHANGE, strcat("^2Active weapon: ^3", W_Name(nix_weapon)), 0, 0);
weapon_action(nix_weapon, WR_RESETPLAYER);
+
// all weapons must be fully loaded when we spawn
entity e;
e = get_weaponinfo(nix_weapon);
if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
self.weapon_load[nix_weapon] = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));
+
+ // nex too
+ if(autocvar_g_balance_nex_charge)
+ {
+ if(autocvar_g_balance_nex_secondary_chargepool)
+ self.nex_chargepool_ammo = 1;
+ self.nex_charge = autocvar_g_balance_nex_charge_start;
+ }
}
if(self.nix_lastinfotime != dt)
{
if(self.hagar_load)
{
// if we pressed primary fire while loading, unload all rockets and abort
+ self.weaponentity.state = WS_READY;
W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_secondary_ammo * self.hagar_load * -1, autocvar_g_balance_hagar_reload_ammo); // give back ammo
self.hagar_load = 0;
sound(self, CH_WEAPON_A, "weapons/hagar_beep.wav", VOL_BASE, ATTN_NORM);
if(!self.hagar_loadblock && self.hagar_loadstep < time)
{
W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_secondary_ammo, autocvar_g_balance_hagar_reload_ammo);
+ self.weaponentity.state = WS_INUSE;
self.hagar_load += 1;
sound(self, CH_WEAPON_B, "weapons/hagar_load.wav", VOL_BASE, ATTN_NORM);
if(self.hagar_load)
{
- self.weapon_forbidchange = TRUE;
if(!self.BUTTON_ATCK2 || ((loaded || !enough_ammo) && self.hagar_loadstep < time && !autocvar_g_balance_hagar_secondary_load_hold))
+ {
+ self.weaponentity.state = WS_READY;
W_Hagar_Attack2_Load_Release();
+ }
}
else
{
- self.weapon_forbidchange = FALSE;
self.hagar_loadbeep = FALSE;
}
// we aren't checking ammo during an attack, so we must do it here
if not(weapon_action(self.weapon, WR_CHECKAMMO1) + weapon_action(self.weapon, WR_CHECKAMMO2))
{
+ // note: this doesn't force the switch
W_SwitchToOtherWeapon(self);
return;
}
}
}
}
+ else if (req == WR_GONETHINK)
+ {
+ // we lost the weapon and want to prepare switching away
+ if(self.hagar_load)
+ {
+ self.weaponentity.state = WS_READY;
+ W_Hagar_Attack2_Load_Release();
+ }
+ }
else if (req == WR_PRECACHE)
{
precache_model ("models/weapons/g_hagar.md3");
Nikoli
**Other Active Contributors
+Akari
Ant "Antibody" Zucaro
Antonio "terencehill" Piu
Ben "MooKow" Banker
Kristian "morfar" Johansson
kojn
Maik "SavageX" Merten
+Mick Rippon
MrBougo
Przemysław "atheros" Grzywacz
Ruszkai "C.Brutail" Ákos
Samual Lenks
Severin "sev" Meyer
Stephan "esteel" Stahl
+The player with the unnecessarily long name
Wolfgang "Blub\0" Bumiller
SoulKeeper_p
+** TODO to be verified and sorted into the categories
+atheros - CA fixes
+cortez - map changes
+Florian Paul Schmidt - g_dodging
+parasti - various fixes
+magorian - a menu text overlap issue fix
+Paul Scott - keepaway bot AI
+PlasmaSheep - worked on player voices
+Sc0rp - some of our music
+Rodrigo Mouton Laudin <ratogenesis> - Spanish translation
+Maxime Paradis <taximus.micro> - French translation (additionally to calinou)
+xaN1C4n3 - Hungarian translation
+PinkRobot and freefang - Dutch translation
+marcus256 - Swedish translation
+
**Past Contributors
Alexander "motorsep" Zubov
Amos "torus" Dudley