mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-11-07 10:47:19 -05:00
commit
a4a7c8d7e7
@ -31,7 +31,7 @@ const originalFPS float64 = 25
|
|||||||
// A Sound that can be started and stopped
|
// A Sound that can be started and stopped
|
||||||
type Sound struct {
|
type Sound struct {
|
||||||
effect d2interface.SoundEffect
|
effect d2interface.SoundEffect
|
||||||
entry *d2records.SoundDetailsRecord
|
entry *d2records.SoundDetailRecord
|
||||||
volume float64
|
volume float64
|
||||||
vTarget float64
|
vTarget float64
|
||||||
vRate float64
|
vRate float64
|
||||||
|
@ -110,7 +110,7 @@ func (f *HeroStateFactory) GetAllHeroStates() ([]*HeroState, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CreateHeroSkillsState will assemble the hero skills from the class stats record.
|
// CreateHeroSkillsState will assemble the hero skills from the class stats record.
|
||||||
func (f *HeroStateFactory) CreateHeroSkillsState(classStats *d2records.CharStatsRecord, heroType d2enum.Hero) (map[int]*HeroSkill, error) {
|
func (f *HeroStateFactory) CreateHeroSkillsState(classStats *d2records.CharStatRecord, heroType d2enum.Hero) (map[int]*HeroSkill, error) {
|
||||||
baseSkills := map[int]*HeroSkill{}
|
baseSkills := map[int]*HeroSkill{}
|
||||||
|
|
||||||
for idx := range classStats.BaseSkill {
|
for idx := range classStats.BaseSkill {
|
||||||
|
@ -30,7 +30,7 @@ type HeroStatsState struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CreateHeroStatsState generates a running state from a hero stats.
|
// CreateHeroStatsState generates a running state from a hero stats.
|
||||||
func (f *HeroStateFactory) CreateHeroStatsState(heroClass d2enum.Hero, classStats *d2records.CharStatsRecord) *HeroStatsState {
|
func (f *HeroStateFactory) CreateHeroStatsState(heroClass d2enum.Hero, classStats *d2records.CharStatRecord) *HeroStatsState {
|
||||||
result := HeroStatsState{
|
result := HeroStatsState{
|
||||||
Level: 1,
|
Level: 1,
|
||||||
Experience: 0,
|
Experience: 0,
|
||||||
|
@ -277,7 +277,7 @@ var itemStatCosts = map[string]*d2records.ItemStatCostRecord{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// nolint:gochecknoglobals // just a test
|
// nolint:gochecknoglobals // just a test
|
||||||
var charStats = map[d2enum.Hero]*d2records.CharStatsRecord{
|
var charStats = map[d2enum.Hero]*d2records.CharStatRecord{
|
||||||
d2enum.HeroPaladin: {
|
d2enum.HeroPaladin: {
|
||||||
Class: d2enum.HeroPaladin,
|
Class: d2enum.HeroPaladin,
|
||||||
SkillStrAll: "to Paladin Skill Levels",
|
SkillStrAll: "to Paladin Skill Levels",
|
||||||
@ -297,7 +297,7 @@ var skillDetails = map[int]*d2records.SkillRecord{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// nolint:gochecknoglobals // just a test
|
// nolint:gochecknoglobals // just a test
|
||||||
var monStats = map[string]*d2records.MonStatsRecord{
|
var monStats = map[string]*d2records.MonStatRecord{
|
||||||
"Specter": {NameString: "Specter", ID: 40},
|
"Specter": {NameString: "Specter", ID: 40},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ func (f *MapEntityFactory) NewItem(x, y int, codes ...string) (*Item, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewNPC creates a new NPC and returns a pointer to it.
|
// NewNPC creates a new NPC and returns a pointer to it.
|
||||||
func (f *MapEntityFactory) NewNPC(x, y int, monstat *d2records.MonStatsRecord, direction int) (*NPC, error) {
|
func (f *MapEntityFactory) NewNPC(x, y int, monstat *d2records.MonStatRecord, direction int) (*NPC, error) {
|
||||||
// https://github.com/OpenDiablo2/OpenDiablo2/issues/803
|
// https://github.com/OpenDiablo2/OpenDiablo2/issues/803
|
||||||
result := &NPC{
|
result := &NPC{
|
||||||
mapEntity: newMapEntity(x, y),
|
mapEntity: newMapEntity(x, y),
|
||||||
@ -263,7 +263,7 @@ func (f *MapEntityFactory) NewCastOverlay(x, y int, overlayRecord *d2records.Ove
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewObject creates an instance of AnimatedComposite
|
// NewObject creates an instance of AnimatedComposite
|
||||||
func (f *MapEntityFactory) NewObject(x, y int, objectRec *d2records.ObjectDetailsRecord,
|
func (f *MapEntityFactory) NewObject(x, y int, objectRec *d2records.ObjectDetailRecord,
|
||||||
palettePath string) (*Object, error) {
|
palettePath string) (*Object, error) {
|
||||||
locX, locY := float64(x), float64(y)
|
locX, locY := float64(x), float64(y)
|
||||||
entity := &Object{
|
entity := &Object{
|
||||||
|
@ -22,8 +22,8 @@ type NPC struct {
|
|||||||
action int
|
action int
|
||||||
path int
|
path int
|
||||||
repetitions int
|
repetitions int
|
||||||
monstatRecord *d2records.MonStatsRecord
|
monstatRecord *d2records.MonStatRecord
|
||||||
monstatEx *d2records.MonStats2Record
|
monstatEx *d2records.MonStat2Record
|
||||||
HasPaths bool
|
HasPaths bool
|
||||||
isDone bool
|
isDone bool
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ type Object struct {
|
|||||||
composite *d2asset.Composite
|
composite *d2asset.Composite
|
||||||
highlight bool
|
highlight bool
|
||||||
// nameLabel d2ui.Label
|
// nameLabel d2ui.Label
|
||||||
objectRecord *d2records.ObjectDetailsRecord
|
objectRecord *d2records.ObjectDetailRecord
|
||||||
drawLayer int
|
drawLayer int
|
||||||
name string
|
name string
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ func armorTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Animation.Token.Armor = records
|
r.Animation.Token.Armor = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d ArmorType records", len(records))
|
r.Debugf("Loaded %d ArmorType records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ func autoMagicLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d AutoMagic records", len(records))
|
r.Debugf("Loaded %d AutoMagic records", len(records))
|
||||||
|
|
||||||
r.Item.AutoMagic = records
|
r.Item.AutoMagic = records
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ func autoMapLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d AutoMapRecord records", len(records))
|
r.Debugf("Loaded %d AutoMap records", len(records))
|
||||||
|
|
||||||
r.Level.AutoMaps = records
|
r.Level.AutoMaps = records
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ func beltsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d belts", len(records))
|
r.Debugf("Loaded %d Belt records", len(records))
|
||||||
|
|
||||||
r.Item.Belts = records
|
r.Item.Belts = records
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ func bodyLocationsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
panic(d.Err)
|
panic(d.Err)
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d Body Location records", len(records))
|
r.Debugf("Loaded %d BodyLocation records", len(records))
|
||||||
|
|
||||||
r.BodyLocations = records
|
r.BodyLocations = records
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ func booksLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
records := make(Books)
|
records := make(Books)
|
||||||
|
|
||||||
for d.Next() {
|
for d.Next() {
|
||||||
record := &BooksRecord{
|
record := &BookRecord{
|
||||||
Name: d.String("Name"),
|
Name: d.String("Name"),
|
||||||
Namco: d.String("Namco"),
|
Namco: d.String("Namco"),
|
||||||
Completed: d.String("Completed"),
|
Completed: d.String("Completed"),
|
||||||
@ -28,7 +28,7 @@ func booksLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
panic(d.Err)
|
panic(d.Err)
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d book items", len(records))
|
r.Debugf("Loaded %d Book records", len(records))
|
||||||
|
|
||||||
r.Item.Books = records
|
r.Item.Books = records
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package d2records
|
package d2records
|
||||||
|
|
||||||
// Books stores all of the BooksRecords
|
// Books stores all of the BookRecords
|
||||||
type Books map[string]*BooksRecord
|
type Books map[string]*BookRecord
|
||||||
|
|
||||||
// BooksRecord is a representation of a row from books.txt
|
// BookRecord is a representation of a row from books.txt
|
||||||
type BooksRecord struct {
|
type BookRecord struct {
|
||||||
Name string
|
Name string
|
||||||
Namco string // The displayed name, where the string prefix is "Tome"
|
Namco string // The displayed name, where the string prefix is "Tome"
|
||||||
Completed string
|
Completed string
|
||||||
|
@ -5,32 +5,28 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func skillCalcLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
func skillCalcLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||||
records, err := loadCalculations(r, d)
|
records, err := loadCalculations(r, d, "Skill")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d Skill Calculation records", len(records))
|
|
||||||
|
|
||||||
r.Calculation.Skills = records
|
r.Calculation.Skills = records
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func missileCalcLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
func missileCalcLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||||
records, err := loadCalculations(r, d)
|
records, err := loadCalculations(r, d, "Missile")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d Missile Calculation records", len(records))
|
|
||||||
|
|
||||||
r.Calculation.Missiles = records
|
r.Calculation.Missiles = records
|
||||||
|
|
||||||
return nil
|
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)
|
records := make(Calculations)
|
||||||
|
|
||||||
for d.Next() {
|
for d.Next() {
|
||||||
@ -45,7 +41,7 @@ func loadCalculations(r *RecordManager, d *d2txt.DataDictionary) (Calculations,
|
|||||||
return nil, d.Err
|
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
|
return records, nil
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ func charStatsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for d.Next() {
|
for d.Next() {
|
||||||
record := &CharStatsRecord{
|
record := &CharStatRecord{
|
||||||
Class: stringMap[d.String("class")],
|
Class: stringMap[d.String("class")],
|
||||||
|
|
||||||
InitStr: d.Number("str"),
|
InitStr: d.Number("str"),
|
||||||
@ -136,7 +136,7 @@ func charStatsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d CharStats records", len(records))
|
r.Debugf("Loaded %d CharStat records", len(records))
|
||||||
|
|
||||||
r.Character.Stats = records
|
r.Character.Stats = records
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@ package d2records
|
|||||||
|
|
||||||
import "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
|
import "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
|
||||||
|
|
||||||
// CharStats holds all of the CharStatsRecords
|
// CharStats holds all of the CharStatRecords
|
||||||
type CharStats map[d2enum.Hero]*CharStatsRecord
|
type CharStats map[d2enum.Hero]*CharStatRecord
|
||||||
|
|
||||||
// CharStatsRecord is a struct that represents a single row from charstats.txt
|
// CharStatRecord is a struct that represents a single row from charstats.txt
|
||||||
type CharStatsRecord struct {
|
type CharStatRecord struct {
|
||||||
Class d2enum.Hero
|
Class d2enum.Hero
|
||||||
|
|
||||||
// the initial stats at character level 1
|
// the initial stats at character level 1
|
||||||
|
@ -22,7 +22,7 @@ func colorsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Colors = records
|
r.Colors = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d Color records", len(records))
|
r.Debugf("Loaded %d Color records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ func componentCodesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d ComponentCode records", len(records))
|
r.Debugf("Loaded %d ComponentCode records", len(records))
|
||||||
|
|
||||||
r.ComponentCodes = records
|
r.ComponentCodes = records
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ func compositeTypeLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Animation.Token.Composite = records
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ func cubeModifierLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Item.Cube.Modifiers = records
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ func cubeTypeLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Item.Cube.Types = records
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ func cubeRecipeLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
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
|
r.Item.Cube.Recipes = records
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ func difficultyLevelsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d DifficultyLevel records", len(records))
|
r.Debugf("Loaded %d DifficultyLevel records", len(records))
|
||||||
|
|
||||||
r.DifficultyLevels = records
|
r.DifficultyLevels = records
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ func elemTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d ElemType records", len(records))
|
r.Debugf("Loaded %d ElemType records", len(records))
|
||||||
|
|
||||||
r.ElemTypes = records
|
r.ElemTypes = records
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ func eventsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d Event records", len(records))
|
r.Debugf("Loaded %d Event records", len(records))
|
||||||
|
|
||||||
r.Character.Events = records
|
r.Character.Events = records
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ func experienceLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for d.Next() {
|
for d.Next() {
|
||||||
record := &ExperienceBreakpointsRecord{
|
record := &ExperienceBreakpointRecord{
|
||||||
Level: d.Number("Level"),
|
Level: d.Number("Level"),
|
||||||
HeroBreakpoints: map[d2enum.Hero]int{
|
HeroBreakpoints: map[d2enum.Hero]int{
|
||||||
d2enum.HeroAmazon: d.Number("Amazon"),
|
d2enum.HeroAmazon: d.Number("Amazon"),
|
||||||
@ -68,7 +68,7 @@ func experienceLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
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.MaxLevel = maxLevels
|
||||||
r.Character.Experience = breakpoints
|
r.Character.Experience = breakpoints
|
||||||
|
@ -4,14 +4,14 @@ import "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
|
|||||||
|
|
||||||
// ExperienceBreakpoints describes the required experience
|
// ExperienceBreakpoints describes the required experience
|
||||||
// for each level for each character class
|
// for each level for each character class
|
||||||
type ExperienceBreakpoints map[int]*ExperienceBreakpointsRecord
|
type ExperienceBreakpoints map[int]*ExperienceBreakpointRecord
|
||||||
|
|
||||||
// ExperienceMaxLevels defines the max character levels
|
// ExperienceMaxLevels defines the max character levels
|
||||||
type ExperienceMaxLevels map[d2enum.Hero]int
|
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
|
// gain a level for all character classes
|
||||||
type ExperienceBreakpointsRecord struct {
|
type ExperienceBreakpointRecord struct {
|
||||||
Level int
|
Level int
|
||||||
HeroBreakpoints map[d2enum.Hero]int
|
HeroBreakpoints map[d2enum.Hero]int
|
||||||
Ratio int
|
Ratio int
|
||||||
|
@ -19,7 +19,7 @@ func gambleLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d gamble records", len(records))
|
r.Debugf("Loaded %d Gamble records", len(records))
|
||||||
|
|
||||||
r.Gamble = records
|
r.Gamble = records
|
||||||
|
|
||||||
|
@ -4,12 +4,12 @@ import (
|
|||||||
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2txt"
|
"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 {
|
func gemsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||||
records := make(Gems)
|
records := make(Gems)
|
||||||
|
|
||||||
for d.Next() {
|
for d.Next() {
|
||||||
gem := &GemsRecord{
|
gem := &GemRecord{
|
||||||
Name: d.String("name"),
|
Name: d.String("name"),
|
||||||
Letter: d.String("letter"),
|
Letter: d.String("letter"),
|
||||||
Transform: d.Number("transform"),
|
Transform: d.Number("transform"),
|
||||||
@ -60,7 +60,7 @@ func gemsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d Gems records", len(records))
|
r.Debugf("Loaded %d Gem records", len(records))
|
||||||
|
|
||||||
r.Item.Gems = records
|
r.Item.Gems = records
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package d2records
|
package d2records
|
||||||
|
|
||||||
// Gems stores all of the GemsRecords
|
// Gems stores all of the GemRecords
|
||||||
type Gems map[string]*GemsRecord
|
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
|
// it describes the properties of socketable items
|
||||||
type GemsRecord struct {
|
type GemRecord struct {
|
||||||
Name string
|
Name string
|
||||||
Letter string
|
Letter string
|
||||||
Transform int
|
Transform int
|
||||||
|
@ -22,7 +22,7 @@ func hirelingDescriptionLoader(r *RecordManager, d *d2txt.DataDictionary) error
|
|||||||
|
|
||||||
r.Hireling.Descriptions = records
|
r.Hireling.Descriptions = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d Hireling Descriptions records", len(records))
|
r.Debugf("Loaded %d HirelingDescription records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ func hirelingLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d Hireling records", len(records))
|
r.Debugf("Loaded %d Hireling records", len(records))
|
||||||
|
|
||||||
r.Hireling.Details = records
|
r.Hireling.Details = records
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ func hitClassLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Animation.Token.HitClass = records
|
r.Animation.Token.HitClass = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d HitClass records", len(records))
|
r.Debugf("Loaded %d HitClass records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ func inventoryLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
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
|
r.Layout.Inventory = records
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ func loadAffixDictionary(
|
|||||||
}
|
}
|
||||||
|
|
||||||
name := getAffixString(superType, subType)
|
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
|
return records, groups, nil
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ func armorLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d armors", len(records))
|
r.Debugf("Loaded %d Armor Item records", len(records))
|
||||||
|
|
||||||
r.Item.Armors = records
|
r.Item.Armors = records
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ func lowQualityLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Item.LowQualityPrefixes = records
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ func miscItemsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d misc items", len(records))
|
r.Debugf("Loaded %d Misc Item records", len(records))
|
||||||
|
|
||||||
r.Item.Misc = records
|
r.Item.Misc = records
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ func itemQualityLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Item.Quality = records
|
r.Item.Quality = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d ItemQualities records", len(records))
|
r.Debugf("Loaded %d ItemQuality records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ func itemRatioLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d ItemRatio records", len(records))
|
r.Debugf("Loaded %d ItemRatio records", len(records))
|
||||||
|
|
||||||
r.Item.Ratios = records
|
r.Item.Ratios = records
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ func itemTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
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.Types = records
|
||||||
r.Item.Equivalency = equivMap
|
r.Item.Equivalency = equivMap
|
||||||
|
@ -13,7 +13,7 @@ func weaponsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d weapons", len(records))
|
r.Debugf("Loaded %d Weapon records", len(records))
|
||||||
|
|
||||||
r.Item.Weapons = records
|
r.Item.Weapons = records
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ func itemStatCostLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d ItemStatCost records", len(records))
|
r.Debugf("Loaded %d ItemStatCost records", len(records))
|
||||||
|
|
||||||
r.Item.Stats = records
|
r.Item.Stats = records
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ func levelDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
records := make(LevelDetails)
|
records := make(LevelDetails)
|
||||||
|
|
||||||
for d.Next() {
|
for d.Next() {
|
||||||
record := &LevelDetailsRecord{
|
record := &LevelDetailRecord{
|
||||||
Name: d.String("Name "),
|
Name: d.String("Name "),
|
||||||
ID: d.Number("Id"),
|
ID: d.Number("Id"),
|
||||||
Palette: d.Number("Pal"),
|
Palette: d.Number("Pal"),
|
||||||
@ -165,7 +165,7 @@ func levelDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d LevelDetails records", len(records))
|
r.Debugf("Loaded %d LevelDetail records", len(records))
|
||||||
|
|
||||||
r.Level.Details = records
|
r.Level.Details = records
|
||||||
|
|
||||||
|
@ -2,13 +2,13 @@ package d2records
|
|||||||
|
|
||||||
import "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
|
import "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
|
||||||
|
|
||||||
// LevelDetails has all of the LevelDetailsRecords
|
// LevelDetails has all of the LevelDetailRecords
|
||||||
type LevelDetails map[int]*LevelDetailsRecord
|
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,
|
// 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.
|
// what kinds of monsters spawn, the level generator type, and lots of other stuff.
|
||||||
type LevelDetailsRecord struct {
|
type LevelDetailRecord struct {
|
||||||
|
|
||||||
// Name
|
// Name
|
||||||
// This column has no function, it only serves as a comment field to make it
|
// 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)
|
records := make(LevelMazeDetails)
|
||||||
|
|
||||||
for d.Next() {
|
for d.Next() {
|
||||||
record := &LevelMazeDetailsRecord{
|
record := &LevelMazeDetailRecord{
|
||||||
Name: d.String("Name"),
|
Name: d.String("Name"),
|
||||||
LevelID: d.Number("Level"),
|
LevelID: d.Number("Level"),
|
||||||
NumRoomsNormal: d.Number("Rooms"),
|
NumRoomsNormal: d.Number("Rooms"),
|
||||||
@ -24,7 +24,7 @@ func levelMazeDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d LevelMazeDetails records", len(records))
|
r.Debugf("Loaded %d LevelMazeDetail records", len(records))
|
||||||
|
|
||||||
r.Level.Maze = records
|
r.Level.Maze = records
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package d2records
|
package d2records
|
||||||
|
|
||||||
// LevelMazeDetails stores all of the LevelMazeDetailsRecords
|
// LevelMazeDetails stores all of the LevelMazeDetailRecords
|
||||||
type LevelMazeDetails map[int]*LevelMazeDetailsRecord
|
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
|
// 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
|
// descriptive, not loaded in game. Corresponds with Name field in
|
||||||
// Levels.txt
|
// Levels.txt
|
||||||
Name string // Name
|
Name string // Name
|
||||||
|
@ -42,7 +42,7 @@ func levelPresetLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
records[record.DefinitionID] = record
|
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 {
|
if d.Err != nil {
|
||||||
return d.Err
|
return d.Err
|
||||||
|
@ -40,7 +40,7 @@ func levelSubstitutionsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d LevelSubstitution records", len(records))
|
r.Debugf("Loaded %d LevelSubstitution records", len(records))
|
||||||
|
|
||||||
r.Level.Sub = records
|
r.Level.Sub = records
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ func levelTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d LevelType records", len(records))
|
r.Debugf("Loaded %d LevelType records", len(records))
|
||||||
|
|
||||||
r.Level.Types = records
|
r.Level.Types = records
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ func levelWarpsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d level warps", len(records))
|
r.Debugf("Loaded %d LevelWarp records", len(records))
|
||||||
|
|
||||||
r.Level.Warp = records
|
r.Level.Warp = records
|
||||||
|
|
||||||
|
@ -304,7 +304,7 @@ func missilesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d Missile Records", len(records))
|
r.Debugf("Loaded %d Missile records", len(records))
|
||||||
|
|
||||||
r.Missiles = records
|
r.Missiles = records
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ func monsterAiLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d MonsterAI records", len(records))
|
r.Debugf("Loaded %d MonsterAI records", len(records))
|
||||||
|
|
||||||
r.Monster.AI = records
|
r.Monster.AI = records
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ func monsterEquipmentLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
length += len(records[k])
|
length += len(records[k])
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d MonsterEquipment records", length)
|
r.Debugf("Loaded %d MonsterEquipment records", length)
|
||||||
|
|
||||||
r.Monster.Equipment = records
|
r.Monster.Equipment = records
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ func monsterLevelsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d MonsterLevel records", len(records))
|
r.Debugf("Loaded %d MonsterLevel records", len(records))
|
||||||
|
|
||||||
r.Monster.Levels = records
|
r.Monster.Levels = records
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ func monsterModeLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d MonMode records", len(records))
|
r.Debugf("Loaded %d MonMode records", len(records))
|
||||||
|
|
||||||
r.Monster.Modes = records
|
r.Monster.Modes = records
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package d2records
|
package d2records
|
||||||
|
|
||||||
// MonModes stores all of the GemsRecords
|
// MonModes stores all of the MonModeRecords
|
||||||
type MonModes map[string]*MonModeRecord
|
type MonModes map[string]*MonModeRecord
|
||||||
|
|
||||||
// MonModeRecord is a representation of a single row of Monmode.txt
|
// 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.Monster.Placements = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d MonsterPlacement records", len(records))
|
r.Debugf("Loaded %d MonsterPlacement records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ func monsterPresetLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d MonPreset records", len(records))
|
r.Debugf("Loaded %d MonPreset records", len(records))
|
||||||
|
|
||||||
r.Monster.Presets = records
|
r.Monster.Presets = records
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ func monsterPropertiesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d MonProp records", len(records))
|
r.Debugf("Loaded %d MonProp records", len(records))
|
||||||
|
|
||||||
r.Monster.Props = records
|
r.Monster.Props = records
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ func monsterSequencesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d MonsterSequence records", len(records))
|
r.Debugf("Loaded %d MonsterSequence records", len(records))
|
||||||
|
|
||||||
r.Monster.Sequences = records
|
r.Monster.Sequences = records
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ func monsterSoundsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
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
|
r.Monster.Sounds = records
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2txt"
|
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2txt"
|
||||||
)
|
)
|
||||||
|
|
||||||
// LoadMonStats2 loads MonStats2Records from monstats2.txt
|
// LoadMonStats2 loads MonStat2Records from monstats2.txt
|
||||||
//nolint:funlen //just a big data loader
|
//nolint:funlen //just a big data loader
|
||||||
func monsterStats2Loader(r *RecordManager, d *d2txt.DataDictionary) error {
|
func monsterStats2Loader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||||
records := make(MonStats2)
|
records := make(MonStats2)
|
||||||
@ -18,7 +18,7 @@ func monsterStats2Loader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
record := &MonStats2Record{
|
record := &MonStat2Record{
|
||||||
Key: d.String("Id"),
|
Key: d.String("Id"),
|
||||||
Height: d.Number("Height"),
|
Height: d.Number("Height"),
|
||||||
OverlayHeight: d.Number("OverlayHeight"),
|
OverlayHeight: d.Number("OverlayHeight"),
|
||||||
@ -161,7 +161,7 @@ func monsterStats2Loader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
panic(d.Err)
|
panic(d.Err)
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d MonStats2 records", len(records))
|
r.Debugf("Loaded %d MonStat2 records", len(records))
|
||||||
|
|
||||||
r.Monster.Stats2 = records
|
r.Monster.Stats2 = records
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@ package d2records
|
|||||||
|
|
||||||
import "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
|
import "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
|
||||||
|
|
||||||
// MonStats2 stores all of the MonStats2Records
|
// MonStats2 stores all of the MonStat2Records
|
||||||
type MonStats2 map[string]*MonStats2Record
|
type MonStats2 map[string]*MonStat2Record
|
||||||
|
|
||||||
// MonStats2Record is a representation of a row from monstats2.txt
|
// MonStat2Record is a representation of a row from monstats2.txt
|
||||||
type MonStats2Record struct {
|
type MonStat2Record struct {
|
||||||
// Available options for equipment
|
// Available options for equipment
|
||||||
// randomly selected from
|
// randomly selected from
|
||||||
EquipmentOptions [16][]string
|
EquipmentOptions [16][]string
|
||||||
|
@ -10,7 +10,7 @@ func monsterStatsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
records := make(MonStats)
|
records := make(MonStats)
|
||||||
|
|
||||||
for d.Next() {
|
for d.Next() {
|
||||||
record := &MonStatsRecord{
|
record := &MonStatRecord{
|
||||||
Key: d.String("Id"),
|
Key: d.String("Id"),
|
||||||
ID: d.Number("hcIdx"),
|
ID: d.Number("hcIdx"),
|
||||||
BaseKey: d.String("BaseId"),
|
BaseKey: d.String("BaseId"),
|
||||||
@ -272,7 +272,7 @@ func monsterStatsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d MonStats records", len(records))
|
r.Debugf("Loaded %d MonStat records", len(records))
|
||||||
|
|
||||||
r.Monster.Stats = records
|
r.Monster.Stats = records
|
||||||
|
|
||||||
|
@ -4,13 +4,13 @@ import "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
|
|||||||
|
|
||||||
// https://d2mods.info/forum/kb/viewarticle?a=360
|
// https://d2mods.info/forum/kb/viewarticle?a=360
|
||||||
|
|
||||||
// MonStats stores all of the MonStat Records
|
// MonStats stores all of the MonStatRecords
|
||||||
type MonStats map[string]*MonStatsRecord
|
type MonStats map[string]*MonStatRecord
|
||||||
|
|
||||||
type (
|
type (
|
||||||
// MonStatsRecord represents a single row from `data/global/excel/monstats.txt` in the MPQ files.
|
// MonStatRecord represents a single row from `data/global/excel/monstats.txt` in the MPQ files.
|
||||||
// These records are used for creating monsters.
|
// These records are used for creating monsters.
|
||||||
MonStatsRecord struct {
|
MonStatRecord struct {
|
||||||
|
|
||||||
// Key contains the pointer that will be used in other txt files
|
// Key contains the pointer that will be used in other txt files
|
||||||
// such as levels.txt and superuniques.txt.
|
// such as levels.txt and superuniques.txt.
|
||||||
|
@ -40,7 +40,7 @@ func monsterSuperUniqeLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Monster.Unique.Super = records
|
r.Monster.Unique.Super = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d SuperUnique records", len(records))
|
r.Debugf("Loaded %d SuperUnique records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ func monsterTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
panic(d.Err)
|
panic(d.Err)
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d MonType records", len(records))
|
r.Debugf("Loaded %d MonType records", len(records))
|
||||||
|
|
||||||
r.Monster.Types = records
|
r.Monster.Types = records
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ func uniqueMonsterPrefixLoader(r *RecordManager, d *d2txt.DataDictionary) error
|
|||||||
|
|
||||||
r.Monster.Name.Prefix = records
|
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
|
return nil
|
||||||
}
|
}
|
||||||
@ -72,7 +72,7 @@ func uniqueMonsterSuffixLoader(r *RecordManager, d *d2txt.DataDictionary) error
|
|||||||
|
|
||||||
r.Monster.Name.Suffix = records
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ func monsterUniqModifiersLoader(r *RecordManager, d *d2txt.DataDictionary) error
|
|||||||
return d.Err
|
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.Mods = records
|
||||||
r.Monster.Unique.Constants = constants
|
r.Monster.Unique.Constants = constants
|
||||||
|
@ -64,7 +64,7 @@ func npcLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.NPCs = records
|
r.NPCs = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d NPC records", len(records))
|
r.Debugf("Loaded %d NPC records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ func objectDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
i := 0
|
i := 0
|
||||||
|
|
||||||
for d.Next() {
|
for d.Next() {
|
||||||
record := &ObjectDetailsRecord{
|
record := &ObjectDetailRecord{
|
||||||
Index: i,
|
Index: i,
|
||||||
Name: d.String("Name"),
|
Name: d.String("Name"),
|
||||||
Description: d.String("description - not loaded"),
|
Description: d.String("description - not loaded"),
|
||||||
@ -225,7 +225,7 @@ func objectDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d objects", len(records))
|
r.Debugf("Loaded %d ObjectDetail records", len(records))
|
||||||
|
|
||||||
r.Object.Details = records
|
r.Object.Details = records
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package d2records
|
package d2records
|
||||||
|
|
||||||
// ObjectDetails stores all of the ObjectDetailRecords
|
// ObjectDetails stores all of the ObjectDetailRecords
|
||||||
type ObjectDetails map[int]*ObjectDetailsRecord
|
type ObjectDetails map[int]*ObjectDetailRecord
|
||||||
|
|
||||||
// ObjectDetailsRecord represents the settings for one type of object from objects.txt
|
// ObjectDetailRecord represents the settings for one type of object from objects.txt
|
||||||
type ObjectDetailsRecord struct {
|
type ObjectDetailRecord struct {
|
||||||
Index int // Line number in file, this is the actual index used for objects
|
Index int // Line number in file, this is the actual index used for objects
|
||||||
FrameCount [8]int // how many frames does this mode have, 0 = skip
|
FrameCount [8]int // how many frames does this mode have, 0 = skip
|
||||||
FrameDelta [8]int // what rate is the animation played at (256 = 100% speed)
|
FrameDelta [8]int // what rate is the animation played at (256 = 100% speed)
|
||||||
|
@ -32,7 +32,7 @@ func objectGroupsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d ObjectGroup records", len(records))
|
r.Debugf("Loaded %d ObjectGroup records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ func objectModesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Object.Modes = records
|
r.Object.Modes = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d ObjectMode records", len(records))
|
r.Debugf("Loaded %d ObjectMode records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ func objectTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d object types", len(records))
|
r.Debugf("Loaded %d ObjectType records", len(records))
|
||||||
|
|
||||||
r.Object.Types = records
|
r.Object.Types = records
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ func overlaysLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d Overlay records", len(records))
|
r.Debugf("Loaded %d Overlay records", len(records))
|
||||||
|
|
||||||
r.Layout.Overlays = records
|
r.Layout.Overlays = records
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ func petTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d PetType records", len(records))
|
r.Debugf("Loaded %d PetType records", len(records))
|
||||||
|
|
||||||
r.PetTypes = records
|
r.PetTypes = records
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ func playerClassLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return d.Err
|
return d.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d PlayerClass records", len(records))
|
r.Debugf("Loaded %d PlayerClass records", len(records))
|
||||||
|
|
||||||
r.Character.Classes = records
|
r.Character.Classes = records
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ func playerModesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Character.Modes = records
|
r.Character.Modes = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d PlayerMode records", len(records))
|
r.Debugf("Loaded %d PlayerMode records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ func playerTypeLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
panic(d.Err)
|
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
|
r.Animation.Token.Player = records
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ func propertyLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Properties = records
|
r.Properties = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d Property records", len(records))
|
r.Debugf("Loaded %d Property records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ func rareItemPrefixLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Item.Rare.Prefix = records
|
r.Item.Rare.Prefix = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d RarePrefix records", len(records))
|
r.Debugf("Loaded %d RarePrefix records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ func rareItemSuffixLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d RareSuffix records", len(records))
|
r.Debugf("Loaded %d RareSuffix records", len(records))
|
||||||
|
|
||||||
r.Item.Rare.Suffix = 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]
|
return r.Character.Experience[level].HeroBreakpoints[heroType]
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetLevelDetails gets a LevelDetailsRecord by the record Id
|
// GetLevelDetails gets a LevelDetailRecord by the record Id
|
||||||
func (r *RecordManager) GetLevelDetails(id int) *LevelDetailsRecord {
|
func (r *RecordManager) GetLevelDetails(id int) *LevelDetailRecord {
|
||||||
for i := 0; i < len(r.Level.Details); i++ {
|
for i := 0; i < len(r.Level.Details); i++ {
|
||||||
if r.Level.Details[i].ID == id {
|
if r.Level.Details[i].ID == id {
|
||||||
return r.Level.Details[i]
|
return r.Level.Details[i]
|
||||||
@ -433,7 +433,7 @@ func (r *RecordManager) lookupObject(act, typ, id int) *ObjectLookupRecord {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SelectSoundByIndex selects a sound by its ID
|
// SelectSoundByIndex selects a sound by its ID
|
||||||
func (r *RecordManager) SelectSoundByIndex(index int) *SoundDetailsRecord {
|
func (r *RecordManager) SelectSoundByIndex(index int) *SoundDetailRecord {
|
||||||
for idx := range r.Sound.Details {
|
for idx := range r.Sound.Details {
|
||||||
if r.Sound.Details[idx].Index == index {
|
if r.Sound.Details[idx].Index == index {
|
||||||
return r.Sound.Details[idx]
|
return r.Sound.Details[idx]
|
||||||
|
@ -24,12 +24,12 @@ const (
|
|||||||
fmtRunewordPropMax = "T1Max%d"
|
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 {
|
func runewordLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||||
records := make(map[string]*RunesRecord)
|
records := make(map[string]*RuneRecord)
|
||||||
|
|
||||||
for d.Next() {
|
for d.Next() {
|
||||||
record := &RunesRecord{
|
record := &RuneRecord{
|
||||||
Name: d.String("name"),
|
Name: d.String("name"),
|
||||||
RuneName: d.String("Rune Name"),
|
RuneName: d.String("Rune Name"),
|
||||||
Complete: d.Bool("complete"),
|
Complete: d.Bool("complete"),
|
||||||
@ -89,7 +89,7 @@ func runewordLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Item.Runewords = records
|
r.Item.Runewords = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d records records", len(records))
|
r.Debugf("Loaded %d Rune records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package d2records
|
package d2records
|
||||||
|
|
||||||
// Runewords stores all of the RunesRecords
|
// Runewords stores all of the RuneRecords
|
||||||
type Runewords map[string]*RunesRecord
|
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.
|
// runewords available in the game.
|
||||||
type RunesRecord struct {
|
type RuneRecord struct {
|
||||||
Name string
|
Name string
|
||||||
RuneName string // More of a note - the actual name should be read from the TBL files.
|
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.
|
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.Item.SetItems = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d SetItem records", len(records))
|
r.Debugf("Loaded %d SetItem records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ func setLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Item.Sets = records
|
r.Item.Sets = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d records records", len(records))
|
r.Debugf("Loaded %d Set records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ func shrineLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Object.Shrines = records
|
r.Object.Shrines = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d shrines", len(records))
|
r.Debugf("Loaded %d Shrine records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,7 @@ func skillDescriptionLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Skill.Descriptions = records
|
r.Skill.Descriptions = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d Skill Description records", len(records))
|
r.Debugf("Loaded %d SkillDescription records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -277,7 +277,7 @@ func skillDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Skill.Details = records
|
r.Skill.Details = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d Skill records", len(records))
|
r.Debugf("Loaded %d Skill records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ func soundDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
records := make(SoundDetails)
|
records := make(SoundDetails)
|
||||||
|
|
||||||
for d.Next() {
|
for d.Next() {
|
||||||
entry := &SoundDetailsRecord{
|
entry := &SoundDetailRecord{
|
||||||
Handle: d.String("Sound"),
|
Handle: d.String("Sound"),
|
||||||
Index: d.Number("Index"),
|
Index: d.Number("Index"),
|
||||||
FileName: d.String("FileName"),
|
FileName: d.String("FileName"),
|
||||||
@ -46,7 +46,7 @@ func soundDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Sound.Details = records
|
r.Sound.Details = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d sound definitions", len(records))
|
r.Debugf("Loaded %d SoundDetail records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package d2records
|
package d2records
|
||||||
|
|
||||||
// SoundDetails is a map of the SoundEntries
|
// SoundDetails is a map of the SoundEntries
|
||||||
type SoundDetails map[string]*SoundDetailsRecord
|
type SoundDetails map[string]*SoundDetailRecord
|
||||||
|
|
||||||
// SoundDetailsRecord represents a sound entry
|
// SoundDetailRecord represents a sound entry
|
||||||
type SoundDetailsRecord struct {
|
type SoundDetailRecord struct {
|
||||||
Handle string
|
Handle string
|
||||||
FileName string
|
FileName string
|
||||||
Index int
|
Index int
|
||||||
|
@ -44,7 +44,7 @@ func soundEnvironmentLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Sound.Environment = records
|
r.Sound.Environment = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d SoundEnviron records", len(records))
|
r.Debugf("Loaded %d SoundEnviron records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ func statesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.States = records
|
r.States = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d State records", len(records))
|
r.Debugf("Loaded %d State records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ func storePagesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Item.StorePages = records
|
r.Item.StorePages = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d StorePage records", len(records))
|
r.Debugf("Loaded %d StorePage records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ func treasureClassLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Item.Treasure.Normal = records
|
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
|
return nil
|
||||||
}
|
}
|
||||||
@ -33,7 +33,7 @@ func treasureClassExLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Item.Treasure.Expansion = records
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ func uniqueAppellationsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|||||||
|
|
||||||
r.Monster.Unique.Appellations = records
|
r.Monster.Unique.Appellations = records
|
||||||
|
|
||||||
r.Logger.Infof("Loaded %d UniqueAppellation records", len(records))
|
r.Debugf("Loaded %d UniqueAppellation records", len(records))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user