2 void W_Nex_Attack (void)
4 //w_shotorg = self.origin + self.view_ofs + v_forward * 5 + v_right * 14 + v_up * -7;
5 W_SetupShot (self, '5 14 -8', TRUE, 5, "weapons/nexfire.wav");
7 // assure that nexdamage is high enough in minstagib
9 FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 1000, 800, IT_NEX);
13 FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, cvar("g_balance_nex_damage"), cvar("g_balance_nex_force"), IT_NEX);
16 announce(self, "announcer/male/yoda.ogg");
19 pointparticles(particleeffectnum("nex_muzzleflash"), w_shotorg + v_forward * 32, v_forward * 1000, 1);
21 // show as if shot started outside of gun
23 //te_smallflash (w_shotorg + w_shotdir * 24);
25 trailparticles(world, particleeffectnum("nex_beam"), w_shotorg + w_shotdir * 28, trace_endpos);
26 // flash and burn the wall
27 if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
28 pointparticles(particleeffectnum("nex_impact"), trace_endpos - w_shotdir * 6, '0 0 0', 1);
30 PointSound (trace_endpos, "weapons/neximpact.wav", 1, ATTN_NORM);
32 if (cvar("g_use_ammunition") && !g_instagib)
35 self.ammo_cells = self.ammo_cells - 1;
37 self.ammo_cells = self.ammo_cells - cvar("g_balance_nex_ammo");
43 setorigin (flash, self.origin + self.view_ofs + v_forward * 33 + v_right * 14 + v_up * -7);
44 flash.angles = vectoangles (w_shotdir);
45 //setattachment(flash, self.weaponentity, "bone01");
46 //flash.origin = '150 0 0';
47 //setattachment(flash, self.weaponentity, "");
48 //flash.origin = '150 -16 -8';
49 //flash.angles_z = 90;
51 setmodel (flash, "models/nexflash.md3"); // precision set below
52 SUB_SetFade (flash, time, 0.4);
53 flash.effects = flash.effects | EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
58 .float minstagib_nextthink;
59 void minstagib_ammocheck (void)
61 if (time < self.minstagib_nextthink || self.deadflag || gameover)
64 if (self.ammo_cells <= 0)
68 centerprint(self, "you're dead now...\n");
69 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
70 announce(self, "announcer/robotic/terminated.ogg");
72 if (self.health == 10)
74 centerprint(self, "^11^7 second left to find some ammo\n");
75 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
76 announce(self, "announcer/robotic/1.ogg");
78 if (self.health == 20)
80 centerprint(self, "^12^7 seconds left to find some ammo\n");
81 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
82 announce(self, "announcer/robotic/2.ogg");
84 if (self.health == 30)
86 centerprint(self, "^13^7 seconds left to find some ammo\n");
87 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
88 announce(self, "announcer/robotic/3.ogg");
90 if (self.health == 40)
92 centerprint(self, "^14^7 seconds left to find some ammo\n");
93 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
94 announce(self, "announcer/robotic/4.ogg");
96 if (self.health == 50)
98 centerprint(self, "^15^7 seconds left to find some ammo\n");
99 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
100 announce(self, "announcer/robotic/5.ogg");
102 if (self.health == 60)
104 centerprint(self, "^36^7 seconds left to find some ammo\n");
105 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
106 announce(self, "announcer/robotic/6.ogg");
108 if (self.health == 70)
110 centerprint(self, "^37^7 seconds left to find some ammo\n");
111 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
112 announce(self, "announcer/robotic/7.ogg");
114 if (self.health == 80)
116 centerprint(self, "^38^7 seconds left to find some ammo\n");
117 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
118 announce(self, "announcer/robotic/8.ogg");
120 if (self.health == 90)
122 centerprint(self, "^39^7 seconds left to find some ammo\n");
123 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
124 announce(self, "announcer/robotic/9.ogg");
126 if (self.health == 100)
128 centerprint(self, "get some ammo or\nyou'll be dead in ^310^7 seconds...");
129 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
130 announce(self, "announcer/robotic/10.ogg");
133 self.minstagib_nextthink = time + 1;
136 float(float req) w_nex =
139 self.button0 = bot_aim(1000000, 0, 1, FALSE);
140 else if (req == WR_THINK)
146 if (weapon_prepareattack(0, cvar("g_balance_minstagib_nex_refire")))
149 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_minstagib_nex_animtime"), w_ready);
154 if (weapon_prepareattack(0, cvar("g_balance_nex_refire")))
157 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nex_animtime"), w_ready);
161 else if (self.button3)
165 if (self.jump_interval <= time)
167 self.jump_interval = time + 0.9;
168 W_Laser_Attack(FALSE);
173 else if (req == WR_PRECACHE)
175 precache_model ("models/nexflash.md3");
176 precache_model ("models/weapons/g_nex.md3");
177 precache_model ("models/weapons/v_nex.md3");
178 precache_model ("models/weapons/w_nex.zym");
179 precache_sound ("weapons/nexfire.wav");
180 precache_sound ("weapons/neximpact.wav");
182 else if (req == WR_SETUP)
183 weapon_setup(WEP_NEX, "nex", IT_CELLS);
184 else if (req == WR_CHECKAMMO1)
187 return self.ammo_cells >= 1;
189 return self.ammo_cells >= cvar("g_balance_nex_ammo");
191 else if (req == WR_CHECKAMMO2)
193 else if (req == WR_REGISTER)
194 weapon_register(WEP_NEX, cvar("g_balance_nex_ammo"));