feat: 添加效果1146并优化条件判断逻辑
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
37
logic/service/fight/effect/1146.go
Normal file
37
logic/service/fight/effect/1146.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
)
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 1146, &Effect1146{})
|
||||
|
||||
}
|
||||
|
||||
type Effect1146 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect1146) OnSkill() bool {
|
||||
// 1. 命中判定失败,不触发
|
||||
count := 0
|
||||
for _, v := range e.Ctx().Opp.Prop[:] {
|
||||
if v > 0 {
|
||||
count++
|
||||
}
|
||||
|
||||
}
|
||||
if count < e.SideEffectArgs[0] {
|
||||
return true
|
||||
}
|
||||
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: e.Args()[1],
|
||||
})
|
||||
|
||||
return true
|
||||
}
|
||||
@@ -4,8 +4,6 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// -----------------------------------------------------------
|
||||
@@ -68,11 +66,9 @@ func (e *EffectConditionalAddDamage) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// 4. 附加固定伤害(从SideEffectArgs[0]获取伤害值)
|
||||
damageValue := alpacadecimal.NewFromInt(int64(e.SideEffectArgs[0]))
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: damageValue,
|
||||
Damage: e.Args()[0],
|
||||
})
|
||||
|
||||
return true
|
||||
@@ -105,10 +101,6 @@ func conditionIsAbnormal(e *EffectConditionalAddDamage) bool {
|
||||
|
||||
// conditionPropDown:判断对方是否处于能力下降状态
|
||||
func conditionPropDown(e *EffectConditionalAddDamage) bool {
|
||||
for _, v := range e.Ctx().Opp.Prop {
|
||||
if v < 0 {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
|
||||
return e.Ctx().Opp.HasPropSub()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user