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.velocity = self.tur_shotdir_updated * self.shot_speed;
48 proj.touch = turret_plasma_projectile_explode;
49 proj.flags = FL_PROJECTILE;
50 proj.enemy = self.enemy;
51 proj.flags = FL_PROJECTILE | FL_NOTARGET;
53 CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO_BEAM, TRUE);
55 if (self.tur_head.frame == 0)
56 self.tur_head.frame = 1;
59 void turret_plasma_dual_attack()
63 sound (self, CHAN_WEAPON, "weapons/hagar_fire.wav", VOL_BASE, ATTN_NORM);
65 setorigin(proj, self.tur_shotorg);
66 setsize(proj, '0 0 0', '0 0 0');
67 proj.classname = "plasmabomb";
69 proj.bot_dodge = TRUE;
70 proj.bot_dodgerating = self.shot_dmg;
71 proj.think = turret_plasma_projectile_explode;
72 proj.nextthink = time + 9;
73 proj.solid = SOLID_BBOX;
74 proj.movetype = MOVETYPE_FLYMISSILE;
75 proj.velocity = normalize(self.tur_shotdir_updated + randomvec() * self.shot_spread) * self.shot_speed;
76 //proj.velocity = self.tur_shotdir_updated * self.shot_speed;
77 proj.touch = turret_plasma_projectile_explode;
78 proj.flags = FL_PROJECTILE;
79 proj.enemy = self.enemy;
80 proj.flags = FL_PROJECTILE | FL_NOTARGET;
82 self.tur_head.frame += 1;
84 CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO_BEAM, TRUE);
87 void turret_plasma_projectile_explode()
91 org2 = findbetterlocation (self.origin, 8);
92 WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
93 WriteByte (MSG_BROADCAST, 79);
94 WriteCoord (MSG_BROADCAST, org2_x);
95 WriteCoord (MSG_BROADCAST, org2_y);
96 WriteCoord (MSG_BROADCAST, org2_z);
97 WriteCoord (MSG_BROADCAST, 0); // SeienAbunae: groan... Useless clutter
98 WriteCoord (MSG_BROADCAST, 0);
99 WriteCoord (MSG_BROADCAST, 0);
100 WriteByte (MSG_BROADCAST, 155);
102 self.event_damage = SUB_Null;
103 //w_deathtypestring = "ate to much plasma";
107 d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET, world);
108 self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + d; //self.owner.shot_dmg;
109 self.owner.tur_dbg_dmg_t_f = self.owner.tur_dbg_dmg_t_f + self.owner.shot_dmg;
111 RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET, world);
113 sound (self, CHAN_PROJECTILE, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
118 void turret_plasma_std_init()
120 if (self.netname == "") self.netname = "Plasma Cannon";
123 self.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIVE;
126 //self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE | TFL_AIM_ZPREDICT | TFL_AIM_GROUND2;
127 self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE | TFL_AIM_GROUND2;
128 self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_MISSILEKILL;
130 if (turret_stdproc_init("plasma_std",FALSE,"models/turrets/base.md3","models/turrets/plasma.md3") == 0)
136 self.damage_flags |= TFL_DMG_HEADSHAKE;
138 //self.firecheck_flags |= (TFL_FIRECHECK_AFF | TFL_FIRECHECK_VERIFIED);
139 self.firecheck_flags |= TFL_FIRECHECK_AFF;
141 //self.target_select_flags |= TFL_TARGETSELECT_FOV;
142 //self.target_select_fov = 45;
144 //setmodel(self,"models/turrets/base.md3");
145 //setmodel(self.tur_head,"models/turrets/plasma.md3");
146 // self.tur_head.alpha = -1;
148 if (!turret_tag_setup())
149 dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
151 // Our fireing routine
152 self.turret_firefunc = turret_plasma_attack;
154 // Custom per turret frame stuff. usualy animation.
155 self.turret_postthink = turret_plasma_postthink;
156 turret_do_updates(self);
160 void turret_plasma_dual_init()
162 if (self.netname == "") self.netname = "Dual Plasma Cannon";
165 self.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIVE;
167 // How to aim at targets
168 self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE | TFL_AIM_GROUND2 ;
169 self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL;
171 if (turret_stdproc_init("plasma_dual",0,"models/turrets/base.md3","models/turrets/plasmad.md3") == 0)
177 self.damage_flags |= TFL_DMG_HEADSHAKE;
178 //self.firecheck_flags |= (TFL_FIRECHECK_AFF | TFL_FIRECHECK_VERIFIED);
179 //self.firecheck_flags |= TFL_FIRECHECK_AFF;
181 //setmodel(self,"models/turrets/base.md3");
182 //setmodel(self.tur_head,"models/turrets/plasmad.md3");
185 if (!turret_tag_setup())
186 dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
188 // Our fireing routine
189 self.turret_firefunc = turret_plasma_dual_attack;
191 // Custom per turret frame stuff. usualy animation.
192 self.turret_postthink = turret_plasma_dual_postthink;
197 * Basic moderate (std) or fast (dual) fireing, short-mid range energy cannon.
198 * Not too mutch of a therat on its own, but can be rather dangerous in groups.
199 * Regenerates ammo slowly, support with a fusionreactor(s) to do some real damage.
202 /*QUAKED turret_plasma (0 .5 .8) ?
204 void spawnfunc_turret_plasma()
206 g_turrets_common_precash();
207 precache_model ("models/turrets/plasma.md3");
208 precache_model ("models/turrets/base.md3");
210 self.think = turret_plasma_std_init;
211 self.nextthink = time + 0.5;
214 /*QUAKED turret_plasma_dual (0 .5 .8) ?
216 void spawnfunc_turret_plasma_dual()
219 precache_model ("models/turrets/plasmad.md3");
220 precache_model ("models/turrets/base.md3");
222 self.think = turret_plasma_dual_init;
223 self.nextthink = time + 0.5;