当前位置: 首页>>代码示例>>C#>>正文


C# FileFormats.ItemTable类代码示例

本文整理汇总了C#中Mooege.Common.MPQ.FileFormats.ItemTable的典型用法代码示例。如果您正苦于以下问题:C# ItemTable类的具体用法?C# ItemTable怎么用?C# ItemTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ItemTable类属于Mooege.Common.MPQ.FileFormats命名空间,在下文中一共展示了ItemTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ApplyAttributeSpecifier

        private void ApplyAttributeSpecifier(ItemTable definition)
        {
            foreach (var effect in definition.Attribute)
            {
                float result;
                if (FormulaScript.Evaluate(effect.Formula.ToArray(), this.RandomGenerator, out result))
                {
                    //Logger.Debug("Randomized value for attribute " + GameAttribute.Attributes[effect.AttributeId].Name + " is " + result);

                    if (GameAttribute.Attributes[effect.AttributeId] is GameAttributeF)
                    {
                        var attr = GameAttribute.Attributes[effect.AttributeId] as GameAttributeF;
                        if (effect.SNOParam != -1)
                            Attributes[attr, effect.SNOParam] += result;
                        else
                            Attributes[attr] += result;
                    }
                    else if (GameAttribute.Attributes[effect.AttributeId] is GameAttributeI)
                    {
                        var attr = GameAttribute.Attributes[effect.AttributeId] as GameAttributeI;
                        if (effect.SNOParam != -1)
                            Attributes[attr, effect.SNOParam] += (int)result;
                        else
                            Attributes[attr] += (int)result;
                    }
                }
            }
        }
开发者ID:angerwin,项目名称:d3sharp,代码行数:28,代码来源:Item.cs

示例2: ApplyDurability

 private void ApplyDurability(ItemTable definition)
 {
     if (definition.DurabilityMin > 0)
     {
         int durability = definition.DurabilityMin + RandomHelper.Next(definition.DurabilityDelta);
         Attributes[GameAttribute.Durability_Cur] = durability;
         Attributes[GameAttribute.Durability_Max] = durability;
     }
 }
开发者ID:angerwin,项目名称:d3sharp,代码行数:9,代码来源:Item.cs

示例3: ApplySkills

 private void ApplySkills(ItemTable definition)
 {
     if (definition.SNOSkill0 != -1)
     {
         Attributes[GameAttribute.Skill, definition.SNOSkill0] = 1;
     }
     if (definition.SNOSkill1 != -1)
     {
         Attributes[GameAttribute.Skill, definition.SNOSkill1] = 1;
     }
     if (definition.SNOSkill2 != -1)
     {
         Attributes[GameAttribute.Skill, definition.SNOSkill2] = 1;
     }
     if (definition.SNOSkill3 != -1)
     {
         Attributes[GameAttribute.Skill, definition.SNOSkill3] = 1;
     }
 }
开发者ID:angerwin,项目名称:d3sharp,代码行数:19,代码来源:Item.cs

示例4: ApplyWeaponSpecificOptions

        private void ApplyWeaponSpecificOptions(ItemTable definition)
        {
            if (definition.WeaponDamageMin > 0)
            {
                Attributes[GameAttribute.Attacks_Per_Second_Item] += definition.AttacksPerSecond;
                Attributes[GameAttribute.Attacks_Per_Second_Item_Subtotal] += definition.AttacksPerSecond;
                Attributes[GameAttribute.Attacks_Per_Second_Item_Total] += definition.AttacksPerSecond;

                Attributes[GameAttribute.Damage_Weapon_Min, 0] += definition.WeaponDamageMin;
                Attributes[GameAttribute.Damage_Weapon_Min_Total, 0] += definition.WeaponDamageMin;

                Attributes[GameAttribute.Damage_Weapon_Delta, 0] += definition.WeaponDamageDelta;
                Attributes[GameAttribute.Damage_Weapon_Delta_SubTotal, 0] += definition.WeaponDamageDelta;
                Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0] += definition.WeaponDamageDelta;

                Attributes[GameAttribute.Damage_Weapon_Max, 0] += Attributes[GameAttribute.Damage_Weapon_Min, 0] + Attributes[GameAttribute.Damage_Weapon_Delta, 0];
                Attributes[GameAttribute.Damage_Weapon_Max_Total, 0] += Attributes[GameAttribute.Damage_Weapon_Min_Total, 0] + Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0];

                Attributes[GameAttribute.Damage_Weapon_Min_Total_All] = definition.WeaponDamageMin;
                Attributes[GameAttribute.Damage_Weapon_Delta_Total_All] = definition.WeaponDamageDelta;
            }
        }
开发者ID:angerwin,项目名称:d3sharp,代码行数:22,代码来源:Item.cs

示例5: ApplyArmorSpecificOptions

 private void ApplyArmorSpecificOptions(ItemTable definition)
 {
     if (definition.ArmorValue > 0)
     {
         Attributes[GameAttribute.Armor_Item] += definition.ArmorValue;
         Attributes[GameAttribute.Armor_Item_SubTotal] += definition.ArmorValue;
         Attributes[GameAttribute.Armor_Item_Total] += definition.ArmorValue;
     }
 }
开发者ID:angerwin,项目名称:d3sharp,代码行数:9,代码来源:Item.cs

示例6: HealthPotion

 public HealthPotion(Map.World world, ItemTable definition)
     : base(world, definition)
 {
 }
开发者ID:ncoop23,项目名称:mooege,代码行数:4,代码来源:HealthPotion.cs

示例7: Item

        public Item(GS.Map.World world, ItemTable definition)
            : base(world, definition.SNOActor)
        {
            this.ItemDefinition = definition;

            this.GBHandle.Type = (int)GBHandleType.Gizmo;
            this.GBHandle.GBID = definition.Hash;
            this.ItemType = ItemGroup.FromHash(definition.ItemType1);
            this.EquipmentSlot = 0;
            this.InventoryLocation = new Vector2D { X = 0, Y = 0 };
            this.Scale = 1.0f;
            this.FacingAngle = 0.0f;
            this.RotationAxis.Set(0.0f, 0.0f, 1.0f);
            this.CurrentState = ItemState.Normal;
            this.Field2 = 0x00000000;
            this.Field7 = 0;
            this.NameSNOId = -1;      // I think it is ignored anyways - farmy
            this.Field10 = 0x00;

            this.ItemLevel = definition.ItemLevel;

            // level requirement
            // Attributes[GameAttribute.Requirement, 38] = definition.RequiredLevel;

            Attributes[GameAttribute.Item_Quality_Level] = 1;
            if (Item.IsArmor(this.ItemType) || Item.IsWeapon(this.ItemType)|| Item.IsOffhand(this.ItemType))
                Attributes[GameAttribute.Item_Quality_Level] = RandomHelper.Next(6);
            if(this.ItemType.Flags.HasFlag(ItemFlags.AtLeastMagical) && Attributes[GameAttribute.Item_Quality_Level] < 3)
                Attributes[GameAttribute.Item_Quality_Level] = 3;

            Attributes[GameAttribute.ItemStackQuantityLo] = 1;
            Attributes[GameAttribute.Seed] = RandomHelper.Next(); //unchecked((int)2286800181);

            RandomGenerator = new ItemRandomHelper(Attributes[GameAttribute.Seed]);
            RandomGenerator.Next();
            if (Item.IsArmor(this.ItemType))
                RandomGenerator.Next(); // next value is used but unknown if armor
            RandomGenerator.ReinitSeed();

            ApplyWeaponSpecificOptions(definition);
            ApplyArmorSpecificOptions(definition);
            ApplyDurability(definition);
            ApplySkills(definition);
            ApplyAttributeSpecifier(definition);

            int affixNumber = 1;
            if (Attributes[GameAttribute.Item_Quality_Level] >= 3)
                affixNumber = Attributes[GameAttribute.Item_Quality_Level] - 2;
            AffixGenerator.Generate(this, affixNumber);
        }
开发者ID:angerwin,项目名称:d3sharp,代码行数:50,代码来源:Item.cs

示例8: CreateItem

        // Creates an item based on supplied definition.
        public static Item CreateItem(Mooege.Core.GS.Actors.Actor owner, ItemTable definition)
        {
            // Logger.Trace("Creating item: {0} [sno:{1}, gbid {2}]", definition.Name, definition.SNOActor, StringHashHelper.HashItemName(definition.Name));

            Type type = GetItemClass(definition);

            var item = (Item)Activator.CreateInstance(type, new object[] { owner.World, definition });

            return item;
        }
开发者ID:ralje,项目名称:mooege,代码行数:11,代码来源:ItemGenerator.cs

示例9: Item

        public Item(GS.Map.World world, ItemTable definition)
            : base(world, definition.SNOActor)
        {
            this.ItemDefinition = definition;

            this.GBHandle.Type = (int)GBHandleType.Gizmo;
            this.GBHandle.GBID = definition.Hash;
            this.ItemType = ItemGroup.FromHash(definition.ItemType1);
            this.EquipmentSlot = 0;
            this.InventoryLocation = new Vector2D { X = 0, Y = 0 };
            this.Scale = 1.0f;
            this.RotationAmount = 0.0f;
            this.RotationAxis.Set(0.0f, 0.0f, 1.0f);

            this.Field2 = 0x00000000;
            this.Field3 = 0x00000000;
            this.Field7 = 0;
            this.Field8 = 0;
            this.Field9 = 0x00000000;
            this.Field10 = 0x00;

            this.ItemLevel = definition.ItemLevel;

            // level requirement
            // Attributes[GameAttribute.Requirement, 38] = definition.RequiredLevel;

            Attributes[GameAttribute.Item_Quality_Level] = 1;
            if (Item.IsArmor(this.ItemType) || Item.IsWeapon(this.ItemType)|| Item.IsOffhand(this.ItemType))
                Attributes[GameAttribute.Item_Quality_Level] = RandomHelper.Next(6);
            if(this.ItemType.Flags.HasFlag(ItemFlags.AtLeastMagical) && Attributes[GameAttribute.Item_Quality_Level] < 3)
                Attributes[GameAttribute.Item_Quality_Level] = 3;

            Attributes[GameAttribute.Seed] = RandomHelper.Next(); //unchecked((int)2286800181);

            /*
            List<IItemAttributeCreator> attributeCreators = new AttributeCreatorFactory().Create(this.ItemType);
            foreach (IItemAttributeCreator creator in attributeCreators)
            {
                creator.CreateAttributes(this);
            }
            */

            RandomGenerator = new ItemRandomHelper(Attributes[GameAttribute.Seed]);
            RandomGenerator.Next();
            if (Item.IsArmor(this.ItemType))
                RandomGenerator.Next(); // next value is used but unknown if armor
            RandomGenerator.ReinitSeed();

            ApplyWeaponSpecificOptions(definition);
            ApplyArmorSpecificOptions(definition);
            ApplyDurability(definition);
            ApplySkills(definition);
            ApplyAttributeSpecifier(definition);

            int affixNumber = 1;
            if (Attributes[GameAttribute.Item_Quality_Level] >= 3)
                affixNumber = Attributes[GameAttribute.Item_Quality_Level] - 2;
            AffixGenerator.Generate(this, affixNumber);
        }
开发者ID:ripper47,项目名称:mooege,代码行数:59,代码来源:Item.cs

示例10: CookFromDefinition

        // Allows cooking a custom item.
        public static Item CookFromDefinition(Player player, ItemTable definition)
        {
            Type type = GetItemClass(definition);

            var item = (Item)Activator.CreateInstance(type, new object[] { player.World, definition });
            //player.GroundItems[item.DynamicID] = item;

            return item;
        }
开发者ID:Im2ortal,项目名称:mooege,代码行数:10,代码来源:ItemGenerator.cs

示例11: GetItemClass

        public static Type GetItemClass(ItemTable definition)
        {
            Type type = typeof(Item);

            if (GBIDHandlers.ContainsKey(definition.Hash))
            {
                type = GBIDHandlers[definition.Hash];
            }
            else
            {
                foreach (var hash in ItemGroup.HierarchyToHashList(ItemGroup.FromHash(definition.ItemType1)))
                {
                    if (TypeHandlers.ContainsKey(hash))
                    {
                        type = TypeHandlers[hash];
                        break;
                    }
                }
            }

            return type;
        }
开发者ID:ralje,项目名称:mooege,代码行数:22,代码来源:ItemGenerator.cs

示例12: Potion

 public Potion(Map.World world, ItemTable definition)
     : base(world, definition)
 {
     Attributes[GameAttribute.ItemStackQuantityLo] = 1;
 }
开发者ID:loonbg,项目名称:mooege,代码行数:5,代码来源:Potion.cs

示例13: Item

        public Item(GS.Map.World world, ItemTable definition)
            : base(world, definition.SNOActor)
        {
            SetInitialValues(definition);
            this.ItemHasChanges = true;//initial, this is set to true.
            // level requirement
            // Attributes[GameAttribute.Requirement, 38] = definition.RequiredLevel;

            Attributes[GameAttribute.Item_Quality_Level] = 1;
            if (Item.IsArmor(this.ItemType) || Item.IsWeapon(this.ItemType) || Item.IsOffhand(this.ItemType))
                Attributes[GameAttribute.Item_Quality_Level] = RandomHelper.Next(6);
            if (this.ItemType.Flags.HasFlag(ItemFlags.AtLeastMagical) && Attributes[GameAttribute.Item_Quality_Level] < 3)
                Attributes[GameAttribute.Item_Quality_Level] = 3;

            Attributes[GameAttribute.ItemStackQuantityLo] = 1;
            Attributes[GameAttribute.Seed] = RandomHelper.Next(); //unchecked((int)2286800181);

            RandomGenerator = new ItemRandomHelper(Attributes[GameAttribute.Seed]);
            RandomGenerator.Next();
            if (Item.IsArmor(this.ItemType))
                RandomGenerator.Next(); // next value is used but unknown if armor
            RandomGenerator.ReinitSeed();

            ApplyWeaponSpecificOptions(definition);
            ApplyArmorSpecificOptions(definition);
            ApplyDurability(definition);
            ApplySkills(definition);
            ApplyAttributeSpecifier(definition);

            int affixNumber = 1;
            if (Attributes[GameAttribute.Item_Quality_Level] >= 3)
                affixNumber = Attributes[GameAttribute.Item_Quality_Level] - 2;
            AffixGenerator.Generate(this, affixNumber);
        }
开发者ID:loonbg,项目名称:mooege,代码行数:34,代码来源:Item.cs

示例14: SetInitialValues

        private void SetInitialValues(ItemTable definition)
        {
            this.ItemDefinition = definition;
            this.ItemLevel = definition.ItemLevel;
            this.GBHandle.Type = (int)GBHandleType.Gizmo;
            this.GBHandle.GBID = definition.Hash;
            this.ItemType = ItemGroup.FromHash(definition.ItemType1);
            this.EquipmentSlot = 0;
            this.InventoryLocation = new Vector2D { X = 0, Y = 0 };
            this.Scale = 1.0f;
            this.RotationW = 0.0f;
            this.RotationAxis.Set(0.0f, 0.0f, 1.0f);
            this.CurrentState = ItemState.Normal;
            this.Field2 = 0x00000000;
            this.Field7 = 0;
            this.NameSNOId = -1;      // I think it is ignored anyways - farmy
            this.Field10 = 0x00;






        }
开发者ID:loonbg,项目名称:mooege,代码行数:24,代码来源:Item.cs

示例15: CreateItem

        // Creates an item based on supplied definition.
        public static Item CreateItem(Mooege.Core.GS.Actors.Actor owner, ItemTable definition)
        {
            // Logger.Trace("Creating item: {0} [sno:{1}, gbid {2}]", definition.Name, definition.SNOActor, StringHashHelper.HashItemName(definition.Name));

            var item = new Item(owner.World, definition);

            return item;
        }
开发者ID:fengjz1,项目名称:mooege,代码行数:9,代码来源:ItemGenerator.cs


注:本文中的Mooege.Common.MPQ.FileFormats.ItemTable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。