Files
bl/logic/service/ai.go
昔念 9d2de92dd6 feat(fight): 实现精灵切换功能并优化战斗逻辑
- 新增 ChangePet 方法实现精灵切换
- 优化战斗循环逻辑,支持精灵切换
- 修复一些战斗相关的 bug
- 优化代码结构,提高可维护性
2025-09-07 00:23:28 +08:00

68 lines
1.5 KiB
Go

package service
import (
"blazing/logic/service/fight/info"
"blazing/modules/blazing/model"
"fmt"
)
type AI_player struct {
fightinfo info.NoteReadyToFightInfo
id uint32 //0
FightC *FightC //绑定战斗标识 替代本身的是否战斗标记 //IsFighting bool
//petinfo []model.PlayerInfo //精灵信息
}
func (f *AI_player) ID() uint32 {
return f.id
}
func (f *AI_player) MapID() uint32 {
panic("not implemented") // TODO: Implement
}
// func (f *AI_player) GetInfo() model.PlayerInfo {
// return f.FightC.Opp.
// }
func (f *AI_player) SendPack(b []byte) error {
panic("not implemented") // TODO: Implement
}
func (f *AI_player) SendReadyToFightInfo(gg info.FightStartOutboundInfo) {
fmt.Println(gg)
// f.FightC.UseSkill(f, f.fightinfo.OpponentPetList[0].SkillList[0].ID) //使用1#技能,实际上要按照四个技能权重去使用
//这时候给个出招
}
func (f *AI_player) SendNoteReadyToFightInfo(_ info.NoteReadyToFightInfo) {
panic("not implemented") // TODO: Implement
}
func (f *AI_player) SendFightEndInfo(_ info.FightOverInfo) {
fmt.Println("战斗结束")
}
func (f *AI_player) GetAction() {
f.FightC.UseSkill(f, int32(f.fightinfo.OpponentPetList[0].SkillList[0].ID)) //使用1#技能,实际上要按照四个技能权重去使用
}
func (p *AI_player) End() {
p.FightC = nil
return
}
func (p *AI_player) GetPetInfo() []*model.PetInfo {
return nil
}
func (p *AI_player) SendAttackValue(info.AttackValueS) {
}
func (p *AI_player) SendChangePet(info.ChangePetInfo) {
}