]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix monster spawnshield cvar
authorMario <mario.mario@y7mail.com>
Sun, 12 May 2013 00:04:22 +0000 (10:04 +1000)
committerMario <mario.mario@y7mail.com>
Sun, 12 May 2013 00:04:22 +0000 (10:04 +1000)
monsters.cfg
qcsrc/client/monsters.qc
qcsrc/server/autocvars.qh
qcsrc/server/g_world.qc
qcsrc/server/generator.qc
qcsrc/server/monsters/lib/monsters.qc
qcsrc/server/monsters/monster/slime.qc

index 78adbcfa611c4f345c08442bc28d6d75d888da13..7423a323ef78e1ccc6523d9e6f37686e4c572567 100644 (file)
@@ -10,7 +10,7 @@ set g_monsters_drop_type armor "Type of item to drop when forced. Possible value
 set g_monsters_drop_size medium "Size of the item monsters drop. Possible health/amor values are: small, medium, large. Possible ammo values are: shells, bullets, cells, rockets"
 set g_monsters_owners 1 "Monsters will not attack their owners in team matches if set to 1"
 set g_monsters_teams 1
-set g_monster_spawnshieldtime 2 "Monsters will not take damage for this amount of seconds"
+set g_monsters_spawnshieldtime 2 "Monsters will not take damage for this amount of seconds"
 set g_monsters_typefrag 1
 set g_monsters_healthbars 1 "Show health bars above monsters"
 set g_monsters_target_range 2000
index bd65ed5a2f5de8cb63cccf9f9c33197f9dd7cda0..991ce684ed9c3fc21fdc95f80dd45b302a3d10af 100644 (file)
@@ -204,7 +204,7 @@ void monster_mid2info(float _mid)
 
 .vector glowmod;
 void monster_changeteam()
-{      
+{
        self.glowmod = Team_ColorRGB(self.team - 1);
        self.teamradar_color = Team_ColorRGB(self.team - 1);
        
@@ -304,7 +304,7 @@ void ent_monster()
                self.move_velocity = self.velocity;
                self.move_origin   = self.origin;
        }
-               
+       
        if(sf & MSF_ANIM)
        {
                self.frame1time = ReadCoord();
index 94db730c521ea6e9f11aa92019779ed2b012ea6e..a8297fa314ed24bd971f7358c063aa5503d4859a 100644 (file)
@@ -1268,7 +1268,7 @@ float autocvar_g_monsters_forcedrop;
 float autocvar_g_monsters_drop_time;
 string autocvar_g_monsters_drop_type;
 string autocvar_g_monsters_drop_size;
-float autocvar_g_monster_spawnshieldtime;
+float autocvar_g_monsters_spawnshieldtime;
 float autocvar_g_monsters_teams;
 float autocvar_g_monsters_healthbars;
 float autocvar_g_monsters_respawn_delay;
index 3ddcc5cfcf29223fb19c86d6cbe90b20fdcd4c16..db5b1d44fb94a5770bdaf1374759b1fc4dcc5227 100644 (file)
@@ -2073,7 +2073,7 @@ float WinningCondition_RanOutOfSpawns()
 }
 
 // TD winning condition:
-// game terminates if there are no generators (or 1 dies if td_dontend is FALSE)
+// game terminates if there are no generators (or 1 dies if td_dont_end is FALSE)
 float gensurvived;
 float WinningCondition_TowerDefense()
 {
@@ -2083,7 +2083,7 @@ float WinningCondition_TowerDefense()
                return WINNING_NO;
 
        // first check if the game has ended
-       if(gendestroyed == TRUE) // FALSE means either generator hasen't spawned yet, or mapper didn't add one
+       if(gendestroyed == TRUE)
        if(td_gencount < 1 || !td_dont_end)
        {
                ClearWinners();
@@ -2094,7 +2094,7 @@ float WinningCondition_TowerDefense()
        if(gensurvived)
        {
                ClearWinners();
-               SetWinners(winning, 4);
+               checkrules_equality = TRUE;
                return WINNING_YES;
        }
 
index c20661dc06fccd3ec3424ce314ad1a75e7d26919..5bc3d119e51cf5837e735df9a09e6b6053d4a9b8 100644 (file)
@@ -48,23 +48,34 @@ void ons_gib_damage (entity inflictor, entity attacker, float damage, float deat
 }
 
 .float giblifetime;
-void ons_throwgib_think()
+
+void gib_draw_noburn()
 {
-       float d;
+       if(time >= self.giblifetime)
+               remove(self);
+}
 
-       self.nextthink = time + 0.05;
+void gib_draw()
+{
+       if(time >= self.move_time)
+               return;
 
-       d = self.giblifetime - time;
+       self.move_time = time + 0.05;
 
-       if(d<0)
+       if(time > self.giblifetime)
        {
-               self.think = SUB_Remove;
+               remove(self);
+               return;
+       }
+       
+       self.alpha -= 0.05;
+       
+       if(self.alpha < 0.1)
+       {
+               remove(self);
                return;
        }
-       if(d<1)
-               self.alpha = d;
 
-       if(d>2)
        if(random()<0.6)
                pointparticles(particleeffectnum("onslaught_generator_gib_flame"), self.origin, '0 0 0', 1);
 }
@@ -78,21 +89,21 @@ void ons_throwgib(vector v_from, vector v_to, string smodel, float f_lifetime, f
        setmodel(gib, smodel);
        setorigin(gib, v_from);
        gib.solid = SOLID_CORPSE;
+       gib.move_movetype = MOVETYPE_BOUNCE;
        gib.movetype = MOVETYPE_BOUNCE;
-       gib.health = -1;
+       gib.health = 255;
+       gib.move_velocity = v_to;
+       gib.move_origin = v_from;
        gib.velocity = v_to;
+       gib.alpha = 1;
+       gib.move_time = time;
+       gib.drawmask = MASK_NORMAL;
        gib.giblifetime = time + f_lifetime;
-
-       if (b_burn)
-       {
-               gib.think = ons_throwgib_think;
-               gib.nextthink = time + 0.05;
-       }
+       
+       if(b_burn)
+               gib.draw = gib_draw;
        else
-       {
-               gib.think = SUB_Remove;
-               gib.nextthink = time + gib.giblifetime;
-       }       
+               gib.draw = gib_draw_noburn;     
 }
 
 void onslaught_generator_ray_think()
@@ -141,7 +152,10 @@ void generator_draw()
 
        // White shockwave
        if(self.count==40||self.count==20)
+       {
                sound(self, CH_TRIGGER, "onslaught/shockwave.wav", VOL_BASE, ATTN_NORM);
+               pointparticles(particleeffectnum("electro_combo"), self.origin, '0 0 0', 6);
+       }
 
        // Throw some gibs
        if(random() < 0.3)
index 6eba15248a7944e05dbfe6123860c51780adc3b0..a42ac1de41f6bbdf751e665268ef7672ac4dfd89 100644 (file)
@@ -1005,7 +1005,7 @@ float monster_initialize(string  net_name, float mon_id,
        self.scale                              = 1;
        self.movetype                   = MOVETYPE_WALK;
        self.delay                              = -1; // used in attack delay code
-       self.spawnshieldtime    = time + autocvar_g_monster_spawnshieldtime;
+       self.spawnshieldtime    = time + autocvar_g_monsters_spawnshieldtime;
        monsters_spawned           += 1;
        self.enemy                              = world;
        self.velocity                   = '0 0 0';
index 8136114495d407abd3ac5b4b292a5a7cbfa16f41..ccaf9bf1caa2835be8abb58457d2fdf9198bd73a 100644 (file)
@@ -71,8 +71,6 @@ void slime_explode()
        pointparticles(particleeffectnum("explosion_medium"), self.origin, '0 0 0', 1);
        sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
        
-       Monster_CheckDropCvars ("slime"); // drop items after exploding to prevent player picking up item before dying
-       
        setmodel(self, "");
 }
 
@@ -81,8 +79,11 @@ void slime_dead()
        self.health = -100; // gibbed
        slime_explode();
        
+       Monster_CheckDropCvars ("slime"); // drop items after exploding to prevent player picking up item before dying
+       
+       self.deadflag = DEAD_DEAD;
        self.think = Monster_Fade;
-       self.nextthink = time;
+       self.nextthink = time + 0.1;
        
        monster_hook_death();