1 void W_Hook_Explode2 (void)
5 org2 = findbetterlocation (self.origin, 12);
6 pointparticles(particleeffectnum("hookbomb_explode"), org2, '0 0 0', 1);
7 sound (self, CHAN_PROJECTILE, "weapons/hookbomb_impact.wav", VOL_BASE, ATTN_NORM);
9 self.event_damage = SUB_Null;
10 RadiusDamage (self, self.owner, cvar("g_balance_hook_secondary_damage"), cvar("g_balance_hook_secondary_edgedamage"), cvar("g_balance_hook_secondary_radius"), world, cvar("g_balance_hook_secondary_force"), self.projectiledeathtype, other);
15 void W_Hook_Touch2 (void)
17 if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
29 if not(self.items & IT_UNLIMITED_AMMO)
30 self.ammo_cells = self.ammo_cells - cvar("g_balance_hook_secondary_ammo");
31 W_SetupShot (self, '25 6 -8', FALSE, 4, "weapons/hookbomb_fire.wav");
35 gren.classname = "hookbomb";
36 gren.bot_dodge = TRUE;
37 gren.bot_dodgerating = cvar("g_balance_hook_secondary_damage");
38 gren.movetype = MOVETYPE_TOSS;
39 gren.solid = SOLID_BBOX;
40 gren.effects = EF_LOWPRECISION;
41 gren.modelflags = MF_TRACER2;
42 gren.projectiledeathtype = WEP_HOOK | HITTYPE_SECONDARY;
43 setmodel(gren, "models/grenademodel.md3"); // precision set above // FIXME replace
44 setsize(gren, '0 0 0', '0 0 0');
45 setorigin(gren, w_shotorg);
47 gren.nextthink = time + cvar("g_balance_hook_secondary_lifetime");
48 gren.think = adaptor_think2use;
49 gren.use = W_Hook_Explode2;
50 gren.touch = W_Hook_Touch2;
51 gren.velocity = '0 0 1' * cvar("g_balance_hook_secondary_speed");
52 gren.gravity = cvar("g_balance_hook_secondary_gravity");
53 //W_SetupProjectileVelocity(gren); // just falling down!
55 gren.angles = '0 0 0';
56 gren.flags = FL_PROJECTILE;
59 void spawnfunc_weapon_hook (void)
61 weapon_defaultspawnfunc(WEP_HOOK);
64 float w_hook(float req)
70 else if (req == WR_THINK)
72 if (self.BUTTON_ATCK || self.BUTTON_HOOK)
75 if not(self.hook_state & HOOK_WAITING_FOR_RELEASE)
76 if (weapon_prepareattack(0, cvar("g_balance_hook_primary_refire")))
78 if not(self.items & IT_UNLIMITED_AMMO)
79 self.ammo_cells = self.ammo_cells - cvar("g_balance_hook_primary_ammo");
80 self.hook_state |= HOOK_FIRING;
81 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hook_primary_animtime"), w_ready);
85 if (self.BUTTON_ATCK2)
87 if (weapon_prepareattack(1, cvar("g_balance_hook_secondary_refire")))
90 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hook_secondary_animtime"), w_ready);
94 if (self.BUTTON_CROUCH)
96 self.hook_state (-) HOOK_PULLING;
97 if (self.BUTTON_ATCK || self.BUTTON_HOOK)
98 self.hook_state (-) HOOK_RELEASING;
100 self.hook_state |= HOOK_RELEASING;
104 self.hook_state |= HOOK_PULLING;
105 self.hook_state (-) HOOK_RELEASING;
107 if (self.BUTTON_ATCK || self.BUTTON_HOOK)
111 self.hook_state |= HOOK_WAITING_FOR_RELEASE;
115 self.hook_state |= HOOK_REMOVING;
116 self.hook_state (-) HOOK_WAITING_FOR_RELEASE;
120 else if (req == WR_PRECACHE)
122 precache_model ("models/weapons/g_hook.md3");
123 precache_model ("models/weapons/v_hook.md3");
124 precache_model ("models/weapons/w_hook.zym");
125 precache_sound ("weapons/hook_fire.wav");
126 precache_sound ("weapons/hook_impact.wav");
127 precache_sound ("weapons/hookbomb_fire.wav");
128 precache_sound ("weapons/hookbomb_impact.wav");
130 else if (req == WR_SETUP)
132 weapon_setup(WEP_HOOK);
134 else if (req == WR_CHECKAMMO1)
136 return self.ammo_cells >= cvar("g_balance_hook_primary_ammo");
138 else if (req == WR_CHECKAMMO2)
140 return self.ammo_cells >= cvar("g_balance_hook_secondary_ammo");
142 else if (req == WR_SUICIDEMESSAGE)
143 w_deathtypestring = "did the impossible";
144 else if (req == WR_KILLMESSAGE)
145 w_deathtypestring = "has run into #'s gravity bomb";