```
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed

feat(effect): 实现战斗效果1785、2195、2215、2219并更新文档规则

新增战斗效果1785:N回合内每回合使用技能吸取对手最大体力的1/M,
满体力时额外恢复己方所有不在场精灵O点体力

修复战斗效果2195:当对方回合存在效果时才降低技能优先级,
This commit is contained in:
昔念
2026-03-31 00:54:29 +08:00
parent e037539123
commit 46f2bdcd9a
3 changed files with 151 additions and 8 deletions

View File

@@ -466,6 +466,52 @@ func (e *Effect1784Sub) DamageLockEx(zone *info.DamageZone) bool {
}
// Effect 1791: 消除双方护盾并附加护盾值{0}%的百分比伤害,若护盾值总和超过{1}点则转变为附加护盾值{2}%的百分比伤害
// Effect 1785: {0}回合内每回合使用技能吸取对手最大体力的1/{1},满体力时额外恢复己方所有不在场精灵{2}点体力
type Effect1785 struct {
node.EffectNode
}
func (e *Effect1785) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1785, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1785Sub struct {
RoundEffectArg0Base
}
func (e *Effect1785Sub) OnSkill() bool {
if len(e.Args()) < 3 || e.Ctx().Our == nil || e.Ctx().Our.CurrentPet == nil || e.Ctx().Opp == nil || e.Ctx().Opp.CurrentPet == nil {
return true
}
if e.Ctx().SkillEntity == nil || e.Args()[1].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
fullHP := e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) >= 0
amount := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[1])
if amount.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: amount,
})
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, amount)
if fullHP {
healBench(e.Ctx().Our, e.Args()[2])
}
return true
}
type Effect1791 struct {
node.EffectNode
}
@@ -608,6 +654,8 @@ func init() {
input.InitEffect(input.EffectType.Sub, 1775, &Effect1775Sub{})
input.InitEffect(input.EffectType.Skill, 1776, &Effect1776{})
input.InitEffect(input.EffectType.Sub, 1776, &Effect1776Sub{})
input.InitEffect(input.EffectType.Skill, 1785, &Effect1785{})
input.InitEffect(input.EffectType.Sub, 1785, &Effect1785Sub{})
input.InitEffect(input.EffectType.Skill, 1781, &Effect1781{})
input.InitEffect(input.EffectType.Sub, 1781, &Effect1781Sub{})
input.InitEffect(input.EffectType.Skill, 1782, &Effect1782{})

View File

@@ -1,6 +1,7 @@
package effect
import (
"blazing/common/data/xmlres"
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
@@ -22,8 +23,30 @@ func (e *Effect2195) Skill_Use() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
before := activeTurnEffectCount(e.Ctx().Opp)
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
e.Ctx().SkillEntity.XML.Priority -= int(e.Args()[1].IntPart())
if before <= 0 {
return true
}
sub := e.Ctx().Opp.InitEffect(input.EffectType.Sub, 2195, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect2195Sub struct {
RoundEffectArg0Base
}
func (e *Effect2195Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil {
return true
}
current.SkillEntity.XML.Priority -= int(e.Args()[1].IntPart())
return true
}
@@ -319,12 +342,24 @@ type Effect2215 struct {
}
func (e *Effect2215) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 || e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity != nil {
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
skill, ok := xmlres.SkillMap[int(e.Ctx().SkillEntity.Info.ID)]
if !ok || skill.MaxPP <= 0 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
lostPercent := int64(skill.MaxPP-int(e.Ctx().SkillEntity.Info.PP)) * 100 / int64(skill.MaxPP)
step := int64(e.Args()[0].IntPart())
if step <= 0 {
return true
}
tiers := lostPercent / step
if tiers <= 0 {
return true
}
bonus := alpacadecimal.NewFromInt(100 + tiers*step)
zone.Damage = zone.Damage.Mul(bonus).Div(hundred)
return true
}
@@ -376,19 +411,22 @@ type Effect2219 struct {
node.EffectNode
}
func (e *Effect2219) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
func (e *Effect2219) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().Our == nil || e.Ctx().Our.CurrentPet == nil {
return true
}
if e.Ctx().SkillEntity == nil {
target := e.Ctx().Our.CurrentPet.Info.MaxHp * int(e.Args()[0].IntPart()) / 100
current := e.Ctx().Our.CurrentDivineEnergy()
if target <= current {
return true
}
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
e.Ctx().Our.AddDivineEnergy(target - current)
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 2195, &Effect2195{})
input.InitEffect(input.EffectType.Sub, 2195, &Effect2195Sub{})
input.InitEffect(input.EffectType.Skill, 2196, &Effect2196{})
input.InitEffect(input.EffectType.Skill, 2197, &Effect2197{})
input.InitEffect(input.EffectType.Skill, 2198, &Effect2198{})