6 void W_Electro_TriggerCombo(
vector org,
float rad,
entity own)
11 if(e.classname ==
"electro_orb")
14 if(
WEP_CVAR(electro, combo_comboradius_thruwall))
17 if(
vdist(e.WarpZone_findradius_dist, >,
WEP_CVAR(electro, combo_comboradius_thruwall)))
32 e.classname =
"electro_orb_chain";
40 delay =
vlen(e.WarpZone_findradius_dist) /
WEP_CVAR(electro, combo_speed);
47 void W_Electro_ExplodeCombo(
entity this)
64 this.weaponentity_fld,
71 void W_Electro_Explode(
entity this,
entity directhitentity)
78 Send_Notification(NOTIF_ONE, this.
realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_ELECTROBITCH);
123 W_Electro_Explode(
this, trigger);
126 void W_Electro_TouchExplode(
entity this,
entity toucher)
129 W_Electro_Explode(
this, toucher);
135 void W_Electro_Bolt_Think(
entity this)
152 if(e.classname ==
"electro_orb")
155 if (this.
owner == e.owner)
173 e.classname =
"electro_orb_chain";
179 setthink(e, W_Electro_ExplodeCombo);
182 delay =
vlen(e.WarpZone_findradius_dist) /
WEP_CVAR_PRI(electro, midaircombo_speed);
222 proj =
new(electro_bolt);
223 proj.owner = proj.realowner = actor;
224 proj.bot_dodge =
true;
226 proj.use = W_Electro_Explode_use;
227 setthink(proj, W_Electro_Bolt_Think);
228 proj.nextthink =
time;
231 proj.projectiledeathtype = thiswep.
m_id;
232 proj.weaponentity_fld = weaponentity;
239 settouch(proj, W_Electro_TouchExplode);
240 setsize(proj,
'0 0 -3',
'0 0 -3');
241 proj.flags = FL_PROJECTILE;
253 void W_Electro_Orb_Follow_Think(
entity this)
262 int lost = LostMovetypeFollow(
this);
292 newproj.owner = this.
owner;
295 setmodel(newproj, MDL_PROJECTILE_ELECTRO);
296 setsize(newproj, this.
mins, this.
maxs);
298 newproj.traileffectnum = _particleeffectnum(EFFECT_TR_NEXUIZPLASMA.eent_eff_name);
305 newproj.event_damage = this.event_damage;
307 newproj.damagedbycontents =
true;
320 newproj.use = this.
use;
321 newproj.flags = this.
flags;
326 if(LimitedElectroBallRubbleList &&
IL_CONTAINS(LimitedElectroBallRubbleList,
this))
328 ReplaceOldListedChildRubble(LimitedElectroBallRubbleList, newproj,
this);
335 SetMovetypeFollow(newproj, to);
337 setthink(newproj, W_Electro_Orb_Follow_Think);
338 newproj.nextthink =
time;
343 newproj.nextthink = newproj.death_time;
351 { W_Electro_Explode(
this, toucher); }
352 else if(toucher.owner !=
this.owner && toucher.classname !=
this.classname)
360 W_Electro_Explode(
this, toucher);
362 W_Electro_Orb_Stick(
this, toucher);
374 float is_combo = (inflictor.classname ==
"electro_orb_chain" || inflictor.classname ==
"electro_bolt");
389 setthink(
this, W_Electro_ExplodeCombo);
398 this.
use = W_Electro_Explode_use;
425 entity proj =
new(electro_orb);
426 proj.owner = proj.realowner = actor;
427 proj.use = W_Electro_Explode_use;
429 proj.bot_dodge =
true;
435 proj.weaponentity_fld = weaponentity;
442 settouch(proj, W_Electro_Orb_Touch);
443 setsize(proj,
'-4 -4 -4',
'4 4 4');
447 proj.event_damage = W_Electro_Orb_Damage;
448 proj.flags = FL_PROJECTILE;
452 if(proj.damagedbycontents)
461 if (!LimitedElectroBallRubbleList)
462 LimitedElectroBallRubbleList =
IL_NEW();
463 ListNewChildRubble(LimitedElectroBallRubbleList, proj);
472 void W_Electro_CheckAttack(
Weapon thiswep,
entity actor, .
entity weaponentity,
int fire)
474 if(actor.(weaponentity).electro_count > 1)
478 W_Electro_Attack_Orb(thiswep, actor, weaponentity);
479 actor.(weaponentity).electro_count -= 1;
480 actor.(weaponentity).electro_secondarytime =
time;
484 w_ready(thiswep, actor, weaponentity, fire);
487 .float bot_secondary_electromooth;
492 if(
vdist(actor.origin - actor.enemy.origin, >, 1000)) { actor.bot_secondary_electromooth = 0; }
493 if(actor.bot_secondary_electromooth == 0)
500 shoot =
bot_aim(actor, weaponentity, 1000000, 0, 0.001,
false);
505 if(
random() < 0.01) actor.bot_secondary_electromooth = 1;
513 if(
random() < 0.03) actor.bot_secondary_electromooth = 0;
519 if(autocvar_g_balance_electro_reload_ammo)
521 float ammo_amount = 0;
529 thiswep.wr_reload(thiswep, actor, weaponentity);
539 W_Electro_Attack_Bolt(thiswep, actor, weaponentity);
548 W_Electro_Attack_Orb(thiswep, actor, weaponentity);
550 actor.(weaponentity).electro_secondarytime =
time;
564 if(
WEP_CVAR(electro, combo_safeammocheck))
583 return WEAPON_ELECTRO_SUICIDE_ORBS;
585 return WEAPON_ELECTRO_SUICIDE_BOLT;
591 return WEAPON_ELECTRO_MURDER_ORBS;
596 return WEAPON_ELECTRO_MURDER_COMBO;
598 return WEAPON_ELECTRO_MURDER_BOLT;
608 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 PROJECTILE_MAKETRIGGER(e)
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
#define W_SetupProjVelocity_UP_SEC(ent, wepname)
#define W_SetupShot_ProjectileSize(ent, wepent, mi, ma, antilag, recoil, snd, chan, maxdamage, deathtype)
float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception)
IntrusiveList g_damagedbycontents
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)
#define WEP_CVAR(wepname, name)
#define METHOD(cname, name, prototype)
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
ERASEABLE bool IL_CONTAINS(IntrusiveList this, entity it)
IntrusiveList g_bot_dodge
void TakeResource(entity receiver, Resource res_type, float amount)
Takes an entity some resource.
#define PROJECTILE_TOUCH(e, t)
#define setmodel(this, m)
#define W_SetupProjVelocity_PRI(ent, wepname)
const float MOVE_NOMONSTERS
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
#define PHYS_INPUT_BUTTON_ATCK(s)
const int HITTYPE_SECONDARY
entity WarpZone_FindRadius(vector org, float rad, bool needlineofsight)
bool IsFlying(entity this)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
IntrusiveList g_projectiles
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
const int PROJECTILE_ELECTRO
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
void WarpZone_TraceLine(vector org, vector end, float nomonsters, entity forent)
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)
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype,.entity weaponentity, entity directhitentity)
const int PROJECTILE_ELECTRO_BEAM
#define MUTATOR_CALLHOOK(id,...)
vector trace_plane_normal
void adaptor_think2use_hittype_splash(entity this)
void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use,.entity weaponentity)
#define sound(e, c, s, v, a)
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
float W_WeaponRateFactor(entity this)
void set_movetype(entity this, int mt)
void W_Reload(entity actor,.entity weaponentity, float sent_ammo_min, Sound sent_sound)