W_Electro_TriggerCombo(this.origin, WEP_CVAR(electro, combo_comboradius), this.realowner);
this.event_damage = func_null;
+ this.velocity = this.movedir; // particle fx and decals need .velocity
RadiusDamage(
this,
this.event_damage = func_null;
this.takedamage = DAMAGE_NO;
+ this.velocity = this.movedir; // particle fx and decals need .velocity
if(this.move_movetype == MOVETYPE_BOUNCE || this.classname == "electro_orb") // TODO: classname is more reliable anyway?
{
}
-void sys_phys_update_single(entity this);
+//void sys_phys_update_single(entity this);
void W_Electro_Bolt_Think(entity this)
{
// proj.com_phys_vel = proj.velocity;
}
+void W_Electro_Orb_Follow_Think(entity this)
+{
+ if (time > this.death_time)
+ {
+ adaptor_think2use_hittype_splash(this);
+ return;
+ }
+ if (this.move_movetype == MOVETYPE_FOLLOW)
+ {
+ int lost = LostMovetypeFollow(this);
+ if (lost == 2)
+ {
+ // FIXME if player disconnected, it isn't possible to drop the orb at player's origin
+ // see comment in LostMovetypeFollow implementation
+ delete(this);
+ return;
+ }
+ if (lost)
+ {
+ // drop the orb at the corpse's location
+ PROJECTILE_MAKETRIGGER(this);
+ set_movetype(this, MOVETYPE_TOSS);
+
+ setthink(this, adaptor_think2use_hittype_splash);
+ this.nextthink = this.death_time;
+ return;
+ }
+ }
+ this.nextthink = time;
+}
+
void W_Electro_Orb_Stick(entity this, entity to)
{
entity newproj = spawn();
setsize(newproj, this.mins, this.maxs);
newproj.angles = vectoangles(-trace_plane_normal); // face against the surface
+ newproj.movedir = -trace_plane_normal;
+
newproj.takedamage = this.takedamage;
newproj.damageforcescale = this.damageforcescale;
SetResourceExplicit(newproj, RES_HEALTH, GetResource(this, RES_HEALTH));
newproj.weaponentity_fld = this.weaponentity_fld;
settouch(newproj, func_null);
- setthink(newproj, getthink(this));
- newproj.nextthink = this.nextthink;
+ newproj.death_time = this.death_time;
newproj.use = this.use;
newproj.flags = this.flags;
IL_PUSH(g_projectiles, newproj);
delete(this);
if(to)
+ {
SetMovetypeFollow(newproj, to);
+
+ setthink(newproj, W_Electro_Orb_Follow_Think);
+ newproj.nextthink = time;
+ }
+ else
+ {
+ setthink(newproj, adaptor_think2use_hittype_splash);
+ newproj.nextthink = newproj.death_time;
+ }
}
void W_Electro_Orb_Touch(entity this, entity toucher)
proj.bot_dodge = true;
proj.bot_dodgerating = WEP_CVAR_SEC(electro, damage);
proj.nextthink = time + WEP_CVAR_SEC(electro, lifetime);
+ proj.death_time = time + WEP_CVAR_SEC(electro, lifetime);
PROJECTILE_MAKETRIGGER(proj);
proj.projectiledeathtype = thiswep.m_id | HITTYPE_SECONDARY;
proj.weaponentity_fld = weaponentity;