feat: 新增效果526和542实现
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:
@@ -34,5 +34,33 @@ func (e *Effect469) SetArgs(t *input.Input, a ...int) {
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 469, &Effect469{})
|
||||
|
||||
input.InitEffect(input.EffectType.Skill, 526, &Effect526{})
|
||||
}
|
||||
|
||||
// {
|
||||
// "id": 526,
|
||||
// "argsNum": 2,
|
||||
// "info": "{0}回合内若对手成功使用属性技能则受到{1}点固定伤害"
|
||||
// },
|
||||
//
|
||||
// 469 - m回合内若对手使用属性技能则n%几率另对手XX
|
||||
type Effect526 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect526) Skill_Use_ex() bool {
|
||||
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||||
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: e.Args()[0],
|
||||
})
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect526) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.EffectNode.Duration(a[0]) // 持续m回合
|
||||
}
|
||||
|
||||
40
logic/service/fight/effect/542.go
Normal file
40
logic/service/fight/effect/542.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// {
|
||||
// "id": 542,
|
||||
// "argsNum": 1,
|
||||
// "info": "对手每处于一种能力下降状态时附加{0}点固定伤害"
|
||||
// },
|
||||
type Effect542 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect542) Skill_Use() bool {
|
||||
|
||||
r := alpacadecimal.Zero
|
||||
for _, v := range e.Ctx().Opp.Prop[:] {
|
||||
if v < 0 {
|
||||
r.Add(alpacadecimal.NewFromInt(1))
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: e.Args()[0].Mul(r),
|
||||
})
|
||||
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 542, &Effect542{})
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user