]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add FLAC Cannon support to TD
authorMario <mario.mario@y7mail.com>
Sun, 10 Feb 2013 22:33:09 +0000 (09:33 +1100)
committerMario <mario.mario@y7mail.com>
Sun, 10 Feb 2013 22:33:09 +0000 (09:33 +1100)
gamemodes.cfg
qcsrc/server/autocvars.qh
qcsrc/server/monsters/monster/hknight.qc
qcsrc/server/monsters/monster/shalrath.qc
qcsrc/server/mutators/base.qh
qcsrc/server/mutators/gamemode_td.qc
qcsrc/server/tturrets/system/system_main.qc

index 0debc59d2ad58021745a8818ad186cfac02e828d..f602935705f2e93bd6a8ebe6ecda322d439cf259 100644 (file)
@@ -507,6 +507,7 @@ set g_td_turret_plasma_cost 50
 set g_td_turret_mlrs_cost 80
 set g_td_turret_walker_cost 100
 set g_td_tower_buff_cost 70
+set g_td_turret_flac_cost 40
 set g_td_turret_upgrade_cost 100
 set g_td_monsters_speed_walk 75
 set g_td_monsters_speed_run 110
index 9d11d27c68a446b65e3126cb53282fa7b2a8f5eb..1ed5378b741f9d174f4280f4efc3cb4b7f198de2 100644 (file)
@@ -1295,6 +1295,7 @@ float autocvar_g_td_turret_plasma_cost;
 float autocvar_g_td_turret_mlrs_cost;
 float autocvar_g_td_turret_walker_cost;
 float autocvar_g_td_tower_buff_cost;
+float autocvar_g_td_turret_flac_cost;
 float autocvar_g_td_monsters_skill_start;
 float autocvar_g_td_monsters_skill_increment;
 float autocvar_g_td_monsters_speed_walk;
index a4b42acbd557c8b106ecbd43980614ec7dd0224d..46c652af57275fdf789de35666906d7af5e76032 100644 (file)
@@ -80,6 +80,7 @@ void hknight_shoot ()
        setsize (missile, '0 0 0', '0 0 0');            
        setorigin(missile, self.origin + '0 0 10' + v_forward * 14);
        missile.scale = self.scale;
+       missile.flags = FL_PROJECTILE;
        missile.velocity = dir * 400;
        missile.avelocity = '300 300 300';
        missile.nextthink = time + 5;
@@ -231,6 +232,7 @@ void hellknight_fireball ()
        missile.movetype = MOVETYPE_FLYMISSILE;
        setsize (missile, fmins, fmaxs);                
        setorigin(missile, self.origin + '0 0 10' + v_forward * 14);
+       missile.flags = FL_PROJECTILE;
        missile.velocity = dir * 400;
        missile.avelocity = '300 300 300';
        missile.nextthink = time + 5;
index 732ff78ae4de4dc2cfd6ee402e30fffd72f9008f..caa96b73afacf73338aa893fbfe9d5acd00435d9 100644 (file)
@@ -64,47 +64,6 @@ float shal_missile ()
        return TRUE;
 }
 
-void() ShalHome;
-void ShalMissile_Spawn ()
-{
-       local   vector  dir = '0 0 0';
-       local   float   dist = 0;
-       
-       self.realowner.effects |= EF_MUZZLEFLASH;
-       
-       dir = normalize((self.owner.enemy.origin + '0 0 10') - self.owner.origin);
-       dist = vlen (self.owner.enemy.origin - self.owner.origin);
-       
-       self.solid = SOLID_BBOX;
-       self.movetype = MOVETYPE_FLYMISSILE;
-       CSQCProjectile(self, TRUE, PROJECTILE_CRYLINK, TRUE);
-       
-       self.realowner.v_angle = self.realowner.angles;
-       makevectors (self.realowner.angles);
-
-       setsize (self, '0 0 0', '0 0 0');               
-
-       setorigin (self, self.realowner.origin + v_forward * 14 + '0 0 30' + v_right * -14);
-       self.velocity = dir * 400;
-       self.avelocity = '300 300 300';
-       self.enemy = self.realowner.enemy;
-       self.touch = W_Plasma_TouchExplode;
-       ShalHome();
-}
-
-void ShalMissile ()
-{
-       local   entity  missile = world;
-
-       sound (self, CHAN_WEAPON, "weapons/spike.wav", 1, ATTN_NORM);
-
-       missile = spawn ();
-       missile.owner = missile.realowner = self;
-
-       missile.think = ShalMissile_Spawn;
-       missile.nextthink = time;
-}
-
 .float shal_cycles;
 void ShalHome ()
 {
@@ -118,7 +77,7 @@ void ShalHome ()
        }
        dir = normalize(vtemp - self.origin);
        UpdateCSQCProjectile(self);
-       if (autocvar_skill == 3)
+       if (monster_skill == 3)
                self.velocity = dir * 350;
        else
                self.velocity = dir * 250;
@@ -126,6 +85,40 @@ void ShalHome ()
        self.think = ShalHome;  
 }
 
+void ShalMissile ()
+{
+       local   entity  missile = world;
+       local   vector  dir = '0 0 0';
+       local   float   dist = 0;
+       
+       self.effects |= EF_MUZZLEFLASH;
+
+       sound (self, CHAN_WEAPON, "weapons/spike.wav", 1, ATTN_NORM);
+
+       missile = spawn ();
+       missile.owner = missile.realowner = self;
+       
+       self.v_angle = self.angles;
+       makevectors (self.angles);
+       
+       dir = normalize((self.enemy.origin + '0 0 10') - self.origin);
+       dist = vlen (self.enemy.origin - self.origin);
+
+       missile.think = ShalHome;
+       missile.nextthink = time;
+       missile.solid = SOLID_BBOX;
+       missile.movetype = MOVETYPE_FLYMISSILE;
+       missile.flags = FL_PROJECTILE;
+       setorigin (missile, self.origin + v_forward * 14 + '0 0 30' + v_right * -14);
+       setsize (missile, '0 0 0', '0 0 0');    
+       missile.velocity = dir * 400;
+       missile.avelocity = '300 300 300';
+       missile.enemy = self.enemy;
+       missile.touch = W_Plasma_TouchExplode;
+       
+       CSQCProjectile(missile, TRUE, PROJECTILE_CRYLINK, TRUE);
+}
+
 float ShalrathCheckAttack ()
 {
        local vector spot1 = '0 0 0', spot2 = '0 0 0';
index 3c2b9fb073c0a863924fcd5601b21c522baed0cc..b9203d844295ddf0a14bfeb4daf08e8b94d66d30 100644 (file)
@@ -113,6 +113,7 @@ MUTATOR_HOOKABLE(TurretValidateTarget);
        // INPUT:
                entity turret_target;
                entity turret;
+               float turret_flags;
        
 MUTATOR_HOOKABLE(OnEntityPreSpawn);
        // return error to prevent entity spawn, or modify the entity
index 46f5d935ff5f4f67952012df09cd0d70480f7211..99688e396e0d7f1dc857e5b0ef7038288af874fb 100644 (file)
@@ -645,6 +645,11 @@ void td_Init()
 
 MUTATOR_HOOKFUNCTION(td_TurretValidateTarget)
 {
+       if(turret_flags & TFL_TARGETSELECT_MISSILESONLY)
+    if(turret_target.flags & FL_PROJECTILE)
+       if(turret_target.owner.flags & FL_MONSTER)
+        return TRUE; // flac support
+                       
        if(turret.turrcaps_flags & TFL_TURRCAPS_SUPPORT && turret_target.turrcaps_flags & TFL_TURRCAPS_ISTURRET)
                return TRUE;
        if not(turret_target.flags & FL_MONSTER)
@@ -936,6 +941,14 @@ MUTATOR_HOOKFUNCTION(td_PlayerCommand)
                                sprint(self, "Spawned 1 MLRS turret", "\n");
                                return TRUE;
                        }
+                       case "flac":
+                       {
+                if(self.ammo_fuel < autocvar_g_td_turret_flac_cost) break;
+                               self.ammo_fuel -= autocvar_g_td_turret_flac_cost;
+                               spawnturret(self, self, "flac", trace_endpos);
+                               sprint(self, "Spawned 1 FLAC Cannon", "\n");
+                               return TRUE;
+                       }
                        case "walker":
                        {
                 if(self.ammo_fuel < autocvar_g_td_turret_walker_cost) break;
index 8907bc41b8d4e62685f0677fce7a7f70622e49ea..ba42215aeb213567ba53047110125a7f24ef23cb 100644 (file)
@@ -573,6 +573,7 @@ float turret_validate_target(entity e_turret, entity e_target, float validate_fl
     vector v_tmp;
        
        turret_target = e_target;
+       turret_flags = validate_flags;
        turret = e_turret;
        if(MUTATOR_CALLHOOK(TurretValidateTarget))
                return 1;