diff --git a/docs/effect-unimplemented-tasks/task-145-effects-1338-1342.md b/docs/effect-unimplemented-tasks/task-145-effects-1338-1342.md deleted file mode 100644 index a4cc6d3da..000000000 --- a/docs/effect-unimplemented-tasks/task-145-effects-1338-1342.md +++ /dev/null @@ -1,36 +0,0 @@ -# Task 145: Effects 1338-1342 - -## 目标 - -- 补齐以下 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 1338 -- `argsNum`: `1` -- `info`: `全属性+{0},对手处于能力下降状态时强化效果翻倍` - -### Effect 1339 -- `argsNum`: `3` -- `info`: `若对手不处于异常状态则下{0}回合攻击{1}%使对手进入{2}状态` -- `param`: `1,2,2` - -### Effect 1340 -- `argsNum`: `0` -- `info`: `命中后附加对手最大体力1/2的百分比伤害,若未命中则自身死亡,且己方下只出战精灵令对手下1次使用的攻击技能无效` - -### Effect 1341 -- `argsNum`: `2` -- `info`: `造成的伤害高于{0}则恢复自身最大体力的1/{1}` - -### Effect 1342 -- `argsNum`: `1` -- `info`: `为自身附加{0}点护罩` - -## 备注 - -- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。 -- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。 diff --git a/docs/effect-unimplemented-tasks/task-146-effects-1343-1347.md b/docs/effect-unimplemented-tasks/task-146-effects-1343-1347.md deleted file mode 100644 index fd2757e8e..000000000 --- a/docs/effect-unimplemented-tasks/task-146-effects-1343-1347.md +++ /dev/null @@ -1,36 +0,0 @@ -# Task 146: Effects 1343-1347 - -## 目标 - -- 补齐以下 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 1343 -- `argsNum`: `1` -- `info`: `消除对手回合类效果,消除成功则下{0}次受到的伤害转化为自身体力` - -### Effect 1344 -- `argsNum`: `1` -- `info`: `全属性+{0},后出手时自身强化效果翻倍` - -### Effect 1345 -- `argsNum`: `3` -- `info`: `消耗自身全部体力,{0}%令对手进入{1}种控制类异常状态,未触发异常状态则附加对手最大体力1/{2}的百分比伤害` - -### Effect 1346 -- `argsNum`: `4` -- `info`: `{0}回合内每回合{1}%令自身全属性+{2},未触发则令对手全属性-{3}` - -### Effect 1347 -- `argsNum`: `1` -- `info`: `反转对手能力提升状态,反转成功则令对手{0},反转失败则消除对手能力提升状态` -- `param`: `1,0,0` - -## 备注 - -- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。 -- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。 diff --git a/docs/effect-unimplemented-tasks/task-147-effects-1348-1352.md b/docs/effect-unimplemented-tasks/task-147-effects-1348-1352.md deleted file mode 100644 index 14893141a..000000000 --- a/docs/effect-unimplemented-tasks/task-147-effects-1348-1352.md +++ /dev/null @@ -1,35 +0,0 @@ -# Task 147: Effects 1348-1352 - -## 目标 - -- 补齐以下 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 1348 -- `argsNum`: `2` -- `info`: `{0}回合内若对手使用属性技能则造成伤害前令对手随机进入{1}种异常状态,未触发则消除对手回合类效果` - -### Effect 1349 -- `argsNum`: `0` -- `info`: `自身处于能力提升状态时80%打出致命一击` - -### Effect 1350 -- `argsNum`: `1` -- `info`: `反转自身能力下降状态,反转成功则对手下{0}回合攻击技能无效` - -### Effect 1351 -- `argsNum`: `2` -- `info`: `获得{0}点护罩,护罩消失时使对手下{1}次攻击技能无效` - -### Effect 1352 -- `argsNum`: `1` -- `info`: `解除自身能力下降状态,解除成功则自身全属性+{0}` - -## 备注 - -- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。 -- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。 diff --git a/docs/effect-unimplemented-tasks/task-148-effects-1353-1357.md b/docs/effect-unimplemented-tasks/task-148-effects-1353-1357.md deleted file mode 100644 index b4ba72efd..000000000 --- a/docs/effect-unimplemented-tasks/task-148-effects-1353-1357.md +++ /dev/null @@ -1,36 +0,0 @@ -# Task 148: Effects 1353-1357 - -## 目标 - -- 补齐以下 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 1353 -- `argsNum`: `3` -- `info`: `{0}回合内若自身先出手则{1}%令对手{2},未触发则消除对手回合类效果` -- `param`: `1,2,2` - -### Effect 1354 -- `argsNum`: `2` -- `info`: `吸取对手能力提升状态,吸取成功则吸取对手{0}点体力,若对手不处于能力提升状态则令对手全属性-{1}` - -### Effect 1355 -- `argsNum`: `1` -- `info`: `若打出致命一击则自身免疫下{0}次受到的异常状态` - -### Effect 1356 -- `argsNum`: `1` -- `info`: `打出致命一击则附加对手最大体力1/{0}的百分比伤害` - -### Effect 1357 -- `argsNum`: `1` -- `info`: `后出手时造成的伤害提高{0}%` - -## 备注 - -- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。 -- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。 diff --git a/docs/effect-unimplemented-tasks/task-149-effects-1358-1362.md b/docs/effect-unimplemented-tasks/task-149-effects-1358-1362.md deleted file mode 100644 index 688954f3e..000000000 --- a/docs/effect-unimplemented-tasks/task-149-effects-1358-1362.md +++ /dev/null @@ -1,35 +0,0 @@ -# Task 149: Effects 1358-1362 - -## 目标 - -- 补齐以下 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 1358 -- `argsNum`: `3` -- `info`: `{0}回合内每回合{1}%闪避对手攻击,未触发则令对手下{2}次使用的攻击技能无效` - -### Effect 1359 -- `argsNum`: `1` -- `info`: `将自身能力下降状态反馈给对手,反馈成功则自身全属性+{0},反馈失败则解除自身能力下降状态` - -### Effect 1360 -- `argsNum`: `1` -- `info`: `自己出手时若自身体力高于对手则造成的伤害提升{0}%` - -### Effect 1361 -- `argsNum`: `1` -- `info`: `消除对手能力提升状态,消除成功则恢复自身所有体力,若对手不处于能力提升状态则{0}回合内对手无法通过自身技能恢复体力` - -### Effect 1362 -- `argsNum`: `1` -- `info`: `先出手时吸取对手{0}点体力` - -## 备注 - -- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。 -- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。 diff --git a/docs/effect-unimplemented-tasks/task-150-effects-1363-1367.md b/docs/effect-unimplemented-tasks/task-150-effects-1363-1367.md deleted file mode 100644 index 9b784b829..000000000 --- a/docs/effect-unimplemented-tasks/task-150-effects-1363-1367.md +++ /dev/null @@ -1,37 +0,0 @@ -# Task 150: Effects 1363-1367 - -## 目标 - -- 补齐以下 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 1363 -- `argsNum`: `3` -- `info`: `造成的伤害低于{0}则{1}%令对手{2},未触发则消除对手回合类效果` -- `param`: `1,2,2` - -### Effect 1364 -- `argsNum`: `0` -- `info`: `令对手随机进入烧伤、冻伤、中毒、焚烬、冰封、感染中的2种异常状态,未触发控制类异常状态则2回合内令对手使用的属性技能无效` - -### Effect 1365 -- `argsNum`: `4` -- `info`: `命中后{0}%令对手{1},自身每损失{2}%的体力则进入异常概率提升{3}%` -- `param`: `1,1,1` - -### Effect 1366 -- `argsNum`: `3` -- `info`: `附加攻击伤害{0}%的百分比伤害,每次使用增加{1}%,最高{2}%` - -### Effect 1367 -- `argsNum`: `2` -- `info`: `随机附加{0}种异常状态,未触发则{1}回合内令对手使用的属性技能无效` - -## 备注 - -- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。 -- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。 diff --git a/docs/effect-unimplemented-tasks/task-151-effects-1368-1372.md b/docs/effect-unimplemented-tasks/task-151-effects-1368-1372.md deleted file mode 100644 index 501aa044b..000000000 --- a/docs/effect-unimplemented-tasks/task-151-effects-1368-1372.md +++ /dev/null @@ -1,37 +0,0 @@ -# Task 151: Effects 1368-1372 - -## 目标 - -- 补齐以下 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 1368 -- `argsNum`: `1` -- `info`: `消除对手所有护盾效果,消除成功则对手下{0}回合所有技能失效` - -### Effect 1369 -- `argsNum`: `3` -- `info`: `{0}回合内每回合{1}%令对手使用的攻击技能无效,未触发则当回合受到的攻击伤害减少{2}%` - -### Effect 1370 -- `argsNum`: `2` -- `info`: `消除对手回合类效果,消除成功则对手{0},未触发则{1}回合内对手无法通过自身技能恢复体力` -- `param`: `1,0,0` - -### Effect 1371 -- `argsNum`: `1` -- `info`: `若自身未满体力则吸取对手最大体力的1/{0}` - -### Effect 1372 -- `argsNum`: `3` -- `info`: `{0}回合内对手使用攻击技能则{1}%{2},未触发则消除对手回合类效果` -- `param`: `1,2,2` - -## 备注 - -- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。 -- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。 diff --git a/docs/effect-unimplemented-tasks/task-152-effects-1373-1377.md b/docs/effect-unimplemented-tasks/task-152-effects-1373-1377.md deleted file mode 100644 index 3f5dc6eea..000000000 --- a/docs/effect-unimplemented-tasks/task-152-effects-1373-1377.md +++ /dev/null @@ -1,36 +0,0 @@ -# Task 152: Effects 1373-1377 - -## 目标 - -- 补齐以下 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 1373 -- `argsNum`: `2` -- `info`: `直接造成{0}点冰系伤害,自身每处于一种能力提升状态则造成的伤害提高{1}%` - -### Effect 1374 -- `argsNum`: `0` -- `info`: `命中后100%秒杀对方,若MISS则自身死亡,消除对手回合类效果且100%令对手冰封,同时令我方下一只出场精灵3回合内获得冰之祝福效果` - -### Effect 1375 -- `argsNum`: `1` -- `info`: `自身下{0}回合获得了冰之祝福` - -### Effect 1376 -- `argsNum`: `4` -- `info`: `{0}回合内自身使用攻击技能则{1}%令对手{2},未触发则吸取对手最大体力的1/{3}` -- `param`: `1,2,2` - -### Effect 1377 -- `argsNum`: `0` -- `info`: `使用后在战斗结束时可以获得500泰坦之灵,每日上限5000` - -## 备注 - -- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。 -- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。 diff --git a/logic/service/fight/effect/1338_1342.go b/logic/service/fight/effect/1338_1342.go new file mode 100644 index 000000000..89573f639 --- /dev/null +++ b/logic/service/fight/effect/1338_1342.go @@ -0,0 +1,181 @@ +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 1338: 全属性+{0},对手处于能力下降状态时强化效果翻倍 +type Effect1338 struct{ node.EffectNode } + +func (e *Effect1338) OnSkill() bool { + if len(e.Args()) == 0 { + return true + } + + boost := int8(e.Args()[0].IntPart()) + if e.Ctx().Opp.HasPropSub() { + boost *= 2 + } + for i := range e.Ctx().Our.Prop[:] { + e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), boost) + } + return true +} + +// Effect 1339: 若对手不处于异常状态则下{0}回合攻击{1}%使对手进入{2}状态 +type Effect1339 struct{ node.EffectNode } + +func (e *Effect1339) Skill_Use() bool { + if len(e.Args()) < 3 || e.Ctx().Opp.StatEffect_Exist_all() { + return true + } + + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1339, 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 Effect1339Sub struct{ RoundEffectArg0Base } + +func (e *Effect1339Sub) Skill_Use() bool { + if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil { + return true + } + if e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().SkillEntity.AttackTime == 0 { + return true + } + + ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100) + if ok { + addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart())) + } + return true +} + +// Effect 1340: 命中后附加对手最大体力1/2的百分比伤害,若未命中则自身死亡,且己方下只出战精灵令对手下1次使用的攻击技能无效 +type Effect1340 struct{ node.EffectNode } + +func (e *Effect1340) Skill_Use() bool { + if e.Ctx().SkillEntity == nil { + return true + } + + if e.Ctx().SkillEntity.AttackTime == 0 { + e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{ + Type: info.DamageType.Fixed, + Damage: e.Ctx().Our.CurrentPet.GetHP(), + }) + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1340) + if sub != nil { + e.Ctx().Our.AddEffect(e.Ctx().Our, sub) + } + return true + } + + damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(alpacadecimal.NewFromInt(2)) + if damage.Cmp(alpacadecimal.Zero) <= 0 { + return true + } + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ + Type: info.DamageType.Percent, + Damage: damage, + }) + return true +} + +type Effect1340Sub struct{ node.EffectNode } + +func (e *Effect1340Sub) SetArgs(t *input.Input, a ...int) { + e.EffectNode.SetArgs(t, a...) + e.CanStack(false) + e.Duration(1) +} + +func (e *Effect1340Sub) SwitchIn(in *input.Input) bool { + if in != e.Ctx().Our { + return true + } + + lock := e.Ctx().Our.InitEffect(input.EffectType.Sub, 13401, 1) + if lock != nil { + e.Ctx().Opp.AddEffect(e.Ctx().Our, lock) + } + e.Alive(false) + return true +} + +type Effect1340LockSub struct { + node.EffectNode + remaining int +} + +func (e *Effect1340LockSub) SetArgs(t *input.Input, a ...int) { + e.EffectNode.SetArgs(t, a...) + e.Duration(-1) + if len(a) > 0 { + e.remaining = a[0] + } +} + +func (e *Effect1340LockSub) ActionStart(a, b *action.SelectSkillAction) bool { + if e.remaining <= 0 { + e.Alive(false) + return true + } + if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS { + return true + } + + e.Ctx().SkillEntity.SetMiss() + e.remaining-- + if e.remaining <= 0 { + e.Alive(false) + } + return true +} + +// Effect 1341: 造成的伤害高于{0}则恢复自身最大体力的1/{1} +type Effect1341 struct{ node.EffectNode } + +func (e *Effect1341) Skill_Use() bool { + if len(e.Args()) < 2 || e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) <= 0 { + return true + } + + heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1]) + if heal.Cmp(alpacadecimal.Zero) <= 0 { + return true + } + e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal) + return true +} + +// Effect 1342: 为自身附加{0}点护罩 +type Effect1342 struct{ node.EffectNode } + +func (e *Effect1342) Skill_Use() bool { + if len(e.Args()) == 0 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + e.Ctx().Our.AddShield(e.Args()[0]) + return true +} + +func init() { + input.InitEffect(input.EffectType.Skill, 1338, &Effect1338{}) + input.InitEffect(input.EffectType.Skill, 1339, &Effect1339{}) + input.InitEffect(input.EffectType.Sub, 1339, &Effect1339Sub{}) + input.InitEffect(input.EffectType.Skill, 1340, &Effect1340{}) + input.InitEffect(input.EffectType.Sub, 1340, &Effect1340Sub{}) + input.InitEffect(input.EffectType.Sub, 13401, &Effect1340LockSub{}) + input.InitEffect(input.EffectType.Skill, 1341, &Effect1341{}) + input.InitEffect(input.EffectType.Skill, 1342, &Effect1342{}) +} diff --git a/logic/service/fight/effect/1343_1347.go b/logic/service/fight/effect/1343_1347.go new file mode 100644 index 000000000..8719873de --- /dev/null +++ b/logic/service/fight/effect/1343_1347.go @@ -0,0 +1,197 @@ +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" + "github.com/gogf/gf/v2/util/grand" +) + +var effect1345ControlStatuses = []int{ + int(info.PetStatus.Paralysis), + int(info.PetStatus.Tired), + int(info.PetStatus.Fear), + int(info.PetStatus.Petrified), + int(info.PetStatus.Sleep), +} + +func addRandomControlStatuses1345(owner, target *input.Input, count int) bool { + if owner == nil || target == nil || count <= 0 { + return false + } + if count > len(effect1345ControlStatuses) { + count = len(effect1345ControlStatuses) + } + + applied := false + for _, idx := range grand.Perm(len(effect1345ControlStatuses))[:count] { + if addStatusByID(owner, target, effect1345ControlStatuses[idx]) { + applied = true + } + } + return applied +} + +// Effect 1343: 消除对手回合类效果,消除成功则下{0}次受到的伤害转化为自身体力 +type Effect1343 struct{ node.EffectNode } + +func (e *Effect1343) 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 + } + + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1343, int(e.Args()[0].IntPart())) + if sub != nil { + e.Ctx().Our.AddEffect(e.Ctx().Our, sub) + } + return true +} + +type Effect1343Sub struct { + node.EffectNode + remaining int +} + +func (e *Effect1343Sub) SetArgs(t *input.Input, a ...int) { + e.EffectNode.SetArgs(t, a...) + e.Duration(-1) + if len(a) > 0 { + e.remaining = a[0] + } +} + +func (e *Effect1343Sub) DamageLockEx(zone *info.DamageZone) bool { + if zone == nil || zone.Type != info.DamageType.Red || e.remaining <= 0 { + return true + } + if zone.Damage.Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + heal := zone.Damage + e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal) + zone.Damage = alpacadecimal.Zero + e.remaining-- + if e.remaining <= 0 { + e.Alive(false) + } + return true +} + +// Effect 1344: 全属性+{0},后出手时自身强化效果翻倍 +type Effect1344 struct{ node.EffectNode } + +func (e *Effect1344) OnSkill() bool { + if len(e.Args()) == 0 { + return true + } + + boost := int8(e.Args()[0].IntPart()) + if !e.IsFirst() { + boost *= 2 + } + for i := range e.Ctx().Our.Prop[:] { + e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), boost) + } + return true +} + +// Effect 1345: 消耗自身全部体力,{0}%令对手进入{1}种控制类异常状态,未触发异常状态则附加对手最大体力1/{2}的百分比伤害 +type Effect1345 struct{ node.EffectNode } + +func (e *Effect1345) Skill_Use() bool { + if len(e.Args()) < 3 { + return true + } + + if e.Ctx().Our.CurrentPet != nil { + e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{ + Type: info.DamageType.Fixed, + Damage: e.Ctx().Our.CurrentPet.GetHP(), + }) + } + + triggered := false + ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100) + if ok { + triggered = addRandomControlStatuses1345(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart())) + } + if triggered || e.Args()[2].Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[2]) + if damage.Cmp(alpacadecimal.Zero) <= 0 { + return true + } + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ + Type: info.DamageType.Percent, + Damage: damage, + }) + return true +} + +// Effect 1346: {0}回合内每回合{1}%令自身全属性+{2},未触发则令对手全属性-{3} +type Effect1346 struct{ RoundEffectArg0Base } + +func (e *Effect1346) OnSkill() bool { + if len(e.Args()) < 4 { + return true + } + + ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100) + if ok { + boost := int8(e.Args()[2].IntPart()) + for i := range e.Ctx().Our.Prop[:] { + e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), boost) + } + return true + } + + applyAllPropDown(e.Ctx().Our, e.Ctx().Opp, int8(e.Args()[3].IntPart())) + return true +} + +// Effect 1347: 反转对手能力提升状态,反转成功则令对手{0},反转失败则消除对手能力提升状态 +type Effect1347 struct{ node.EffectNode } + +func (e *Effect1347) Skill_Use() bool { + if len(e.Args()) == 0 { + return true + } + + reversed := false + for i, v := range e.Ctx().Opp.Prop[:] { + if v <= 0 { + continue + } + if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), -2*v) { + reversed = true + } + } + if reversed { + addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart())) + return true + } + + clearPositiveProps(e.Ctx().Opp, e.Ctx().Our) + return true +} + +func init() { + input.InitEffect(input.EffectType.Skill, 1343, &Effect1343{}) + input.InitEffect(input.EffectType.Sub, 1343, &Effect1343Sub{}) + input.InitEffect(input.EffectType.Skill, 1344, &Effect1344{}) + input.InitEffect(input.EffectType.Skill, 1345, &Effect1345{}) + input.InitEffect(input.EffectType.Skill, 1346, &Effect1346{}) + input.InitEffect(input.EffectType.Skill, 1347, &Effect1347{}) +} diff --git a/logic/service/fight/effect/1348_1352.go b/logic/service/fight/effect/1348_1352.go new file mode 100644 index 000000000..9be3c8134 --- /dev/null +++ b/logic/service/fight/effect/1348_1352.go @@ -0,0 +1,203 @@ +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 1348: {0}回合内若对手使用属性技能则造成伤害前令对手随机进入{1}种异常状态,未触发则消除对手回合类效果 +type Effect1348 struct { + RoundEffectArg0Base + pending bool + triggered bool +} + +func (e *Effect1348) Skill_Use_ex() bool { + if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS { + return true + } + + e.pending = true + return true +} + +func (e *Effect1348) SkillHit() bool { + if !e.pending || len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS { + return true + } + + applyRandomStatuses1394(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart())) + e.pending = false + e.triggered = true + return true +} + +func (e *Effect1348) TurnEnd() { + if !e.triggered && e.Duration() == 1 { + e.Ctx().Opp.CancelTurn(e.Ctx().Our) + } + e.EffectNode.TurnEnd() +} + +// Effect 1349: 自身处于能力提升状态时80%打出致命一击 +type Effect1349 struct{ node.EffectNode } + +func (e *Effect1349) SkillHit() bool { + if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS { + return true + } + if !e.Ctx().Our.HasPropADD() { + return true + } + + ok, _, _ := e.Input.Player.Roll(80, 100) + if ok { + e.Ctx().SkillEntity.XML.CritRate = 16 + } + return true +} + +// Effect 1350: 反转自身能力下降状态,反转成功则对手下{0}回合攻击技能无效 +type Effect1350 struct{ node.EffectNode } + +func (e *Effect1350) Skill_Use() bool { + reversed := false + for i, v := range e.Ctx().Our.Prop[:] { + if v >= 0 { + continue + } + if e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), -2*v) { + reversed = true + } + } + if !reversed || len(e.Args()) == 0 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1350, int(e.Args()[0].IntPart())) + if sub != nil { + e.Ctx().Opp.AddEffect(e.Ctx().Our, sub) + } + return true +} + +type Effect1350Sub struct{ RoundEffectArg0Base } + +func (e *Effect1350Sub) 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 1351: 获得{0}点护罩,护罩消失时使对手下{1}次攻击技能无效 +type Effect1351 struct{ node.EffectNode } + +func (e *Effect1351) Skill_Use() bool { + if len(e.Args()) < 2 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + e.Ctx().Our.AddShield(e.Args()[0]) + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1351, int(e.Args()[1].IntPart())) + if sub != nil { + e.Ctx().Our.AddEffect(e.Ctx().Our, sub) + } + return true +} + +type Effect1351Sub struct { + node.EffectNode + triggered bool +} + +func (e *Effect1351Sub) SetArgs(t *input.Input, a ...int) { + e.EffectNode.SetArgs(t, a...) + e.Duration(-1) +} + +func (e *Effect1351Sub) ShieldChange(before, after alpacadecimal.Decimal) bool { + if e.triggered || before.Cmp(alpacadecimal.Zero) <= 0 || after.Cmp(alpacadecimal.Zero) > 0 || len(e.Args()) == 0 { + return true + } + + e.triggered = true + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2351, int(e.Args()[0].IntPart())) + if sub != nil { + e.Ctx().Opp.AddEffect(e.Ctx().Our, sub) + } + e.Alive(false) + return true +} + +type Effect1351DisableSub struct { + node.EffectNode + remaining int +} + +func (e *Effect1351DisableSub) SetArgs(t *input.Input, a ...int) { + e.EffectNode.SetArgs(t, a...) + e.Duration(-1) + if len(a) > 0 { + e.remaining = a[0] + } +} + +func (e *Effect1351DisableSub) ActionStart(a, b *action.SelectSkillAction) bool { + if e.remaining <= 0 { + e.Alive(false) + return true + } + if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS { + return true + } + + e.Ctx().SkillEntity.SetMiss() + e.remaining-- + if e.remaining <= 0 { + e.Alive(false) + } + return true +} + +// Effect 1352: 解除自身能力下降状态,解除成功则自身全属性+{0} +type Effect1352 struct{ node.EffectNode } + +func (e *Effect1352) OnSkill() bool { + if len(e.Args()) == 0 { + return true + } + + cleared := false + for i, v := range e.Ctx().Our.Prop[:] { + if v < 0 && e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), 0) { + cleared = true + } + } + if !cleared { + return true + } + + boost := int8(e.Args()[0].IntPart()) + for i := range e.Ctx().Our.Prop[:] { + e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), boost) + } + return true +} + +func init() { + input.InitEffect(input.EffectType.Skill, 1348, &Effect1348{}) + input.InitEffect(input.EffectType.Skill, 1349, &Effect1349{}) + input.InitEffect(input.EffectType.Skill, 1350, &Effect1350{}) + input.InitEffect(input.EffectType.Sub, 1350, &Effect1350Sub{}) + input.InitEffect(input.EffectType.Skill, 1351, &Effect1351{}) + input.InitEffect(input.EffectType.Sub, 1351, &Effect1351Sub{}) + input.InitEffect(input.EffectType.Sub, 2351, &Effect1351DisableSub{}) + input.InitEffect(input.EffectType.Skill, 1352, &Effect1352{}) +} diff --git a/logic/service/fight/effect/1353_1357.go b/logic/service/fight/effect/1353_1357.go new file mode 100644 index 000000000..4f5c2a0b6 --- /dev/null +++ b/logic/service/fight/effect/1353_1357.go @@ -0,0 +1,126 @@ +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 1353: {0}回合内若自身先出手则{1}%令对手{2},未触发则消除对手回合类效果 +type Effect1353 struct { + RoundEffectArg0Base + triggered bool +} + +func (e *Effect1353) OnSkill() bool { + if len(e.Args()) < 3 || !e.IsFirst() { + return true + } + + ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100) + if ok && addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart())) { + e.triggered = true + } + return true +} + +func (e *Effect1353) TurnEnd() { + if !e.triggered && e.Duration() == 1 { + e.Ctx().Opp.CancelTurn(e.Ctx().Our) + } + e.EffectNode.TurnEnd() +} + +// Effect 1354: 吸取对手能力提升状态,吸取成功则吸取对手{0}点体力,若对手不处于能力提升状态则令对手全属性-{1} +type Effect1354 struct{ node.EffectNode } + +func (e *Effect1354) OnSkill() bool { + if len(e.Args()) < 2 { + return true + } + + absorbed := false + 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) + absorbed = true + } + } + if absorbed { + drain := e.Args()[0] + if drain.Cmp(alpacadecimal.Zero) > 0 { + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ + Type: info.DamageType.Fixed, + Damage: drain, + }) + e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, drain) + } + return true + } + + applyAllPropDown(e.Ctx().Our, e.Ctx().Opp, int8(e.Args()[1].IntPart())) + return true +} + +// Effect 1355: 若打出致命一击则自身免疫下{0}次受到的异常状态 +type Effect1355 struct{ node.EffectNode } + +func (e *Effect1355) SkillHit_ex() bool { + if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().SkillEntity.Crit == 0 { + return true + } + + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1099, int(e.Args()[0].IntPart())) + if sub != nil { + e.Ctx().Our.AddEffect(e.Ctx().Our, sub) + } + return true +} + +// Effect 1356: 打出致命一击则附加对手最大体力1/{0}的百分比伤害 +type Effect1356 struct{ node.EffectNode } + +func (e *Effect1356) OnSkill() bool { + if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Crit == 0 || e.Ctx().Opp == nil || e.Ctx().Opp.CurrentPet == nil { + return true + } + if e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0]) + if damage.Cmp(alpacadecimal.Zero) <= 0 { + return true + } + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ + Type: info.DamageType.Percent, + Damage: damage, + }) + return true +} + +// Effect 1357: 后出手时造成的伤害提高{0}% +type Effect1357 struct{ node.EffectNode } + +func (e *Effect1357) SkillHit() bool { + if len(e.Args()) == 0 || e.IsFirst() || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS { + return true + } + + addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0]) + return true +} + +func init() { + input.InitEffect(input.EffectType.Skill, 1353, &Effect1353{}) + input.InitEffect(input.EffectType.Skill, 1354, &Effect1354{}) + input.InitEffect(input.EffectType.Skill, 1355, &Effect1355{}) + input.InitEffect(input.EffectType.Skill, 1356, &Effect1356{}) + input.InitEffect(input.EffectType.Skill, 1357, &Effect1357{}) +} diff --git a/logic/service/fight/effect/1358_1362.go b/logic/service/fight/effect/1358_1362.go new file mode 100644 index 000000000..308605bff --- /dev/null +++ b/logic/service/fight/effect/1358_1362.go @@ -0,0 +1,140 @@ +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 1358: {0}回合内每回合{1}%闪避对手攻击,未触发则令对手下{2}次使用的攻击技能无效 +type Effect1358 struct{ RoundEffectArg0Base } + +func (e *Effect1358) SkillHit_ex() bool { + if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS { + return true + } + if e.Ctx().SkillEntity.AttackTime == 2 { + return true + } + + ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100) + if ok && e.Ctx().SkillEntity.SetMiss() { + return true + } + if e.Args()[2].Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2062, int(e.Args()[2].IntPart())) + if sub != nil { + e.Ctx().Opp.AddEffect(e.Ctx().Our, sub) + } + return true +} + +// Effect 1359: 将自身能力下降状态反馈给对手,反馈成功则自身全属性+{0},反馈失败则解除自身能力下降状态 +type Effect1359 struct{ node.EffectNode } + +func (e *Effect1359) OnSkill() bool { + reflected := false + for i, v := range e.Ctx().Our.Prop[:] { + if v >= 0 { + continue + } + if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), v) { + reflected = true + } + } + if reflected { + if len(e.Args()) == 0 { + return true + } + boost := int8(e.Args()[0].IntPart()) + for i := range e.Ctx().Our.Prop[:] { + e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), boost) + } + return true + } + + for i, v := range e.Ctx().Our.Prop[:] { + if v < 0 { + e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), 0) + } + } + return true +} + +// Effect 1360: 自己出手时若自身体力高于对手则造成的伤害提升{0}% +type Effect1360 struct{ node.EffectNode } + +func (e *Effect1360) SkillHit() bool { + if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS { + return true + } + if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) <= 0 { + return true + } + + addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0]) + return true +} + +// Effect 1361: 消除对手能力提升状态,消除成功则恢复自身所有体力,若对手不处于能力提升状态则{0}回合内对手无法通过自身技能恢复体力 +type Effect1361 struct{ node.EffectNode } + +func (e *Effect1361) Skill_Use() bool { + hadPositive := false + cleared := false + for i, v := range e.Ctx().Opp.Prop[:] { + if v <= 0 { + continue + } + hadPositive = true + if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) { + cleared = true + } + } + if cleared { + if e.Ctx().Our.CurrentPet != nil { + e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP()) + } + return true + } + if hadPositive || len(e.Args()) == 0 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 679, int(e.Args()[0].IntPart())) + if sub != nil { + e.Ctx().Opp.AddEffect(e.Ctx().Our, sub) + } + return true +} + +// Effect 1362: 先出手时吸取对手{0}点体力 +type Effect1362 struct{ node.EffectNode } + +func (e *Effect1362) OnSkill() bool { + if len(e.Args()) == 0 || !e.IsFirst() || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + drain := e.Args()[0] + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ + Type: info.DamageType.Fixed, + Damage: drain, + }) + e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, drain) + return true +} + +func init() { + input.InitEffect(input.EffectType.Skill, 1358, &Effect1358{}) + input.InitEffect(input.EffectType.Skill, 1359, &Effect1359{}) + input.InitEffect(input.EffectType.Skill, 1360, &Effect1360{}) + input.InitEffect(input.EffectType.Skill, 1361, &Effect1361{}) + input.InitEffect(input.EffectType.Skill, 1362, &Effect1362{}) +} diff --git a/logic/service/fight/effect/1363_1367.go b/logic/service/fight/effect/1363_1367.go new file mode 100644 index 000000000..517a68ecc --- /dev/null +++ b/logic/service/fight/effect/1363_1367.go @@ -0,0 +1,187 @@ +package effect + +import ( + "blazing/logic/service/fight/info" + "blazing/logic/service/fight/input" + "blazing/logic/service/fight/node" + + "github.com/alpacahq/alpacadecimal" + "github.com/gogf/gf/v2/util/grand" +) + +var effect1364StatusPool = []int{ + int(info.PetStatus.Burned), + int(info.PetStatus.Frozen), + int(info.PetStatus.Poisoned), + 22, // 焚烬 + int(info.PetStatus.IceBound), + 27, // 感染 +} + +func addRandomStatuses1364(owner, target *input.Input, count int) (applied int, controlApplied bool) { + if owner == nil || target == nil || count <= 0 { + return 0, false + } + if count > len(effect1364StatusPool) { + count = len(effect1364StatusPool) + } + + indexes := grand.Perm(len(effect1364StatusPool)) + for _, idx := range indexes { + statusID := effect1364StatusPool[idx] + eff := owner.InitEffect(input.EffectType.Status, statusID) + if eff == nil { + continue + } + target.AddEffect(owner, eff) + applied++ + if statusID == int(info.PetStatus.IceBound) { + controlApplied = true + } + if applied >= count { + break + } + } + return applied, controlApplied +} + +func addRandomStatuses1367(owner, target *input.Input, count int) int { + if owner == nil || target == nil || count <= 0 || len(effect1394Statuses) == 0 { + return 0 + } + if count > len(effect1394Statuses) { + count = len(effect1394Statuses) + } + + applied := 0 + for _, idx := range grand.Perm(len(effect1394Statuses))[:count] { + statusEffect := owner.InitEffect(input.EffectType.Status, effect1394Statuses[idx]) + if statusEffect == nil { + continue + } + target.AddEffect(owner, statusEffect) + applied++ + } + return applied +} + +// Effect 1363: 造成的伤害低于{0}则{1}%令对手{2},未触发则消除对手回合类效果 +type Effect1363 struct{ node.EffectNode } + +func (e *Effect1363) Skill_Use() bool { + if len(e.Args()) < 3 || e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) >= 0 { + return true + } + + ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100) + if ok && addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart())) { + return true + } + + e.Ctx().Opp.CancelTurn(e.Ctx().Our) + return true +} + +// Effect 1364: 令对手随机进入烧伤、冻伤、中毒、焚烬、冰封、感染中的2种异常状态,未触发控制类异常状态则2回合内令对手使用的属性技能无效 +type Effect1364 struct{ node.EffectNode } + +func (e *Effect1364) Skill_Use() bool { + _, controlApplied := addRandomStatuses1364(e.Ctx().Our, e.Ctx().Opp, 2) + if controlApplied { + return true + } + + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1284, 2) + if sub != nil { + e.Ctx().Opp.AddEffect(e.Ctx().Our, sub) + } + return true +} + +// Effect 1365: 命中后{0}%令对手{1},自身每损失{2}%的体力则进入异常概率提升{3}% +type Effect1365 struct{ node.EffectNode } + +func (e *Effect1365) 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 + } + if e.Args()[2].Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + maxHP := e.Ctx().Our.CurrentPet.GetMaxHP() + curHP := e.Ctx().Our.CurrentPet.GetHP() + lostHPPercent := maxHP.Sub(curHP).Mul(hundred).Div(maxHP).IntPart() + additionalStacks := lostHPPercent / e.Args()[2].IntPart() + chance := int(e.Args()[0].IntPart() + additionalStacks*e.Args()[3].IntPart()) + if chance > 100 { + chance = 100 + } + if ok, _, _ := e.Input.Player.Roll(chance, 100); ok { + addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart())) + } + return true +} + +// Effect 1366: 附加攻击伤害{0}%的百分比伤害,每次使用增加{1}%,最高{2}% +type Effect1366 struct{ AddLvelEffect } + +func (e *Effect1366) Skill_Use() bool { + if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().SkillEntity.AttackTime == 0 { + return true + } + if e.Ctx().Our.SumDamage.Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + percent := e.Args()[0] + if e.UseSkillCount > 1 { + percent = percent.Add(e.Args()[1].Mul(alpacadecimal.NewFromInt(e.UseSkillCount - 1))) + } + if percent.Cmp(e.Args()[2]) > 0 { + percent = e.Args()[2] + } + if percent.Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + damage := e.Ctx().Our.SumDamage.Mul(percent).Div(hundred) + if damage.Cmp(alpacadecimal.Zero) <= 0 { + return true + } + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ + Type: info.DamageType.Percent, + Damage: damage, + }) + return true +} + +// Effect 1367: 随机附加{0}种异常状态,未触发则{1}回合内令对手使用的属性技能无效 +type Effect1367 struct{ node.EffectNode } + +func (e *Effect1367) Skill_Use() bool { + if len(e.Args()) < 2 { + return true + } + + if addRandomStatuses1367(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart())) > 0 { + return true + } + if e.Args()[1].Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1284, int(e.Args()[1].IntPart())) + if sub != nil { + e.Ctx().Opp.AddEffect(e.Ctx().Our, sub) + } + return true +} + +func init() { + input.InitEffect(input.EffectType.Skill, 1363, &Effect1363{}) + input.InitEffect(input.EffectType.Skill, 1364, &Effect1364{}) + input.InitEffect(input.EffectType.Skill, 1365, &Effect1365{}) + input.InitEffect(input.EffectType.Skill, 1366, &Effect1366{}) + input.InitEffect(input.EffectType.Skill, 1367, &Effect1367{}) +} diff --git a/logic/service/fight/effect/1368_1372.go b/logic/service/fight/effect/1368_1372.go new file mode 100644 index 000000000..a2cbcf22c --- /dev/null +++ b/logic/service/fight/effect/1368_1372.go @@ -0,0 +1,136 @@ +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 1368: 消除对手所有护盾效果,消除成功则对手下{0}回合所有技能失效 +type Effect1368 struct{ node.EffectNode } + +func (e *Effect1368) Skill_Use() bool { + if len(e.Args()) == 0 || e.Ctx().Opp.CurrentShield().Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + e.Ctx().Opp.ConsumeAllShield() + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 902, int(e.Args()[0].IntPart())) + if sub != nil { + e.Ctx().Opp.AddEffect(e.Ctx().Our, sub) + } + return true +} + +// Effect 1369: {0}回合内每回合{1}%令对手使用的攻击技能无效,未触发则当回合受到的攻击伤害减少{2}% +type Effect1369 struct { + RoundEffectArg0Base + reduceCurrentAttack bool +} + +func (e *Effect1369) ActionStart(a, b *action.SelectSkillAction) bool { + e.reduceCurrentAttack = false + if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS { + return true + } + + ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100) + if ok { + e.Ctx().SkillEntity.SetMiss() + return true + } + + e.reduceCurrentAttack = true + return true +} + +func (e *Effect1369) DamageDivEx(zone *info.DamageZone) bool { + if !e.reduceCurrentAttack || zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 3 { + return true + } + + zone.Damage = zone.Damage.Mul(hundred.Sub(e.Args()[2])).Div(hundred) + e.reduceCurrentAttack = false + return true +} + +// Effect 1370: 消除对手回合类效果,消除成功则对手{0},未触发则{1}回合内对手无法通过自身技能恢复体力 +type Effect1370 struct{ node.EffectNode } + +func (e *Effect1370) Skill_Use() bool { + if len(e.Args()) < 2 { + return true + } + + before := activeTurnEffectCount(e.Ctx().Opp) + e.Ctx().Opp.CancelTurn(e.Ctx().Our) + if before > 0 { + addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart())) + return true + } + if e.Args()[1].Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 679, int(e.Args()[1].IntPart())) + if sub != nil { + e.Ctx().Opp.AddEffect(e.Ctx().Our, sub) + } + return true +} + +// Effect 1371: 若自身未满体力则吸取对手最大体力的1/{0} +type Effect1371 struct{ node.EffectNode } + +func (e *Effect1371) OnSkill() bool { + if len(e.Args()) == 0 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 { + return true + } + if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) >= 0 { + return true + } + + damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0]) + if damage.Cmp(alpacadecimal.Zero) <= 0 { + return true + } + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage}) + e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage) + return true +} + +// Effect 1372: {0}回合内对手使用攻击技能则{1}%{2},未触发则消除对手回合类效果 +type Effect1372 struct { + RoundEffectArg0Base + triggered bool +} + +func (e *Effect1372) Skill_Use_ex() bool { + if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS { + return true + } + + ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100) + if ok && addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart())) { + e.triggered = true + } + return true +} + +func (e *Effect1372) TurnEnd() { + if !e.triggered && e.Duration() == 1 { + e.Ctx().Opp.CancelTurn(e.Ctx().Our) + } + e.EffectNode.TurnEnd() +} + +func init() { + input.InitEffect(input.EffectType.Skill, 1368, &Effect1368{}) + input.InitEffect(input.EffectType.Skill, 1369, &Effect1369{}) + input.InitEffect(input.EffectType.Skill, 1370, &Effect1370{}) + input.InitEffect(input.EffectType.Skill, 1371, &Effect1371{}) + input.InitEffect(input.EffectType.Skill, 1372, &Effect1372{}) +} diff --git a/logic/service/fight/effect/1373_1377.go b/logic/service/fight/effect/1373_1377.go new file mode 100644 index 000000000..a39d40269 --- /dev/null +++ b/logic/service/fight/effect/1373_1377.go @@ -0,0 +1,204 @@ +package effect + +import ( + "blazing/common/data/share" + "blazing/logic/service/fight/action" + "blazing/logic/service/fight/info" + "blazing/logic/service/fight/input" + "blazing/logic/service/fight/node" + + "github.com/alpacahq/alpacadecimal" + "github.com/gogf/gf/v2/util/grand" +) + +// Effect 1373: 直接造成{0}点冰系伤害,自身每处于一种能力提升状态则造成的伤害提高{1}% +type Effect1373 struct{ node.EffectNode } + +func (e *Effect1373) Skill_Use() bool { + if len(e.Args()) < 2 { + return true + } + + damage := e.Args()[0] + boostCount := countPositivePropKinds(e.Ctx().Our) + if boostCount > 0 { + damage = damage.Add( + damage.Mul(e.Args()[1]).Mul(alpacadecimal.NewFromInt(int64(boostCount))).Div(hundred), + ) + } + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ + Type: info.DamageType.Fixed, + Damage: damage, + }) + return true +} + +// Effect 1374: 命中后100%秒杀对方,若MISS则自身死亡,消除对手回合类效果且100%令对手冰封,同时令我方下一只出场精灵3回合内获得冰之祝福效果 +type Effect1374 struct{ node.EffectNode } + +func (e *Effect1374) DamageFloor(zone *info.DamageZone) bool { + if zone == nil || zone.Type != info.DamageType.Red { + return true + } + if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.AttackTime == 0 { + return true + } + + zone.Damage = e.Ctx().Opp.CurrentPet.GetMaxHP() + return true +} + +func (e *Effect1374) Skill_Use() bool { + if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.AttackTime == 0 { + e.Ctx().Our.CurrentPet.Info.Hp = 0 + } + + e.Ctx().Opp.CancelTurn(e.Ctx().Our) + applyStatusByID(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.IceBound)) + + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1374, 3) + if sub != nil { + e.Ctx().Our.AddEffect(e.Ctx().Our, sub) + } + return true +} + +type Effect1374Sub struct{ node.EffectNode } + +func (e *Effect1374Sub) SetArgs(t *input.Input, a ...int) { + e.EffectNode.SetArgs(t, a...) + e.Duration(-1) + e.CanStack(false) +} + +func (e *Effect1374Sub) SwitchIn(in *input.Input) bool { + if in != e.Ctx().Our || len(e.Args()) == 0 { + return true + } + + buff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1375, int(e.Args()[0].IntPart())) + if buff != nil { + e.Ctx().Our.AddEffect(e.Ctx().Our, buff) + } + e.Alive(false) + return true +} + +// Effect 1375: 自身下{0}回合获得了冰之祝福 +type Effect1375 struct{ node.EffectNode } + +func (e *Effect1375) Skill_Use() bool { + if len(e.Args()) == 0 { + return true + } + + sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1375, int(e.Args()[0].IntPart())) + if sub != nil { + e.Ctx().Our.AddEffect(e.Ctx().Our, sub) + } + return true +} + +type Effect1375Sub struct{ RoundEffectArg0Base } + +func (e *Effect1375Sub) SetArgs(t *input.Input, a ...int) { + e.RoundEffectArg0Base.SetArgs(t, a...) + e.CanStack(false) +} + +func (e *Effect1375Sub) SkillHit() bool { + if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS { + return true + } + if ok, _, _ := e.Input.Player.Roll(50, 100); ok { + e.Ctx().SkillEntity.XML.CritRate = 16 + } + return true +} + +func (e *Effect1375Sub) OnSkill() bool { + if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().SkillEntity.AttackTime == 0 { + return true + } + + damage := alpacadecimal.NewFromInt(int64(grand.N(150, 300))) + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ + Type: info.DamageType.Fixed, + Damage: damage, + }) + return true +} + +// Effect 1376: {0}回合内自身使用攻击技能则{1}%令对手{2},未触发则吸取对手最大体力的1/{3} +type Effect1376 struct{ RoundEffectArg0Base } + +func (e *Effect1376) OnSkill() bool { + if len(e.Args()) < 4 || 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 { + if addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart())) { + return true + } + } + + if e.Args()[3].Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[3]) + if damage.Cmp(alpacadecimal.Zero) <= 0 { + return true + } + + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ + Type: info.DamageType.Percent, + Damage: damage, + }) + e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage) + return true +} + +// Effect 1377: 使用后在战斗结束时可以获得500泰坦之灵,每日上限5000 +type Effect1377 struct{ node.EffectNode } + +func (e *Effect1377) SetArgs(t *input.Input, a ...int) { + e.EffectNode.SetArgs(t, a...) + e.Duration(-1) +} + +func (e *Effect1377) OnBattleEnd() bool { + player := e.Ctx().Our.Player + if player == nil || player.GetInfo().UserID == 0 { + return true + } + + count, err := share.GlobalCounterManager.GetCount(&share.DailyPeriod, player.GetInfo().UserID, 1377) + if err != nil && err != share.ErrCacheMiss { + return true + } + if err == share.ErrCacheMiss { + count = 0 + } + if count >= 10 { + return true + } + + if !player.ItemAdd(1400352, 500) { + return true + } + + _, _ = share.GlobalCounterManager.IncrCount(&share.DailyPeriod, player.GetInfo().UserID, 1377) + return true +} + +func init() { + input.InitEffect(input.EffectType.Skill, 1373, &Effect1373{}) + input.InitEffect(input.EffectType.Skill, 1374, &Effect1374{}) + input.InitEffect(input.EffectType.Sub, 1374, &Effect1374Sub{}) + input.InitEffect(input.EffectType.Skill, 1375, &Effect1375{}) + input.InitEffect(input.EffectType.Sub, 1375, &Effect1375Sub{}) + input.InitEffect(input.EffectType.Skill, 1376, &Effect1376{}) + input.InitEffect(input.EffectType.Skill, 1377, &Effect1377{}) +} diff --git a/logic/service/fight/effect/effect_info_map.go b/logic/service/fight/effect/effect_info_map.go index 4802e9372..7a8130a2a 100644 --- a/logic/service/fight/effect/effect_info_map.go +++ b/logic/service/fight/effect/effect_info_map.go @@ -887,6 +887,46 @@ var effectInfoByID = map[int]string{ 1335: "{0}%令对手{1},未触发则随机吸取对手{2}项属性-{3},并将该属性附加给自己", 1336: "{0}回合内每回合使用技能附加自身最大体力值与攻击值总和{1}%的百分比伤害", 1337: "自身体力高于对手则{0}%令对手{1},未触发{2}则消除对手回合类效果", + 1338: "全属性+{0},对手处于能力下降状态时强化效果翻倍", + 1339: "若对手不处于异常状态则下{0}回合攻击{1}%使对手进入{2}状态", + 1340: "命中后附加对手最大体力1/2的百分比伤害,若未命中则自身死亡,且己方下只出战精灵令对手下1次使用的攻击技能无效", + 1341: "造成的伤害高于{0}则恢复自身最大体力的1/{1}", + 1342: "为自身附加{0}点护罩", + 1343: "消除对手回合类效果,消除成功则下{0}次受到的伤害转化为自身体力", + 1344: "全属性+{0},后出手时自身强化效果翻倍", + 1345: "消耗自身全部体力,{0}%令对手进入{1}种控制类异常状态,未触发异常状态则附加对手最大体力1/{2}的百分比伤害", + 1346: "{0}回合内每回合{1}%令自身全属性+{2},未触发则令对手全属性-{3}", + 1347: "反转对手能力提升状态,反转成功则令对手{0},反转失败则消除对手能力提升状态", + 1348: "{0}回合内若对手使用属性技能则造成伤害前令对手随机进入{1}种异常状态,未触发则消除对手回合类效果", + 1349: "自身处于能力提升状态时80%打出致命一击", + 1350: "反转自身能力下降状态,反转成功则对手下{0}回合攻击技能无效", + 1351: "获得{0}点护罩,护罩消失时使对手下{1}次攻击技能无效", + 1352: "解除自身能力下降状态,解除成功则自身全属性+{0}", + 1353: "{0}回合内若自身先出手则{1}%令对手{2},未触发则消除对手回合类效果", + 1354: "吸取对手能力提升状态,吸取成功则吸取对手{0}点体力,若对手不处于能力提升状态则令对手全属性-{1}", + 1355: "若打出致命一击则自身免疫下{0}次受到的异常状态", + 1356: "打出致命一击则附加对手最大体力1/{0}的百分比伤害", + 1357: "后出手时造成的伤害提高{0}%", + 1358: "{0}回合内每回合{1}%闪避对手攻击,未触发则令对手下{2}次使用的攻击技能无效", + 1359: "将自身能力下降状态反馈给对手,反馈成功则自身全属性+{0},反馈失败则解除自身能力下降状态", + 1360: "自己出手时若自身体力高于对手则造成的伤害提升{0}%", + 1361: "消除对手能力提升状态,消除成功则恢复自身所有体力,若对手不处于能力提升状态则{0}回合内对手无法通过自身技能恢复体力", + 1362: "先出手时吸取对手{0}点体力", + 1363: "造成的伤害低于{0}则{1}%令对手{2},未触发则消除对手回合类效果", + 1364: "令对手随机进入烧伤、冻伤、中毒、焚烬、冰封、感染中的2种异常状态,未触发控制类异常状态则2回合内令对手使用的属性技能无效", + 1365: "命中后{0}%令对手{1},自身每损失{2}%的体力则进入异常概率提升{3}%", + 1366: "附加攻击伤害{0}%的百分比伤害,每次使用增加{1}%,最高{2}%", + 1367: "随机附加{0}种异常状态,未触发则{1}回合内令对手使用的属性技能无效", + 1368: "消除对手所有护盾效果,消除成功则对手下{0}回合所有技能失效", + 1369: "{0}回合内每回合{1}%令对手使用的攻击技能无效,未触发则当回合受到的攻击伤害减少{2}%", + 1370: "消除对手回合类效果,消除成功则对手{0},未触发则{1}回合内对手无法通过自身技能恢复体力", + 1371: "若自身未满体力则吸取对手最大体力的1/{0}", + 1372: "{0}回合内对手使用攻击技能则{1}%{2},未触发则消除对手回合类效果", + 1373: "直接造成{0}点冰系伤害,自身每处于一种能力提升状态则造成的伤害提高{1}%", + 1374: "命中后100%秒杀对方,若MISS则自身死亡,消除对手回合类效果且100%令对手冰封,同时令我方下一只出场精灵3回合内获得冰之祝福效果", + 1375: "自身下{0}回合获得了冰之祝福", + 1376: "{0}回合内自身使用攻击技能则{1}%令对手{2},未触发则吸取对手最大体力的1/{3}", + 1377: "使用后在战斗结束时可以获得500泰坦之灵,每日上限5000", 1393: "{0}回合内每回合使用技能则造成伤害前令对手防御-{1}、速度-{2},未触发则附加对手最大体力1/{3}的百分比伤害", 1394: "{0}回合内对手使用属性技能则随机进入{1}种异常状态", 1395: "若先出手则必定打出致命一击",