chore: update fight logic and effect implementations
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
This commit is contained in:
@@ -151,25 +151,6 @@ func (f *FightC) bindInputFightContext(inputGroups ...[]*input.Input) {
|
||||
}
|
||||
}
|
||||
|
||||
// linkOppInputs 仅建立“默认对手回退”关系,不参与真实目标选择。
|
||||
// 真实目标应由 action.targetIndex 决定;这里仅为旧 effect/无动作上下文链路提供默认 Opp。
|
||||
func (f *FightC) linkOppInputs() {
|
||||
defaultOpp := f.selectInput(f.Opp, 0)
|
||||
for _, fighter := range f.Our {
|
||||
if fighter == nil {
|
||||
continue
|
||||
}
|
||||
fighter.SetOPP(defaultOpp)
|
||||
}
|
||||
defaultOur := f.selectInput(f.Our, 0)
|
||||
for _, fighter := range f.Opp {
|
||||
if fighter == nil {
|
||||
continue
|
||||
}
|
||||
fighter.SetOPP(defaultOur)
|
||||
}
|
||||
}
|
||||
|
||||
// linkTeamViews 建立每个输入的同阵营/对阵营视图(Team/OppTeam)。
|
||||
func (f *FightC) linkTeamViews() {
|
||||
for _, fighter := range f.Our {
|
||||
@@ -263,7 +244,8 @@ func (f *FightC) setActionAttackValue(act action.BattleActionI) {
|
||||
return
|
||||
}
|
||||
attacker.AttackValue.ActorIndex = uint32(act.GetActorIndex())
|
||||
attacker.AttackValue.TargetIndex = uint32(act.GetTargetIndex())
|
||||
targetIndex, _ := DecodeTargetIndex(act.GetTargetIndex())
|
||||
attacker.AttackValue.TargetIndex = uint32(targetIndex)
|
||||
}
|
||||
|
||||
func (f *FightC) Ownerid() uint32 {
|
||||
@@ -311,10 +293,11 @@ func (f *FightC) GetInputByAction(c action.BattleActionI, isOpposite bool) *inpu
|
||||
return f.primaryOur()
|
||||
}
|
||||
index := c.GetActorIndex()
|
||||
if isOpposite {
|
||||
index = c.GetTargetIndex()
|
||||
if !isOpposite {
|
||||
return f.getInputByUserID(c.GetPlayerID(), index, false)
|
||||
}
|
||||
return f.getInputByUserID(c.GetPlayerID(), index, isOpposite)
|
||||
targetIndex, targetIsOpposite := DecodeTargetIndex(c.GetTargetIndex())
|
||||
return f.getInputByUserID(c.GetPlayerID(), targetIndex, targetIsOpposite)
|
||||
}
|
||||
|
||||
// 玩家使用技能
|
||||
|
||||
Reference in New Issue
Block a user