Table of Contents

Class ProtectionModifiers

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll
public class ProtectionModifiers
Inheritance
ProtectionModifiers
Inherited Members
Extension Methods

Properties

DamageReductionValues

public static List<List<float>> DamageReductionValues { get; set; }

Property Value

List<List<float>>

MinDamageReductionValue

public static float MinDamageReductionValue { get; set; }

Property Value

float

ProtectionTierRounding

public static ProtectionModifiers.EnumRoundingType ProtectionTierRounding { get; set; }

Property Value

ProtectionModifiers.EnumRoundingType

ProtectionTiers

public Dictionary<EnumDamageType, int> ProtectionTiers { get; set; }

Property Value

Dictionary<EnumDamageType, int>

Methods

Add(params ProtectionModifiers[])

public static ProtectionModifiers Add(params ProtectionModifiers[] modifiers)

Parameters

modifiers ProtectionModifiers[]

Returns

ProtectionModifiers

Apply(ref float, out int, EntityAgent, DamageSource)

public virtual void Apply(ref float damage, out int durabilityLoss, EntityAgent receiver, DamageSource damageStats)

Parameters

damage float
durabilityLoss int
receiver EntityAgent
damageStats DamageSource

Average(params (ProtectionModifiers modifiers, float weight)[])

public static ProtectionModifiers Average(params (ProtectionModifiers modifiers, float weight)[] modifiers)

Parameters

modifiers (ProtectionModifiers modifiers, float weight)[]

Returns

ProtectionModifiers

GetDamageReduction(int, int)

public static float GetDamageReduction(int attackTier, int protectionTier)

Parameters

attackTier int
protectionTier int

Returns

float

GetDescription(StringBuilder, ICoreAPI, bool, bool)

public virtual void GetDescription(StringBuilder description, ICoreAPI api, bool broken = false, bool header = true)

Parameters

description StringBuilder
api ICoreAPI
broken bool
header bool

GetProtectionTier(EntityAgent, DamageSource)

public virtual int GetProtectionTier(EntityAgent receiver, DamageSource damageStats)

Parameters

receiver EntityAgent
damageStats DamageSource

Returns

int

LoadDamageReductionTable(ICoreAPI)

public static void LoadDamageReductionTable(ICoreAPI api)

Parameters

api ICoreAPI

SetDamageReductionTable(float[][])

public static void SetDamageReductionTable(float[][] values)

Parameters

values float[][]