163 lines
3.9 KiB
Go
163 lines
3.9 KiB
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/action"
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
)
|
|
|
|
// Effect 729: {0}回合内若造成伤害大于{1}则{2}%概率使对手{3}
|
|
type Effect729 struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect729) Skill_Use() bool {
|
|
skill := e.Ctx().SkillEntity
|
|
if skill == nil || skill.Category() == info.Category.STATUS || len(e.Args()) < 4 {
|
|
return true
|
|
}
|
|
if e.Ctx().Opp.CurrentPet.Info.Hp <= 0 {
|
|
return true
|
|
}
|
|
if e.Ctx().Our.SumDamage.Cmp(e.Args()[1]) <= 0 {
|
|
return true
|
|
}
|
|
|
|
success, _, _ := e.Input.Player.Roll(int(e.Args()[2].IntPart()), 100)
|
|
if !success {
|
|
return true
|
|
}
|
|
|
|
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[3].IntPart()))
|
|
if statusEffect != nil {
|
|
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 730: 下回合起,{0}回合内每回合{1}
|
|
type Effect730 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect730) Skill_Use() bool {
|
|
addSubEffect(e.Ctx().Our, e.Ctx().Our, &e.EffectNode, &Effect730Sub{}, -1)
|
|
return true
|
|
}
|
|
|
|
type Effect730Sub struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect730Sub) ActionStart(a, b *action.SelectSkillAction) bool {
|
|
for i := 1; i < len(e.Args()) && i <= 6; i++ {
|
|
level := int8(e.Args()[i].IntPart())
|
|
if level == 0 {
|
|
continue
|
|
}
|
|
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i-1), level)
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 731: 本回合打出致命一击则下{0}回合其它攻击技能必定致命一击
|
|
type Effect731 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect731) Skill_Use() bool {
|
|
skill := e.Ctx().SkillEntity
|
|
if skill == nil || skill.Category() == info.Category.STATUS || skill.AttackTime == 0 || skill.Crit == 0 || len(e.Args()) == 0 {
|
|
return true
|
|
}
|
|
|
|
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 731, int(e.Args()[0].IntPart()), skill.XML.ID)
|
|
if sub != nil {
|
|
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
|
}
|
|
return true
|
|
}
|
|
|
|
type Effect731Sub struct {
|
|
RoundEffectArg0Base
|
|
triggerSkillID int
|
|
}
|
|
|
|
func (e *Effect731Sub) SetArgs(t *input.Input, a ...int) {
|
|
setArgsWithDuration0(&e.EffectNode, t, a...)
|
|
if len(a) > 1 {
|
|
e.triggerSkillID = a[1]
|
|
}
|
|
}
|
|
|
|
func (e *Effect731Sub) ActionStart(a, b *action.SelectSkillAction) bool {
|
|
skill := e.Ctx().SkillEntity
|
|
if skill == nil || skill.Category() == info.Category.STATUS || skill.AttackTime == 0 {
|
|
return true
|
|
}
|
|
if skill.XML.ID == e.triggerSkillID {
|
|
return true
|
|
}
|
|
|
|
skill.XML.CritRate = 16
|
|
return true
|
|
}
|
|
|
|
// Effect 732: 本回合若没有打出致命一击则{0}
|
|
type Effect732 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect732) Skill_Use() bool {
|
|
skill := e.Ctx().SkillEntity
|
|
if skill == nil || skill.Category() == info.Category.STATUS || skill.AttackTime == 0 || skill.Crit != 0 {
|
|
return true
|
|
}
|
|
|
|
for i := 0; i < len(e.Args()) && i < 6; i++ {
|
|
level := int8(e.Args()[i].IntPart())
|
|
if level == 0 {
|
|
continue
|
|
}
|
|
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), level)
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 733: 反转自身能力下降状态,反转成功则对手{0}
|
|
type Effect733 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect733) OnSkill() bool {
|
|
reversed := false
|
|
for i, v := range e.Ctx().Our.Prop[:] {
|
|
if v >= 0 {
|
|
continue
|
|
}
|
|
if e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), -2*v) {
|
|
reversed = true
|
|
}
|
|
}
|
|
if !reversed || len(e.Args()) == 0 {
|
|
return true
|
|
}
|
|
|
|
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[0].IntPart()))
|
|
if statusEffect != nil {
|
|
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
|
}
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 729, &Effect729{})
|
|
input.InitEffect(input.EffectType.Skill, 730, &Effect730{})
|
|
input.InitEffect(input.EffectType.Sub, 730, &Effect730Sub{})
|
|
input.InitEffect(input.EffectType.Skill, 731, &Effect731{})
|
|
input.InitEffect(input.EffectType.Sub, 731, &Effect731Sub{})
|
|
input.InitEffect(input.EffectType.Skill, 732, &Effect732{})
|
|
input.InitEffect(input.EffectType.Skill, 733, &Effect733{})
|
|
}
|