]> icculus.org git repositories - divverent/nexuiz.git/blob - qcsrc/triggers.qc
Fixed two minor bugs.
[divverent/nexuiz.git] / qcsrc / triggers.qc
1 void() hurt_on =
2 {
3         self.solid = SOLID_TRIGGER;
4         self.nextthink = -1;
5 };
6
7 void() hurt_touch =
8 {
9         if (other.takedamage)
10         {
11                 self.solid = SOLID_NOT;
12                 Damage (other, self, self, self.dmg, 1, '0 0 0', '0 0 0');
13                 self.think = hurt_on;
14                 self.nextthink = time + 0.1;
15         }
16
17         return;
18 };
19
20
21 void() trigger_hurt =       // this doesn't work
22 {
23         InitTrigger ();
24         self.touch = hurt_touch;
25         self.dmg = 300;
26 };
27
28 void() target_speaker_use = {sound(self, CHAN_VOICE, self.noise, 1, 1);}
29 //void() target_speaker = {self.use = target_speaker_use;}
30
31 void() target_speaker =
32 {
33 if(self.noise) {
34  precache_sound (self.noise);
35  ambientsound (self.origin, self.noise, 1, ATTN_STATIC);
36 }
37 remove(self);
38 };