refactor: 重构战斗技能使用节点
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-03-08 19:42:47 +08:00
committed by cnb
parent ca7eb04f6e
commit 09da1dc253
10 changed files with 45 additions and 38 deletions

View File

@@ -248,26 +248,14 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction)
}
}
// if defender.CurrentPet.Info.Hp > 0 {
// //技能使用后
// defender.Exec(func(effect input.Effect) bool {
// effect.Ctx().SkillEntity = currentSkill
// effect.Skill_Use_ex()
// return true
// })
// }
// //技能使用后
// attacker.Exec(func(effect input.Effect) bool { //技能使用后的我方效果
// effect.Ctx().SkillEntity = currentSkill
// effect.SkillUseed()
// return true
// })
// defender.Exec(func(effect input.Effect) bool {
// effect.Ctx().SkillEntity = currentSkill
// effect.Action_end_ex()
// return true
// })
if defender.CurrentPet.Info.Hp > 0 {
//技能使用后
defender.Exec(func(effect input.Effect) bool {
effect.Ctx().SkillEntity = currentSkill
effect.Skill_Use_ex()
return true
})
}
if defender.CurrentPet.Info.Hp <= 0 && attacker.CurrentPet.Info.Hp <= 0 { //先手方死亡,触发反同归于尽
attacker.CurrentPet.Info.Hp = 1
@@ -280,9 +268,10 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction)
//技能使用后
attacker.Exec(func(effect input.Effect) bool { //技能使用后的我方效果
effect.Ctx().SkillEntity = currentSkill
effect.Action_end()
effect.Skill_Use()
return true
})
}
if defender.CurrentPet.Info.Hp <= 0 {
@@ -294,11 +283,22 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction)
//技能使用后
defender.Exec(func(effect input.Effect) bool { //技能使用后的我方效果
effect.Ctx().SkillEntity = currentSkill
effect.Action_end_ex()
effect.Skill_Use_ex()
return true
})
}
//技能使用后
attacker.Exec(func(effect input.Effect) bool { //技能使用后的我方效果
effect.Ctx().SkillEntity = currentSkill
effect.Action_end()
return true
})
//技能使用后
defender.Exec(func(effect input.Effect) bool { //技能使用后的我方效果
effect.Ctx().SkillEntity = currentSkill
effect.Action_end_ex()
return true
})
}
f.Broadcast(func(ff *input.Input) {