1 // NO bounce protection, as bounces are limited!
2 void W_Hagar_Explode (void)
4 self.event_damage = SUB_Null;
5 RadiusDamage (self, self.realowner, cvar("g_balance_hagar_primary_damage"), cvar("g_balance_hagar_primary_edgedamage"), cvar("g_balance_hagar_primary_radius"), world, cvar("g_balance_hagar_primary_force"), self.projectiledeathtype, other);
10 void W_Hagar_Explode2 (void)
12 self.event_damage = SUB_Null;
13 RadiusDamage (self, self.realowner, cvar("g_balance_hagar_secondary_damage"), cvar("g_balance_hagar_secondary_edgedamage"), cvar("g_balance_hagar_secondary_radius"), world, cvar("g_balance_hagar_secondary_force"), self.projectiledeathtype, other);
18 void W_Hagar_Touch (void)
24 void W_Hagar_Touch2 (void)
28 if(self.cnt > 0 || other.takedamage == DAMAGE_AIM) {
32 pointparticles(particleeffectnum("hagar_bounce"), self.origin, self.velocity, 1);
33 self.angles = vectoangles (self.velocity);
35 self.projectiledeathtype |= HITTYPE_BOUNCE;
39 void W_Hagar_Attack (void)
43 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
44 self.ammo_rockets = self.ammo_rockets - cvar("g_balance_hagar_primary_ammo");
45 W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", cvar("g_balance_hagar_primary_damage"));
47 pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
50 missile.owner = missile.realowner = self;
51 missile.classname = "missile";
52 missile.bot_dodge = TRUE;
53 missile.bot_dodgerating = cvar("g_balance_hagar_primary_damage");
54 missile.touch = W_Hagar_Touch;
55 missile.use = W_Hagar_Explode;
56 missile.think = adaptor_think2use;
57 missile.nextthink = time + cvar("g_balance_hagar_primary_lifetime");
58 PROJECTILE_MAKETRIGGER(missile);
59 missile.projectiledeathtype = WEP_HAGAR;
60 setorigin (missile, w_shotorg);
61 setsize(missile, '0 0 0', '0 0 0');
63 missile.movetype = MOVETYPE_FLY;
64 W_SETUPPROJECTILEVELOCITY(missile, g_balance_hagar_primary);
66 missile.angles = vectoangles (missile.velocity);
67 missile.flags = FL_PROJECTILE;
69 CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR, TRUE);
72 void W_Hagar_Attack2 (void)
76 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
77 self.ammo_rockets = self.ammo_rockets - cvar("g_balance_hagar_secondary_ammo");
78 W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", cvar("g_balance_hagar_secondary_damage"));
79 //W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav"); // TODO: move model a little to the right
81 pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
84 missile.owner = missile.realowner = self;
85 missile.classname = "missile";
86 missile.bot_dodge = TRUE;
87 missile.bot_dodgerating = cvar("g_balance_hagar_secondary_damage");
88 missile.touch = W_Hagar_Touch2;
90 missile.use = W_Hagar_Explode;
91 missile.think = adaptor_think2use;
92 missile.nextthink = time + cvar("g_balance_hagar_secondary_lifetime_min") + random() * cvar("g_balance_hagar_secondary_lifetime_rand");
93 PROJECTILE_MAKETRIGGER(missile);
94 missile.projectiledeathtype = WEP_HAGAR | HITTYPE_SECONDARY;
95 setorigin (missile, w_shotorg);
96 setsize(missile, '0 0 0', '0 0 0');
98 missile.movetype = MOVETYPE_BOUNCEMISSILE;
99 W_SETUPPROJECTILEVELOCITY(missile, g_balance_hagar_secondary);
101 missile.angles = vectoangles (missile.velocity);
102 missile.flags = FL_PROJECTILE;
104 CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR_BOUNCING, TRUE);
107 void spawnfunc_weapon_hagar (void)
109 weapon_defaultspawnfunc(WEP_HAGAR);
112 float w_hagar(float req)
116 self.BUTTON_ATCK = bot_aim(cvar("g_balance_hagar_primary_speed"), 0, cvar("g_balance_hagar_primary_lifetime"), FALSE);
119 // not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming
120 self.BUTTON_ATCK2 = bot_aim(cvar("g_balance_hagar_primary_speed"), 0, cvar("g_balance_hagar_primary_lifetime"), FALSE);
122 else if (req == WR_THINK)
124 if (self.BUTTON_ATCK)
125 if (weapon_prepareattack(0, cvar("g_balance_hagar_primary_refire")))
128 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hagar_primary_refire"), w_ready);
130 if (self.BUTTON_ATCK2)
131 if (weapon_prepareattack(1, cvar("g_balance_hagar_secondary_refire")))
134 weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_hagar_secondary_refire"), w_ready);
137 else if (req == WR_PRECACHE)
139 precache_model ("models/weapons/g_hagar.md3");
140 precache_model ("models/weapons/v_hagar.md3");
141 precache_model ("models/weapons/h_hagar.dpm");
142 precache_sound ("weapons/hagar_fire.wav");
144 else if (req == WR_SETUP)
145 weapon_setup(WEP_HAGAR);
146 else if (req == WR_CHECKAMMO1)
147 return self.ammo_rockets >= cvar("g_balance_hagar_primary_ammo");
148 else if (req == WR_CHECKAMMO2)
149 return self.ammo_rockets >= cvar("g_balance_hagar_secondary_ammo");
150 else if (req == WR_SUICIDEMESSAGE)
151 w_deathtypestring = "played with tiny rockets";
152 else if (req == WR_KILLMESSAGE)
154 if(w_deathtype & HITTYPE_BOUNCE) // must be secondary; unchecked: SPLASH
155 w_deathtypestring = "hoped #'s missiles wouldn't bounce";
156 else // unchecked: SPLASH, SECONDARY
157 w_deathtypestring = "was pummeled by";