41
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-03-07 23:54:01 +08:00
parent 54a4876beb
commit d367f9d1d4
26 changed files with 3761 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 509 - 恢复当前受损体力值1/m的体力
type Effect509 struct {
node.EffectNode
}
func (e *Effect509) OnSkill() bool {
maxHp := e.Ctx().Our.CurrentPet.GetMaxHP()
currentHp := e.Ctx().Our.CurrentPet.GetHP()
lostHp := maxHp.Sub(currentHp)
healAmount := lostHp.Div(e.Args()[0]) // 受损体力值的1/m
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, healAmount)
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 509, &Effect509{})
}

View File

@@ -0,0 +1,43 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 163 - n回合内若对手使用属性技能则随机进入烧伤、冻伤、中毒、麻痹、害怕、睡眠中的一种异常状态
type Effect163 struct {
node.EffectNode
}
func (e *Effect163) Skill_Use_ex() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS {
// 随机选择一个异常状态
statusTypes := []int{
int(info.PetStatus.Burned),
int(info.PetStatus.Frozen),
int(info.PetStatus.Poisoned),
int(info.PetStatus.Paralysis),
int(info.PetStatus.Fear),
int(info.PetStatus.Sleep),
}
randomIndex := int(e.Input.FightC.GetRand().Int31n(int32(len(statusTypes))))
selectedStatus := statusTypes[randomIndex]
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, selectedStatus)
if statusEffect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
}
}
return true
}
func (e *Effect163) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续n回合
}
func init() {
input.InitEffect(input.EffectType.NewSel, 163, &Effect163{})
}

View File

@@ -0,0 +1,39 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 174 - n回合内若对手使用属性攻击则m%自身XX等级k
type Effect174 struct {
node.EffectNode
}
func (e *Effect174) Skill_Use_ex() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS {
chance := e.Args()[0].IntPart()
success, _, _ := e.Input.Player.Roll(int(chance), 100)
if success {
// 提升自身能力等级
effectType := e.Args()[1].IntPart() // 状态类型
effectValue := e.Args()[2].IntPart() // 等级提升数量
boostEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(effectType))
if boostEffect != nil {
boostEffect.SetArgs(e.Ctx().Our, int(effectValue))
e.Ctx().Our.AddEffect(e.Ctx().Our, boostEffect)
}
}
}
return true
}
func (e *Effect174) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续n回合
}
func init() {
input.InitEffect(input.EffectType.NewSel, 174, &Effect174{})
}

View File

@@ -0,0 +1,33 @@
package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 187 - n回合内若对手使用属性技能则自身恢复1/m最大体力值
type Effect187 struct {
node.EffectNode
}
func (e *Effect187) Skill_Use_ex() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS {
maxHp := e.Ctx().Our.CurrentPet.GetMaxHP()
healAmount := maxHp.Div(e.Args()[1]) // 1/m
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, healAmount)
}
return true
}
func (e *Effect187) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续n回合
}
func init() {
input.InitEffect(input.EffectType.NewSel, 187, &Effect187{})
}

View File

@@ -0,0 +1,30 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 189 - n回合内若受到攻击对手攻击等级-1、特攻等级-1
type Effect189 struct {
node.EffectNode
}
func (e *Effect189) Skill_Use_ex() bool {
if e.Ctx().SkillEntity == nil {
return true
}
e.Ctx().Opp.SetProp(e.Ctx().Our, 0, -1, info.AbilityOpType.SUB)
e.Ctx().Opp.SetProp(e.Ctx().Our, 2, -1, info.AbilityOpType.SUB)
return true
}
func (e *Effect189) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续n回合
}
func init() {
input.InitEffect(input.EffectType.NewSel, 189, &Effect189{})
}

View File

@@ -0,0 +1,36 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 192 - 附加n%当前体力值的伤害
type Effect192 struct {
node.EffectNode
}
func (e *Effect192) OnSkill() bool {
if e.Ctx().SkillEntity == nil {
return true
}
currentHp := e.Ctx().Our.CurrentPet.GetHP()
percent := e.Args()[0].Div(alpacadecimal.NewFromInt(100))
additionalDamage := currentHp.Mul(percent)
damageZone := &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: additionalDamage,
}
e.Ctx().Opp.Damage(e.Ctx().Our, damageZone)
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 192, &Effect192{})
}

View File

@@ -0,0 +1,49 @@
package effect
import (
"blazing/common/utils"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
func init() {
t := &Effect411{}
t.Duration(-1) //次数类无限回合
t.CanStack(true) //后续的不会顶掉这个效果
input.InitEffect(input.EffectType.Skill, 411, t)
}
// 411 - 附加对手当前体力值n%的百分比伤害连续使用每次增加m%最高k%
type Effect411 struct {
node.EffectNode
Skillid int //记录使用的技能 如果技能变了就删除effect
UseSkillCount int //技能使用了多少次切换后置0
}
func (e *Effect411) OnSkill() bool {
if e.Skillid != 0 && e.Ctx().SkillEntity.ID != e.Skillid {
e.Alive(false)
e.UseSkillCount = 0
return true
}
e.Skillid = e.Ctx().SkillEntity.ID
opponentHp := e.Ctx().Opp.CurrentPet.GetHP()
addhe := utils.Min(e.Args()[1].IntPart()*int64(e.UseSkillCount), e.Args()[2].IntPart())
// 附加百分比伤害
damageZone := &info.DamageZone{
Type: info.DamageType.Percent,
Damage: opponentHp.Mul((e.Args()[0].Add(alpacadecimal.NewFromInt(addhe))).Mul(alpacadecimal.NewFromInt(100))),
}
e.Ctx().Opp.Damage(e.Ctx().Our, damageZone)
e.UseSkillCount++
return true
}

View File

@@ -0,0 +1,28 @@
package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 415 - 若造成的伤害大于m点则自身恢复n点体力
type Effect415 struct {
node.EffectNode
}
func (e *Effect415) SkillUseed() bool {
damageThreshold := int(e.Args()[0].IntPart())
healAmount := e.Args()[1].IntPart()
if e.Ctx().Our.SumDamage.Cmp(alpacadecimal.NewFromInt(int64(damageThreshold))) > 0 {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, alpacadecimal.NewFromInt(int64(healAmount)))
}
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 415, &Effect415{})
}

View File

@@ -0,0 +1,26 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 447 - 造成的伤害不少于m
type Effect447 struct {
node.EffectNode
}
func (e *Effect447) DamageLockEx(t *info.DamageZone) bool {
if t.Type != info.DamageType.Red {
return true
}
t.Damage = alpacadecimal.Max(e.Args()[0], t.Damage)
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 447, &Effect447{})
}

View File

@@ -0,0 +1,30 @@
package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 452 - n回合内自身所有攻击造成的伤害都将为自己恢复体力
type Effect452 struct {
node.EffectNode
}
func (e *Effect452) SkillUseed() bool {
damageDone := e.Ctx().Our.SumDamage
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damageDone)
return true
}
func (e *Effect452) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0])
}
func init() {
input.InitEffect(input.EffectType.NewSel, 452, &Effect452{})
}

View File

@@ -0,0 +1,39 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 455 - 当损失n点体力时额外附加m点固定伤害
type Effect455 struct {
node.EffectNode
}
func (e *Effect455) Skill_Use_ex() bool {
// 计算受到的伤害
damageTaken := e.Ctx().Our.SumDamage
// 计算应该附加的额外伤害
damageRatio := damageTaken.Div(e.Args()[0]) // 损失n点的次数
additionalDamagePerHit := alpacadecimal.NewFromInt(int64(e.Args()[1].IntPart()))
// 总额外伤害
totalAdditionalDamage := additionalDamagePerHit.Mul(damageRatio)
if totalAdditionalDamage.Cmp(alpacadecimal.NewFromInt(0)) > 0 {
damageZone := &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: totalAdditionalDamage,
}
e.Ctx().Opp.Damage(e.Ctx().Our, damageZone)
}
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 455, &Effect455{})
}

View File

@@ -0,0 +1,31 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 459 - 附加对手防御值m%的固定伤害
type Effect459 struct {
node.EffectNode
}
func (e *Effect459) OnSkill() bool {
if e.Ctx().SkillEntity == nil {
return true
}
opponentDef := alpacadecimal.NewFromInt(int64(e.Ctx().Opp.CurrentPet.Info.Prop[1]))
percent := e.Args()[0].Div(alpacadecimal.NewFromInt(100))
additionalDamage := opponentDef.Mul(percent)
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: additionalDamage})
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 459, &Effect459{})
}

View File

@@ -0,0 +1,26 @@
package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 472 - 若对手处于XX状态则每次攻击造成的伤害都将恢复自身体力
type Effect472 struct {
node.EffectNode
}
func (e *Effect472) SkillUseed() bool {
if e.Ctx().Opp.StatEffect_Exist(info.EnumPetStatus(e.Args()[0].IntPart())) { // 对手处于异常状态
// 造成的伤害恢复自身体力
damageDone := e.Ctx().Our.SumDamage
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damageDone)
}
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 472, &Effect472{})
}

View File

@@ -0,0 +1,52 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 479 - 损失自身n点体力给对手造成m点固定伤害
type Effect479 struct {
node.EffectNode
}
func (e *Effect479) OnSkill() bool {
selfDamage := alpacadecimal.NewFromInt(int64(e.Args()[0].IntPart()))
opponentDamage := alpacadecimal.NewFromInt(int64(e.Args()[1].IntPart()))
// 检查自身体力是否低于200
currentHp := e.Ctx().Our.CurrentPet.GetHP()
minHp := alpacadecimal.NewFromInt(200)
if currentHp.Cmp(minHp) < 0 {
// 如果自身体力不足200保留1点体力
damageToTake := currentHp.Sub(alpacadecimal.NewFromInt(1))
damageZone := &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: damageToTake,
}
e.Ctx().Our.Damage(e.Ctx().Our, damageZone)
} else {
// 损失n点体力
damageZone := &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: selfDamage,
}
e.Ctx().Our.Damage(e.Ctx().Our, damageZone)
}
// 给对手造成m点固定伤害
damageZone := &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: opponentDamage,
}
e.Ctx().Opp.Damage(e.Ctx().Our, damageZone)
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 479, &Effect479{})
}

View File

@@ -0,0 +1,26 @@
package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 482 - m%几率先制+n
type Effect482 struct {
node.EffectNode
}
func (e *Effect482) ActionStartEx(fattack, sattack *action.SelectSkillAction) bool {
// n%几率触发
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if success && e.Ctx().SkillEntity != nil {
// 先制+1提升优先级
e.Ctx().SkillEntity.AttackTime += uint32(e.Args()[1].IntPart())
}
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 482, &Effect482{})
}

View File

@@ -0,0 +1,44 @@
package effect
import (
"blazing/common/utils"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 484 - 连击n次每次命中后连击数+m最高连击p次
type Effect484 struct {
node.EffectNode
count int64
}
func (e *Effect484) Damage_Mul(t *info.DamageZone) bool {
if t.Type == info.DamageType.Red {
n := utils.Min(e.Args()[0].IntPart()+e.count, e.Args()[1].IntPart())
t.Damage = t.Damage.Mul(alpacadecimal.NewFromInt(int64(n)))
}
return true
}
func (e *Effect484) SkillHit() bool {
if e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.AttackTime != 0 {
e.count = 0
return true
}
e.count += e.Args()[1].IntPart()
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 484, &Effect484{})
}

View File

@@ -0,0 +1,28 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 487 - 若对手的体力大于400则每次使用自身攻击+1
type Effect487 struct {
node.EffectNode
}
func (e *Effect487) OnSkill() bool {
opponentHp := e.Ctx().Opp.CurrentPet.GetHP()
if opponentHp.Cmp(alpacadecimal.NewFromInt(400)) > 0 {
// 提升自身攻击等级
e.Ctx().Our.SetProp(e.Ctx().Our, 0, 1, info.AbilityOpType.ADD)
}
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 487, &Effect487{})
}

View File

@@ -0,0 +1,40 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 502 - n回合内所有直接攻击都将降低对手1/m的体力
type Effect502 struct {
node.EffectNode
}
func (e *Effect502) OnSkill() bool {
if e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.Category() != info.Category.STATUS { // 非属性技能,即直接攻击
// 计算对手最大体力的1/m
maxHp := e.Ctx().Opp.CurrentPet.GetMaxHP()
damage := maxHp.Div(e.Args()[1])
damageZone := &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: damage,
}
e.Ctx().Opp.Damage(e.Ctx().Our, damageZone)
}
return true
}
func (e *Effect502) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续n回合
}
func init() {
input.InitEffect(input.EffectType.NewSel, 502, &Effect502{})
}

View File

@@ -0,0 +1,23 @@
package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 510 - 1 当对手处于防御能力提升时恢复n点体力值
type Effect510 struct {
node.EffectNode
}
func (e *Effect510) Skill_Use_ex() bool {
if e.Ctx().Opp.Prop[1] > 0 {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Args()[0])
}
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 510, &Effect510{})
}

View File

@@ -0,0 +1,36 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 514 - 附加对手已损失体力n%的固定伤害
type Effect514 struct {
node.EffectNode
}
func (e *Effect514) OnSkill() bool {
maxHp := e.Ctx().Opp.CurrentPet.GetMaxHP()
currentHp := e.Ctx().Opp.CurrentPet.GetHP()
lostHp := maxHp.Sub(currentHp)
damagePercent := e.Args()[0].Div(alpacadecimal.NewFromInt(100))
additionalDamage := lostHp.Mul(damagePercent)
if additionalDamage.Cmp(alpacadecimal.NewFromInt(0)) > 0 {
damageZone := &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: additionalDamage,
}
e.Ctx().Opp.Damage(e.Ctx().Our, damageZone)
}
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 514, &Effect514{})
}

View File

@@ -0,0 +1,38 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 515 - 自身处于能力下降状态时附加n点固定伤害并解除这些能力下降状态
type Effect515 struct {
node.EffectNode
}
func (e *Effect515) OnSkill() bool {
var is bool
for i := 0; i < 6; i++ {
if e.Ctx().Our.Prop[i] < 0 {
is = true
}
}
if !is {
return true
}
fixedDamage := alpacadecimal.NewFromInt(int64(e.Args()[0].IntPart()))
damageZone := &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: fixedDamage,
}
e.Ctx().Opp.Damage(e.Ctx().Our, damageZone)
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 515, &Effect515{})
}

View File

@@ -0,0 +1,39 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 517 - n%概率使对手害怕每损失m%体力害怕几率提升k%
type Effect517 struct {
node.EffectNode
}
func (e *Effect517) OnSkill() bool {
baseChance := e.Args()[0].IntPart()
lostHpPercent := (e.Ctx().Opp.CurrentPet.GetMaxHP().Sub(e.Ctx().Opp.CurrentPet.GetHP())).Div(e.Ctx().Opp.CurrentPet.GetMaxHP()).Mul(alpacadecimal.NewFromInt(100)).IntPart()
// 计算额外几率
additionalStacks := lostHpPercent / e.Args()[1].IntPart()
extraChance := additionalStacks * e.Args()[2].IntPart()
totalChance := baseChance + extraChance
success, _, _ := e.Input.Player.Roll(int(totalChance), 100)
if success {
fearEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(info.PetStatus.Fear))
if fearEffect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, fearEffect)
}
}
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 452, &Effect517{})
}

View File

@@ -0,0 +1,44 @@
package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 519 - n回合内自身每处于一种能力强化或弱化状态时都会回复m点体力
type Effect519 struct {
node.EffectNode
}
func init() {
input.InitEffect(input.EffectType.Skill, 519, &Effect519{})
}
func (e *Effect519) Action_start() bool {
var buffCount int
for _, v := range e.Ctx().Our.Prop {
if v != 0 {
buffCount++
}
}
// 每种状态回复m点体力
healPerBuff := alpacadecimal.NewFromInt(int64(e.Args()[1].IntPart()))
totalHeal := healPerBuff.Mul(alpacadecimal.NewFromInt(int64(buffCount)))
if totalHeal.Cmp(alpacadecimal.NewFromInt(0)) > 0 {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, totalHeal)
}
return true
}
func (e *Effect519) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续n回合
}

View File

@@ -0,0 +1,29 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 520 - 有n%的几率使自己害怕
type Effect520 struct {
node.EffectNode
}
func (e *Effect520) OnSkill() bool {
chance := e.Args()[0].IntPart()
success, _, _ := e.Input.Player.Roll(int(chance), 100)
if success {
fearEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(info.PetStatus.Fear))
if fearEffect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, fearEffect)
}
}
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 520, &Effect520{})
}

View File

@@ -0,0 +1,31 @@
package effect
import (
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 545 - n回合内若受到伤害高于m则对手XX
type Effect545 struct {
node.EffectNode
}
func (e *Effect545) Skill_Use_ex() bool {
if e.Ctx().Our.SumDamage.Cmp(alpacadecimal.NewFromInt(int64(e.Args()[1].IntPart()))) > 0 {
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[2].IntPart())) // 以麻痹为例
if statusEffect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
}
}
return true
}
func (e *Effect545) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续n回合
}
func init() {
input.InitEffect(input.EffectType.NewSel, 545, &Effect545{})
}

File diff suppressed because it is too large Load Diff