12 float animlimit =
WEP_CVAR(WEP_VORTEX, charge_animlimit);
13 float f =
min(1, charge / animlimit);
15 vector g = f * (mycolors * 0.3);
16 if (charge > animlimit)
18 f = (charge - animlimit) / (1 - animlimit);
19 g += f * (mycolors * 0.7);
61 charge =
sqrt(charge);
94 if (!
WEP_CVAR(WEP_VORTEX, charge) || !
WEP_CVAR(WEP_VORTEX, charge_velocity_rate))
101 if (player.(weaponentity).m_weapon == WEP_VORTEX &&
WEP_CVAR(WEP_VORTEX, charge) &&
WEP_CVAR(WEP_VORTEX, charge_velocity_rate) &&
vdist(
vec2(player.velocity), >,
WEP_CVAR(WEP_VORTEX, charge_minspeed)))
103 float xyspeed =
vlen(
vec2(player.velocity));
105 xyspeed =
min(xyspeed,
WEP_CVAR(WEP_VORTEX, charge_maxspeed));
106 float f = (xyspeed -
WEP_CVAR(WEP_VORTEX, charge_minspeed)) / (
WEP_CVAR(WEP_VORTEX, charge_maxspeed) -
WEP_CVAR(WEP_VORTEX, charge_minspeed));
115 float mydmg =
WEP_CVAR_BOTH(WEP_VORTEX, !is_secondary, damage);
116 float myforce =
WEP_CVAR_BOTH(WEP_VORTEX, !is_secondary, force);
118 float dtype = thiswep.
m_id;
127 charge =
WEP_CVAR(WEP_VORTEX, charge_mindmg) / mydmg + (1 -
WEP_CVAR(WEP_VORTEX, charge_mindmg) / mydmg) * actor.(weaponentity).vortex_charge;
138 if (
WEP_CVAR(WEP_VORTEX, charge_animlimit) && charge >
WEP_CVAR(WEP_VORTEX, charge_animlimit))
147 WEP_CVAR_BOTH(WEP_VORTEX, !is_secondary, damagefalloff_mindist),
148 WEP_CVAR_BOTH(WEP_VORTEX, !is_secondary, damagefalloff_maxdist),
149 WEP_CVAR_BOTH(WEP_VORTEX, !is_secondary, damagefalloff_halflife),
150 WEP_CVAR_BOTH(WEP_VORTEX, !is_secondary, damagefalloff_forcehalflife),
176 if (
WEP_CVAR(WEP_VORTEX, charge) && actor.(weaponentity).vortex_charge <
WEP_CVAR(WEP_VORTEX, charge_limit))
177 actor.(weaponentity).
vortex_charge =
min(1, actor.(weaponentity).vortex_charge +
WEP_CVAR(WEP_VORTEX, charge_rate) * dt);
182 if (
bot_aim(actor, weaponentity, 1000000, 0, 1,
false,
true))
187 if (!
WEP_CVAR(WEP_VORTEX, charge_always))
191 && actor.(weaponentity).vortex_chargepool_ammo < 1)
193 if (actor.vortex_chargepool_pauseregen_finished <
time)
195 actor.pauseregen_finished =
max(actor.pauseregen_finished,
time +
WEP_CVAR_SEC(WEP_VORTEX, chargepool_pause_regen));
200 thiswep.wr_reload(thiswep, actor, weaponentity);
219 if (actor.(weaponentity).vortex_charge < 1)
228 dt =
min(dt, (1 - actor.(weaponentity).vortex_charge) /
WEP_CVAR(WEP_VORTEX, charge_rate));
229 actor.vortex_chargepool_pauseregen_finished =
time +
WEP_CVAR_SEC(WEP_VORTEX, chargepool_pause_regen);
230 dt =
bound(0, dt, actor.(weaponentity).vortex_chargepool_ammo);
239 dt =
min(dt, (1 - actor.(weaponentity).vortex_charge) /
WEP_CVAR(WEP_VORTEX, charge_rate));
243 if (autocvar_g_balance_vortex_reload_ammo)
262 dt =
min(dt, (1 - actor.(weaponentity).vortex_charge) /
WEP_CVAR(WEP_VORTEX, charge_rate));
267 else if (
WEP_CVAR(WEP_VORTEX, secondary))
279 actor.vortex_lasthit = 0;
284 ammo_amount += (autocvar_g_balance_vortex_reload_ammo && actor.(weaponentity).(weapon_load[thiswep.m_id]) >=
WEP_CVAR_PRI(WEP_VORTEX,
ammo));
289 if (
WEP_CVAR(WEP_VORTEX, secondary))
310 actor.vortex_lasthit = 0;
318 return WEAPON_THINKING_WITH_PORTALS;
322 return WEAPON_VORTEX_MURDER;
367 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));
368 PAR(_(
"The secondary fire zooms in when held, allowing for ease of aiming."));
369 PAR(_(
"It consumes %s ammo for each shot."),
COLORED_NAME(ITEM_Cells));
370 PAR(_(
"Unlike the %s, the %s doesn't need to be reloaded manually, although you have to wait a couple seconds between shots. "
371 "Uniquely, it can be fired slightly before it finishes completely reloading, albeit with the tradeoff of dealing slightly less damage."),
COLORED_NAME(WEP_RIFLE),
COLORED_NAME(
this));
372 PAR(_(
"Similar to the %s, the %s can be used at any range, but it stands out at long ranges."),
COLORED_NAME(WEP_RIFLE),
COLORED_NAME(
this));
bool bot_aim(entity this,.entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, float applygravity, bool shot_accurate)
#define MUTATOR_CALLHOOK(id,...)
#define REGISTER_MUTATOR(...)
#define MUTATOR_HOOKFUNCTION(...)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void SetResource(entity e, Resource res_type, float amount)
Sets the current amount of resource the given entity will have.
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)
bool autocvar_cl_reticle_weapon
vector particles_colormin
vector particles_colormax
const int HITTYPE_ARMORPIERCE
#define particleeffectnum(e)
int entcs_GetClientColors(int i)
#define NET_HANDLE(id, param)
#define WriteHeader(to, id)
#define REGISTER_NET_TEMP(id)
void WarpZone_TrailParticles_WithMultiplier(entity own, float eff, vector org, vector end, float f, int boxflags)
vector WarpZone_UnTransformOrigin(entity wz, vector v)
entity WarpZone_trace_transform
void Send_Notification(NOTIF broadcast, entity client, MSG net_type, Notification net_name,...count)
entity Notification
always last
#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 vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
void SendCSQCVortexBeamParticle(entity player, float charge)
vector vortex_glowcolor(int actor_colors, float charge)
void W_Vortex_Charge(entity actor,.entity weaponentity, float dt)
float vortex_chargepool_pauseregen_finished
void W_Vortex_Attack(Weapon thiswep, entity actor,.entity weaponentity, bool is_secondary)
float vortex_charge_rottime
bool autocvar_cl_particles_oldvortexbeam
string W_Guide_Keybinds(Weapon wep)
void W_MuzzleFlash(Weapon thiswep, entity actor,.entity weaponentity, vector shotorg, vector shotdir)
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]
int autocvar_cl_tracers_teamcolor
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 weapon_load[REGISTRY_MAX(Weapons)]
float vortex_chargepool_ammo