Esempio n. 1
0
    private BaseItem createTestItem(string illness)
    {
        PlayerInventory  mockPlayerInventory = new PlayerInventory("player", 20);
        PlayerController controller          = new GameObject().AddComponent <PlayerController>();

        controller.PlayerStatManager = new PlayerStatManager();

        Game.Instance.PlayerInstance            = new Player(mockPlayerInventory);
        Game.Instance.PlayerInstance.Controller = controller;

        BaseItem medicineItem = new BaseItem("Sample Medicine");

        medicineItem.FlavorText      = "This is a test medicine";
        medicineItem.InventorySprite = "medicine.png";
        medicineItem.WorldModel      = "medicineModel.png";
        medicineItem.Types           = new List <string>();
        medicineItem.Types.Add(ItemTypes.Medicinal);

        MedicineCategory medicine = new MedicineCategory();

        medicine.HealthGain = 5f;
        medicine.Sickness   = illness;

        medicineItem.AddItemCategory(medicine);

        return(medicineItem);
    }
    private BaseItem createTestItem()
    {
        PlayerInventory  mockPlayerInventory = new PlayerInventory("player", 20);
        PlayerController controller          = new GameObject().AddComponent <PlayerController>();

        controller.PlayerStatManager = new PlayerStatManager();

        Game.Instance.PlayerInstance            = new Player(mockPlayerInventory);
        Game.Instance.PlayerInstance.Controller = controller;
        Game.Player.FoodPoisoningChance         = 1f;

        GuiInstanceManager.ItemAmountPanelInstance = new GameObject().AddComponent <ChooseItemAmountPanelBehavior>();
        GuiInstanceManager.ItemAmountPanelInstance.CurrentAmount = 1;

        BaseItem plantItem = new BaseItem("Sample Plant");

        plantItem.FlavorText      = "This is a test plant";
        plantItem.InventorySprite = "plant.png";
        plantItem.WorldModel      = "plantModel.png";
        plantItem.Types           = new List <string>();
        plantItem.Types.Add(ItemTypes.Edible);

        PlantCategory plant = new PlantCategory();

        plant.PneumoniaEffect = 0.1f;
        plant.StomachEffect   = 0.2f;
        plant.Toughness       = 0.3f;
        plant.WaterContent    = 0.4f;

        plantItem.AddItemCategory(plant);

        return(plantItem);
    }
    private BaseItem createTestItem()
    {
        PlayerInventory  mockPlayerInventory = new PlayerInventory("player", 20);
        PlayerController controller          = new GameObject().AddComponent <PlayerController>();

        controller.PlayerStatManager = new PlayerStatManager();

        Game.Instance.PlayerInstance            = new Player(mockPlayerInventory);
        Game.Instance.PlayerInstance.Controller = controller;

        BaseItem clothItem = new BaseItem("Sample Cloth");

        clothItem.FlavorText      = "This is a test cloth";
        clothItem.InventorySprite = "cloth.png";
        clothItem.WorldModel      = "clothModel.png";
        clothItem.Types           = new List <string>();
        clothItem.Types.Add(ItemTypes.Cloth);

        ClothCategory cloth = new ClothCategory();

        cloth.FabricThickness = 0.5f;
        cloth.Impermiability  = 1f;
        cloth.ThreadDensity   = 0.3f;
        cloth.OnPlayer        = 0f;

        clothItem.AddItemCategory(cloth);

        return(clothItem);
    }
    public void AddItemCategoryMethodShouldUpdateGetItemCategoryList()
    {
        //Arrange
        BaseItem  item      = createTestItem();
        ItemStack itemStack = new ItemStack(item, 4, "");

        Assert.AreEqual(13, itemStack.Item.GetItemCategories().Count);

        PlantCategory plant = new PlantCategory();

        item.AddItemCategory(plant);

        // Act
        itemStack.Item.GetItemCategories();

        // Assert
        Assert.AreEqual(14, itemStack.Item.GetItemCategories().Count);
    }
Esempio n. 5
0
	private BaseItem createTestItem()
	{
		PlayerInventory mockPlayerInventory = new PlayerInventory("player", 20);
		Game.Instance.PlayerInstance = new Player(mockPlayerInventory);

		BaseItem equipableItem = new BaseItem("Sample Equipable");
		equipableItem.FlavorText = "This is a test equipable";
		equipableItem.InventorySprite = "equipable.png";
		equipableItem.WorldModel = "equipableModel.png";
		equipableItem.Types = new List<string>();
		equipableItem.Types.Add(ItemTypes.Equipable);

		EquipableCategory equipable = new EquipableCategory ();
		equipable.Equiped = 0f;

		equipableItem.AddItemCategory(equipable);

		return equipableItem;
	}
Esempio n. 6
0
    private BaseItem createTestItem()
    {
        BaseItem fireItem = new BaseItem("Sample Fire");

        fireItem.FlavorText      = "This is a test fire";
        fireItem.InventorySprite = "fire.png";
        fireItem.WorldModel      = "fireModel.png";
        fireItem.Types           = new List <string>();
        fireItem.Types.Add(ItemTypes.Fuel);

        FireBaseCategory fire = new FireBaseCategory();

        fire.BurnRateMultiplier = 1f;
        fire.FuelRemaining      = 10f;
        fire.StartingFuel       = 10f;

        fireItem.AddItemCategory(fire);

        return(fireItem);
    }
Esempio n. 7
0
    private BaseItem createTestItem()
    {
        BaseItem lightItem = new BaseItem("Sample Light");

        lightItem.FlavorText      = "This is a test light";
        lightItem.InventorySprite = "light.png";
        lightItem.WorldModel      = "lightModel.png";
        lightItem.Types           = new List <string>();
        lightItem.Types.Add(ItemTypes.Fuel);

        LightCategory light = new LightCategory();

        light.Brightness       = 2f;
        light.BurnRate         = 0.75f;
        light.CurrentFuelLevel = 3f;
        light.MaxFuel          = 5f;

        lightItem.AddItemCategory(light);

        return(lightItem);
    }
    private BaseItem createTestItem()
    {
        PlayerInventory mockPlayerInventory = new PlayerInventory("player", 20);

        PlayerController controller = new GameObject().AddComponent <PlayerController>();

        controller.PlayerStatManager = new PlayerStatManager();

        Game.Instance.PlayerInstance               = new Player(mockPlayerInventory);
        Game.Instance.PlayerInstance.Controller    = controller;
        GuiInstanceManager.ItemAmountPanelInstance = new GameObject().AddComponent <ChooseItemAmountPanelBehavior>();
        GuiInstanceManager.ItemAmountPanelInstance.CurrentAmount = 1;

        BaseItem fleshItem = new BaseItem("Sample Flesh");

        fleshItem.FlavorText      = "This is a test flesh";
        fleshItem.InventorySprite = "flesh.png";
        fleshItem.WorldModel      = "fleshModel.png";
        fleshItem.Types           = new List <string>();
        fleshItem.Types.Add(ItemTypes.Edible);
        fleshItem.ModifyingActionNames = new List <string> {
            "Cook"
        };
        fleshItem.ActionModifiedSprites = new List <string> {
            "modifiedFlesh.png"
        };
        fleshItem.ActionModifiedModels = new List <string> {
            "modifiedFleshModel.png"
        };

        FleshCategory flesh = new FleshCategory();

        flesh.HealthEffect = 0.1f;
        flesh.HungerGain   = 0.2f;

        fleshItem.AddItemCategory(flesh);

        return(fleshItem);
    }
Esempio n. 9
0
    private BaseItem createTestItem()
    {
        BaseItem solidItem = new BaseItem("Sample Solid");

        solidItem.FlavorText      = "This is a test solid";
        solidItem.InventorySprite = "solid.png";
        solidItem.WorldModel      = "solid.png";
        solidItem.Types           = new List <string>();
        solidItem.Types.Add(ItemTypes.BaseSolid);
        solidItem.Types.Add(ItemTypes.Rod);

        SolidCategory solid = new SolidCategory();

        solid.Durability  = 0.1f;
        solid.Elasticity  = 0.2f;
        solid.Flexibility = 0.3f;
        solid.Sharpness   = 0.4f;
        solid.Stickiness  = 0.5f;
        solid.Thickness   = 0.6f;

        solidItem.AddItemCategory(solid);

        solidItem.ActionModifiedModels  = new List <string>();
        solidItem.ActionModifiedSprites = new List <string>();
        solidItem.ModifyingActionNames  = new List <string>();

        solidItem.ActionModifiedModels.Add("basket.png");
        solidItem.ActionModifiedModels.Add("rope.png");

        solidItem.ActionModifiedSprites.Add("basketSprite.png");
        solidItem.ActionModifiedSprites.Add("ropeSprite.png");

        solidItem.ModifyingActionNames.Add("Weave Basket");
        solidItem.ModifyingActionNames.Add("Weave Rope");

        return(solidItem);
    }
Esempio n. 10
0
    private BaseItem createTestItem()
    {
        PlayerInventory  mockPlayerInventory = new PlayerInventory("player", 20);
        PlayerController controller          = new GameObject().AddComponent <PlayerController>();

        Game.Instance.PlayerInstance            = new Player(mockPlayerInventory);
        Game.Instance.PlayerInstance.Controller = controller;
        BaseItem item = new BaseItem("Sample Item");

        item.FlavorText      = "This is a test item";
        item.InventorySprite = "item.png";
        item.WorldModel      = "itemWorld.png";
        item.Types           = new List <string>();
        item.Types.Add(ItemTypes.BaseSolid);
        item.Types.Add(ItemTypes.Rod);

        SolidCategory solid = new SolidCategory();

        solid.Durability  = 0.1f;
        solid.Elasticity  = 0.2f;
        solid.Flexibility = 0.3f;
        solid.Sharpness   = 0.4f;
        solid.Stickiness  = 0.5f;
        solid.Thickness   = 0.6f;

        PlantCategory plant = new PlantCategory();

        plant.PneumoniaEffect = 0.1f;
        plant.StomachEffect   = 0.2f;
        plant.Toughness       = 0.3f;
        plant.WaterContent    = 0.4f;

        FleshCategory flesh = new FleshCategory();

        flesh.HealthEffect = 0.1f;
        flesh.HungerGain   = 0.2f;

        ContainerCategory container = new ContainerCategory();

        container.Size = 1;

        MedicineCategory medicine = new MedicineCategory();

        medicine.HealthGain = 5f;
        medicine.Sickness   = "all";

        ClothCategory cloth = new ClothCategory();

        cloth.FabricThickness = 0.5f;
        cloth.Impermiability  = 1f;
        cloth.ThreadDensity   = 0.3f;
        cloth.OnPlayer        = 0f;

        FuelCategory fuel = new FuelCategory();

        fuel.BurnTime = 5f;

        FireBaseCategory fire = new FireBaseCategory();

        fire.BurnRateMultiplier = 1f;
        fire.FuelRemaining      = 10f;
        fire.StartingFuel       = 10f;

        ShelterCategory shelter = new ShelterCategory();

        shelter.WarmthRate = 2;

        RaftCategory raft = new RaftCategory();

        raft.Speed         = 1f;
        raft.InventorySize = 5;

        WarmthIdolCategory warmthIdol = new WarmthIdolCategory();

        warmthIdol.Equiped       = 0f;
        warmthIdol.WarmthBenefit = 1;

        LightCategory light = new LightCategory();

        light.Brightness       = 2f;
        light.BurnRate         = 0.75f;
        light.CurrentFuelLevel = 3f;
        light.MaxFuel          = 5f;

        EquipableCategory equipable = new EquipableCategory();

        equipable.Equiped = 0f;

        item.AddItemCategory(solid);
        item.AddItemCategory(plant);
        item.AddItemCategory(flesh);
        item.AddItemCategory(container);
        item.AddItemCategory(medicine);
        item.AddItemCategory(cloth);
        item.AddItemCategory(fuel);
        item.AddItemCategory(fire);
        item.AddItemCategory(shelter);
        item.AddItemCategory(raft);
        item.AddItemCategory(warmthIdol);
        item.AddItemCategory(light);
        item.AddItemCategory(equipable);

        return(item);
    }