tModLoader

tModLoader

Not enough ratings
Grappling Hook Helper
   
Award
Favorite
Favorited
Unfavorite
Mod Features: Library
Mod Side: Both
tModLoader Version: 1.4.4
File Size
Posted
Updated
25.080 KB
May 28, 2024 @ 7:47pm
May 28, 2024 @ 8:21pm
2 Change Notes ( view )

Subscribe to download
Grappling Hook Helper

Description
A helper/library mod designed exclusively to assist in modifying grappling hook stats! Note that because this is a library mod, it does NOT add any new content.
The main feature of this mod is the new "HookPlayer", a ModPlayer with three stats that can be modified by any mod- hookRange, hookSpeed, and extraHooks.

How To Use:
First, any modder intending to use this mod will need to add this line to their build.txt file:
modReferences = GrappleHelper
If you're using Visual Studio or Visual Studio Code, you'll probably want to add this mod's DLL file to your project, which you can get by extracting this mod from the mod menu in-game!
Once you have a reference to this mod, you can access HookPlayer in any file like so:
using GrappleHelper; namespace MyExampleMod { public class ExampleHookAccessory : ModItem { public override void UpdateAccessory(Player player, bool hideVisual) { HookPlayer hPlr = player.GetModPlayer<HookPlayer>(); hPlr.hookRange += 0.5f; // Adds +50% grappling hook range hPlr.hookSpeed += 1f; // Adds +100% grappling hook speed hPlr.extraHooks += 2; // Allows the player to have two extra hooks out at once } } }

Mod Calls:
This mod currently has four mod calls, one intended to be used by mods which edit the number of hooks a vanilla grappling hook can have out at once, and the others intended to be used by mods looking to access the stats from this mod without using it as a dependency:
Call("EditHookCounts", int hookType, int numBaseHooks)
Given a vanilla hook's ID and amount of hooks, updates a dictionary of vanilla hooks with the new base stats for the vanilla hook. This is especially important for single-use hooks like the gem hooks, as they rely on having an accurate base value in order to update ProjectileID.Sets.SingleGrappleHook and to kill old hooks when too many are spawned (since vanilla seems to only do this for multi-use hooks).
Call("GetHookRange", Player player)
Call("GetHookSpeed", Player player)
Call("GetNumHooks", Player player)
Given a player instance, returns that player's hookRange, hookSpeed, or numHooks. Useful for modders looking to access these stats without using this mod as a required dependency! There are no mod calls that support modifying these stats, since at that point you'd be better off using this mod as a dependency.
Originally posted by tModLoader:
Developed By Lurrae & Snek