11 this.move_time =
time;
16 this.
scale = (
WEP_CVAR(WEP_ELECTRO, combo_radius) * 0.05) * myscale;
23 setsize(e,
'-4 -4 -4',
'4 4 4');
25 setorigin(e, e.origin);
32 e.avelocity =
'7 0 11';
43 Net_Accept(Electro_Orb);
46 setorigin(
this, this.
origin);
60 WriteVector(channel, this.
origin);
76 for (; e; e = e.chain)
77 if (e.classname ==
"electro_orb")
85 if (
WEP_CVAR(WEP_ELECTRO, combo_comboradius_thruwall))
88 if (
vdist(e.WarpZone_findradius_dist, >,
WEP_CVAR(WEP_ELECTRO, combo_comboradius_thruwall)))
102 e.classname =
"electro_orb_chain";
109 ?
vlen(e.WarpZone_findradius_dist) /
WEP_CVAR(WEP_ELECTRO, combo_speed)
121 float dmg_remaining_next =
bound(0, 1 - dt /
WEP_CVAR(WEP_ELECTRO, combo_duration), 1);
123 float f = this.
dmg_last - dmg_remaining_next;
127 f *
WEP_CVAR(WEP_ELECTRO, combo_damage),
128 f *
WEP_CVAR(WEP_ELECTRO, combo_edgedamage),
129 WEP_CVAR(WEP_ELECTRO, combo_radius),
139 if (dt <
WEP_CVAR(WEP_ELECTRO, combo_duration))
149 newproj.solid = this.
solid;
150 setorigin(newproj, this.
origin);
151 setmodel(newproj, MDL_PROJECTILE_ELECTRO);
152 setsize(newproj, this.
mins, this.
maxs);
153 newproj.owner = this.
owner;
160 newproj.teleport_time =
time;
161 newproj.dmg_last = 1;
165 newproj.SendFlags = 0xFFFFFF;
176 if (
WEP_CVAR(WEP_ELECTRO, combo_duration))
185 WEP_CVAR(WEP_ELECTRO, combo_damage),
186 WEP_CVAR(WEP_ELECTRO, combo_edgedamage),
187 WEP_CVAR(WEP_ELECTRO, combo_radius),
192 this.weaponentity_fld,
271 for (; e; e = e.chain)
272 if (e.classname ==
"electro_orb")
280 if (this.
owner == e.owner)
283 explode =
WEP_CVAR_PRI(WEP_ELECTRO, midaircombo_teammate);
292 e.classname =
"electro_orb_chain";
300 ?
vlen(e.WarpZone_findradius_dist) /
WEP_CVAR_PRI(WEP_ELECTRO, midaircombo_speed)
309 if (found &&
WEP_CVAR_PRI(WEP_ELECTRO, midaircombo_explode))
338 entity proj =
new(electro_bolt);
339 proj.owner = proj.realowner = actor;
340 proj.bot_dodge =
true;
341 proj.bot_dodgerating =
WEP_CVAR_PRI(WEP_ELECTRO, damage);
344 proj.nextthink =
time;
347 proj.projectiledeathtype = thiswep.
m_id;
348 proj.weaponentity_fld = weaponentity;
356 setsize(proj,
'0 0 -3',
'0 0 -3');
408 newproj.owner = this.
owner;
411 setorigin(newproj, this.
origin);
412 setmodel(newproj, MDL_PROJECTILE_ELECTRO);
413 setsize(newproj, this.
mins, this.
maxs);
415 newproj.traileffectnum = _particleeffectnum(EFFECT_TR_NEXUIZPLASMA.eent_eff_name);
422 newproj.event_damage = this.event_damage;
424 newproj.damagedbycontents =
true;
436 newproj.use = this.
use;
437 newproj.flags = this.
flags;
452 newproj.nextthink =
time;
457 newproj.nextthink = newproj.death_time;
466 else if (
toucher.owner !=
this.owner &&
toucher.classname !=
this.classname)
488 float is_combo = (inflictor.classname ==
"electro_orb_chain" || inflictor.classname ==
"electro_bolt");
539 entity proj =
new(electro_orb);
540 proj.owner = proj.realowner = actor;
543 proj.bot_dodge =
true;
544 proj.bot_dodgerating =
WEP_CVAR_SEC(WEP_ELECTRO, damage);
549 proj.weaponentity_fld = weaponentity;
557 setsize(proj,
'-4 -4 -4',
'4 4 4');
566 if (proj.damagedbycontents)
588 if (actor.(weaponentity).electro_count > 1
598 w_ready(thiswep, actor, weaponentity, fire);
606 if (
vdist(actor.origin - actor.enemy.origin, >, 1000))
607 actor.bot_secondary_electromooth =
false;
608 if (!actor.bot_secondary_electromooth)
612 :
bot_aim(actor, weaponentity, 1000000, 0, 0.001,
false,
true);
618 actor.bot_secondary_electromooth =
true;
627 actor.bot_secondary_electromooth =
false;
634 if (autocvar_g_balance_electro_reload_ammo)
636 float ammo_amount = 0;
644 thiswep.wr_reload(thiswep, actor, weaponentity);
681 if (
WEP_CVAR(WEP_ELECTRO, combo_safeammocheck))
702 return WEAPON_ELECTRO_SUICIDE_ORBS;
704 return WEAPON_ELECTRO_SUICIDE_BOLT;
711 return WEAPON_ELECTRO_MURDER_ORBS;
716 return WEAPON_ELECTRO_MURDER_COMBO;
718 return WEAPON_ELECTRO_MURDER_BOLT;
761 PAR(_(
"The %s shoots electric balls forwards, dealing some splash damage when they burst on impact."),
COLORED_NAME(
this));
762 PAR(_(
"The secondary fire launches orbs that are influenced by gravity, "
763 "so they can be laid around the map at high traffic locations (like at %s flag bases) to damage enemies that walk by. "
764 "The orbs burst after some time, and can be forced to burst in a \"combo\" if a primary fire ball bursts near them."),
COLORED_NAME(MAPINFO_TYPE_CTF));
765 PAR(_(
"It consumes some %s ammo for each ball / orb."),
COLORED_NAME(ITEM_Cells));
766 PAR(_(
"The %s is one of the best spam weapons to use in crowded areas, since combos can deal tons of damage, if the enemy is close enough. "
767 "Since the primary fire doesn't travel particularly fast, the %s is not useful in many other situations."),
COLORED_NAME(
this),
COLORED_NAME(
this));
bool bot_aim(entity this,.entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, float applygravity, bool shot_accurate)
IntrusiveList g_bot_dodge
#define MUTATOR_CALLHOOK(id,...)
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.
void TakeResource(entity receiver, Resource res_type, float amount)
Takes an entity some resource.
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
IntrusiveList g_drawables
#define COLORED_NAME(this)
#define setmodel(this, m)
bool IsFlying(entity this)
#define PHYS_INPUT_BUTTON_ATCK(s)
#define PHYS_INPUT_BUTTON_ATCK2(s)
float W_WeaponRateFactor(entity this)
void SetMovetypeFollow(entity ent, entity e)
int LostMovetypeFollow(entity ent)
const float MOVE_NOMONSTERS
vector trace_plane_normal
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype,.entity weaponentity, entity directhitentity)
IntrusiveList g_damagedbycontents
const int HITTYPE_BOUNCE
set manually after projectile has bounced
const int HITTYPE_SPAM
set manually after first RadiusDamage, stops effect spam
const int HITTYPE_SECONDARY
#define pointparticles(effect, org, vel, howmany)
void W_Electro_TouchExplode(entity this, entity toucher)
void electro_orb_draw(entity this)
void W_Electro_Explode_use(entity this, entity actor, entity trigger)
void W_Electro_Attack_Bolt(Weapon thiswep, entity actor,.entity weaponentity)
void W_Electro_Orb_ExplodeOverTime(entity this)
void W_Electro_Orb_Touch(entity this, entity toucher)
bool electro_orb_send(entity this, entity to, int sf)
void W_Electro_Bolt_Think(entity this)
void W_Electro_Explode(entity this, entity directhitentity)
bool bot_secondary_electromooth
void W_Electro_ExplodeComboThink(entity this)
void W_Electro_Attack_Orb(Weapon thiswep, entity actor,.entity weaponentity)
void electro_orb_setup(entity e)
const float ELECTRO_COMBO_OVERTIME_DELAY
void W_Electro_Orb_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
void W_Electro_CheckAttack(Weapon thiswep, entity actor,.entity weaponentity, int fire)
void W_Electro_Orb_Follow_Think(entity this)
void W_Electro_Orb_Stick(entity this, entity to)
void W_Electro_TriggerCombo(vector org, float rad, entity own)
void W_Electro_ExplodeCombo(entity this)
IntrusiveList LimitedElectroBallRubbleList
float electro_secondarytime
WriteByte(chan, ent.angles.y/DEC_FACTOR)
SetResourceExplicit(ent, RES_ARMOR, ReadByte() *DEC_FACTOR)) ENTCS_PROP(NAME
int entcs_GetClientColors(int i)
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
ERASEABLE bool IL_CONTAINS(IntrusiveList this, entity it)
#define NET_HANDLE(id, param)
#define WriteHeader(to, id)
#define REGISTER_NET_LINKED(id)
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
entity WarpZone_FindRadius(vector org, float rad, bool needlineofsight)
void WarpZone_TraceLine(vector org, vector end, float nomonsters, entity forent)
void set_movetype(entity this, int mt)
const int MOVETYPE_FOLLOW
const int MOVETYPE_BOUNCE
void Send_Notification(NOTIF broadcast, entity client, MSG net_type, Notification net_name,...count)
entity Notification
always last
#define METHOD(cname, name, prototype)
const int PROJECTILE_ELECTRO
const int PROJECTILE_ELECTRO_BEAM
float health
Legacy fields for the resources. To be removed.
void LimitedChildrenRubble(IntrusiveList list, string cname, int limit, void(entity) deleteproc, entity parent)
entity ListNewChildRubble(IntrusiveList list, entity child)
entity ReplaceOldListedChildRubble(IntrusiveList list, entity child, entity oldChild)
#define IS_INDEPENDENT_PLAYER(e)
float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception)
void adaptor_think2use_hittype_splash(entity this)
#define PROJECTILE_TOUCH(e, t)
IntrusiveList g_projectiles
#define PROJECTILE_MAKETRIGGER(e)
#define sound(e, c, s, v, a)
float spamsound(entity e, int chan, Sound samp, float vol, float _atten)
use this one if you might be causing spam (e.g.
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
#define W_SetupShot_ProjectileSize(ent, wepent, mi, ma, antilag, recoil, snd, chan, maxdamage, deathtype)
#define W_SetupProjVelocity_PRI(ent, wep)
#define W_SetupProjVelocity_UP_SEC(ent, wep)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt().
string W_Guide_Keybinds(Weapon wep)
void W_MuzzleFlash(Weapon thiswep, entity actor,.entity weaponentity, vector shotorg, vector shotdir)
string W_Guide_DPS_secondaryMultishotWithCombo(string name, string pri, string sec, string shots, string refire2, string combo, bool sec_variable)
#define WEP_CVAR_PRI(wep, name)
#define WEP_CVAR(wep, name)
#define WEP_CVAR_SEC(wep, name)
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)]