```feat(fight): 新增无视双防效果566实现,优化战斗过程中宠物信息保存逻辑
This commit is contained in:
@@ -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 {
|
||||
|
||||
43
logic/service/fight/effect/effect_566.go
Normal file
43
logic/service/fight/effect/effect_566.go
Normal 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
|
||||
}
|
||||
@@ -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:害怕
|
||||
}))
|
||||
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user