1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-02-07 00:18:14 +08:00
parent 637a49e274
commit 3947fbce4b
14 changed files with 61 additions and 44 deletions

View File

@@ -17,6 +17,7 @@ func (our *Input) GetAction() {
if selfPet.Info.Hp <= 0 {
for _, v := range our.AllPet {
if v.Info.Hp > 0 {
println("AI出手,切换宠物")
our.FightC.ChangePet(our.Player, v.Info.CatchTime)
return
}
@@ -76,29 +77,4 @@ func (our *Input) GetAction() {
our.FightC.UseSkill(our.Player, 0)
}
// // 若存在能秒杀的技能,优先使用(选伤害最高的,避免浪费高伤害技能)
// if len(killableSkills) > 0 {
// bestKillSkill := killableSkills[0].SkillEntity
// maxDamage := killableSkills[0].damage
// for _, ks := range killableSkills[1:] {
// if ks.damage.Cmp(maxDamage) > 0 { // 使用decimal的比较方法比较伤害值
// if ks.CanUse() {
// maxDamage = ks.damage
// bestKillSkill = ks.SkillEntity
// }
// }
// }
// our.FightC.UseSkill(our.Player, uint32(bestKillSkill.ID))
// return
// }
// if len(allSkills) <= 0 {
// our.FightC.UseSkill(our.Player, 0)
// return
// }
// 优化随机选择技能的逻辑,直接使用随机索引
// randomIdx := grand.Intn(len(allSkills))
// our.FightC.UseSkill(our.Player, uint32(allSkills[randomIdx].ID))
}