mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-11-18 02:16:23 -05:00
Cleanup d2records logging
This commit is contained in:
parent
7509a0d963
commit
c7288eec38
@ -22,7 +22,7 @@ func armorTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Animation.Token.Armor = records
|
||||
|
||||
r.Logger.Infof("Loaded %d ArmorType records", len(records))
|
||||
r.Debugf("Loaded %d ArmorType records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ func autoMagicLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d AutoMagic records", len(records))
|
||||
r.Debugf("Loaded %d AutoMagic records", len(records))
|
||||
|
||||
r.Item.AutoMagic = records
|
||||
|
||||
|
@ -37,7 +37,7 @@ func autoMapLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d AutoMapRecord records", len(records))
|
||||
r.Debugf("Loaded %d AutoMap records", len(records))
|
||||
|
||||
r.Level.AutoMaps = records
|
||||
|
||||
|
@ -102,7 +102,7 @@ func beltsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d belts", len(records))
|
||||
r.Debugf("Loaded %d Belt records", len(records))
|
||||
|
||||
r.Item.Belts = records
|
||||
|
||||
|
@ -19,7 +19,7 @@ func bodyLocationsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
panic(d.Err)
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d Body Location records", len(records))
|
||||
r.Debugf("Loaded %d BodyLocation records", len(records))
|
||||
|
||||
r.BodyLocations = records
|
||||
|
||||
|
@ -8,7 +8,7 @@ func booksLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
records := make(Books)
|
||||
|
||||
for d.Next() {
|
||||
record := &BooksRecord{
|
||||
record := &BookRecord{
|
||||
Name: d.String("Name"),
|
||||
Namco: d.String("Namco"),
|
||||
Completed: d.String("Completed"),
|
||||
@ -28,7 +28,7 @@ func booksLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
panic(d.Err)
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d book items", len(records))
|
||||
r.Debugf("Loaded %d Book records", len(records))
|
||||
|
||||
r.Item.Books = records
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
package d2records
|
||||
|
||||
// Books stores all of the BooksRecords
|
||||
type Books map[string]*BooksRecord
|
||||
// Books stores all of the BookRecords
|
||||
type Books map[string]*BookRecord
|
||||
|
||||
// BooksRecord is a representation of a row from books.txt
|
||||
type BooksRecord struct {
|
||||
// BookRecord is a representation of a row from books.txt
|
||||
type BookRecord struct {
|
||||
Name string
|
||||
Namco string // The displayed name, where the string prefix is "Tome"
|
||||
Completed string
|
||||
|
@ -5,32 +5,28 @@ import (
|
||||
)
|
||||
|
||||
func skillCalcLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
records, err := loadCalculations(r, d)
|
||||
records, err := loadCalculations(r, d, "Skill")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d Skill Calculation records", len(records))
|
||||
|
||||
r.Calculation.Skills = records
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func missileCalcLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
records, err := loadCalculations(r, d)
|
||||
records, err := loadCalculations(r, d, "Missile")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d Missile Calculation records", len(records))
|
||||
|
||||
r.Calculation.Missiles = records
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func loadCalculations(r *RecordManager, d *d2txt.DataDictionary) (Calculations, error) {
|
||||
func loadCalculations(r *RecordManager, d *d2txt.DataDictionary, name string) (Calculations, error) {
|
||||
records := make(Calculations)
|
||||
|
||||
for d.Next() {
|
||||
@ -45,7 +41,7 @@ func loadCalculations(r *RecordManager, d *d2txt.DataDictionary) (Calculations,
|
||||
return nil, d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d Skill Calculation records", len(records))
|
||||
r.Debugf("Loaded %d %s Calculation records", len(records), name)
|
||||
|
||||
return records, nil
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ func charStatsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d CharStats records", len(records))
|
||||
r.Debugf("Loaded %d CharStat records", len(records))
|
||||
|
||||
r.Character.Stats = records
|
||||
|
||||
|
@ -22,7 +22,7 @@ func colorsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Colors = records
|
||||
|
||||
r.Logger.Infof("Loaded %d Color records", len(records))
|
||||
r.Debugf("Loaded %d Color records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ func componentCodesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d ComponentCode records", len(records))
|
||||
r.Debugf("Loaded %d ComponentCode records", len(records))
|
||||
|
||||
r.ComponentCodes = records
|
||||
|
||||
|
@ -22,7 +22,7 @@ func compositeTypeLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Animation.Token.Composite = records
|
||||
|
||||
r.Logger.Infof("Loaded %d Composite Type records", len(records))
|
||||
r.Debugf("Loaded %d CompositeType records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ func cubeModifierLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Item.Cube.Modifiers = records
|
||||
|
||||
r.Logger.Infof("Loaded %d Cube Modifier records", len(records))
|
||||
r.Debugf("Loaded %d CubeModifier records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ func cubeTypeLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Item.Cube.Types = records
|
||||
|
||||
r.Logger.Infof("Loaded %d Cube Type records", len(records))
|
||||
r.Debugf("Loaded %d CubeType records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ func cubeRecipeLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d CubeMainRecord records", len(records))
|
||||
r.Debugf("Loaded %d CubeRecipe records", len(records))
|
||||
|
||||
r.Item.Cube.Recipes = records
|
||||
|
||||
|
@ -42,7 +42,7 @@ func difficultyLevelsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d DifficultyLevel records", len(records))
|
||||
r.Debugf("Loaded %d DifficultyLevel records", len(records))
|
||||
|
||||
r.DifficultyLevels = records
|
||||
|
||||
|
@ -20,7 +20,7 @@ func elemTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d ElemType records", len(records))
|
||||
r.Debugf("Loaded %d ElemType records", len(records))
|
||||
|
||||
r.ElemTypes = records
|
||||
|
||||
|
@ -20,7 +20,7 @@ func eventsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d Event records", len(records))
|
||||
r.Debugf("Loaded %d Event records", len(records))
|
||||
|
||||
r.Character.Events = records
|
||||
|
||||
|
@ -48,7 +48,7 @@ func experienceLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
}
|
||||
|
||||
for d.Next() {
|
||||
record := &ExperienceBreakpointsRecord{
|
||||
record := &ExperienceBreakpointRecord{
|
||||
Level: d.Number("Level"),
|
||||
HeroBreakpoints: map[d2enum.Hero]int{
|
||||
d2enum.HeroAmazon: d.Number("Amazon"),
|
||||
@ -68,7 +68,7 @@ func experienceLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d Experience Breakpoint records", len(breakpoints))
|
||||
r.Debugf("Loaded %d ExperienceBreakpoint records", len(breakpoints))
|
||||
|
||||
r.Character.MaxLevel = maxLevels
|
||||
r.Character.Experience = breakpoints
|
||||
|
@ -4,14 +4,14 @@ import "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
|
||||
|
||||
// ExperienceBreakpoints describes the required experience
|
||||
// for each level for each character class
|
||||
type ExperienceBreakpoints map[int]*ExperienceBreakpointsRecord
|
||||
type ExperienceBreakpoints map[int]*ExperienceBreakpointRecord
|
||||
|
||||
// ExperienceMaxLevels defines the max character levels
|
||||
type ExperienceMaxLevels map[d2enum.Hero]int
|
||||
|
||||
// ExperienceBreakpointsRecord describes the experience points required to
|
||||
// ExperienceBreakpointRecord describes the experience points required to
|
||||
// gain a level for all character classes
|
||||
type ExperienceBreakpointsRecord struct {
|
||||
type ExperienceBreakpointRecord struct {
|
||||
Level int
|
||||
HeroBreakpoints map[d2enum.Hero]int
|
||||
Ratio int
|
||||
|
@ -19,7 +19,7 @@ func gambleLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d gamble records", len(records))
|
||||
r.Debugf("Loaded %d Gamble records", len(records))
|
||||
|
||||
r.Gamble = records
|
||||
|
||||
|
@ -4,12 +4,12 @@ import (
|
||||
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2txt"
|
||||
)
|
||||
|
||||
// LoadGems loads gem records into a map[string]*GemsRecord
|
||||
// LoadGems loads gem records into a map[string]*GemRecord
|
||||
func gemsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
records := make(Gems)
|
||||
|
||||
for d.Next() {
|
||||
gem := &GemsRecord{
|
||||
gem := &GemRecord{
|
||||
Name: d.String("name"),
|
||||
Letter: d.String("letter"),
|
||||
Transform: d.Number("transform"),
|
||||
@ -60,7 +60,7 @@ func gemsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d Gems records", len(records))
|
||||
r.Debugf("Loaded %d Gem records", len(records))
|
||||
|
||||
r.Item.Gems = records
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
package d2records
|
||||
|
||||
// Gems stores all of the GemsRecords
|
||||
type Gems map[string]*GemsRecord
|
||||
// Gems stores all of the GemRecords
|
||||
type Gems map[string]*GemRecord
|
||||
|
||||
// GemsRecord is a representation of a single row of gems.txt
|
||||
// GemRecord is a representation of a single row of gems.txt
|
||||
// it describes the properties of socketable items
|
||||
type GemsRecord struct {
|
||||
type GemRecord struct {
|
||||
Name string
|
||||
Letter string
|
||||
Transform int
|
||||
|
@ -22,7 +22,7 @@ func hirelingDescriptionLoader(r *RecordManager, d *d2txt.DataDictionary) error
|
||||
|
||||
r.Hireling.Descriptions = records
|
||||
|
||||
r.Logger.Infof("Loaded %d Hireling Descriptions records", len(records))
|
||||
r.Debugf("Loaded %d HirelingDescription records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ func hirelingLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d Hireling records", len(records))
|
||||
r.Debugf("Loaded %d Hireling records", len(records))
|
||||
|
||||
r.Hireling.Details = records
|
||||
|
||||
|
@ -22,7 +22,7 @@ func hitClassLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Animation.Token.HitClass = records
|
||||
|
||||
r.Logger.Infof("Loaded %d HitClass records", len(records))
|
||||
r.Debugf("Loaded %d HitClass records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ func inventoryLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d Inventory Panel records", len(records))
|
||||
r.Debugf("Loaded %d Inventory records", len(records))
|
||||
|
||||
r.Layout.Inventory = records
|
||||
|
||||
|
@ -70,7 +70,7 @@ func loadAffixDictionary(
|
||||
}
|
||||
|
||||
name := getAffixString(superType, subType)
|
||||
r.Logger.Infof("Loaded %d %s records", len(records), name)
|
||||
r.Debugf("Loaded %d %s records", len(records), name)
|
||||
|
||||
return records, groups, nil
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ func armorLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d armors", len(records))
|
||||
r.Debugf("Loaded %d Armor Item records", len(records))
|
||||
|
||||
r.Item.Armors = records
|
||||
|
||||
|
@ -21,7 +21,7 @@ func lowQualityLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Item.LowQualityPrefixes = records
|
||||
|
||||
r.Logger.Infof("Loaded %d Low Item Quality records", len(records))
|
||||
r.Debugf("Loaded %d LowQuality records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ func miscItemsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d misc items", len(records))
|
||||
r.Debugf("Loaded %d Misc Item records", len(records))
|
||||
|
||||
r.Item.Misc = records
|
||||
|
||||
|
@ -45,7 +45,7 @@ func itemQualityLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Item.Quality = records
|
||||
|
||||
r.Logger.Infof("Loaded %d ItemQualities records", len(records))
|
||||
r.Debugf("Loaded %d ItemQuality records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ func itemRatioLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d ItemRatio records", len(records))
|
||||
r.Debugf("Loaded %d ItemRatio records", len(records))
|
||||
|
||||
r.Item.Ratios = records
|
||||
|
||||
|
@ -76,7 +76,7 @@ func itemTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d ItemType records", len(records))
|
||||
r.Debugf("Loaded %d ItemType records", len(records))
|
||||
|
||||
r.Item.Types = records
|
||||
r.Item.Equivalency = equivMap
|
||||
|
@ -13,7 +13,7 @@ func weaponsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d weapons", len(records))
|
||||
r.Debugf("Loaded %d Weapon records", len(records))
|
||||
|
||||
r.Item.Weapons = records
|
||||
|
||||
|
@ -95,7 +95,7 @@ func itemStatCostLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d ItemStatCost records", len(records))
|
||||
r.Debugf("Loaded %d ItemStatCost records", len(records))
|
||||
|
||||
r.Item.Stats = records
|
||||
|
||||
|
@ -11,7 +11,7 @@ func levelDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
records := make(LevelDetails)
|
||||
|
||||
for d.Next() {
|
||||
record := &LevelDetailsRecord{
|
||||
record := &LevelDetailRecord{
|
||||
Name: d.String("Name "),
|
||||
ID: d.Number("Id"),
|
||||
Palette: d.Number("Pal"),
|
||||
@ -165,7 +165,7 @@ func levelDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d LevelDetails records", len(records))
|
||||
r.Debugf("Loaded %d LevelDetail records", len(records))
|
||||
|
||||
r.Level.Details = records
|
||||
|
||||
|
@ -2,13 +2,13 @@ package d2records
|
||||
|
||||
import "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
|
||||
|
||||
// LevelDetails has all of the LevelDetailsRecords
|
||||
type LevelDetails map[int]*LevelDetailsRecord
|
||||
// LevelDetails has all of the LevelDetailRecords
|
||||
type LevelDetails map[int]*LevelDetailRecord
|
||||
|
||||
// LevelDetailsRecord is a representation of a row from levels.txt
|
||||
// LevelDetailRecord is a representation of a row from levels.txt
|
||||
// it describes lots of things about the levels, like where they are connected,
|
||||
// what kinds of monsters spawn, the level generator type, and lots of other stuff.
|
||||
type LevelDetailsRecord struct {
|
||||
type LevelDetailRecord struct {
|
||||
|
||||
// Name
|
||||
// This column has no function, it only serves as a comment field to make it
|
||||
|
@ -8,7 +8,7 @@ func levelMazeDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
records := make(LevelMazeDetails)
|
||||
|
||||
for d.Next() {
|
||||
record := &LevelMazeDetailsRecord{
|
||||
record := &LevelMazeDetailRecord{
|
||||
Name: d.String("Name"),
|
||||
LevelID: d.Number("Level"),
|
||||
NumRoomsNormal: d.Number("Rooms"),
|
||||
@ -24,7 +24,7 @@ func levelMazeDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d LevelMazeDetails records", len(records))
|
||||
r.Debugf("Loaded %d LevelMazeDetail records", len(records))
|
||||
|
||||
r.Level.Maze = records
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
package d2records
|
||||
|
||||
// LevelMazeDetails stores all of the LevelMazeDetailsRecords
|
||||
type LevelMazeDetails map[int]*LevelMazeDetailsRecord
|
||||
// LevelMazeDetails stores all of the LevelMazeDetailRecords
|
||||
type LevelMazeDetails map[int]*LevelMazeDetailRecord
|
||||
|
||||
// LevelMazeDetailsRecord is a representation of a row from lvlmaze.txt
|
||||
// LevelMazeDetailRecord is a representation of a row from lvlmaze.txt
|
||||
// these records define the parameters passed to the maze level generator
|
||||
type LevelMazeDetailsRecord struct {
|
||||
type LevelMazeDetailRecord struct {
|
||||
// descriptive, not loaded in game. Corresponds with Name field in
|
||||
// Levels.txt
|
||||
Name string // Name
|
||||
|
@ -42,7 +42,7 @@ func levelPresetLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
records[record.DefinitionID] = record
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d level presets", len(records))
|
||||
r.Debugf("Loaded %d LevelPresets records", len(records))
|
||||
|
||||
if d.Err != nil {
|
||||
return d.Err
|
||||
|
@ -40,7 +40,7 @@ func levelSubstitutionsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d LevelSubstitution records", len(records))
|
||||
r.Debugf("Loaded %d LevelSubstitution records", len(records))
|
||||
|
||||
r.Level.Sub = records
|
||||
|
||||
|
@ -58,7 +58,7 @@ func levelTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d LevelType records", len(records))
|
||||
r.Debugf("Loaded %d LevelType records", len(records))
|
||||
|
||||
r.Level.Types = records
|
||||
|
||||
|
@ -30,7 +30,7 @@ func levelWarpsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d level warps", len(records))
|
||||
r.Debugf("Loaded %d LevelWarp records", len(records))
|
||||
|
||||
r.Level.Warp = records
|
||||
|
||||
|
@ -304,7 +304,7 @@ func missilesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d Missile Records", len(records))
|
||||
r.Debugf("Loaded %d Missile records", len(records))
|
||||
|
||||
r.Missiles = records
|
||||
|
||||
|
@ -19,7 +19,7 @@ func monsterAiLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d MonsterAI records", len(records))
|
||||
r.Debugf("Loaded %d MonsterAI records", len(records))
|
||||
|
||||
r.Monster.AI = records
|
||||
|
||||
|
@ -49,7 +49,7 @@ func monsterEquipmentLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
length += len(records[k])
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d MonsterEquipment records", length)
|
||||
r.Debugf("Loaded %d MonsterEquipment records", length)
|
||||
|
||||
r.Monster.Equipment = records
|
||||
|
||||
|
@ -52,7 +52,7 @@ func monsterLevelsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d MonsterLevel records", len(records))
|
||||
r.Debugf("Loaded %d MonsterLevel records", len(records))
|
||||
|
||||
r.Monster.Levels = records
|
||||
|
||||
|
@ -21,7 +21,7 @@ func monsterModeLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d MonMode records", len(records))
|
||||
r.Debugf("Loaded %d MonMode records", len(records))
|
||||
|
||||
r.Monster.Modes = records
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package d2records
|
||||
|
||||
// MonModes stores all of the GemsRecords
|
||||
// MonModes stores all of the MonModeRecords
|
||||
type MonModes map[string]*MonModeRecord
|
||||
|
||||
// MonModeRecord is a representation of a single row of Monmode.txt
|
||||
|
@ -18,7 +18,7 @@ func monsterPlacementsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Monster.Placements = records
|
||||
|
||||
r.Logger.Infof("Loaded %d MonsterPlacement records", len(records))
|
||||
r.Debugf("Loaded %d MonsterPlacement records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ func monsterPresetLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d MonPreset records", len(records))
|
||||
r.Debugf("Loaded %d MonPreset records", len(records))
|
||||
|
||||
r.Monster.Presets = records
|
||||
|
||||
|
@ -57,7 +57,7 @@ func monsterPropertiesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d MonProp records", len(records))
|
||||
r.Debugf("Loaded %d MonProp records", len(records))
|
||||
|
||||
r.Monster.Props = records
|
||||
|
||||
|
@ -31,7 +31,7 @@ func monsterSequencesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d MonsterSequence records", len(records))
|
||||
r.Debugf("Loaded %d MonsterSequence records", len(records))
|
||||
|
||||
r.Monster.Sequences = records
|
||||
|
||||
|
@ -57,7 +57,7 @@ func monsterSoundsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d Monster Sound records", len(records))
|
||||
r.Debugf("Loaded %d MonsterSound records", len(records))
|
||||
|
||||
r.Monster.Sounds = records
|
||||
|
||||
|
@ -161,7 +161,7 @@ func monsterStats2Loader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
panic(d.Err)
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d MonStats2 records", len(records))
|
||||
r.Debugf("Loaded %d MonStat2 records", len(records))
|
||||
|
||||
r.Monster.Stats2 = records
|
||||
|
||||
|
@ -272,7 +272,7 @@ func monsterStatsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d MonStats records", len(records))
|
||||
r.Debugf("Loaded %d MonStat records", len(records))
|
||||
|
||||
r.Monster.Stats = records
|
||||
|
||||
|
@ -40,7 +40,7 @@ func monsterSuperUniqeLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Monster.Unique.Super = records
|
||||
|
||||
r.Logger.Infof("Loaded %d SuperUnique records", len(records))
|
||||
r.Debugf("Loaded %d SuperUnique records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ func monsterTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
panic(d.Err)
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d MonType records", len(records))
|
||||
r.Debugf("Loaded %d MonType records", len(records))
|
||||
|
||||
r.Monster.Types = records
|
||||
|
||||
|
@ -59,7 +59,7 @@ func uniqueMonsterPrefixLoader(r *RecordManager, d *d2txt.DataDictionary) error
|
||||
|
||||
r.Monster.Name.Prefix = records
|
||||
|
||||
r.Logger.Infof("Loaded %d unique monster prefix records", len(records))
|
||||
r.Debugf("Loaded %d UniqueMonsterPrefix records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
@ -72,7 +72,7 @@ func uniqueMonsterSuffixLoader(r *RecordManager, d *d2txt.DataDictionary) error
|
||||
|
||||
r.Monster.Name.Suffix = records
|
||||
|
||||
r.Logger.Infof("Loaded %d unique monster suffix records", len(records))
|
||||
r.Debugf("Loaded %d UniqueMonsterSuffix records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ func monsterUniqModifiersLoader(r *RecordManager, d *d2txt.DataDictionary) error
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d MonsterUniqueModifier records", len(records))
|
||||
r.Debugf("Loaded %d MonsterUniqueModifier records", len(records))
|
||||
|
||||
r.Monster.Unique.Mods = records
|
||||
r.Monster.Unique.Constants = constants
|
||||
|
@ -64,7 +64,7 @@ func npcLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.NPCs = records
|
||||
|
||||
r.Logger.Infof("Loaded %d NPC records", len(records))
|
||||
r.Debugf("Loaded %d NPC records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ func objectDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d objects", len(records))
|
||||
r.Debugf("Loaded %d ObjectDetail records", len(records))
|
||||
|
||||
r.Object.Details = records
|
||||
|
||||
|
@ -32,7 +32,7 @@ func objectGroupsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d ObjectGroup records", len(records))
|
||||
r.Debugf("Loaded %d ObjectGroup records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ func objectModesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Object.Modes = records
|
||||
|
||||
r.Logger.Infof("Loaded %d ObjectMode records", len(records))
|
||||
r.Debugf("Loaded %d ObjectMode records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ func objectTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d object types", len(records))
|
||||
r.Debugf("Loaded %d ObjectType records", len(records))
|
||||
|
||||
r.Object.Types = records
|
||||
|
||||
|
@ -35,7 +35,7 @@ func overlaysLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d Overlay records", len(records))
|
||||
r.Debugf("Loaded %d Overlay records", len(records))
|
||||
|
||||
r.Layout.Overlays = records
|
||||
|
||||
|
@ -39,7 +39,7 @@ func petTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d PetType records", len(records))
|
||||
r.Debugf("Loaded %d PetType records", len(records))
|
||||
|
||||
r.PetTypes = records
|
||||
|
||||
|
@ -29,7 +29,7 @@ func playerClassLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return d.Err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d PlayerClass records", len(records))
|
||||
r.Debugf("Loaded %d PlayerClass records", len(records))
|
||||
|
||||
r.Character.Classes = records
|
||||
|
||||
|
@ -23,7 +23,7 @@ func playerModesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Character.Modes = records
|
||||
|
||||
r.Logger.Infof("Loaded %d PlayerMode records", len(records))
|
||||
r.Debugf("Loaded %d PlayerMode records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ func playerTypeLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
panic(d.Err)
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d PlayerType records", len(records))
|
||||
r.Debugf("Loaded %d PlayerType records", len(records))
|
||||
|
||||
r.Animation.Token.Player = records
|
||||
|
||||
|
@ -67,7 +67,7 @@ func propertyLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Properties = records
|
||||
|
||||
r.Logger.Infof("Loaded %d Property records", len(records))
|
||||
r.Debugf("Loaded %d Property records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ func rareItemPrefixLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Item.Rare.Prefix = records
|
||||
|
||||
r.Logger.Infof("Loaded %d RarePrefix records", len(records))
|
||||
r.Debugf("Loaded %d RarePrefix records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ func rareItemSuffixLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
return err
|
||||
}
|
||||
|
||||
r.Logger.Infof("Loaded %d RareSuffix records", len(records))
|
||||
r.Debugf("Loaded %d RareSuffix records", len(records))
|
||||
|
||||
r.Item.Rare.Suffix = records
|
||||
|
||||
|
@ -334,8 +334,8 @@ func (r *RecordManager) GetExperienceBreakpoint(heroType d2enum.Hero, level int)
|
||||
return r.Character.Experience[level].HeroBreakpoints[heroType]
|
||||
}
|
||||
|
||||
// GetLevelDetails gets a LevelDetailsRecord by the record Id
|
||||
func (r *RecordManager) GetLevelDetails(id int) *LevelDetailsRecord {
|
||||
// GetLevelDetails gets a LevelDetailRecord by the record Id
|
||||
func (r *RecordManager) GetLevelDetails(id int) *LevelDetailRecord {
|
||||
for i := 0; i < len(r.Level.Details); i++ {
|
||||
if r.Level.Details[i].ID == id {
|
||||
return r.Level.Details[i]
|
||||
|
@ -24,12 +24,12 @@ const (
|
||||
fmtRunewordPropMax = "T1Max%d"
|
||||
)
|
||||
|
||||
// Loadrecords loads runes records into a map[string]*RunesRecord
|
||||
// Loadrecords loads runes records into a map[string]*RuneRecord
|
||||
func runewordLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
records := make(map[string]*RunesRecord)
|
||||
records := make(map[string]*RuneRecord)
|
||||
|
||||
for d.Next() {
|
||||
record := &RunesRecord{
|
||||
record := &RuneRecord{
|
||||
Name: d.String("name"),
|
||||
RuneName: d.String("Rune Name"),
|
||||
Complete: d.Bool("complete"),
|
||||
@ -89,7 +89,7 @@ func runewordLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Item.Runewords = records
|
||||
|
||||
r.Logger.Infof("Loaded %d records records", len(records))
|
||||
r.Debugf("Loaded %d Rune records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
package d2records
|
||||
|
||||
// Runewords stores all of the RunesRecords
|
||||
type Runewords map[string]*RunesRecord
|
||||
// Runewords stores all of the RuneRecords
|
||||
type Runewords map[string]*RuneRecord
|
||||
|
||||
// RunesRecord is a representation of a single row of runes.txt. It defines
|
||||
// RuneRecord is a representation of a single row of runes.txt. It defines
|
||||
// runewords available in the game.
|
||||
type RunesRecord struct {
|
||||
type RuneRecord struct {
|
||||
Name string
|
||||
RuneName string // More of a note - the actual name should be read from the TBL files.
|
||||
Complete bool // An enabled/disabled flag. Only "Complete" runewords work in game.
|
||||
|
@ -94,7 +94,7 @@ func setItemLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Item.SetItems = records
|
||||
|
||||
r.Logger.Infof("Loaded %d SetItem records", len(records))
|
||||
r.Debugf("Loaded %d SetItem records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ func setLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Item.Sets = records
|
||||
|
||||
r.Logger.Infof("Loaded %d records records", len(records))
|
||||
r.Debugf("Loaded %d Set records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ func shrineLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Object.Shrines = records
|
||||
|
||||
r.Logger.Infof("Loaded %d shrines", len(records))
|
||||
r.Debugf("Loaded %d Shrine records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ func skillDescriptionLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Skill.Descriptions = records
|
||||
|
||||
r.Logger.Infof("Loaded %d Skill Description records", len(records))
|
||||
r.Debugf("Loaded %d SkillDescription records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ func skillDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Skill.Details = records
|
||||
|
||||
r.Logger.Infof("Loaded %d Skill records", len(records))
|
||||
r.Debugf("Loaded %d Skill records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ func soundDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Sound.Details = records
|
||||
|
||||
r.Logger.Infof("Loaded %d sound definitions", len(records))
|
||||
r.Debugf("Loaded %d SoundDetail records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ func soundEnvironmentLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Sound.Environment = records
|
||||
|
||||
r.Logger.Infof("Loaded %d SoundEnviron records", len(records))
|
||||
r.Debugf("Loaded %d SoundEnviron records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ func statesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.States = records
|
||||
|
||||
r.Logger.Infof("Loaded %d State records", len(records))
|
||||
r.Debugf("Loaded %d State records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ func storePagesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Item.StorePages = records
|
||||
|
||||
r.Logger.Infof("Loaded %d StorePage records", len(records))
|
||||
r.Debugf("Loaded %d StorePage records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ func treasureClassLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Item.Treasure.Normal = records
|
||||
|
||||
r.Logger.Infof("Loaded %d treasure class (normal) records", len(records))
|
||||
r.Debugf("Loaded %d TreasureClass (normal) records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
@ -33,7 +33,7 @@ func treasureClassExLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Item.Treasure.Expansion = records
|
||||
|
||||
r.Logger.Infof("Loaded %d treasure class (expansion) records", len(records))
|
||||
r.Debugf("Loaded %d TreasureClass (expansion) records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ func uniqueAppellationsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Monster.Unique.Appellations = records
|
||||
|
||||
r.Logger.Infof("Loaded %d UniqueAppellation records", len(records))
|
||||
r.Debugf("Loaded %d UniqueAppellation records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ func uniqueItemsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Item.Unique = records
|
||||
|
||||
r.Logger.Infof("Loaded %d unique items", len(records))
|
||||
r.Debugf("Loaded %d UniqueItem records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ func weaponClassesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
|
||||
r.Animation.Token.Weapon = records
|
||||
|
||||
r.Logger.Infof("Loaded %d WeaponClass records", len(records))
|
||||
r.Debugf("Loaded %d WeaponClass records", len(records))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user