1 void spawnfunc_turret_plasma();
2 void spawnfunc_turret_plasma_dual();
4 void turret_plasma_std_init();
5 void turret_plasma_dual_init();
7 void turret_plasma_attack();
8 void turret_plasma_projectile_explode();
10 void turret_plasma_postthink()
12 if (self.tur_head.frame != 0)
13 self.tur_head.frame = self.tur_head.frame + 1;
15 if (self.tur_head.frame > 5)
16 self.tur_head.frame = 0;
19 void turret_plasma_dual_postthink()
21 if ((self.tur_head.frame != 0) && (self.tur_head.frame != 3))
22 self.tur_head.frame = self.tur_head.frame + 1;
24 if (self.tur_head.frame > 6)
25 self.tur_head.frame = 0;
28 void turret_plasma_attack()
32 sound (self, CH_WEAPON_A, "weapons/hagar_fire.wav", VOL_BASE, ATTN_NORM);
33 pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
36 setorigin(proj, self.tur_shotorg);
37 setsize(proj, '-1 -1 -1', '1 1 1');
38 proj.classname = "plasmabomb";
40 proj.bot_dodge = TRUE;
41 proj.bot_dodgerating = self.shot_dmg;
42 proj.think = turret_plasma_projectile_explode;
43 proj.nextthink = time + 9;
44 proj.solid = SOLID_BBOX;
45 proj.movetype = MOVETYPE_FLYMISSILE;
46 proj.velocity = normalize(self.tur_shotdir_updated + randomvec() * self.shot_spread) * self.shot_speed;
47 proj.touch = turret_plasma_projectile_explode;
48 proj.flags = FL_PROJECTILE;
49 proj.enemy = self.enemy;
50 proj.flags = FL_PROJECTILE | FL_NOTARGET;
52 CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO_BEAM, TRUE);
54 if (self.tur_head.frame == 0)
55 self.tur_head.frame = 1;
58 void turret_plasma_dual_attack()
62 sound (self, CH_WEAPON_A, "weapons/hagar_fire.wav", VOL_BASE, ATTN_NORM);
64 setorigin(proj, self.tur_shotorg);
65 setsize(proj, '0 0 0', '0 0 0');
66 proj.classname = "plasmabomb";
68 proj.bot_dodge = TRUE;
69 proj.bot_dodgerating = self.shot_dmg;
70 proj.think = turret_plasma_projectile_explode;
71 proj.nextthink = time + 9;
72 proj.solid = SOLID_BBOX;
73 proj.movetype = MOVETYPE_FLYMISSILE;
74 proj.velocity = normalize(self.tur_shotdir_updated + randomvec() * self.shot_spread) * self.shot_speed;
75 proj.touch = turret_plasma_projectile_explode;
76 proj.flags = FL_PROJECTILE;
77 proj.enemy = self.enemy;
78 proj.flags = FL_PROJECTILE | FL_NOTARGET;
80 self.tur_head.frame += 1;
82 CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO_BEAM, TRUE);
85 void turret_plasma_projectile_explode()
87 self.event_damage = SUB_Null;
88 //w_deathtypestring = "ate to much plasma";
92 d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_PLASMA, world);
93 self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + d; //self.owner.shot_dmg;
94 self.owner.tur_dbg_dmg_t_f = self.owner.tur_dbg_dmg_t_f + self.owner.shot_dmg;
96 RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_PLASMA, world);
102 void turret_plasma_std_init()
104 if (self.netname == "") self.netname = "Plasma Cannon";
107 self.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIVE;
110 self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE | TFL_AIM_GROUND2;
111 self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_MISSILEKILL;
113 if (turret_stdproc_init("plasma_std", "models/turrets/base.md3", "models/turrets/plasma.md3", TID_PLASMA) == 0)
119 self.damage_flags |= TFL_DMG_HEADSHAKE;
120 self.firecheck_flags |= TFL_FIRECHECK_AFF;
122 // Our fireing routine
123 self.turret_firefunc = turret_plasma_attack;
125 // Custom per turret frame stuff. usualy animation.
126 self.turret_postthink = turret_plasma_postthink;
127 turret_do_updates(self);
131 void turret_plasma_dual_init()
133 if (self.netname == "") self.netname = "Dual Plasma Cannon";
136 self.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIVE;
138 // How to aim at targets
139 self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE | TFL_AIM_GROUND2 ;
140 self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL;
142 if (turret_stdproc_init("plasma_dual", "models/turrets/base.md3", "models/turrets/plasmad.md3", TID_PLASMA_DUAL) == 0)
148 self.damage_flags |= TFL_DMG_HEADSHAKE;
149 self.firecheck_flags |= TFL_FIRECHECK_AFF;
151 // Our fireing routine
152 self.turret_firefunc = turret_plasma_dual_attack;
154 // Custom per turret frame stuff. usualy animation.
155 self.turret_postthink = turret_plasma_dual_postthink;
160 * Basic moderate (std) or fast (dual) fireing, short-mid range energy cannon.
161 * Not too mutch of a therat on its own, but can be rather dangerous in groups.
162 * Regenerates ammo slowly, support with a fusionreactor(s) to do some real damage.
165 /*QUAKED turret_plasma (0 .5 .8) ?
167 void spawnfunc_turret_plasma()
169 g_turrets_common_precash();
170 precache_model ("models/turrets/plasma.md3");
171 precache_model ("models/turrets/base.md3");
173 self.think = turret_plasma_std_init;
174 self.nextthink = time + 0.5;
177 /*QUAKED turret_plasma_dual (0 .5 .8) ?
179 void spawnfunc_turret_plasma_dual()
182 precache_model ("models/turrets/plasmad.md3");
183 precache_model ("models/turrets/base.md3");
185 self.think = turret_plasma_dual_init;
186 self.nextthink = time + 0.5;