Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .float nex_bullets_hit;
- .float nex_bullets_fired;
- void W_Nex_Attack (void)
- {
- float flying;
- flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
- self.nex_bullets_fired = self.nex_bullets_fired + 1;
- W_SetupShot (self, '25 4 -4', TRUE, 5, "weapons/nexfire.wav");
- yoda = 0;
- self.nex_bullets_hit = self.nex_bullets_hit + FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, cvar("g_balance_nex_damage"), cvar("g_balance_nex_force"), WEP_NEX);
- if not(self.isbot)
- {
- string s;
- float f;
- f = self.nex_bullets_hit / self.nex_bullets_fired;
- f = f * 100;
- f = rint(f);
- s = ftos(f);
- sprint(self, "Nexgun Hit%: ",s,"\n");
- }
- if(yoda && flying)
- announce(self, "announcer/male/yoda.wav");
- pointparticles(particleeffectnum("nex_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
- // beam effect
- trailparticles(world, particleeffectnum("nex_beam"), w_shotorg, trace_endpos);
- // flash and burn the wall
- if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
- pointparticles(particleeffectnum("nex_impact"), trace_endpos - w_shotdir * 6, '0 0 0', 1);
- // play a sound
- soundat (self, trace_endpos, CHAN_PROJECTILE, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- {
- self.ammo_cells = self.ammo_cells - cvar("g_balance_nex_ammo");
- }
- }
- void spawnfunc_weapon_nex (void); // defined in t_items.qc
- float w_nex(float req)
- {
- if (req == WR_AIM)
- self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
- else if (req == WR_THINK)
- {
- if (self.BUTTON_ATCK)
- {
- if (weapon_prepareattack(0, cvar("g_balance_nex_refire")))
- {
- W_Nex_Attack();
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nex_animtime"), w_ready);
- }
- }
- }
- else if (req == WR_PRECACHE)
- {
- precache_model ("models/nexflash.md3");
- precache_model ("models/weapons/g_nex.md3");
- precache_model ("models/weapons/v_nex.md3");
- precache_model ("models/weapons/w_nex.zym");
- precache_sound ("weapons/nexfire.wav");
- precache_sound ("weapons/neximpact.wav");
- }
- else if (req == WR_SETUP)
- weapon_setup(WEP_NEX);
- else if (req == WR_CHECKAMMO1)
- return self.ammo_cells >= cvar("g_balance_nex_ammo");
- else if (req == WR_CHECKAMMO2)
- return FALSE;
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = "did the impossible";
- else if (req == WR_KILLMESSAGE)
- w_deathtypestring = "has been vaporized by";
- return TRUE;
- };
Add Comment
Please, Sign In to add comment