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;
9 float() crylink_check =
11 if (self.ammo_cells >= cvar("g_balance_crylink_primary_ammo"))
16 float() crylink_check2 =
18 if (self.ammo_cells >= cvar("g_balance_crylink_secondary_ammo"))
23 void(float req) w_crylink =
27 else if (req == WR_FIRE1)
28 weapon_prepareattack(crylink_check, crylink_check, crylink_fire1_01, cvar("g_balance_crylink_primary_refire"));
29 else if (req == WR_FIRE2)
30 weapon_prepareattack(crylink_check2, crylink_check2, crylink_fire2_01, cvar("g_balance_crylink_secondary_refire"));
31 else if (req == WR_RAISE)
33 else if (req == WR_UPDATECOUNTS)
34 self.currentammo = self.ammo_cells;
35 else if (req == WR_DROP)
36 crylink_deselect_01();
37 else if (req == WR_SETUP)
38 weapon_setup(WEP_CRYLINK, "w_crylink.zym", IT_CELLS);
39 else if (req == WR_CHECKAMMO)
40 weapon_hasammo = crylink_check() + crylink_check2();
44 void W_Crylink_Touch (void)
46 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);
47 //te_smallflash(self.origin);
48 if (other.takedamage == DAMAGE_AIM)
54 self.touch = SUB_Null;
55 setmodel (self, "models/plasma.mdl");
56 setsize (self, '0 0 0', '0 0 0');
60 self.think = SUB_Remove;
61 self.movetype = MOVETYPE_NONE;
62 self.effects = EF_FULLBRIGHT | EF_LOWPRECISION;
63 SUB_SetFade(self, time, 1);
67 void W_Crylink_Touch2 (void)
69 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);
70 //te_smallflash(self.origin);
71 if (other.takedamage == DAMAGE_AIM)
77 self.touch = SUB_Null;
78 setmodel (self, "models/plasma.mdl");
79 setsize (self, '0 0 0', '0 0 0');
83 self.think = SUB_Remove;
84 self.movetype = MOVETYPE_NONE;
85 self.effects = EF_FULLBRIGHT | EF_LOWPRECISION;
86 SUB_SetFade(self, time, 1);
90 void W_Crylink_Attack (void)
92 local float counter, shots;
97 trueaim = W_TrueAim();
99 sound (self, CHAN_WEAPON, "weapons/crylink_fire.ogg", 1, ATTN_NORM);
100 if (self.items & IT_STRENGTH) {
101 sound (self, CHAN_AUTO, "weapons/strength_fire.ogg", 1, ATTN_NORM);
104 if (cvar("g_use_ammunition"))
105 self.ammo_cells = self.ammo_cells - cvar("g_balance_crylink_primary_ammo");
106 self.punchangle_x = -2;
107 org = self.origin + self.view_ofs + v_forward * 10 + v_right * 5 + v_up * -14;
110 shots = cvar("g_balance_crylink_shots");
113 while (counter < shots)
116 proj.realowner = proj.owner = self;
117 proj.classname = "spike";
119 proj.movetype = MOVETYPE_BOUNCE;
120 proj.solid = SOLID_BBOX;
121 proj.gravity = 0.001;
123 setmodel (proj, "models/plasmatrail.mdl");
124 setsize (proj, '0 0 0', '0 0 0');
125 setorigin (proj, org);
127 proj.velocity = (normalize(trueaim - org) + randomvec() * cvar("g_balance_crylink_primary_spread")) * cvar("g_balance_crylink_primary_speed");
128 proj.touch = W_Crylink_Touch;
129 proj.think = SUB_Remove;
130 proj.nextthink = time + cvar("g_balance_crylink_primary_lifetime");
132 proj.angles = vectoangles (proj.velocity);
134 //proj.glow_size = 20;
136 proj.effects = EF_NOSHADOW | EF_FULLBRIGHT | EF_LOWPRECISION;
137 counter = counter + 1;
141 void W_Crylink_Attack2 (void)
143 local float counter, shots;
147 local vector trueaim;
148 trueaim = W_TrueAim();
150 sound (self, CHAN_WEAPON, "weapons/crylink_fire.ogg", 1, ATTN_NORM);
151 if (self.items & IT_STRENGTH) {
152 sound (self, CHAN_AUTO, "weapons/strength_fire.ogg", 1, ATTN_NORM);
155 if (cvar("g_use_ammunition"))
156 self.ammo_cells = self.ammo_cells - cvar("g_balance_crylink_secondary_ammo");
157 self.punchangle_x = -2;
158 org = self.origin + self.view_ofs + v_forward * 10 + v_right * 5 + v_up * -14;
161 shots = cvar("g_balance_crylink_secondary_shots");
164 while (counter < shots)
167 proj.realowner = proj.owner = self;
168 proj.classname = "spike";
170 proj.movetype = MOVETYPE_BOUNCE;
171 proj.solid = SOLID_BBOX;
172 proj.gravity = 0.001;
174 setmodel (proj, "models/plasmatrail.mdl");
175 setsize (proj, '0 0 0', '0 0 0');
176 setorigin (proj, org);
178 proj.velocity = (normalize(trueaim - org) + ((counter / shots) * 2 - 1) * v_right * cvar("g_balance_crylink_secondary_spread")) * cvar("g_balance_crylink_secondary_speed");
179 proj.touch = W_Crylink_Touch2;
180 proj.think = SUB_Remove;
181 proj.nextthink = time + cvar("g_balance_crylink_secondary_lifetime");
183 proj.angles = vectoangles (proj.velocity);
185 //proj.glow_size = 20;
187 proj.effects = EF_NOSHADOW | EF_FULLBRIGHT | EF_LOWPRECISION;
188 counter = counter + 1;
194 void() crylink_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, crylink_ready_01); self.weaponentity.state = WS_READY;};
195 void() crylink_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');};
196 void() crylink_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);};
197 void() crylink_fire1_01 =
199 weapon_doattack(crylink_check, crylink_check, W_Crylink_Attack);
200 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_crylink_primary_animtime"), crylink_ready_01);
202 void() crylink_fire2_01 =
204 weapon_doattack(crylink_check, crylink_check, W_Crylink_Attack2);
205 weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_crylink_secondary_animtime"), crylink_ready_01);