Files
bl/logic/service/fight/effect/996_1005.go
昔念 e037539123 ```
docs(effects): 移除已完成的技能效果任务文档

移除 effects 956-1005、1263-1312、1695-1734 等范围内的未实现技能效果任务文档,
这些任务已经完成实现,相关文档不再需要维护。
```
2026-03-31 00:38:50 +08:00

240 lines
6.4 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// Effect 996: 自身体力高于1/{0}时,附加自身当前体力{1}%的百分比伤害
type Effect996 struct {
node.EffectNode
}
func (e *Effect996) OnSkill() bool {
if len(e.Args()) < 2 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
threshold := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0])
if e.Ctx().Our.CurrentPet.GetHP().Cmp(threshold) <= 0 {
return true
}
damage := e.Ctx().Our.CurrentPet.GetHP().Mul(e.Args()[1]).Div(alpacadecimal.NewFromInt(100))
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: damage,
})
return true
}
// Effect 997: 自身体力低于1/{0}时恢复自身最大体力的1/{1}并造成等量百分比伤害
type Effect997 struct {
node.EffectNode
}
func (e *Effect997) OnSkill() bool {
if len(e.Args()) < 2 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 || e.Args()[1].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
threshold := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0])
if e.Ctx().Our.CurrentPet.GetHP().Cmp(threshold) >= 0 {
return true
}
damage := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: damage,
})
return true
}
// Effect 998: {0}回合内自身能力提升状态被消除或吸取时,{1}回合内对手属性技能命中效果失效
type Effect998 struct {
node.EffectNode
}
func (e *Effect998) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 998, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect998Sub struct {
RoundEffectArg0Base
}
func (e *Effect998Sub) SkillHit_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
// Effect 999: 自身每处于{0}种能力提升状态,造成的伤害提升{1}%
type Effect999 struct {
node.EffectNode
}
func (e *Effect999) SkillHit() bool {
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
step := int(e.Args()[0].IntPart())
if step <= 0 {
return true
}
boostCount := 0
for _, v := range e.Ctx().Our.Prop[:] {
if v > 0 {
boostCount++
}
}
mul := boostCount / step
if mul <= 0 {
return true
}
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[1].Mul(alpacadecimal.NewFromInt(int64(mul))))
return true
}
// Effect 1000: 命中则{0}%使对手{1},未触发则附加{2}点固定伤害
type Effect1000 struct {
node.EffectNode
}
func (e *Effect1000) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if success {
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[1].IntPart()))
if statusEffect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
}
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: e.Args()[2],
})
return true
}
// Effect 1001: 全属性+{0},对手处于异常状态时强化效果翻倍
type Effect1001 struct {
node.EffectNode
}
func (e *Effect1001) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
boost := int8(e.Args()[0].IntPart())
if e.Ctx().Opp.StatEffect_Exist_all() {
boost *= 2
}
applyAllPropUp(e.Ctx().Our, boost)
return true
}
// Effect 1002: 若对手处于异常状态则先制+1
type Effect1002 struct {
node.EffectNode
}
func (e *Effect1002) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if !e.Ctx().Opp.StatEffect_Exist_all() {
return true
}
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil || current.SkillEntity.Category() == info.Category.STATUS {
return true
}
current.SkillEntity.XML.Priority++
return true
}
// Effect 1003: 命中后{0}%使对手{1},未触发则使对手全属性-{2}
type Effect1003 struct {
node.EffectNode
}
func (e *Effect1003) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if success {
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[1].IntPart()))
if statusEffect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
}
return true
}
applyAllPropDown(e.Ctx().Our, e.Ctx().Opp, int8(e.Args()[2].IntPart()))
return true
}
// Effect 1004: {0}回合内使用技能附加{1}点固定伤害,若自身体力高于对手则效果翻倍
type Effect1004 struct {
RoundEffectArg0Base
}
func (e *Effect1004) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
damage := e.Args()[1]
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) > 0 {
damage = damage.Mul(alpacadecimal.NewFromInt(2))
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: damage,
})
return true
}
// Effect 1005: 恢复自身最大体力的1/{0}并造成等量百分比伤害
type Effect1005 struct {
node.EffectNode
}
func (e *Effect1005) OnSkill() bool {
if len(e.Args()) == 0 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
damage := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0])
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: damage,
})
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 996, &Effect996{})
input.InitEffect(input.EffectType.Skill, 997, &Effect997{})
input.InitEffect(input.EffectType.Skill, 998, &Effect998{})
input.InitEffect(input.EffectType.Sub, 998, &Effect998Sub{})
input.InitEffect(input.EffectType.Skill, 999, &Effect999{})
input.InitEffect(input.EffectType.Skill, 1000, &Effect1000{})
input.InitEffect(input.EffectType.Skill, 1001, &Effect1001{})
input.InitEffect(input.EffectType.Skill, 1002, &Effect1002{})
input.InitEffect(input.EffectType.Skill, 1003, &Effect1003{})
input.InitEffect(input.EffectType.Skill, 1004, &Effect1004{})
input.InitEffect(input.EffectType.Skill, 1005, &Effect1005{})
}