예제 #1
0
        public ItemDefinition(string name, string key, string iconKey, string meshKey, string textureKey, EquipmentSlot slot, int durability, int power, int hours, int value,
                              int actions, ItemType type, ItemHardnessAllowed hardness, ItemNameFormat format,
                              WeaponData weapon, AmmoData ammo, WearableData armor, AccessoryData accessory, IngredientData ingredient, UsableData usable,
                              Vector3 portraitRotation, Vector3 worldRotation, Vector3 portraitPosition, Vector3 worldPosition, string particleEffect)
        {
            Name        = name;
            Key         = key;
            Description = "empty";

            Type                = type;
            NameFormat          = format;
            IconKey             = iconKey;
            MeshKey             = meshKey;
            TextureKey          = textureKey;
            this.particleEffect = particleEffect;
            Value               = value;

            Actions       = actions;
            BasePower     = power;
            BaseBuildTime = hours;
            Slot          = slot;
            DurabilityMax = durability;
            Hardness      = hardness;

            if (weapon != null)
            {
                WeaponData = new WeaponData(weapon);
            }
            else
            {
                WeaponData = null;
            }

            if (ammo != null)
            {
                AmmoData = new AmmoData(ammo);
            }
            else
            {
                AmmoData = null;
            }

            if (armor != null)
            {
                WearableData = new WearableData(armor);
            }
            else
            {
                WearableData = null;
            }

            if (accessory != null)
            {
                AccessoryData = new AccessoryData(accessory);
            }
            else
            {
                AccessoryData = null;
            }

            if (ingredient != null)
            {
                IngredientData = new IngredientData(ingredient);
            }
            else
            {
                IngredientData = null;
            }

            if (usable != null)
            {
                UsableData = new UsableData(usable);
            }
            else
            {
                UsableData = null;
            }

            SkillRequirements = new List <SkillRequirement>();
            SetTooltipText();

            this.portraitRotation = portraitRotation;
            this.portraitPosition = portraitPosition;

            this.worldRotation = worldRotation;
            this.worldPosition = worldPosition;
        }
예제 #2
0
        public ItemData(ItemDefinition def, int stack_size)
        {
            Name       = def.Name;
            Key        = def.Key;
            Type       = def.Type;
            NameFormat = def.NameFormat;

            IconKey        = def.IconKey;
            MeshKey        = def.MeshKey;
            TextureKey     = def.TextureKey;
            particleEffect = def.particleEffect;

            StackSize     = stack_size;
            Slot          = def.Slot;
            DurabilityMax = def.DurabilityMax;
            Hardness      = def.Hardness;

            if (def.WeaponData != null && def.WeaponData.Type != WeaponType.None)
            {
                WeaponData = new WeaponData(def.WeaponData);
            }
            else
            {
                WeaponData = null;
            }

            if (def.AmmoData != null && def.AmmoData.Type != AmmoType.None)
            {
                AmmoData = new AmmoData(def.AmmoData);
            }
            else
            {
                AmmoData = null;
            }

            if (def.WearableData != null && def.WearableData.Type != WearableType.None)
            {
                WearableData = new WearableData(def.WearableData);
            }
            else
            {
                WearableData = null;
            }

            if (def.AccessoryData != null && def.AccessoryData.Type != AccessoryType.None)
            {
                AccessoryData = new AccessoryData(def.AccessoryData);
            }
            else
            {
                AccessoryData = null;
            }

            if (def.IngredientData != null && def.IngredientData.Type != IngredientType.None)
            {
                IngredientData = new IngredientData(def.IngredientData);
            }
            else
            {
                AccessoryData = null;
            }

            if (UsableData != null)
            {
                UsableData = new UsableData(def.UsableData);
            }
            else
            {
                UsableData = null;
            }

            SkillRequirements = new List <SkillRequirement>();
            for (int i = 0; i < def.SkillRequirements.Count; i++)
            {
                SkillRequirements.Add(new SkillRequirement(def.SkillRequirements[i]));
            }

            Actions      = def.Actions;
            HoursToBuild = def.BaseBuildTime;
            Power        = def.BasePower;

            description       = "";
            attributesTooltip = "";
            effectsTooltip    = "";

            portraitRotation = def.portraitRotation;
            portraitPosition = def.portraitPosition;

            worldRotation = def.worldRotation;
            worldPosition = def.worldPosition;
        }
예제 #3
0
        public ItemDefinition(ItemDefinition item)
        {
            Name        = item.Name;
            Key         = item.Key;
            Description = item.Description;

            Type           = item.Type;
            NameFormat     = item.NameFormat;
            IconKey        = item.IconKey;
            MeshKey        = item.MeshKey;
            TextureKey     = item.TextureKey;
            particleEffect = item.particleEffect;

            Actions       = item.Actions;
            BaseBuildTime = item.BaseBuildTime;
            BasePower     = item.BasePower;
            Slot          = item.Slot;
            DurabilityMax = item.DurabilityMax;

            Hardness = item.Hardness;

            if (item.WeaponData != null)
            {
                WeaponData = new WeaponData(item.WeaponData);
            }
            else
            {
                WeaponData = null;
            }

            if (item.AmmoData != null)
            {
                AmmoData = new AmmoData(item.AmmoData);
            }
            else
            {
                AmmoData = null;
            }

            if (item.WearableData != null)
            {
                WearableData = new WearableData(item.WearableData);
            }
            else
            {
                WearableData = null;
            }

            if (item.AccessoryData != null)
            {
                AccessoryData = new AccessoryData(item.AccessoryData);
            }
            else
            {
                AccessoryData = null;
            }

            if (item.IngredientData != null)
            {
                IngredientData = new IngredientData(item.IngredientData);
            }
            else
            {
                IngredientData = null;
            }

            if (item.UsableData != null)
            {
                UsableData = new UsableData(item.UsableData);
            }
            else
            {
                UsableData = null;
            }

            Value = item.Value;

            SkillRequirements = new List <SkillRequirement>();
            for (int i = 0; i < item.SkillRequirements.Count; i++)
            {
                SkillRequirements.Add(new SkillRequirement(item.SkillRequirements[i]));
            }

            SetTooltipText();

            portraitRotation = item.portraitRotation;
            portraitPosition = item.portraitPosition;

            worldRotation = item.worldRotation;
            worldPosition = item.worldPosition;
        }
예제 #4
0
        public ItemData(ItemData item)
        {
            Name       = item.Name;
            Key        = item.Key;
            Type       = item.Type;
            NameFormat = item.NameFormat;

            IconKey        = item.IconKey;
            MeshKey        = item.MeshKey;
            TextureKey     = item.TextureKey;
            particleEffect = item.particleEffect;

            Slot          = item.Slot;
            DurabilityCur = item.DurabilityCur;
            DurabilityMax = item.DurabilityMax;
            StackSize     = item.StackSize;

            Hardness     = item.Hardness;
            Power        = item.Power;
            Actions      = item.Actions;
            HoursToBuild = item.HoursToBuild;
            Rarity       = item.Rarity;

            description       = item.description;
            attributesTooltip = item.attributesTooltip;
            effectsTooltip    = item.effectsTooltip;

            if (item.WeaponData != null)
            {
                WeaponData = new WeaponData(item.WeaponData);
            }
            else
            {
                WeaponData = null;
            }

            if (item.AmmoData != null)
            {
                AmmoData = new AmmoData(item.AmmoData);
            }
            else
            {
                AmmoData = null;
            }

            if (item.WearableData != null)
            {
                WearableData = new WearableData(item.WearableData);
            }
            else
            {
                WearableData = null;
            }

            if (item.AccessoryData != null)
            {
                AccessoryData = new AccessoryData(item.AccessoryData);
            }
            else
            {
                AccessoryData = null;
            }

            if (item.IngredientData != null)
            {
                IngredientData = new IngredientData(item.IngredientData);
            }
            else
            {
                IngredientData = null;
            }

            if (item.Material != null)
            {
                Material = new ItemModifier(item.Material);
            }
            else
            {
                Material = null;
            }

            if (item.Quality != null)
            {
                Quality = new ItemModifier(item.Quality);
            }
            else
            {
                Quality = null;
            }

            if (item.PreEnchant != null)
            {
                PreEnchant = new ItemModifier(item.PreEnchant);
            }
            else
            {
                PreEnchant = null;
            }

            if (item.PostEnchant != null)
            {
                PostEnchant = new ItemModifier(item.PostEnchant);
            }
            else
            {
                PostEnchant = null;
            }

            SkillRequirements = new List <SkillRequirement>();
            for (int i = 0; i < item.SkillRequirements.Count; i++)
            {
                SkillRequirements.Add(new SkillRequirement(item.SkillRequirements[i]));
            }

            if (item.ArtifactData != null)
            {
                ArtifactData = new ArtifactData(item.ArtifactData);
            }
            else
            {
                ArtifactData = null;
            }

            if (item.SetData != null)
            {
                SetData = new ItemSetData(item.SetData);
            }
            else
            {
                SetData = null;
            }

            if (item.UsableData != null)
            {
                UsableData = new UsableData(item.UsableData);
            }
            else
            {
                UsableData = null;
            }

            portraitRotation = item.portraitRotation;
            portraitPosition = item.portraitPosition;

            worldRotation = item.worldRotation;
            worldPosition = item.worldPosition;
        }