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
Modifier and TypeFieldDescriptionstatic final IScalingFunction
Default Scaling function used by the vanillaDamageScaling
values. -
Method Summary
Modifier and TypeMethodDescriptionfloat
scaleDamage
(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 vanillaDamageScaling
values.
-
-
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.
-