X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ftrigger%2Fcounter.qc;h=8246aed7c329a67c8eaa10cf3f4822186ba62cfc;hb=34e7f534e2015466228eb3a78c9857741b736dca;hp=bf1d9b2da76f672c4f554ed9d262e3cb1624cbd1;hpb=451382be257bcb485a1ada1872bfdf2f18769051;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/triggers/trigger/counter.qc b/qcsrc/common/triggers/trigger/counter.qc index bf1d9b2da..8246aed7c 100644 --- a/qcsrc/common/triggers/trigger/counter.qc +++ b/qcsrc/common/triggers/trigger/counter.qc @@ -1,32 +1,33 @@ +#include "counter.qh" #ifdef SVQC -void counter_use() +void counter_use(entity this, entity actor, entity trigger) { - self.count -= 1; - if (self.count < 0) + this.count -= 1; + if (this.count < 0) return; - if (self.count == 0) + if (this.count == 0) { - if(IS_PLAYER(activator) && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0) - Send_Notification(NOTIF_ONE, activator, MSG_CENTER, CENTER_SEQUENCE_COMPLETED); + if(IS_PLAYER(actor) && (this.spawnflags & SPAWNFLAG_NOMESSAGE) == 0) + Send_Notification(NOTIF_ONE, actor, MSG_CENTER, CENTER_SEQUENCE_COMPLETED); - self.enemy = activator; - multi_trigger (); + this.enemy = actor; + multi_trigger(this); } else { - if(IS_PLAYER(activator) && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0) - if(self.count >= 4) - Send_Notification(NOTIF_ONE, activator, MSG_CENTER, CENTER_SEQUENCE_COUNTER); + if(IS_PLAYER(actor) && (this.spawnflags & SPAWNFLAG_NOMESSAGE) == 0) + if(this.count >= 4) + Send_Notification(NOTIF_ONE, actor, MSG_CENTER, CENTER_SEQUENCE_COUNTER); else - Send_Notification(NOTIF_ONE, activator, MSG_CENTER, CENTER_SEQUENCE_COUNTER_FEWMORE, self.count); + Send_Notification(NOTIF_ONE, actor, MSG_CENTER, CENTER_SEQUENCE_COUNTER_FEWMORE, this.count); } } -void counter_reset() +void counter_reset(entity this) { - self.count = self.cnt; - multi_reset(); + this.count = this.cnt; + multi_reset(this); } /*QUAKED spawnfunc_trigger_counter (.5 .5 .5) ? nomessage @@ -36,14 +37,14 @@ If nomessage is not set, t will print "1 more.. " etc when triggered and "sequen After the counter has been triggered "count" times (default 2), it will fire all of it's targets and remove itself. */ -void spawnfunc_trigger_counter() +spawnfunc(trigger_counter) { - self.wait = -1; - if (!self.count) - self.count = 2; - self.cnt = self.count; + this.wait = -1; + if (!this.count) + this.count = 2; + this.cnt = this.count; - self.use = counter_use; - self.reset = counter_reset; + this.use = counter_use; + this.reset = counter_reset; } #endif