12 if (!
WEP_CVAR(oknex, charge))
return '0 0 0';
13 float charge = wepent.oknex_charge;
14 float animlimit =
WEP_CVAR(oknex, charge_animlimit);
15 float f = autocvar_g_weapon_charge_colormod_hdrmultiplier *
min(1, charge / animlimit);
17 g.x = f * autocvar_g_weapon_charge_colormod_red_half;
18 g.y = f * autocvar_g_weapon_charge_colormod_green_half;
19 g.z = f * autocvar_g_weapon_charge_colormod_blue_half;
20 if (charge > animlimit)
22 f = autocvar_g_weapon_charge_colormod_hdrmultiplier * (charge - animlimit) / (1 - animlimit);
23 g.x += f * autocvar_g_weapon_charge_colormod_red_full;
24 g.y += f * autocvar_g_weapon_charge_colormod_green_full;
25 g.z += f * autocvar_g_weapon_charge_colormod_blue_full;
49 if (player.(weaponentity).m_weapon == WEP_OVERKILL_NEX &&
WEP_CVAR(oknex, charge) &&
WEP_CVAR(oknex, charge_velocity_rate) &&
vdist(
vec2(player.velocity), >,
WEP_CVAR(oknex, charge_minspeed)))
51 float xyspeed =
vlen(
vec2(player.velocity));
53 xyspeed =
min(xyspeed,
WEP_CVAR(oknex, charge_maxspeed));
54 float f = (xyspeed -
WEP_CVAR(oknex, charge_minspeed)) / (
WEP_CVAR(oknex, charge_maxspeed) -
WEP_CVAR(oknex, charge_minspeed));
56 player.(weaponentity).
oknex_charge =
min(1, player.(weaponentity).oknex_charge +
WEP_CVAR(oknex, charge_velocity_rate) * f * PHYS_INPUT_TIMELENGTH);
61 void W_OverkillNex_Attack(
Weapon thiswep,
entity actor, .
entity weaponentity,
float issecondary)
63 float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo, charge;
67 mymindist =
WEP_CVAR_BOTH(oknex, !issecondary, damagefalloff_mindist);
68 mymaxdist =
WEP_CVAR_BOTH(oknex, !issecondary, damagefalloff_maxdist);
69 myhalflife =
WEP_CVAR_BOTH(oknex, !issecondary, damagefalloff_halflife);
70 myforcehalflife =
WEP_CVAR_BOTH(oknex, !issecondary, damagefalloff_forcehalflife);
78 charge =
WEP_CVAR(oknex, charge_mindmg) / mydmg + (1 -
WEP_CVAR(oknex, charge_mindmg) / mydmg) * actor.(weaponentity).oknex_charge;
91 if(charge >
WEP_CVAR(oknex, charge_animlimit) &&
WEP_CVAR(oknex, charge_animlimit))
98 FireRailgunBullet(actor, weaponentity,
w_shotorg,
w_shotorg +
w_shotdir * max_shot_distance, mydmg,
true, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, thiswep.
m_id);
101 Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
104 Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
111 SendCSQCVortexBeamParticle(charge);
116 .float oknex_chargepool_pauseregen_finished;
120 if(
bot_aim(actor, weaponentity, 1000000, 0, 1,
false))
131 if (
WEP_CVAR(oknex, charge) && actor.(weaponentity).oknex_charge <
WEP_CVAR(oknex, charge_limit))
137 if (actor.(weaponentity).oknex_chargepool_ammo < 1)
139 if (actor.oknex_chargepool_pauseregen_finished <
time)
141 actor.pauseregen_finished =
max(actor.pauseregen_finished,
time +
WEP_CVAR_SEC(oknex, chargepool_pause_regen));
144 if ((
WEP_CVAR_SEC(oknex, refire_type) == 1) && (fire & 2) && (
time >= actor.jump_interval))
148 BLASTER_SECONDARY_ATTACK(oknex, actor, weaponentity);
149 if ((actor.(weaponentity).wframe == WFRAME_IDLE) ||
150 (actor.(weaponentity).wframe == WFRAME_FIRE2))
153 actor.(weaponentity).wframe = WFRAME_FIRE2;
155 if (it == actor || (
IS_SPEC(it) && it.enemy == actor))
157 wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, autocvar_g_weaponratefactor, true);
164 if (autocvar_g_balance_oknex_reload_ammo && actor.(weaponentity).clip_load <
WEP_CVAR_PRI(oknex,
ammo))
167 thiswep.wr_reload(thiswep, actor, weaponentity);
176 W_OverkillNex_Attack(thiswep, actor, weaponentity, 0);
187 BLASTER_SECONDARY_ATTACK(oknex, actor, weaponentity);
268 actor.oknex_lasthit = 0;
274 ammo_amount += (autocvar_g_balance_oknex_reload_ammo && actor.(weaponentity).(
weapon_load[thiswep.m_id]) >=
WEP_CVAR_PRI(oknex,
ammo));
302 actor.oknex_lasthit = 0;
312 return WEAPON_THINKING_WITH_PORTALS;
317 return WEAPON_OVERKILL_NEX_MURDER;
331 vector org2 = w_org + w_backoff * 6;
#define WEP_CVAR_PRI(wepname, name)
#define PHYS_INPUT_BUTTON_ATCK2(s)
bool bot_aim(entity this,.entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, float applygravity)
#define WEP_CVAR_SEC(wepname, name)
float weapon_load[REGISTRY_MAX(Weapons)]
#define REGISTER_MUTATOR(id, dependence)
#define FOREACH_CLIENT(cond, body)
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)
#define WEP_CVAR(wepname, name)
#define METHOD(cname, name, prototype)
float oknex_chargepool_ammo
const int MAX_WEAPONSLOTS
void GetPressedKeys(entity this)
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
void animdecide_setaction(entity e, float action, float restart)
#define WEP_CVAR_BOTH(wepname, isprimary, name)
#define PHYS_INPUT_BUTTON_ATCK(s)
const int ANIMACTION_SHOOT
#define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype)
bool autocvar_cl_reticle_weapon
bool IsFlying(entity this)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
entity Notification
always last
void weapon_thinkf(entity actor,.entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,.entity weaponentity, int fire) func)
entity weaponentities[MAX_WEAPONSLOTS]
#define MUTATOR_HOOKFUNCTION(...)
void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use,.entity weaponentity)
#define sound(e, c, s, v, a)
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)
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
float W_WeaponRateFactor(entity this)
void W_Reload(entity actor,.entity weaponentity, float sent_ammo_min, Sound sent_sound)