]> icculus.org git repositories - divverent/nexuiz.git/blob - qcsrc/gamec/w_nex.c
Updated TODO
[divverent/nexuiz.git] / qcsrc / gamec / w_nex.c
1 void() nex_ready_01;
2 void() nex_fire1_01;
3 void() nex_fire2_01;
4 void() nex_deselect_01;
5 void() nex_select_01;
6
7 float() nex_check = 
8 {
9         if (self.ammo_cells > 0) 
10                 return TRUE; 
11         return FALSE;
12 };
13
14 void(float req) w_nex =
15 {
16         if (req == WR_IDLE)
17                 nex_ready_01();
18         else if (req == WR_FIRE1)
19                 weapon_prepareattack(nex_check, nex_check, nex_fire1_01, 1);
20         else if (req == WR_FIRE2)
21                 weapon_prepareattack(nex_check, nex_check, nex_fire2_01, 1);
22         else if (req == WR_RAISE)
23                 nex_select_01();
24         else if (req == WR_UPDATECOUNTS)
25                 self.currentammo = self.ammo_cells;
26         else if (req == WR_DROP)
27                 nex_deselect_01();
28         else if (req == WR_SETUP)
29                 weapon_setup(WEP_NEX, "w_nex.zym", IT_CELLS);
30         else if (req == WR_CHECKAMMO)
31                 weapon_hasammo = nex_check();
32 };               
33
34
35 void W_Nex_Attack (void)
36 {
37         vector  org;
38         vector  dir;
39         entity  explosion;
40
41         sound (self, CHAN_WEAPON, "weapons/nexfire.wav", 1, ATTN_NORM);
42         self.punchangle_x = -4;
43         makevectors(self.v_angle);
44         org = self.origin + self.view_ofs + v_forward * 28 + v_right * 14 + v_up * -7;
45         te_smallflash(org);
46
47         FireRailgunBullet (org, self.origin + self.view_ofs + v_forward * 4096, 800, IT_NEX);
48
49         self.attack_finished = time + 1;
50
51         if (!(game & GAME_INSTAGIB))
52                 self.ammo_cells = self.ammo_cells - 1;
53 }
54
55 void W_Nex_Attack2 (void)
56 {
57         makevectors(self.v_angle);
58 }
59
60 // weapon frames 
61 void()  nex_ready_01 =  {weapon_thinkf(WFRAME_IDLE, 0.1, nex_ready_01); self.weaponentity.state = WS_READY;};
62 void()  nex_select_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');};
63 void()  nex_deselect_01 =       {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);};
64 void()  nex_fire1_01 =  
65 {
66         weapon_doattack(nex_check, nex_check, W_Nex_Attack);
67         weapon_thinkf(WFRAME_FIRE1, 0.3, nex_ready_01);
68 };
69 void()  nex_fire2_01 =  
70 {
71         weapon_doattack(nex_check, nex_check, W_Nex_Attack);
72         weapon_thinkf(WFRAME_FIRE2, 0.5, nex_ready_01);
73 };
74