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"), self.owner, 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_WEAPON_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 if(g_grappling_hook) // offhand hook
63 startitem_failed = TRUE;
67 weapon_defaultspawnfunc(WEP_HOOK);
70 float w_hook(float req)
76 else if (req == WR_THINK)
78 if (self.BUTTON_ATCK || self.BUTTON_HOOK)
81 if not(self.hook_state & HOOK_WAITING_FOR_RELEASE)
82 if (weapon_prepareattack(0, cvar("g_balance_hook_primary_refire")))
84 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
85 self.ammo_cells = self.ammo_cells - cvar("g_balance_hook_primary_ammo");
86 self.hook_state |= HOOK_FIRING;
87 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hook_primary_animtime"), w_ready);
91 if (self.BUTTON_ATCK2)
93 if (weapon_prepareattack(1, cvar("g_balance_hook_secondary_refire")))
96 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hook_secondary_animtime"), w_ready);
100 if (self.BUTTON_CROUCH)
102 self.hook_state (-) HOOK_PULLING;
103 if (self.BUTTON_ATCK || self.BUTTON_HOOK)
104 self.hook_state (-) HOOK_RELEASING;
106 self.hook_state |= HOOK_RELEASING;
110 self.hook_state |= HOOK_PULLING;
111 self.hook_state (-) HOOK_RELEASING;
113 if (self.BUTTON_ATCK || self.BUTTON_HOOK)
117 self.hook_state |= HOOK_WAITING_FOR_RELEASE;
121 self.hook_state |= HOOK_REMOVING;
122 self.hook_state (-) HOOK_WAITING_FOR_RELEASE;
126 else if (req == WR_PRECACHE)
128 precache_model ("models/weapons/g_hookgun.md3");
129 precache_model ("models/weapons/v_hookgun.md3");
130 precache_model ("models/weapons/w_hookgun.zym");
131 precache_sound ("weapons/hook_fire.wav");
132 precache_sound ("weapons/hook_impact.wav");
133 precache_sound ("weapons/hookbomb_fire.wav");
134 precache_sound ("weapons/hookbomb_impact.wav");
136 else if (req == WR_SETUP)
138 weapon_setup(WEP_HOOK);
140 else if (req == WR_CHECKAMMO1)
142 return self.ammo_cells >= cvar("g_balance_hook_primary_ammo");
144 else if (req == WR_CHECKAMMO2)
146 return self.ammo_cells >= cvar("g_balance_hook_secondary_ammo");
148 else if (req == WR_SUICIDEMESSAGE)
149 w_deathtypestring = "did the impossible";
150 else if (req == WR_KILLMESSAGE)
151 w_deathtypestring = "has run into #'s gravity bomb";