Beispiel #1
0
    public Recipe TieredRecipe()
    {
        Recipe      fishingRodRecipe = new Recipe();
        Requirement hook             = new Requirement();

        hook.AmountRequired = 1;
        hook.ItemType       = ItemTypes.Hook;

        Requirement rope = new Requirement();

        rope.AmountRequired = 1;
        rope.ItemType       = ItemTypes.Rope;

        Requirement rod = new Requirement();

        rod.AmountRequired = 1;
        rod.ItemType       = ItemTypes.Rod;

        fishingRodRecipe.ResourceRequirements = new List <Requirement> {
            hook, rod, rope
        };

        fishingRodRecipe.Tiered           = true;
        fishingRodRecipe.ToolRequirements = null;
        fishingRodRecipe.RecipeName       = "Fishing Rod";
        fishingRodRecipe.StatsToCheck     = new List <CraftingStat>();

        CraftingStat durability = new CraftingStat();

        durability.StatName         = "durability";
        durability.QualityThreshold = new List <float> {
            9, 13
        };
        durability.StatAffectingItems = new List <string> {
            ItemTypes.Hook, ItemTypes.Rod, ItemTypes.Rope
        };

        CraftingStat flexibility = new CraftingStat();

        flexibility.StatName         = "flexibility";
        flexibility.QualityThreshold = new List <float> {
            0.5f, 1
        };
        flexibility.StatAffectingItems = new List <string> {
            ItemTypes.Rod, ItemTypes.Rope
        };

        fishingRodRecipe.StatsToCheck.Add(durability);
        fishingRodRecipe.StatsToCheck.Add(flexibility);

        return(fishingRodRecipe);
    }
Beispiel #2
0
    public Recipe TieredDecreasingRecipeWithTool()
    {
        Recipe cloth = new Recipe();

        Requirement threadReq = new Requirement();

        threadReq.AmountRequired = 1;
        threadReq.ItemType       = ItemTypes.Rope;

        Requirement knifeReq = new Requirement();

        knifeReq.AmountRequired = 1;
        knifeReq.ItemType       = ItemTypes.Blade;

        cloth.ResourceRequirements = new List <Requirement> {
            threadReq
        };

        cloth.Tiered           = true;
        cloth.ToolRequirements = new List <Requirement> {
            knifeReq
        };
        cloth.RecipeName   = "Woven Blanket";
        cloth.StatsToCheck = new List <CraftingStat>();

        CraftingStat thickness = new CraftingStat();

        thickness.StatName         = "thickness";
        thickness.QualityThreshold = new List <float> {
            0.8f, 0.2f
        };
        thickness.StatAffectingItems = new List <string> {
            ItemTypes.Rope
        };

        CraftingStat flexibility = new CraftingStat();

        flexibility.StatName         = "flexibility";
        flexibility.QualityThreshold = new List <float> {
            3f, 4f
        };
        flexibility.StatAffectingItems = new List <string> {
            ItemTypes.Rope
        };

        cloth.StatsToCheck.Add(thickness);
        cloth.StatsToCheck.Add(flexibility);

        return(cloth);
    }