feat: 新增战斗效果和修复登录逻辑
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed

This commit is contained in:
xinian
2026-03-08 11:22:00 +08:00
committed by cnb
parent 3dd2d40c50
commit 73d7f7f062
13 changed files with 262 additions and 179 deletions

View File

@@ -1,14 +1,10 @@
package effect
import (
"blazing/common/data/xmlres"
element "blazing/common/data/Element"
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"strings"
"github.com/gogf/gf/v2/util/gconv"
"github.com/samber/lo"
)
// 14. 若遇到天敌, 则战斗开始时连续害怕 n 回合;a1: n
@@ -23,11 +19,12 @@ func (e *NewSel14) TurnStart(fattack *action.SelectSkillAction, sattack *action.
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
return
}
evs := gconv.Uint32s(strings.Split(xmlres.PetMAP[int(e.Ctx().Our.CurrentPet.ID)].NaturalEnemy, " "))
_, ok := lo.Find(evs, func(t uint32) bool {
return t == uint32(e.Ctx().Opp.CurrentPet.ID)
})
if !ok {
t, _ := element.Calculator.GetOffensiveMultiplier(e.Ctx().Opp.CurrentPet.Type, e.Ctx().Our.CurrentPet.Type)
// evs := gconv.Uint32s(strings.Split(xmlres.PetMAP[int(e.Ctx().Our.CurrentPet.ID)].NaturalEnemy, " "))
// _, ok := lo.Find(evs, func(t uint32) bool {
// return t == uint32(e.Ctx().Opp.CurrentPet.ID)
// })
if t <= 1 {
return
}
// 5. 获取状态效果实例并设置参数