mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-02-02 14:46:28 -05:00
d2core/d2records: rename some Id
s to ID
s
This commit is contained in:
parent
9c87bd775e
commit
6fb564a170
@ -136,7 +136,7 @@ func (mr *Stamp) Entities(tileOffsetX, tileOffsetY int) []d2interface.MapEntity
|
||||
continue
|
||||
}
|
||||
|
||||
objectRecord := mr.factory.asset.Records.Object.Details[lookup.ObjectsTxtId]
|
||||
objectRecord := mr.factory.asset.Records.Object.Details[lookup.ObjectsTxtID]
|
||||
|
||||
if objectRecord != nil {
|
||||
// nolint:gomnd // constant
|
||||
|
@ -16,7 +16,7 @@ func missilesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
for d.Next() {
|
||||
record := &MissileRecord{
|
||||
Name: d.String("Missile"),
|
||||
Id: d.Number("Id"),
|
||||
ID: d.Number("Id"),
|
||||
|
||||
ClientMovementFunc: d.Number("pCltDoFunc"),
|
||||
ClientCollisionFunc: d.Number("pCltHitFunc"),
|
||||
@ -296,7 +296,7 @@ func missilesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
},
|
||||
}
|
||||
|
||||
records[record.Id] = record
|
||||
records[record.ID] = record
|
||||
r.missilesByName[sanitizeMissilesKey(record.Name)] = record
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ type MissileRecord struct {
|
||||
ServerMovementFunc int
|
||||
ClientMovementFunc int
|
||||
ClientCollisionFunc int
|
||||
Id int
|
||||
ID int
|
||||
ServerCollisionFunc int
|
||||
ServerDamageFunc int
|
||||
Velocity int
|
||||
|
@ -15,7 +15,7 @@ func monsterStatsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
ID: d.Number("hcIdx"),
|
||||
BaseKey: d.String("BaseId"),
|
||||
NextKey: d.String("NextInClass"),
|
||||
PaletteId: d.Number("TransLvl"),
|
||||
PaletteID: d.Number("TransLvl"),
|
||||
NameString: d.String("NameStr"),
|
||||
ExtraDataKey: d.String("MonStatsEx"),
|
||||
PropertiesKey: d.String("MonProp"),
|
||||
@ -30,8 +30,8 @@ func monsterStatsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
SpawnOffsetX: d.Number("spawnx"),
|
||||
SpawnOffsetY: d.Number("spawny"),
|
||||
SpawnAnimationKey: d.String("spawnmode"),
|
||||
MinionId1: d.String("minion1"),
|
||||
MinionId2: d.String("minion2"),
|
||||
MinionID1: d.String("minion1"),
|
||||
MinionID2: d.String("minion2"),
|
||||
IsLeader: d.Number("SetBoss") > 0,
|
||||
TransferLeadership: d.Number("BossXfer") > 0,
|
||||
MinionPartyMin: d.Number("PartyMin"),
|
||||
@ -108,14 +108,14 @@ func monsterStatsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
IgnorePets: d.Number("petIgnore") > 0,
|
||||
DealsDamageOnDeath: d.Number("deathDmg") > 0,
|
||||
GenericSpawn: d.Number("genericSpawn") > 0,
|
||||
SkillId1: d.String("Skill1"),
|
||||
SkillId2: d.String("Skill2"),
|
||||
SkillId3: d.String("Skill3"),
|
||||
SkillId4: d.String("Skill4"),
|
||||
SkillId5: d.String("Skill5"),
|
||||
SkillId6: d.String("Skill6"),
|
||||
SkillId7: d.String("Skill7"),
|
||||
SkillId8: d.String("Skill8"),
|
||||
SkillID1: d.String("Skill1"),
|
||||
SkillID2: d.String("Skill2"),
|
||||
SkillID3: d.String("Skill3"),
|
||||
SkillID4: d.String("Skill4"),
|
||||
SkillID5: d.String("Skill5"),
|
||||
SkillID6: d.String("Skill6"),
|
||||
SkillID7: d.String("Skill7"),
|
||||
SkillID8: d.String("Skill8"),
|
||||
SkillAnimation1: d.String("Sk1mode"),
|
||||
SkillAnimation2: d.String("Sk2mode"),
|
||||
SkillAnimation3: d.String("Sk3mode"),
|
||||
@ -157,7 +157,7 @@ func monsterStatsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
ResistancePoisonNightmare: d.Number("ResPo(N)"),
|
||||
ResistancePoisonHell: d.Number("ResPo(H)"),
|
||||
HealthRegenPerFrame: d.Number("DamageRegen"),
|
||||
DamageSkillId: d.String("SkillDamage"),
|
||||
DamageSkillID: d.String("SkillDamage"),
|
||||
IgnoreMonLevelTxt: d.Number("noRatio") > 0,
|
||||
CanBlockWithoutShield: d.Number("NoShldBlock") > 0,
|
||||
ChanceToBlockNormal: d.Number("ToBlock"),
|
||||
@ -257,8 +257,8 @@ func monsterStatsLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
||||
TreasureClassQuestNormal: d.String("TreasureClass4"),
|
||||
TreasureClassQuestNightmare: d.String("TreasureClass4(N)"),
|
||||
TreasureClassQuestHell: d.String("TreasureClass4(H)"),
|
||||
TreasureClassQuestTriggerId: d.String("TCQuestId"),
|
||||
TreasureClassQuestCompleteId: d.String("TCQuestCP"),
|
||||
TreasureClassQuestTriggerID: d.String("TCQuestId"),
|
||||
TreasureClassQuestCompleteID: d.String("TCQuestCP"),
|
||||
SpecialEndDeath: d.Number("SplEndDeath"),
|
||||
SpecialGetModeChart: d.Number("SplGetModeChart") > 0,
|
||||
SpecialEndGeneric: d.Number("SplEndGeneric") > 0,
|
||||
|
@ -11,7 +11,7 @@ type (
|
||||
// MonStatRecord represents a single row from `data/global/excel/monstats.txt` in the MPQ files.
|
||||
// These records are used for creating monsters.
|
||||
MonStatRecord struct {
|
||||
TreasureClassQuestCompleteId string
|
||||
TreasureClassQuestCompleteID string
|
||||
Key string
|
||||
BaseKey string
|
||||
NextKey string
|
||||
@ -24,8 +24,8 @@ type (
|
||||
AnimationDirectoryToken string
|
||||
SpawnKey string
|
||||
SpawnAnimationKey string
|
||||
MinionId1 string
|
||||
MinionId2 string
|
||||
MinionID1 string
|
||||
MinionID2 string
|
||||
SoundKeyNormal string
|
||||
SoundKeySpecial string
|
||||
MissileA1 string
|
||||
@ -36,14 +36,14 @@ type (
|
||||
MissileS4 string
|
||||
MissileC string
|
||||
MissileSQ string
|
||||
SkillId1 string
|
||||
SkillId2 string
|
||||
SkillId3 string
|
||||
SkillId4 string
|
||||
SkillId5 string
|
||||
SkillId6 string
|
||||
SkillId7 string
|
||||
SkillId8 string
|
||||
SkillID1 string
|
||||
SkillID2 string
|
||||
SkillID3 string
|
||||
SkillID4 string
|
||||
SkillID5 string
|
||||
SkillID6 string
|
||||
SkillID7 string
|
||||
SkillID8 string
|
||||
SkillAnimation1 string
|
||||
SkillAnimation2 string
|
||||
SkillAnimation3 string
|
||||
@ -52,7 +52,7 @@ type (
|
||||
SkillAnimation6 string
|
||||
SkillAnimation7 string
|
||||
SkillAnimation8 string
|
||||
DamageSkillId string
|
||||
DamageSkillID string
|
||||
ElementAttackMode1 string
|
||||
ElementAttackMode2 string
|
||||
ElementAttackMode3 string
|
||||
@ -71,9 +71,9 @@ type (
|
||||
TreasureClassQuestNormal string
|
||||
TreasureClassQuestNightmare string
|
||||
TreasureClassQuestHell string
|
||||
TreasureClassQuestTriggerId string
|
||||
TreasureClassQuestTriggerID string
|
||||
ResistanceMagicNightmare int
|
||||
PaletteId int
|
||||
PaletteID int
|
||||
SpawnOffsetX int
|
||||
SpawnOffsetY int
|
||||
MinionPartyMin int
|
||||
|
@ -37,9 +37,9 @@ type ObjectLookupRecord struct {
|
||||
S3 string
|
||||
Act int
|
||||
Direction int
|
||||
MonstatsTxtId int
|
||||
ObjectsTxtId int
|
||||
Id int
|
||||
MonstatsTxtID int
|
||||
ObjectsTxtID int
|
||||
ID int
|
||||
Type d2enum.ObjectType
|
||||
Index int
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -20,22 +20,22 @@ func TestIndexObjects(t *testing.T) {
|
||||
}
|
||||
|
||||
testObjects := []ObjectLookupRecord{
|
||||
{Act: 1, Type: d2enum.ObjectTypeCharacter, Id: 0, Description: "Act1CharId0"},
|
||||
{Act: 1, Type: d2enum.ObjectTypeCharacter, Id: 1, Description: "Act1CharId1"},
|
||||
{Act: 1, Type: d2enum.ObjectTypeCharacter, Id: 2, Description: "Act1CharId2"},
|
||||
{Act: 1, Type: d2enum.ObjectTypeCharacter, Id: 3, Description: "Act1CharId3"},
|
||||
{Act: 1, Type: d2enum.ObjectTypeItem, Id: 0, Description: "Act1ItemId0"},
|
||||
{Act: 1, Type: d2enum.ObjectTypeItem, Id: 1, Description: "Act1ItemId1"},
|
||||
{Act: 1, Type: d2enum.ObjectTypeItem, Id: 2, Description: "Act1ItemId2"},
|
||||
{Act: 1, Type: d2enum.ObjectTypeItem, Id: 3, Description: "Act1ItemId3"},
|
||||
{Act: 2, Type: d2enum.ObjectTypeCharacter, Id: 0, Description: "Act2CharId0"},
|
||||
{Act: 2, Type: d2enum.ObjectTypeCharacter, Id: 1, Description: "Act2CharId1"},
|
||||
{Act: 2, Type: d2enum.ObjectTypeCharacter, Id: 2, Description: "Act2CharId2"},
|
||||
{Act: 2, Type: d2enum.ObjectTypeCharacter, Id: 3, Description: "Act2CharId3"},
|
||||
{Act: 2, Type: d2enum.ObjectTypeItem, Id: 0, Description: "Act2ItemId0"},
|
||||
{Act: 2, Type: d2enum.ObjectTypeItem, Id: 1, Description: "Act2ItemId1"},
|
||||
{Act: 2, Type: d2enum.ObjectTypeItem, Id: 2, Description: "Act2ItemId2"},
|
||||
{Act: 2, Type: d2enum.ObjectTypeItem, Id: 3, Description: "Act2ItemId3"},
|
||||
{Act: 1, Type: d2enum.ObjectTypeCharacter, ID: 0, Description: "Act1CharID0"},
|
||||
{Act: 1, Type: d2enum.ObjectTypeCharacter, ID: 1, Description: "Act1CharID1"},
|
||||
{Act: 1, Type: d2enum.ObjectTypeCharacter, ID: 2, Description: "Act1CharID2"},
|
||||
{Act: 1, Type: d2enum.ObjectTypeCharacter, ID: 3, Description: "Act1CharID3"},
|
||||
{Act: 1, Type: d2enum.ObjectTypeItem, ID: 0, Description: "Act1ItemID0"},
|
||||
{Act: 1, Type: d2enum.ObjectTypeItem, ID: 1, Description: "Act1ItemID1"},
|
||||
{Act: 1, Type: d2enum.ObjectTypeItem, ID: 2, Description: "Act1ItemID2"},
|
||||
{Act: 1, Type: d2enum.ObjectTypeItem, ID: 3, Description: "Act1ItemID3"},
|
||||
{Act: 2, Type: d2enum.ObjectTypeCharacter, ID: 0, Description: "Act2CharID0"},
|
||||
{Act: 2, Type: d2enum.ObjectTypeCharacter, ID: 1, Description: "Act2CharID1"},
|
||||
{Act: 2, Type: d2enum.ObjectTypeCharacter, ID: 2, Description: "Act2CharID2"},
|
||||
{Act: 2, Type: d2enum.ObjectTypeCharacter, ID: 3, Description: "Act2CharID3"},
|
||||
{Act: 2, Type: d2enum.ObjectTypeItem, ID: 0, Description: "Act2ItemID0"},
|
||||
{Act: 2, Type: d2enum.ObjectTypeItem, ID: 1, Description: "Act2ItemID1"},
|
||||
{Act: 2, Type: d2enum.ObjectTypeItem, ID: 2, Description: "Act2ItemID2"},
|
||||
{Act: 2, Type: d2enum.ObjectTypeItem, ID: 3, Description: "Act2ItemID3"},
|
||||
}
|
||||
|
||||
r.initObjectRecords(testObjects)
|
||||
|
@ -398,7 +398,7 @@ func (r *RecordManager) initObjectRecords(lookups []ObjectLookupRecord) {
|
||||
records[record.Act][record.Type] = make([]*ObjectLookupRecord, 1000)
|
||||
}
|
||||
|
||||
records[record.Act][record.Type][record.Id] = record
|
||||
records[record.Act][record.Type][record.ID] = record
|
||||
}
|
||||
|
||||
r.Object.Lookup = records
|
||||
|
@ -19,7 +19,6 @@ import (
|
||||
"github.com/OpenDiablo2/OpenDiablo2/d2core/d2screen"
|
||||
"github.com/OpenDiablo2/OpenDiablo2/d2core/d2ui"
|
||||
"github.com/OpenDiablo2/OpenDiablo2/d2networking/d2client/d2clientconnectiontype"
|
||||
"github.com/OpenDiablo2/OpenDiablo2/d2script"
|
||||
)
|
||||
|
||||
type mainMenuScreenMode int
|
||||
@ -169,7 +168,6 @@ type MainMenu struct {
|
||||
diabloLogoRight *d2ui.Sprite
|
||||
diabloLogoLeft *d2ui.Sprite
|
||||
background *d2ui.Sprite
|
||||
scriptEngine *d2script.ScriptEngine
|
||||
trademarkBackground *d2ui.Sprite
|
||||
*d2util.Logger
|
||||
buildInfo BuildInfo
|
||||
|
@ -266,7 +266,6 @@ func (g *GameClient) handleMovePlayerPacket(packet d2netpacket.NetPacket) error
|
||||
player.SetIsInTown(tile.RegionType == d2enum.RegionAct1Town)
|
||||
|
||||
err := player.SetAnimationMode(player.GetAnimationMode())
|
||||
|
||||
if err != nil {
|
||||
fmtStr := "GameClient: error setting animation mode for player %s: %s"
|
||||
g.Errorf(fmtStr, player.ID(), err)
|
||||
@ -394,9 +393,8 @@ func (g *GameClient) createMissileEntity(
|
||||
missileEntity, err := g.MapEngine.NewMissile(
|
||||
int(player.Position.X()),
|
||||
int(player.Position.Y()),
|
||||
g.asset.Records.Missiles[missileRecord.Id],
|
||||
g.asset.Records.Missiles[missileRecord.ID],
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user