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