]> icculus.org git repositories - divverent/nexuiz.git/blob - qcsrc/gamec/w_crylink.c
Added a massive push when shot with the Nex
[divverent/nexuiz.git] / qcsrc / gamec / w_crylink.c
1 void() crylink_ready_01;
2 void() crylink_fire1_01;
3 void() crylink_fire2_01;
4 void() crylink_deselect_01;
5 void() crylink_select_01;
6
7 float() crylink_check =
8 {
9         if (self.ammo_cells >= 1)
10                 return TRUE;
11         return FALSE;
12 };
13
14 void(float req) w_crylink =
15 {
16         if (req == WR_IDLE)
17                 crylink_ready_01();
18         else if (req == WR_FIRE1)
19                 weapon_prepareattack(crylink_check, crylink_check, crylink_fire1_01, 0.2);
20         else if (req == WR_FIRE2)
21                 weapon_prepareattack(crylink_check, crylink_check, crylink_fire2_01, 0.2);
22         else if (req == WR_RAISE)
23                 crylink_select_01();
24         else if (req == WR_UPDATECOUNTS)
25                 self.currentammo = self.ammo_cells;
26         else if (req == WR_DROP)
27                 crylink_deselect_01();
28         else if (req == WR_SETUP)
29                 weapon_setup(WEP_CRYLINK, "w_crylink.zym", IT_CELLS);
30         else if (req == WR_CHECKAMMO)
31                 weapon_hasammo = crylink_check();
32 };
33
34
35 void W_Crylink_Touch (void)
36 {
37         self.event_damage = nullfunction;
38         //te_smallflash(self.origin);
39         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);
40         remove (self);
41 }
42
43 void W_Crylink_Attack (void) //(float postion)
44 {
45         float counter;
46
47         sound (self, CHAN_WEAPON, "weapons/shotgun_fire.wav", 1, ATTN_NORM);
48         self.attack_finished = time + 0.7;
49         self.ammo_cells = self.ammo_cells - 1;
50
51         while (counter < 5)
52         {
53                 entity  proj;
54
55                 makevectors(self.v_angle);
56                 proj = spawn ();
57                 proj.owner = self;
58                 proj.classname = "spike";
59
60                 proj.movetype = MOVETYPE_FLY;
61                 proj.solid = SOLID_BBOX;
62
63                 setmodel (proj, "models/plasma.mdl");
64                 setsize (proj, '0 0 0', '0 0 0');
65                 setorigin (proj, self.origin + self.view_ofs + v_forward * 10 + v_right * 5 + v_up * -14);
66
67                 proj.velocity = v_forward * cvar("g_balance_crylink_speed");
68                 proj.velocity = proj.velocity + v_right * ( crandom() * 50 );
69                 proj.velocity = proj.velocity + v_up * ( crandom() * 50 );
70                 proj.touch = W_Crylink_Touch;
71                 proj.think = SUB_Remove;
72                 proj.nextthink = time + 9;
73
74                 proj.glow_color = 10;
75                 proj.glow_size = 20;
76
77                 proj.effects = proj.effects | EF_ADDITIVE;
78                 counter = counter + 1;
79         }
80 }
81
82 void W_Crylink_Attack2 (void)
83 {
84
85
86 }
87
88
89 // weapon frames
90 void()  crylink_ready_01 =      {weapon_thinkf(WFRAME_IDLE, 0.1, crylink_ready_01); self.weaponentity.state = WS_READY;};
91 void()  crylink_select_01 =     {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');};
92 void()  crylink_deselect_01 =   {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);};
93 void()  crylink_fire1_01 =
94 {
95         weapon_doattack(crylink_check, crylink_check, W_Crylink_Attack);
96         weapon_thinkf(WFRAME_FIRE1, 0.15, crylink_ready_01);
97 };
98 void()  crylink_fire2_01 =
99 {
100         weapon_doattack(crylink_check, crylink_check, W_Crylink_Attack);
101         weapon_thinkf(WFRAME_FIRE1, 0.15, crylink_ready_01);
102 };
103 void()  crylink_fire3_01 =
104 {
105         weapon_doattack(crylink_check, crylink_check, W_Crylink_Attack);
106         weapon_thinkf(WFRAME_FIRE1, 0.15, crylink_ready_01);
107 };
108