- 移除 NodeManager 相关代码,改为使用 input 包中的 Effect - 重构 FightC 结构,添加 GetRand 方法 - 新增 BaseAction 结构和 NewBaseAction 函数 - 更新 effect 包中的 Effect 结构和相关方法 - 调整 BattleSkillEntity 中的 AttackTime 方法,增加 Hit 字段 - 更新 AttackValue 结构,保留原有的 AttackTime 字段 - 重构战斗逻辑,包括回合开始前的处理、技能使用、伤害计算等
47 lines
1.0 KiB
Go
47 lines
1.0 KiB
Go
package input
|
|
|
|
import (
|
|
"blazing/logic/service/common"
|
|
"blazing/logic/service/fight/info"
|
|
|
|
"github.com/jinzhu/copier"
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
type Input struct {
|
|
CanChange bool //是否可以死亡切换CanChange
|
|
CurrentPet *info.BattlePetEntity //当前精灵
|
|
AllPet []*info.BattlePetEntity
|
|
Player common.PlayerI
|
|
Finished bool //是否加载完成
|
|
*info.AttackValue
|
|
FightC common.FightI
|
|
// info.BattleActionI
|
|
Effect NodeManager //effects容器OurEffect node.NodeManager //effects容器
|
|
Damage decimal.Decimal //造成伤害
|
|
First bool
|
|
}
|
|
|
|
func (i *Input) GetPetInfo() *info.BattlePetEntity {
|
|
|
|
return i.CurrentPet
|
|
|
|
}
|
|
func (i *Input) InitAttackValue() {
|
|
i.AttackValue = info.NewAttackValue(i.Player.ID())
|
|
|
|
}
|
|
func (i *Input) GetPet(id uint32) (ii *info.BattlePetEntity, Reason info.ChangePetInfo) {
|
|
for _, v := range i.AllPet {
|
|
if v.Info.CatchTime == uint32(id) {
|
|
copier.Copy(&Reason, &v.Info)
|
|
Reason.UserId = i.Player.ID()
|
|
|
|
ii = v
|
|
}
|
|
|
|
}
|
|
return
|
|
|
|
}
|