.float selectweapon; // last selected weapon of the player
.float ballistics_density; // wall piercing factor, larger = bullet can pass through more
+
+#define ACTIVE_NOT 0
+#define ACTIVE_ACTIVE 1
+#define ACTIVE_IDLE 2
+#define ACTIVE_BUSY 2
+#define ACTIVE_TOGGLE 3
+.float active;
+.float (float act_state) setactive;
\ No newline at end of file
// target:
// what to trigger
}
+
+void relay_activateors_use()
+{
+ entity trg, os;
+
+ os = self;
+
+ for(trg = world; (trg = find(trg, targetname, os.target)); )
+ {
+ self = trg;
+ if (trg.setactive)
+ trg.setactive(os.cnt);
+ else
+ {
+ if(os.cnt == ACTIVE_TOGGLE)
+ if(trg.active)
+ trg.active = ACTIVE_NOT;
+ else
+ trg.active = ACTIVE_ACTIVE;
+ else
+ trg.active = os.cnt;
+ }
+ }
+ self = os;
+}
+
+void spawnfunc_relay_activate()
+{
+ self.cnt = ACTIVE_ACTIVE;
+ self.use = relay_activateors_use;
+}
+
+void spawnfunc_relay_deactivate()
+{
+ self.cnt = ACTIVE_NOT;
+ self.use = relay_activateors_use;
+}
+
+void spawnfunc_relay_activatetoggle()
+{
+ self.cnt = ACTIVE_TOGGLE;
+ self.use = relay_activateors_use;
+}
void trigger_push_touch()
{
+ if (self.active == ACTIVE_NOT)
+ return;
+
// FIXME: add a .float for whether an entity should be tossed by jumppads
if (!other.iscreature)
if (other.classname != "corpse")
}
};
-.vector dest;
+void trigger_push_setactive(float astate)
+{
+ self.active = astate;
+
+ if(astate == ACTIVE_NOT)
+ self.touch = SUB_Null;
+ else if (astate == ACTIVE_TOGGLE)
+ {
+ if(self.active)
+ self.active = ACTIVE_NOT;
+ else
+ self.active = ACTIVE_ACTIVE;
+ }
+ else
+ self.touch = trigger_push_touch;
+}
+
+
+.vector dest;
void trigger_push_findtarget()
{
local entity e;
SetMovedir ();
EXACTTRIGGER_INIT;
-
+
+ self.active = ACTIVE_ACTIVE;
+ self.setactive = trigger_push_setactive;
self.use = trigger_push_use;
self.touch = trigger_push_touch;
// TODO make a reset function for this one
};
+void func_rotating_setactive(float astate)
+{
+
+ if (astate == ACTIVE_TOGGLE)
+ {
+ if(self.active)
+ self.active = ACTIVE_NOT;
+ else
+ self.active = ACTIVE_ACTIVE;
+ }
+ else
+ self.active = astate;
+
+ if(astate == ACTIVE_NOT)
+ self.avelocity = '0 0 0';
+ else
+ self.avelocity = self.pos1;
+}
+
/*QUAKED spawnfunc_func_rotating (0 .5 .8) ? - - X_AXIS Y_AXIS
Brush model that spins in place on one axis (default Z).
speed : speed to rotate (in degrees per second)
precache_sound(self.noise);
ambientsound(self.origin, self.noise, VOL_BASE, ATTN_IDLE);
}
+
+ self.active = ACTIVE_ACTIVE;
+ self.setactive = func_rotating_setactive;
+
if (!self.speed)
self.speed = 100;
// FIXME: test if this turns the right way, then remove this comment (negate as needed)
// FIXME: test if this turns the right way, then remove this comment (negate as needed)
else // Z
self.avelocity = '0 1 0' * self.speed;
-
+
+ self.pos1 = self.avelocity;
+
if(self.dmg & (!self.message))
self.message = " was squished";
if(self.dmg && (!self.message2))