#include <BlockRegistry/BlockRegistry.hpp>
#include <GraphicsContext/GraphicsContext.hpp>
#include <Material/Material.hpp>
#include <Milestone/BronzeAgeMilestone/BronzeAgeMilestone.hpp>
#include <Milestone/CarpentryMilestone/CarpentryMilestone.hpp>
#include <Color/Color.hpp>

const std::string BronzeAgeMilestone::ID = "main:BronzeAge";

BronzeAgeMilestone::BronzeAgeMilestone() :
    Milestone(
        Material::bronzeIngot,
        Material::bronzeIngot,
        "Bronze age"
    )
{
    addAchievement(
        StonePickaxe,
        Material::stonePickaxe,
        Material::stonePickaxe,
        "Construct the stone pickaxe",
        "*Collect {block|main:stone|3} and {item|main:stick|8}.\n"
        "*{action|Construct} the {item|main:stonePickaxe}.\n"
        "@constructTable|main:stonePickaxe|1|main:stone|3|main:stick|8\n",
        Dependency{CarpentryMilestone::ID, CarpentryMilestone::ConstructTable}
    );

    addAchievement(
        StonePot,
        Material::stonePotIconTodo,
        Material::stonePotIconDone,
        "The stone pot",
        "*Collect {block|main:stone|12} and {item|main:stick|16}.\n"
        "*{action|Construct} the {block|main:stonePot}.\n"
        "@constructTable|main:stonePot|1|main:stone|12|main:stick|16\n"
        "*Open the {machine|main:stonePot}.\n",
        Dependency{CarpentryMilestone::ID, CarpentryMilestone::ConstructTable}
    );

    addAchievement(
        MineTin,
        blockRegistry.getBlockByName("main:stoneTinOre").iconMaterial,
        Material::tinIngot,
        "Mine tin",
        "*Select the {item|main:stonePickaxe} in the sidebar.\n"
        "*Find {block|main:stoneTinOre} underground and collect it.\n"
        "*Open the {machine|main:stonePot}.\n"
        "*Place the {block|main:stoneTinOre} into the {inputSlot}.\n"
        "*Place a fuel (e.g. {item|main:stick}, {block|main:planks})"
        " into the {fuelSlot}.\n"
        "*Wait until the ore is smelted.\n"
        "@itemProc|main:stonePot|main:stoneTinOre|1|main:tinIngot|1\n"
        "*Take the {item|main:tinIngot} out of the pot.\n",
        Dependency{ID, StonePickaxe},
        Dependency{ID, StonePot}
    );

    addAchievement(
        MineCopper,
        blockRegistry.getBlockByName("main:stoneCopperOre").iconMaterial,
        Material::copperIngot,
        "Mine copper",
        "*Select the {item|main:stonePickaxe} in the sidebar.\n"
        "*Find {block|main:stoneCopperOre} underground and collect it.\n"
        "*Open the {machine|main:stonePot}.\n"
        "*Place the {block|main:stoneCopperOre} into the {inputSlot}.\n"
        "*Place a fuel (e.g. {item|main:stick}, {block|main:planks})"
        " into the {fuelSlot}.\n"
        "*Wait until the ore is smelted.\n"
        "@itemProc|main:stonePot|main:stoneCopperOre|1|main:copperIngot|1\n"
        "*Take the {item|main:copperIngot} out of the pot.\n",
        Dependency{ID, StonePickaxe},
        Dependency{ID, StonePot}
    );

    addAchievement(
        MakeBrass,
        Material::tinCopperBundle,
        Material::brassIngot,
        "Make brass",
        "*{action|Construct} a {item|main:tinCopperBundle}.\n"
        "@constructTable|main:tinCopperBundle|1|main:tinIngot|1|main:copperIngot|1\n"
        "*Open a {machine|main:stonePot}.\n"
        "*{action|Smelt} the {item|main:tinCopperBundle}+ into {item|main:brassIngot}.\n"
        "@itemProc|main:stonePot|main:tinCopperBundle|1|main:brassIngot|1\n"
        "*Take the {item|main:brassIngot} out of the pot.\n",
        Dependency{ID, MineTin},
        Dependency{ID, MineCopper}
    );

    addAchievement(
        MakeBronze,
        Material::brassCopperBundle,
        Material::bronzeIngot,
        "Make bronze",
        "*{action|Construct} a {item|main:brassCopperBundle}.\n"
        "@constructTable|main:brassCopperBundle|1|main:brassIngot|1|main:copperIngot|1\n"
        "*Open a {machine|main:stonePot}.\n"
        "*{action|Smelt} the {item|main:brassCopperBundle} into {item|main:bronzeIngot}.\n"
        "@itemProc|main:stonePot|main:brassCopperBundle|1|main:bronzeIngot|1\n"
        "*Take the {item|main:bronzeIngot} out of the pot.\n",
        Dependency{ID, MakeBrass}
    );

    addAchievement(
        BronzePickaxe,
        Material::bronzePickaxe,
        Material::bronzePickaxe,
        "Construct the bronze pickaxe",
        "*{action|Construct} the {item|main:bronzePickaxe}.\n"
        "@constructTable|main:bronzePickaxe|1|main:bronzeIngot|3|main:stick|8\n",
        Dependency{ID, MakeBronze}
    );
}