Skip to content

Clothes

Vadim Gromov edited this page Jan 10, 2021 · 13 revisions

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:

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.

What are Clothes Groups?

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.

How to use?

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);

How Water and Cold Resistances are being calculated?

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.

Clothes side effects

You can adjust how clothes player is wearing affects his health parameters (such as stamina, run speed, etc.) More on it here.

Clone this wiki locally