void counter_use(entity this, entity actor, entity trigger)
{
- this.count -= 1;
- if (this.count < 0)
+ entity store = this;
+ if(this.spawnflags & COUNTER_PER_PLAYER)
+ {
+ if(!IS_PLAYER(actor))
+ return;
+ store = actor;
+ }
+
+ store.counter_cnt += 1;
+ if (store.counter_cnt > this.count)
return;
bool doactivate = (this.spawnflags & COUNTER_FIRE_AT_COUNT);
- if (this.count == 0)
+ if (store.counter_cnt == this.count)
{
if(IS_PLAYER(actor) && !(this.spawnflags & SPAWNFLAG_NOMESSAGE))
Send_Notification(NOTIF_ONE, actor, MSG_CENTER, CENTER_SEQUENCE_COMPLETED);
{
if(IS_PLAYER(actor) && !(this.spawnflags & SPAWNFLAG_NOMESSAGE))
{
- if(this.count >= 4)
+ if((this.count - store.counter_cnt) >= 4)
Send_Notification(NOTIF_ONE, actor, MSG_CENTER, CENTER_SEQUENCE_COUNTER);
else
- Send_Notification(NOTIF_ONE, actor, MSG_CENTER, CENTER_SEQUENCE_COUNTER_FEWMORE, this.count);
+ Send_Notification(NOTIF_ONE, actor, MSG_CENTER, CENTER_SEQUENCE_COUNTER_FEWMORE, this.count - store.counter_cnt);
}
}
{
setthink(this, func_null);
this.nextthink = 0;
- this.count = this.cnt;
+ this.counter_cnt = 0;
}
/*QUAKED spawnfunc_trigger_counter (.5 .5 .5) ? nomessage COUNTER_FIRE_AT_COUNT
{
if (!this.count)
this.count = 2;
- this.cnt = this.count;
+ this.counter_cnt = 0;
this.use = counter_use;
this.reset = counter_reset;
}
#include "../common/mapobjects/func/conveyor.qh"
#include "../common/mapobjects/teleporters.qh"
#include "../common/mapobjects/target/spawnpoint.qh"
+#include <common/mapobjects/trigger/counter.qh>
#include "../common/vehicles/all.qh"
this.speedrunning = false;
+ this.counter_cnt = 0;
+
target_voicescript_clear(this);
// reset fields the weapons may use
}
-//spawnfunc(target_fragsFilter)
-//{
-// this.count = this.frags;
-// spawnfunc_trigger_counter(this);
-//}
+spawnfunc(target_fragsFilter)
+{
+ this.spawnflags |= COUNTER_PER_PLAYER;
+ this.count = this.frags;
+ spawnfunc_trigger_counter(this);
+}
//spawnfunc(item_flight) /* handled by buffs mutator */
//spawnfunc(item_haste) /* handled by buffs mutator */