.float targetfactor, target2factor, target3factor, target4factor;
.vector targetnormal, target2normal, target3normal, target4normal;
-vector func_vectormamamam_origin(entity o, float t)
+vector func_vectormamamam_origin(entity o, float timestep)
{
vector v, p;
- float f;
+ float flags;
entity e;
- f = o.spawnflags;
+ flags = o.spawnflags;
v = '0 0 0';
e = o.wp00;
if(e)
{
- p = e.origin + t * e.velocity;
- if(f & 1)
+ p = e.origin + timestep * e.velocity;
+ if(flags & PROJECT_ON_TARGETNORMAL)
v = v + (p * o.targetnormal) * o.targetnormal * o.targetfactor;
else
v = v + (p - (p * o.targetnormal) * o.targetnormal) * o.targetfactor;
e = o.wp01;
if(e)
{
- p = e.origin + t * e.velocity;
- if(f & 2)
+ p = e.origin + timestep * e.velocity;
+ if(flags & PROJECT_ON_TARGET2NORMAL)
v = v + (p * o.target2normal) * o.target2normal * o.target2factor;
else
v = v + (p - (p * o.target2normal) * o.target2normal) * o.target2factor;
e = o.wp02;
if(e)
{
- p = e.origin + t * e.velocity;
- if(f & 4)
+ p = e.origin + timestep * e.velocity;
+ if(flags & PROJECT_ON_TARGET3NORMAL)
v = v + (p * o.target3normal) * o.target3normal * o.target3factor;
else
v = v + (p - (p * o.target3normal) * o.target3normal) * o.target3factor;
e = o.wp03;
if(e)
{
- p = e.origin + t * e.velocity;
- if(f & 8)
+ p = e.origin + timestep * e.velocity;
+ if(flags & PROJECT_ON_TARGET4NORMAL)
v = v + (p * o.target4normal) * o.target4normal * o.target4factor;
else
v = v + (p - (p * o.target4normal) * o.target4normal) * o.target4factor;
void func_vectormamamam_controller_think(entity this)
{
- this.nextthink = time + 0.1;
+ this.nextthink = time + vectormamamam_timestep;
if(this.owner.active != ACTIVE_ACTIVE)
{
}
if(this.owner.classname == "func_vectormamamam") // don't brake stuff if the func_vectormamamam was killtarget'ed
- this.owner.velocity = (this.owner.destvec + func_vectormamamam_origin(this.owner, 0.1) - this.owner.origin) * 10;
+ this.owner.velocity = (this.owner.destvec + func_vectormamamam_origin(this.owner, vectormamamam_timestep) - this.owner.origin) * 10;
}
void func_vectormamamam_findtarget(entity this)
this.dmgtime = 0.25;
this.dmgtime2 = time;
- if(this.netname == "")
- this.netname = "1 0 0 0 1";
-
if (!InitMovingBrushTrigger(this))
return;
const int VIEWLOC_FREEAIM = BIT(1);
const int VIEWLOC_FREEMOVE = BIT(2);
+// vectormamamam
+const int PROJECT_ON_TARGETNORMAL = BIT(0);
+const int PROJECT_ON_TARGET2NORMAL = BIT(1);
+const int PROJECT_ON_TARGET3NORMAL = BIT(2);
+const int PROJECT_ON_TARGET4NORMAL = BIT(3);
+
// platforms
const int PLAT_LOW_TRIGGER = BIT(0);
const int PLAT_CRUSH = BIT(2);