refactor: 将战斗初始化逻辑移动到新文件并优化AI技能选择

This commit is contained in:
xinian
2026-01-29 13:59:48 +08:00
parent 74808ecffd
commit 70f6d62069
3 changed files with 113 additions and 93 deletions

View File

@@ -43,8 +43,17 @@ func (our *Input) GetAction() {
s.DamageValue = our.CalculatePower(our.Opp, s)
// 判断是否能秒杀(伤害 >= 对方当前生命值)
if uint32(s.DamageValue.IntPart()) >= our.Opp.CurrentPet.Info.Hp { // 假设oppPet.HP为对方当前剩余生命值
usedskill = s
if s.DamageValue.Cmp(our.Opp.CurrentPet.GetHP()) != -1 { // 假设oppPet.HP为对方当前剩余生命值
if usedskill != nil {
if s.DamageValue.Cmp(usedskill.DamageValue) != -1 {
usedskill = s
}
} else {
usedskill = s
}
}
}
if usedskill == nil {