refactor(fight/item/ai): 重构结构体初始化方式,移除冗余End方法并清理AI_player战斗结束逻辑
This commit is contained in:
@@ -92,7 +92,7 @@ func (h Controller) OnPlayerHandleFightInvite(data *fight.HandleFightInviteInbou
|
||||
|
||||
// 邀请其他人进行战斗
|
||||
func (h Controller) OnPlayerInviteOtherFight(data *fight.InviteToFightInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
c.InvitePlayerToBattle(&info.PVPinfo{data.UserID, data.Mode})
|
||||
c.InvitePlayerToBattle(&info.PVPinfo{PlayerID: data.UserID, Mode: data.Mode})
|
||||
|
||||
return nil, 0
|
||||
}
|
||||
|
||||
@@ -28,6 +28,6 @@ func (h Controller) PlayerGoldCount(data *item.GoldOnlineRemainInboundInfo, c *p
|
||||
|
||||
return &item.GoldOnlineRemainOutboundInfo{
|
||||
|
||||
uint32(c.Info.GoldBean) * 100,
|
||||
GoldNumber: uint32(c.Info.GoldBean) * 100,
|
||||
}, 0
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ type AI_player struct {
|
||||
CanCapture bool
|
||||
}
|
||||
|
||||
|
||||
func (f *AI_player) SendPack(b []byte) error {
|
||||
return nil
|
||||
|
||||
@@ -31,6 +30,7 @@ func (f *AI_player) SendNoteReadyToFightInfo(fs info.NoteReadyToFightInfo) {
|
||||
}
|
||||
|
||||
func (f *AI_player) SendFightEndInfo(_ info.FightOverInfo) {
|
||||
f.FightC = nil
|
||||
//fmt.Println("战斗结束")
|
||||
|
||||
}
|
||||
@@ -38,11 +38,6 @@ 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) GetPetInfo() []model.PetInfo {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user