feat: 新增战斗技能效果 524-580
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
32
logic/service/fight/effect/572.go
Normal file
32
logic/service/fight/effect/572.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
)
|
||||
|
||||
// 572 - 攻击对手时若对手处于{0}状态,则{1}%使对手{2}
|
||||
type Effect572 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect572) OnSkill() bool {
|
||||
triggerStatus := info.EnumPetStatus(e.Args()[0].IntPart())
|
||||
if e.Ctx().Opp.StatEffect_Exist(triggerStatus) {
|
||||
chance := e.Args()[1].IntPart()
|
||||
success, _, _ := e.Input.Player.Roll(int(chance), 100)
|
||||
if success {
|
||||
targetStatus := int(e.Args()[2].IntPart())
|
||||
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, targetStatus)
|
||||
if statusEffect != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 572, &Effect572{})
|
||||
}
|
||||
Reference in New Issue
Block a user