Interface IScalingFunction
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An
This allows finer control over the actual scaling value, instead of the hard-coded vanilla defaults.
IScalingFunction is used by custom DamageScaling instances.This allows finer control over the actual scaling value, instead of the hard-coded vanilla defaults.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IScalingFunctionDefault Scaling function used by the vanillaDamageScalingvalues. -
Method Summary
Modifier and TypeMethodDescriptionfloatscaleDamage(DamageSource source, Player target, float amount, Difficulty difficulty) Scales the incoming damage amount based on the current difficulty.
Only damage dealt to players is scaled, other damage is not impacted.
-
Field Details
-
DEFAULT
Default Scaling function used by the vanillaDamageScalingvalues.
-
-
Method Details
-
scaleDamage
Scales the incoming damage amount based on the current difficulty.
Only damage dealt to players is scaled, other damage is not impacted.- Parameters:
source- The source of the incoming damage.target- The player which is being attacked.amount- The amount of damage being dealt.difficulty- The current game difficulty.- Returns:
- The scaled damage value.
-