4 void() hagar_deselect_01;
5 void() hagar_select_01;
9 if (self.ammo_rockets > 0)
14 void(float req) w_hagar =
18 else if (req == WR_FIRE1)
19 weapon_prepareattack(hagar_check, hagar_check, hagar_fire1_01, 0.2);
20 else if (req == WR_FIRE2)
21 weapon_prepareattack(hagar_check, hagar_check, hagar_fire2_01, 0.2);
22 else if (req == WR_RAISE)
24 else if (req == WR_UPDATECOUNTS)
25 self.currentammo = self.ammo_rockets;
26 else if (req == WR_DROP)
28 else if (req == WR_SETUP)
29 weapon_setup(WEP_HAGAR, "w_hagar.zym", IT_ROCKETS);
30 else if (req == WR_CHECKAMMO)
31 weapon_hasammo = hagar_check();
34 void W_Hagar_Explode (void)
36 ImpactEffect (self, IT_HAGAR);
38 self.event_damage = nullfunction;
39 RadiusDamage (self, self.owner, 40, 15, 70, world, 100, IT_HAGAR);
44 void W_Hagar_Touch (void)
46 if (other == self.owner)
48 else if (pointcontents (self.origin) == CONTENT_SKY)
57 void W_Hagar_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
59 self.health = self.health - damage;
64 void W_Hagar_Attack (void)
68 makevectors(self.v_angle);
69 sound (self, CHAN_WEAPON, "weapons/hagar_fire.wav", 1, ATTN_NORM);
73 missile.classname = "missile";
75 missile.takedamage = DAMAGE_YES;
76 missile.damageforcescale = 4;
78 missile.event_damage = W_Hagar_Damage;
80 missile.movetype = MOVETYPE_FLY;
81 missile.solid = SOLID_BBOX;
82 setmodel (missile, "models/hagarmissile.mdl");
83 setsize (missile, '0 0 0', '0 0 0');
85 setorigin (missile, self.origin + self.view_ofs + v_forward * 25 + v_right * 5 + v_up * -12);
87 missile.velocity = v_forward * 2000;
88 missile.velocity = missile.velocity + v_right * ( crandom() * 70 );
89 missile.velocity = missile.velocity + v_up * ( crandom() * 30 );
90 missile.angles = vectoangles (missile.velocity);
92 missile.touch = W_Hagar_Touch;
93 missile.think = W_Hagar_Explode;
94 missile.nextthink = time + 10;
96 self.attack_finished = time + 0.2;
97 self.ammo_rockets = self.ammo_rockets - 0.25;
100 void W_Hagar_Attack2 (void)
104 sound (self, CHAN_WEAPON, "weapons/hagar_fire.wav", 1, ATTN_NORM);
106 makevectors(self.v_angle);
109 missile.owner = self;
110 missile.classname = "missile";
112 missile.movetype = MOVETYPE_TOSS;
113 missile.solid = SOLID_BBOX;
115 missile.takedamage = DAMAGE_YES;
116 missile.damageforcescale = 4;
118 missile.event_damage = W_Hagar_Damage;
120 setmodel (missile, "models/hagarmissile.mdl");
121 setsize (missile, '-6 -6 -3', '6 6 3');
123 setorigin (missile, self.origin + self.view_ofs + v_forward * 15 + v_right * 5 + v_up * -12);
125 missile.velocity = v_forward * 1400 + v_up * 100;
126 missile.angles = vectoangles (missile.velocity);
127 missile.avelocity = '100 10 10';
129 missile.touch = W_Hagar_Touch;
130 missile.think = W_Hagar_Explode;
131 missile.nextthink = time + 10;
133 self.attack_finished = time + 0.2;
134 self.ammo_rockets = self.ammo_rockets - 0.25;
138 void() hagar_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, hagar_ready_01); self.weaponentity.state = WS_READY;};
139 void() hagar_select_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');};
140 void() hagar_deselect_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);};
141 void() hagar_fire1_01 =
143 weapon_doattack(hagar_check, hagar_check, W_Hagar_Attack);
144 weapon_thinkf(WFRAME_FIRE1, 0.15, hagar_ready_01);
146 void() hagar_fire2_01 =
148 weapon_doattack(hagar_check, hagar_check, W_Hagar_Attack2);
149 weapon_thinkf(WFRAME_FIRE2, 0.15, hagar_ready_01);