```feat(fight): 新增无视双防效果566实现,优化战斗过程中宠物信息保存逻辑

This commit is contained in:
1
2025-12-11 20:20:39 +00:00
parent 4c69e578dd
commit 32c61f37bd
4 changed files with 49 additions and 5 deletions

View File

@@ -34,9 +34,6 @@ func (e *Effect1605) OnSkill() bool {
return true
}
duration := int(e.Input.FightC.GetRand().Int31n(2)) // 默认随机 2~3 回合
duration++
// 获取状态效果
eff := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.SideEffectArgs[1]))
if eff == nil {

View File

@@ -0,0 +1,43 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
/**
* 无视对手双防能力提升状态
*/
type Effect566 struct {
node.EffectNode
}
func init() {
ret := &Effect566{}
input.InitEffect(input.EffectType.Skill, 566, ret)
}
// 命中之后
func (e *Effect566) OnSkill() bool {
if !e.Hit() {
return true
}
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
return true
}
func (e *Effect566) Skill_Hit() bool {
if e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.Category() == info.Category.PHYSICAL {
e.Ctx().Opp.CurrentPet.Info.Prop[2] = 0
} else {
e.Ctx().Opp.CurrentPet.Info.Prop[4] = 0
}
return true
}

View File

@@ -53,7 +53,7 @@ func (e *EffectRandomStatus) OnSkill() bool {
if eff == nil {
return true
}
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
return true
@@ -74,4 +74,5 @@ func init() {
{upper: 20, status: info.PetStatus.Sleep}, // 10-19睡眠
{upper: 30, status: info.PetStatus.Fear}, // 20-29害怕
}))
}

View File

@@ -31,7 +31,10 @@ func (f *FightC) processSkillAttack(attacker, defender *input.Input, a *info.Ski
})
var oldprop [2][6]int8
var oldinfo [2]model.PetInfo
oldprop[0], oldprop[1] = attacker.Prop, defender.Prop //先复制能力提升
oldinfo[0], oldinfo[1] = attacker.CurrentPet.Info, defender.CurrentPet.Info
attacker.Exec(func(t input.Effect) bool {
//计算变威力
t.Ctx().SkillEntity = a
@@ -58,7 +61,7 @@ func (f *FightC) processSkillAttack(attacker, defender *input.Input, a *info.Ski
}
attacker.Prop, defender.Prop = oldprop[0], oldprop[1] //先复制能力提升
attacker.CurrentPet.Info, defender.CurrentPet.Info = oldinfo[0], oldinfo[1]
if attacker.IsCritical == 1 { //命中了才有暴击
//暴击破防
if a.Category() == info.Category.PHYSICAL && defender.Prop[1] > 0 {