feat: 重构怪物生成和NPC战斗处理逻辑
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

调整怪物等级处理方式,将固定等级逻辑移至GetLevel方法
优化NPC战斗特殊情况的处理流程
This commit is contained in:
xinian
2026-02-26 19:28:02 +08:00
committed by cnb
parent de297c9904
commit 21ae004979
3 changed files with 14 additions and 8 deletions

View File

@@ -46,6 +46,13 @@ func (o *OgrePetInfo) GetID() int {
}
return int(o.ID)
}
func (o *OgrePetInfo) GetLevel() int {
if o.Ext != 0 {
return 16
}
return int(o.Lv)
}
func (o *OgrePetInfo) FixSHiny() {
var co *data.GlowFilter
if o.Ext == 0 {
@@ -80,14 +87,16 @@ func (o *OgrePetInfo) RandomByWeightShiny() {
// handleNPCFightSpecial 处理NPC战斗特殊情况
func (o *OgrePetInfo) HandleNPCFightSpecial(v int) {
if v == 0 {
o.IsCapture = 0
return
}
npcPetID := int(o.ID)
if o.Ext != 0 {
npcPetID = int(o.Ext)
} else {
if v == 0 {
o.IsCapture = 0
return
}
}
petCfg, ok := xmlres.PetMAP[npcPetID]