-
Notifications
You must be signed in to change notification settings - Fork 12
Clothes
All _gc
references in these examples are instances of a IGameController
Every clothes item belongs to player's inventory.
Clothes inventory items are derived from the ClothesItemBase and have the following additional properties:
- ClothesType -- from ClothesTypes enum
- Order -- order of an clothes item on a body
- WaterResistance -- describes water resistance of this item, in percents
- ColdResistance -- describes cold resistance of this item, in percents
- CanBeTool -- describes whether the item can be also a tool
Clothes item's Name property must exactly match its class name in order for clothes groups to work correctly. Clothes items must also reside in the ZaraEngine.Inventory
namespace.
How to put clothes on and off see here.
These are sets of particular clothing that is treated as an completed set. For example, if you wear everything made from fur, you get the Fur Clothing set -- in other words, Clothes Groups are grouping particular clothes together to give player additional bonuses: additional cold- and water resistance.
These are described in a ZaraEngine.Inventory.ClothesGroups class, like this:
Groups = new List<ClothesGroup>(new[]
{
new ClothesGroup
{
Name = "WaterResistantSuit",
ColdResistanceBonus = 0,
WaterResistanceBonus = 25,
Members =
{
InventoryController.CommonClothes.WaterproofJacket,
InventoryController.CommonClothes.WaterproofPants,
InventoryController.CommonClothes.RubberBoots,
InventoryController.CommonClothes.LeafHat
}
},
});
Members of a group are not actual inventory items, but strings, their class names, like Scarf
.
To check if player has a complete set of clothes, call
var clothesGroup = ClothesGroups.Instance.GetCompleteClothesGroup(_gc);
Or to get the list of possible clothes groups for the player, call
var groups = ClothesGroups.Instance.GetPossibleClothesGroups(_gc);
These resistances are calculated in a WetnessController and BodyStatusController as a sum of WaterResistance/ColdResistance of all clothing, plus bonus from the ZaraEngine.Inventory.ClothesGroups if any.
You can adjust how clothes player is wearing affects his health parameters (such as stamina, run speed, etc.) More on it here.