/// <summary> /// This method is injected into the start of the SetDefaults(int) method. /// The return value will dictate if normal vanilla code should continue to run. /// </summary> /// <returns>True to continue on to vanilla code, otherwise false</returns> internal static bool SetDefaultsByIdBegin(global::Terraria.Projectile projectile, ref int Type) { var res = Hooks.Projectile.PreSetDefaultsById?.Invoke(projectile, ref Type); if (res.HasValue) { return(res.Value == HookResult.Continue); } return(true); }
internal static bool KillBegin(global::Terraria.Projectile projectile) { var res = Hooks.Projectile.PreKill?.Invoke(projectile); if (res.HasValue) { return(res.Value == HookResult.Continue); } return(true); }
/// <summary> /// This method is injected into the start of the Update(int) method. /// The return value will dictate if normal vanilla code should continue to run. /// </summary> /// <returns>True to continue on to vanilla code, otherwise false</returns> internal static bool UpdateBegin(global::Terraria.Projectile projectile, ref int i) { var res = Hooks.Projectile.PreUpdate?.Invoke(projectile, ref i); if (res.HasValue) { return(res.Value == HookResult.Continue); } return(true); }
internal static void KillEnd(global::Terraria.Projectile projectile) => Hooks.Projectile.PostKilled?.Invoke(projectile);
/// <summary> /// This method is injected into the end of the SetDefaults(int) method. /// </summary> internal static void SetDefaultsByIdEnd(global::Terraria.Projectile projectile, int Type) => Hooks.Projectile.PostSetDefaultsById?.Invoke(projectile, Type);
/// <summary> /// This method is injected into the end of the Update(int) method. /// </summary> internal static void UpdateEnd(global::Terraria.Projectile projectile, int i) => Hooks.Projectile.PostUpdate?.Invoke(projectile, i);
/// <summary> /// This method is injected into the end of the AI() method. /// </summary> internal static void AIEnd(global::Terraria.Projectile projectile) => Hooks.Projectile.PostAI?.Invoke(projectile);