Add more item flags (#69)

* Add more item flags

- Add more item flags
- Modify some of the stat strings

* fix ethereal

* Rename flag
This commit is contained in:
Arto Simonyan
2025-02-09 01:08:58 +02:00
committed by GitHub
parent 415ac29ab1
commit 09dfe3c65d
3 changed files with 57 additions and 24 deletions

View File

@@ -85,6 +85,14 @@ type Item struct {
Stats stat.Stats
Identified bool
IsRuneword bool
IsNamed bool
IsStartItem bool
IsEar bool
IsBroken bool
IsEquipped bool
HasSockets bool
InTradeOrStoreScreen bool
IsInSocket bool
}
type Drop struct {

View File

@@ -785,15 +785,15 @@ var StatStringMap = map[int]map[int]string{
19: {0: "+# to Attack Rating"}, // tohit
20: {0: "#% Increased Chance of Blocking"}, // toblock
21: {
0: "Adds #-# Damage", // mindamage
0: "#-# Damage", // mindamage
1: "+# to Minimum Damage", // plusmindamage
},
22: {
0: "maxdamage ????",
0: "#", // maxdamage
1: "+# to Maximum Damage", // plusmaxdamage
},
23: {0: "secondarymindamage ????"},
24: {0: "secondarymaxdamage ????"},
23: {0: "#"}, //minimum dmg for 2hand weapons - secondarymindamage
24: {0: "#"}, // maximum dmg for 2hand weapons - secondarymaxdamage
25: {0: "damagepercent ????"},
26: {0: "manarecovery ????"},
27: {0: "Regenerate Mana #%"}, // manarecoverybonus
@@ -840,17 +840,17 @@ var StatStringMap = map[int]map[int]string{
65: {0: "stamdrainmaxdam ????"},
66: {0: "stunlength ????"},
67: {0: "+#% Faster Run/Walk"},
68: {0: "+#% Increased Attack Speed"},
68: {0: "#"}, // attackrate
69: {0: "otheranimrate ????"},
70: {0: "Quantity: #"},
71: {0: "Value: #"},
72: {0: "Durability: # of #"}, // durability
73: {0: "Increase Maximum Durability #%"}, // maxdurability
73: {0: "#"}, // maxdurability
74: {0: "Replenish Life +#"}, // hpregen
75: {0: "Increase Maximum Durability #%"}, //itemmaxdurabilitypercent
76: {0: "Increase Maximum Life #%"}, //itemmaxmanapercent
77: {0: "Increase Maximum Mana #%"}, //itemmaxmanapercent
78: {0: "itemattackertakesdamage"}, //itemattackertakesdamage
78: {0: "Attacker Takes Damage of #"}, //itemattackertakesdamage
79: {0: "#% Extra Gold from Monsters"}, //itemgoldbonus
80: {0: "#% Better Chance of Getting Magic Items"}, //itemmagicbonus
81: {0: "Knockback"}, //itemknockback

View File

@@ -266,13 +266,38 @@ func (gd *GameReader) getItemStats(statsListExPtr uintptr) (stat.Stats, stat.Sta
}
func setProperties(item *data.Item, flags uint32) {
if 0x00400000&flags != 0 {
item.Ethereal = true
}
if 0x00000010&flags != 0 {
item.Identified = true
}
if 0x04000000&flags != 0 {
if 0x4000000&flags != 0 {
item.IsRuneword = true
}
if 0x1000000&flags != 0 {
item.IsNamed = true
}
if 0x400000&flags != 0 {
item.Ethereal = true
}
if 0x20000&flags != 0 {
item.IsStartItem = true
}
if 0x10000&flags != 0 {
item.IsEar = true
}
if 0x2000&flags != 0 {
item.InTradeOrStoreScreen = true
}
if 0x800&flags != 0 {
item.HasSockets = true
}
if 0x100&flags != 0 {
item.IsBroken = true
}
if 0x10&flags != 0 {
item.Identified = true
}
// Only jewels and runes, gems don't work
if 0x8&flags != 0 {
item.IsInSocket = true
}
if 0x1&flags != 0 {
item.IsEquipped = true
}
}