3 void func_rotating_setactive(entity this, int astate)
5 if (astate == ACTIVE_TOGGLE)
7 if(this.active == ACTIVE_ACTIVE)
8 this.active = ACTIVE_NOT;
10 this.active = ACTIVE_ACTIVE;
15 if(this.active == ACTIVE_NOT)
16 this.avelocity = '0 0 0';
18 this.avelocity = this.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 spawnfunc(func_rotating)
33 precache_sound(this.noise);
34 ambientsound(this.origin, this.noise, VOL_BASE, ATTEN_IDLE);
37 this.active = ACTIVE_ACTIVE;
38 this.setactive = func_rotating_setactive;
42 // FIXME: test if this turns the right way, then remove this comment (negate as needed)
43 if (this.spawnflags & 4) // X (untested)
44 this.avelocity = '0 0 1' * this.speed;
45 // FIXME: test if this turns the right way, then remove this comment (negate as needed)
46 else if (this.spawnflags & 8) // Y (untested)
47 this.avelocity = '1 0 0' * this.speed;
48 // FIXME: test if this turns the right way, then remove this comment (negate as needed)
50 this.avelocity = '0 1 0' * this.speed;
52 this.pos1 = this.avelocity;
54 if(this.dmg && (this.message == ""))
55 this.message = " was squished";
56 if(this.dmg && (this.message2 == ""))
57 this.message2 = "was squished by";
60 if(this.dmg && (!this.dmgtime))
65 if (!InitMovingBrushTrigger(this))
67 // no EF_LOWPRECISION here, as rounding angles is bad
69 setblocked(this, generic_plat_blocked);
71 // wait for targets to spawn
72 this.nextthink = this.ltime + 999999999;
73 setthink(this, SUB_NullThink); // for PushMove
75 // TODO make a reset function for this one