refactor: 重构战斗技能使用节点
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user