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

This commit is contained in:
昔念
2026-02-07 01:12:46 +08:00
parent 3947fbce4b
commit 99ef8fafce
3 changed files with 10 additions and 6 deletions

View File

@@ -377,8 +377,8 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction)
} }
if f.Info.Status == info.BattleMode.FIGHT_WITH_NPC { if f.Info.Status == info.BattleMode.FIGHT_WITH_NPC {
println("AI出手") // println("AI出手")
go f.Opp.GetAction() f.Opp.GetAction()
} }

View File

@@ -17,7 +17,7 @@ func (our *Input) GetAction() {
if selfPet.Info.Hp <= 0 { if selfPet.Info.Hp <= 0 {
for _, v := range our.AllPet { for _, v := range our.AllPet {
if v.Info.Hp > 0 { if v.Info.Hp > 0 {
println("AI出手,切换宠物") // println("AI出手,切换宠物")
our.FightC.ChangePet(our.Player, v.Info.CatchTime) our.FightC.ChangePet(our.Player, v.Info.CatchTime)
return return
} }
@@ -32,6 +32,7 @@ func (our *Input) GetAction() {
if len(skills) == 0 { if len(skills) == 0 {
return return
} }
//println("AI出手,选择技能")
var usedskill *info.SkillEntity var usedskill *info.SkillEntity
for _, s := range skills { for _, s := range skills {
if s == nil { if s == nil {

View File

@@ -158,6 +158,7 @@ func (f *FightC) collectPlayerActions(ourID, oppID uint32) map[uint32]action.Bat
} }
pid := paction.GetPlayerID() pid := paction.GetPlayerID()
if pid != ourID && pid != oppID { if pid != ourID && pid != oppID {
continue continue
} }
@@ -167,6 +168,7 @@ func (f *FightC) collectPlayerActions(ourID, oppID uint32) map[uint32]action.Bat
// } // }
selfinput := f.GetInputByAction(paction, false) selfinput := f.GetInputByAction(paction, false)
if ret, ok := paction.(*action.ActiveSwitchAction); ok { if ret, ok := paction.(*action.ActiveSwitchAction); ok {
// println("玩家执行切换精灵动作:", pid, ret.Cid)
//正常结束可以切换,以及死切后还能再切一次 //正常结束可以切换,以及死切后还能再切一次
if selfinput.CanChange == 0 { if selfinput.CanChange == 0 {
if selfinput.CurrentPet.Info.Hp > 0 { //非死亡切换 if selfinput.CurrentPet.Info.Hp > 0 { //非死亡切换
@@ -211,8 +213,8 @@ func (f *FightC) collectPlayerActions(ourID, oppID uint32) map[uint32]action.Bat
if f.Info.Status == info.BattleMode.FIGHT_WITH_NPC && pid == 0 { if f.Info.Status == info.BattleMode.FIGHT_WITH_NPC && pid == 0 {
f.Switch = make(map[uint32]*action.ActiveSwitchAction) f.Switch = make(map[uint32]*action.ActiveSwitchAction)
f.Our.Player.SendPackCmd(2407, &ret.Reason) f.Our.Player.SendPackCmd(2407, &ret.Reason)
println("AI出手死切") //println("AI出手死切")
go f.Our.GetAction() //boss出手后获取出招 f.Opp.GetAction() //boss出手后获取出招
} }
continue continue
@@ -222,9 +224,10 @@ func (f *FightC) collectPlayerActions(ourID, oppID uint32) map[uint32]action.Bat
} }
} else { } else {
println("玩家执行释放技能动作:", pid, paction.(*action.SelectSkillAction).Info.ID)
if selfinput.CurrentPet.Info.Hp <= 0 { //0血执行非切换动作 if selfinput.CurrentPet.Info.Hp <= 0 { //0血执行非切换动作
//todo 记录异常操作 //todo 记录异常操作
println("玩家执行了异常操作当前精灵血量为0不能执行非切换动作", pid)
continue continue
} }
if selfinput.CanChange == 1 { //非被动死亡情况下,不能执行额外动作,0允许切2是死亡可以额外动作 if selfinput.CanChange == 1 { //非被动死亡情况下,不能执行额外动作,0允许切2是死亡可以额外动作