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, CHAN_WEAPON, "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, CHAN_WEAPON, "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()
89 org2 = findbetterlocation (self.origin, 8);
90 WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
91 WriteByte (MSG_BROADCAST, 79);
92 WriteCoord (MSG_BROADCAST, org2_x);
93 WriteCoord (MSG_BROADCAST, org2_y);
94 WriteCoord (MSG_BROADCAST, org2_z);
95 WriteCoord (MSG_BROADCAST, 0); // SeienAbunae: groan... Useless clutter
96 WriteCoord (MSG_BROADCAST, 0);
97 WriteCoord (MSG_BROADCAST, 0);
98 WriteByte (MSG_BROADCAST, 155);
100 self.event_damage = SUB_Null;
101 //w_deathtypestring = "ate to much plasma";
105 d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET, world);
106 self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + d; //self.owner.shot_dmg;
107 self.owner.tur_dbg_dmg_t_f = self.owner.tur_dbg_dmg_t_f + self.owner.shot_dmg;
109 RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET, world);
111 sound (self, CHAN_PROJECTILE, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
116 void turret_plasma_std_init()
118 if (self.netname == "") self.netname = "Plasma Cannon";
121 self.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIVE;
124 self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE | TFL_AIM_GROUND2;
125 self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_MISSILEKILL;
127 if (turret_stdproc_init("plasma_std",FALSE,"models/turrets/base.md3","models/turrets/plasma.md3") == 0)
133 self.damage_flags |= TFL_DMG_HEADSHAKE;
134 self.firecheck_flags |= TFL_FIRECHECK_AFF;
136 if (!turret_tag_fire_update())
137 dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
139 // Our fireing routine
140 self.turret_firefunc = turret_plasma_attack;
142 // Custom per turret frame stuff. usualy animation.
143 self.turret_postthink = turret_plasma_postthink;
144 turret_do_updates(self);
148 void turret_plasma_dual_init()
150 if (self.netname == "") self.netname = "Dual Plasma Cannon";
153 self.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIVE;
155 // How to aim at targets
156 self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE | TFL_AIM_GROUND2 ;
157 self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL;
159 if (turret_stdproc_init("plasma_dual",0,"models/turrets/base.md3","models/turrets/plasmad.md3") == 0)
165 self.damage_flags |= TFL_DMG_HEADSHAKE;
166 self.firecheck_flags |= TFL_FIRECHECK_AFF;
168 if (!turret_tag_fire_update())
169 dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
171 // Our fireing routine
172 self.turret_firefunc = turret_plasma_dual_attack;
174 // Custom per turret frame stuff. usualy animation.
175 self.turret_postthink = turret_plasma_dual_postthink;
180 * Basic moderate (std) or fast (dual) fireing, short-mid range energy cannon.
181 * Not too mutch of a therat on its own, but can be rather dangerous in groups.
182 * Regenerates ammo slowly, support with a fusionreactor(s) to do some real damage.
185 /*QUAKED turret_plasma (0 .5 .8) ?
187 void spawnfunc_turret_plasma()
189 g_turrets_common_precash();
190 precache_model ("models/turrets/plasma.md3");
191 precache_model ("models/turrets/base.md3");
193 self.think = turret_plasma_std_init;
194 self.nextthink = time + 0.5;
197 /*QUAKED turret_plasma_dual (0 .5 .8) ?
199 void spawnfunc_turret_plasma_dual()
202 precache_model ("models/turrets/plasmad.md3");
203 precache_model ("models/turrets/base.md3");
205 self.think = turret_plasma_dual_init;
206 self.nextthink = time + 0.5;