diff --git a/docs/effect-refactor-summary-2026-03-28.md b/docs/effect-refactor-summary-2026-03-28.md index b7d542731..726103bf7 100644 --- a/docs/effect-refactor-summary-2026-03-28.md +++ b/docs/effect-refactor-summary-2026-03-28.md @@ -509,3 +509,39 @@ JSON 中存在但代码未注册(示例前 60 项): ### 14.6 本轮验证 - `cd /workspace/logic && go test ./service/fight/effect` - `cd /workspace/logic && go build ./...` + +--- + +## 15. 2026-03-31 增量记录(二) + +### 15.1 本轮新增实现 +- `780` `{0}` 回合内受到攻击则 `{1}%` 令对手随机 `{2}` 个技能 PP 值归零 +- `781` 消除对手回合类效果,消除成功则 `{0}` 回合内令对手使用的属性技能无效 +- `782` `{0}%` 令对手 `{1}`,每次使用概率增加 `{2}%`,最高概率 `{3}%` +- `783` `{0}` 回合内自身能力提升状态被消除或吸取时附加对手最大体力 `1/{1}` 的百分比伤害 +- `784` 若本回合击败对手则将对手的能力提升效果转移到自己身上 +- `790` `{0}` 回合内自身所有攻击无视伤害限制效果 +- `791` `{0}` 回合内每回合使用技能恢复自身最大体力的 `1/{1}`,当前体力低于对手时恢复翻倍 +- `792` 先出手时对手当回合攻击技能无效 +- `793` 若造成的伤害低于 `{0}`,则下 `{1}` 回合每回合造成 `{2}` 点固定伤害 +- `794` 消除对手能力提升,消除成功则抵挡 `{0}` 回合内对手的攻击伤害 + +### 15.2 本轮复核后确认已存在 +- `637-641` 已在 `637_641.go` 落地,相关任务文档可删除 +- `764-768` 已在 `764_768.go` 落地,相关任务文档可删除 +- `774-779` 已在 `774_779.go` 落地,相关任务文档可删除 +- `785-789` 已在 `785_789.go` 落地,相关任务文档可删除 + +### 15.3 本轮同步更新 +- 新增 `logic/service/fight/effect/780_784.go` +- 新增 `logic/service/fight/effect/790_794.go` +- 删除 `docs/effect-unimplemented-tasks/task-008-effects-637-641.md` +- 删除 `docs/effect-unimplemented-tasks/task-031-effects-764-768.md` +- 删除 `docs/effect-unimplemented-tasks/task-033-effects-774-779.md` +- 删除 `docs/effect-unimplemented-tasks/task-034-effects-780-784.md` +- 删除 `docs/effect-unimplemented-tasks/task-035-effects-785-789.md` +- 删除 `docs/effect-unimplemented-tasks/task-036-effects-790-794.md` + +### 15.4 本轮验证 +- `cd /workspace/logic && go test ./service/fight/effect` +- `cd /workspace/logic && go build ./...` diff --git a/docs/effect-unimplemented-tasks/task-008-effects-637-641.md b/docs/effect-unimplemented-tasks/task-008-effects-637-641.md deleted file mode 100644 index b0bd55fb0..000000000 --- a/docs/effect-unimplemented-tasks/task-008-effects-637-641.md +++ /dev/null @@ -1,46 +0,0 @@ -# Task 008: Effects 637-641 - -## 目标 - -- 补齐以下 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 637 -- `argsNum`: `2` -- `info`: `若对手处于异常状态,则对手{0}{1}` -- `param`: `2,0,0` - -### Effect 638 -- `argsNum`: `2` -- `info`: `若对手{0},技能威力提升{1}%` -- `param`: `1,0,0` - -### Effect 639 -- `argsNum`: `4` -- `info`: `造成伤害{0}{1},则下{2}回合所有技能附带{3}点固定伤害` -- `param`: `12,0,0` - -### Effect 640 -- `argsNum`: `3` -- `info`: `命中后{0}%使对手{1}{2}回合,遇到天敌概率翻倍` -- `param`: `1,1,1` - -### Effect 641 -- `argsNum`: `1` -- `info`: `命中后{0}%使对手进入流血状态` - -## 备注 - -- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。 -- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。 - -## 完成记录 - -- 2026-03-29:已在 `logic/service/fight/effect/637_641.go` 补齐 `637-641`。 -- 同步更新了 `logic/service/fight/effect/effect_info_map.go`。 -- 额外补上了 `Bleeding(16)` 状态的基础注册,使 `641` 能挂载流血状态。 -- 验证命令:`cd /workspace/logic && go test ./service/fight/effect` diff --git a/docs/effect-unimplemented-tasks/task-031-effects-764-768.md b/docs/effect-unimplemented-tasks/task-031-effects-764-768.md deleted file mode 100644 index 73631c65d..000000000 --- a/docs/effect-unimplemented-tasks/task-031-effects-764-768.md +++ /dev/null @@ -1,35 +0,0 @@ -# Task 031: Effects 764-768 - -## 目标 - -- 补齐以下 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 764 -- `argsNum`: `2` -- `info`: `{0}回合内若对手使用攻击技能降低对手最大体力的1/{1}` - -### Effect 765 -- `argsNum`: `1` -- `info`: `{0}回合对手无法使自身能力出现提升状态` - -### Effect 766 -- `argsNum`: `2` -- `info`: `消除对手能力提升状态,消除成功则{0}回合内对手造成的攻击伤害不超过{1}点` - -### Effect 767 -- `argsNum`: `2` -- `info`: `{0}回合内每回合使用技能且出手流程结束后若对手处于能力下降状态则附加给对手{1}点固定伤害` - -### Effect 768 -- `argsNum`: `1` -- `info`: `对手每处于一种异常状态则附加{0}点固定伤害` - -## 备注 - -- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。 -- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。 diff --git a/docs/effect-unimplemented-tasks/task-033-effects-774-779.md b/docs/effect-unimplemented-tasks/task-033-effects-774-779.md deleted file mode 100644 index bf7a1bff7..000000000 --- a/docs/effect-unimplemented-tasks/task-033-effects-774-779.md +++ /dev/null @@ -1,35 +0,0 @@ -# Task 033: Effects 774-779 - -## 目标 - -- 补齐以下 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 774 -- `argsNum`: `1` -- `info`: `若自身当前体力高于对手则附加对手最大体力1/{0}的百分比伤害` - -### Effect 775 -- `argsNum`: `2` -- `info`: `{0}回合内若受到的伤害大于{1},则恢复自身所有体力` - -### Effect 777 -- `argsNum`: `1` -- `info`: `消除对手能力上升状态,消除成功下{0}回合必定先出手` - -### Effect 778 -- `argsNum`: `0` -- `info`: `反转对手的能力提升状态,反转成功则恢复自身所有体力` - -### Effect 779 -- `argsNum`: `0` -- `info`: `若对手处于能力提升状态则先制+2` - -## 备注 - -- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。 -- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。 diff --git a/docs/effect-unimplemented-tasks/task-034-effects-780-784.md b/docs/effect-unimplemented-tasks/task-034-effects-780-784.md deleted file mode 100644 index 1dc2f001a..000000000 --- a/docs/effect-unimplemented-tasks/task-034-effects-780-784.md +++ /dev/null @@ -1,36 +0,0 @@ -# Task 034: Effects 780-784 - -## 目标 - -- 补齐以下 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 780 -- `argsNum`: `3` -- `info`: `{0}回合内受到攻击则{1}%令对手随机{2}个技能PP值归零` - -### Effect 781 -- `argsNum`: `1` -- `info`: `消除对手回合类效果,消除成功则{0}回合内令对手使用的属性技能无效` - -### Effect 782 -- `argsNum`: `4` -- `info`: `{0}%令对手{1},每次使用概率增加{2}%,最高概率{3}%` -- `param`: `1,1,1` - -### Effect 783 -- `argsNum`: `2` -- `info`: `{0}回合内自身能力提升状态被消除或吸取时附加对手最大体力1/{1}的百分比伤害` - -### Effect 784 -- `argsNum`: `0` -- `info`: `若本回合击败对手则将对手的能力提升效果转移到自己身上` - -## 备注 - -- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。 -- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。 diff --git a/docs/effect-unimplemented-tasks/task-035-effects-785-789.md b/docs/effect-unimplemented-tasks/task-035-effects-785-789.md deleted file mode 100644 index 475e2f885..000000000 --- a/docs/effect-unimplemented-tasks/task-035-effects-785-789.md +++ /dev/null @@ -1,35 +0,0 @@ -# Task 035: Effects 785-789 - -## 目标 - -- 补齐以下 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 785 -- `argsNum`: `0` -- `info`: `若自身攻击对手时克制关系为微弱则先制+2` - -### Effect 786 -- `argsNum`: `1` -- `info`: `令对手随机进入{0}种异常状态` - -### Effect 787 -- `argsNum`: `2` -- `info`: `{0}回合内使用技能后若对手处于能力提升状态则附加对手最大体力1/{1}的百分比伤害` - -### Effect 788 -- `argsNum`: `1` -- `info`: `消除对手能力提升,消除成功{0}回合内免疫异常状态` - -### Effect 789 -- `argsNum`: `1` -- `info`: `消除对手回合类效果,消除成功对手下{0}回合受到的伤害翻倍` - -## 备注 - -- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。 -- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。 diff --git a/docs/effect-unimplemented-tasks/task-036-effects-790-794.md b/docs/effect-unimplemented-tasks/task-036-effects-790-794.md deleted file mode 100644 index 5569648ed..000000000 --- a/docs/effect-unimplemented-tasks/task-036-effects-790-794.md +++ /dev/null @@ -1,35 +0,0 @@ -# Task 036: Effects 790-794 - -## 目标 - -- 补齐以下 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 790 -- `argsNum`: `1` -- `info`: `{0}回合内自身所有攻击无视伤害限制效果` - -### Effect 791 -- `argsNum`: `2` -- `info`: `{0}回合内每回合使用技能恢复自身最大体力的1/{1},恢复体力时若自身当前体力低于对手则恢复效果翻倍` - -### Effect 792 -- `argsNum`: `0` -- `info`: `先出手时对手当回合攻击技能无效` - -### Effect 793 -- `argsNum`: `3` -- `info`: `若造成的伤害低于{0},则下{1}回合每回合造成{2}点固定伤害` - -### Effect 794 -- `argsNum`: `1` -- `info`: `消除对手能力提升,消除成功可以抵挡{0}回合内对手的攻击伤害` - -## 备注 - -- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。 -- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。 diff --git a/logic/service/fight/boss/json_eid_advanced.go b/logic/service/fight/boss/json_eid_advanced.go index ba04786a1..83073dc87 100644 --- a/logic/service/fight/boss/json_eid_advanced.go +++ b/logic/service/fight/boss/json_eid_advanced.go @@ -46,6 +46,83 @@ func (e *BossJsonEid41) TurnStart(fattack, sattack *action.SelectSkillAction) { } } +// 42: 迅捷,所有技能先制+n +type BossJsonEid42 struct{ BossJsonEid0 } + +func (e *BossJsonEid42) ComparePre(fattack, sattack *action.SelectSkillAction) bool { + if !e.ownerActive() { + return true + } + priority := bossJsonIntArg(e.Args(), 0, 0) + if priority == 0 { + return true + } + userID := e.Ctx().Our.Player.GetInfo().UserID + if fattack != nil && fattack.PlayerID == userID && fattack.SkillEntity != nil { + fattack.SkillEntity.XML.Priority += priority + } + if sattack != nil && sattack.PlayerID == userID && sattack.SkillEntity != nil { + sattack.SkillEntity.XML.Priority += priority + } + return true +} + +// 7: 致盲,闪避率提升n% +type BossJsonEid7 struct{ BossJsonEid0 } + +func (e *BossJsonEid7) SkillHit_ex() bool { + if !e.ownerActive() || e.Ctx().SkillEntity == nil { + return true + } + if e.Ctx().SkillEntity.AttackTime == 2 { + return true + } + hit, _, _ := e.Input.Player.Roll(bossJsonFirstPositiveArg(e.Args(), 0), 100) + if hit { + e.Ctx().SkillEntity.SetMiss() + } + return true +} + +// 8: 锁定,n%打出致命一击 +type BossJsonEid8 struct{ BossJsonEid0 } + +func (e *BossJsonEid8) ActionStart(a, b *action.SelectSkillAction) bool { + if !e.ownerActive() || !bossJsonIsAttackSkill(e.Ctx().SkillEntity) { + return true + } + e.Ctx().SkillEntity.XML.CritRate += bossJsonIntArg(e.Args(), 0, 0) + return true +} + +// 45: 锁定,n%打出致命一击 +type BossJsonEid45 struct{ BossJsonEid0 } + +func (e *BossJsonEid45) ActionStart(a, b *action.SelectSkillAction) bool { + if !e.ownerActive() || !bossJsonIsAttackSkill(e.Ctx().SkillEntity) { + return true + } + e.Ctx().SkillEntity.XML.CritRate = bossJsonIntArg(e.Args(), 0, 0) + return true +} + +// 77: 锋锐,每回合附加n点固定伤害 +type BossJsonEid77 struct{ BossJsonEid0 } + +func (e *BossJsonEid77) TurnStart(fattack, sattack *action.SelectSkillAction) { + if !e.ownerActive() { + return + } + damage := bossJsonIntArg(e.Args(), 0, 0) + if damage <= 0 { + return + } + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ + Type: info.DamageType.Fixed, + Damage: alpacadecimal.NewFromInt(int64(damage)), + }) +} + // 113: 对手使用技能后全属性-1 type BossJsonEid113 struct{ BossJsonEid0 } @@ -314,6 +391,11 @@ func (e *BossJsonEid1254) TurnEnd() { func init() { input.InitEffect(input.EffectType.NewSel, 41, &BossJsonEid41{}) + input.InitEffect(input.EffectType.NewSel, 42, &BossJsonEid42{}) + input.InitEffect(input.EffectType.NewSel, 7, &BossJsonEid7{}) + input.InitEffect(input.EffectType.NewSel, 8, &BossJsonEid8{}) + input.InitEffect(input.EffectType.NewSel, 45, &BossJsonEid45{}) + input.InitEffect(input.EffectType.NewSel, 77, &BossJsonEid77{}) input.InitEffect(input.EffectType.NewSel, 113, &BossJsonEid113{}) input.InitEffect(input.EffectType.NewSel, 144, &BossJsonEid144{}) input.InitEffect(input.EffectType.NewSel, 224, &BossJsonEid224{}) diff --git a/logic/service/fight/effect/2220_2244.go b/logic/service/fight/effect/2220_2244.go index 9b772c3d4..a5d6ee02f 100644 --- a/logic/service/fight/effect/2220_2244.go +++ b/logic/service/fight/effect/2220_2244.go @@ -33,22 +33,34 @@ func (e *Effect2220) SkillHit() bool { if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS { return true } - if e.Ctx().Our.Prop[1] > e.Ctx().Our.Prop[0] { - e.Ctx().SkillEntity.XML.Power = int(e.Ctx().Our.Prop[1]) - return true + atk := e.Ctx().Our.GetProp(0) + spAtk := e.Ctx().Our.GetProp(2) + if spAtk.Cmp(atk) > 0 { + e.Ctx().SkillEntity.XML.Category = int(info.Category.SPECIAL) + } else if atk.Cmp(spAtk) > 0 { + e.Ctx().SkillEntity.XML.Category = int(info.Category.PHYSICAL) } - e.Ctx().SkillEntity.XML.Power = int(e.Ctx().Our.Prop[0]) return true } // Effect 2221: {0}回合内每回合{1}%闪避对手攻击,对手攻击技能命中时令对手随机{2}个技能PP值归0 -type Effect2221 struct{ node.EffectNode } +type Effect2221 struct{ RoundEffectArg0Base } + +func (e *Effect2221) SkillHit_ex() bool { + if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS { + return true + } + if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok { + e.Ctx().SkillEntity.SetMiss() + } + return true +} func (e *Effect2221) Skill_Use_ex() bool { if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS { return true } - if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok && e.Ctx().SkillEntity.AttackTime != 0 { + if e.Ctx().SkillEntity.AttackTime != 0 { e.Ctx().Opp.DelPP(int(e.Args()[2].IntPart())) } return true @@ -61,6 +73,9 @@ func (e *Effect2222) Damage_Mul(zone *info.DamageZone) bool { if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 { return true } + if e.Ctx().Opp == nil || e.Ctx().Opp.CurrentPet == nil { + return true + } if e.Ctx().Opp.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetMaxHP()) >= 0 { zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred) } @@ -68,26 +83,55 @@ func (e *Effect2222) Damage_Mul(zone *info.DamageZone) bool { } // Effect 2223: 若对手当回合切换精灵则造成伤害提升 -type Effect2223 struct{ node.EffectNode } +type Effect2223 struct { + node.EffectNode + opponentSwitched bool +} + +func (e *Effect2223) ComparePre(fattack, sattack *action.SelectSkillAction) bool { + e.opponentSwitched = false + ourAction := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID) + if ourAction == nil || ourAction.SkillEntity == nil { + return true + } + if oppAction := actionByPlayer(fattack, sattack, e.Ctx().Opp.UserID); oppAction != nil { + return true + } + e.opponentSwitched = e.Ctx().Opp != nil && e.Ctx().Opp.CanChange == 1 + return true +} func (e *Effect2223) Damage_Mul(zone *info.DamageZone) bool { if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 { return true } - if e.Ctx().Opp.CurrentPet != nil && e.Ctx().Opp.CurrentPet.Info.Hp <= 0 { + if e.opponentSwitched { zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred) } return true } // Effect 2224: 若对手当回合选择属性技能则造成伤害提升 -type Effect2224 struct{ node.EffectNode } +type Effect2224 struct { + node.EffectNode + oppSelectedStatus bool +} + +func (e *Effect2224) ComparePre(fattack, sattack *action.SelectSkillAction) bool { + e.oppSelectedStatus = false + oppAction := actionByPlayer(fattack, sattack, e.Ctx().Opp.UserID) + if oppAction == nil || oppAction.SkillEntity == nil { + return true + } + e.oppSelectedStatus = oppAction.SkillEntity.Category() == info.Category.STATUS + return true +} func (e *Effect2224) Damage_Mul(zone *info.DamageZone) bool { if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 { return true } - if e.Ctx().Opp.AttackTime == 0 { + if e.oppSelectedStatus { zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred) } return true diff --git a/logic/service/fight/effect/780_784.go b/logic/service/fight/effect/780_784.go new file mode 100644 index 000000000..1a536023a --- /dev/null +++ b/logic/service/fight/effect/780_784.go @@ -0,0 +1,199 @@ +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 780: {0}回合内受到攻击则{1}%令对手随机{2}个技能PP值归零 +type Effect780 struct { + node.EffectNode +} + +func (e *Effect780) Skill_Use() bool { + if len(e.Args()) < 3 { + return true + } + + effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 780, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart())) + if effect != nil { + e.Ctx().Our.AddEffect(e.Ctx().Our, effect) + } + return true +} + +type Effect780Sub struct { + RoundEffectArg0Base +} + +func (e *Effect780Sub) Skill_Use_ex() bool { + if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil { + return true + } + if e.Ctx().SkillEntity.Category() == info.Category.STATUS { + return true + } + + success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100) + if !success { + return true + } + + zeroRandomSkillPP(e.Ctx().Opp, int(e.Args()[2].IntPart())) + return true +} + +// Effect 781: 消除对手回合类效果,消除成功则{0}回合内令对手使用的属性技能无效 +type Effect781 struct { + node.EffectNode +} + +func (e *Effect781) Skill_Use() bool { + if len(e.Args()) == 0 { + return true + } + + before := activeTurnEffectCount(e.Ctx().Opp) + e.Ctx().Opp.CancelTurn(e.Ctx().Our) + if before <= 0 { + return true + } + + effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 781, int(e.Args()[0].IntPart())) + if effect != nil { + e.Ctx().Opp.AddEffect(e.Ctx().Our, effect) + } + return true +} + +type Effect781Sub struct { + RoundEffectArg0Base +} + +func (e *Effect781Sub) ActionStart(a, b *action.SelectSkillAction) bool { + if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS { + return true + } + + e.Ctx().SkillEntity.SetMiss() + return true +} + +// Effect 782: {0}%令对手{1},每次使用概率增加{2}%,最高概率{3}% +type Effect782 struct { + node.EffectNode + useCount int +} + +func (e *Effect782) OnSkill() bool { + if len(e.Args()) < 4 { + return true + } + + chance := int(e.Args()[0].IntPart()) + e.useCount*int(e.Args()[2].IntPart()) + maxChance := int(e.Args()[3].IntPart()) + if chance > maxChance { + chance = maxChance + } + + success, _, _ := e.Input.Player.Roll(chance, 100) + e.useCount++ + if !success { + return true + } + + addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart())) + return true +} + +// Effect 783: {0}回合内自身能力提升状态被消除或吸取时附加对手最大体力1/{1}的百分比伤害 +type Effect783 struct { + node.EffectNode +} + +func (e *Effect783) Skill_Use() bool { + if len(e.Args()) < 2 { + return true + } + + effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 783, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart())) + if effect != nil { + e.Ctx().Our.AddEffect(e.Ctx().Our, effect) + } + return true +} + +type Effect783Sub struct { + RoundEffectArg0Base + triggered bool +} + +func (e *Effect783Sub) PropBefer(in *input.Input, prop int8, level int8) bool { + if len(e.Args()) < 2 || in != e.Ctx().Our || e.triggered { + return true + } + if int(prop) < 0 || int(prop) >= len(e.Ctx().Our.Prop) { + return true + } + if level > 0 || e.Ctx().Our.Prop[prop] <= 0 || e.Args()[1].Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[1]) + if damage.Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + e.triggered = true + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ + Type: info.DamageType.Percent, + Damage: damage, + }) + return true +} + +func (e *Effect783Sub) Action_end() bool { + e.triggered = false + return true +} + +func (e *Effect783Sub) Action_end_ex() bool { + e.triggered = false + return true +} + +// Effect 784: 若本回合击败对手则将对手的能力提升效果转移到自己身上 +type Effect784 struct { + node.EffectNode +} + +func (e *Effect784) Skill_Use() bool { + if e.Ctx().Opp.CurrentPet.Info.Hp > 0 { + return true + } + + for i, v := range e.Ctx().Opp.Prop[:] { + if v <= 0 { + continue + } + if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) { + e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), v) + } + } + return true +} + +func init() { + input.InitEffect(input.EffectType.Skill, 780, &Effect780{}) + input.InitEffect(input.EffectType.Sub, 780, &Effect780Sub{}) + input.InitEffect(input.EffectType.Skill, 781, &Effect781{}) + input.InitEffect(input.EffectType.Sub, 781, &Effect781Sub{}) + input.InitEffect(input.EffectType.Skill, 782, &Effect782{}) + input.InitEffect(input.EffectType.Skill, 783, &Effect783{}) + input.InitEffect(input.EffectType.Sub, 783, &Effect783Sub{}) + input.InitEffect(input.EffectType.Skill, 784, &Effect784{}) +} diff --git a/logic/service/fight/effect/790_794.go b/logic/service/fight/effect/790_794.go new file mode 100644 index 000000000..1ee4c0663 --- /dev/null +++ b/logic/service/fight/effect/790_794.go @@ -0,0 +1,212 @@ +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 790: {0}回合内自身所有攻击无视伤害限制效果 +type Effect790 struct { + node.EffectNode +} + +func (e *Effect790) Skill_Use() bool { + if len(e.Args()) == 0 { + return true + } + + effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 790, int(e.Args()[0].IntPart())) + if effect != nil { + e.Ctx().Our.AddEffect(e.Ctx().Our, effect) + } + return true +} + +type Effect790Sub struct { + RoundEffectArg0Base + disabled []input.Effect +} + +func (e *Effect790Sub) SkillHit() bool { + if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS { + return true + } + + e.disabled = e.disabled[:0] + for _, effect := range e.Ctx().Opp.Effects { + if effect == nil || !effect.Alive() { + continue + } + if _, ok := effect697IgnoredLimitIDs[int(effect.ID().Suffix())]; !ok { + continue + } + + effect.Alive(false) + e.disabled = append(e.disabled, effect) + } + return true +} + +func (e *Effect790Sub) Skill_Use() bool { + restoreTemporarilyDisabledEffects(e.disabled) + e.disabled = e.disabled[:0] + return true +} + +func (e *Effect790Sub) Action_end() bool { + restoreTemporarilyDisabledEffects(e.disabled) + e.disabled = e.disabled[:0] + return true +} + +// Effect 791: {0}回合内每回合使用技能恢复自身最大体力的1/{1},恢复体力时若自身当前体力低于对手则恢复效果翻倍 +type Effect791 struct { + node.EffectNode +} + +func (e *Effect791) Skill_Use() bool { + if len(e.Args()) < 2 { + return true + } + + effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 791, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart())) + if effect != nil { + e.Ctx().Our.AddEffect(e.Ctx().Our, effect) + } + return true +} + +type Effect791Sub struct { + RoundEffectArg0Base +} + +func (e *Effect791Sub) Skill_Use() bool { + if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Args()[1].Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1]) + if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) < 0 { + heal = heal.Mul(alpacadecimal.NewFromInt(2)) + } + if heal.Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal) + return true +} + +// Effect 792: 先出手时对手当回合攻击技能无效 +type Effect792 struct { + node.EffectNode +} + +func (e *Effect792) Skill_Use() bool { + if !e.IsFirst() { + return true + } + + effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 792, 1) + if effect != nil { + e.Ctx().Opp.AddEffect(e.Ctx().Our, effect) + } + return true +} + +type Effect792Sub struct { + FixedDuration1Base +} + +func (e *Effect792Sub) ActionStart(a, b *action.SelectSkillAction) bool { + if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS { + return true + } + + e.Ctx().SkillEntity.SetMiss() + return true +} + +// Effect 793: 若造成的伤害低于{0},则下{1}回合每回合造成{2}点固定伤害 +type Effect793 struct { + node.EffectNode +} + +func (e *Effect793) Skill_Use() bool { + if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil { + return true + } + if e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) >= 0 { + return true + } + + effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 793, int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart())) + if effect != nil { + e.Ctx().Our.AddEffect(e.Ctx().Our, effect) + } + return true +} + +type Effect793Sub struct { + RoundEffectArg0Base +} + +func (e *Effect793Sub) TurnEnd() { + if len(e.Args()) >= 2 && e.Ctx().Opp.CurrentPet != nil && e.Ctx().Opp.CurrentPet.Info.Hp > 0 { + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ + Type: info.DamageType.Fixed, + Damage: e.Args()[1], + }) + } + e.EffectNode.TurnEnd() +} + +// Effect 794: 消除对手能力提升,消除成功可以抵挡{0}回合内对手的攻击伤害 +type Effect794 struct { + node.EffectNode +} + +func (e *Effect794) Skill_Use() bool { + if len(e.Args()) == 0 || !clearPositiveProps(e.Ctx().Opp, e.Ctx().Our) { + return true + } + + effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 794, int(e.Args()[0].IntPart())) + if effect != nil { + e.Ctx().Our.AddEffect(e.Ctx().Our, effect) + } + return true +} + +type Effect794Sub struct { + RoundEffectArg0Base +} + +func (e *Effect794Sub) DamageLockEx(zone *info.DamageZone) bool { + if zone == nil || zone.Type != info.DamageType.Red { + return true + } + if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS { + return true + } + + zone.Damage = alpacadecimal.Zero + return true +} + +func init() { + input.InitEffect(input.EffectType.Skill, 790, &Effect790{}) + input.InitEffect(input.EffectType.Sub, 790, &Effect790Sub{}) + input.InitEffect(input.EffectType.Skill, 791, &Effect791{}) + input.InitEffect(input.EffectType.Sub, 791, &Effect791Sub{}) + input.InitEffect(input.EffectType.Skill, 792, &Effect792{}) + input.InitEffect(input.EffectType.Sub, 792, &Effect792Sub{}) + input.InitEffect(input.EffectType.Skill, 793, &Effect793{}) + input.InitEffect(input.EffectType.Sub, 793, &Effect793Sub{}) + input.InitEffect(input.EffectType.Skill, 794, &Effect794{}) + input.InitEffect(input.EffectType.Sub, 794, &Effect794Sub{}) +} diff --git a/logic/service/fight/effect/effect_info_map.go b/logic/service/fight/effect/effect_info_map.go index 055af8cf2..8faafe45c 100644 --- a/logic/service/fight/effect/effect_info_map.go +++ b/logic/service/fight/effect/effect_info_map.go @@ -507,6 +507,26 @@ var effectInfoByID = map[int]string{ 766: "消除对手能力提升状态,消除成功则{0}回合内对手造成的攻击伤害不超过{1}点", 767: "{0}回合内每回合使用技能且出手流程结束后若对手处于能力下降状态则附加给对手{1}点固定伤害", 768: "对手每处于一种异常状态则附加{0}点固定伤害", + 774: "若自身当前体力高于对手则附加对手最大体力1/{0}的百分比伤害", + 775: "{0}回合内若受到的伤害大于{1},则恢复自身所有体力", + 777: "消除对手能力上升状态,消除成功下{0}回合必定先出手", + 778: "反转对手的能力提升状态,反转成功则恢复自身所有体力", + 779: "若对手处于能力提升状态则先制+2", + 780: "{0}回合内受到攻击则{1}%令对手随机{2}个技能PP值归零", + 781: "消除对手回合类效果,消除成功则{0}回合内令对手使用的属性技能无效", + 782: "{0}%令对手{1},每次使用概率增加{2}%,最高概率{3}%", + 783: "{0}回合内自身能力提升状态被消除或吸取时附加对手最大体力1/{1}的百分比伤害", + 784: "若本回合击败对手则将对手的能力提升效果转移到自己身上", + 785: "若自身攻击对手时克制关系为微弱则先制+2", + 786: "令对手随机进入{0}种异常状态", + 787: "{0}回合内使用技能后若对手处于能力提升状态则附加对手最大体力1/{1}的百分比伤害", + 788: "消除对手能力提升,消除成功{0}回合内免疫异常状态", + 789: "消除对手回合类效果,消除成功对手下{0}回合受到的伤害翻倍", + 790: "{0}回合内自身所有攻击无视伤害限制效果", + 791: "{0}回合内每回合使用技能恢复自身最大体力的1/{1},恢复体力时若自身当前体力低于对手则恢复效果翻倍", + 792: "先出手时对手当回合攻击技能无效", + 793: "若造成的伤害低于{0},则下{1}回合每回合造成{2}点固定伤害", + 794: "消除对手能力提升,消除成功可以抵挡{0}回合内对手的攻击伤害", 841: "使对手和自身同时降低1/{0}最大体力", 842: "若自身处于能力提升状态则造成的攻击伤害额外提升{0}%",