namespace Eco.Mods.TechTree
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using Eco.Core.Utils;
    using Eco.Core.Utils.AtomicAction;
    using Eco.Gameplay.Components;
    using Eco.Gameplay.DynamicValues;
    using Eco.Gameplay.Items;
    using Eco.Gameplay.Players;
    using Eco.Gameplay.Property;
    using Eco.Gameplay.Skills;
    using Eco.Gameplay.Systems.TextLinks;
    using Eco.Shared.Serialization;
    using Eco.Shared.Services;
    using Eco.Shared.Utils;
    using Gameplay.Systems.Tooltip;

    [Serialized]
    [RequiresSkill(typeof(MasonSkill), 0)]    
    public partial class ClayWorkingSkill : Skill
    {
        public override string FriendlyName { get { return "Clay & Pottery Working"; } }
        public override string Description { get { return ""; } }

        public static int[] SkillPointCost = { 1, 1, 1, 1, 1 };
        public override int RequiredPoint { get { return this.Level < this.MaxLevel ? SkillPointCost[this.Level] : 0; } }
        public override int PrevRequiredPoint { get { return this.Level - 1 >= 0 && this.Level - 1 < this.MaxLevel ? SkillPointCost[this.Level - 1] : 0; } }
        public override int MaxLevel { get { return 1; } }
    }

    [Serialized]
    public partial class ClayWorkingSkillBook : SkillBook<ClayWorkingSkill, ClayWorkingSkillScroll>
    {
        public override string FriendlyName { get { return "Clay & Pottery Working Skill Book"; } }
    }

    [Serialized]
    public partial class ClayWorkingSkillScroll : SkillScroll<ClayWorkingSkill, ClayWorkingSkillBook>
    {
        public override string FriendlyName { get { return "Clay & Pottery Working Skill Scroll"; } }
    }

    [RequiresSkill(typeof(GatheringSkill), 0)] 
    public partial class ClayWorkingSkillBookRecipe : Recipe
    {
        public ClayWorkingSkillBookRecipe()
        {
            this.Products = new CraftingElement[]
            {
                new CraftingElement<ClayWorkingSkillBook>(),
            };
            this.Ingredients = new CraftingElement[]
            {
                new CraftingElement<ClayItem>(typeof(ResearchEfficiencySkill), 40, ResearchEfficiencySkill.MultiplicativeStrategy),
                new CraftingElement<CeramicItem>(typeof(ResearchEfficiencySkill), 40, ResearchEfficiencySkill.MultiplicativeStrategy),
            };
            this.CraftMinutes = new ConstantValue(30);

            this.Initialize("Clay & Pottery Working Skill Book", typeof(ClayWorkingSkillBookRecipe));
            CraftingComponent.AddRecipe(typeof(ResearchTableObject), this);
        }
    }
}
