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

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

416 lines
12 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"
"github.com/alpacahq/alpacadecimal"
)
func clearOwnDownProps(target *input.Input) {
for i, v := range target.Prop[:] {
if v < 0 {
target.SetProp(target, int8(i), 0)
}
}
}
func addPercentDamageToOpp(e *node.EffectNode, percent alpacadecimal.Decimal) {
if percent.Cmp(alpacadecimal.Zero) <= 0 {
return
}
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Mul(percent).Div(alpacadecimal.NewFromInt(100))
if damage.Cmp(alpacadecimal.Zero) <= 0 {
return
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
}
// Effect 1695: 每回合使用技能恢复自身最大体力的1/{1}并造成等量百分比伤害,若自身满体力则改为附加自身最大体力/{2}的百分比伤害
type Effect1695 struct {
node.EffectNode
}
func (e *Effect1695) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) >= 0 {
addPercentDamageToOpp(&e.EffectNode, e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[2]))
return true
}
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
addPercentDamageToOpp(&e.EffectNode, alpacadecimal.NewFromInt(100).Mul(heal).Div(e.Ctx().Our.CurrentPet.GetMaxHP()))
return true
}
// Effect 1696: 对手不存在致命裂痕则令对手随机{0}个技能PP值归零
type Effect1696 struct {
node.EffectNode
}
func (e *Effect1696) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
zeroRandomSkillPP(e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
// Effect 1697: 附加自身最大体力{0}%的百分比伤害,若对手免疫百分比伤害则额外附加等量的真实伤害
type Effect1697 struct {
node.EffectNode
}
func (e *Effect1697) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
percent := e.Args()[0]
damage := e.Ctx().Our.CurrentPet.GetMaxHP().Mul(percent).Div(alpacadecimal.NewFromInt(100))
if damage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
before := e.Ctx().Opp.CurrentPet.GetHP()
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(before) == 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: damage})
}
return true
}
// Effect 1698: 消耗自身全部体力,{0}%令对手{1},未触发则附加自身最大体力/{2}的百分比伤害且{3}回合内对手无法通过技能恢复体力
type Effect1698 struct {
node.EffectNode
}
func (e *Effect1698) OnSkill() bool {
if len(e.Args()) < 4 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
e.Ctx().Opp.SetProp(e.Ctx().Our, 0, -1)
return true
}
addPercentDamageToOpp(&e.EffectNode, e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[2]))
return true
}
// Effect 1699: 水之力量觉醒,使自身下一次攻击获得夸张之潮效果
type Effect1699 struct {
node.EffectNode
}
func (e *Effect1699) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
e.Ctx().Our.SetProp(e.Ctx().Our, 5, int8(e.Args()[0].IntPart()))
return true
}
// Effect 1700: 清除自身能力下降状态,清除成功则自身免疫下{0}次受到的异常状态
type Effect1700 struct {
node.EffectNode
immune int
}
func (e *Effect1700) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
clearOwnDownProps(e.Ctx().Our)
e.immune = int(e.Args()[0].IntPart())
return true
}
func (e *Effect1700) Skill_Use_ex() bool {
if e.immune > 0 {
e.immune--
}
return true
}
// Effect 1701: {0}%的概率造成的伤害翻倍,若后出手则概率翻倍
type Effect1701 struct {
node.EffectNode
}
func (e *Effect1701) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
chance := int(e.Args()[0].IntPart())
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.AttackTime == 2 {
chance *= 2
}
ok, _, _ := e.Input.Player.Roll(chance, 100)
if ok {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
}
return true
}
// Effect 1702: 自身主动切换下场后令己方下只精灵出战时恢复{0}点体力
type Effect1702 struct {
node.EffectNode
}
func (e *Effect1702) SwitchOut(in *input.Input) bool {
return true
}
func (e *Effect1702) TurnStart(fattack, sattack *action.SelectSkillAction) {
if len(e.Args()) == 0 {
return
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Args()[0])
e.EffectNode.TurnEnd()
}
// Effect 1703: 使用技能{0}%不消耗PP值
type Effect1703 struct {
node.EffectNode
}
func (e *Effect1703) HookPP(count *int) bool {
if len(e.Args()) == 0 || count == nil {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
*count = 0
}
return true
}
// Effect 1704: {0}%降低对手所有PP值
type Effect1704 struct {
node.EffectNode
}
func (e *Effect1704) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
e.Ctx().Opp.DelPP(1)
}
return true
}
// Effect 1705: {0}%恢复自身所有PP值
type Effect1705 struct {
node.EffectNode
}
func (e *Effect1705) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
e.Ctx().Our.HealPP(-1)
}
return true
}
// Effect 1706: 命中后造成的攻击伤害为0时吸取对手最大体力的{0}%
type Effect1706 struct {
node.EffectNode
}
func (e *Effect1706) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
addPercentDamageToOpp(&e.EffectNode, e.Args()[0])
return true
}
// Effect 1707: 本次攻击克制对手时伤害提升{0}%
type Effect1707 struct {
node.EffectNode
}
func (e *Effect1707) SkillHit() bool {
if len(e.Args()) == 0 || !e.ISNaturalEnemy() {
return true
}
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
return true
}
// Effect 1708: 出手时本回合若未受到伤害则对手下{0}回合先制-{1}
type Effect1708 struct {
node.EffectNode
touched bool
}
func (e *Effect1708) DamageLockEx(zone *info.DamageZone) bool {
if zone != nil && zone.Damage.Cmp(alpacadecimal.Zero) > 0 {
e.touched = true
}
return true
}
func (e *Effect1708) TurnEnd() {
if len(e.Args()) >= 2 && !e.touched {
e.Ctx().Opp.SetProp(e.Ctx().Our, 5, -int8(e.Args()[1].IntPart()))
}
e.touched = false
e.EffectNode.TurnEnd()
}
// Effect 1709: 附加对手最大体力1/{0}的百分比伤害,未击败对手则恢复自身等量体力
type Effect1709 struct {
node.EffectNode
}
func (e *Effect1709) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])
if damage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
before := e.Ctx().Opp.CurrentPet.GetHP()
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(before) == 0 {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
}
return true
}
// Effect 1710: {0}%概率造成伤害翻倍,对手不处于异常状态时概率翻倍
type Effect1710 struct {
node.EffectNode
}
func (e *Effect1710) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
chance := int(e.Args()[0].IntPart())
if !e.Ctx().Opp.StatEffect_Exist_all() {
chance *= 2
}
if ok, _, _ := e.Input.Player.Roll(chance, 100); ok {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
}
return true
}
// Effect 1711: 清除自身能力下降状态,清除成功则自身免疫下{0}%对手的{1}
type Effect1711 struct {
node.EffectNode
}
func (e *Effect1711) OnSkill() bool {
clearOwnDownProps(e.Ctx().Our)
return true
}
// Effect 1712: 本次攻击对微弱对手时克制关系变为普通
type Effect1712 struct{ node.EffectNode }
func (e *Effect1712) SkillHit() bool { return true }
// Effect 1713: 本次攻击对微弱对手时50%克制关系变为普通
type Effect1713 struct{ node.EffectNode }
func (e *Effect1713) SkillHit() bool { return true }
// Effect 1714: 本次攻击对微弱对手时5%克制关系变为普通
type Effect1714 struct{ node.EffectNode }
func (e *Effect1714) SkillHit() bool { return true }
// Effect 1715: 本次攻击对微弱对手时0%克制关系变为普通
type Effect1715 struct{ node.EffectNode }
func (e *Effect1715) SkillHit() bool { return true }
// Effect 1716: 本次攻击对微弱对手时5%克制关系变为普通
type Effect1716 struct{ node.EffectNode }
func (e *Effect1716) SkillHit() bool { return true }
// Effect 1717: {0}回合内若对手使用属性技能,则对手下{1}回合攻击伤害减少{2}点
type Effect1717 struct {
RoundEffectArg0Base
}
func (e *Effect1717) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS {
e.Ctx().Opp.SetProp(e.Ctx().Our, 5, -int8(e.Args()[2].IntPart()))
}
return true
}
// Effect 1718: 后出手时造成的攻击伤害提升{0}%,若对手当前体力高于自身则伤害额外提升{1}%
type Effect1718 struct {
node.EffectNode
}
func (e *Effect1718) SkillHit() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.AttackTime == 2 {
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) < 0 {
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[1])
}
}
return true
}
// Effect 1719: 击败对手则下{0}回合自身造成的攻击伤害提升{1}%,若以致命一击击败对手则伤害再提升{2}%
type Effect1719 struct {
node.EffectNode
}
func (e *Effect1719) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(alpacadecimal.Zero) <= 0 {
e.Ctx().Our.SetProp(e.Ctx().Our, 0, int8(e.Args()[1].IntPart()))
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 1695, &Effect1695{})
input.InitEffect(input.EffectType.Skill, 1696, &Effect1696{})
input.InitEffect(input.EffectType.Skill, 1697, &Effect1697{})
input.InitEffect(input.EffectType.Skill, 1698, &Effect1698{})
input.InitEffect(input.EffectType.Skill, 1699, &Effect1699{})
input.InitEffect(input.EffectType.Skill, 1700, &Effect1700{})
input.InitEffect(input.EffectType.Skill, 1701, &Effect1701{})
input.InitEffect(input.EffectType.Skill, 1702, &Effect1702{})
input.InitEffect(input.EffectType.Skill, 1703, &Effect1703{})
input.InitEffect(input.EffectType.Skill, 1704, &Effect1704{})
input.InitEffect(input.EffectType.Skill, 1705, &Effect1705{})
input.InitEffect(input.EffectType.Skill, 1706, &Effect1706{})
input.InitEffect(input.EffectType.Skill, 1707, &Effect1707{})
input.InitEffect(input.EffectType.Skill, 1708, &Effect1708{})
input.InitEffect(input.EffectType.Skill, 1709, &Effect1709{})
input.InitEffect(input.EffectType.Skill, 1710, &Effect1710{})
input.InitEffect(input.EffectType.Skill, 1711, &Effect1711{})
input.InitEffect(input.EffectType.Skill, 1712, &Effect1712{})
input.InitEffect(input.EffectType.Skill, 1713, &Effect1713{})
input.InitEffect(input.EffectType.Skill, 1714, &Effect1714{})
input.InitEffect(input.EffectType.Skill, 1715, &Effect1715{})
input.InitEffect(input.EffectType.Skill, 1716, &Effect1716{})
input.InitEffect(input.EffectType.Skill, 1717, &Effect1717{})
input.InitEffect(input.EffectType.Skill, 1718, &Effect1718{})
input.InitEffect(input.EffectType.Skill, 1719, &Effect1719{})
}