2 void W_Nex_Attack (void)
4 W_SetupShot (self, '25 8 -4', TRUE, 5, "weapons/nexfire.wav");
5 //W_SetupShot (self, '25 8 -8', TRUE, 2, "weapons/nexfire.wav"); // TODO: move model down a little
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, w_shotdir * 1000, 1);
22 trailparticles(world, particleeffectnum("nex_beam"), w_shotorg, trace_endpos);
23 // flash and burn the wall
24 if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
25 pointparticles(particleeffectnum("nex_impact"), trace_endpos - w_shotdir * 6, '0 0 0', 1);
27 PointSound (trace_endpos, "weapons/neximpact.wav", 1, ATTN_NORM);
29 if (cvar("g_use_ammunition") && !g_instagib)
32 self.ammo_cells = self.ammo_cells - 1;
34 self.ammo_cells = self.ammo_cells - cvar("g_balance_nex_ammo");
39 .float minstagib_nextthink;
40 void minstagib_ammocheck (void)
42 if (time < self.minstagib_nextthink || self.deadflag || gameover)
45 if (self.ammo_cells <= 0)
49 centerprint(self, "you're dead now...\n");
50 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
51 announce(self, "announcer/robotic/terminated.ogg");
53 if (self.health == 10)
55 centerprint(self, "^11^7 second left to find some ammo\n");
56 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
57 announce(self, "announcer/robotic/1.ogg");
59 if (self.health == 20)
61 centerprint(self, "^12^7 seconds left to find some ammo\n");
62 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
63 announce(self, "announcer/robotic/2.ogg");
65 if (self.health == 30)
67 centerprint(self, "^13^7 seconds left to find some ammo\n");
68 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
69 announce(self, "announcer/robotic/3.ogg");
71 if (self.health == 40)
73 centerprint(self, "^14^7 seconds left to find some ammo\n");
74 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
75 announce(self, "announcer/robotic/4.ogg");
77 if (self.health == 50)
79 centerprint(self, "^15^7 seconds left to find some ammo\n");
80 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
81 announce(self, "announcer/robotic/5.ogg");
83 if (self.health == 60)
85 centerprint(self, "^36^7 seconds left to find some ammo\n");
86 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
87 announce(self, "announcer/robotic/6.ogg");
89 if (self.health == 70)
91 centerprint(self, "^37^7 seconds left to find some ammo\n");
92 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
93 announce(self, "announcer/robotic/7.ogg");
95 if (self.health == 80)
97 centerprint(self, "^38^7 seconds left to find some ammo\n");
98 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
99 announce(self, "announcer/robotic/8.ogg");
101 if (self.health == 90)
103 centerprint(self, "^39^7 seconds left to find some ammo\n");
104 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
105 announce(self, "announcer/robotic/9.ogg");
107 if (self.health == 100)
109 centerprint(self, "get some ammo or\nyou'll be dead in ^310^7 seconds...");
110 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
111 announce(self, "announcer/robotic/10.ogg");
114 self.minstagib_nextthink = time + 1;
117 float(float req) w_nex =
120 self.button0 = bot_aim(1000000, 0, 1, FALSE);
121 else if (req == WR_THINK)
127 if (weapon_prepareattack(0, cvar("g_balance_minstagib_nex_refire")))
130 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_minstagib_nex_animtime"), w_ready);
135 if (weapon_prepareattack(0, cvar("g_balance_nex_refire")))
138 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nex_animtime"), w_ready);
142 else if (self.button3)
146 if (self.jump_interval <= time)
148 self.jump_interval = time + 0.9;
149 W_Laser_Attack(FALSE);
154 else if (req == WR_PRECACHE)
156 precache_model ("models/nexflash.md3");
157 precache_model ("models/weapons/g_nex.md3");
158 precache_model ("models/weapons/v_nex.md3");
159 precache_model ("models/weapons/w_nex.zym");
160 precache_sound ("weapons/nexfire.wav");
161 precache_sound ("weapons/neximpact.wav");
163 w_laser(WR_PRECACHE);
165 else if (req == WR_SETUP)
166 weapon_setup(WEP_NEX, "nex", IT_CELLS);
167 else if (req == WR_CHECKAMMO1)
170 return self.ammo_cells >= 1;
172 return self.ammo_cells >= cvar("g_balance_nex_ammo");
174 else if (req == WR_CHECKAMMO2)
176 else if (req == WR_REGISTER)
179 weapon_register(WEP_NEX, 1);
181 weapon_register(WEP_NEX, cvar("g_balance_nex_ammo"));