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;
37 if(trace_ent && trace_ent.solid > SOLID_TRIGGER) // CSQC doesn't know about these entities well enough
38 UpdateCSQCProjectile(self);
41 void W_Hagar_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
43 self.health = self.health - damage;
45 W_PrepareExplosionByDamage(attacker, self.think);
48 void W_Hagar_Attack (void)
52 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
53 self.ammo_rockets = self.ammo_rockets - cvar("g_balance_hagar_primary_ammo");
54 W_SetupShot (self, '25 5 -8', FALSE, 2, "weapons/hagar_fire.wav");
55 //W_SetupShot (self, '25 8 -8', FALSE, 2, "weapons/hagar_fire.wav"); // TODO: move model a little to the right
57 pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
60 missile.owner = missile.realowner = self;
61 missile.classname = "missile";
62 missile.bot_dodge = TRUE;
63 missile.bot_dodgerating = cvar("g_balance_hagar_primary_damage");
64 missile.touch = W_Hagar_Touch;
65 missile.use = W_Hagar_Explode;
66 missile.think = adaptor_think2use;
67 missile.nextthink = time + cvar("g_balance_hagar_primary_lifetime");
68 missile.solid = SOLID_BBOX;
69 missile.projectiledeathtype = WEP_HAGAR;
70 setorigin (missile, w_shotorg);
71 //missile.takedamage = DAMAGE_YES;
72 //missile.damageforcescale = 4;
73 //missile.health = 10;
74 //missile.event_damage = W_Hagar_Damage;
76 missile.movetype = MOVETYPE_FLY;
77 missile.velocity = (w_shotdir + randomvec() * cvar("g_balance_hagar_primary_spread")) * cvar("g_balance_hagar_primary_speed");
78 W_SetupProjectileVelocity(missile);
80 missile.angles = vectoangles (missile.velocity);
81 missile.flags = FL_PROJECTILE;
83 CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR, TRUE);
86 void W_Hagar_Attack2 (void)
90 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
91 self.ammo_rockets = self.ammo_rockets - cvar("g_balance_hagar_secondary_ammo");
92 W_SetupShot (self, '25 5 -8', FALSE, 2, "weapons/hagar_fire.wav");
93 //W_SetupShot (self, '25 8 -8', FALSE, 2, "weapons/hagar_fire.wav"); // TODO: move model a little to the right
95 pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
98 missile.owner = missile.realowner = self;
99 missile.classname = "missile";
100 missile.bot_dodge = TRUE;
101 missile.bot_dodgerating = cvar("g_balance_hagar_secondary_damage");
102 missile.touch = W_Hagar_Touch2;
104 missile.use = W_Hagar_Explode;
105 missile.think = adaptor_think2use;
106 missile.nextthink = time + cvar("g_balance_hagar_secondary_lifetime");
107 missile.solid = SOLID_BBOX;
108 missile.projectiledeathtype = WEP_HAGAR | HITTYPE_SECONDARY;
109 setorigin (missile, w_shotorg);
110 //missile.takedamage = DAMAGE_YES;
111 //missile.damageforcescale = 4;
112 //missile.health = 10;
113 //missile.event_damage = W_Hagar_Damage;
115 missile.movetype = MOVETYPE_BOUNCEMISSILE;
116 missile.velocity = (w_shotdir + randomvec() * cvar("g_balance_hagar_secondary_spread")) * cvar("g_balance_hagar_secondary_speed");
117 W_SetupProjectileVelocity(missile);
118 missile.avelocity = '100 10 10';
120 missile.angles = vectoangles (missile.velocity);
121 missile.flags = FL_PROJECTILE;
123 CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR_BOUNCING, TRUE);
126 void spawnfunc_weapon_hagar (void)
128 weapon_defaultspawnfunc(WEP_HAGAR);
131 float w_hagar(float req)
135 self.BUTTON_ATCK = bot_aim(cvar("g_balance_hagar_primary_speed"), 0, cvar("g_balance_hagar_primary_lifetime"), FALSE);
138 // not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming
139 self.BUTTON_ATCK2 = bot_aim(cvar("g_balance_hagar_primary_speed"), 0, cvar("g_balance_hagar_primary_lifetime"), FALSE);
141 else if (req == WR_THINK)
143 if (self.BUTTON_ATCK)
144 if (weapon_prepareattack(0, cvar("g_balance_hagar_primary_refire")))
147 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hagar_primary_refire"), w_ready);
149 if (self.BUTTON_ATCK2)
150 if (weapon_prepareattack(1, cvar("g_balance_hagar_secondary_refire")))
153 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hagar_secondary_refire"), w_ready);
156 else if (req == WR_PRECACHE)
158 precache_model ("models/weapons/g_hagar.md3");
159 precache_model ("models/weapons/v_hagar.md3");
160 precache_model ("models/weapons/w_hagar.zym");
161 precache_sound ("weapons/hagar_fire.wav");
163 else if (req == WR_SETUP)
164 weapon_setup(WEP_HAGAR);
165 else if (req == WR_CHECKAMMO1)
166 return self.ammo_rockets >= cvar("g_balance_hagar_primary_ammo");
167 else if (req == WR_CHECKAMMO2)
168 return self.ammo_rockets >= cvar("g_balance_hagar_secondary_ammo");
169 else if (req == WR_SUICIDEMESSAGE)
170 w_deathtypestring = "played with tiny rockets";
171 else if (req == WR_KILLMESSAGE)
173 if(w_deathtype & HITTYPE_BOUNCE) // must be secondary; unchecked: SPLASH
174 w_deathtypestring = "hoped #'s missiles wouldn't bounce";
175 else // unchecked: SPLASH, SECONDARY
176 w_deathtypestring = "was pummeled by";