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_check =
9 if (self.ammo_cells > 2)
14 void(float req) w_electro =
18 else if (req == WR_FIRE1)
19 weapon_prepareattack(electro_check, electro_check, electro_fire1_01, cvar("g_balance_electro_refire"));
20 else if (req == WR_FIRE2)
21 weapon_prepareattack(electro_check, electro_check, electro_fire2_01, cvar("g_balance_electro_refire"));
22 else if (req == WR_RAISE)
24 else if (req == WR_UPDATECOUNTS)
25 self.currentammo = self.ammo_cells;
26 else if (req == WR_DROP)
27 electro_deselect_01();
28 else if (req == WR_SETUP)
29 weapon_setup(WEP_ELECTRO, "w_electro.zym", IT_CELLS);
30 else if (req == WR_CHECKAMMO)
31 weapon_hasammo = electro_check();
35 void W_Plasma_Explode (entity ignore)
37 WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
38 WriteByte (MSG_BROADCAST, 79);
39 WriteCoord (MSG_BROADCAST, self.origin_x);
40 WriteCoord (MSG_BROADCAST, self.origin_y);
41 WriteCoord (MSG_BROADCAST, self.origin_z);
42 WriteCoord (MSG_BROADCAST, 0); // SeienAbunae: groan... Useless clutter
43 WriteCoord (MSG_BROADCAST, 0);
44 WriteCoord (MSG_BROADCAST, 0);
45 WriteByte (MSG_BROADCAST, 155);
47 te_customflash (self.origin, 5000, 10, '0 0 1');
49 self.event_damage = nullfunction;
50 RadiusDamage (self, self.owner, cvar("g_balance_electro_damage"), cvar("g_balance_electro_edgedamage"), cvar("g_balance_electro_radius"), world, cvar("g_balance_electro_force"), IT_ELECTRO);
51 sound (self, CHAN_IMPACT, "weapons/plasmahit.wav", 1, ATTN_NORM);
56 void W_Plasma_FuseExplode (void)
58 W_Plasma_Explode (world);
61 void W_Plasma_Touch (void)
63 if (other.classname == "player" || other.classname == "corpse")
64 W_Plasma_Explode (other);
66 sound (self, CHAN_BODY, "weapons/grenade_bounce.wav", 1, ATTN_NORM);
69 void W_Plasma_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
71 self.health = self.health - damage;
73 W_Plasma_FuseExplode ();
76 void W_Plasma_Think ()
78 self.velocity = self.velocity * 1.2;
82 void() W_Electro_Attack
87 postion = self.electrocount;
88 makevectors(self.v_angle);
89 sound (self, CHAN_WEAPON, "weapons/electro_fire.wav", 1, ATTN_NORM);
93 proj.classname = "spike";
95 proj.movetype = MOVETYPE_FLY;
96 proj.solid = SOLID_BBOX;
100 org = self.origin + self.view_ofs + v_forward * 15 + v_right * 7 + v_up * -9;
104 setmodel (proj, "models/elaser.mdl");
105 setsize (proj, '0 0 0', '0 0 0');
107 setorigin (proj, self.origin + self.view_ofs + v_forward * 15 + v_right * 5 + v_up * -14);
109 setorigin (proj, self.origin + self.view_ofs + v_forward * 15 + v_right * 10 + v_up * -12);
111 setorigin (proj, self.origin + self.view_ofs + v_forward * 15 + v_right * 15 + v_up * -14);
113 proj.velocity = v_forward * cvar("g_balance_electro_speed");
114 proj.touch = W_Plasma_Explode;
115 proj.think = W_Plasma_Think;
116 proj.nextthink = time + 0.1;
118 proj.angles = vectoangles (proj.velocity);
120 proj.effects = proj.effects | EF_ADDITIVE;
122 self.ammo_cells = self.ammo_cells - 2;
125 void() W_Electro_Attack2
130 postion = self.electrocount;
131 makevectors(self.v_angle);
132 sound (self, CHAN_WEAPON, "weapons/electro_fire.wav", 1, ATTN_NORM);
134 self.punchangle_x = -2;
138 Plasma.classname = "grenade";
141 Plasma.movetype = MOVETYPE_BOUNCE;
142 Plasma.solid = SOLID_BBOX;
145 org = self.origin + self.view_ofs + v_forward * 15 + v_right * 7 + v_up * -9;
148 Plasma.takedamage = DAMAGE_YES;
149 Plasma.damageforcescale = 4;
151 Plasma.event_damage = W_Plasma_Damage;
153 setmodel (Plasma, "models/ebomb.mdl");
154 setsize (Plasma, '-6 -6 -3', '6 6 3');
157 setorigin (Plasma, self.origin + self.view_ofs + v_forward * 15 + v_right * 5 + v_up * -14);
159 setorigin (Plasma, self.origin + self.view_ofs + v_forward * 15 + v_right * 10 + v_up * -12);
161 setorigin (Plasma, self.origin + self.view_ofs + v_forward * 15 + v_right * 15 + v_up * -14);
163 Plasma.velocity = v_forward * cvar("g_balance_electro_ballspeed") + v_up * cvar("g_balance_electro_ballspeed_up");
164 //Plasma.angles = vectoangles (Plasma.velocity);
165 //Plasma.avelocity_y = random () * -500 - 500;
166 //Plasma.avelocity_x = random () * -500 - 500;
167 //Plasma.avelocity_z = random () * -500 - 500;
169 Plasma.touch = W_Plasma_Touch;
170 Plasma.think = W_Plasma_FuseExplode;
171 Plasma.nextthink = time + 2;
173 Plasma.effects = Plasma.effects | EF_ADDITIVE;
175 self.ammo_cells = self.ammo_cells - 2;
181 void() electro_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, electro_ready_01); self.weaponentity.state = WS_READY;};
182 void() electro_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');};
183 void() electro_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);};
184 void() electro_fire1_01 =
186 weapon_doattack(electro_check, electro_check, W_Electro_Attack);
188 self.electrocount = self.electrocount + 1;
189 if (self.electrocount == 3)
190 self.electrocount = 0;
192 weapon_thinkf(WFRAME_FIRE1, 0.3, electro_ready_01);
194 void() electro_fire2_01 =
196 weapon_doattack(electro_check, electro_check, W_Electro_Attack2);
198 self.electrocount = self.electrocount + 1;
199 if (self.electrocount == 3)
200 self.electrocount = 0;
202 weapon_thinkf(WFRAME_FIRE2, 0.3, electro_ready_01);