#ifdef SVQC
.float electro_count;
.float electro_secondarytime;
-void W_Electro_ExplodeCombo();
+void W_Electro_ExplodeCombo(entity this);
#endif
#endif
#ifdef IMPLEMENTATION
e.classname = "electro_orb_chain";
// now set the next one to trigger as well
- e.think = W_Electro_ExplodeCombo;
+ setthink(e, W_Electro_ExplodeCombo);
// delay combo chains, looks cooler
e.nextthink =
}
}
-void W_Electro_ExplodeCombo()
-{SELFPARAM();
+void W_Electro_ExplodeCombo(entity this)
+{
W_Electro_TriggerCombo(self.origin, WEP_CVAR(electro, combo_comboradius), self.realowner);
self.event_damage = func_null;
remove(self);
}
-void W_Electro_Explode()
-{SELFPARAM();
+void W_Electro_Explode(entity this)
+{
if(other.takedamage == DAMAGE_AIM)
if(IS_PLAYER(other))
if(DIFF_TEAM(self.realowner, other))
void W_Electro_Explode_use(entity this, entity actor, entity trigger)
{
- WITHSELF(this, W_Electro_Explode());
+ WITHSELF(this, W_Electro_Explode(this));
}
-void W_Electro_TouchExplode()
+void W_Electro_TouchExplode(entity this)
{
PROJECTILE_TOUCH;
- W_Electro_Explode();
+ W_Electro_Explode(this);
}
-void W_Electro_Bolt_Think()
-{SELFPARAM();
+void W_Electro_Bolt_Think(entity this)
+{
if(time >= self.ltime)
{
this.use(this, NULL, NULL);
e.classname = "electro_orb_chain";
// now set the next one to trigger as well
- e.think = W_Electro_ExplodeCombo;
+ setthink(e, W_Electro_ExplodeCombo);
// delay combo chains, looks cooler
e.nextthink =
else { self.nextthink = self.ltime; }
}
-void W_Electro_Attack_Bolt(Weapon thiswep)
-{SELFPARAM();
+void W_Electro_Attack_Bolt(Weapon thiswep, entity actor)
+{entity this = actor;
entity proj;
W_DecreaseAmmo(thiswep, self, WEP_CVAR_PRI(electro, ammo));
proj.bot_dodge = true;
proj.bot_dodgerating = WEP_CVAR_PRI(electro, damage);
proj.use = W_Electro_Explode_use;
- proj.think = W_Electro_Bolt_Think;
+ setthink(proj, W_Electro_Bolt_Think);
proj.nextthink = time;
proj.ltime = time + WEP_CVAR_PRI(electro, lifetime);
PROJECTILE_MAKETRIGGER(proj);
proj.movetype = MOVETYPE_FLY;
W_SetupProjVelocity_PRI(proj, electro);
proj.angles = vectoangles(proj.velocity);
- proj.touch = W_Electro_TouchExplode;
+ settouch(proj, W_Electro_TouchExplode);
setsize(proj, '0 0 -3', '0 0 -3');
proj.flags = FL_PROJECTILE;
proj.missile_flags = MIF_SPLASH;
MUTATOR_CALLHOOK(EditProjectile, self, proj);
}
-void W_Electro_Orb_Touch()
-{SELFPARAM();
+void W_Electro_Orb_Touch(entity this)
+{
PROJECTILE_TOUCH;
if(other.takedamage == DAMAGE_AIM)
- { if(WEP_CVAR_SEC(electro, touchexplode)) { W_Electro_Explode(); } }
+ { if(WEP_CVAR_SEC(electro, touchexplode)) { W_Electro_Explode(self); } }
else
{
//UpdateCSQCProjectile(self);
// change owner to whoever caused the combo explosion
this.realowner = inflictor.realowner;
this.classname = "electro_orb_chain";
- this.think = W_Electro_ExplodeCombo;
+ setthink(this, W_Electro_ExplodeCombo);
this.nextthink = time +
(
// bound the length, inflictor may be in a galaxy far far away (warpzones)
else
{
this.use = W_Electro_Explode_use;
- this.think = adaptor_think2use; // not _hittype_splash, as this runs "immediately"
+ setthink(this, adaptor_think2use); // not _hittype_splash, as this runs "immediately"
}
}
}
-void W_Electro_Attack_Orb(Weapon thiswep)
-{SELFPARAM();
+void W_Electro_Attack_Orb(Weapon thiswep, entity actor)
+{entity this = actor;
W_DecreaseAmmo(thiswep, self, WEP_CVAR_SEC(electro, ammo));
W_SetupShot_ProjectileSize(
entity proj = new(electro_orb);
proj.owner = proj.realowner = self;
proj.use = W_Electro_Explode_use;
- proj.think = adaptor_think2use_hittype_splash;
+ setthink(proj, adaptor_think2use_hittype_splash);
proj.bot_dodge = true;
proj.bot_dodgerating = WEP_CVAR_SEC(electro, damage);
proj.nextthink = time + WEP_CVAR_SEC(electro, lifetime);
//proj.glow_color = 45;
proj.movetype = MOVETYPE_BOUNCE;
W_SetupProjVelocity_UP_SEC(proj, electro);
- proj.touch = W_Electro_Orb_Touch;
+ settouch(proj, W_Electro_Orb_Touch);
setsize(proj, '0 0 -4', '0 0 -4');
proj.takedamage = DAMAGE_YES;
proj.damageforcescale = WEP_CVAR_SEC(electro, damageforcescale);
}
void W_Electro_CheckAttack(Weapon thiswep, entity actor, .entity weaponentity, int fire)
-{SELFPARAM();
+{entity this = actor;
if(self.electro_count > 1)
if(PHYS_INPUT_BUTTON_ATCK2(self))
if(weapon_prepareattack(thiswep, actor, weaponentity, true, -1))
{
- W_Electro_Attack_Orb(WEP_ELECTRO);
+ W_Electro_Attack_Orb(WEP_ELECTRO, actor);
self.electro_count -= 1;
weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(electro, animtime), W_Electro_CheckAttack);
return;
.float bot_secondary_electromooth;
-METHOD(Electro, wr_aim, void(entity thiswep))
+METHOD(Electro, wr_aim, void(entity thiswep, entity actor))
{
- SELFPARAM();
+ entity this = actor;
PHYS_INPUT_BUTTON_ATCK(self) = PHYS_INPUT_BUTTON_ATCK2(self) = false;
if(vdist(self.origin - self.enemy.origin, >, 1000)) { self.bot_secondary_electromooth = 0; }
if(self.bot_secondary_electromooth == 0)
{
if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire)))
{
- W_Electro_Attack_Bolt(thiswep);
+ W_Electro_Attack_Bolt(thiswep, actor);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
}
}
if(time >= actor.electro_secondarytime)
if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(electro, refire)))
{
- W_Electro_Attack_Orb(thiswep);
+ W_Electro_Attack_Orb(thiswep, actor);
actor.electro_count = WEP_CVAR_SEC(electro, count);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(electro, animtime), W_Electro_CheckAttack);
actor.electro_secondarytime = time + WEP_CVAR_SEC(electro, refire2) * W_WeaponRateFactor();
}
}
}
-METHOD(Electro, wr_checkammo1, bool(entity thiswep))
+METHOD(Electro, wr_checkammo1, bool(entity thiswep, entity actor))
{
- SELFPARAM();
- float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_PRI(electro, ammo);
- ammo_amount += self.(weapon_load[WEP_ELECTRO.m_id]) >= WEP_CVAR_PRI(electro, ammo);
+ float ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR_PRI(electro, ammo);
+ ammo_amount += actor.(weapon_load[WEP_ELECTRO.m_id]) >= WEP_CVAR_PRI(electro, ammo);
return ammo_amount;
}
-METHOD(Electro, wr_checkammo2, bool(entity thiswep))
+METHOD(Electro, wr_checkammo2, bool(entity thiswep, entity actor))
{
- SELFPARAM();
float ammo_amount;
if(WEP_CVAR(electro, combo_safeammocheck)) // true if you can fire at least one secondary blob AND one primary shot after it, otherwise false.
{
- ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_SEC(electro, ammo) + WEP_CVAR_PRI(electro, ammo);
- ammo_amount += self.(weapon_load[WEP_ELECTRO.m_id]) >= WEP_CVAR_SEC(electro, ammo) + WEP_CVAR_PRI(electro, ammo);
+ ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR_SEC(electro, ammo) + WEP_CVAR_PRI(electro, ammo);
+ ammo_amount += actor.(weapon_load[WEP_ELECTRO.m_id]) >= WEP_CVAR_SEC(electro, ammo) + WEP_CVAR_PRI(electro, ammo);
}
else
{
- ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_SEC(electro, ammo);
- ammo_amount += self.(weapon_load[WEP_ELECTRO.m_id]) >= WEP_CVAR_SEC(electro, ammo);
+ ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR_SEC(electro, ammo);
+ ammo_amount += actor.(weapon_load[WEP_ELECTRO.m_id]) >= WEP_CVAR_SEC(electro, ammo);
}
return ammo_amount;
}
-METHOD(Electro, wr_resetplayer, void(entity thiswep))
+METHOD(Electro, wr_resetplayer, void(entity thiswep, entity actor))
{
- SELFPARAM();
+ entity this = actor;
self.electro_secondarytime = time;
}
METHOD(Electro, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
{
- SELFPARAM();
- W_Reload(self, min(WEP_CVAR_PRI(electro, ammo), WEP_CVAR_SEC(electro, ammo)), SND_RELOAD);
+ W_Reload(actor, min(WEP_CVAR_PRI(electro, ammo), WEP_CVAR_SEC(electro, ammo)), SND_RELOAD);
}
METHOD(Electro, wr_suicidemessage, Notification(entity thiswep))
{
#endif
#ifdef CSQC
-METHOD(Electro, wr_impacteffect, void(entity thiswep))
+METHOD(Electro, wr_impacteffect, void(entity thiswep, entity actor))
{
- SELFPARAM();
+ entity this = actor;
vector org2;
org2 = w_org + w_backoff * 6;
if(w_deathtype & HITTYPE_SECONDARY)