Turret fusionreactor:
authortzork <tzork@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Wed, 24 Feb 2010 20:18:22 +0000 (20:18 +0000)
committertzork <tzork@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Wed, 24 Feb 2010 20:18:22 +0000 (20:18 +0000)
Fix top location
Add a small flash effect to target when it recharges a unit
Fix bbox
Top part variable spin speed depending on stored energy.
Tweak config

Turret tessa:
Tweak top animation, get rid of unnecessary field define.
Tweak config
Fix bbox

git-svn-id: svn://svn.icculus.org/nexuiz/trunk@8666 f962a42d-fe04-0410-a3ab-8c8b0445ebaa

data/qcsrc/server/tturrets/units/unit_fusionreactor.qc
data/qcsrc/server/tturrets/units/unit_tessla.qc
data/unit_fusreac.cfg
data/unit_tesla.cfg

index 7e2d883..00c568b 100644 (file)
@@ -5,10 +5,8 @@ void turret_fusionreactor_fire();
 float turret_fusionreactor_firecheck()
 {
     if (self.enemy == world) return 0;
-
-    if (!(self.enemy.ammo_flags & TFL_AMMO_RECIVE)) return 0;
-    if (!(self.enemy.ammo_flags & TFL_AMMO_ENERGY)) return 0;
-
+    if not (self.enemy.ammo_flags & TFL_AMMO_RECIVE) return 0;
+    if not (self.enemy.ammo_flags & TFL_AMMO_ENERGY) return 0;
     if (self.ammo < self.shot_dmg) return 0;
     if (self.enemy.ammo >= self.enemy.ammo_max) return 0;
     if (self.tur_dist_aimpos > self.target_range) return 0;
@@ -19,12 +17,20 @@ float turret_fusionreactor_firecheck()
 
 void turret_fusionreactor_fire()
 {
+    vector fl_org;
+
     self.enemy.ammo = min(self.enemy.ammo + self.shot_dmg,self.enemy.ammo_max);
+    fl_org = 0.5 * (self.enemy.absmin + self.enemy.absmax);
+    te_smallflash(fl_org);
     //te_lightning1(world,self.origin,self.enemy.origin);
 }
 
 void turret_fusionreactor_postthink()
 {
+    float v
+    v = self.ammo / self.ammo_max;
+
+    self.tur_head.avelocity = '0 250 0' * v;
 }
 
 void turret_fusionreactor_respawnhook()
@@ -36,33 +42,27 @@ void turret_fusionreactor_dinit()
 {
     if (self.netname == "")      self.netname     = "Fusionreactor";
 
-    self.turrcaps_flags = TFL_TURRCAPS_SUPPORT | TFL_TURRCAPS_AMMOSOURCE;
-
-    self.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE;
-
+    self.turrcaps_flags      = TFL_TURRCAPS_SUPPORT | TFL_TURRCAPS_AMMOSOURCE;
+    self.ammo_flags          = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE;
     self.target_select_flags = TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_OWNTEAM | TFL_TARGETSELECT_RANGELIMTS;
+    self.firecheck_flags     = TFL_FIRECHECK_OWM_AMMO | TFL_FIRECHECK_OTHER_AMMO | TFL_FIRECHECK_DISTANCES | TFL_FIRECHECK_DEAD | TFL_FIRECHECK_WORLD;
+    self.shoot_flags         = TFL_SHOOT_HITALLVALID;
+    self.aim_flags           = TFL_AIM_NO;
+    self.track_flags         = TFL_TRACK_NO;
+    self.turret_respawnhook  = turret_fusionreactor_respawnhook;
 
-    self.firecheck_flags = TFL_FIRECHECK_OWM_AMMO | TFL_FIRECHECK_OTHER_AMMO | TFL_FIRECHECK_DISTANCES | TFL_FIRECHECK_DEAD | TFL_FIRECHECK_WORLD;
-
-    self.shoot_flags = TFL_SHOOT_HITALLVALID;
-    self.aim_flags = TFL_AIM_NO;
-    self.track_flags = TFL_TRACK_NO;
-    self.turret_respawnhook = turret_fusionreactor_respawnhook;
     if (turret_stdproc_init("fusreac_std",0,"models/turrets/base.md3","models/turrets/reactor.md3") == 0)
     {
         remove(self);
         return;
     }
-    setsize(self.tur_head,'-32 -32 0','32 32 64');
-
     self.tur_head.scale = 0.75;
-    setorigin(self.tur_head,self.origin + '0 0 25');
     self.tur_head.avelocity = '0 50 0';
+    setsize(self,'-34 -34 0','34 34 90');
 
-    self.turret_firecheckfunc = turret_fusionreactor_firecheck;
-    self.turret_firefunc = turret_fusionreactor_fire;
-
-    self.turret_postthink = turret_fusionreactor_postthink;
+    self.turret_firecheckfunc   = turret_fusionreactor_firecheck;
+    self.turret_firefunc        = turret_fusionreactor_fire;
+    self.turret_postthink       = turret_fusionreactor_postthink;
 }
 
 /*QUAKED turret_fusionreactor (0 .5 .8) ?
index 8d5a1ba..1d77c99 100644 (file)
@@ -2,7 +2,6 @@ void spawnfunc_turret_tesla();
 void turret_tesla_dinit();
 void turret_tesla_fire();
 
-.float toasted;
 entity toast(entity from, float range, float damage)
 {
     entity e;
@@ -15,7 +14,7 @@ entity toast(entity from, float range, float damage)
     e = findradius(from.origin,range);
     while (e)
     {
-        if ((e.toasted != 1) && (e != from))
+        if ((e.railgunhit != 1) && (e != from))
         {
             r = turret_validate_target(self,e,self.target_validate_flags);
             if (r > 0)
@@ -32,7 +31,6 @@ entity toast(entity from, float range, float damage)
                 }
             }
         }
-
         e = e.chain;
     }
 
@@ -40,8 +38,9 @@ entity toast(entity from, float range, float damage)
     {
         te_smallflash(etarget.origin);
         te_csqc_lightningarc(from.origin,etarget.origin);
-        Damage(etarget,self,self,damage,DEATH_TURRET,etarget.origin,'0 0 0');
-        etarget.toasted = 1;
+        dprint("DMG:",ftos(damage),"\n");
+        Damage(etarget, self, self, damage, DEATH_TURRET, etarget.origin, '0 0 0');
+        etarget.railgunhit = 1;
     }
 
     return etarget;
@@ -52,8 +51,7 @@ float turret_tesla_firecheck()
     if not (turret_stdproc_firecheck())
         return 0;
 
-    self.target_select_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_MISSILES |
-                                 TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK;
+    self.target_select_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_MISSILES | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK;
 
     self.enemy = turret_select_target();
 
@@ -76,33 +74,29 @@ void turret_tesla_fire()
     e = spawn();
     setorigin(e,self.tur_shotorg);
 
-
-    self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_MISSILES |
-                                 TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK;
+    self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_MISSILES | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK;
 
     t = toast(e,r,d);
     remove(e);
 
     if (t == world) return;
 
-    self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_MISSILES |
-                                 TFL_TARGETSELECT_TEAMCHECK;
-
-
+    self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_MISSILES | TFL_TARGETSELECT_TEAMCHECK;
 
     self.attack_finished_single = time + self.shot_refire;
     for (i = 0; i < 10; ++i)
     {
-        d *= 0.5;
+        d *= 0.75;
         r *= 0.85;
-        t = toast(t,r,d);
+        t = toast(t, r, d);
         if (t == world) break;
+
     }
 
-    e = findchainfloat(toasted, 1);
+    e = findchainfloat(railgunhit, 1);
     while (e)
     {
-        e.toasted = 0;
+        e.railgunhit = 0;
         e = e.chain;
     }
 }
@@ -117,18 +111,18 @@ void turret_tesla_postthink()
 
     if(self.ammo < self.shot_dmg)
     {
-        self.tur_head.avelocity = '0 9 0' * (self.ammo / self.shot_dmg);
+        self.tur_head.avelocity = '0 45 0' * (self.ammo / self.shot_dmg);
     }
     else
     {
-        self.tur_head.avelocity = '0 90 0' * (self.ammo / self.shot_dmg);
+        self.tur_head.avelocity = '0 180 0' * (self.ammo / self.shot_dmg);
 
         if(self.attack_finished_single > time)
             return;
 
         float f;
         f = (self.ammo / self.ammo_max);
-        f = f*f;
+        f = f * f;
         if(f > random())
             if(random() < 0.1)
                 te_csqc_lightningarc(self.tur_shotorg,self.tur_shotorg + (randomvec() * 350));
@@ -156,7 +150,7 @@ void turret_tesla_dinit()
         remove(self);
         return;
     }
-    setsize(self,'-48 -48 0','48 48 96');
+    setsize(self,'-60 -60 0','60 60 128');
 
     self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_MISSILES |
                                  TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK;
index c45b1da..c575f1b 100644 (file)
@@ -2,12 +2,12 @@ set g_turrets_unit_fusreac_std_health 700
 set g_turrets_unit_fusreac_std_respawntime 90
 
 set g_turrets_unit_fusreac_std_shot_speed 1
-set g_turrets_unit_fusreac_std_shot_dmg 25
-set g_turrets_unit_fusreac_std_shot_refire 0.1
+set g_turrets_unit_fusreac_std_shot_dmg 20
+set g_turrets_unit_fusreac_std_shot_refire 0.2
 
 set g_turrets_unit_fusreac_std_target_range 1024
 set g_turrets_unit_fusreac_std_target_range_min 1
 
-set g_turrets_unit_fusreac_std_ammo_max 300
+set g_turrets_unit_fusreac_std_ammo_max 100
 set g_turrets_unit_fusreac_std_ammo 0
-set g_turrets_unit_fusreac_std_ammo_recharge 150
+set g_turrets_unit_fusreac_std_ammo_recharge 100
index 95529c7..3a66b5f 100644 (file)
@@ -1,8 +1,8 @@
 set g_turrets_unit_tesla_std_health 1000
 set g_turrets_unit_tesla_std_respawntime 120
 
-set g_turrets_unit_tesla_std_shot_dmg 100
-set g_turrets_unit_tesla_std_shot_refire 1
+set g_turrets_unit_tesla_std_shot_dmg 200
+set g_turrets_unit_tesla_std_shot_refire 1.5
 set g_turrets_unit_tesla_std_shot_force 400
 
 set g_turrets_unit_tesla_std_shot_volly 1