+#include "secret.qh"
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../../../server/_all.qh"
- #include "../../util.qh"
- #include "../../../server/defs.qh"
- #include "secret.qh"
+ #include <common/util.qh>
+ #include <server/defs.qh>
#endif
#ifdef SVQC
-void secrets_setstatus()
-{SELFPARAM();
- self.stat_secrets_total = secrets_total;
- self.stat_secrets_found = secrets_found;
+void secrets_setstatus(entity this)
+{
+ this.stat_secrets_total = secrets_total;
+ this.stat_secrets_found = secrets_found;
}
/**
* A secret has been found (maybe :P)
*/
-void trigger_secret_touch()
-{SELFPARAM();
+void trigger_secret_touch(entity this, entity toucher)
+{
// only a player can trigger this
- if (!IS_PLAYER(other))
+ if (!IS_PLAYER(toucher))
return;
// update secrets found counter
//print(ftos(secret_counter.count), "\n");
// centerprint message (multi_touch() doesn't always call centerprint())
- centerprint(other, self.message);
- self.message = "";
+ centerprint(toucher, this.message);
+ this.message = "";
// handle normal trigger features
- multi_touch();
- remove(self);
+ multi_touch(this, toucher);
+ delete(this);
}
/*QUAKED trigger_secret (.5 .5 .5) ?
You should create a common/trigger textured brush covering the entrance to a secret room/area.
Trigger secret can only be trigger by a player's touch and can not be a target itself.
*/
-void spawnfunc_trigger_secret()
-{SELFPARAM();
+spawnfunc(trigger_secret)
+{
// FIXME: should it be disabled in most modes?
// update secrets count
secrets_total += 1;
// add default message
- if (self.message == "")
- self.message = "You found a secret!";
+ if (this.message == "")
+ this.message = "You found a secret!";
// set default sound
- if (self.noise == "")
- if (!self.sounds)
- self.sounds = 1; // misc/secret.wav
+ if (this.noise == "")
+ if (!this.sounds)
+ this.sounds = 1; // misc/secret.wav
// this entity can't be a target itself!!!!
- self.targetname = "";
+ this.targetname = "";
// you can't just shoot a room to find it, can you?
- self.health = 0;
+ this.health = 0;
// a secret can not be delayed
- self.delay = 0;
+ this.delay = 0;
// convert this trigger to trigger_once
- self.classname = "trigger_once";
- spawnfunc_trigger_once();
+ this.classname = "trigger_once";
+ spawnfunc_trigger_once(this);
// take over the touch() function, so we can mark secret as found
- self.touch = trigger_secret_touch;
+ settouch(this, trigger_secret_touch);
// ignore triggering;
- self.use = func_null;
+ this.use = func_null;
}
#endif