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