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 // centerprint message (multi_touch() doesn't always call centerprint())
22 centerprint(other, self.message);
25 // handle normal trigger features
30 /*QUAKED trigger_secret (.5 .5 .5) ?
31 Variable sized secret trigger. Can be targeted at one or more entities.
32 Basically, it's a trigger_once (with restrictions, see notes) that additionally updates the number of secrets found.
33 -------- KEYS --------
34 sounds: 1 to play misc/secret.wav, 2 to play misc/talk.wav, 3 to play misc/trigger1.wav (default: 1)
35 noise: path to sound file, if you want to play something else
36 target: trigger all entities with this targetname when triggered
37 message: print this message to the player who activated the trigger instead of the standard 'You found a secret!'
38 killtarget: remove all entities with this targetname when triggered
39 -------- NOTES --------
40 You should create a common/trigger textured brush covering the entrance to a secret room/area.
41 Trigger secret can only be trigger by a player's touch and can not be a target itself.
43 void spawnfunc_trigger_secret() {
44 // FIXME: should it be disabled in most modes?
46 // update secrets count
49 // add default message
50 if (self.message == "")
51 self.message = "You found a secret!";
56 self.sounds = 1; // misc/secret.wav
58 // this entity can't be a target itself!!!!
61 // you can't just shoot a room to find it, can you?
64 // a secret can not be delayed
67 // convert this trigger to trigger_once
68 self.classname = "trigger_once";
69 spawnfunc_trigger_once();
71 // take over the touch() function, so we can mark secret as found
72 self.touch = trigger_secret_touch;