]> icculus.org git repositories - divverent/nexuiz.git/blob - qcsrc/gamec/w_crylink.c
disabled the 'has taken the lead' till it works
[divverent/nexuiz.git] / qcsrc / gamec / w_crylink.c
1 void() crylink_ready_01;
2 void() crylink_fire1_01;
3 void() crylink_deselect_01;
4 void() crylink_select_01;
5
6 .float gravity;
7
8 float() crylink_check =
9 {
10         if (self.ammo_cells >= 1)
11                 return TRUE;
12         return FALSE;
13 };
14
15 void(float req) w_crylink =
16 {
17         if (req == WR_IDLE)
18                 crylink_ready_01();
19         else if (req == WR_FIRE1 || req == WR_FIRE2)
20                 weapon_prepareattack(crylink_check, crylink_check, crylink_fire1_01, cvar("g_balance_crylink_refire"));
21         else if (req == WR_RAISE)
22                 crylink_select_01();
23         else if (req == WR_UPDATECOUNTS)
24                 self.currentammo = self.ammo_cells;
25         else if (req == WR_DROP)
26                 crylink_deselect_01();
27         else if (req == WR_SETUP)
28                 weapon_setup(WEP_CRYLINK, "w_crylink.zym", IT_CELLS);
29         else if (req == WR_CHECKAMMO)
30                 weapon_hasammo = crylink_check();
31 };
32
33
34 void W_Crylink_Touch (void)
35 {
36         self.event_damage = SUB_Null;
37         //te_smallflash(self.origin);
38         RadiusDamage (self, self.owner, cvar("g_balance_crylink_damage"), cvar("g_balance_crylink_edgedamage"), cvar("g_balance_crylink_radius"), world, cvar("g_balance_crylink_force"), IT_CRYLINK);
39         self.touch = SUB_Null;
40         setmodel (self, "models/plasma.mdl");
41         setsize (self, '0 0 0', '0 0 0');
42         self.gravity = 1;
43         self.glow_size = 0;
44         self.glow_color = 0;
45         self.think = SUB_Remove;
46         //self.movetype = MOVETYPE_NONE;
47         self.effects = EF_LOWPRECISION;
48         SUB_SetFade(self, time, 1);
49         //remove (self);
50 }
51
52 void W_Crylink_Attack (void)
53 {
54         local float counter;
55         local vector org;
56         local entity proj;
57
58         sound (self, CHAN_WEAPON, "weapons/crylink.wav", 1, ATTN_NORM);
59         self.ammo_cells = self.ammo_cells - 1;
60         self.punchangle_x = -2;
61         org = self.origin + self.view_ofs + v_forward * 10 + v_right * 5 + v_up * -14;
62         te_smallflash(org);
63
64         while (counter < 5)
65         {
66                 proj = spawn ();
67                 proj.owner = self;
68                 proj.classname = "spike";
69
70                 proj.movetype = MOVETYPE_BOUNCE;
71                 proj.solid = SOLID_BBOX;
72                 proj.gravity = 0.001;
73
74                 setmodel (proj, "models/plasmatrail.mdl");
75                 setsize (proj, '0 0 0', '0 0 0');
76                 setorigin (proj, org);
77
78                 if (self.button3)
79                         proj.velocity = (v_forward + (counter / 2 - 1) * v_right * cvar("g_balance_crylink_spread")) * cvar("g_balance_crylink_speed");
80                 else
81                         proj.velocity = (v_forward + (counter / 5) * randomvec() * cvar("g_balance_crylink_spread")) * cvar("g_balance_crylink_speed");
82                 proj.touch = W_Crylink_Touch;
83                 proj.think = SUB_Remove;
84                 proj.nextthink = time + 9;
85
86                 proj.angles = vectoangles (proj.velocity);
87
88                 //proj.glow_size = 20;
89
90                 proj.effects = proj.effects | EF_FULLBRIGHT;
91                 //proj.effects = proj.effects | EF_ADDITIVE;
92                 proj.effects = proj.effects | EF_LOWPRECISION;
93                 counter = counter + 1;
94         }
95 }
96
97
98 // weapon frames
99 void()  crylink_ready_01 =      {weapon_thinkf(WFRAME_IDLE, 0.1, crylink_ready_01); self.weaponentity.state = WS_READY;};
100 void()  crylink_select_01 =     {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');};
101 void()  crylink_deselect_01 =   {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);};
102 void()  crylink_fire1_01 =
103 {
104         weapon_doattack(crylink_check, crylink_check, W_Crylink_Attack);
105         weapon_thinkf(WFRAME_FIRE1, 0.15, crylink_ready_01);
106 };
107