2 void func_rotating_setactive(float astate)
5 if (astate == ACTIVE_TOGGLE)
7 if(self.active == ACTIVE_ACTIVE)
8 self.active = ACTIVE_NOT;
10 self.active = ACTIVE_ACTIVE;
15 if(self.active == ACTIVE_NOT)
16 self.avelocity = '0 0 0';
18 self.avelocity = self.pos1;
21 /*QUAKED spawnfunc_func_rotating (0 .5 .8) ? - - X_AXIS Y_AXIS
22 Brush model that spins in place on one axis (default Z).
23 speed : speed to rotate (in degrees per second)
24 noise : path/name of looping .wav file to play.
25 dmg : Do this mutch dmg every .dmgtime intervall when blocked
29 void spawnfunc_func_rotating()
33 precache_sound(self.noise);
34 ambientsound(self.origin, self.noise, VOL_BASE, ATTEN_IDLE);
37 self.active = ACTIVE_ACTIVE;
38 self.setactive = func_rotating_setactive;
42 // FIXME: test if this turns the right way, then remove this comment (negate as needed)
43 if (self.spawnflags & 4) // X (untested)
44 self.avelocity = '0 0 1' * self.speed;
45 // FIXME: test if this turns the right way, then remove this comment (negate as needed)
46 else if (self.spawnflags & 8) // Y (untested)
47 self.avelocity = '1 0 0' * self.speed;
48 // FIXME: test if this turns the right way, then remove this comment (negate as needed)
50 self.avelocity = '0 1 0' * self.speed;
52 self.pos1 = self.avelocity;
54 if(self.dmg && (self.message == ""))
55 self.message = " was squished";
56 if(self.dmg && (self.message2 == ""))
57 self.message2 = "was squished by";
60 if(self.dmg && (!self.dmgtime))
65 if (!InitMovingBrushTrigger())
67 // no EF_LOWPRECISION here, as rounding angles is bad
69 self.blocked = generic_plat_blocked;
71 // wait for targets to spawn
72 self.SUB_NEXTTHINK = self.SUB_LTIME + 999999999;
73 self.SUB_THINK = SUB_NullThink; // for PushMove
75 // TODO make a reset function for this one