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 self.event_damage = nullfunction;
48 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);
49 sound (self, CHAN_IMPACT, "weapons/plasmahit.wav", 1, ATTN_NORM);
54 void W_Plasma_FuseExplode (void)
56 W_Plasma_Explode (world);
59 void W_Plasma_Touch (void)
61 if (other.classname == "player" || other.classname == "corpse")
62 W_Plasma_Explode (other);
64 sound (self, CHAN_BODY, "weapons/grenade_bounce.wav", 1, ATTN_NORM);
67 void W_Plasma_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
69 self.health = self.health - damage;
71 W_Plasma_FuseExplode ();
74 void W_Plasma_Think ()
76 self.velocity = self.velocity * 1.2;
80 void() W_Electro_Attack
85 postion = self.electrocount;
86 makevectors(self.v_angle);
87 sound (self, CHAN_WEAPON, "weapons/electro_fire.wav", 1, ATTN_NORM);
91 proj.classname = "spike";
93 proj.movetype = MOVETYPE_FLY;
94 proj.solid = SOLID_BBOX;
98 org = self.origin + self.view_ofs + v_forward * 15 + v_right * 7 + v_up * -9;
102 setmodel (proj, "models/elaser.mdl");
103 setsize (proj, '0 0 0', '0 0 0');
105 setorigin (proj, self.origin + self.view_ofs + v_forward * 15 + v_right * 5 + v_up * -14);
107 setorigin (proj, self.origin + self.view_ofs + v_forward * 15 + v_right * 10 + v_up * -12);
109 setorigin (proj, self.origin + self.view_ofs + v_forward * 15 + v_right * 15 + v_up * -14);
111 proj.velocity = v_forward * cvar("g_balance_electro_speed");
112 proj.touch = W_Plasma_Explode;
113 proj.think = W_Plasma_Think;
114 proj.nextthink = time + 0.1;
116 proj.angles = vectoangles (proj.velocity);
118 proj.effects = proj.effects | EF_ADDITIVE;
120 self.ammo_cells = self.ammo_cells - 2;
123 void() W_Electro_Attack2
128 postion = self.electrocount;
129 makevectors(self.v_angle);
130 sound (self, CHAN_WEAPON, "weapons/electro_fire.wav", 1, ATTN_NORM);
132 self.punchangle_x = -2;
136 Plasma.classname = "grenade";
139 Plasma.movetype = MOVETYPE_BOUNCE;
140 Plasma.solid = SOLID_BBOX;
143 org = self.origin + self.view_ofs + v_forward * 15 + v_right * 7 + v_up * -9;
146 Plasma.takedamage = DAMAGE_YES;
147 Plasma.damageforcescale = 4;
149 Plasma.event_damage = W_Plasma_Damage;
151 setmodel (Plasma, "models/ebomb.mdl");
152 setsize (Plasma, '-6 -6 -3', '6 6 3');
155 setorigin (Plasma, self.origin + self.view_ofs + v_forward * 15 + v_right * 5 + v_up * -14);
157 setorigin (Plasma, self.origin + self.view_ofs + v_forward * 15 + v_right * 10 + v_up * -12);
159 setorigin (Plasma, self.origin + self.view_ofs + v_forward * 15 + v_right * 15 + v_up * -14);
161 Plasma.velocity = v_forward * cvar("g_balance_electro_ballspeed") + v_up * cvar("g_balance_electro_ballspeed_up");
162 //Plasma.angles = vectoangles (Plasma.velocity);
163 //Plasma.avelocity_y = random () * -500 - 500;
164 //Plasma.avelocity_x = random () * -500 - 500;
165 //Plasma.avelocity_z = random () * -500 - 500;
167 Plasma.touch = W_Plasma_Touch;
168 Plasma.think = W_Plasma_FuseExplode;
169 Plasma.nextthink = time + 2;
171 Plasma.effects = Plasma.effects | EF_ADDITIVE;
173 self.ammo_cells = self.ammo_cells - 2;
179 void() electro_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, electro_ready_01); self.weaponentity.state = WS_READY;};
180 void() electro_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');};
181 void() electro_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);};
182 void() electro_fire1_01 =
184 weapon_doattack(electro_check, electro_check, W_Electro_Attack);
186 self.electrocount = self.electrocount + 1;
187 if (self.electrocount == 3)
188 self.electrocount = 0;
190 weapon_thinkf(WFRAME_FIRE1, 0.3, electro_ready_01);
192 void() electro_fire2_01 =
194 weapon_doattack(electro_check, electro_check, W_Electro_Attack2);
196 self.electrocount = self.electrocount + 1;
197 if (self.electrocount == 3)
198 self.electrocount = 0;
200 weapon_thinkf(WFRAME_FIRE2, 0.3, electro_ready_01);