-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qc"
- #include "../../dpdefs/dpextensions.qc"
- #include "../sys-post.qh"
- #include "../../common/constants.qh"
- #include "../../common/util.qh"
- #include "../../common/animdecide.qh"
- #include "../../common/monsters/monsters.qh"
- #include "../../common/weapons/weapons.qh"
- #include "weaponsystem.qh"
- #include "../t_items.qh"
- #include "../autocvars.qh"
- #include "../defs.qh"
- #include "../../common/notifications.qh"
- #include "../mutators/mutators_include.qh"
- #include "../command/common.qh"
- #include "../../csqcmodellib/sv_model.qh"
- #include "../round_handler.qh"
-#endif
+#include "weaponsystem.qh"
+#include "../_all.qh"
+
+#include "selection.qh"
+
+#include "../command/common.qh"
+#include "../mutators/mutators_include.qh"
+#include "../round_handler.qh"
+#include "../t_items.qh"
+#include "../../common/animdecide.qh"
+#include "../../common/constants.qh"
+#include "../../common/monsters/all.qh"
+#include "../../common/notifications.qh"
+#include "../../common/util.qh"
+#include "../../common/weapons/all.qh"
+#include "../../csqcmodellib/sv_model.qh"
/*
===========================================================================
float W_WeaponRateFactor()
{
- float t;
- t = 1.0 / g_weaponratefactor;
+ float t = 1.0 / g_weaponratefactor;
- weapon_rate = t;
- MUTATOR_CALLHOOK(WeaponRateFactor);
+ MUTATOR_CALLHOOK(WeaponRateFactor, t);
t = weapon_rate;
return t;
}
-// VorteX: static frame globals
-const float WFRAME_DONTCHANGE = -1;
-const float WFRAME_FIRE1 = 0;
-const float WFRAME_FIRE2 = 1;
-const float WFRAME_IDLE = 2;
-const float WFRAME_RELOAD = 3;
-.float wframe;
+float W_WeaponSpeedFactor()
+{
+ float t = 1.0 * g_weaponspeedfactor;
+
+ MUTATOR_CALLHOOK(WeaponSpeedFactor, t);
+ t = ret_float;
+
+ return t;
+}
+
void(float fr, float t, void() func) weapon_thinkf;
void CL_Weaponentity_Think()
{
- float tb;
+ int tb;
self.nextthink = time;
if (intermission_running)
self.frame = self.anim_idle.x;
{
// always keep the Mine Layer if we placed mines, so that we can detonate them
entity mine;
- if(self.weapon == WEP_MINE_LAYER)
+ if(self.weapon == WEP_MINE_LAYER.m_id)
for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.owner == self)
return false;
- if(self.weapon == WEP_SHOTGUN)
+ if(self.weapon == WEP_SHOTGUN.m_id)
if(!secondary && WEP_CVAR(shotgun, secondary) == 1)
return false; // no clicking, just allow
if((fr == WFRAME_FIRE1 || fr == WFRAME_FIRE2) && t)
{
- if((self.weapon == WEP_SHOCKWAVE || self.weapon == WEP_SHOTGUN) && fr == WFRAME_FIRE2)
+ if((self.weapon == WEP_SHOCKWAVE.m_id || self.weapon == WEP_SHOTGUN.m_id) && fr == WFRAME_FIRE2)
animdecide_setaction(self, ANIMACTION_MELEE, restartanim);
else
animdecide_setaction(self, ANIMACTION_SHOOT, restartanim);
}
}
-float forbidWeaponUse()
+float forbidWeaponUse(entity player)
{
if(time < game_starttime && !autocvar_sv_ready_restart_after_countdown)
return 1;
if(round_handler_IsActive() && !round_handler_IsRoundStarted())
return 1;
- if(self.player_blocked)
+ if(player.player_blocked)
return 1;
- if(self.frozen)
+ if(player.frozen)
return 1;
- if(self.weapon_blocked)
+ if(player.weapon_blocked)
return 1;
return 0;
}
if (!self.weaponentity || self.health < 1)
return; // Dead player can't use weapons and injure impulse commands
- if(forbidWeaponUse())
+ if(forbidWeaponUse(self))
if(self.weaponentity.state != WS_CLEAR)
{
w_ready();
self.clip_load = self.(weapon_load[self.weapon]) = -1;
}
-entity weapon_dropevent_item;
void W_DropEvent(float event, entity player, float weapon_type, entity weapon_item)
{
entity oldself = self;