Fix broken negative stats, update some stat description (#79)

* Fix broken negative stats, update some stat description

* ###

* #2

* curses is necro, frw on armor is velocity percent ( unused)

* Update rules to accept negative value

fix a bug with unique grand charm tz

[name] == grandcharm && [quality] == unique # ([fireresist] + [coldresist] + [lightresist]) >= -75

Single stat rules like [coldresist] >= -75 require the stat to exist

expressions like ([fireresist] + [coldresist] + [lightresist]) >= -75 treat missing stats as 0

Unidentified items with any stat requirements need identification first

* LevelReq + identifiedName added for all Crafted items

* Fix issue with rule.go

* Update stat throw damage and basename: GrandCharm -- Grand Charm

* Adjusting rule for ItemLevelReq  = 0

* update rule again
This commit is contained in:
elb
2025-02-21 11:11:27 -05:00
committed by GitHub
parent 438f80b911
commit 5455fd9772
5 changed files with 147 additions and 45 deletions

View File

@@ -146,14 +146,16 @@ func (gd *GameReader) getStatsList(statListPtr uintptr) stat.Stats {
}
var stats = make([]stat.Data, 0)
statBuffer := gd.Process.ReadBytesFromMemory(uintptr(statList), statCount*10)
for i := 0; i < int(statCount); i++ {
offset := uint(i * 8)
statLayer := ReadUIntFromBuffer(statBuffer, offset, Uint16)
statEnum := ReadUIntFromBuffer(statBuffer, offset+0x2, Uint16)
statValue := ReadUIntFromBuffer(statBuffer, offset+0x4, Uint32)
statValue := ReadIntFromBuffer(statBuffer, offset+0x4, Uint32)
value := int(statValue)
value := statValue
switch stat.ID(statEnum) {
case stat.Life,
stat.MaxLife,
@@ -161,16 +163,16 @@ func (gd *GameReader) getStatsList(statListPtr uintptr) stat.Stats {
stat.MaxMana,
stat.Stamina,
stat.MaxStamina:
value = int(statValue >> 8)
value = statValue >> 8
case stat.ColdLength,
stat.PoisonLength:
value = int(statValue / 25)
value = statValue / 25
case stat.DeadlyStrikePerLevel:
value = int(float64(statValue) / .8)
case stat.HitCausesMonsterToFlee:
value = int(float64(statValue) / 1.28)
case stat.AttackRatingUndeadPerLevel:
value = int(statValue / 2)
value = statValue / 2
case stat.MagicFindPerLevel,
stat.ExtraGoldPerLevel,
stat.DamageDemonPerLevel,