Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
fix(fight): 修复技能实体属性访问问题 - 修改所有技能实体的ID、Power、CritRate、MustHit、Priority等属性访问方式 从直接访问改为通过XML字段访问,确保数据一致性 - 更新多个boss技能效果处理逻辑中的属性引用路径 - 移除已废弃的effect/486文件 - 在New
56 lines
1.1 KiB
Go
56 lines
1.1 KiB
Go
package effect
|
|
|
|
import (
|
|
element "blazing/common/data/Element"
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/alpacahq/alpacadecimal"
|
|
)
|
|
|
|
/**
|
|
*m~n回合对本方的火系攻击伤害减半
|
|
*/
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 41, &Effect41{})
|
|
|
|
}
|
|
|
|
type Effect41 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect41) SetArgs(t *input.Input, a ...int) {
|
|
e.EffectNode.SetArgs(t, a...)
|
|
t1 := e.Input.FightC
|
|
t2 := t1.GetRand()
|
|
|
|
n := t2.Int31n(int32(e.Args()[1].Sub(e.Args()[0]).Add(alpacadecimal.NewFromInt(1)).IntPart()))
|
|
|
|
e.EffectNode.Duration(int(e.Args()[0].Add(alpacadecimal.NewFromInt(int64(n))).IntPart()))
|
|
|
|
}
|
|
|
|
// 伤害落实前触发,限制最大伤害
|
|
func (e *Effect41) DamageDivEx(t *info.DamageZone) bool {
|
|
|
|
if e.Ctx().SkillEntity == nil {
|
|
return true
|
|
}
|
|
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
return true
|
|
}
|
|
|
|
if e.Ctx().SkillEntity.XML.Type != int(element.ElementTypeFire) {
|
|
return true
|
|
}
|
|
if t.Type == info.DamageType.Red {
|
|
t.Damage = t.Damage.Div(alpacadecimal.NewFromInt(2))
|
|
|
|
}
|
|
|
|
return true
|
|
}
|