1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-03-07 22:24:54 +08:00
parent b9ae17234d
commit bd3d7eac50
2 changed files with 70 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
func init() {
t := &Effect127{
EffectNode: node.EffectNode{},
}
input.InitEffect(input.EffectType.Skill, 127, t)
}
type Effect127 struct {
node.EffectNode
}
// 默认添加回合
func (e *Effect127) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[1])
}
func (e *Effect127) DamageDivEx(t *info.DamageZone) bool {
if t.Type != info.DamageType.Red {
return true
}
// 概率判定
ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if !ok {
return true
}
t.Damage = t.Damage.Div(alpacadecimal.NewFromInt(2))
return true
}

View File

@@ -0,0 +1,27 @@
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, 414, &Effect414{})
}
type Effect414 struct {
node.EffectNode
}
// 使用技能时不可被继承继承Miss和Hit就行
func (e *Effect414) OnSkill() bool {
if e.Ctx().Opp.StatEffect_Exist(info.EnumPetStatus(e.Args()[2].IntPart())) {
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(e.Args()[0].IntPart()), int8(e.Args()[1].IntPart())*2, info.AbilityOpType.SUB)
} else {
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(e.Args()[0].IntPart()), int8(e.Args()[1].IntPart()), info.AbilityOpType.SUB)
}
return true
}