#include "sv_assault.qh"
+#include <common/mapobjects/func/breakable.qh>
+
.entity sprite;
#define AS_ROUND_DELAY 5
void assault_objective_use(entity this, entity actor, entity trigger)
{
// activate objective
- SetResource(this, RES_HEALTH, 100);
+ SetResourceExplicit(this, RES_HEALTH, 100);
//print("^2Activated objective ", this.targetname, "=", etos(this), "\n");
//print("Activator is ", actor.classname, "\n");
// and when a new round starts
void assault_objective_reset(entity this)
{
- SetResource(this, RES_HEALTH, ASSAULT_VALUE_INACTIVE);
+ SetResourceExplicit(this, RES_HEALTH, ASSAULT_VALUE_INACTIVE);
}
// decrease the health of targeted objectives
{
GameRules_scoring_add_team(actor, SCORE, hlth);
GameRules_scoring_add_team(actor, ASSAULT_OBJECTIVES, 1);
- SetResource(this.enemy, RES_HEALTH, -1);
+ SetResourceExplicit(this.enemy, RES_HEALTH, -1);
if(this.enemy.message)
FOREACH_CLIENT(IS_PLAYER(it), { centerprint(it, this.enemy.message); });
this.dmg = 101;
this.use = assault_objective_decrease_use;
- SetResource(this, RES_HEALTH, ASSAULT_VALUE_INACTIVE);
+ SetResourceExplicit(this, RES_HEALTH, ASSAULT_VALUE_INACTIVE);
this.max_health = ASSAULT_VALUE_INACTIVE;
this.enemy = NULL;
return true;
}
-spawnfunc(func_breakable);
spawnfunc(func_assault_destructible)
{
if (!g_assault) { delete(this); return; }
entity turret = M_ARGV(0, entity);
if(!turret.team || turret.team == FLOAT_MAX)
- turret.team = 5; // this gets reversed when match starts?
+ turret.team = assault_attacker_team; // this gets reversed when match starts (assault_roundstart_use)
}
MUTATOR_HOOKFUNCTION(as, VehicleInit)
MUTATOR_HOOKFUNCTION(as, OnEntityPreSpawn)
{
- entity ent = M_ARGV(0, entity);
+ entity ent = M_ARGV(0, entity);
switch(ent.classname)
{