Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
refactor(fight): 统一技能执行方法命名并修复战斗逻辑错误 - 将多个boss技能结构体中的OnSkill()方法重命名为Skill_Use()以保持一致性 - 修改fightc.go中的战斗回合逻辑,修复attacker和defender的执行顺序错误 - 将Effect126的TurnStart方法改为Skill_Use方法并返回bool值 - 为Effect499添加缺失的方法实现 - 移除effect_124_126.go中未
37 lines
826 B
Go
37 lines
826 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/alpacahq/alpacadecimal"
|
|
)
|
|
|
|
// 491 - 3回合内对手造成的伤害降低m%
|
|
type Effect491 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect491) DamageDivEx(t *info.DamageZone) bool {
|
|
if t.Type != info.DamageType.Red {
|
|
return true
|
|
}
|
|
damageReduction := alpacadecimal.NewFromInt(int64(e.Args()[1].IntPart())).Mul(t.Damage)
|
|
if t.Damage.Cmp(damageReduction) > 0 {
|
|
t.Damage = t.Damage.Sub(damageReduction)
|
|
} else {
|
|
t.Damage = alpacadecimal.Zero
|
|
}
|
|
|
|
return true
|
|
}
|
|
func (e *Effect491) SetArgs(t *input.Input, a ...int) {
|
|
e.EffectNode.SetArgs(t, a...)
|
|
e.EffectNode.Duration(a[0]) // 持续n回合
|
|
}
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 491, &Effect491{})
|
|
|
|
}
|