diff --git a/common/data/xmlres/file.go b/common/data/xmlres/file.go index 243f842c5..8b885d8a4 100644 --- a/common/data/xmlres/file.go +++ b/common/data/xmlres/file.go @@ -31,7 +31,7 @@ var ( MonsterMap map[int]TMapConfig //Skill MovesTbl //技能配置 SkillMap map[int]Move - PetMAP map[int]PetMM //宠物配置 + PetMAP map[int]PetInfo //宠物配置 NatureRootMap map[int]NatureItem ) @@ -54,7 +54,7 @@ func initfile() { }) pet := getXml[Monsters](path + "226.xml") - PetMAP = utils.ToMap[PetMM, int](pet.Monsters, func(m PetMM) int { + PetMAP = utils.ToMap[PetInfo, int](pet.Monsters, func(m PetInfo) int { return m.ID }) diff --git a/common/data/xmlres/pet.go b/common/data/xmlres/pet.go index f88c688f4..8a9aec5a4 100644 --- a/common/data/xmlres/pet.go +++ b/common/data/xmlres/pet.go @@ -13,13 +13,13 @@ type LearnableMoves struct { Moves []PetMoves `xml:"Move"` } -// PetMM 表示一个怪物的信息 -type PetMM struct { +// PetInfo 表示一个怪物的信息 +type PetInfo struct { ID int `xml:"ID,attr"` - DefName string `xml:"DefName,attr"` - Type int `xml:"Type,attr"` - GrowthType int `xml:"GrowthType,attr"` - HP int `xml:"HP,attr"` + DefName string `xml:"DefName,attr"` //名字 + Type int `xml:"Type,attr"` //类型 + GrowthType int `xml:"GrowthType,attr"` //成长类型 + HP int `xml:"HP,attr"` //血量种族值 Atk int `xml:"Atk,attr"` Def int `xml:"Def,attr"` SpAtk int `xml:"SpAtk,attr"` @@ -45,6 +45,6 @@ type PetMM struct { // Monsters 表示所有怪物的集合 type Monsters struct { - XMLName xml.Name `xml:"Monsters"` - Monsters []PetMM `xml:"Monster"` + XMLName xml.Name `xml:"Monsters"` + Monsters []PetInfo `xml:"Monster"` } diff --git a/logic/service/fight/info/BattlePetEntity.go b/logic/service/fight/info/BattlePetEntity.go index f3632bb36..8358245a7 100644 --- a/logic/service/fight/info/BattlePetEntity.go +++ b/logic/service/fight/info/BattlePetEntity.go @@ -2,6 +2,7 @@ package info import ( element "blazing/common/data/Element" + "blazing/common/data/xmlres" "blazing/modules/blazing/model" "context" "sync" @@ -41,7 +42,8 @@ func (a *Attribute) Value() int64 { } type BattlePetEntity struct { - model.PetInfo //通过偏移赋值 + xmlres.PetInfo + info model.PetInfo //通过偏移赋值 ctx context.Context Capturable bool // 是否可捕获 statusConditions sync.Map // key: StatusCondition, value: int (剩余回合) diff --git a/logic/service/fight/info/BattleSkillEntity.go b/logic/service/fight/info/BattleSkillEntity.go index c746951db..5e5f712b9 100644 --- a/logic/service/fight/info/BattleSkillEntity.go +++ b/logic/service/fight/info/BattleSkillEntity.go @@ -36,16 +36,15 @@ var Category = enum.New[struct { // 战斗中可以修改技能实体值,比如是否暴击,是否必中等 type BattleSkillEntity struct { xmlres.Move - ctx context.Context - SideEffects []int - SideEffectArgs []int - PP int - InfinityPP bool - DamageZone map[EnumCategory]map[EnumsZoneType]map[EnumsZoneType][]float64 // 三维map 伤害类型-》增还是减-》加还是乘-》值 - isCritical bool //技能是否暴击 - isHIt bool //技能是否命中 - ATTACK_COUNT_ZONE int //攻击次数 - DamageValue decimal.Decimal // 伤害值 + ctx context.Context + SideEffects []int + SideEffectArgs []int + PP int + InfinityPP bool + DamageZone map[EnumCategory]map[EnumsZoneType]map[EnumsZoneType][]float64 // 三维map 伤害类型-》增还是减-》加还是乘-》值 + + ATTACK_COUNT_ZONE int //攻击次数 + DamageValue decimal.Decimal // 伤害值 // 技能类型属性 //SkillType EnumCategory // 技能类型(物理/特殊/状态)