Esempio n. 1
0
        /// <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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        /// <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);
        }
Esempio n. 4
0
 internal static void KillEnd(global::Terraria.Projectile projectile) =>
 Hooks.Projectile.PostKilled?.Invoke(projectile);
Esempio n. 5
0
 /// <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);
Esempio n. 6
0
 /// <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);
Esempio n. 7
0
 /// <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);