]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/gamemode_onslaught.qc
Merge branch 'master' into Mario/csqc_models
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_onslaught.qc
index e4be2d7ab4ce2ea2b9422456b2affc7fbec3f2fd..fd7f305c910c2859bd528e72d5fb9ec29ae62aba 100644 (file)
@@ -397,7 +397,7 @@ void onslaught_generator_think()
                        }
                        // self.max_health / 300 gives 5 minutes of overtime.
                        // control points reduce the overtime duration.
-                       sound(self, CH_TRIGGER, "onslaught/generator_decay.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_TRIGGER, "onslaught/generator_decay.wav", VOL_BASE, ATTEN_NORM);
                        d = 1;
                        e = findchain(classname, "onslaught_controlpoint");
                        while (e)
@@ -426,7 +426,7 @@ void onslaught_generator_think()
                 if(e.team == self.team)
                 {
                     centerprint(e, "^1Your generator is NOT shielded!\n^7Re-capture controlpoints to shield it!");
-                    soundto(MSG_ONE, e, CHAN_AUTO, "kh/alarm.wav", VOL_BASE, ATTN_NONE);    // FIXME: Uniqe sound?
+                    soundto(MSG_ONE, e, CHAN_AUTO, "kh/alarm.wav", VOL_BASE, ATTEN_NONE);    // FIXME: Uniqe sound?
                 }
             }
         }
@@ -488,7 +488,7 @@ void onslaught_generator_damage_think()
                if(random() < 0.01)
                {
                        pointparticles(particleeffectnum("electro_ballexplode"), self.origin + randompos('-50 -50 -20', '50 50 50'), '0 0 0', 1);
-                       sound(self, CH_TRIGGER, "onslaught/electricity_explode.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_TRIGGER, "onslaught/electricity_explode.wav", VOL_BASE, ATTEN_NORM);
                }
                else
                        pointparticles(particleeffectnum("torch_small"), self.origin + randompos('-60 -60 -20', '60 60 60'), '0 0 0', 1);
@@ -510,14 +510,14 @@ void onslaught_generator_deaththink()
        vector org;
        float i;
 
-       if not (self.count)
+       if (!self.count)
                self.count = 40;
 
        // White shockwave
        if(self.count==40||self.count==20)
        {
                onslaught_generator_ring_spawn(self.origin);
-               sound(self, CH_TRIGGER, "onslaught/shockwave.wav", VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER, "onslaught/shockwave.wav", VOL_BASE, ATTEN_NORM);
        }
 
        // Throw some gibs
@@ -543,7 +543,7 @@ void onslaught_generator_deaththink()
        if(random() < 0.25)
        {
                te_explosion(self.origin);
-               sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTEN_NORM);
        }
 
        // Particles
@@ -563,7 +563,7 @@ void onslaught_generator_deaththink()
                te_explosion(org);
                onslaught_generator_shockwave_spawn(org);
                pointparticles(particleeffectnum("onslaught_generator_finalexplosion"), org, '0 0 0', 1);
-               sound(self, CH_TRIGGER, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
        }
        else
                self.nextthink = time + 0.05;
@@ -576,7 +576,7 @@ void onslaught_generator_damage(entity inflictor, entity attacker, float damage,
        float i;
        if (damage <= 0)
                return;
-       if(inWarmupStage)
+       if(warmup_stage)
                return;
        if (attacker != self)
        {
@@ -614,7 +614,7 @@ void onslaught_generator_damage(entity inflictor, entity attacker, float damage,
 #endif
                self.lasthealth = self.health;
        }
-       else if not(inWarmupStage)
+       else if (!warmup_stage)
        {
                if (attacker == self)
                        bprint(Team_ColoredFullName(self.team), " generator spontaneously exploded due to overtime!\n");
@@ -664,7 +664,7 @@ void onslaught_generator_damage(entity inflictor, entity attacker, float damage,
        // Throw some flaming gibs on damage, more damage = more chance for gib
        if(random() < damage/220)
        {
-               sound(self, CH_TRIGGER, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
                i = random();
                if(i < 0.3)
                        ons_throwgib(hitloc + '0 0 20', force * -1, "models/onslaught/gen_gib1.md3", 5, TRUE);
@@ -680,9 +680,9 @@ void onslaught_generator_damage(entity inflictor, entity attacker, float damage,
 
                //sound on every hit
                if (random() < 0.5)
-                       sound(self, CH_TRIGGER, "onslaught/ons_hit1.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_TRIGGER, "onslaught/ons_hit1.wav", VOL_BASE, ATTEN_NORM);
                else
-                       sound(self, CH_TRIGGER, "onslaught/ons_hit2.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_TRIGGER, "onslaught/ons_hit2.wav", VOL_BASE, ATTEN_NORM);
        }
 
        //throw some gibs on damage
@@ -1026,13 +1026,13 @@ void onslaught_controlpoint_icon_damage(entity inflictor, entity attacker, float
        pointparticles(particleeffectnum("sparks"), hitloc, force*-1, 1);
        //sound on every hit
        if (random() < 0.5)
-               sound(self, CH_TRIGGER, "onslaught/ons_hit1.wav", VOL_BASE+0.3, ATTN_NORM);
+               sound(self, CH_TRIGGER, "onslaught/ons_hit1.wav", VOL_BASE+0.3, ATTEN_NORM);
        else
-               sound(self, CH_TRIGGER, "onslaught/ons_hit2.wav", VOL_BASE+0.3, ATTN_NORM);
+               sound(self, CH_TRIGGER, "onslaught/ons_hit2.wav", VOL_BASE+0.3, ATTEN_NORM);
 
        if (self.health < 0)
        {
-               sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTEN_NORM);
                pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
                {
                        string t;
@@ -1209,9 +1209,9 @@ void onslaught_controlpoint_icon_think()
                pointparticles(particleeffectnum("electricity_sparks"), self.origin + randompos('-10 -10 -20', '10 10 20'), '0 0 0', 1);
 
                if(random() > 0.8)
-                       sound(self, CH_PAIN, "onslaught/ons_spark1.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_PAIN, "onslaught/ons_spark1.wav", VOL_BASE, ATTEN_NORM);
                else if (random() > 0.5)
-                       sound(self, CH_PAIN, "onslaught/ons_spark2.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_PAIN, "onslaught/ons_spark2.wav", VOL_BASE, ATTEN_NORM);
        }
 }
 
@@ -1234,7 +1234,7 @@ void onslaught_controlpoint_icon_buildthink()
                self.health = self.max_health;
                self.count = autocvar_g_onslaught_cp_regen * sys_frametime; // slow repair rate from now on
                self.think = onslaught_controlpoint_icon_think;
-               sound(self, CH_TRIGGER, "onslaught/controlpoint_built.wav", VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER, "onslaught/controlpoint_built.wav", VOL_BASE, ATTEN_NORM);
                bprint(Team_ColoredFullName(self.team), " captured ", self.owner.message, " control point\n");
                self.owner.iscaptured = TRUE;
 
@@ -1271,7 +1271,7 @@ void onslaught_controlpoint_touch()
 {
        entity e;
        float a;
-       if not(IS_PLAYER(other))
+       if (!IS_PLAYER(other))
                return;
        a = onslaught_controlpoint_attackable(self, other.team);
        if(a != 2 && a != 4)
@@ -1297,13 +1297,19 @@ void onslaught_controlpoint_touch()
        e.think = onslaught_controlpoint_icon_buildthink;
        e.nextthink = time + sys_frametime;
        e.count = (e.max_health - e.health) * sys_frametime / autocvar_g_onslaught_cp_buildtime; // how long it takes to build
-       sound(e, CH_TRIGGER, "onslaught/controlpoint_build.wav", VOL_BASE, ATTN_NORM);
+       sound(e, CH_TRIGGER, "onslaught/controlpoint_build.wav", VOL_BASE, ATTEN_NORM);
        self.team = e.team;
        self.colormap = e.colormap;
        WaypointSprite_UpdateBuildFinished(self.sprite, time + (e.max_health - e.health) / (e.count / sys_frametime));
        onslaught_updatelinks();
 }
 
+void onslaught_controlpoint_think()
+{
+       self.nextthink = time;
+       CSQCMODEL_AUTOUPDATE();
+}
+
 void onslaught_controlpoint_reset()
 {
        if(self.goalentity && self.goalentity != world)
@@ -1316,8 +1322,9 @@ void onslaught_controlpoint_reset()
        self.isshielded = TRUE;
        self.enemy.solid = SOLID_NOT;
        self.enemy.colormap = self.colormap;
-       self.think = self.enemy.think = func_null;
-       self.nextthink = 0; // don't like func_null :P
+       self.think = onslaught_controlpoint_think;
+       self.enemy.think = func_null;
+       self.nextthink = time; // don't like func_null :P
        setmodel(self, "models/onslaught/controlpoint_pad.md3");
        //setsize(self, '-32 -32 0', '32 32 8');
 
@@ -1327,6 +1334,8 @@ void onslaught_controlpoint_reset()
 
        activator = self;
        SUB_UseTargets(); // to reset the structures, playerspawns etc.
+       
+       CSQCMODEL_AUTOUPDATE();
 }
 
 /*QUAKED spawnfunc_onslaught_controlpoint (0 .5 .8) (-32 -32 0) (32 32 128)
@@ -1397,6 +1406,9 @@ void spawnfunc_onslaught_controlpoint()
        self.enemy.colormap = self.colormap;
 
        waypoint_spawnforitem(self);
+       
+       self.think = onslaught_controlpoint_think;
+       self.nextthink = time;
 
        WaypointSprite_SpawnFixed(string_null, self.origin + '0 0 128', self, sprite, RADARICON_NONE, '0 0 0');
        WaypointSprite_UpdateRule(self.sprite, NUM_TEAM_2, SPRITERULE_TEAMPLAY);
@@ -1404,6 +1416,8 @@ void spawnfunc_onslaught_controlpoint()
        onslaught_updatelinks();
 
        self.reset = onslaught_controlpoint_reset;
+       
+       CSQCMODEL_AUTOINIT();
 }
 
 float onslaught_link_send(entity to, float sendflags)