.float triggerhurttime;
void trigger_hurt_touch()
{
+ if (self.active != ACTIVE_ACTIVE)
+ return;
+
// only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
if (other.iscreature)
{
void spawnfunc_trigger_hurt()
{
EXACTTRIGGER_INIT;
+ self.active = ACTIVE_ACTIVE;
self.touch = trigger_hurt_touch;
if (!self.dmg)
self.dmg = 1000;
self.message = "was in the wrong place";
if (!self.message2)
self.message2 = "was thrown into a world of hurt by";
+ // self.message = "someone like %s always gets wrongplaced";
if(!trigger_hurt_first)
trigger_hurt_first = self;
.float triggerhealtime;
void trigger_heal_touch()
{
+ if (self.active != ACTIVE_ACTIVE)
+ return;
+
// only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
if (other.iscreature)
{
void spawnfunc_trigger_heal()
{
+ self.active = ACTIVE_ACTIVE;
+
EXACTTRIGGER_INIT;
self.touch = trigger_heal_touch;
if (!self.health)
float pushdeltatime;
float str;
+ if (self.active != ACTIVE_ACTIVE)
+ return;
+
// FIXME: Better checking for what to push and not.
if not(other.iscreature)
if (other.classname != "corpse")
if(!pushdeltatime) return;
other.velocity = other.velocity + normalize(targ.origin - self.origin) * str * pushdeltatime;
- other.flags &~= FL_ONGROUND;
+ other.flags &~= FL_ONGROUND;
+ UpdateCSQCProjectile(other);
}
// Directionless (accelerator/decelerator) mode
{
float pushdeltatime;
+ if (self.active != ACTIVE_ACTIVE)
+ return;
+
// FIXME: Better checking for what to push and not.
if not(other.iscreature)
if (other.classname != "corpse")
// div0: ticrate independent, 1 = identity (not 20)
other.velocity = other.velocity * pow(self.strength, pushdeltatime);
+ UpdateCSQCProjectile(other);
}
// Spherical (gravity/repulsor) mode
float pushdeltatime;
float str;
+ if (self.active != ACTIVE_ACTIVE)
+ return;
+
// FIXME: Better checking for what to push and not.
if not(other.iscreature)
if (other.classname != "corpse")
str = self.strength;
other.velocity = other.velocity + normalize(other.origin - self.origin) * str * pushdeltatime;
+ UpdateCSQCProjectile(other);
}
/*QUAKED spawnfunc_trigger_impulse (.5 .5 .5) ?
void spawnfunc_trigger_impulse()
{
+ self.active = ACTIVE_ACTIVE;
+
EXACTTRIGGER_INIT;
if(self.radius)
{
// target:
// what to trigger
}
+
+void relay_activators_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
+ {
+ //bprint("Not using setactive\n");
+ if(os.cnt == ACTIVE_TOGGLE)
+ if(trg.active == ACTIVE_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_activators_use;
+}
+
+void spawnfunc_relay_deactivate()
+{
+ self.cnt = ACTIVE_NOT;
+ self.use = relay_activators_use;
+}
+
+void spawnfunc_relay_activatetoggle()
+{
+ self.cnt = ACTIVE_TOGGLE;
+ self.use = relay_activators_use;
+}
+
+.string chmap, gametype;
+void spawnfunc_target_changelevel_use()
+{
+ if(self.gametype != "")
+ MapInfo_SwitchGameType(MapInfo_Type_FromString(self.gametype));
+
+ if (self.chmap == "")
+ localcmd("endmatch\n");
+ else
+ localcmd(strcat("changelevel ", self.chmap, "\n"));
+};
+
+void spawnfunc_target_changelevel()
+{
+ self.use = spawnfunc_target_changelevel_use;
+};