Beispiel #1
0
        public static void Forge_Post(MeleeWeapon __instance, Item item, bool count_towards_stats, ref bool __result)
        {
            try
            {
                if (!mod.Config.EnchantableScythes || !__instance.isScythe(-1))
                {
                    return;
                }

                if (item is MeleeWeapon other_weapon && other_weapon.type == __instance.type)
                {
                    __instance.appearance.Value = (__instance.IndexOfMenuItemView = other_weapon.getDrawnItemIndex());
                    __result = true;
                    return;
                }

                BaseEnchantment enchantment = BaseEnchantment.GetEnchantmentFromItem(__instance, item);
                if (enchantment != null && __instance.AddEnchantment(enchantment))
                {
                    // deleted diamond case

                    if (count_towards_stats && !enchantment.IsForge())
                    {
                        __instance.previousEnchantments.Insert(0, enchantment.GetName());
                        while (__instance.previousEnchantments.Count > 2)
                        {
                            __instance.previousEnchantments.RemoveAt(__instance.previousEnchantments.Count - 1);
                        }
                        Game1.stats.incrementStat("timesEnchanted", 1);
                    }

                    __result = true;
                    return;
                }

                __result = false;
            }
            catch (Exception e)
            {
                mod.ErrorLog("There was an exception in a patch", e);
            }
        }
Beispiel #2
0
        public override List <Item> getExtraDropItems()
        {
            List <Item> extraDrops = new List <Item>();

            if ((bool)cursedDoll && Game1.random.NextDouble() < 0.1429 && (bool)hauntedSkull)
            {
                switch (Game1.random.Next(11))
                {
                case 0:
                    switch (Game1.random.Next(6))
                    {
                    case 0:
                    {
                        Clothing v2 = new Clothing(10);
                        v2.clothesColor.Value = Color.DimGray;
                        extraDrops.Add(v2);
                        break;
                    }

                    case 1:
                        extraDrops.Add(new Clothing(1004));
                        break;

                    case 2:
                        extraDrops.Add(new Clothing(1014));
                        break;

                    case 3:
                        extraDrops.Add(new Clothing(1263));
                        break;

                    case 4:
                        extraDrops.Add(new Clothing(1262));
                        break;

                    case 5:
                    {
                        Clothing v2 = new Clothing(12);
                        v2.clothesColor.Value = Color.DimGray;
                        extraDrops.Add(v2);
                        break;
                    }
                    }
                    break;

                case 1:
                {
                    MeleeWeapon weapon = new MeleeWeapon(2);
                    weapon.AddEnchantment(new VampiricEnchantment());
                    extraDrops.Add(weapon);
                    break;
                }

                case 2:
                    extraDrops.Add(new Object(288, 1));
                    break;

                case 3:
                    extraDrops.Add(new Ring(534));
                    break;

                case 4:
                    extraDrops.Add(new Ring(531));
                    break;

                case 5:
                    do
                    {
                        extraDrops.Add(new Object(768, 1));
                        extraDrops.Add(new Object(769, 1));
                    }while (Game1.random.NextDouble() < 0.33);
                    break;

                case 6:
                    extraDrops.Add(new Object(581, 1));
                    break;

                case 7:
                    extraDrops.Add(new Object(582, 1));
                    break;

                case 8:
                    extraDrops.Add(new Object(725, 1));
                    break;

                case 9:
                    extraDrops.Add(new Object(86, 1));
                    break;

                case 10:
                    if (Utility.doesMasterPlayerHaveMailReceivedButNotMailForTomorrow("ccVault"))
                    {
                        extraDrops.Add(new Object(275, 1));
                    }
                    else
                    {
                        extraDrops.Add(new Object(749, 1));
                    }
                    break;
                }
                return(extraDrops);
            }
            if ((bool)hauntedSkull && Game1.random.NextDouble() < 0.25 && Game1.currentSeason == "winter")
            {
                do
                {
                    extraDrops.Add(new Object(273, 1));
                }while (Game1.random.NextDouble() < 0.4);
            }
            if ((bool)hauntedSkull && Game1.random.NextDouble() < 0.001502)
            {
                extraDrops.Add(new Object(279, 1));
            }
            if (extraDrops.Count > 0)
            {
                return(extraDrops);
            }
            return(base.getExtraDropItems());
        }