]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/assault/sv_assault.qc
Clean up steerlib a bit
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / assault / sv_assault.qc
index 211bfb5bfa017371782ef3a159cbe081ad379714..9a9a654de9c928d3ae5112a69c8308ebaaab4016 100644 (file)
@@ -1,5 +1,7 @@
 #include "sv_assault.qh"
 
+#include <common/mapobjects/func/breakable.qh>
+
 .entity sprite;
 #define AS_ROUND_DELAY 5
 
@@ -17,7 +19,7 @@ STATIC_INIT(g_assault)
 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");
 
@@ -39,7 +41,7 @@ vector target_objective_spawn_evalfunc(entity this, entity player, entity spot,
 // 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
@@ -72,7 +74,7 @@ void assault_objective_decrease_use(entity this, entity actor, entity trigger)
                {
                        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); });
@@ -323,7 +325,7 @@ spawnfunc(target_objective_decrease)
                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;
 
@@ -347,7 +349,6 @@ bool destructible_heal(entity targ, entity inflictor, float amount, float limit)
        return true;
 }
 
-spawnfunc(func_breakable);
 spawnfunc(func_assault_destructible)
 {
        if (!g_assault) { delete(this); return; }
@@ -579,7 +580,7 @@ MUTATOR_HOOKFUNCTION(as, TurretSpawn)
        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)
@@ -626,7 +627,7 @@ MUTATOR_HOOKFUNCTION(as, ReadLevelCvars)
 
 MUTATOR_HOOKFUNCTION(as, OnEntityPreSpawn)
 {
-    entity ent = M_ARGV(0, entity);
+       entity ent = M_ARGV(0, entity);
 
        switch(ent.classname)
        {