Better Thunderbolt
Created By: | Marius |
eMail: | lordshoel@yahoo.com |
Difficulty Scale: | Easy |
//Thunderbolt .float temp_cells;The above does not need to be at the bottom but it is easy and will not interfere with anything that might cause errors.
void() W_FireLightning = { local vector org; local float cells; if (self.ammo_cells < 1) { self.weapon = W_BestWeapon (); W_SetCurrentAmmo (); return; } // explode if under water if (self.waterlevel > 1) { cells = self.ammo_cells; self.ammo_cells = 0; W_SetCurrentAmmo (); T_RadiusDamage (self, self, 35*cells, world); return; } if (self.t_width < time) { sound (self, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM); self.t_width = time + 0.6; } self.punchangle_x = -2; //This is Added self.temp_cells = self.temp_cells + 1; if (self.temp_cells == 3) { self.currentammo = self.ammo_cells = self.ammo_cells - 1; self.temp_cells = 0; } org = self.origin + '0 0 16'; traceline (org, org + v_forward*600, TRUE, self); WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); WriteByte (MSG_BROADCAST, TE_LIGHTNING2); WriteEntity (MSG_BROADCAST, self); WriteCoord (MSG_BROADCAST, org_x); WriteCoord (MSG_BROADCAST, org_y); WriteCoord (MSG_BROADCAST, org_z); WriteCoord (MSG_BROADCAST, trace_endpos_x); WriteCoord (MSG_BROADCAST, trace_endpos_y); WriteCoord (MSG_BROADCAST, trace_endpos_z); //This is changed from 30 to 10. Mainly Because you will fire it 3 times at 10 for //a cell rather than once per cell at 30 dmg LightningDamage (self.origin, trace_endpos + v_forward*4, self, 10); };