Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
fix(fight): 修复技能实体属性访问问题 - 修改所有技能实体的ID、Power、CritRate、MustHit、Priority等属性访问方式 从直接访问改为通过XML字段访问,确保数据一致性 - 更新多个boss技能效果处理逻辑中的属性引用路径 - 移除已废弃的effect/486文件 - 在New
51 lines
1.1 KiB
Go
51 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"
|
|
"github.com/gogf/gf/v2/util/grand"
|
|
)
|
|
|
|
// n回合提示m翻倍
|
|
// ---- Effect42 ----
|
|
type Effect42 struct {
|
|
node.EffectNode
|
|
StatusID int
|
|
}
|
|
|
|
func (e *Effect42) Damage_Mul(t *info.DamageZone) bool {
|
|
|
|
if e.Ctx().SkillEntity == nil {
|
|
return true
|
|
}
|
|
|
|
if e.Ctx().SkillEntity.XML.Type != int(element.ElementTypeElectric) {
|
|
return true
|
|
}
|
|
//fmt.Println("Effect42_o", t.Damage)
|
|
if t.Type == info.DamageType.Red {
|
|
|
|
t.Damage = t.Damage.Mul(alpacadecimal.NewFromInt(2))
|
|
|
|
}
|
|
//fmt.Println("Effect42_n", t.Damage)
|
|
return true
|
|
}
|
|
func (e *Effect42) SetArgs(t *input.Input, a ...int) {
|
|
|
|
//e.CanStack(-1)//后续的不会顶掉这个效果
|
|
e.EffectNode.SetArgs(t, a...)
|
|
|
|
e.Duration(grand.N(int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))) //次数类,无限回合
|
|
|
|
}
|
|
|
|
// ---- 注册所有效果 ----
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 42, &Effect42{})
|
|
}
|