3 void() hagar_deselect_01;
4 void() hagar_select_01;
8 if (self.ammo_rockets >= 1)
13 void(float req) w_hagar =
17 else if (req == WR_FIRE1 || req == WR_FIRE2)
18 weapon_prepareattack(hagar_check, hagar_check, hagar_fire1_01, cvar("g_balance_hagar_refire"));
19 else if (req == WR_RAISE)
21 else if (req == WR_UPDATECOUNTS)
22 self.currentammo = self.ammo_rockets;
23 else if (req == WR_DROP)
25 else if (req == WR_SETUP)
26 weapon_setup(WEP_HAGAR, "w_hagar.zym", IT_ROCKETS);
27 else if (req == WR_CHECKAMMO)
28 weapon_hasammo = hagar_check();
31 void W_Hagar_Explode (void)
35 org2 = findbetterlocation (self.origin);
37 effect (org2, "models/sprites/hagar.spr", 0, 12, 35);
40 sound (self, CHAN_BODY, "weapons/hagexp1.ogg", 1, ATTN_NORM);
42 sound (self, CHAN_BODY, "weapons/hagexp2.ogg", 1, ATTN_NORM);
44 sound (self, CHAN_BODY, "weapons/hagexp3.ogg", 1, ATTN_NORM);
46 self.event_damage = SUB_Null;
47 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);
52 void W_Hagar_Touch (void)
54 if (other == self.owner)
56 else if (pointcontents (self.origin) == CONTENT_SKY)
65 void W_Hagar_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
67 self.health = self.health - damage;
72 void W_Hagar_Attack (void)
77 sound (self, CHAN_WEAPON, "weapons/hagar_fire.ogg", 1, ATTN_NORM);
78 if (self.items & IT_STRENGTH) {
79 sound (self, CHAN_AUTO, "weapons/strength_fire.ogg", 1, ATTN_NORM);
82 if (cvar("g_use_ammunition"))
83 self.ammo_rockets = self.ammo_rockets - 1;
84 self.punchangle_x = -2;
85 org = self.origin + self.view_ofs + v_forward * 15 + v_right * 5 + v_up * -8;
89 missile.classname = "missile";
90 missile.touch = W_Hagar_Touch;
91 missile.think = W_Hagar_Explode;
92 missile.nextthink = time + 10;
93 missile.solid = SOLID_BBOX;
94 missile.scale = 0.4; // BUG: the model is too big
95 setorigin (missile, org);
96 setmodel (missile, "models/hagarmissile.mdl");
97 setsize (missile, '0 0 0', '0 0 0');
98 //missile.takedamage = DAMAGE_YES;
99 //missile.damageforcescale = 4;
100 //missile.health = 10;
101 //missile.event_damage = W_Hagar_Damage;
102 missile.effects = EF_LOWPRECISION;
106 missile.movetype = MOVETYPE_TOSS;
107 missile.velocity = v_forward * cvar("g_balance_hagar_speed2") + v_up * cvar("g_balance_hagar_speed2_up");
108 missile.avelocity = '100 10 10';
112 missile.movetype = MOVETYPE_FLY;
113 missile.velocity = (v_forward + randomvec() * cvar("g_balance_hagar_spread")) * cvar("g_balance_hagar_speed");
116 missile.angles = vectoangles (missile.velocity);
120 void() hagar_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, hagar_ready_01); self.weaponentity.state = WS_READY;};
121 void() hagar_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');};
122 void() hagar_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);};
123 void() hagar_fire1_01 =
125 weapon_doattack(hagar_check, hagar_check, W_Hagar_Attack);
126 weapon_thinkf(WFRAME_FIRE1, 0.15, hagar_ready_01);