Example #1
0
        private ItemType(Game game, ItemManager owner, ItemContentCollectionEntry itemInfo)
        {
            _game     = game;
            _owner    = owner;
            _itemInfo = itemInfo;

            HealthPoints       = new StatModifcator();
            HealthRegeneration = new StatModifcator();
            AttackDamage       = new StatModifcator();
            AbilityPower       = new StatModifcator();
            CriticalChance     = new StatModifcator();
            Armor            = new StatModifcator();
            MagicResist      = new StatModifcator();
            AttackSpeed      = new StatModifcator();
            ArmorPenetration = new StatModifcator();
            MagicPenetration = new StatModifcator();
            ManaPoints       = new StatModifcator();
            ManaRegeneration = new StatModifcator();
            LifeSteel        = new StatModifcator();
            SpellVamp        = new StatModifcator();
            Tenacity         = new StatModifcator();
            Size             = new StatModifcator();
            Range            = new StatModifcator();
            MoveSpeed        = new StatModifcator();
            GoldPerSecond    = new StatModifcator();
        }
Example #2
0
        public static ItemType Load(ItemManager owner, ItemContentCollectionEntry itemInfo)
        {
            // Because IntelliSense is nice to have
            var result = new ItemType(owner, itemInfo)
            {
                ItemId           = itemInfo.ItemId,
                Name             = itemInfo.Name,
                MaxStack         = itemInfo.GetInt("Data", "MaxStack"),
                Price            = itemInfo.GetInt("Data", "Price"),
                ItemGroup        = itemInfo.GetString("Data", "ItemGroup"),
                SellBackModifier = itemInfo.GetFloat("Data", "SellBackModifier", 0.7f),

                RecipeItem1 = itemInfo.GetInt("Data", "RecipeItem1", -1),
                RecipeItem2 = itemInfo.GetInt("Data", "RecipeItem2", -1),
                RecipeItem3 = itemInfo.GetInt("Data", "RecipeItem3", -1),
                RecipeItem4 = itemInfo.GetInt("Data", "RecipeItem4", -1)
            };

            result.Armor.FlatBonus          = itemInfo.GetFloat("Data", "FlatArmorMod");
            result.CriticalChance.FlatBonus = itemInfo.GetFloat("Data", "FlatCritChanceMod");
            //itemInfo.SafeGetFloat("Data", "FlatCritDamageMod"); // TODO
            result.HealthPoints.FlatBonus     = itemInfo.GetFloat("Data", "FlatHPPoolMod");
            result.ManaPoints.FlatBonus       = itemInfo.GetFloat("Data", "FlatMPPoolMod");
            result.AbilityPower.FlatBonus     = itemInfo.GetFloat("Data", "FlatMagicDamageMod");
            result.MagicPenetration.FlatBonus = itemInfo.GetFloat("Data", "FlatMagicPenetrationMod");
            result.MoveSpeed.FlatBonus        = itemInfo.GetFloat("Data", "FlatMovementSpeedMod");
            result.AttackDamage.FlatBonus     = itemInfo.GetFloat("Data", "FlatPhysicalDamageMod");
            result.MagicResist.FlatBonus      = itemInfo.GetFloat("Data", "FlatSpellBlockMod");
            result.Armor.PercentBonus         = itemInfo.GetFloat("Data", "PercentArmorMod");
            result.AttackSpeed.FlatBonus      = itemInfo.GetFloat("Data", "PercentAttackSpeedMod");
            //itemInfo.SafeGetFloat("Data", "PercentCritDamageMod"); // TODO
            //itemInfo.SafeGetFloat("Data", "PercentEXPBonus"); // TODO
            result.HealthPoints.PercentBonus       = itemInfo.GetFloat("Data", "PercentHPPoolMod");
            result.HealthRegeneration.PercentBonus = itemInfo.GetFloat("Data", "PercentBaseHPRegenMod");
            result.ManaPoints.PercentBonus         = itemInfo.GetFloat("Data", "PercentMPPoolMod");
            result.ManaRegeneration.PercentBonus   = itemInfo.GetFloat("Data", "PercentBaseMPRegenMod");
            result.AbilityPower.PercentBonus       = itemInfo.GetFloat("Data", "PercentMagicDamageMod");
            result.MoveSpeed.PercentBonus          = itemInfo.GetFloat("Data", "PercentMovementSpeedMod");
            result.AttackDamage.PercentBonus       = itemInfo.GetFloat("Data", "PercentPhysicalDamageMod");
            result.MagicResist.PercentBonus        = itemInfo.GetFloat("Data", "PercentSpellBlockMod");
            result.SpellName = itemInfo.GetString("Data", "SpellName");

            result.CreateRecipe(owner);
            return(result);
        }