1 void() electro_ready_01;
2 void() electro_fire1_01;
3 void() electro_fire2_01;
4 void() electro_deselect_01;
5 void() electro_select_01;
7 float() electro_check1 =
9 if (self.ammo_cells > 1)
14 float() electro_check2 =
16 if (self.ammo_cells > 2)
21 void(float req) w_electro =
25 else if (req == WR_FIRE1)
26 weapon_prepareattack(electro_check1, electro_check1, electro_fire1_01, 0.4);
27 else if (req == WR_FIRE2)
28 weapon_prepareattack(electro_check1, electro_check2, electro_fire2_01, 2);
29 else if (req == WR_RAISE)
31 else if (req == WR_UPDATECOUNTS)
32 self.currentammo = self.ammo_cells;
33 else if (req == WR_DROP)
34 electro_deselect_01();
35 else if (req == WR_SETUP)
36 weapon_setup(WEP_ELECTRO, "w_electro.zym", IT_CELLS);
37 else if (req == WR_CHECKAMMO)
38 weapon_hasammo = electro_check1();
42 void W_Electro_Touch (void)
44 WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
45 WriteByte (MSG_BROADCAST, 79);
46 WriteCoord (MSG_BROADCAST, self.origin_x);
47 WriteCoord (MSG_BROADCAST, self.origin_y);
48 WriteCoord (MSG_BROADCAST, self.origin_z);
49 WriteCoord (MSG_BROADCAST, 0); // SeienAbunae: groan... Useless clutter
50 WriteCoord (MSG_BROADCAST, 0); // Sajt: Yeah.. I agree with him
51 WriteCoord (MSG_BROADCAST, 0);
52 WriteByte (MSG_BROADCAST, 155);
53 self.event_damage = nullfunction;
54 RadiusDamage (self, self.owner, cvar("g_balance_electro_shot_damage"), cvar("g_balance_electro_shot_edgedamage"), cvar("g_balance_electro_shot_radius"), world, cvar("g_balance_electro_shot_force"), IT_ELECTRO);
55 sound (self, CHAN_IMPACT, "weapons/plasmahit.wav", 1, ATTN_NORM);
59 void() W_Electro_Attack
64 postion = self.electrocount;
65 makevectors(self.v_angle);
66 sound (self, CHAN_WEAPON, "weapons/electro_fire.wav", 1, ATTN_NORM);
70 proj.classname = "spike";
72 proj.movetype = MOVETYPE_FLY;
73 proj.solid = SOLID_BBOX;
77 org = self.origin + self.view_ofs + v_forward * 15 + v_right * 7 + v_up * -9;
81 setmodel (proj, "models/elaser.mdl");
82 setsize (proj, '0 0 0', '0 0 0');
84 setorigin (proj, self.origin + self.view_ofs + v_forward * 15 + v_right * 5 + v_up * -14);
86 setorigin (proj, self.origin + self.view_ofs + v_forward * 15 + v_right * 10 + v_up * -12);
88 setorigin (proj, self.origin + self.view_ofs + v_forward * 15 + v_right * 15 + v_up * -14);
90 proj.velocity = v_forward * cvar("g_balance_electro_shot_speed");
91 proj.touch = W_Electro_Touch;
92 proj.think = SUB_Remove;
93 proj.nextthink = time + 1.5;
95 proj.angles = vectoangles (proj.velocity);
97 proj.effects = proj.effects | EF_ADDITIVE;
99 self.attack_finished = time + 0.4;
100 self.ammo_cells = self.ammo_cells - 1;
103 void W_Plasma_Explode (entity ignore)
105 WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
106 WriteByte (MSG_BROADCAST, 79);
107 WriteCoord (MSG_BROADCAST, self.origin_x);
108 WriteCoord (MSG_BROADCAST, self.origin_y);
109 WriteCoord (MSG_BROADCAST, self.origin_z);
110 WriteCoord (MSG_BROADCAST, 0); // SeienAbunae: groan... Useless clutter
111 WriteCoord (MSG_BROADCAST, 0);
112 WriteCoord (MSG_BROADCAST, 0);
113 WriteByte (MSG_BROADCAST, 155);
115 te_customflash (self.origin, 5000, 10, '0 0 1');
117 self.event_damage = nullfunction;
118 RadiusDamage (self, self.owner, cvar("g_balance_electro_grenade_damage"), cvar("g_balance_electro_grenade_edgedamage"), cvar("g_balance_electro_grenade_radius"), world, cvar("g_balance_electro_grenade_force"), IT_ELECTRO);
119 sound (self, CHAN_IMPACT, "weapons/plasmahit.wav", 1, ATTN_NORM);
124 void W_Plasma_FuseExplode (void)
126 W_Plasma_Explode (world);
129 void W_Plasma_Touch (void)
131 if (other.classname == "player" || other.classname == "corpse")
132 W_Plasma_Explode (other);
134 sound (self, CHAN_BODY, "weapons/grenade_bounce.wav", 1, ATTN_NORM);
137 void W_Plasma_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
139 self.health = self.health - damage;
140 if (self.health <= 0)
141 W_Plasma_FuseExplode ();
144 void() W_Electro_Attack2
149 postion = self.electrocount;
150 makevectors(self.v_angle);
151 sound (self, CHAN_WEAPON, "weapons/electro_fire.wav", 1, ATTN_NORM);
153 self.punchangle_x = -4;
157 Plasma.classname = "grenade";
160 Plasma.movetype = MOVETYPE_BOUNCE;
161 Plasma.solid = SOLID_BBOX;
164 org = self.origin + self.view_ofs + v_forward * 15 + v_right * 7 + v_up * -9;
167 Plasma.takedamage = DAMAGE_YES;
168 Plasma.damageforcescale = 4;
170 Plasma.event_damage = W_Plasma_Damage;
172 setmodel (Plasma, "models/ebomb.mdl");
173 setsize (Plasma, '-6 -6 -3', '6 6 3');
176 setorigin (Plasma, self.origin + self.view_ofs + v_forward * 15 + v_right * 5 + v_up * -14);
178 setorigin (Plasma, self.origin + self.view_ofs + v_forward * 15 + v_right * 10 + v_up * -12);
180 setorigin (Plasma, self.origin + self.view_ofs + v_forward * 15 + v_right * 15 + v_up * -14);
182 Plasma.velocity = v_forward * cvar("g_balance_electro_grenade_speed") + v_up * cvar("g_balance_electro_grenade_speed_up");
183 Plasma.angles = vectoangles (Plasma.velocity);
184 Plasma.avelocity_y = random () * -500 - 500;
185 Plasma.avelocity_x = random () * -500 - 500;
186 Plasma.avelocity_z = random () * -500 - 500;
188 Plasma.touch = W_Plasma_Touch;
189 Plasma.think = W_Plasma_FuseExplode;
190 Plasma.nextthink = time + 2;
192 Plasma.effects = Plasma.effects | EF_ADDITIVE;
194 self.attack_finished = time + 1;
195 self.ammo_cells = self.ammo_cells - 2;
201 void() electro_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, electro_ready_01); self.weaponentity.state = WS_READY;};
202 void() electro_select_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');};
203 void() electro_deselect_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);};
204 void() electro_fire1_01 =
206 weapon_doattack(electro_check1, electro_check1, W_Electro_Attack);
208 self.electrocount = self.electrocount + 1;
209 if (self.electrocount == 3)
210 self.electrocount = 0;
212 weapon_thinkf(WFRAME_FIRE1, 0.3, electro_ready_01);
214 void() electro_fire2_01 =
216 weapon_doattack(electro_check1, electro_check2, W_Electro_Attack2);
218 self.electrocount = self.electrocount + 1;
219 if (self.electrocount == 3)
220 self.electrocount = 0;
222 weapon_thinkf(WFRAME_FIRE2, 0.3, electro_ready_01);