1 void spawnfunc_turret_fusionreactor();
2 void turret_fusionreactor_dinit();
3 void turret_fusionreactor_fire();
5 void turret_fusionreactor_fire()
9 self.enemy.ammo = min(self.enemy.ammo + self.shot_dmg,self.enemy.ammo_max);
10 fl_org = 0.5 * (self.enemy.absmin + self.enemy.absmax);
11 te_smallflash(fl_org);
14 void turret_fusionreactor_postthink()
16 self.tur_head.avelocity = '0 250 0' * (self.ammo / self.ammo_max);
20 void turret_fusionreactor_respawnhook()
22 self.tur_head.avelocity = '0 50 0';
27 ** Preforms pre-fire checks for fusionreactor
29 float turret_fusionreactor_firecheck()
31 if (self.attack_finished_single > time)
34 if (self.enemy.deadflag != DEAD_NO)
37 if (self.enemy == world)
40 if (self.ammo < self.shot_dmg)
43 if (self.enemy.ammo >= self.enemy.ammo_max)
46 if (vlen(self.enemy.origin - self.origin) > self.target_range)
49 if(self.team != self.enemy.team)
52 if not (self.enemy.ammo_flags & TFL_AMMO_ENERGY)
58 void turret_fusionreactor_dinit()
60 if (self.netname == "") self.netname = "Fusionreactor";
62 self.turrcaps_flags = TFL_TURRCAPS_SUPPORT | TFL_TURRCAPS_AMMOSOURCE;
63 self.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE;
64 self.target_select_flags = TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_OWNTEAM | TFL_TARGETSELECT_RANGELIMTS;
65 self.firecheck_flags = TFL_FIRECHECK_OWM_AMMO | TFL_FIRECHECK_OTHER_AMMO | TFL_FIRECHECK_DISTANCES | TFL_FIRECHECK_DEAD;
66 self.shoot_flags = TFL_SHOOT_HITALLVALID;
67 self.aim_flags = TFL_AIM_NO;
68 self.track_flags = TFL_TRACK_NO;
69 // self.turret_respawnhook = turret_fusionreactor_respawnhook;
71 if (turret_stdproc_init("fusreac_std", "models/turrets/base.md3", "models/turrets/reactor.md3", TID_FUSION) == 0)
76 self.tur_head.scale = 0.75;
77 self.tur_head.avelocity = '0 50 0';
78 setsize(self,'-34 -34 0','34 34 90');
80 self.turret_firecheckfunc = turret_fusionreactor_firecheck;
81 self.turret_firefunc = turret_fusionreactor_fire;
82 self.turret_postthink = turret_fusionreactor_postthink;
85 /*QUAKED turret_fusionreactor (0 .5 .8) ?
87 void spawnfunc_turret_fusionreactor()
89 precache_model ("models/turrets/reactor.md3");
90 precache_model ("models/turrets/base.md3");
92 self.think = turret_fusionreactor_dinit;
93 self.nextthink = time + 0.5;