1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-19 19:06:45 -05:00

Feature item stat cost (#338)

* adding rules for swap files to .gitignore
* main, d2common: load Magic/Rare/Unique Affix
* d2common: item affixes only
removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.
* removed debug print from item_affix.go
* changed item affix type names for clarity, removed debug print from data_dictionary
* d2common: item affix datadict and records
Item Affixes are defined in `/data/global/excel/Magic{Prefix,Suffix}.txt`
Rare and Unique Pre/Suffixes seem to be for monsters, not items.
d2common: item affixes only
removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.
removed debug print from item_affix.go
changed item affix type names for clarity, removed debug print from data_dictionary
* adding ItemStatCost data dict loader
* removed call to append, added records to exported array
This commit is contained in:
dk 2020-06-18 19:39:57 -07:00 committed by GitHub
parent 2da08884c4
commit f06d4b2c68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -241,9 +241,9 @@ stuff
var ItemStatCosts map[string]*ItemStatCostRecord
func LoadItemStatCosts(file []byte) {
ItemStatCosts = make(map[string]*ItemStatCostRecord, 0)
d := d2common.LoadDataDictionary(string(file))
r := make([]*ItemStatCostRecord, 0)
numRecords := len(d.Data)
ItemStatCosts = make(map[string]*ItemStatCostRecord, numRecords)
for idx, _ := range d.Data {
record := &ItemStatCostRecord{
@ -314,7 +314,7 @@ func LoadItemStatCosts(file []byte) {
Stuff: d.GetString("stuff", idx),
}
r = append(r, record)
ItemStatCosts[record.Name] = record
}
log.Printf("Loaded %d ItemStatCost records", len(r))
log.Printf("Loaded %d ItemStatCost records", len(ItemStatCosts))
}