Minimum value per level and enhanced damage item stats fix (#26)
* Added a temporary fix to have a minimum value of 1 for per level mods * Expose Stat Aliases and Type Aliases (#25) * Fixed setting a minimum value of 1 for per level item stats * Added minimum value of attack rating per level to be 15 * Added min value for replenish durability/quantity * Added fix for reading item modifiers - enhanced damage now works * Delete .idea/.gitignore * Delete .idea/d2go.iml * Delete .idea/modules.xml * Delete .idea/vcs.xml * Added gitignore file * Refactored code --------- Co-authored-by: dmeli <d.melia@outlook.fr> Co-authored-by: Arto Simonyan <artosimonyan@protonmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@ package memory
|
||||
import (
|
||||
"github.com/hectorgimenez/d2go/pkg/data"
|
||||
"github.com/hectorgimenez/d2go/pkg/data/stat"
|
||||
"math"
|
||||
)
|
||||
|
||||
type GameReader struct {
|
||||
@@ -158,16 +159,18 @@ func (gd *GameReader) getStatsList(statListPtr uintptr) stat.Stats {
|
||||
stat.DexterityPerLevel,
|
||||
stat.VitalityPerLevel,
|
||||
stat.ThornsPerLevel:
|
||||
value = int(statValue / 8)
|
||||
value = int(math.Max(float64(statValue/8), 1))
|
||||
case stat.LifePerLevel,
|
||||
stat.ManaPerLevel:
|
||||
value = int(statValue / 2048)
|
||||
value = int(math.Max(float64(statValue/2048), 1))
|
||||
case stat.ReplenishDurability, stat.ReplenishQuantity:
|
||||
value = 2 / int(statValue)
|
||||
value = int(math.Max(float64(2/statValue), 1))
|
||||
case stat.RegenStaminaPerLevel:
|
||||
value = int(statValue) * 10
|
||||
case stat.LevelRequirePercent:
|
||||
value = int(statValue) * -1
|
||||
case stat.AttackRatingPerLevel:
|
||||
value = int(math.Max(float64(statValue), 15))
|
||||
}
|
||||
|
||||
stats = append(stats, stat.Data{
|
||||
|
||||
Reference in New Issue
Block a user