2 REGISTER_WEAPON(HAGAR, w_hagar, IT_ROCKETS, 8, WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "hagar", "hagar", _("Hagar"))
5 // NO bounce protection, as bounces are limited!
6 void W_Hagar_Explode (void)
8 self.event_damage = SUB_Null;
9 RadiusDamage (self, self.realowner, autocvar_g_balance_hagar_primary_damage, autocvar_g_balance_hagar_primary_edgedamage, autocvar_g_balance_hagar_primary_radius, world, autocvar_g_balance_hagar_primary_force, self.projectiledeathtype, other);
14 void W_Hagar_Explode2 (void)
16 self.event_damage = SUB_Null;
17 RadiusDamage (self, self.realowner, autocvar_g_balance_hagar_secondary_damage, autocvar_g_balance_hagar_secondary_edgedamage, autocvar_g_balance_hagar_secondary_radius, world, autocvar_g_balance_hagar_secondary_force, self.projectiledeathtype, other);
22 void W_Hagar_Touch (void)
28 void W_Hagar_Touch2 (void)
32 if(self.cnt > 0 || other.takedamage == DAMAGE_AIM) {
36 pointparticles(particleeffectnum("hagar_bounce"), self.origin, self.velocity, 1);
37 self.angles = vectoangles (self.velocity);
39 self.projectiledeathtype |= HITTYPE_BOUNCE;
43 void W_Hagar_Attack (void)
47 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
48 self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_hagar_primary_ammo;
49 W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", CHAN_WEAPON, autocvar_g_balance_hagar_primary_damage);
51 pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
54 missile.owner = missile.realowner = self;
55 missile.classname = "missile";
56 missile.bot_dodge = TRUE;
57 missile.bot_dodgerating = autocvar_g_balance_hagar_primary_damage;
58 missile.touch = W_Hagar_Touch;
59 missile.use = W_Hagar_Explode;
60 missile.think = adaptor_think2use_hittype_splash;
61 missile.nextthink = time + autocvar_g_balance_hagar_primary_lifetime;
62 PROJECTILE_MAKETRIGGER(missile);
63 missile.projectiledeathtype = WEP_HAGAR;
64 setorigin (missile, w_shotorg);
65 setsize(missile, '0 0 0', '0 0 0');
67 missile.movetype = MOVETYPE_FLY;
68 W_SETUPPROJECTILEVELOCITY(missile, g_balance_hagar_primary);
70 missile.angles = vectoangles (missile.velocity);
71 missile.flags = FL_PROJECTILE;
73 CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR, TRUE);
75 other = missile; MUTATOR_CALLHOOK(EditProjectile);
78 void W_Hagar_Attack2 (void)
82 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
83 self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_hagar_secondary_ammo;
84 W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", CHAN_WEAPON, autocvar_g_balance_hagar_secondary_damage);
86 pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
89 missile.owner = missile.realowner = self;
90 missile.classname = "missile";
91 missile.bot_dodge = TRUE;
92 missile.bot_dodgerating = autocvar_g_balance_hagar_secondary_damage;
93 missile.touch = W_Hagar_Touch2;
95 missile.use = W_Hagar_Explode2;
96 missile.think = adaptor_think2use_hittype_splash;
97 missile.nextthink = time + autocvar_g_balance_hagar_secondary_lifetime_min + random() * autocvar_g_balance_hagar_secondary_lifetime_rand;
98 PROJECTILE_MAKETRIGGER(missile);
99 missile.projectiledeathtype = WEP_HAGAR | HITTYPE_SECONDARY;
100 setorigin (missile, w_shotorg);
101 setsize(missile, '0 0 0', '0 0 0');
103 missile.movetype = MOVETYPE_BOUNCEMISSILE;
104 W_SETUPPROJECTILEVELOCITY(missile, g_balance_hagar_secondary);
106 missile.angles = vectoangles (missile.velocity);
107 missile.flags = FL_PROJECTILE;
109 CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR_BOUNCING, TRUE);
111 other = missile; MUTATOR_CALLHOOK(EditProjectile);
114 void spawnfunc_weapon_hagar (void)
116 weapon_defaultspawnfunc(WEP_HAGAR);
119 float w_hagar(float req)
123 self.BUTTON_ATCK = bot_aim(autocvar_g_balance_hagar_primary_speed, 0, autocvar_g_balance_hagar_primary_lifetime, FALSE);
126 // not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming
127 self.BUTTON_ATCK2 = bot_aim(autocvar_g_balance_hagar_primary_speed, 0, autocvar_g_balance_hagar_primary_lifetime, FALSE);
129 else if (req == WR_THINK)
131 if (self.BUTTON_ATCK)
132 if (weapon_prepareattack(0, autocvar_g_balance_hagar_primary_refire))
135 weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hagar_primary_refire, w_ready);
137 if (self.BUTTON_ATCK2 && autocvar_g_balance_hagar_secondary)
138 if (weapon_prepareattack(1, autocvar_g_balance_hagar_secondary_refire))
141 weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_hagar_secondary_refire, w_ready);
144 else if (req == WR_PRECACHE)
146 precache_model ("models/weapons/g_hagar.md3");
147 precache_model ("models/weapons/v_hagar.md3");
148 precache_model ("models/weapons/h_hagar.iqm");
149 precache_sound ("weapons/hagar_fire.wav");
151 else if (req == WR_SETUP)
152 weapon_setup(WEP_HAGAR);
153 else if (req == WR_CHECKAMMO1)
154 return self.ammo_rockets >= autocvar_g_balance_hagar_primary_ammo;
155 else if (req == WR_CHECKAMMO2)
156 return self.ammo_rockets >= autocvar_g_balance_hagar_secondary_ammo;
161 float w_hagar(float req)
163 if(req == WR_IMPACTEFFECT)
166 org2 = w_org + w_backoff * 6;
167 pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
171 sound(self, CHAN_PROJECTILE, "weapons/hagexp1.wav", VOL_BASE, ATTN_NORM);
172 else if (w_random<0.7)
173 sound(self, CHAN_PROJECTILE, "weapons/hagexp2.wav", VOL_BASE, ATTN_NORM);
175 sound(self, CHAN_PROJECTILE, "weapons/hagexp3.wav", VOL_BASE, ATTN_NORM);
178 else if(req == WR_PRECACHE)
180 precache_sound("weapons/hagexp1.wav");
181 precache_sound("weapons/hagexp2.wav");
182 precache_sound("weapons/hagexp3.wav");
184 else if (req == WR_SUICIDEMESSAGE)
185 w_deathtypestring = _("%s played with tiny rockets");
186 else if (req == WR_KILLMESSAGE)
188 if(w_deathtype & HITTYPE_BOUNCE) // must be secondary; unchecked: SPLASH
189 w_deathtypestring = _("%s hoped %s's missiles wouldn't bounce");
190 else // unchecked: SPLASH, SECONDARY
191 w_deathtypestring = _("%s was pummeled by %s");