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