+ this.nade_show_particles = 0;
+}
+
+entity nades_spawn_orb(entity own, entity realown, vector org, float orb_ltime, float orb_rad)
+{
+ // NOTE: this function merely places an orb
+ // you must add a custom touch function to the returned entity if desired
+ // also set .colormod if you wish to have it colorized
+ entity orb = spawn(); // Net_LinkEntity sets the classname (TODO)
+ orb.owner = own;
+ orb.realowner = realown;
+ setorigin(orb, org);
+
+ orb.orb_lifetime = orb_ltime; // required for timers
+ orb.ltime = time + orb.orb_lifetime;
+ orb.bot_dodge = false;
+ orb.team = realown.team;
+ orb.solid = SOLID_TRIGGER;
+
+ setmodel(orb, MDL_NADE_ORB);
+ orb.orb_radius = orb_rad; // required for fading
+ vector size = '1 1 1' * orb.orb_radius / 2;
+ setsize(orb, -size, size);
+
+ Net_LinkEntity(orb, true, 0, orb_send);
+ orb.SendFlags |= 1;
+
+ orb.think = nades_orb_think;
+ orb.nextthink = time;
+
+ return orb;
+}
+
+void nade_entrap_touch()
+{SELFPARAM();
+ if(DIFF_TEAM(other, self.realowner)) // TODO: what if realowner changes team or disconnects?
+ {
+ if (!isPushable(other))
+ return;
+
+ float pushdeltatime = time - other.lastpushtime;
+ if (pushdeltatime > 0.15) pushdeltatime = 0;
+ other.lastpushtime = time;
+ if(!pushdeltatime) return;
+
+ // div0: ticrate independent, 1 = identity (not 20)
+#ifdef SVQC
+ other.velocity = other.velocity * pow(autocvar_g_nades_entrap_strength, pushdeltatime);
+
+ UpdateCSQCProjectile(other);
+#elif defined(CSQC)
+ other.move_velocity = other.move_velocity * pow(autocvar_g_nades_entrap_strength, pushdeltatime);
+#endif
+
+ if ( IS_REAL_CLIENT(other) || IS_VEHICLE(other) )
+ {
+ entity show_tint = (IS_VEHICLE(other)) ? other.owner : other;
+ STAT(ENTRAP_ORB, show_tint) = time + 0.1;
+ STAT(ENTRAP_ORB_ALPHA, show_tint) = 0.75 * (self.ltime - time) / self.orb_lifetime;
+ }
+ }
+}
+
+void nade_entrap_boom(entity this)
+{
+ entity healer = nades_spawn_orb(this.owner, this.realowner, this.origin, autocvar_g_nades_entrap_time, autocvar_g_nades_entrap_radius);
+
+ healer.touch = nade_entrap_touch;
+ healer.colormod = NADE_TYPE_ENTRAP.m_color;