``` feat(fight): 新增多种技能效果实现(110/125/128/131/145/151),优化状态判断逻辑并重构随机数生成方式
This commit is contained in:
44
logic/service/fight/effect/effect_128.go
Normal file
44
logic/service/fight/effect/effect_128.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/action"
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
func init() {
|
||||
t := &Effect128{
|
||||
EffectNode: node.EffectNode{},
|
||||
}
|
||||
|
||||
input.InitEffect(input.EffectType.Skill, 128, t)
|
||||
|
||||
}
|
||||
|
||||
type Effect128 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
// 默认添加回合
|
||||
func (e *Effect128) SetArgs(t *input.Input, a ...int) {
|
||||
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0])
|
||||
|
||||
}
|
||||
func (e *Effect128) DamageLock_ex(t *info.DamageZone) bool {
|
||||
if !e.Hit() {
|
||||
return true
|
||||
}
|
||||
if t.Type != info.DamageType.Red {
|
||||
return true
|
||||
}
|
||||
|
||||
heal := t.Damage
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
|
||||
t.Damage = alpacadecimal.Zero
|
||||
return true
|
||||
}
|
||||
Reference in New Issue
Block a user