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);
11 FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, cvar("g_balance_nex_damage"), cvar("g_balance_nex_force"), IT_NEX);
13 pointparticles(particleeffectnum("nex_muzzleflash"), w_shotorg + v_forward * 32, v_forward * 1000, 1);
15 // show as if shot started outside of gun
17 //te_smallflash (w_shotorg + w_shotdir * 24);
19 trailparticles(world, particleeffectnum("nex_beam"), w_shotorg + w_shotdir * 28, trace_endpos);
20 // flash and burn the wall
21 if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
22 pointparticles(particleeffectnum("nex_impact"), trace_endpos - w_shotdir * 6, '0 0 0', 1);
24 PointSound (trace_endpos, "weapons/neximpact.wav", 1, ATTN_NORM);
26 if (cvar("g_use_ammunition") && !g_instagib)
29 self.ammo_cells = self.ammo_cells - 1;
31 self.ammo_cells = self.ammo_cells - cvar("g_balance_nex_ammo");
37 setorigin (flash, self.origin + self.view_ofs + v_forward * 33 + v_right * 14 + v_up * -7);
38 flash.angles = vectoangles (w_shotdir);
39 //setattachment(flash, self.weaponentity, "bone01");
40 //flash.origin = '150 0 0';
41 //setattachment(flash, self.weaponentity, "");
42 //flash.origin = '150 -16 -8';
43 //flash.angles_z = 90;
45 setmodel (flash, "models/nexflash.md3"); // precision set below
46 SUB_SetFade (flash, time, 0.4);
47 flash.effects = flash.effects | EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
52 .float minstagib_nextthink;
53 void minstagib_ammocheck (void)
55 if (time < self.minstagib_nextthink || self.deadflag || gameover)
58 if (self.ammo_cells <= 0)
62 centerprint(self, "you're dead now...\n");
63 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
64 play2(self, "announcer/robotic/terminated.ogg");
66 if (self.health == 10)
68 centerprint(self, "^11^7 second left to find some ammo\n");
69 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
70 play2(self, "announcer/robotic/1.ogg");
72 if (self.health == 20)
74 centerprint(self, "^12^7 seconds left to find some ammo\n");
75 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
76 play2(self, "announcer/robotic/2.ogg");
78 if (self.health == 30)
80 centerprint(self, "^13^7 seconds left to find some ammo\n");
81 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
82 play2(self, "announcer/robotic/3.ogg");
84 if (self.health == 40)
86 centerprint(self, "^14^7 seconds left to find some ammo\n");
87 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
88 play2(self, "announcer/robotic/4.ogg");
90 if (self.health == 50)
92 centerprint(self, "^15^7 seconds left to find some ammo\n");
93 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
94 play2(self, "announcer/robotic/5.ogg");
96 if (self.health == 60)
98 centerprint(self, "^36^7 seconds left to find some ammo\n");
99 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
100 play2(self, "announcer/robotic/6.ogg");
102 if (self.health == 70)
104 centerprint(self, "^37^7 seconds left to find some ammo\n");
105 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
106 play2(self, "announcer/robotic/7.ogg");
108 if (self.health == 80)
110 centerprint(self, "^38^7 seconds left to find some ammo\n");
111 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
112 play2(self, "announcer/robotic/8.ogg");
114 if (self.health == 90)
116 centerprint(self, "^39^7 seconds left to find some ammo\n");
117 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
118 play2(self, "announcer/robotic/9.ogg");
120 if (self.health == 100)
122 centerprint(self, "get some ammo or\nyou'll be dead in ^310^7 seconds...");
123 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
124 play2(self, "announcer/robotic/10.ogg");
127 self.minstagib_nextthink = time + 1;
130 float(float req) w_nex =
133 self.button0 = bot_aim(1000000, 0, 1, FALSE);
134 else if (req == WR_THINK)
140 if (weapon_prepareattack(0, cvar("g_balance_minstagib_nex_refire")))
143 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_minstagib_nex_animtime"), w_ready);
148 if (weapon_prepareattack(0, cvar("g_balance_nex_refire")))
151 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nex_animtime"), w_ready);
155 else if (self.button3)
159 if (self.jump_interval <= time)
161 self.jump_interval = time + 0.9;
162 W_Laser_Attack(FALSE);
167 else if (req == WR_PRECACHE)
169 precache_model ("models/nexflash.md3");
170 precache_model ("models/weapons/g_nex.md3");
171 precache_model ("models/weapons/v_nex.md3");
172 precache_model ("models/weapons/w_nex.zym");
173 precache_sound ("weapons/nexfire.wav");
174 precache_sound ("weapons/neximpact.wav");
176 else if (req == WR_SETUP)
177 weapon_setup(WEP_NEX, "nex", IT_CELLS);
178 else if (req == WR_CHECKAMMO1)
181 return self.ammo_cells >= 1;
183 return self.ammo_cells >= cvar("g_balance_nex_ammo");
185 else if (req == WR_CHECKAMMO2)
187 else if (req == WR_REGISTER)
188 weapon_register(WEP_NEX, cvar("g_balance_nex_ammo"));