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)
25 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
26 self.ammo_cells = self.ammo_cells - cvar("g_balance_hook_secondary_ammo");
27 W_SetupShot (self, '25 6 -8', FALSE, 4, "weapons/hookbomb_fire.wav");
31 gren.classname = "hookbomb";
32 gren.bot_dodge = TRUE;
33 gren.bot_dodgerating = cvar("g_balance_hook_secondary_damage");
34 gren.movetype = MOVETYPE_TOSS;
35 gren.solid = SOLID_BBOX;
36 gren.effects = EF_LOWPRECISION;
37 gren.modelflags = MF_TRACER2;
38 gren.projectiledeathtype = WEP_HOOK | HITTYPE_SECONDARY;
39 setmodel(gren, "models/grenademodel.md3"); // precision set above // FIXME replace
40 setsize(gren, '0 0 0', '0 0 0');
41 setorigin(gren, w_shotorg);
43 gren.nextthink = time + cvar("g_balance_hook_secondary_lifetime");
44 gren.think = adaptor_think2use;
45 gren.use = W_Hook_Explode2;
46 gren.touch = W_Hook_Touch2;
47 gren.velocity = '0 0 1' * cvar("g_balance_hook_secondary_speed");
48 gren.gravity = cvar("g_balance_hook_secondary_gravity");
49 //W_SetupProjectileVelocity(gren); // just falling down!
51 gren.angles = '0 0 0';
52 gren.flags = FL_PROJECTILE;
55 void spawnfunc_weapon_hook (void)
57 if(g_grappling_hook) // offhand hook
59 startitem_failed = TRUE;
63 weapon_defaultspawnfunc(WEP_HOOK);
66 float w_hook(float req)
72 else if (req == WR_THINK)
74 if (self.BUTTON_ATCK || self.BUTTON_HOOK)
77 if not(self.hook_state & HOOK_WAITING_FOR_RELEASE)
78 if (weapon_prepareattack(0, cvar("g_balance_hook_primary_refire")))
80 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
81 self.ammo_cells = self.ammo_cells - cvar("g_balance_hook_primary_ammo");
82 self.hook_state |= HOOK_FIRING;
83 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hook_primary_animtime"), w_ready);
87 if (self.BUTTON_ATCK2)
89 if (weapon_prepareattack(1, cvar("g_balance_hook_secondary_refire")))
92 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hook_secondary_animtime"), w_ready);
96 if (self.BUTTON_CROUCH)
98 self.hook_state (-) HOOK_PULLING;
99 if (self.BUTTON_ATCK || self.BUTTON_HOOK)
100 self.hook_state (-) HOOK_RELEASING;
102 self.hook_state |= HOOK_RELEASING;
106 self.hook_state |= HOOK_PULLING;
107 self.hook_state (-) HOOK_RELEASING;
109 if (self.BUTTON_ATCK || self.BUTTON_HOOK)
113 self.hook_state |= HOOK_WAITING_FOR_RELEASE;
117 self.hook_state |= HOOK_REMOVING;
118 self.hook_state (-) HOOK_WAITING_FOR_RELEASE;
122 else if (req == WR_PRECACHE)
124 precache_model ("models/weapons/g_hookgun.md3");
125 precache_model ("models/weapons/v_hookgun.md3");
126 precache_model ("models/weapons/w_hookgun.zym");
127 precache_sound ("weapons/hook_fire.wav");
128 precache_sound ("weapons/hook_impact.wav");
129 precache_sound ("weapons/hookbomb_fire.wav");
130 precache_sound ("weapons/hookbomb_impact.wav");
132 else if (req == WR_SETUP)
134 weapon_setup(WEP_HOOK);
136 else if (req == WR_CHECKAMMO1)
138 return self.ammo_cells >= cvar("g_balance_hook_primary_ammo");
140 else if (req == WR_CHECKAMMO2)
142 return self.ammo_cells >= cvar("g_balance_hook_secondary_ammo");
144 else if (req == WR_SUICIDEMESSAGE)
145 w_deathtypestring = "did the impossible";
146 else if (req == WR_KILLMESSAGE)
147 w_deathtypestring = "has run into #'s gravity bomb";