3 void secrets_setstatus() {
4 self.stat_secrets_total = secrets_total;
5 self.stat_secrets_found = secrets_found;
9 * A secret has been found (maybe :P)
11 void trigger_secret_touch() {
12 // only a player can trigger this
13 if (other.classname != "player")
16 // update secrets found counter
18 //print("Secret found: ", ftos(secret_counter.cnt), "/");
19 //print(ftos(secret_counter.count), "\n");
21 // handle normal trigger features
26 /*QUAKED trigger_secret (.5 .5 .5) ?
27 Variable sized secret trigger. Can be targeted at one or more entities.
28 Basically, it's a trigger_once (with restrictions, see notes) that additionally updates the number of secrets found.
29 -------- KEYS --------
30 sounds: 1 to play misc/secret.wav, 2 to play misc/talk.wav, 3 to play misc/trigger1.wav (default: 1)
31 noise: path to sound file, if you want to play something else
32 target: trigger all entities with this targetname when triggered
33 message: print this message to the player who activated the trigger instead of the standard 'You found a secret!'
34 killtarget: remove all entities with this targetname when triggered
35 -------- NOTES --------
36 You should create a common/trigger textured brush covering the entrance to a secret room/area.
37 Trigger secret can only be trigger by a player's touch and can not be a target itself.
39 void spawnfunc_trigger_secret() {
40 // FIXME: should it be disabled in most modes?
42 // update secrets count
45 // add default message
46 if (self.message == "")
47 self.message = "You found a secret!";
52 self.sounds = 1; // misc/secret.wav
54 // this entity can't be a target itself!!!!
57 // you can't just shoot a room to find it, can you?
60 // a secret can not be delayed
63 // convert this trigger to trigger_once
64 self.classname = "trigger_once";
65 spawnfunc_trigger_once();
67 // take over the touch() function, so we can mark secret as found
68 self.touch = trigger_secret_touch;