11 if (!
WEP_CVAR(WEP_OVERKILL_NEX, charge))
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);
17 vector g = f * (mycolors * 0.3);
18 if (charge > animlimit)
20 f = (charge - animlimit) / (1 - animlimit);
21 g += f * (mycolors * 0.7);
39 if (!
WEP_CVAR(WEP_OVERKILL_NEX, charge) || !
WEP_CVAR(WEP_OVERKILL_NEX, charge_velocity_rate))
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)))
48 float xyspeed =
vlen(
vec2(player.velocity));
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));
60 float mydmg =
WEP_CVAR_BOTH(WEP_OVERKILL_NEX, !is_secondary, damage);
61 float myforce =
WEP_CVAR_BOTH(WEP_OVERKILL_NEX, !is_secondary, force);
66 if (
WEP_CVAR(WEP_OVERKILL_NEX, charge))
68 charge =
WEP_CVAR(WEP_OVERKILL_NEX, charge_mindmg) / mydmg + (1 -
WEP_CVAR(WEP_OVERKILL_NEX, charge_mindmg) / mydmg) * actor.(weaponentity).oknex_charge;
79 if (charge >
WEP_CVAR(WEP_OVERKILL_NEX, charge_animlimit) &&
WEP_CVAR(WEP_OVERKILL_NEX, charge_animlimit))
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),
115 if (
bot_aim(actor, weaponentity, 1000000, 0, 1,
false,
true))
119 if (
WEP_CVAR(WEP_OVERKILL_NEX, charge))
126 if (
WEP_CVAR(WEP_OVERKILL_NEX, charge) && actor.(weaponentity).oknex_charge <
WEP_CVAR(WEP_OVERKILL_NEX, charge_limit))
130 && actor.(weaponentity).oknex_chargepool_ammo < 1)
132 if (actor.oknex_chargepool_pauseregen_finished <
time)
134 actor.pauseregen_finished =
max(actor.pauseregen_finished,
time +
WEP_CVAR_SEC(WEP_OVERKILL_NEX, chargepool_pause_regen));
137 if (
WEP_CVAR_SEC(WEP_OVERKILL_NEX, refire_type) == 1 && (fire & 2)
138 &&
time >= actor.jump_interval)
144 if (actor.(weaponentity).wframe == WFRAME_IDLE
145 || actor.(weaponentity).wframe == WFRAME_FIRE2)
148 actor.(weaponentity).
wframe = WFRAME_FIRE2;
150 if (it == actor || (
IS_SPEC(it) && it.enemy == actor))
157 if (autocvar_g_balance_oknex_reload_ammo && actor.(weaponentity).clip_load <
WEP_CVAR_PRI(WEP_OVERKILL_NEX,
ammo))
160 thiswep.wr_reload(thiswep, actor, weaponentity);
171 if ((fire & 2) &&
WEP_CVAR(WEP_OVERKILL_NEX, secondary) == 2 &&
WEP_CVAR_SEC(WEP_OVERKILL_NEX, refire_type) == 0)
183 if ((
WEP_CVAR(WEP_OVERKILL_NEX, charge) &&
WEP_CVAR(WEP_OVERKILL_NEX, secondary) == 1)
187 if (
WEP_CVAR(WEP_OVERKILL_NEX, charge))
189 actor.(weaponentity).oknex_charge_rottime =
time +
WEP_CVAR(WEP_OVERKILL_NEX, charge_rot_pause);
192 if (actor.(weaponentity).oknex_charge < 1)
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);
213 dt =
min(dt, (1 - actor.(weaponentity).oknex_charge) /
WEP_CVAR(WEP_OVERKILL_NEX, charge_rate));
217 if (autocvar_g_balance_vortex_reload_ammo)
239 dt =
min(dt, (1 - actor.(weaponentity).oknex_charge) /
WEP_CVAR(WEP_OVERKILL_NEX, charge_rate));
244 else if (
WEP_CVAR(WEP_OVERKILL_NEX, secondary))
258 actor.oknex_lasthit = 0;
264 ammo_amount += (autocvar_g_balance_oknex_reload_ammo && actor.(weaponentity).(weapon_load[thiswep.m_id]) >=
WEP_CVAR_PRI(WEP_OVERKILL_NEX,
ammo));
270 if (
WEP_CVAR(WEP_OVERKILL_NEX, secondary))
283 if (
WEP_CVAR(WEP_OVERKILL_NEX, charge))
289 actor.oknex_lasthit = 0;
299 return WEAPON_THINKING_WITH_PORTALS;
304 return WEAPON_OVERKILL_NEX_MURDER;
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));
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(...)
#define MUTATOR_HOOKFUNCTION(...)
void W_Blaster_Attack(entity actor,.entity weaponentity)
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...
#define colormapPaletteColor(c, isPants)
#define COLORED_NAME(this)
const int IT_UNLIMITED_AMMO
bool IsFlying(entity this)
#define PHYS_INPUT_TIMELENGTH
#define PHYS_INPUT_BUTTON_ZOOMSCRIPT(s)
#define PHYS_INPUT_BUTTON_ATCK(s)
#define PHYS_INPUT_BUTTON_ZOOM(s)
#define PHYS_INPUT_BUTTON_ATCK2(s)
float W_WeaponRateFactor(entity this)
bool autocvar_cl_reticle_weapon
#define pointparticles(effect, org, vel, howmany)
void Send_Notification(NOTIF broadcast, entity client, MSG net_type, Notification net_name,...count)
entity Notification
always last
void W_OverkillNex_Attack(Weapon thiswep, entity actor,.entity weaponentity, bool is_secondary)
float oknex_chargepool_pauseregen_finished
#define METHOD(cname, name, prototype)
void GetPressedKeys(entity this)
#define sound(e, c, s, v, a)
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
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)
#define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype)
#define FOREACH_CLIENT(cond, body)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
void SendCSQCVortexBeamParticle(entity player, float charge)
void wframe_send(entity actor, entity weaponentity, int wepframe, float attackrate, bool restartanim)
string W_Guide_Keybinds(Weapon wep)
string W_Guide_DPS_onlyOne(string name, string fire)
#define WEP_CVAR_PRI(wep, name)
#define WEP_CVAR_BOTH(wep, isprimary, name)
#define WEP_CVAR(wep, name)
#define WEP_CVAR_SEC(wep, name)
const int MAX_WEAPONSLOTS
entity weaponentities[MAX_WEAPONSLOTS]
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)
float autocvar_g_weaponratefactor
float weapon_load[REGISTRY_MAX(Weapons)]
float oknex_chargepool_ammo