コード例 #1
0
        public static void InvItem_SetupDetails(InvItem __instance)
        {
            bool debug  = RogueFramework.IsDebugEnabled(DebugFlags.Items);
            bool debug2 = RogueFramework.IsDebugEnabled(DebugFlags.Abilities);

            foreach (IHookFactory <InvItem> factory in RogueFramework.ItemFactories)
            {
                if (factory.TryCreate(__instance, out IHook <InvItem> hook))
                {
                    if (debug2 && hook is CustomAbility)
                    {
                        RogueFramework.LogDebug($"Initializing custom ability {hook} ({__instance.invItemName}).");
                    }
                    else if (debug)
                    {
                        if (hook is CustomItem)
                        {
                            RogueFramework.LogDebug($"Initializing custom item {hook} ({__instance.invItemName}).");
                        }
                        else
                        {
                            RogueFramework.LogDebug($"Initializing item hook {hook} for \"{__instance.invItemName}\".");
                        }
                    }
                    __instance.AddHook(hook);
                }
            }
        }
コード例 #2
0
        public bool CombineItems(InvItem other)
        {
            if (!CombineFilter(other))
            {
                return(false);
            }

            SpicedHook hook = other.GetHook <SpicedHook>() ?? other.AddHook <SpicedHook>();

            hook.IncreaseSpiciness();

            Count--;
            gc.audioHandler.Play(Owner, VanillaAudio.CombineItem);
            return(true);
        }