}
setsize (trigger, tmin, tmax);
-};
+}
void plat_hit_top()
{
self.state = 1;
self.think = plat_go_down;
self.nextthink = self.ltime + 3;
-};
+}
void plat_hit_bottom()
{
sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTN_NORM);
self.state = 2;
-};
+}
void plat_go_down()
{
sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_NORM);
self.state = 3;
SUB_CalcMove (self.pos2, self.speed, plat_hit_bottom);
-};
+}
void plat_go_up()
{
sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_NORM);
self.state = 4;
SUB_CalcMove (self.pos1, self.speed, plat_hit_top);
-};
+}
void plat_center_touch()
{
plat_go_up ();
else if (self.state == 1)
self.nextthink = self.ltime + 1; // delay going down
-};
+}
void plat_outside_touch()
{
self = self.enemy;
if (self.state == 1)
plat_go_down ();
-};
+}
void plat_trigger_use()
{
if (self.think)
return; // already activated
plat_go_down();
-};
+}
void plat_crush()
// plat state already had changed
// this isn't a bug per se!
}
-};
+}
void plat_use()
{
if (self.state != 4)
objerror ("plat_use: not in up state");
plat_go_down();
-};
+}
.string sound1, sound2;
}
}
-void spawnfunc_path_corner() { };
+void spawnfunc_path_corner() { }
void spawnfunc_func_plat()
{
if (!self.t_length)
self.reset = plat_reset;
plat_reset();
-};
+}
void() train_next;
SUB_UseTargets();
self = oldself;
self.enemy = world;
-};
+}
void train_next()
{
if(self.noise != "")
sound(self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_IDLE);
-};
+}
void func_train_find()
{
setorigin(self, targ.origin - self.mins);
self.nextthink = self.ltime + 1;
self.think = train_next;
-};
+}
/*QUAKED spawnfunc_func_train (0 .5 .8) ?
Ridable platform, targets spawnfunc_path_corner path to follow.
self.dmgtime2 = time;
// TODO make a reset function for this one
-};
+}
void func_rotating_setactive(float astate)
{
self.think = SUB_Null;
// TODO make a reset function for this one
-};
+}
.float height;
void func_bobbing_controller_think()
if(self.owner.classname == "func_bobbing") // don't brake stuff if the func_bobbing was killtarget'ed
// * 10 so it will arrive in 0.1 sec
self.owner.velocity = (v - self.owner.origin) * 10;
-};
+}
/*QUAKED spawnfunc_func_bobbing (0 .5 .8) ? X_AXIS Y_AXIS
Brush model that moves back and forth on one axis (default Z).
self.effects |= EF_LOWPRECISION;
// TODO make a reset function for this one
-};
+}
.float freq;
void func_pendulum_controller_think()
// * 10 so it will arrive in 0.1 sec
self.owner.avelocity_z = (remainder(v - self.owner.angles_z, 360)) * 10;
}
-};
+}
void spawnfunc_func_pendulum()
{
//self.effects |= EF_LOWPRECISION;
// TODO make a reset function for this one
-};
+}
// button and multiple button
activator = self.enemy;
SUB_UseTargets();
self.frame = 1; // use alternate textures
-};
+}
void button_done()
{
self.state = STATE_BOTTOM;
-};
+}
void button_return()
{
self.frame = 0; // use normal textures
if (self.health)
self.takedamage = DAMAGE_YES; // can be shot again
-};
+}
void button_blocked()
{
// do nothing, just don't come all the way back out
-};
+}
void button_fire()
self.state = STATE_UP;
SUB_CalcMove (self.pos2, self.speed, button_wait);
-};
+}
void button_reset()
{
self.enemy = activator;
button_fire ();
-};
+}
void button_touch()
{
if (other.owner)
self.enemy = other.owner;
button_fire ();
-};
+}
void button_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
self.enemy = damage_attacker;
button_fire ();
}
-};
+}
/*QUAKED spawnfunc_func_button (0 .5 .8) ?
self.flags |= FL_NOTARGET;
button_reset();
-};
+}
float DOOR_START_OPEN = 1;
door_go_down ();
}
*/
-};
+}
void door_hit_top()
self.think = door_rotating_go_down;
}
self.nextthink = self.ltime + self.wait;
-};
+}
void door_hit_bottom()
{
if (self.noise1 != "")
sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTN_NORM);
self.state = STATE_BOTTOM;
-};
+}
void door_go_down()
{
self.state = STATE_DOWN;
SUB_CalcMove (self.pos1, self.speed, door_hit_bottom);
-};
+}
void door_go_up()
{
self.message = "";
SUB_UseTargets();
self.message = oldmessage;
-};
+}
/*
self = self.enemy;
} while ( (self != starte) && (self != world) );
self = oself;
-};
+}
void door_use()
door_fire ();
self = oself;
}
-};
+}
void door_trigger_touch()
self = self.owner;
door_use ();
-};
+}
void door_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
door_use ();
self = oself;
}
-};
+}
/*
centerprint (other, self.owner.message);
play2(other, "misc/talk.wav");
}
-};
+}
void door_generic_plat_blocked()
door_rotating_go_down ();
}
*/
-};
+}
void door_rotating_hit_top()
return; // don't come down automatically
self.think = door_rotating_go_down;
self.nextthink = self.ltime + self.wait;
-};
+}
void door_rotating_hit_bottom()
{
self.lip = 0;
}
self.state = STATE_BOTTOM;
-};
+}
void door_rotating_go_down()
{
self.state = STATE_DOWN;
SUB_CalcAngleMove (self.pos1, self.speed, door_rotating_hit_bottom);
-};
+}
void door_rotating_go_up()
{
self.message = "";
SUB_UseTargets();
self.message = oldmessage;
-};
+}
t2 = fmaxs;
setsize (trigger, t1 - '60 60 8', t2 + '60 60 8');
return (trigger);
-};
+}
float EntitiesTouching(entity e1, entity e2)
if (e1.absmax_z < e2.absmin_z)
return FALSE;
return TRUE;
-};
+}
/*
}
} while (1 );
-};
+}
/*QUAKED spawnfunc_func_door (0 .5 .8) ? START_OPEN x DOOR_DONT_LINK x x TOGGLE
InitializeEntity(self, LinkDoors, INITPRIO_LINKDOORS);
self.reset = door_reset;
-};
+}
/*QUAKED spawnfunc_func_door_rotating (0 .5 .8) ? START_OPEN BIDIR DOOR_DONT_LINK BIDIR_IN_DOWN x TOGGLE X_AXIS Y_AXIS
if two doors touch, they are assumed to be connected and operate as a unit.
InitializeEntity(self, LinkDoors, INITPRIO_LINKDOORS);
self.reset = door_rotating_reset;
-};
+}
/*
=============================================================================
SUB_CalcMove(self.dest1, self.speed, fd_secret_move1);
if (self.noise2 != "")
sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
-};
+}
// Wait after first movement...
void fd_secret_move1()
self.think = fd_secret_move2;
if (self.noise3 != "")
sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTN_NORM);
-};
+}
// Start moving sideways w/sound...
void fd_secret_move2()
if (self.noise2 != "")
sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
SUB_CalcMove(self.dest2, self.speed, fd_secret_move3);
-};
+}
// Wait here until time to go back...
void fd_secret_move3()
self.nextthink = self.ltime + self.wait;
self.think = fd_secret_move4;
}
-};
+}
// Move backward...
void fd_secret_move4()
if (self.noise2 != "")
sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
SUB_CalcMove(self.dest1, self.speed, fd_secret_move5);
-};
+}
// Wait 1 second...
void fd_secret_move5()
self.think = fd_secret_move6;
if (self.noise3 != "")
sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTN_NORM);
-};
+}
void fd_secret_move6()
{
if (self.noise2 != "")
sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
SUB_CalcMove(self.oldorigin, self.speed, fd_secret_done);
-};
+}
void fd_secret_done()
{
}
if (self.noise3 != "")
sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTN_NORM);
-};
+}
void secret_blocked()
{
return;
self.attack_finished_single = time + 0.5;
//T_Damage (other, self, self, self.dmg, self.dmg, self.deathtype, DT_IMPACT, (self.absmin + self.absmax) * 0.5, '0 0 0', Obituary_Generic);
-};
+}
/*
==============
centerprint (other, self.message);
play2(other, "misc/talk.wav");
}
-};
+}
void secret_reset()
{
self.reset = secret_reset;
secret_reset();
-};
+}
/*QUAKED spawnfunc_func_fourier (0 .5 .8) ?
Brush model that moves in a pattern of added up sine waves, can be used e.g. for circular motions.
if(self.owner.classname == "func_fourier") // don't brake stuff if the func_fourier was killtarget'ed
// * 10 so it will arrive in 0.1 sec
self.owner.velocity = (v - self.owner.origin) * 10;
-};
+}
void spawnfunc_func_fourier()
{
self.effects |= EF_LOWPRECISION;
// TODO make a reset function for this one
-};
+}
// reusing some fields havocbots declared
.entity wp00, wp01, wp02, wp03;