3 const vector proj_color = '1 1 1';
6 void W_Crylink_Touch (void)
8 if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
13 RadiusDamage (self, self.realowner, cvar("g_balance_crylink_primary_damage"), cvar("g_balance_crylink_primary_edgedamage"), cvar("g_balance_crylink_primary_radius"), world, cvar("g_balance_crylink_primary_force"), IT_CRYLINK);
14 te_gunshotquad(self.origin);
17 //te_smallflash(self.origin);
18 if (other.takedamage == DAMAGE_AIM)
24 self.touch = SUB_Null;
25 setmodel (self, "models/plasma.mdl");
26 setsize (self, '0 0 0', '0 0 0');
30 self.think = SUB_Remove;
31 self.movetype = MOVETYPE_NONE;
32 self.effects = EF_FULLBRIGHT | EF_LOWPRECISION;
33 SUB_SetFade(self, time, 1);
38 void W_Crylink_Touch2 (void)
40 if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
45 RadiusDamage (self, self.realowner, cvar("g_balance_crylink_secondary_damage"), cvar("g_balance_crylink_secondary_edgedamage"), cvar("g_balance_crylink_secondary_radius"), world, cvar("g_balance_crylink_secondary_force"), IT_CRYLINK);
46 te_gunshotquad(self.origin);
49 //te_smallflash(self.origin);
50 if (other.takedamage == DAMAGE_AIM)
56 self.touch = SUB_Null;
57 setmodel (self, "models/plasma.mdl");
58 setsize (self, '0 0 0', '0 0 0');
62 self.think = SUB_Remove;
63 self.movetype = MOVETYPE_NONE;
64 self.effects = EF_FULLBRIGHT | EF_LOWPRECISION;
65 SUB_SetFade(self, time, 1);
70 void W_Crylink_Attack (void)
72 local float counter, shots;
75 if (cvar("g_use_ammunition"))
76 self.ammo_cells = self.ammo_cells - cvar("g_balance_crylink_primary_ammo");
78 W_SetupShot (self, '15 8 -8', FALSE, 2, "weapons/crylink_fire.ogg");
79 te_smallflash(w_shotorg);
81 shots = cvar("g_balance_crylink_primary_shots");
82 while (counter < shots)
85 proj.realowner = proj.owner = self;
86 proj.classname = "spike";
87 proj.bot_dodge = TRUE;
88 proj.bot_dodgerating = cvar("g_balance_crylink_primary_damage");
90 proj.movetype = MOVETYPE_BOUNCE;
91 proj.solid = SOLID_BBOX;
94 setmodel (proj, "models/plasmatrail.mdl");
95 setsize (proj, '0 0 0', '0 0 0');
96 setorigin (proj, w_shotorg);
98 proj.velocity = (w_shotdir + randomvec() * cvar("g_balance_crylink_primary_spread")) * cvar("g_balance_crylink_primary_speed");
99 proj.touch = W_Crylink_Touch;
100 proj.think = SUB_Remove;
101 proj.nextthink = time + cvar("g_balance_crylink_primary_lifetime");
103 proj.angles = vectoangles (proj.velocity);
105 //proj.glow_size = 20;
107 proj.effects = EF_NOSHADOW | EF_FULLBRIGHT | EF_LOWPRECISION;
108 proj.flags = FL_PROJECTILE;
109 proj.colormod = proj_color;
110 counter = counter + 1;
114 void W_Crylink_Attack2 (void)
116 local float counter, shots;
119 if (cvar("g_use_ammunition"))
120 self.ammo_cells = self.ammo_cells - cvar("g_balance_crylink_secondary_ammo");
122 W_SetupShot (self, '15 8 -8', FALSE, 2, "weapons/crylink_fire.ogg");
123 te_smallflash(w_shotorg);
125 shots = cvar("g_balance_crylink_secondary_shots");
126 while (counter < shots)
129 proj.realowner = proj.owner = self;
130 proj.classname = "spike";
131 proj.bot_dodge = TRUE;
132 proj.bot_dodgerating = cvar("g_balance_crylink_secondary_damage");
134 proj.movetype = MOVETYPE_BOUNCE;
135 proj.solid = SOLID_BBOX;
136 proj.gravity = 0.001;
138 setmodel (proj, "models/plasmatrail.mdl");
139 setsize (proj, '0 0 0', '0 0 0');
140 setorigin (proj, w_shotorg);
142 proj.velocity = (w_shotdir + ((counter / shots) * 2 - 1) * v_right * cvar("g_balance_crylink_secondary_spread")) * cvar("g_balance_crylink_secondary_speed");
143 proj.touch = W_Crylink_Touch2;
144 proj.think = SUB_Remove;
145 proj.nextthink = time + cvar("g_balance_crylink_secondary_lifetime");
147 proj.angles = vectoangles (proj.velocity);
149 //proj.glow_size = 20;
151 proj.effects = EF_NOSHADOW | EF_FULLBRIGHT | EF_LOWPRECISION;
152 proj.flags = FL_PROJECTILE;
153 proj.colormod = proj_color;
154 counter = counter + 1;
160 // experimental lightning gun
161 void W_Crylink_Attack3 (void)
163 if (cvar("g_use_ammunition"))
164 self.ammo_cells = self.ammo_cells - cvar("g_balance_crylink_primary_ammo");
165 //W_SetupShot(self, '10 5 -14', TRUE, 0, "weapons/crylink_fire.ogg");
166 W_SetupShot (self, '15 7 -8', TRUE, 0, "weapons/crylink_fire.ogg");
168 // use traceline_hitcorpse to make sure it can hit gibs and corpses too
169 traceline_hitcorpse(self, w_shotorg, w_shotorg + w_shotdir * 1000, FALSE, self);
171 te_smallflash(w_shotorg);
172 te_plasmaburn(trace_endpos);
173 te_lightning2(self, w_shotorg, trace_endpos);
175 if (trace_fraction < 1)
176 Damage(trace_ent, self, self, cvar("g_balance_crylink_primary_damage"), IT_CRYLINK, trace_endpos, '0 0 0');
180 float(float req) w_crylink =
185 self.button0 = bot_aim(cvar("g_balance_crylink_primary_speed"), 0, cvar("g_balance_crylink_primary_lifetime"), FALSE);
187 self.button3 = bot_aim(cvar("g_balance_crylink_secondary_speed"), 0, cvar("g_balance_crylink_secondary_lifetime"), FALSE);
189 else if (req == WR_THINK)
192 if (weapon_prepareattack(0, cvar("g_balance_crylink_primary_refire")))
195 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_crylink_primary_animtime"), w_ready);
198 if (weapon_prepareattack(1, cvar("g_balance_crylink_secondary_refire")))
201 weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_crylink_secondary_animtime"), w_ready);
204 else if (req == WR_SETUP)
205 weapon_setup(WEP_CRYLINK, "crylink", IT_CELLS);
206 else if (req == WR_CHECKAMMO1)
207 return self.ammo_cells >= cvar("g_balance_crylink_primary_ammo");
208 else if (req == WR_CHECKAMMO2)
209 return self.ammo_cells >= cvar("g_balance_crylink_secondary_ammo");