This commit is contained in:
43
logic/service/fight/effect/effect_127.go
Normal file
43
logic/service/fight/effect/effect_127.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"
|
||||
|
||||
"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
|
||||
}
|
||||
27
logic/service/fight/effect/effect_414.go
Normal file
27
logic/service/fight/effect/effect_414.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user