Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
oknex.qc
Go to the documentation of this file.
1#include "oknex.qh"
2
3#ifdef SVQC
5#endif
6
7#ifdef GAMEQC
8
9METHOD(OverkillNex, wr_glow, vector(OverkillNex this, int actor_colors, entity wepent))
10{
11 if (!WEP_CVAR(WEP_OVERKILL_NEX, charge))
12 return '0 0 0';
13 float charge = max(0.25, wepent.oknex_charge);
14 float animlimit = WEP_CVAR(WEP_OVERKILL_NEX, charge_animlimit);
15 float f = min(1, charge / animlimit);
16 vector mycolors = colormapPaletteColor(actor_colors & 0x0F, true);
17 vector g = f * (mycolors * 0.3);
18 if (charge > animlimit)
19 {
20 f = (charge - animlimit) / (1 - animlimit);
21 g += f * (mycolors * 0.7);
22 }
23 // transition color can't be '0 0 0' as it defaults to player model glow color
24 if (g == '0 0 0')
25 g = '0 0 0.000001';
26 return g;
27}
28
29#endif // GAMEQC
30#ifdef SVQC
31
33
35{
36 entity player = M_ARGV(0, entity);
37
38 // WEAPONTODO
39 if (!WEP_CVAR(WEP_OVERKILL_NEX, charge) || !WEP_CVAR(WEP_OVERKILL_NEX, charge_velocity_rate))
40 return;
41
42 for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
43 {
44 .entity weaponentity = weaponentities[slot];
45
46 if (player.(weaponentity).m_weapon == WEP_OVERKILL_NEX && WEP_CVAR(WEP_OVERKILL_NEX, charge) && WEP_CVAR(WEP_OVERKILL_NEX, charge_velocity_rate) && vdist(vec2(player.velocity), >, WEP_CVAR(WEP_OVERKILL_NEX, charge_minspeed)))
47 {
48 float xyspeed = vlen(vec2(player.velocity));
49 // add a maximum of charge_velocity_rate when going fast (f = 1), gradually increasing from minspeed (f = 0) to maxspeed
50 xyspeed = min(xyspeed, WEP_CVAR(WEP_OVERKILL_NEX, charge_maxspeed));
51 float f = (xyspeed - WEP_CVAR(WEP_OVERKILL_NEX, charge_minspeed)) / (WEP_CVAR(WEP_OVERKILL_NEX, charge_maxspeed) - WEP_CVAR(WEP_OVERKILL_NEX, charge_minspeed));
52 // add the extra charge
53 player.(weaponentity).oknex_charge = min(1, player.(weaponentity).oknex_charge + WEP_CVAR(WEP_OVERKILL_NEX, charge_velocity_rate) * f * PHYS_INPUT_TIMELENGTH);
54 }
55 }
56}
57
58void W_OverkillNex_Attack(Weapon thiswep, entity actor, .entity weaponentity, bool is_secondary)
59{
60 float mydmg = WEP_CVAR_BOTH(WEP_OVERKILL_NEX, !is_secondary, damage);
61 float myforce = WEP_CVAR_BOTH(WEP_OVERKILL_NEX, !is_secondary, force);
62
63 float flying = IsFlying(actor); // do this BEFORE to make the trace values from FireRailgunBullet last
64
65 float charge;
66 if (WEP_CVAR(WEP_OVERKILL_NEX, charge))
67 {
68 charge = WEP_CVAR(WEP_OVERKILL_NEX, charge_mindmg) / mydmg + (1 - WEP_CVAR(WEP_OVERKILL_NEX, charge_mindmg) / mydmg) * actor.(weaponentity).oknex_charge;
69 actor.(weaponentity).oknex_charge *= WEP_CVAR(WEP_OVERKILL_NEX, charge_shot_multiplier); // do this AFTER setting mydmg/myforce
70 // O RLY? -- divVerent
71 // YA RLY -- FruitieX
72 }
73 else
74 charge = 1;
75 mydmg *= charge;
76 myforce *= charge;
77
78 W_SetupShot(actor, weaponentity, true, 5, SND_OK_NEX_FIRE, CH_WEAPON_A, mydmg, thiswep.m_id);
79 if (charge > WEP_CVAR(WEP_OVERKILL_NEX, charge_animlimit) && WEP_CVAR(WEP_OVERKILL_NEX, charge_animlimit)) // if the OverkillNex is overcharged, we play an extra sound
80 sound(actor, CH_WEAPON_B, SND_OK_NEX_CHARGE, VOL_BASE * (charge - 0.5 * WEP_CVAR(WEP_OVERKILL_NEX, charge_animlimit)) / (1 - 0.5 * WEP_CVAR(WEP_OVERKILL_NEX, charge_animlimit)), ATTN_NORM);
81
82 yoda = 0;
85 mydmg,
86 true,
87 myforce,
88 WEP_CVAR_BOTH(WEP_OVERKILL_NEX, !is_secondary, damagefalloff_mindist),
89 WEP_CVAR_BOTH(WEP_OVERKILL_NEX, !is_secondary, damagefalloff_maxdist),
90 WEP_CVAR_BOTH(WEP_OVERKILL_NEX, !is_secondary, damagefalloff_halflife),
91 WEP_CVAR_BOTH(WEP_OVERKILL_NEX, !is_secondary, damagefalloff_forcehalflife),
92 thiswep.m_id
93 );
94
95 if (yoda && flying)
96 Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
97 if (impressive_hits && actor.oknex_lasthit)
98 {
99 Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
100 impressive_hits = 0; // only every second time
101 }
102
103 actor.oknex_lasthit = impressive_hits;
104
105 //beam and muzzle flash done on client
106 SendCSQCVortexBeamParticle(actor, charge);
107
108 W_DecreaseAmmo(thiswep, actor, WEP_CVAR_BOTH(WEP_OVERKILL_NEX, !is_secondary, ammo), weaponentity);
109}
110
112
113METHOD(OverkillNex, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
114{
115 if (bot_aim(actor, weaponentity, 1000000, 0, 1, false, true))
116 PHYS_INPUT_BUTTON_ATCK(actor) = true;
117 else
118 {
119 if (WEP_CVAR(WEP_OVERKILL_NEX, charge))
120 PHYS_INPUT_BUTTON_ATCK2(actor) = true;
121 }
122}
123
124METHOD(OverkillNex, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
125{
126 if (WEP_CVAR(WEP_OVERKILL_NEX, charge) && actor.(weaponentity).oknex_charge < WEP_CVAR(WEP_OVERKILL_NEX, charge_limit))
127 actor.(weaponentity).oknex_charge = min(1, actor.(weaponentity).oknex_charge + WEP_CVAR(WEP_OVERKILL_NEX, charge_rate) * frametime / W_TICSPERFRAME);
128
129 if (WEP_CVAR_SEC(WEP_OVERKILL_NEX, chargepool)
130 && actor.(weaponentity).oknex_chargepool_ammo < 1)
131 {
132 if (actor.oknex_chargepool_pauseregen_finished < time)
133 actor.(weaponentity).oknex_chargepool_ammo = min(1, actor.(weaponentity).oknex_chargepool_ammo + WEP_CVAR_SEC(WEP_OVERKILL_NEX, chargepool_regen) * frametime / W_TICSPERFRAME);
134 actor.pauseregen_finished = max(actor.pauseregen_finished, time + WEP_CVAR_SEC(WEP_OVERKILL_NEX, chargepool_pause_regen));
135 }
136
137 if (WEP_CVAR_SEC(WEP_OVERKILL_NEX, refire_type) == 1 && (fire & 2)
138 && time >= actor.jump_interval)
139 {
140 // Secondary uses it's own refire timer if refire_type is 1.
141 actor.jump_interval = time + WEP_CVAR_PRI(WEP_BLASTER, refire) * W_WeaponRateFactor(actor);
142 makevectors(actor.v_angle);
143 W_Blaster_Attack(actor, weaponentity);
144 if (actor.(weaponentity).wframe == WFRAME_IDLE
145 || actor.(weaponentity).wframe == WFRAME_FIRE2)
146 {
147 // Set secondary fire animation.
148 actor.(weaponentity).wframe = WFRAME_FIRE2;
150 if (it == actor || (IS_SPEC(it) && it.enemy == actor))
151 wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, autocvar_g_weaponratefactor, true);
152 ));
154 }
155 }
156
157 if (autocvar_g_balance_oknex_reload_ammo && actor.(weaponentity).clip_load < WEP_CVAR_PRI(WEP_OVERKILL_NEX, ammo))
158 {
159 // Rorced reload
160 thiswep.wr_reload(thiswep, actor, weaponentity);
161 return;
162 }
163 if (fire & 1) // Primary attack
164 {
165 if (!weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(WEP_OVERKILL_NEX, refire)))
166 return;
167 W_OverkillNex_Attack(thiswep, actor, weaponentity, false);
168 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_OVERKILL_NEX, animtime), w_ready);
169 return;
170 }
171 if ((fire & 2) && WEP_CVAR(WEP_OVERKILL_NEX, secondary) == 2 && WEP_CVAR_SEC(WEP_OVERKILL_NEX, refire_type) == 0)
172 {
173 // Secondary attack
174 if (!weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_PRI(WEP_BLASTER, refire)))
175 return;
176 makevectors(actor.v_angle);
177 W_Blaster_Attack(actor, weaponentity);
178 weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_PRI(WEP_BLASTER, animtime), w_ready);
179 return;
180 }
181
182#if 0
183 if ((WEP_CVAR(WEP_OVERKILL_NEX, charge) && WEP_CVAR(WEP_OVERKILL_NEX, secondary) == 1)
185 : (fire & 2))
186 {
187 if (WEP_CVAR(WEP_OVERKILL_NEX, charge))
188 {
189 actor.(weaponentity).oknex_charge_rottime = time + WEP_CVAR(WEP_OVERKILL_NEX, charge_rot_pause);
190 float dt = frametime / W_TICSPERFRAME;
191
192 if (actor.(weaponentity).oknex_charge < 1)
193 {
194 if (WEP_CVAR_SEC(WEP_OVERKILL_NEX, chargepool))
195 {
196 if (WEP_CVAR_PRI(WEP_BLASTER, ammo))
197 {
198 // always deplete if secondary is held
199 actor.(weaponentity).oknex_chargepool_ammo = max(0, actor.(weaponentity).oknex_chargepool_ammo - WEP_CVAR_PRI(WEP_BLASTER, ammo) * dt);
200
201 dt = min(dt, (1 - actor.(weaponentity).oknex_charge) / WEP_CVAR(WEP_OVERKILL_NEX, charge_rate));
202 actor.oknex_chargepool_pauseregen_finished = time + WEP_CVAR_SEC(WEP_OVERKILL_NEX, chargepool_pause_regen);
203 dt = min(dt, actor.(weaponentity).oknex_chargepool_ammo);
204 dt = max(0, dt);
205
206 actor.(weaponentity).oknex_charge += dt * WEP_CVAR(WEP_OVERKILL_NEX, charge_rate);
207 }
208 }
209 else if (WEP_CVAR_PRI(WEP_BLASTER, ammo))
210 {
211 if (fire & 2) // only eat ammo when the button is pressed
212 {
213 dt = min(dt, (1 - actor.(weaponentity).oknex_charge) / WEP_CVAR(WEP_OVERKILL_NEX, charge_rate));
214 if (!(actor.items & IT_UNLIMITED_AMMO))
215 {
216 // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
217 if (autocvar_g_balance_vortex_reload_ammo)
218 {
219 dt = min(dt, (actor.(weaponentity).clip_load - WEP_CVAR_PRI(WEP_OVERKILL_NEX, ammo)) / WEP_CVAR_PRI(WEP_BLASTER, ammo));
220 dt = max(0, dt);
221 if (dt > 0)
222 actor.(weaponentity).clip_load = max(WEP_CVAR_PRI(WEP_BLASTER, ammo), actor.(weaponentity).clip_load - WEP_CVAR_PRI(WEP_BLASTER, ammo) * dt);
223 actor.(weaponentity).(weapon_load[WEP_OVERKILL_NEX.m_id]) = actor.(weaponentity).clip_load;
224 }
225 else
226 {
227 dt = min(dt, (actor.(thiswep.ammo_field) - WEP_CVAR_PRI(WEP_OVERKILL_NEX, ammo)) / WEP_CVAR_PRI(WEP_BLASTER, ammo));
228 dt = max(0, dt);
229 if (dt > 0)
230 actor.(thiswep.ammo_field) = max(WEP_CVAR_PRI(WEP_BLASTER, ammo), actor.(thiswep.ammo_field) - WEP_CVAR_PRI(WEP_BLASTER, ammo) * dt);
231 }
232 }
233 actor.(weaponentity).oknex_charge += dt * WEP_CVAR(WEP_OVERKILL_NEX, charge_rate);
234 }
235 }
236
237 else
238 {
239 dt = min(dt, (1 - actor.(weaponentity).oknex_charge) / WEP_CVAR(WEP_OVERKILL_NEX, charge_rate));
240 actor.(weaponentity).oknex_charge += dt * WEP_CVAR(WEP_OVERKILL_NEX, charge_rate);
241 }
242 }
243 }
244 else if (WEP_CVAR(WEP_OVERKILL_NEX, secondary))
245 {
246 if (weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(WEP_BLASTER, refire)))
247 {
248 W_OverkillNex_Attack(thiswep, actor, weaponentity, true);
249 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_BLASTER, animtime), w_ready);
250 }
251 }
252 }
253#endif
254}
255
256METHOD(OverkillNex, wr_setup, void(entity thiswep, entity actor, .entity weaponentity))
257{
258 actor.oknex_lasthit = 0;
259}
260
261METHOD(OverkillNex, wr_checkammo1, bool(entity thiswep, entity actor, .entity weaponentity))
262{
263 float ammo_amount = GetResource(actor, thiswep.ammo_type) >= WEP_CVAR_PRI(WEP_OVERKILL_NEX, ammo);
264 ammo_amount += (autocvar_g_balance_oknex_reload_ammo && actor.(weaponentity).(weapon_load[thiswep.m_id]) >= WEP_CVAR_PRI(WEP_OVERKILL_NEX, ammo));
265 return ammo_amount;
266}
267
268METHOD(OverkillNex, wr_checkammo2, bool(entity thiswep, entity actor, .entity weaponentity))
269{
270 if (WEP_CVAR(WEP_OVERKILL_NEX, secondary))
271 {
272 // don't allow charging if we don't have enough ammo
273 float ammo_amount = GetResource(actor, thiswep.ammo_type) >= WEP_CVAR_PRI(WEP_BLASTER, ammo);
274 ammo_amount += actor.(weaponentity).(weapon_load[thiswep.m_id]) >= WEP_CVAR_PRI(WEP_BLASTER, ammo);
275 return ammo_amount;
276 }
277 else
278 return false; // zoom is not a fire mode
279}
280
281METHOD(OverkillNex, wr_resetplayer, void(entity thiswep, entity actor))
282{
283 if (WEP_CVAR(WEP_OVERKILL_NEX, charge))
284 for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
285 {
286 .entity weaponentity = weaponentities[slot];
287 actor.(weaponentity).oknex_charge = WEP_CVAR(WEP_OVERKILL_NEX, charge_start);
288 }
289 actor.oknex_lasthit = 0;
290}
291
292METHOD(OverkillNex, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
293{
294 W_Reload(actor, weaponentity, WEP_CVAR_PRI(WEP_OVERKILL_NEX, ammo), SND_RELOAD);
295}
296
297METHOD(OverkillNex, wr_suicidemessage, Notification(entity thiswep))
298{
299 return WEAPON_THINKING_WITH_PORTALS;
300}
301
302METHOD(OverkillNex, wr_killmessage, Notification(entity thiswep))
303{
304 return WEAPON_OVERKILL_NEX_MURDER;
305}
306
307METHOD(OverkillNex, wr_zoom, bool(entity thiswep, entity actor))
308{
309 return PHYS_INPUT_BUTTON_ATCK2(actor) && !WEP_CVAR(WEP_OVERKILL_NEX, secondary);
310}
311
312#endif // SVQC
313#ifdef CSQC
314
315METHOD(OverkillNex, wr_impacteffect, void(entity thiswep, entity actor))
316{
317 entity this = actor;
318 vector org2 = w_org + w_backoff * 2;
319 pointparticles(EFFECT_VORTEX_IMPACT, org2, '0 0 0', 1);
320 if (!w_issilent)
321 sound(this, CH_SHOTS, SND_OK_NEX_IMPACT, VOL_BASE, ATTN_NORM);
322}
323
324METHOD(OverkillNex, wr_init, void(entity thiswep))
325{
327 precache_pic(thiswep.w_reticle);
328}
329
330METHOD(OverkillNex, wr_zoom, bool(entity thiswep, entity actor))
331{
332 if (button_zoom || zoomscript_caught || (!WEP_CVAR(WEP_OVERKILL_NEX, secondary) && button_attack2))
333 return true;
334 else // no weapon specific image for this weapon
335 return false;
336}
337
338METHOD(OverkillNex, wr_zoomdir, bool(entity thiswep))
339{
340 return button_attack2 && !WEP_CVAR(WEP_OVERKILL_NEX, secondary);
341}
342
343#endif // CSQC
344#ifdef MENUQC
347
348METHOD(OverkillNex, describe, string(OverkillNex this))
349{
350 TC(OverkillNex, this);
352 PAR(_("The %s fires harmful beams of energy that traverse the map instantaneously and deal a significant chunk of damage on impact."), COLORED_NAME(this));
353 PAR(_("Like with all %s weapons, the secondary fire shoots a laser which doesn't damage or push enemies, but can be used to push yourself around."), COLORED_NAME(MUTATOR_ok));
354 PAR(_("The primary fire consumes %s ammo, although you spawn with an infinite amount of it in %s. "
355 "It has a limited magazine size, so needs reloading after several shots."), COLORED_NAME(ITEM_Cells), COLORED_NAME(MUTATOR_ok));
356 PAR(_("Since it is the only %s weapon with no spread, the %s stands out at long ranges."), COLORED_NAME(MUTATOR_ok), COLORED_NAME(this));
357 PAR(W_Guide_Keybinds(this));
358 PAR(W_Guide_DPS_onlyOne(this.netname, "primary"));
359 return PAGE_TEXT;
360}
361
362#endif // MENUQC
void animdecide_setaction(entity e, float action, float restart)
const int ANIMACTION_SHOOT
bool bot_aim(entity this,.entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, float applygravity, bool shot_accurate)
#define REGISTER_MUTATOR(...)
Definition base.qh:295
#define MUTATOR_HOOKFUNCTION(...)
Definition base.qh:335
void W_Blaster_Attack(entity actor,.entity weaponentity)
Definition blaster.qc:52
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition weapon.qh:42
int m_id
Definition weapon.qh:43
string netname
Definition powerups.qc:20
bool button_zoom
Definition main.qh:113
bool button_attack2
Definition main.qh:116
#define colormapPaletteColor(c, isPants)
Definition color.qh:5
#define COLORED_NAME(this)
Definition color.qh:195
const int IT_UNLIMITED_AMMO
Definition item.qh:23
#define M_ARGV(x, type)
Definition events.qh:17
bool IsFlying(entity this)
Definition player.qc:843
#define PHYS_INPUT_TIMELENGTH
Definition player.qh:253
#define PHYS_INPUT_BUTTON_ZOOMSCRIPT(s)
Definition player.qh:163
#define PHYS_INPUT_BUTTON_ATCK(s)
Definition player.qh:152
#define PHYS_INPUT_BUTTON_ZOOM(s)
Definition player.qh:155
#define PHYS_INPUT_BUTTON_ATCK2(s)
Definition player.qh:154
float W_WeaponRateFactor(entity this)
bool autocvar_cl_reticle_weapon
Definition crosshair.qh:5
bool autocvar_cl_reticle
Definition crosshair.qh:3
float frametime
float time
const float ATTN_NORM
float yoda
Definition damage.qh:48
int impressive_hits
Definition damage.qh:49
vector w_org
vector w_backoff
float w_issilent
#define pointparticles(effect, org, vel, howmany)
Definition effect.qh:7
#define TC(T, sym)
Definition _all.inc:82
string precache_pic(string name,...)
float vlen(vector v)
float min(float f,...)
float max(float f,...)
#define LAMBDA(...)
Definition misc.qh:34
void Send_Notification(NOTIF broadcast, entity client, MSG net_type, Notification net_name,...count)
Definition all.qc:1573
entity Notification
always last
Definition all.qh:81
void W_OverkillNex_Attack(Weapon thiswep, entity actor,.entity weaponentity, bool is_secondary)
Definition oknex.qc:58
float oknex_lasthit
Definition oknex.qc:4
float oknex_chargepool_pauseregen_finished
Definition oknex.qc:111
#define METHOD(cname, name, prototype)
Definition oo.qh:269
#define makevectors
Definition post.qh:21
vector
Definition self.qh:92
void GetPressedKeys(entity this)
Definition client.qc:1762
const float VOL_BASE
Definition sound.qh:36
const int CH_SHOTS
Definition sound.qh:14
const int CH_WEAPON_A
Definition sound.qh:7
#define sound(e, c, s, v, a)
Definition sound.qh:52
const int CH_WEAPON_B
Definition sound.qh:8
#define PAGE_TEXT
Definition string.qh:642
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
Definition string.qh:648
#define PAGE_TEXT_INIT()
Definition string.qh:641
float ammo
Definition sv_turrets.qh:43
void FireRailgunBullet(entity this,.entity weaponentity, vector start, vector end, float bdamage, bool headshot_notify, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, int deathtype)
Definition tracing.qc:231
vector w_shotdir
Definition tracing.qh:20
vector w_shotorg
Definition tracing.qh:19
#define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype)
Definition tracing.qh:34
#define IS_SPEC(v)
Definition utils.qh:10
#define FOREACH_CLIENT(cond, body)
Definition utils.qh:52
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
Definition vector.qh:8
#define vec2(...)
Definition vector.qh:90
float zoomscript_caught
Definition view.qh:121
void SendCSQCVortexBeamParticle(entity player, float charge)
Definition vortex.qc:37
void wframe_send(entity actor, entity weaponentity, int wepframe, float attackrate, bool restartanim)
Definition all.qc:577
string W_Guide_Keybinds(Weapon wep)
Definition all.qc:824
string W_Guide_DPS_onlyOne(string name, string fire)
Definition all.qc:914
#define WEP_CVAR_PRI(wep, name)
Definition all.qh:338
#define WEP_CVAR_BOTH(wep, isprimary, name)
Definition all.qh:340
WFRAME wframe
Definition all.qh:439
#define WEP_CVAR(wep, name)
Definition all.qh:337
#define WEP_CVAR_SEC(wep, name)
Definition all.qh:339
const int MAX_WEAPONSLOTS
Definition weapon.qh:16
int max_shot_distance
Definition weapon.qh:245
entity weaponentities[MAX_WEAPONSLOTS]
Definition weapon.qh:17
void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use,.entity weaponentity)
void W_Reload(entity actor,.entity weaponentity, float sent_ammo_min, Sound sent_sound)
void weapon_thinkf(entity actor,.entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,.entity weaponentity, int fire) func)
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)
const int W_TICSPERFRAME
float autocvar_g_weaponratefactor
float weapon_load[REGISTRY_MAX(Weapons)]
float oknex_charge
Definition wepent.qh:8
int clip_load
Definition wepent.qh:14
float oknex_chargepool_ammo
Definition wepent.qh:9