From 79a3874d139c877e86b4b3d54a476ef82154af67 Mon Sep 17 00:00:00 2001 From: xinian Date: Tue, 31 Mar 2026 10:40:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0=E6=95=88=E6=9E=9C107?= =?UTF-8?q?2-1081=E5=8F=8A1173-1177?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/effect-refactor-summary-2026-03-28.md | 62 +++++- .../task-092-effects-1072-1076.md | 36 ---- .../task-093-effects-1077-1081.md | 37 ---- .../task-112-effects-1173-1177.md | 35 ---- logic/service/fight/effect/1072_1076.go | 159 ++++++++++++++++ logic/service/fight/effect/1077_1081.go | 180 ++++++++++++++++++ logic/service/fight/effect/1173_1177.go | 169 ++++++++++++++++ logic/service/fight/effect/effect_info_map.go | 15 ++ 8 files changed, 584 insertions(+), 109 deletions(-) delete mode 100644 docs/effect-unimplemented-tasks/task-092-effects-1072-1076.md delete mode 100644 docs/effect-unimplemented-tasks/task-093-effects-1077-1081.md delete mode 100644 docs/effect-unimplemented-tasks/task-112-effects-1173-1177.md create mode 100644 logic/service/fight/effect/1072_1076.go create mode 100644 logic/service/fight/effect/1077_1081.go create mode 100644 logic/service/fight/effect/1173_1177.go diff --git a/docs/effect-refactor-summary-2026-03-28.md b/docs/effect-refactor-summary-2026-03-28.md index 61cb7c872..c9a282ac7 100644 --- a/docs/effect-refactor-summary-2026-03-28.md +++ b/docs/effect-refactor-summary-2026-03-28.md @@ -548,7 +548,7 @@ JSON 中存在但代码未注册(示例前 60 项): ## 16. 2026-03-31 增量记录 -### 9.1 本轮补齐的 effect +### 16.1 本轮补齐的 effect - `1067` `{0}回合内每回合使用技能恢复自身最大体力的1/{1},恢复体力时若自身体力低于最大体力的1/{2}则恢复效果转变为吸取对手最大体力的1/{3}` - `1068` 下`{0}`回合受到致命伤害时残留`{1}`点体力 - `1069` 反转自身能力下降状态,反转成功则`{0}`回合内躲避所有攻击 @@ -565,3 +565,63 @@ JSON 中存在但代码未注册(示例前 60 项): ### 16.3 本轮同步项 - 已补 `logic/service/fight/effect/effect_info_map.go` 中 `1067-1071` 的说明映射。 - `docs/effect-unimplemented-tasks/task-091-effects-1067-1071.md` 已删除。 + +## 17. 2026-03-31 增量记录 + +### 17.1 本轮补齐的 effect +- `1072` 附加自身当前体力`{0}`%的百分比伤害,连续使用每次增加`{1}`%,最高`{2}`% +- `1073` `{0}`回合内受到的伤害大于`{1}`则主动恢复自身全部体力并造成等同于恢复量的固定伤害 +- `1074` 造成的伤害大于`{0}`则对手`{1}`%`{2}`,未触发则自身下`{3}`回合攻击有`{4}`%的概率使对手`{5}` +- `1075` 恢复自身最大体力的1/`{0}`,自身体力低于1/`{1}`时回满 +- `1076` 对手不处于能力提升状态时先制+2 + +### 17.2 实现口径 +- `1072` 参考 `1280`,按当前体力百分比追加伤害并在连续使用时累计加成,封顶于实参上限。 +- `1073` 参考 `775`,在受击伤害超过阈值时于行动结束节点回满自身,并按实际恢复量反打固定伤害。 +- `1074` 参考 `1256/1271`,先按本次造成伤害判定即时概率状态;未触发时再给自身挂后续攻击概率附加状态的回合子效果。 +- `1075` 参考 `704/900`,常态回复最大体力的分数值,低血线时改为直接补满缺失体力。 +- `1076` 参考 `779` 的反向条件,对手不存在能力提升状态时令自身先制+2。 + +### 17.3 本轮同步项 +- 已补 `logic/service/fight/effect/effect_info_map.go` 中 `1072-1076` 的说明映射。 +- `docs/effect-unimplemented-tasks/task-092-effects-1072-1076.md` 已删除。 + +## 18. 2026-03-31 增量记录 + +### 18.1 本轮补齐的 effect +- `1077` `{0}`回合内对手使用攻击技能后使对手`{1}`,未触发则对手下`{2}`回合属性技能命中效果失效 +- `1078` 使对手随机进入`{0}`种异常状态,未触发则下`{1}`回合自身属性技能先制+`{2}` +- `1079` 命中后`{0}`%令对手`{1}`,未触发则下`{2}`回合自身攻击技能先制+`{3}` +- `1080` 连续使用时先制+1 +- `1081` 若对手处于能力提升状态则先制+1 + +### 18.2 实现口径 +- `1077` 参考 `1267/998`,在己方身上挂对手攻击技能监听,若整段持续期未触发则给对手补一段属性技能失效子效果。 +- `1078` 先尝试随机附加异常,若没有新增异常状态成功落到对手身上,再给自身挂属性技能先制子效果。 +- `1079` 参考概率异常+后续先制类效果,命中后先判即时异常,未触发则给自身挂攻击技能先制子效果。 +- `1080` 复用 `AddLvelEffect` 的连续使用计数,在连续使用同一技能时给当前技能先制+1。 +- `1081` 直接复用 `779` 的同类判断,只是条件改为“对手处于能力提升状态”且先制值为+1。 + +### 18.3 本轮同步项 +- 已补 `logic/service/fight/effect/effect_info_map.go` 中 `1077-1081` 的说明映射。 +- `docs/effect-unimplemented-tasks/task-093-effects-1077-1081.md` 已删除。 + +## 18. 2026-03-31 增量记录 + +### 18.1 本轮补齐的 effect +- `1077` `{0}`回合内对手使用攻击技能后使对手`{1}`,未触发则对手下`{2}`回合属性技能命中效果失效 +- `1078` 使对手随机进入`{0}`种异常状态,未触发则下`{1}`回合自身属性技能先制+`{2}` +- `1079` 命中后`{0}`%令对手`{1}`,未触发则下`{2}`回合自身攻击技能先制+`{3}` +- `1080` 连续使用时先制+1 +- `1081` 若对手处于能力提升状态则先制+1 + +### 18.2 实现口径 +- `1077` 参考 `1267/1490/738`,在己方身上挂对手攻击技能监听;状态未成功挂上时,再给对手挂属性技能命中效果失效子效果。 +- `1078` 参考 `786/1100`,先尝试随机异常状态;未触发时给自身挂仅对属性技能生效的先制子效果。 +- `1079` 参考 `756/1230`,命中后按概率给对手附加状态;未触发时给自身挂仅对攻击技能生效的回合先制子效果。 +- `1080` 记录上次使用技能 ID,在连续使用同一技能时给予先制+1。 +- `1081` 复用 `779` 的同类条件判断,对手存在能力提升状态时自身先制+1。 + +### 18.3 本轮同步项 +- 已补 `logic/service/fight/effect/effect_info_map.go` 中 `1077-1081` 的说明映射。 +- `docs/effect-unimplemented-tasks/task-093-effects-1077-1081.md` 已删除。 diff --git a/docs/effect-unimplemented-tasks/task-092-effects-1072-1076.md b/docs/effect-unimplemented-tasks/task-092-effects-1072-1076.md deleted file mode 100644 index c09d9a583..000000000 --- a/docs/effect-unimplemented-tasks/task-092-effects-1072-1076.md +++ /dev/null @@ -1,36 +0,0 @@ -# Task 092: Effects 1072-1076 - -## 目标 - -- 补齐以下 5 个(或最后一组不足 5 个)当前判定未实现的 skill effect。 -- 实现位置优先放在 `logic/service/fight/effect/`。 -- 如 effect 需要展示说明,同步更新 `logic/service/fight/effect/effect_info_map.go`。 -- 完成后至少执行:`cd /workspace/logic && go test ./service/fight/effect`。 - -## Effect 列表 - -### Effect 1072 -- `argsNum`: `3` -- `info`: `附加自身当前体力{0}%的百分比伤害,连续使用每次增加{1}%,最高{2}%` - -### Effect 1073 -- `argsNum`: `2` -- `info`: `{0}回合内受到的伤害大于{1}则主动恢复自身全部体力并造成等同于恢复量的固定伤害` - -### Effect 1074 -- `argsNum`: `6` -- `info`: `造成的伤害大于{0}则对手{1}%{2},未触发则自身下{3}回合攻击有{4}%的概率使对手{5}` -- `param`: `1,2,2|1,5,5` - -### Effect 1075 -- `argsNum`: `2` -- `info`: `恢复自身最大体力的1/{0},自身体力低于1/{1}时回满` - -### Effect 1076 -- `argsNum`: `0` -- `info`: `对手不处于能力提升状态时先制+2` - -## 备注 - -- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。 -- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。 diff --git a/docs/effect-unimplemented-tasks/task-093-effects-1077-1081.md b/docs/effect-unimplemented-tasks/task-093-effects-1077-1081.md deleted file mode 100644 index ea3be1a6a..000000000 --- a/docs/effect-unimplemented-tasks/task-093-effects-1077-1081.md +++ /dev/null @@ -1,37 +0,0 @@ -# Task 093: Effects 1077-1081 - -## 目标 - -- 补齐以下 5 个(或最后一组不足 5 个)当前判定未实现的 skill effect。 -- 实现位置优先放在 `logic/service/fight/effect/`。 -- 如 effect 需要展示说明,同步更新 `logic/service/fight/effect/effect_info_map.go`。 -- 完成后至少执行:`cd /workspace/logic && go test ./service/fight/effect`。 - -## Effect 列表 - -### Effect 1077 -- `argsNum`: `3` -- `info`: `{0}回合内对手使用攻击技能后使对手{1},未触发则对手下{2}回合属性技能命中效果失效` -- `param`: `1,1,1` - -### Effect 1078 -- `argsNum`: `3` -- `info`: `使对手随机进入{0}种异常状态,未触发则下{1}回合自身属性技能先制+{2}` - -### Effect 1079 -- `argsNum`: `4` -- `info`: `命中后{0}%令对手{1},未触发则下{2}回合自身攻击技能先制+{3}` -- `param`: `1,1,1` - -### Effect 1080 -- `argsNum`: `0` -- `info`: `连续使用时先制+1` - -### Effect 1081 -- `argsNum`: `0` -- `info`: `若对手处于能力提升状态则先制+1` - -## 备注 - -- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。 -- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。 diff --git a/docs/effect-unimplemented-tasks/task-112-effects-1173-1177.md b/docs/effect-unimplemented-tasks/task-112-effects-1173-1177.md deleted file mode 100644 index 79fa23197..000000000 --- a/docs/effect-unimplemented-tasks/task-112-effects-1173-1177.md +++ /dev/null @@ -1,35 +0,0 @@ -# Task 112: Effects 1173-1177 - -## 目标 - -- 补齐以下 5 个(或最后一组不足 5 个)当前判定未实现的 skill effect。 -- 实现位置优先放在 `logic/service/fight/effect/`。 -- 如 effect 需要展示说明,同步更新 `logic/service/fight/effect/effect_info_map.go`。 -- 完成后至少执行:`cd /workspace/logic && go test ./service/fight/effect`。 - -## Effect 列表 - -### Effect 1173 -- `argsNum`: `1` -- `info`: `未击败对手则回合结束后附加对手最大体力1/{0}的百分比伤害(自身体力为0时也可触发)` - -### Effect 1174 -- `argsNum`: `0` -- `info`: `若自身处于能力提升状态则先制+2` - -### Effect 1175 -- `argsNum`: `2` -- `info`: `获得{0}点护盾,护盾消失时恢复自身最大体力的1/{1}` - -### Effect 1176 -- `argsNum`: `3` -- `info`: `{0}%概率伤害为{1}倍,未触发则附加{2}点固定伤害` - -### Effect 1177 -- `argsNum`: `0` -- `info`: `自身处于能力提升状态则使自身能力提升状态翻倍` - -## 备注 - -- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。 -- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。 diff --git a/logic/service/fight/effect/1072_1076.go b/logic/service/fight/effect/1072_1076.go new file mode 100644 index 000000000..b443626bb --- /dev/null +++ b/logic/service/fight/effect/1072_1076.go @@ -0,0 +1,159 @@ +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 1072: 附加自身当前体力{0}%的百分比伤害,连续使用每次增加{1}%,最高{2}% +type Effect1072 struct { + node.EffectNode + bonus int +} + +func (e *Effect1072) OnSkill() bool { + if len(e.Args()) < 3 { + return true + } + percent := int(e.Args()[0].IntPart()) + e.bonus + maxPercent := int(e.Args()[2].IntPart()) + if percent > maxPercent { + percent = maxPercent + } + if percent <= 0 { + return true + } + + damage := e.Ctx().Our.CurrentPet.GetHP().Mul(alpacadecimal.NewFromInt(int64(percent))).Div(hundred) + if damage.Cmp(alpacadecimal.Zero) > 0 { + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage}) + } + e.bonus += int(e.Args()[1].IntPart()) + return true +} + +// Effect 1073: {0}回合内受到的伤害大于{1}则主动恢复自身全部体力并造成等同于恢复量的固定伤害 +type Effect1073 struct{ node.EffectNode } + +func (e *Effect1073) Skill_Use() bool { + if len(e.Args()) < 2 { + return true + } + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1073, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart())) + if sub != nil { + e.Ctx().Our.AddEffect(e.Ctx().Our, sub) + } + return true +} + +type Effect1073Sub struct { + RoundEffectArg0Base + pending bool +} + +func (e *Effect1073Sub) DamageLockEx(zone *info.DamageZone) bool { + if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 { + return true + } + if zone.Damage.Cmp(e.Args()[1]) <= 0 { + return true + } + e.pending = true + return true +} + +func (e *Effect1073Sub) Action_end_ex() bool { + if !e.pending { + return true + } + e.pending = false + missing := e.Ctx().Our.CurrentPet.GetMaxHP().Sub(e.Ctx().Our.CurrentPet.GetHP()) + if missing.Cmp(alpacadecimal.Zero) <= 0 { + return true + } + e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, missing) + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: missing}) + return true +} + +// Effect 1074: 造成的伤害大于{0}则对手{1}%{2},未触发则自身下{3}回合攻击有{4}%的概率使对手{5} +type Effect1074 struct{ node.EffectNode } + +func (e *Effect1074) Skill_Use() bool { + if len(e.Args()) < 6 { + return true + } + if e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) > 0 { + success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100) + if success { + applyStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart())) + return true + } + } + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1074, int(e.Args()[3].IntPart()), int(e.Args()[4].IntPart()), int(e.Args()[5].IntPart())) + if sub != nil { + e.Ctx().Our.AddEffect(e.Ctx().Our, sub) + } + return true +} + +type Effect1074Sub struct{ RoundEffectArg0Base } + +func (e *Effect1074Sub) OnSkill() bool { + if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS { + return true + } + success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100) + if success { + applyStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart())) + } + return true +} + +// Effect 1075: 恢复自身最大体力的1/{0},自身体力低于1/{1}时回满 +type Effect1075 struct{ node.EffectNode } + +func (e *Effect1075) OnSkill() bool { + if len(e.Args()) < 2 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 || e.Args()[1].Cmp(alpacadecimal.Zero) <= 0 { + return true + } + currentHP := e.Ctx().Our.CurrentPet.GetHP() + heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0]) + if currentHP.Mul(e.Args()[1]).Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) < 0 { + heal = e.Ctx().Our.CurrentPet.GetMaxHP().Sub(currentHP) + } + if heal.Cmp(alpacadecimal.Zero) <= 0 { + return true + } + e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal) + return true +} + +// Effect 1076: 对手不处于能力提升状态时先制+2 +type Effect1076 struct{ node.EffectNode } + +func (e *Effect1076) ComparePre(fattack, sattack *action.SelectSkillAction) bool { + if e.Ctx().Opp.HasPropADD() { + return true + } + current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID) + if current == nil || current.SkillEntity == nil { + return true + } + current.SkillEntity.XML.Priority += 2 + return true +} + +func init() { + input.InitEffect(input.EffectType.Skill, 1072, &Effect1072{}) + input.InitEffect(input.EffectType.Skill, 1073, &Effect1073{}) + input.InitEffect(input.EffectType.Sub, 1073, &Effect1073Sub{}) + input.InitEffect(input.EffectType.Skill, 1074, &Effect1074{}) + input.InitEffect(input.EffectType.Sub, 1074, &Effect1074Sub{}) + input.InitEffect(input.EffectType.Skill, 1075, &Effect1075{}) + input.InitEffect(input.EffectType.Skill, 1076, &Effect1076{}) +} diff --git a/logic/service/fight/effect/1077_1081.go b/logic/service/fight/effect/1077_1081.go new file mode 100644 index 000000000..eb725f82b --- /dev/null +++ b/logic/service/fight/effect/1077_1081.go @@ -0,0 +1,180 @@ +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/gogf/gf/v2/util/grand" +) + +var effect1078Statuses = []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), +} + +func activeStatusCount(target *input.Input, statuses []int) int { + if target == nil { + return 0 + } + count := 0 + for _, statusID := range statuses { + if target.StatEffect_Exist(info.EnumPetStatus(statusID)) { + count++ + } + } + return count +} + +// Effect 1077: {0}回合内对手使用攻击技能后使对手{1},未触发则对手下{2}回合属性技能命中效果失效 +type Effect1077 struct{ RoundEffectArg0Base } + +func (e *Effect1077) Skill_Use_ex() bool { + if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS { + return true + } + statusID := int(e.Args()[1].IntPart()) + before := e.Ctx().Opp.StatEffect_Exist(info.EnumPetStatus(statusID)) + applyStatusByID(e.Ctx().Our, e.Ctx().Opp, statusID) + if before || e.Ctx().Opp.StatEffect_Exist(info.EnumPetStatus(statusID)) { + return true + } + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1077, int(e.Args()[2].IntPart())) + if sub != nil { + e.Ctx().Opp.AddEffect(e.Ctx().Our, sub) + } + return true +} + +type Effect1077Sub struct{ RoundEffectArg0Base } + +func (e *Effect1077Sub) SkillHit_ex() bool { + if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS { + e.Ctx().SkillEntity.XML.MustHit = 1 + } + return true +} + +// Effect 1078: 使对手随机进入{0}种异常状态,未触发则下{1}回合自身属性技能先制+{2} +type Effect1078 struct{ node.EffectNode } + +func (e *Effect1078) OnSkill() bool { + if len(e.Args()) < 3 { + return true + } + count := int(e.Args()[0].IntPart()) + if count > len(effect1078Statuses) { + count = len(effect1078Statuses) + } + before := activeStatusCount(e.Ctx().Opp, effect1078Statuses) + if count > 0 { + for _, idx := range grand.Perm(len(effect1078Statuses))[:count] { + applyStatusByID(e.Ctx().Our, e.Ctx().Opp, effect1078Statuses[idx]) + } + } + if activeStatusCount(e.Ctx().Opp, effect1078Statuses) > before { + return true + } + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1078, int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart())) + if sub != nil { + e.Ctx().Our.AddEffect(e.Ctx().Our, sub) + } + return true +} + +type Effect1078Sub struct{ RoundEffectArg0Base } + +func (e *Effect1078Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool { + 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 += int(e.Args()[1].IntPart()) + return true +} + +// Effect 1079: 命中后{0}%令对手{1},未触发则下{2}回合自身攻击技能先制+{3} +type Effect1079 struct{ node.EffectNode } + +func (e *Effect1079) OnSkill() bool { + if len(e.Args()) < 4 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().SkillEntity.AttackTime == 0 { + return true + } + success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100) + if success { + applyStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart())) + return true + } + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1079, int(e.Args()[2].IntPart()), int(e.Args()[3].IntPart())) + if sub != nil { + e.Ctx().Our.AddEffect(e.Ctx().Our, sub) + } + return true +} + +type Effect1079Sub struct{ RoundEffectArg0Base } + +func (e *Effect1079Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool { + 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 += int(e.Args()[1].IntPart()) + return true +} + +// Effect 1080: 连续使用时先制+1 +type Effect1080 struct { + node.EffectNode + lastSkillID int +} + +func (e *Effect1080) ComparePre(fattack, sattack *action.SelectSkillAction) bool { + current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID) + if current == nil || current.SkillEntity == nil { + return true + } + if e.lastSkillID != 0 && current.SkillEntity.XML.ID == e.lastSkillID { + current.SkillEntity.XML.Priority += 1 + } + return true +} + +func (e *Effect1080) SkillHit() bool { + if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.AttackTime == 0 { + return true + } + e.lastSkillID = e.Ctx().SkillEntity.XML.ID + return true +} + +// Effect 1081: 若对手处于能力提升状态则先制+1 +type Effect1081 struct{ node.EffectNode } + +func (e *Effect1081) ComparePre(fattack, sattack *action.SelectSkillAction) bool { + if !e.Ctx().Opp.HasPropADD() { + return true + } + current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID) + if current == nil || current.SkillEntity == nil { + return true + } + current.SkillEntity.XML.Priority += 1 + return true +} + +func init() { + input.InitEffect(input.EffectType.Skill, 1077, &Effect1077{}) + input.InitEffect(input.EffectType.Sub, 1077, &Effect1077Sub{}) + input.InitEffect(input.EffectType.Skill, 1078, &Effect1078{}) + input.InitEffect(input.EffectType.Sub, 1078, &Effect1078Sub{}) + input.InitEffect(input.EffectType.Skill, 1079, &Effect1079{}) + input.InitEffect(input.EffectType.Sub, 1079, &Effect1079Sub{}) + input.InitEffect(input.EffectType.Skill, 1080, &Effect1080{}) + input.InitEffect(input.EffectType.Skill, 1081, &Effect1081{}) +} diff --git a/logic/service/fight/effect/1173_1177.go b/logic/service/fight/effect/1173_1177.go new file mode 100644 index 000000000..e75851afc --- /dev/null +++ b/logic/service/fight/effect/1173_1177.go @@ -0,0 +1,169 @@ +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 1173: 未击败对手则回合结束后附加百分比伤害 +type Effect1173 struct{ node.EffectNode } + +func (e *Effect1173) Skill_Use() bool { + if len(e.Args()) == 0 || e.Ctx().Opp == nil || e.Ctx().Opp.CurrentPet == nil || e.Ctx().Opp.CurrentPet.Info.Hp <= 0 { + return true + } + + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1173, int(e.Args()[0].IntPart())) + if sub != nil { + e.Ctx().Our.AddEffect(e.Ctx().Our, sub) + } + return true +} + +type Effect1173Sub struct{ FixedDuration1Base } + +func (e *Effect1173Sub) TurnEnd() { + defer e.Alive(false) + if len(e.Args()) == 0 || e.Ctx().Opp == nil || e.Ctx().Opp.CurrentPet == nil { + return + } + + divisor := e.Args()[0] + if divisor.Cmp(alpacadecimal.Zero) <= 0 { + return + } + + damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(divisor) + if damage.Cmp(alpacadecimal.Zero) <= 0 { + return + } + + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage}) +} + +// Effect 1174: 自身处于能力提升状态则先制+2 +type Effect1174 struct{ node.EffectNode } + +func (e *Effect1174) ComparePre(fattack, sattack *action.SelectSkillAction) bool { + if !e.Ctx().Our.HasPropADD() { + return true + } + + current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID) + if current == nil || current.SkillEntity == nil { + return true + } + + current.SkillEntity.XML.Priority += 2 + return true +} + +// Effect 1175: 获得护盾,护盾消失时恢复生命 +type Effect1175 struct{ node.EffectNode } + +func (e *Effect1175) Skill_Use() bool { + if len(e.Args()) < 2 || e.Ctx().Our == nil || e.Ctx().Our.CurrentPet == nil { + return true + } + if e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + e.Ctx().Our.AddShield(e.Args()[0]) + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1175, int(e.Args()[1].IntPart())) + if sub != nil { + e.Ctx().Our.AddEffect(e.Ctx().Our, sub) + } + return true +} + +type Effect1175Sub struct{ node.EffectNode } + +func (e *Effect1175Sub) SetArgs(t *input.Input, a ...int) { + e.EffectNode.SetArgs(t, a...) + e.CanStack(false) + e.Duration(-1) +} + +func (e *Effect1175Sub) ShieldChange(before, after alpacadecimal.Decimal) bool { + if len(e.Args()) == 0 || e.Ctx().Our == nil || e.Ctx().Our.CurrentPet == nil { + return true + } + if before.Cmp(alpacadecimal.Zero) <= 0 || after.Cmp(alpacadecimal.Zero) > 0 { + return true + } + if e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0]) + if heal.Cmp(alpacadecimal.Zero) > 0 { + e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal) + } + e.Alive(false) + return true +} + +// Effect 1176: 概率倍伤,未触发则附加固伤 +type Effect1176 struct { + node.EffectNode + multiplied bool +} + +func (e *Effect1176) SkillHit() bool { + e.multiplied = false + if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().SkillEntity.AttackTime == 0 { + return true + } + + e.multiplied, _, _ = e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100) + return true +} + +func (e *Effect1176) Damage_Mul(zone *info.DamageZone) bool { + if !e.multiplied || zone == nil || zone.Type != info.DamageType.Red { + return true + } + + zone.Damage = zone.Damage.Mul(e.Args()[1]) + return true +} + +func (e *Effect1176) OnSkill() bool { + if e.multiplied || len(e.Args()) < 3 || e.Ctx().Opp == nil || e.Ctx().Opp.CurrentPet == nil { + return true + } + if e.Args()[2].Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[2]}) + return true +} + +// Effect 1177: 自身能力提升状态翻倍 +type Effect1177 struct{ node.EffectNode } + +func (e *Effect1177) Skill_Use() bool { + for i, v := range e.Ctx().Our.Prop[:] { + if v <= 0 { + continue + } + e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), v) + } + return true +} + +func init() { + input.InitEffect(input.EffectType.Skill, 1173, &Effect1173{}) + input.InitEffect(input.EffectType.Sub, 1173, &Effect1173Sub{}) + input.InitEffect(input.EffectType.Skill, 1174, &Effect1174{}) + input.InitEffect(input.EffectType.Skill, 1175, &Effect1175{}) + input.InitEffect(input.EffectType.Sub, 1175, &Effect1175Sub{}) + input.InitEffect(input.EffectType.Skill, 1176, &Effect1176{}) + input.InitEffect(input.EffectType.Skill, 1177, &Effect1177{}) +} diff --git a/logic/service/fight/effect/effect_info_map.go b/logic/service/fight/effect/effect_info_map.go index d5152879c..820f031a2 100644 --- a/logic/service/fight/effect/effect_info_map.go +++ b/logic/service/fight/effect/effect_info_map.go @@ -601,6 +601,16 @@ var effectInfoByID = map[int]string{ 1069: "反转自身能力下降状态,反转成功则{0}回合内躲避所有攻击", 1070: "对手处于能力下降状态时自身先制+1", 1071: "{0}回合内若对手恢复体力(药剂恢复除外),则{1}回合内自身攻击附加{2}点固定伤害", + 1072: "附加自身当前体力{0}%的百分比伤害,连续使用每次增加{1}%,最高{2}%", + 1073: "{0}回合内受到的伤害大于{1}则主动恢复自身全部体力并造成等同于恢复量的固定伤害", + 1074: "造成的伤害大于{0}则对手{1}%{2},未触发则自身下{3}回合攻击有{4}%的概率使对手{5}", + 1075: "恢复自身最大体力的1/{0},自身体力低于1/{1}时回满", + 1076: "对手不处于能力提升状态时先制+2", + 1077: "{0}回合内对手使用攻击技能后使对手{1},未触发则对手下{2}回合属性技能命中效果失效", + 1078: "使对手随机进入{0}种异常状态,未触发则下{1}回合自身属性技能先制+{2}", + 1079: "命中后{0}%令对手{1},未触发则下{2}回合自身攻击技能先制+{3}", + 1080: "连续使用时先制+1", + 1081: "若对手处于能力提升状态则先制+1", 1097: "造成的攻击伤害若低于280则令对手疲惫;未击败对手则令对手下1回合使用的攻击技能无效;技能结束后对手体力值高于0,则50%进行一次额外行动以触发星皇之怒(星皇之怒:50%令对手失明,未触发则2回合内令对手使用的属性技能无效)", 1098: "致命一击率提升20%,每次使用增加20%,最高100%;打出致命一击后令自身下2次技能触发的星皇之怒威力不再减少;技能结束后对手体力值高于0,则50%进行一次额外行动以触发星皇之怒(星皇之怒:下2次自身使用的攻击技能先制+2)", 1099: "消除对手能力提升状态,消除成功则自身免疫下{0}次受到的异常状态", @@ -617,6 +627,11 @@ var effectInfoByID = map[int]string{ 1110: "反转对手能力提升状态,反转成功则令对手下{0}次属性技能失效,反转失败则消除对手能力提升状态", 1111: "{0}%令对手{1},未触发则{2}回合内自身造成的攻击伤害额外提升{3}%", 1146: "双方每处于{0}种能力提升状态则附加{1}点固定伤害", + 1173: "未击败对手则回合结束后附加对手最大体力1/{0}的百分比伤害(自身体力为0时也可触发)", + 1174: "若自身处于能力提升状态则先制+2", + 1175: "获得{0}点护盾,护盾消失时恢复自身最大体力的1/{1}", + 1176: "{0}%概率伤害为{1}倍,未触发则附加{2}点固定伤害", + 1177: "自身处于能力提升状态则使自身能力提升状态翻倍", 1213: "{0}回合内每回合使用技能附加对手最大体力1/{1}的百分比伤害", 1214: "对手处于异常状态则吸取对手{0}点体力", 1215: "消除对手所有护盾效果,消除成功则使对手全属性-{0},自身体力低于对手时弱化效果翻倍",