2 REGISTER_WEAPON(NEX, w_nex, IT_CELLS, 7, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_HIGH, "nex", "nex", "Nex");
4 void SendCSQCNexBeamParticle() {
5 WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
6 WriteByte(MSG_BROADCAST, TE_CSQC_NEXGUNBEAMPARTICLE);
8 WriteCoord(MSG_BROADCAST, w_shotorg_x);
9 WriteCoord(MSG_BROADCAST, w_shotorg_y);
10 WriteCoord(MSG_BROADCAST, w_shotorg_z);
11 WriteCoord(MSG_BROADCAST, trace_endpos_x);
12 WriteCoord(MSG_BROADCAST, trace_endpos_y);
13 WriteCoord(MSG_BROADCAST, trace_endpos_z);
16 void W_Nex_Attack (void)
19 flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
21 W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", cvar("g_balance_nex_damage"));
24 FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, cvar("g_balance_nex_damage"), cvar("g_balance_nex_force"), cvar("g_balance_nex_damagefalloff_mindist"), cvar("g_balance_nex_damagefalloff_maxdist"), cvar("g_balance_nex_damagefalloff_halflife"), cvar("g_balance_nex_damagefalloff_forcehalflife"), WEP_NEX);
27 announce(self, "announcer/male/yoda.wav");
29 //beam and muzzle flash done on client
30 SendCSQCNexBeamParticle();
32 // flash and burn the wall
33 if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
34 Damage_DamageInfo(trace_endpos, cvar("g_balance_nex_damage"), 0, 0, cvar("g_balance_nex_force") * w_shotdir, WEP_NEX, self);
36 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
37 self.ammo_cells = self.ammo_cells - cvar("g_balance_nex_ammo");
40 void spawnfunc_weapon_nex (void); // defined in t_items.qc
42 float w_nex(float req)
45 self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
46 else if (req == WR_THINK)
50 if (weapon_prepareattack(0, cvar("g_balance_nex_refire")))
53 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nex_animtime"), w_ready);
57 else if (req == WR_PRECACHE)
59 precache_model ("models/nexflash.md3");
60 precache_model ("models/weapons/g_nex.md3");
61 precache_model ("models/weapons/v_nex.md3");
62 precache_model ("models/weapons/h_nex.dpm");
63 precache_sound ("weapons/nexfire.wav");
64 precache_sound ("weapons/nexwhoosh1.wav");
65 precache_sound ("weapons/nexwhoosh2.wav");
66 precache_sound ("weapons/nexwhoosh3.wav");
68 else if (req == WR_SETUP)
69 weapon_setup(WEP_NEX);
70 else if (req == WR_CHECKAMMO1)
71 return self.ammo_cells >= cvar("g_balance_nex_ammo");
72 else if (req == WR_CHECKAMMO2)
74 else if (req == WR_SUICIDEMESSAGE)
75 w_deathtypestring = "did the impossible";
76 else if (req == WR_KILLMESSAGE)
77 w_deathtypestring = "has been vaporized by";