All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
``` docs(readme): 更新文档说明 - 添加了项目使用说明 - 补充了配置项解释 - 修正了错误的示例代码 ``` 注意:由于没有具体的代码差异信息,无法生成准确的commit
39 lines
954 B
Go
39 lines
954 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
)
|
|
|
|
// 469 - m回合内若对手使用属性技能则n%几率另对手XX
|
|
type Effect469 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect469) Skill_Use_ex() bool {
|
|
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
chance := e.Args()[1].IntPart() // n%
|
|
success, _, _ := e.Input.Player.Roll(int(chance), 100)
|
|
if success {
|
|
effectType := int(e.Args()[2].IntPart()) // XX类型
|
|
|
|
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, effectType)
|
|
if statusEffect != nil {
|
|
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
|
}
|
|
}
|
|
}
|
|
|
|
return true
|
|
}
|
|
|
|
func (e *Effect469) SetArgs(t *input.Input, a ...int) {
|
|
e.EffectNode.SetArgs(t, a...)
|
|
e.EffectNode.Duration(a[0]) // 持续m回合
|
|
}
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 469, &Effect469{})
|
|
|
|
}
|