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.ogg");
7 // assure that nexdamage is high enough in minstagib
8 if (cvar("g_minstagib"))
9 FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 1000, IT_NEX);
11 FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, cvar("g_balance_nex_damage"), IT_NEX);
13 // show as if shot started outside of gun
15 //te_smallflash (w_shotorg + w_shotdir * 24);
17 WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
18 WriteByte (MSG_BROADCAST, 76);
19 WriteCoord (MSG_BROADCAST, w_shotorg_x + w_shotdir_x * 18);
20 WriteCoord (MSG_BROADCAST, w_shotorg_y + w_shotdir_y * 18);
21 WriteCoord (MSG_BROADCAST, w_shotorg_z + w_shotdir_z * 18);
22 WriteCoord (MSG_BROADCAST, trace_endpos_x);
23 WriteCoord (MSG_BROADCAST, trace_endpos_y);
24 WriteCoord (MSG_BROADCAST, trace_endpos_z);
25 WriteCoord (MSG_BROADCAST, 0);
26 WriteCoord (MSG_BROADCAST, 0);
27 WriteCoord (MSG_BROADCAST, 0);
28 // flash and burn the wall
29 if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
30 te_plasmaburn (trace_endpos - w_shotdir * 6);
32 PointSound (trace_endpos, "weapons/neximpact.ogg", 1, ATTN_NORM);
34 if (cvar("g_use_ammunition") && !cvar("g_instagib"))
36 if (cvar("g_minstagib"))
37 self.ammo_cells = self.ammo_cells - 1;
39 self.ammo_cells = self.ammo_cells - cvar("g_balance_nex_ammo");
45 setorigin (flash, self.origin + self.view_ofs + v_forward * 33 + v_right * 14 + v_up * -7);
46 flash.angles = vectoangles (w_shotdir);
47 //setattachment(flash, self.weaponentity, "bone01");
48 //flash.origin = '150 0 0';
49 //setattachment(flash, self.weaponentity, "");
50 //flash.origin = '150 -16 -8';
51 //flash.angles_z = 90;
53 setmodel (flash, "models/nexflash.md3");
54 SUB_SetFade (flash, time, 0.4);
55 flash.effects = flash.effects | EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
60 .float minstagib_nextthink;
61 void minstagib_ammocheck (void)
63 if (time < self.minstagib_nextthink || self.deadflag || gameover)
66 if (self.ammo_cells <= 0)
70 centermsg_set(CENTERMSG_MINSTAGIB, "you're dead now...");
71 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
72 stuffcmd(self, "play2 announcer/robotic/terminated.ogg\n");
74 if (self.health == 10)
76 centermsg_set(CENTERMSG_MINSTAGIB, "^11^7 second left to find some ammo");
77 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
78 stuffcmd(self, "play2 announcer/robotic/1.ogg\n");
80 if (self.health == 20)
82 centermsg_set(CENTERMSG_MINSTAGIB, "^12^7 seconds left to find some ammo");
83 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
84 stuffcmd(self, "play2 announcer/robotic/2.ogg\n");
86 if (self.health == 30)
88 centermsg_set(CENTERMSG_MINSTAGIB, "^13^7 seconds left to find some ammo");
89 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
90 stuffcmd(self, "play2 announcer/robotic/3.ogg\n");
92 if (self.health == 40)
94 centermsg_set(CENTERMSG_MINSTAGIB, "^14^7 seconds left to find some ammo");
95 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
96 stuffcmd(self, "play2 announcer/robotic/4.ogg\n");
98 if (self.health == 50)
100 centermsg_set(CENTERMSG_MINSTAGIB, "^15^7 seconds left to find some ammo");
101 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
102 stuffcmd(self, "play2 announcer/robotic/5.ogg\n");
104 if (self.health == 60)
106 centermsg_set(CENTERMSG_MINSTAGIB, "^36^7 seconds left to find some ammo");
107 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
108 stuffcmd(self, "play2 announcer/robotic/6.ogg\n");
110 if (self.health == 70)
112 centermsg_set(CENTERMSG_MINSTAGIB, "^37^7 seconds left to find some ammo");
113 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
114 stuffcmd(self, "play2 announcer/robotic/7.ogg\n");
116 if (self.health == 80)
118 centermsg_set(CENTERMSG_MINSTAGIB, "^38^7 seconds left to find some ammo");
119 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
120 stuffcmd(self, "play2 announcer/robotic/8.ogg\n");
122 if (self.health == 90)
124 centermsg_set(CENTERMSG_MINSTAGIB, "^39^7 seconds left to find some ammo");
125 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
126 stuffcmd(self, "play2 announcer/robotic/9.ogg\n");
128 if (self.health == 100)
130 centermsg_set(CENTERMSG_MINSTAGIB, "get some ammo or");
131 centermsg_set(CENTERMSG_MINSTAGIB2, "you'll be dead in ^310^7 seconds...");
132 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
133 stuffcmd(self, "play2 announcer/robotic/10.ogg\n");
136 self.minstagib_nextthink = time + 1;
139 float(float req) w_nex =
142 self.button0 = bot_aim(1000000, 0, 1, FALSE);
143 else if (req == WR_THINK)
146 if (weapon_prepareattack(0, cvar("g_balance_nex_refire")))
149 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nex_animtime"), w_ready);
152 else if (req == WR_SETUP)
153 weapon_setup(WEP_NEX, "nex", IT_CELLS);
154 else if (req == WR_CHECKAMMO1)
156 if (cvar("g_minstagib"))
157 return self.ammo_cells >= 1;
159 return self.ammo_cells >= cvar("g_balance_nex_ammo");
161 else if (req == WR_CHECKAMMO2)