Abstract class scaling + Fixes + Commons no longer needed.
REMOVE COMMONS JAR FROM PLUGINS IF YOU ARE USING THIS VERSION. IT IS NO LONGER NEEDED.
Abstract the health/mana/shield/etc scaling system
Abstracted places in the code where "base-max-x", "max-x-per-level", "max-x-per-level-power" etc. appeared with scalings. A scaling is essentially a class that wraps a ToDoubleFunction and provides a "double getScaled(Hero hero)" method, which returns the value of the function for the given hero. There are several implementations of this class to provide multiple ways to scale health and other values, while still supporting old configs and code.
Scaling types:
Level
- Identical to the old scaling system, calculating the value based off of the base and per-level values.
Power
- Similar to level scaling, except per-level * level is raised to a power. With a power of 1 this is identical to level scaling.
Expression
Explicit
- Looks through the given level thresholds to find the highest threshold reached and uses that value.
ExplicitPower
- Similar to power scaling, except the power used is calculated by looking through the given level thresholds to find the value of the highest threshold reached.
Config Examples:
Old system
base-max-health: 28.0
max-health-per-level: 0.4
New system
Code (Text):
value:
scaling: level
base: 28
per-level: 0.4
value:
scaling: power
base: 28
per-level: 0.4
power: 1.1
value:
scaling: expression
expression: "50 + level * 10"
value:
scaling: explicit
levels:
1: 100
2: 120
5: 150
10: 1000
value:
scaling: explicitpower
base: 28
per-level: 0.4
powers:
1: 1
2: 2
5: 2.5
6: 2
10: 1.5
50: 1.1
Where does "value" appear in the class.ymls? The new keys max-health, max-mana, max-shield, item-damages, and projectile-damages.
The structure of item-damage and projectile-damage has also changed. Old system:
Code (Text):
item-damage:
IRON_SWORD: 6
GOLD_SWORD: 7
DIAMOND_SWORD: 8
item-damage-level:
IRON_SWORD: 0.1
GOLD_SWORD: 0.15
DIAMOND_SWORD: 0.2
New system (item-damage becomes item-damages, projectile-damage becomes projectile-damages):
Code (Text):
item-damages:
IRON_SWORD:
scaling: level
base: 6
per-level: 0.1
GOLD_SWORD:
scaling: level
base: 7
per-level: 0.15
DIAMOND_SWORD:
scaling: level
base: 8
per-level: 0.2
Changes
#705 (Feb 18, 2017 11:12:15 PM)
- Don't create an inner UCL — kashike / gitlab
#704 (Feb 18, 2017 10:44:50 PM)
- Shrink final JAR — kashike / gitlab
#703 (Feb 16, 2017 11:09:27 AM)
- Abstract the health/mana/shield/etc scaling system — payneaustin5 / gitlab
#702 (Feb 7, 2017 6:42:26 PM)
- Bump to 1.8.11-SNAPSHOT — kashike / gitlab
#701 (Feb 7, 2017 6:36:36 PM)
- Convert project to Gradle — kashike / gitlab
#699 (Feb 5, 2017 3:48:52 PM)
- add enchanter — Kainzo / gitlab
- add this again. — Kainzo / gitlab