1 void W_Hagar_Explode (void)
3 self.event_damage = SUB_Null;
4 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);
9 void W_Hagar_Explode2 (void)
11 self.event_damage = SUB_Null;
12 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);
17 void W_Hagar_Touch (void)
23 void W_Hagar_Touch2 (void)
27 if(self.cnt > 0 || other.takedamage == DAMAGE_AIM) {
31 pointparticles(particleeffectnum("hagar_bounce"), self.origin, self.velocity, 1);
32 self.angles = vectoangles (self.velocity);
34 self.projectiledeathtype |= HITTYPE_BOUNCE;
38 void W_Hagar_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
40 self.health = self.health - damage;
42 W_PrepareExplosionByDamage(attacker, self.think);
45 void W_Hagar_Attack (void)
49 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
50 self.ammo_rockets = self.ammo_rockets - cvar("g_balance_hagar_primary_ammo");
51 W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav");
53 pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
56 missile.owner = missile.realowner = self;
57 missile.classname = "missile";
58 missile.bot_dodge = TRUE;
59 missile.bot_dodgerating = cvar("g_balance_hagar_primary_damage");
60 missile.touch = W_Hagar_Touch;
61 missile.use = W_Hagar_Explode;
62 missile.think = adaptor_think2use;
63 missile.nextthink = time + cvar("g_balance_hagar_primary_lifetime");
64 missile.solid = SOLID_BBOX;
65 missile.projectiledeathtype = WEP_HAGAR;
66 setorigin (missile, w_shotorg);
67 //missile.takedamage = DAMAGE_YES;
68 //missile.damageforcescale = 4;
69 //missile.health = 10;
70 //missile.event_damage = W_Hagar_Damage;
72 missile.movetype = MOVETYPE_FLY;
73 missile.velocity = (w_shotdir + randomvec() * cvar("g_balance_hagar_primary_spread")) * cvar("g_balance_hagar_primary_speed");
74 W_SetupProjectileVelocity(missile);
76 missile.angles = vectoangles (missile.velocity);
77 missile.flags = FL_PROJECTILE;
79 CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR, TRUE);
82 void W_Hagar_Attack2 (void)
86 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
87 self.ammo_rockets = self.ammo_rockets - cvar("g_balance_hagar_secondary_ammo");
88 W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav");
89 //W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav"); // TODO: move model a little to the right
91 pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
94 missile.owner = missile.realowner = self;
95 missile.classname = "missile";
96 missile.bot_dodge = TRUE;
97 missile.bot_dodgerating = cvar("g_balance_hagar_secondary_damage");
98 missile.touch = W_Hagar_Touch2;
100 missile.use = W_Hagar_Explode;
101 missile.think = adaptor_think2use;
102 missile.nextthink = time + cvar("g_balance_hagar_secondary_lifetime");
103 missile.solid = SOLID_BBOX;
104 missile.projectiledeathtype = WEP_HAGAR | HITTYPE_SECONDARY;
105 setorigin (missile, w_shotorg);
106 //missile.takedamage = DAMAGE_YES;
107 //missile.damageforcescale = 4;
108 //missile.health = 10;
109 //missile.event_damage = W_Hagar_Damage;
111 missile.movetype = MOVETYPE_BOUNCEMISSILE;
112 missile.velocity = (w_shotdir + randomvec() * cvar("g_balance_hagar_secondary_spread")) * cvar("g_balance_hagar_secondary_speed");
113 W_SetupProjectileVelocity(missile);
114 missile.avelocity = '100 10 10';
116 missile.angles = vectoangles (missile.velocity);
117 missile.flags = FL_PROJECTILE;
119 CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR_BOUNCING, TRUE);
122 void spawnfunc_weapon_hagar (void)
124 weapon_defaultspawnfunc(WEP_HAGAR);
127 float w_hagar(float req)
131 self.BUTTON_ATCK = bot_aim(cvar("g_balance_hagar_primary_speed"), 0, cvar("g_balance_hagar_primary_lifetime"), FALSE);
134 // not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming
135 self.BUTTON_ATCK2 = bot_aim(cvar("g_balance_hagar_primary_speed"), 0, cvar("g_balance_hagar_primary_lifetime"), FALSE);
137 else if (req == WR_THINK)
139 if (self.BUTTON_ATCK)
140 if (weapon_prepareattack(0, cvar("g_balance_hagar_primary_refire")))
143 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hagar_primary_refire"), w_ready);
145 if (self.BUTTON_ATCK2)
146 if (weapon_prepareattack(1, cvar("g_balance_hagar_secondary_refire")))
149 weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_hagar_secondary_refire"), w_ready);
152 else if (req == WR_PRECACHE)
154 precache_model ("models/weapons/g_hagar.md3");
155 precache_model ("models/weapons/v_hagar.md3");
156 precache_model ("models/weapons/h_hagar.dpm");
157 precache_sound ("weapons/hagar_fire.wav");
159 else if (req == WR_SETUP)
160 weapon_setup(WEP_HAGAR);
161 else if (req == WR_CHECKAMMO1)
162 return self.ammo_rockets >= cvar("g_balance_hagar_primary_ammo");
163 else if (req == WR_CHECKAMMO2)
164 return self.ammo_rockets >= cvar("g_balance_hagar_secondary_ammo");
165 else if (req == WR_SUICIDEMESSAGE)
166 w_deathtypestring = "played with tiny rockets";
167 else if (req == WR_KILLMESSAGE)
169 if(w_deathtype & HITTYPE_BOUNCE) // must be secondary; unchecked: SPLASH
170 w_deathtypestring = "hoped #'s missiles wouldn't bounce";
171 else // unchecked: SPLASH, SECONDARY
172 w_deathtypestring = "was pummeled by";