1 void() crylink_ready_01;
2 void() crylink_fire1_01;
3 void() crylink_fire2_01;
4 void() crylink_deselect_01;
5 void() crylink_select_01;
8 const vector proj_color = '1 1 1';
10 float() crylink_check =
12 if (self.ammo_cells >= cvar("g_balance_crylink_primary_ammo"))
17 float() crylink_check2 =
19 if (self.ammo_cells >= cvar("g_balance_crylink_secondary_ammo"))
24 void(float req) w_crylink =
28 else if (req == WR_FIRE1)
29 weapon_prepareattack(crylink_check, crylink_check, crylink_fire1_01, cvar("g_balance_crylink_primary_refire"));
30 else if (req == WR_FIRE2)
31 weapon_prepareattack(crylink_check2, crylink_check2, crylink_fire2_01, cvar("g_balance_crylink_secondary_refire"));
32 else if (req == WR_RAISE)
34 else if (req == WR_UPDATECOUNTS)
35 self.currentammo = self.ammo_cells;
36 else if (req == WR_DROP)
37 crylink_deselect_01();
38 else if (req == WR_SETUP)
39 weapon_setup(WEP_CRYLINK, "w_crylink.zym", IT_CELLS);
40 else if (req == WR_CHECKAMMO)
41 weapon_hasammo = crylink_check() + crylink_check2();
45 void W_Crylink_Touch (void)
47 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);
48 //te_smallflash(self.origin);
49 if (other.takedamage == DAMAGE_AIM)
55 self.touch = SUB_Null;
56 setmodel (self, "models/plasma.mdl");
57 setsize (self, '0 0 0', '0 0 0');
61 self.think = SUB_Remove;
62 self.movetype = MOVETYPE_NONE;
63 self.effects = EF_FULLBRIGHT | EF_LOWPRECISION;
64 SUB_SetFade(self, time, 1);
68 void W_Crylink_Touch2 (void)
70 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);
71 //te_smallflash(self.origin);
72 if (other.takedamage == DAMAGE_AIM)
78 self.touch = SUB_Null;
79 setmodel (self, "models/plasma.mdl");
80 setsize (self, '0 0 0', '0 0 0');
84 self.think = SUB_Remove;
85 self.movetype = MOVETYPE_NONE;
86 self.effects = EF_FULLBRIGHT | EF_LOWPRECISION;
87 SUB_SetFade(self, time, 1);
91 void W_Crylink_Attack (void)
93 local float counter, shots;
98 trueaim = W_TrueAim();
100 sound (self, CHAN_WEAPON, "weapons/crylink_fire.ogg", 1, ATTN_NORM);
101 if (self.items & IT_STRENGTH) {
102 sound (self, CHAN_AUTO, "weapons/strength_fire.ogg", 1, ATTN_NORM);
105 if (cvar("g_use_ammunition"))
106 self.ammo_cells = self.ammo_cells - cvar("g_balance_crylink_primary_ammo");
107 self.punchangle_x = -2;
108 org = self.origin + self.view_ofs + v_forward * 10 + v_right * 5 + v_up * -14;
111 shots = cvar("g_balance_crylink_shots");
114 while (counter < shots)
117 proj.realowner = proj.owner = self;
118 proj.classname = "spike";
120 proj.movetype = MOVETYPE_BOUNCE;
121 proj.solid = SOLID_BBOX;
122 proj.gravity = 0.001;
124 setmodel (proj, "models/plasmatrail.mdl");
125 setsize (proj, '0 0 0', '0 0 0');
126 setorigin (proj, org);
128 proj.velocity = (normalize(trueaim - org) + randomvec() * cvar("g_balance_crylink_primary_spread")) * cvar("g_balance_crylink_primary_speed");
129 proj.touch = W_Crylink_Touch;
130 proj.think = SUB_Remove;
131 proj.nextthink = time + cvar("g_balance_crylink_primary_lifetime");
133 proj.angles = vectoangles (proj.velocity);
135 //proj.glow_size = 20;
137 proj.effects = EF_NOSHADOW | EF_FULLBRIGHT | EF_LOWPRECISION;
138 proj.colormod = proj_color;
139 counter = counter + 1;
143 void W_Crylink_Attack2 (void)
145 local float counter, shots;
149 local vector trueaim;
150 trueaim = W_TrueAim();
152 sound (self, CHAN_WEAPON, "weapons/crylink_fire.ogg", 1, ATTN_NORM);
153 if (self.items & IT_STRENGTH) {
154 sound (self, CHAN_AUTO, "weapons/strength_fire.ogg", 1, ATTN_NORM);
157 if (cvar("g_use_ammunition"))
158 self.ammo_cells = self.ammo_cells - cvar("g_balance_crylink_secondary_ammo");
159 self.punchangle_x = -2;
160 org = self.origin + self.view_ofs + v_forward * 10 + v_right * 5 + v_up * -14;
163 shots = cvar("g_balance_crylink_secondary_shots");
166 while (counter < shots)
169 proj.realowner = proj.owner = self;
170 proj.classname = "spike";
172 proj.movetype = MOVETYPE_BOUNCE;
173 proj.solid = SOLID_BBOX;
174 proj.gravity = 0.001;
176 setmodel (proj, "models/plasmatrail.mdl");
177 setsize (proj, '0 0 0', '0 0 0');
178 setorigin (proj, org);
180 proj.velocity = (normalize(trueaim - org) + ((counter / shots) * 2 - 1) * v_right * cvar("g_balance_crylink_secondary_spread")) * cvar("g_balance_crylink_secondary_speed");
181 proj.touch = W_Crylink_Touch2;
182 proj.think = SUB_Remove;
183 proj.nextthink = time + cvar("g_balance_crylink_secondary_lifetime");
185 proj.angles = vectoangles (proj.velocity);
187 //proj.glow_size = 20;
189 proj.effects = EF_NOSHADOW | EF_FULLBRIGHT | EF_LOWPRECISION;
190 proj.colormod = proj_color;
191 counter = counter + 1;
197 void() crylink_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, crylink_ready_01); self.weaponentity.state = WS_READY;};
198 void() crylink_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');};
199 void() crylink_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);};
200 void() crylink_fire1_01 =
202 weapon_doattack(crylink_check, crylink_check, W_Crylink_Attack);
203 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_crylink_primary_animtime"), crylink_ready_01);
205 void() crylink_fire2_01 =
207 weapon_doattack(crylink_check, crylink_check, W_Crylink_Attack2);
208 weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_crylink_secondary_animtime"), crylink_ready_01);