Exemple #1
0
 public HoodItem(ItemRarities rarity, double look = -1) : base(rarity, ItemTypes.Hood, "hood")
 {
     look = look < 0 ? Globals.Random.NextDouble() : look;
     if (look < 0.95)
     {
         AnimationFile = "Zerds/bare-head.png";
         Name          = $"{Rarity} Headband";
     }
     else
     {
         AnimationFile = "Zerds/red-hood.png";
         Name          = $"{Rarity} Red Hood";
     }
 }
Exemple #2
0
 public RobeItem(ItemRarities rarity, double color = -1, double itemType = -1) : base(rarity, ItemTypes.Robe, "robe")
 {
     color = color < 0 ? Globals.Random.NextDouble() : color;
     if (color < 0.25)
     {
         Name          = $"{rarity} Red Robe";
         AnimationFile = "Zerds/red-robe.png";
     }
     else if (color < 0.5)
     {
         Name          = $"{rarity} Blue Robe";
         AnimationFile = "Zerds/blue-robe.png";
     }
     else if (color < 0.7)
     {
         Name          = $"{rarity} Green Robe";
         AnimationFile = "Zerds/green-robe.png";
     }
     else if (color < 0.9)
     {
         Name          = $"{rarity} Purple Robe";
         AnimationFile = "Zerds/purple-robe.png";
     }
     else
     {
         Name          = $"{rarity} Dark Robe";
         AnimationFile = "Zerds/dark-robe.png";
     }
     itemType = itemType < 0 ? Globals.Random.NextDouble() : itemType;
     if (itemType < 0.5)
     {
         _chestItemType      = ChestType.Knockback;
         KnockbackReduction  = 0.05f + 0.03f * (int)rarity;
         KnockbackReduction *= 0.9f + (float)Globals.Random.NextDouble() * 0.2f;
     }
     else
     {
         _chestItemType = ChestType.Thorns;
         Thorns         = 1 + (int)rarity;
         if (itemType < 0.65)
         {
             Thorns++;
         }
         else if (itemType < 0.8 && Thorns > 1)
         {
             Thorns--;
         }
     }
 }
Exemple #3
0
        public GloveItem(ItemRarities rarity, double look = -1) : base(rarity, ItemTypes.Glove, "hands")
        {
            look = look < 0 ? Globals.Random.NextDouble() : look;
            if (look < 0.95)
            {
                AnimationFile = "Zerds/bare-hands.png";
                Name          = $"{Rarity} Wraps";
            }
            else
            {
                AnimationFile = "Zerds/red-hands.png";
                Name          = $"{Rarity} Devil Hands";
            }

            SpellDamage = (int)Helpers.RandomInRange(7, 11) + (int)rarity;
        }
Exemple #4
0
        // Use this for initialization
        new void Start()
        {
            base.Start();
            Stats.ItemLevel = (int)Random.Range(ItemLevelMin, ItemLevelMax + 1);
            Prefix          = ItemPSTables.GetMeleePrefix();
            if (Prefix.Name != "" && Random.Range(0f, 1f) < PrefixChance)
            {
                UIName = Prefix.Name + " ";
                Stats += Prefix.StatChanges;
            }
            UIName += PossibleNames[UnityEngine.Random.Range(0, PossibleNames.Length)];

            if (Stats.ItemLevel <= 0)
            {
                Rarity = ItemRarities.Junk;
            }
            else if (Stats.ItemLevel < 10)
            {
                Rarity = ItemRarities.Common;
            }
            else if (Stats.ItemLevel < 35)
            {
                Rarity = ItemRarities.Uncommon;
            }
            else if (Stats.ItemLevel < 70)
            {
                Rarity = ItemRarities.Rare;
            }
            else if (Stats.ItemLevel < 90)
            {
                Rarity = ItemRarities.Epic;
            }
            else if (Stats.ItemLevel >= 90)
            {
                Rarity = ItemRarities.Legendary;
            }

            float effectiveItemLevel = Stats.ItemLevel - ((ItemLevelMin + ItemLevelMax) / 2);

            Stats.Damage      += Stats.Damage * effectiveItemLevel * 0.05f;
            Stats.AttackSpeed += Stats.AttackSpeed * effectiveItemLevel * 0.002f;
        }
Exemple #5
0
        public static Color GetItemColor(ItemRarities rarity)
        {
            switch (rarity)
            {
                case ItemRarities.Common:
                    return Color.Gray;
                case ItemRarities.Uncommon:
                    return Color.White;
                case ItemRarities.Rare:
                    return Color.MediumAquamarine;
                case ItemRarities.Heroic:
                    return Color.CornflowerBlue;
                case ItemRarities.Epic:
                    return Color.MediumPurple;
                case ItemRarities.Legendary:
                    return Color.Orange;
            }

            return Color.White;
        }
Exemple #6
0
        protected Item(ItemRarities rarity, ItemTypes type, string folder)
        {
            Rarity          = rarity;
            Type            = type;
            SkillUpgrades   = new List <SkillUpgrade>();
            AbilityUpgrades = new List <AbilityUpgrade>();
            for (var i = 0; i < (int)rarity; i++)
            {
                AbilityUpgrades.Add(AbilityUpgradeHelper.GetRandomUpgrade(true));
            }
            string iconName;

            switch (rarity)
            {
            case ItemRarities.Novice:
                iconName = "novice.png";
                break;

            case ItemRarities.Apprentice:
                iconName = "apprentice.png";
                break;

            case ItemRarities.Adept:
                iconName = "adept.png";
                break;

            case ItemRarities.Master:
                iconName = "master.png";
                break;

            case ItemRarities.Legendary:
                iconName = "legend.png";
                break;

            default:
                throw new Exception("Unknown icon rarity");
            }
            Texture = TextureCacheFactory.GetOnce($"Items/{folder}/{iconName}");
        }
Exemple #7
0
        public ItemDefinition Generate(int itemLevel, ItemSlots slot, ItemRarities rarity)
        {
            var armorClass = randomizer.Next<ItemArmorClasses>();

            var item = new ItemDefinition();
            item.Level = itemLevel;
            item.Rarity = rarity;
            item.Quality = ItemQualities.Superior;
            item.Slot = slot;
            item.ArmorClass = armorClass;

            var slotName = ItemSlotHelper.ItemSlotNames[(int)slot, (int)armorClass];
            var slotModifier = ItemSlotHelper.ItemSlotModifier[(int)slot];

            var itemLevelMultiplier = (float)(Math.Pow(2, (double)itemLevel / 10.0)) * 0.5f;
            var armorClassHealthMultiplier = (float)(armorClass == ItemArmorClasses.Plate ? 4 : 1);
            var armorClassArmorMultipler = (float)Math.Pow(2, (int)armorClass);

            //var baseStatistics = new Statistics();
            //baseStatistics.Add(new Health(itemLevelMultiplier * armorClassHealthMultiplier * slotModifier * 25));
            //baseStatistics.Add(new DamageReduction { ArmorRating = (int)(itemLevelMultiplier * armorClassArmorMultipler * slotModifier * 25)});
            item.Statistics.Add(new StatDefinition(typeof(Health)));
            item.Statistics.Add(new StatDefinition(typeof(Armor)));

            if (rarity > ItemRarities.Common)
            {
                var prefix = string.Empty;
                var suffix = string.Empty;
                //var statistics = new Statistics();

                for (int i = (int)rarity + 1; i > 0;)
                {
                    var modifier = randomizer.From(ItemModifier.AllModifiers.Where(m => m.Rank <= i && m.Slots.Contains(slot) && m.ArmorClasses.Contains(armorClass)).ToArray());

                    if (string.IsNullOrEmpty(prefix))
                        prefix = modifier.Prefix;
                    else if (string.IsNullOrEmpty(suffix))
                        suffix = modifier.Suffix;

                    //statistics = statistics + modifier.Statistics * itemLevelMultiplier * slotModifier * 6.25f;

                    foreach (var stat in modifier.Statistics)
                    {
                        var statType = stat.GetType();
                        if (!item.Statistics.Any(x => x.StatType == statType))
                            item.Statistics.Add(new StatDefinition(statType));
                    }

                    i -= modifier.Rank;
                }

                //item.Statistics = baseStatistics + statistics;
                item.Name = string.Format("{0} {1} {2}", prefix, slotName, suffix);
            }
            else
            {
                var quality = randomizer.Next<ItemQualities>();
                item.Name = quality.ToString() + " " + slotName;
                item.Quality = quality;
            }

            return item;
        }
Exemple #8
0
        public BootItem(ItemRarities rarity) : base(rarity, ItemTypes.Boots, "boots")
        {
            AnimationFile = "Zerds/bare-feet.png";
            Name          = $"{Rarity} Boots";

            SprintBonus         = 175;
            SprintManaPerSecond = 15;
            Speed = 200;
            var ran = Globals.Random.NextDouble();

            if (ran < 0.2)
            {
                SprintBonus         += 25;
                SprintManaPerSecond += 5;
                Speed += 5;
            }
            else if (ran < 0.4)
            {
                SprintBonus         += 50;
                SprintManaPerSecond += 7;
                Speed += 5;
            }
            else if (ran < 0.48)
            {
                SprintBonus         -= 10;
                SprintManaPerSecond -= 5;
                Speed += 15;
            }
            else if (ran < 0.48)
            {
                SprintBonus         -= 10;
                SprintManaPerSecond -= 5;
                Speed -= 10;
            }
            else if (ran < 0.7)
            {
                SprintBonus         -= 50;
                SprintManaPerSecond -= 7;
                Speed -= 5;
            }
            else if (ran < 0.8)
            {
                SprintBonus         -= 65;
                SprintManaPerSecond -= 6;
            }
            else if (ran < 0.85)
            {
                SprintBonus         -= 80;
                SprintManaPerSecond -= 10;
                Speed += 5;
            }
            else if (ran < 0.9)
            {
                SprintBonus         += 100;
                SprintManaPerSecond += 11;
                Speed -= 50;
            }
            ran = Globals.Random.NextDouble();
            if (ran < 0.15)
            {
                SprintManaPerSecond--;
            }
            else if (ran < 0.3)
            {
                SprintManaPerSecond++;
            }

            Speed += 5 * (int)rarity;
        }
Exemple #9
0
 public WandItem(ItemRarities rarity) : base(rarity, ItemTypes.Wand, "wand")
 {
     Name = $"{Rarity} Wand";
 }