- 移除未使用的 SocketHandler_Tomee.go、ai.go、effect_1.go 文件 - 更新 player 包名引用,替换原 service 包 - 调整 TomeeHeader 和相关处理逻辑至 player 包 - 更新各控制器中的 Player 引用为 player 包中的类型 - 移除冗余的 GetPlayer 方法,使用新逻辑
87 lines
1.9 KiB
Go
87 lines
1.9 KiB
Go
package player
|
|
|
|
import (
|
|
"blazing/common/data/xmlres"
|
|
"blazing/logic/service/common"
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/modules/blazing/model"
|
|
"fmt"
|
|
)
|
|
|
|
type AI_player struct {
|
|
FightC common.FightI //绑定战斗标识 替代本身的是否战斗标记 //IsFighting bool
|
|
petinfo []model.PetInfo //精灵信息
|
|
info model.PlayerInfo
|
|
CanCapture bool
|
|
}
|
|
|
|
func NewAI_player(i model.PlayerInfo, m model.PetInfo) *AI_player {
|
|
ret := &AI_player{}
|
|
ret.petinfo = make([]model.PetInfo, 0)
|
|
ret.petinfo = append(ret.petinfo, m)
|
|
ret.info = i
|
|
ret.info.Nick = xmlres.PetMAP[int(m.ID)].DefName
|
|
return ret
|
|
|
|
}
|
|
func (f *AI_player) SetFightC(ff common.FightI) {
|
|
f.FightC = ff
|
|
}
|
|
|
|
func (f *AI_player) ID() uint32 {
|
|
return 0
|
|
}
|
|
|
|
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(fs info.NoteReadyToFightInfo) {
|
|
fmt.Println(fs)
|
|
}
|
|
|
|
func (f *AI_player) SendFightEndInfo(_ info.FightOverInfo) {
|
|
//fmt.Println("战斗结束")
|
|
|
|
}
|
|
func (f *AI_player) GetAction() {
|
|
//使用1#技能,实际上要按照四个技能权重去使用
|
|
f.FightC.UseSkill(f, int32(f.FightC.GetCurrPET(f).Skills[0].ID))
|
|
}
|
|
func (p *AI_player) End() {
|
|
p.FightC = nil
|
|
|
|
return
|
|
}
|
|
func (p *AI_player) GetInfo() model.PlayerInfo {
|
|
|
|
return p.info
|
|
}
|
|
|
|
func (p *AI_player) GetPetInfo() []model.PetInfo {
|
|
|
|
return p.petinfo
|
|
}
|
|
func (p *AI_player) SendAttackValue(info.AttackValueS) {
|
|
|
|
}
|
|
func (p *AI_player) SendChangePet(info.ChangePetInfo) {
|
|
|
|
}
|