4 void() hagar_deselect_01;
5 void() hagar_select_01;
9 if (self.ammo_rockets >= 1)
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, cvar("g_balance_hagar_damage"), cvar("g_balance_hagar_edgedamage"), cvar("g_balance_hagar_radius"), world, cvar("g_balance_hagar_force"), 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)
69 makevectors(self.v_angle);
70 sound (self, CHAN_WEAPON, "weapons/hagar_fire.wav", 1, ATTN_NORM);
74 missile.classname = "missile";
76 missile.takedamage = DAMAGE_YES;
77 missile.damageforcescale = 4;
79 missile.event_damage = W_Hagar_Damage;
81 missile.movetype = MOVETYPE_FLY;
82 missile.solid = SOLID_BBOX;
83 setmodel (missile, "models/hagarmissile.mdl");
84 setsize (missile, '0 0 0', '0 0 0');
87 setorigin (missile, self.origin + self.view_ofs + v_forward * 25 + v_right * 5 + v_up * -8);
89 sped = cvar("g_balance_hagar_speed");
90 missile.velocity = v_forward * sped + v_right * crandom() * 0.035 * sped + v_up * crandom() * 0.015 * sped;
91 missile.angles = vectoangles (missile.velocity);
93 missile.touch = W_Hagar_Touch;
94 missile.think = W_Hagar_Explode;
95 missile.nextthink = time + 10;
97 self.attack_finished = time + 0.2;
98 self.ammo_rockets = self.ammo_rockets - 1;
101 void W_Hagar_Attack2 (void)
105 sound (self, CHAN_WEAPON, "weapons/hagar_fire.wav", 1, ATTN_NORM);
107 makevectors(self.v_angle);
110 missile.owner = self;
111 missile.classname = "missile";
113 missile.movetype = MOVETYPE_TOSS;
114 missile.solid = SOLID_BBOX;
116 missile.takedamage = DAMAGE_YES;
117 missile.damageforcescale = 4;
119 missile.event_damage = W_Hagar_Damage;
121 setmodel (missile, "models/hagarmissile.mdl");
122 setsize (missile, '-6 -6 -3', '6 6 3');
124 setorigin (missile, self.origin + self.view_ofs + v_forward * 25 + v_right * 5 + v_up * -8);
128 missile.velocity = v_forward * cvar("g_balance_hagar_speed2") + v_up * cvar("g_balance_hagar_speed2_up");
129 missile.angles = vectoangles (missile.velocity);
130 missile.avelocity = '100 10 10';
132 missile.touch = W_Hagar_Touch;
133 missile.think = W_Hagar_Explode;
134 missile.nextthink = time + 10;
136 self.attack_finished = time + 0.2;
137 self.ammo_rockets = self.ammo_rockets - 1;
141 void() hagar_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, hagar_ready_01); self.weaponentity.state = WS_READY;};
142 void() hagar_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');};
143 void() hagar_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);};
144 void() hagar_fire1_01 =
146 weapon_doattack(hagar_check, hagar_check, W_Hagar_Attack);
147 weapon_thinkf(WFRAME_FIRE1, 0.15, hagar_ready_01);
149 void() hagar_fire2_01 =
151 weapon_doattack(hagar_check, hagar_check, W_Hagar_Attack2);
152 weapon_thinkf(WFRAME_FIRE2, 0.15, hagar_ready_01);