5 void() hagar_deselect_01;
6 void() hagar_select_01;
10 if (self.ammo_rockets > 0)
15 void(float req) w_hagar =
19 else if (req == WR_FIRE1)
20 weapon_prepareattack(hagar_check, hagar_check, hagar_fire1_01, 0.2);
21 else if (req == WR_FIRE2)
22 weapon_prepareattack(hagar_check, hagar_check, hagar_fire2_01, 0.2);
23 else if (req == WR_FIRE3)
24 weapon_prepareattack(hagar_check, hagar_check, hagar_fire3_01, 0);
25 else if (req == WR_RAISE)
27 else if (req == WR_UPDATECOUNTS)
28 self.currentammo = self.ammo_rockets;
29 else if (req == WR_DROP)
31 else if (req == WR_SETUP)
32 weapon_setup(WEP_HAGAR, "w_hagar.zym", IT_ROCKETS);
33 else if (req == WR_CHECKAMMO)
34 weapon_hasammo = hagar_check();
37 void W_Hagar_Explode (void)
39 ImpactEffect (self, IT_HAGAR);
41 self.event_damage = SUB_Null;
42 RadiusDamage (self, self.owner, 40, 15, 70, world, 100, IT_HAGAR);
47 void W_Hagar_Touch (void)
49 if (other == self.owner)
51 else if (pointcontents (self.origin) == CONTENT_SKY)
60 void W_Hagar_Damage (vector hitloc, float damage, entity inflictor, entity attacker, float deathtype)
62 self.health = self.health - damage;
67 void W_Hagar_Attack (void)
71 makevectors(self.v_angle);
72 sound (self, CHAN_WEAPON, "weapons/hagar_fire.wav", 1, ATTN_NORM);
76 missile.classname = "missile";
78 missile.takedamage = DAMAGE_YES;
79 missile.damageforcescale = 4;
81 missile.event_damage = W_Hagar_Damage;
83 missile.movetype = MOVETYPE_FLY;
84 missile.solid = SOLID_BBOX;
85 setmodel (missile, "models/hagarmissile.mdl");
86 setsize (missile, '0 0 0', '0 0 0');
88 setorigin (missile, self.origin + self.view_ofs + v_forward * 18 + v_right * 5 + v_up * -12);
90 missile.velocity = v_forward * 2000;
91 missile.velocity = missile.velocity + v_right * ( crandom() * 70 );
92 missile.velocity = missile.velocity + v_up * ( crandom() * 30 );
93 missile.angles = vectoangles (missile.velocity);
94 setorigin (missile, self.origin + self.view_ofs + v_forward * 18 + v_right * 5 + v_up * -12);
96 missile.touch = W_Hagar_Touch;
97 missile.think = W_Hagar_Explode;
98 missile.nextthink = time + 10;
100 self.attack_finished = time + 0.2;
101 self.ammo_rockets = self.ammo_rockets - 0.25;
104 void W_Hagar_Attack2 (void)
108 sound (self, CHAN_WEAPON, "weapons/hagar_fire.wav", 1, ATTN_NORM);
110 makevectors(self.v_angle);
113 missile.owner = self;
114 missile.classname = "missile";
116 missile.movetype = MOVETYPE_TOSS;
117 missile.solid = SOLID_BBOX;
119 missile.takedamage = DAMAGE_YES;
120 missile.damageforcescale = 4;
122 missile.event_damage = W_Hagar_Damage;
124 setmodel (missile, "models/hagarmissile.mdl");
125 setsize (missile, '-6 -6 -3', '6 6 3');
127 setorigin (missile, self.origin + self.view_ofs + v_forward * 18 + v_right * 5 + v_up * -12);
129 missile.velocity = v_forward * 1400 + v_up * 100;
130 missile.angles = vectoangles (missile.velocity);
131 missile.avelocity = '100 10 10';
133 missile.touch = W_Hagar_Touch;
134 missile.think = W_Hagar_Explode;
135 missile.nextthink = time + 10;
137 self.attack_finished = time + 0.2;
138 self.ammo_rockets = self.ammo_rockets - 0.25;
141 void W_Hagar_Attack3 (void)
144 makevectors(self.v_angle);
145 proj = findradius (self.origin, 50000);
148 if (proj.classname == "missile" && proj.owner == self)
150 proj.velocity = proj.velocity - v_up * 500;
151 proj.velocity = proj.velocity - v_forward * 1000;
156 self.attack_finished = time;
161 void() hagar_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, hagar_ready_01); self.weaponentity.state = WS_READY;};
162 void() hagar_select_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');};
163 void() hagar_deselect_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);};
164 void() hagar_fire1_01 =
166 weapon_doattack(hagar_check, hagar_check, W_Hagar_Attack);
167 weapon_thinkf(WFRAME_FIRE1, 0.15, hagar_ready_01);
169 void() hagar_fire2_01 =
171 weapon_doattack(hagar_check, hagar_check, W_Hagar_Attack2);
172 weapon_thinkf(WFRAME_FIRE2, 0.15, hagar_ready_01);
174 void() hagar_fire3_01 =
176 weapon_doattack(hagar_check, hagar_check, W_Hagar_Attack3);
177 weapon_thinkf(WFRAME_FIRE2, 0.15, hagar_ready_01);