feat: 新增战斗Boss特性效果实现
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:
38
logic/service/fight/boss/NewSeIdx_144.go
Normal file
38
logic/service/fight/boss/NewSeIdx_144.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
)
|
||||
|
||||
// 144. 重生 (hp和btl_maxhp 恢复到 maxhp + maxhp_adj, 技能PP值回满)(a1: 可重生次数)
|
||||
// TODO: 实现重生 (hp和btl_maxhp 恢复到 maxhp + maxhp_adj, 技能PP值回满)(a1: 可重生次数)的核心逻辑
|
||||
type NewSel144 struct {
|
||||
NewSel0
|
||||
count int
|
||||
}
|
||||
|
||||
func (e *NewSel144) ActionEndEx() bool {
|
||||
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
|
||||
return true
|
||||
}
|
||||
|
||||
if e.Ctx().Our.CurrentPet.Info.Hp == 0 {
|
||||
if e.count >= int(e.Args()[0].IntPart()) {
|
||||
return true
|
||||
}
|
||||
|
||||
e.count++
|
||||
|
||||
e.Ctx().Our.CurrentPet.Info.Hp = e.Ctx().Our.CurrentPet.Info.MaxHp
|
||||
e.Ctx().Our.HealPP(-1)
|
||||
for i := 0; i < 6; i++ {
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), 6, info.AbilityOpType.ADD)
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 144, &NewSel144{})
|
||||
}
|
||||
44
logic/service/fight/boss/NewSeIdx_224.go
Normal file
44
logic/service/fight/boss/NewSeIdx_224.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
"github.com/samber/lo"
|
||||
)
|
||||
|
||||
// 224. 对方用这些技能时, 对自身的命中率为0 (最多8个 / 不要与必中技能一起配置);(a1-a8: 有效技能ID)
|
||||
// TODO: 实现对方用这些技能时, 对自身的命中率为0 (最多8个 / 不要与必中技能一起配置);(a1-a8: 有效技能ID)的核心逻辑
|
||||
type NewSel224 struct {
|
||||
NewSel0
|
||||
}
|
||||
|
||||
func (e *NewSel224) SkillUseed() bool {
|
||||
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
|
||||
return true
|
||||
}
|
||||
// 技能为空时不处理
|
||||
skill := e.Ctx().SkillEntity
|
||||
if skill == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
_, ok := lo.Find(e.Args(), func(item alpacadecimal.Decimal) bool {
|
||||
|
||||
return skill.ID == int(item.IntPart())
|
||||
})
|
||||
if !ok {
|
||||
return true
|
||||
}
|
||||
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Percent,
|
||||
Damage: e.Ctx().Opp.CurrentPet.GetHP().Div(alpacadecimal.NewFromInt(3)),
|
||||
})
|
||||
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 224, &NewSel224{})
|
||||
}
|
||||
32
logic/service/fight/boss/NewSeIdx_283.go
Normal file
32
logic/service/fight/boss/NewSeIdx_283.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
)
|
||||
|
||||
// 283. 受到超过n 全属性-1
|
||||
type NewSel283 struct {
|
||||
NewSel0
|
||||
}
|
||||
|
||||
func (e *NewSel283) SkillUseed() bool {
|
||||
//魂印特性有不在场的情况,绑定时候将精灵和特性绑定
|
||||
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
|
||||
return true
|
||||
}
|
||||
|
||||
// 检查受到的伤害是否超过阈值
|
||||
if e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) > 0 {
|
||||
|
||||
for i := 0; i < 6; i++ {
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), int8(e.Args()[1].IntPart()), info.AbilityOpType.SUB)
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 283, &NewSel283{})
|
||||
}
|
||||
Reference in New Issue
Block a user