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