Compare commits
8 Commits
9c6f3988de
...
80cfa0a07e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80cfa0a07e | ||
|
|
c89632b409 | ||
|
|
5a5a1db2a3 | ||
|
|
0ac84a9509 | ||
|
|
3a9932e307 | ||
|
|
28d92c1e18 | ||
|
|
b62b4af628 | ||
|
|
31d274dd9d |
@@ -1,36 +0,0 @@
|
||||
# Task 199: Effects 1609-1613
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 1609
|
||||
- `argsNum`: `0`
|
||||
- `info`: `召唤自己的伙伴进行5-10次攻击,布布犬发起时可额外令自身下回合攻击造成的伤害翻倍`
|
||||
|
||||
### Effect 1610
|
||||
- `argsNum`: `0`
|
||||
- `info`: `召唤自己的伙伴进行5-10次攻击,布布熊发起时可额外令对手下回合属性技能失效`
|
||||
|
||||
### Effect 1611
|
||||
- `argsNum`: `0`
|
||||
- `info`: `攻击命中后5%的概率汲取泰坦源脉的力量,本次攻击造成5倍伤害且战斗结束后获得5000泰坦之灵(每日上限50000)`
|
||||
|
||||
### Effect 1612
|
||||
- `argsNum`: `5`
|
||||
- `info`: `{0}回合内受到的伤害低于{1}时{2}%令对手{3},未触发则附加{4}点固定伤害`
|
||||
- `param`: `1,3,3`
|
||||
|
||||
### Effect 1613
|
||||
- `argsNum`: `2`
|
||||
- `info`: `自身不处于能力提升状态则吸取对手{0}点体力,若先出手则额外吸取{1}点体力`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
@@ -1,37 +0,0 @@
|
||||
# Task 200: Effects 1614-1619
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 1614
|
||||
- `argsNum`: `4`
|
||||
- `info`: `{0}回合内对手使用攻击技能后{1}%令对手{2},未触发则令对手全属性-{3}`
|
||||
- `param`: `1,2,2`
|
||||
|
||||
### Effect 1616
|
||||
- `argsNum`: `0`
|
||||
- `info`: `当回合使用的技能克制对手时获得本系属性加成`
|
||||
|
||||
### Effect 1617
|
||||
- `argsNum`: `4`
|
||||
- `info`: `{0}回合内受到攻击后{1}%使对手{2},未触发则自身全属性+{3}`
|
||||
- `param`: `1,2,2`
|
||||
|
||||
### Effect 1618
|
||||
- `argsNum`: `2`
|
||||
- `info`: `{0}回合内每回合结束时令对手随机{1}个技能PP值归零`
|
||||
|
||||
### Effect 1619
|
||||
- `argsNum`: `0`
|
||||
- `info`: `50%复制对手当回合释放的技能,未触发则恢复自身最大体力的1/2且令对手全属性-1`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
@@ -1,36 +0,0 @@
|
||||
# Task 201: Effects 1620-1624
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 1620
|
||||
- `argsNum`: `1`
|
||||
- `info`: `对手基础速度值高于{0}则下回合先制-1`
|
||||
|
||||
### Effect 1621
|
||||
- `argsNum`: `2`
|
||||
- `info`: `{0}%令对手所有技能PP值-{1},自身满体力时效果翻倍`
|
||||
|
||||
### Effect 1622
|
||||
- `argsNum`: `4`
|
||||
- `info`: `{0}回合内每回合{1}%对手属性技能无效,未触发则下{2}次受到的攻击伤害减少{3}%`
|
||||
|
||||
### Effect 1623
|
||||
- `argsNum`: `3`
|
||||
- `info`: `若对手是{0}精灵则下{1}回合对手受到的伤害提高{2}%`
|
||||
- `param`: `5,0,0`
|
||||
|
||||
### Effect 1624
|
||||
- `argsNum`: `1`
|
||||
- `info`: `对手不处于异常状态时随机附加{0}种异常状态`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
@@ -1,36 +0,0 @@
|
||||
# Task 202: Effects 1625-1629
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 1625
|
||||
- `argsNum`: `3`
|
||||
- `info`: `造成的伤害高于{0}则{1}%令自身全属性+{2}`
|
||||
|
||||
### Effect 1626
|
||||
- `argsNum`: `1`
|
||||
- `info`: `后出手时将当回合护盾所承受的伤害值以百分比伤害的形式{0}%反弹给对手`
|
||||
|
||||
### Effect 1627
|
||||
- `argsNum`: `3`
|
||||
- `info`: `{0}回合做{1}-{2}次攻击,若本回合攻击次数达到最大则必定秒杀对手`
|
||||
|
||||
### Effect 1628
|
||||
- `argsNum`: `2`
|
||||
- `info`: `每次使用该技能击败对手则恢复自身全部体力,同时重置该技能使用次数并使该技能攻击威力提升{0}点,未击败对手时令自身下回合攻击技能先制+{1}`
|
||||
|
||||
### Effect 1629
|
||||
- `argsNum`: `4`
|
||||
- `info`: `{0}基础速度值{1}{2}则自身下回合先制+{3}`
|
||||
- `param`: `4,0,0|7,1,1`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
@@ -1,37 +0,0 @@
|
||||
# Task 203: Effects 1630-1634
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 1630
|
||||
- `argsNum`: `2`
|
||||
- `info`: `若对手当回合使用的技能为攻击技能则自身必定先出手且命中后{0}%令对手{1}`
|
||||
- `param`: `1,1,1`
|
||||
|
||||
### Effect 1631
|
||||
- `argsNum`: `2`
|
||||
- `info`: `{0}回合内每回合若自身未受到攻击伤害则回合结束后附加对手最大体力1/{1}的百分比伤害(自身体力为0时也可触发)`
|
||||
|
||||
### Effect 1632
|
||||
- `argsNum`: `3`
|
||||
- `info`: `吸取对手{0}点体力,若对手任意1项技能PP值小于{1}点则额外吸取{2}点体力`
|
||||
|
||||
### Effect 1633
|
||||
- `argsNum`: `2`
|
||||
- `info`: `使自身体力百分比与对手体力百分比对调,自身体力百分比高于对手时{0}%令对手{1}`
|
||||
- `param`: `1,1,1`
|
||||
|
||||
### Effect 1634
|
||||
- `argsNum`: `0`
|
||||
- `info`: `自身体力低于250时必定先手`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
@@ -1,35 +0,0 @@
|
||||
# Task 204: Effects 1635-1639
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 1635
|
||||
- `argsNum`: `2`
|
||||
- `info`: `立刻恢复自身{0}点体力,{1}回合后恢复自身全部体力`
|
||||
|
||||
### Effect 1636
|
||||
- `argsNum`: `0`
|
||||
- `info`: `涵双1回合释放4-8张玫瑰卡牌进行攻击,每张卡牌额外附加50点固定伤害,自身体力低于最大体力的1/3时效果翻倍`
|
||||
|
||||
### Effect 1637
|
||||
- `argsNum`: `2`
|
||||
- `info`: `{0}回合内若对手使用属性技能,则使用属性技能后的下{1}回合属性技能命中效果失效`
|
||||
|
||||
### Effect 1638
|
||||
- `argsNum`: `2`
|
||||
- `info`: `{0}回合内若自身未受到攻击伤害则令对手全属性-{1}`
|
||||
|
||||
### Effect 1639
|
||||
- `argsNum`: `0`
|
||||
- `info`: `自身处于能力提升状态时100%打出致命一击`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
@@ -1,35 +0,0 @@
|
||||
# Task 205: Effects 1640-1644
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 1640
|
||||
- `argsNum`: `0`
|
||||
- `info`: `出手时若自身满体力则100%打出致命一击`
|
||||
|
||||
### Effect 1641
|
||||
- `argsNum`: `2`
|
||||
- `info`: `自身处于能力提升状态时造成伤害的{0}%恢复自身体力值,当前体力低于最大体力的1/{1}时附加等量百分比伤害`
|
||||
|
||||
### Effect 1642
|
||||
- `argsNum`: `2`
|
||||
- `info`: `消除对手能力提升状态,消除成功则{0}%随机为对手任意技能散布{1}枚致命印记`
|
||||
|
||||
### Effect 1643
|
||||
- `argsNum`: `1`
|
||||
- `info`: `对手每存在1层致命裂痕则附加{0}点真实伤害`
|
||||
|
||||
### Effect 1644
|
||||
- `argsNum`: `3`
|
||||
- `info`: `{0}回合内对手使用攻击技能则随机进入{1}种异常状态,未触发则随机为对手任意技能散布{2}枚致命印记`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
@@ -1,35 +0,0 @@
|
||||
# Task 206: Effects 1645-1649
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 1645
|
||||
- `argsNum`: `3`
|
||||
- `info`: `{0}回合内对手使用属性技能则自身下{1}次受到的攻击伤害减少{2}%`
|
||||
|
||||
### Effect 1646
|
||||
- `argsNum`: `1`
|
||||
- `info`: `全属性+{0},对手存在致命裂痕时强化效果翻倍`
|
||||
|
||||
### Effect 1647
|
||||
- `argsNum`: `4`
|
||||
- `info`: `{0}回合内每回合使用技能吸取对手最大体力的1/{1},吸取体力时若自身体力低于最大体力的1/{2}则吸取效果翻倍,对手免疫百分比伤害时额外附加{3}点真实伤害`
|
||||
|
||||
### Effect 1648
|
||||
- `argsNum`: `1`
|
||||
- `info`: `附加自身最大体力{0}%的百分比伤害并恢复等量体力值,对手存在致命裂痕时转变为等量的真实伤害`
|
||||
|
||||
### Effect 1649
|
||||
- `argsNum`: `4`
|
||||
- `info`: `{0}%概率造成的攻击伤害为{1}倍,对手每存在1层致命裂痕则概率提升{2}%,未触发则{3}回合内令对手使用的属性技能无效`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
@@ -1,35 +0,0 @@
|
||||
# Task 207: Effects 1650-1654
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 1650
|
||||
- `argsNum`: `4`
|
||||
- `info`: `命中后{0}%随机为对手任意技能散布{1}枚致命印记,若对手当前精灵致命裂痕≥{2}层则额外散布{3}枚致命印记`
|
||||
|
||||
### Effect 1651
|
||||
- `argsNum`: `2`
|
||||
- `info`: `当回合击败对手则令对手下{0}次触发致命印记真实伤害效果转变为1/{1}`
|
||||
|
||||
### Effect 1652
|
||||
- `argsNum`: `2`
|
||||
- `info`: `释放技能时自身每损失{0}%的体力值则此技能威力提升{1}点`
|
||||
|
||||
### Effect 1653
|
||||
- `argsNum`: `2`
|
||||
- `info`: `释放技能时对手每残留{0}%的体力值则此技能附加{1}点固定伤害`
|
||||
|
||||
### Effect 1654
|
||||
- `argsNum`: `1`
|
||||
- `info`: `当回合击败对手则令对手下只登场精灵首次使用的技能所附加的效果失效`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
@@ -1,36 +0,0 @@
|
||||
# Task 208: Effects 1655-1659
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 1655
|
||||
- `argsNum`: `3`
|
||||
- `info`: `{0}回合内每回合结束后{1}恢复自身所有技能{2}点PP值`
|
||||
- `param`: `25,1,1`
|
||||
|
||||
### Effect 1656
|
||||
- `argsNum`: `0`
|
||||
- `info`: `100%复制对手当回合释放的技能,若对手当回合使用的技能为攻击技能则令对手随机1个技能PP值归零,若对手当回合使用的技能为属性技能则令对手下回合先制-2`
|
||||
|
||||
### Effect 1657
|
||||
- `argsNum`: `3`
|
||||
- `info`: `己方每有一只精灵死亡则附加{0}点固定伤害,对手体力高于最大体力的1/{1}时转变为{2}点`
|
||||
|
||||
### Effect 1658
|
||||
- `argsNum`: `0`
|
||||
- `info`: `3回合内每回合80%闪避对手攻击,未触发时自身处于圣念状态则使对手随机1项技能PP值归零,自身处于邪念状态则使对手失明`
|
||||
|
||||
### Effect 1659
|
||||
- `argsNum`: `4`
|
||||
- `info`: `随机附加给对手{0}-{1}点固定伤害,若打出致命一击则效果转变为吸取对手{2}-{3}点体力`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
@@ -1,35 +0,0 @@
|
||||
# Task 210: Effects 1665-1669
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 1665
|
||||
- `argsNum`: `2`
|
||||
- `info`: `全属性+{0},自身背包内每阵亡1只精灵则{1}%的概率强化效果翻倍`
|
||||
|
||||
### Effect 1666
|
||||
- `argsNum`: `3`
|
||||
- `info`: `1回合做{0}-{1}次攻击,自身处于领域效果下连击上限为{2}`
|
||||
|
||||
### Effect 1667
|
||||
- `argsNum`: `0`
|
||||
- `info`: `开启时空漩涡,使用后必定令对手束缚且下2回合令对手无法主动切换精灵`
|
||||
|
||||
### Effect 1668
|
||||
- `argsNum`: `1`
|
||||
- `info`: `附加对手当前已损失技能PP值总和×{0}的固定伤害,若对手未受到固定伤害则额外附加等量的真实伤害`
|
||||
|
||||
### Effect 1669
|
||||
- `argsNum`: `2`
|
||||
- `info`: `全属性+{0},自身背包内每存活1只精灵则{1}%的概率强化效果翻倍`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
@@ -1,36 +0,0 @@
|
||||
# Task 233: Effects 1780-1784
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 1780
|
||||
- `argsNum`: `5`
|
||||
- `info`: `消耗自身全部体力,减少对手当前体力的1/{0},同时使己方下1只出场精灵获得点数等同于对手最大体力值1/{1}的护盾且下{2}次技能先制+{3},护盾最多可获得{4}点`
|
||||
|
||||
### Effect 1781
|
||||
- `argsNum`: `2`
|
||||
- `info`: `若自身拥有的护盾值高于{0}则令自身下{1}回合回合类效果无法被消除`
|
||||
|
||||
### Effect 1782
|
||||
- `argsNum`: `0`
|
||||
- `info`: `自身存在护盾则先制+2`
|
||||
|
||||
### Effect 1783
|
||||
- `argsNum`: `2`
|
||||
- `info`: `消除敌我双方回合类效果,消除任意一项成功则敌我双方同时进入{0}状态,若任意一方回合类效果无法被消除则令对手下{1}回合无法主动切换精灵`
|
||||
- `param`: `1,0,0`
|
||||
|
||||
### Effect 1784
|
||||
- `argsNum`: `1`
|
||||
- `info`: `{0}回合内对手使用技能时自身免疫对手下1次非致命一击造成的攻击伤害`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
@@ -1,36 +0,0 @@
|
||||
# Task 234: Effects 1785-1789
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 1785
|
||||
- `argsNum`: `3`
|
||||
- `info`: `{0}回合内每回合使用技能吸取对手最大体力的1/{1},吸取体力时若自身为满体力则恢复己方所有不在场精灵{2}点体力`
|
||||
|
||||
### Effect 1786
|
||||
- `argsNum`: `2`
|
||||
- `info`: `{0}回合内若自身回合类效果被消除则对手下{1}次使用的攻击技能附加效果失效`
|
||||
|
||||
### Effect 1787
|
||||
- `argsNum`: `1`
|
||||
- `info`: `沙之力量觉醒,使自身下{0}次攻击获得黯天之尘效果`
|
||||
|
||||
### Effect 1788
|
||||
- `argsNum`: `3`
|
||||
- `info`: `{0}%令对手{1},未触发则附加自身最大体力{2}%的百分比伤害,若对手免疫百分比伤害则转变为真实伤害`
|
||||
- `param`: `1,1,1`
|
||||
|
||||
### Effect 1789
|
||||
- `argsNum`: `1`
|
||||
- `info`: `预留,{0}`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
@@ -1,36 +0,0 @@
|
||||
# Task 295: Effects 2090-2094
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 2090
|
||||
- `argsNum`: `0`
|
||||
- `info`: `空元之诗·均:附加双方体力上限差值50%的次元·龙系伤害,自身体力上限高于对手时额外吸取对手第五技能剩余的PP值,自身体力上限低于对手时附加伤害翻倍`
|
||||
|
||||
### Effect 2091
|
||||
- `argsNum`: `1`
|
||||
- `info`: ``
|
||||
|
||||
### Effect 2092
|
||||
- `argsNum`: `2`
|
||||
- `info`: `全属性+{0}并将空妄诗章补充至与自身先制等级相等,自身没有空妄诗章时额外书写{1}篇,拥有时强化效果翻倍`
|
||||
|
||||
### Effect 2093
|
||||
- `argsNum`: `5`
|
||||
- `info`: `{0}回合内使用技能吸取对手最大体力的1/{1},自身体力低于1/{2}时效果翻倍,吸取后若对手体力未减少则{3}回合内对手{4}`
|
||||
- `param`: `23,4,4`
|
||||
|
||||
### Effect 2094
|
||||
- `argsNum`: `3`
|
||||
- `info`: `自身每有1篇空妄诗章造成的攻击伤害提升{0}%,若空妄诗章的篇数高于{1}则每有1篇额外附加{2}点真实伤害`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
@@ -1,35 +0,0 @@
|
||||
# Task 301: Effects 2120-2124
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 2120
|
||||
- `argsNum`: `2`
|
||||
- `info`: `自身为对手天敌时下{0}次受到攻击的伤害减少{1}%`
|
||||
|
||||
### Effect 2121
|
||||
- `argsNum`: `1`
|
||||
- `info`: `未击败对手则己方在场精灵吸取对手最大体力的{0}%,吸取后若对手体力未减少则延续至下回合`
|
||||
|
||||
### Effect 2122
|
||||
- `argsNum`: `2`
|
||||
- `info`: `获得{0}点护罩,护罩消失时自身所有技能PP值+{1}`
|
||||
|
||||
### Effect 2123
|
||||
- `argsNum`: `1`
|
||||
- `info`: `消除对手回合类效果,消除成功令对手感染且自身每有1点灵茉之芯额外附加中毒、睡眠、寄生中的前1种异常状态,未触发则吸取对手最大体力的1/{0}`
|
||||
|
||||
### Effect 2124
|
||||
- `argsNum`: `1`
|
||||
- `info`: `{0}%的概率造成伤害翻倍,自身处于能力提升状态或对手处于能力下降状态时概率翻倍`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
@@ -1,36 +0,0 @@
|
||||
# Task 317: Effects 2200-2204
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 2200
|
||||
- `argsNum`: `2`
|
||||
- `info`: `令双方{0},任意一方未触发则额外令对手{1}`
|
||||
- `param`: `1,0,0|1,1,1`
|
||||
|
||||
### Effect 2201
|
||||
- `argsNum`: `1`
|
||||
- `info`: `自身携带技能中含有的光系多于暗影系时{0}%令对手疲惫,暗影系多于光系时{0}%令对手害怕`
|
||||
|
||||
### Effect 2202
|
||||
- `argsNum`: `1`
|
||||
- `info`: `自身携带技能中含有的光系不少于暗影系时必定打出致命一击,暗影系不少于光系时吸取对手最大体力的1/{0}`
|
||||
|
||||
### Effect 2203
|
||||
- `argsNum`: `0`
|
||||
- `info`: `技能无效时,免疫下次对手的攻击`
|
||||
|
||||
### Effect 2204
|
||||
- `argsNum`: `2`
|
||||
- `info`: `技能威力减少{0}%,对手处于异常状态时改为提升{1}%`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
@@ -1,35 +0,0 @@
|
||||
# Task 318: Effects 2205-2209
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 2205
|
||||
- `argsNum`: `0`
|
||||
- `info`: `自身处于异常状态时,克制倍数取自身对对手、对手对自身克制倍数中的最大值`
|
||||
|
||||
### Effect 2206
|
||||
- `argsNum`: `1`
|
||||
- `info`: `{0}回合内自身能力提升状态被消除则解除自身所处的异常状态`
|
||||
|
||||
### Effect 2207
|
||||
- `argsNum`: `1`
|
||||
- `info`: `使自身所处的异常状态剩余回合数-{0}`
|
||||
|
||||
### Effect 2208
|
||||
- `argsNum`: `1`
|
||||
- `info`: `自身星盘每转动1刻技能提升{0}点威力,回返期间提升效果翻倍`
|
||||
|
||||
### Effect 2209
|
||||
- `argsNum`: `1`
|
||||
- `info`: `自身星盘每转动1刻吸取对手{0}点体力,回返期间改为汲取体力`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
@@ -1,35 +0,0 @@
|
||||
# Task 322: Effects 2225-2229
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 2225
|
||||
- `argsNum`: `1`
|
||||
- `info`: `减少对手体力上限的1/{0}`
|
||||
|
||||
### Effect 2226
|
||||
- `argsNum`: `1`
|
||||
- `info`: `解除双方所处的异常状态,解除成功则免疫下{0}次对手的攻击`
|
||||
|
||||
### Effect 2227
|
||||
- `argsNum`: `1`
|
||||
- `info`: `消除对手能力提升状态,消除成功对手下{0}回合无法主动切换精灵`
|
||||
|
||||
### Effect 2228
|
||||
- `argsNum`: `2`
|
||||
- `info`: `{0}回合内对手造成的固定伤害和百分比伤害减少{1}%`
|
||||
|
||||
### Effect 2229
|
||||
- `argsNum`: `1`
|
||||
- `info`: `{0}回合内使用技能则全属性+1,自身回合类效果、能力提升效果被消除、吸取时触发自身的登场效果`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
327
docs/fight-multi-battle-refactor-task-2026-04-04.md
Normal file
327
docs/fight-multi-battle-refactor-task-2026-04-04.md
Normal file
@@ -0,0 +1,327 @@
|
||||
# 战斗多单位模式改造交接文档(2026-04-04)
|
||||
|
||||
## 0. 2026-04-04 本轮完成情况
|
||||
|
||||
本轮已完成以下落地项:
|
||||
|
||||
- 动作提交改为按 `playerID + actorIndex` 去重,同一玩家同回合的多个上场位动作不会再互相覆盖
|
||||
- 主循环已从“双动作入口”改为“动作列表入口”,`resolveRound` 现接收并处理 `[]action.BattleActionI`
|
||||
- 回合结算增加了基于优先级和速度的统一排序,并按跨阵营动作对子顺序执行,保留现有 `enterturn(first, second)` 兼容层
|
||||
- 技能和道具的目标选择已接入 `targetIndex`,不再固定打对面 `0` 号位
|
||||
- 切宠同步改为携带 `actorIndex`,同一玩家多上场位的切宠播报不再冲突
|
||||
- 开战同步结构新增当前战斗位数组,同时保留 `Info1/Info2` 兼容旧结构
|
||||
- `FightI` 已补充 `UseSkillAt/ChangePetAt/UseItemAt/GetCurrPETAt`
|
||||
- `NewFight` 已改为包装 `NewFightWithOptions(...)`,创建阶段开始支持 option/builder 扩展
|
||||
- `Ctx` 已拆分为 `LegacySides + EffectBinding`,effect 本体上挂载上下文,并补充 `Source/Carrier/Target`
|
||||
- 核心执行链已开始迁移到真实 source/target 语义:`AddEffect`、`Exec`、`Damage`、`SetProp`、主技能结算流程会注入实际对手上下文
|
||||
- 已迁移一批公共/高复用 effect 到新语义,包括状态基类、击败触发、物攻附加状态、`1097-1101`、`680-690`、部分魂印基础逻辑
|
||||
- 本轮继续完成了 `1263-1287`、`1288-1312`、`1448-1472`、`1473-1497` 四组 effect 的迁移,已不再直接依赖 `Ctx().Our/Opp`,统一改为 `CarrierInput()/OpponentInput()` 访问当前承载侧与对位侧
|
||||
- 增加了动作队列的基础单测,覆盖“同玩家不同槽位保留”和“同槽位动作替换”
|
||||
|
||||
本轮仍保留的限制:
|
||||
|
||||
- `enterturn` 和大量 `effect/node` 逻辑仍是双动作上下文,因此当前实现采用“动作列表排序 + 跨阵营配对兼容执行”的过渡方案,而不是一次性重写所有效果系统
|
||||
- `NewFight` 仍按现有建房流程创建双方 1 个战斗位;本轮打通的是多战斗位结算骨架和接口,不是外部建房入口的全量切换
|
||||
- 大量具体 effect 仍在使用旧的 `Ctx().Our/Opp` 语义;当前已迁移的是上下文承载方式、执行链和部分公共基类,具体 effect 仍需继续分批迁移
|
||||
|
||||
### 0.1 effect 迁移增量记录
|
||||
|
||||
本轮新增完成:
|
||||
|
||||
- `logic/service/fight/effect/1263_1287.go`
|
||||
- `logic/service/fight/effect/1288_1312.go`
|
||||
- `logic/service/fight/effect/1448_1472.go`
|
||||
- `logic/service/fight/effect/1473_1497.go`
|
||||
|
||||
这两组文件当前迁移策略是:
|
||||
|
||||
- 旧语义中的 `Our` 统一视为“当前执行/承载该 effect 的输入侧”,迁移为 `CarrierInput()`
|
||||
- 旧语义中的 `Opp` 统一迁移为当前结算上下文里的对位输入侧,即 `OpponentInput()`
|
||||
- 暂不在这一轮强行把所有 effect 重写成纯 `Source/Target/Carrier` 三元语义;先保证 hostile sub-effect、回合类 effect、挂在对手身上的限制类 effect 都不再依赖 legacy 字段访问
|
||||
|
||||
### 0.2 下一批待迁移队列
|
||||
|
||||
高密度遗留文件已继续向后推进,`1448-1497` 这两个分段本轮已清理完成。
|
||||
|
||||
下一轮继续迁移时,建议直接对 effect 包执行一次全量扫描,按“仍包含 `Ctx().Our/Opp` 的 grouped file”继续往后收口,而不是再只盯固定编号段。
|
||||
|
||||
## 1. 任务目标
|
||||
|
||||
将当前战斗系统从“每回合双方各 1 个动作”的模型,改造成支持多上场位、多操作者的统一回合模型,最终支持以下 3 种战斗模式:
|
||||
|
||||
1. `1玩家:N精灵:1上场 VS 1玩家:N精灵:1上场`
|
||||
2. `N玩家:N精灵:N上场 VS N玩家:N精灵:N上场`
|
||||
3. `1玩家:N精灵:N上场 VS 1玩家:N精灵:N上场`
|
||||
|
||||
当前代码只完整支持模式 1。模式 2 和模式 3 只做了结构铺垫,还没有真正打通。
|
||||
|
||||
---
|
||||
|
||||
## 2. 当前已完成的基础改造
|
||||
|
||||
以下结构改造已经落地:
|
||||
|
||||
- `FightC.Our/Opp` 已改成数组,表示战场单位数组,不再是单对象。
|
||||
- `input.Input.CurrentPet` 已改成 `CurPet`,并且是数组。
|
||||
- `FightC.OurPlayers/OppPlayers` 已加入,用于表达操作者数组。
|
||||
- 战斗单位与操作者已解耦:
|
||||
- `Our/Opp` 表示战斗位
|
||||
- `OurPlayers/OppPlayers` 表示操作这些战斗位的玩家
|
||||
- `BattlePetEntity` 已支持绑定控制者:`ControllerUserID`
|
||||
- 动作模型已支持:
|
||||
- `ActorIndex`
|
||||
- `TargetIndex`
|
||||
- 已提供 indexed 入口:
|
||||
- `UseSkillAt(c, skillID, actorIndex, targetIndex)`
|
||||
- `ChangePetAt(c, petID, actorIndex)`
|
||||
- `UseItemAt(c, catchTime, itemID, actorIndex, targetIndex)`
|
||||
|
||||
当前默认行为仍等价于:
|
||||
|
||||
- `actorIndex = 0`
|
||||
- `targetIndex = 0`
|
||||
|
||||
也就是当前模式下仍然是操作和结算 `0` 号单位。
|
||||
|
||||
---
|
||||
|
||||
## 3. 当前未完成的核心问题
|
||||
|
||||
### 3.1 回合模型仍然是“双动作模型”
|
||||
|
||||
目前主流程仍然是每回合只处理双方两个动作,而不是处理一个动作列表。
|
||||
|
||||
关键位置:
|
||||
|
||||
- `logic/service/fight/loop.go`
|
||||
- `collectPlayerActions(...)` 只收 2 个动作
|
||||
- `resolveRound(p1Action, p2Action)` 只结算 2 个动作
|
||||
|
||||
这意味着:
|
||||
|
||||
- 模式 2 无法支持双方多个操作者或多个上场位同时行动
|
||||
- 模式 3 无法支持同一玩家控制多个上场位分别出手
|
||||
|
||||
### 3.2 动作提交仍按 `playerID` 去重
|
||||
|
||||
当前动作队列逻辑仍以 `playerID` 作为主要识别维度。
|
||||
|
||||
关键位置:
|
||||
|
||||
- `logic/service/fight/action.go`
|
||||
- `submitAction(...)`
|
||||
|
||||
这会导致:
|
||||
|
||||
- 同一玩家在同一回合给多个上场位下达动作时,动作会互相覆盖或无法完整保留
|
||||
|
||||
这一点对模式 3 是直接阻塞,对模式 2 也不够健壮。
|
||||
|
||||
### 3.3 切宠和当前上场位逻辑仍大量默认使用 `CurPet[0]`
|
||||
|
||||
虽然 `CurPet` 已经是数组,但主流程中不少逻辑仍固定操作 `0` 号位。
|
||||
|
||||
典型影响:
|
||||
|
||||
- 死亡换宠
|
||||
- 主动换宠
|
||||
- 当前出手单位检查
|
||||
- 当前目标单位检查
|
||||
|
||||
这部分需要按 `actorIndex` 或上场槽位改造。
|
||||
|
||||
### 3.4 开战协议仍然只有两个当前单位
|
||||
|
||||
当前开战下发协议仍然是双单位结构。
|
||||
|
||||
关键位置:
|
||||
|
||||
- `logic/service/fight/info/info.go`
|
||||
- `FightStartOutboundInfo`
|
||||
- 仍只有 `Info1` 和 `Info2`
|
||||
|
||||
这不适合多上场位模式。
|
||||
|
||||
### 3.5 公共接口仍是旧的单单位接口
|
||||
|
||||
关键位置:
|
||||
|
||||
- `logic/service/common/fight.go`
|
||||
- `FightI`
|
||||
|
||||
目前接口仍只有:
|
||||
|
||||
- `UseSkill(c, id)`
|
||||
- `ChangePet(c, id)`
|
||||
- `UseItem(c, cacthid, itemid)`
|
||||
|
||||
而 indexed 版本只存在于具体实现 `FightC` 上,没有进入正式接口层。
|
||||
|
||||
---
|
||||
|
||||
## 4. 当前实现与目标模式的对应关系
|
||||
|
||||
### 4.1 模式 1
|
||||
|
||||
`1玩家:N精灵:1上场 VS 1玩家:N精灵:1上场`
|
||||
|
||||
当前支持。
|
||||
|
||||
原因:
|
||||
|
||||
- 当前默认就是操作 `0` 号单位
|
||||
- 当前默认就是攻击 `0` 号目标
|
||||
- 当前回合系统仍是每边 1 个动作,这与模式 1 一致
|
||||
|
||||
### 4.2 模式 2
|
||||
|
||||
`N玩家:N精灵:N上场 VS N玩家:N精灵:N上场`
|
||||
|
||||
当前不支持。
|
||||
|
||||
直接原因:
|
||||
|
||||
- 一回合只收 2 个动作
|
||||
- 一回合只结算 2 个动作
|
||||
- 协议仍只同步 2 个当前上场位
|
||||
|
||||
### 4.3 模式 3
|
||||
|
||||
`1玩家:N精灵:N上场 VS 1玩家:N精灵:N上场`
|
||||
|
||||
当前不支持。
|
||||
|
||||
直接原因:
|
||||
|
||||
- 同一玩家的多个动作无法作为同回合动作列表完整保留
|
||||
- 主流程仍不是按动作列表统一排序和执行
|
||||
|
||||
---
|
||||
|
||||
## 5. 需要完成的工作
|
||||
|
||||
### 5.1 改造动作收集模型
|
||||
|
||||
将当前“每边 1 个动作”的模型改成“每个可操作上场位 1 个动作”的模型。
|
||||
|
||||
至少需要做到:
|
||||
|
||||
- 同一玩家可以在同一回合提交多个动作
|
||||
- 每个动作能区分是哪个上场位发出的
|
||||
- 每个动作能区分目标上场位
|
||||
|
||||
建议将动作唯一键至少扩为:
|
||||
|
||||
- `playerID`
|
||||
- `actorIndex`
|
||||
|
||||
### 5.2 改造回合结算模型
|
||||
|
||||
将当前:
|
||||
|
||||
- `resolveRound(p1Action, p2Action)`
|
||||
|
||||
改成:
|
||||
|
||||
- `resolveRound(actions []action.BattleActionI)`
|
||||
|
||||
并完成:
|
||||
|
||||
- 动作列表排序
|
||||
- 按优先级、速度等规则统一排序
|
||||
- 排序后逐个结算
|
||||
|
||||
注意:
|
||||
|
||||
- 当前 effect/node 体系里仍有大量“双动作”接口,不适合一次性全部重写
|
||||
- 建议先在主流程做兼容层,逐步过渡
|
||||
|
||||
### 5.3 按槽位处理切宠与死亡换宠
|
||||
|
||||
将当前固定 `CurPet[0]` 的逻辑改成按槽位处理:
|
||||
|
||||
- 主动换宠
|
||||
- 被动死亡换宠
|
||||
- 死亡校验
|
||||
- 出手资格判断
|
||||
|
||||
### 5.4 增加开战与战斗同步结构
|
||||
|
||||
将当前的双单位同步结构扩成可支持多上场位的结构。但是保持协议结构不变。现在是固定两个,可以改成数组来实现
|
||||
|
||||
重点是:
|
||||
|
||||
- 开战协议
|
||||
- 当前上场位同步
|
||||
- 切宠同步
|
||||
- 可能的回合播报结构
|
||||
|
||||
### 5.5 补齐公共接口
|
||||
|
||||
将 indexed 版本能力补进接口层,避免只能通过具体实现类型访问。
|
||||
|
||||
建议新增类似接口:
|
||||
|
||||
- `UseSkillAt(...)`
|
||||
- `ChangePetAt(...)`
|
||||
- `UseItemAt(...)`
|
||||
|
||||
---
|
||||
|
||||
## 6. 推荐实施顺序
|
||||
|
||||
建议按下面顺序推进,避免一次性改动面过大:
|
||||
|
||||
1. 先改动作队列和动作收集逻辑
|
||||
2. 再改回合结算为动作列表
|
||||
3. 再改切宠和死亡换宠按槽位处理
|
||||
4. 最后改协议和正式接口
|
||||
|
||||
不建议一开始就全量重写 effect/node 接口,因为当前大量效果实现仍假设双动作上下文。
|
||||
|
||||
---
|
||||
|
||||
## 7. 建议重点查看文件
|
||||
|
||||
- `logic/service/fight/action.go`
|
||||
- `logic/service/fight/loop.go`
|
||||
- `logic/service/fight/fightc.go`
|
||||
- `logic/service/fight/input.go`
|
||||
- `logic/service/fight/input/input.go`
|
||||
- `logic/service/fight/action/BattleAction.go`
|
||||
- `logic/service/fight/info/info.go`
|
||||
- `logic/service/common/fight.go`
|
||||
|
||||
---
|
||||
|
||||
## 8. 完成标准
|
||||
|
||||
至少满足以下条件,才算这次改造完成:
|
||||
|
||||
1. 同一玩家可以在同一回合给多个上场位分别提交动作,动作不会互相覆盖
|
||||
2. 双方多个上场位可以在同一回合统一排序并依次结算
|
||||
3. 攻击目标位可选,不再默认只能打对面 `0` 号
|
||||
4. 切宠可以按上场槽位处理
|
||||
5. 模式 1 不回归
|
||||
6. 代码编译通过
|
||||
|
||||
---
|
||||
|
||||
## 9. 最低验证要求
|
||||
|
||||
至少执行:
|
||||
|
||||
- `cd /workspace/logic && go build ./...`
|
||||
- `cd /workspace/logic && go test ./service/fight/effect`
|
||||
|
||||
如果本轮改动较大,建议再补一轮:
|
||||
|
||||
- `cd /workspace/logic && go test ./...`
|
||||
|
||||
---
|
||||
|
||||
## 10. 额外提醒
|
||||
|
||||
- 当前仓库工作区可能是脏的,不要回滚无关修改。
|
||||
- 这次改造的真正核心不是结构字段改数组,而是把回合系统从“双动作模型”改成“动作列表模型”。
|
||||
- 已有 `ActorIndex/TargetIndex` 只是入口铺垫,不代表多单位模式已经完成。
|
||||
@@ -23,5 +23,5 @@ type InInfo struct { //这里直接使用组合来实现将传入的原始头部
|
||||
|
||||
// OutInfo 表示系统时间的出站消息
|
||||
type OutInfo struct {
|
||||
SystemTime uint32 `json:"systemTime"` // @UInt long类型
|
||||
SystemTime uint32 `json:"systemTime"`
|
||||
}
|
||||
|
||||
@@ -8,15 +8,19 @@ import (
|
||||
type FightI interface {
|
||||
Over(c PlayerI, id model.EnumBattleOverReason) //逃跑
|
||||
UseSkill(c PlayerI, id uint32) //使用技能
|
||||
GetCurrPET(c PlayerI) *info.BattlePetEntity //当前精灵
|
||||
UseSkillAt(c PlayerI, id uint32, actorIndex, targetIndex int)
|
||||
GetCurrPET(c PlayerI) *info.BattlePetEntity //当前精灵
|
||||
GetCurrPETAt(c PlayerI, actorIndex int) *info.BattlePetEntity
|
||||
GetOverInfo() model.FightOverInfo
|
||||
Ownerid() uint32
|
||||
ReadyFight(c PlayerI) //是否准备战斗
|
||||
ChangePet(c PlayerI, id uint32)
|
||||
ChangePetAt(c PlayerI, id uint32, actorIndex int)
|
||||
Capture(c PlayerI, id uint32)
|
||||
|
||||
LoadPercent(c PlayerI, percent int32)
|
||||
UseItem(c PlayerI, cacthid, itemid uint32)
|
||||
UseItemAt(c PlayerI, cacthid, itemid uint32, actorIndex, targetIndex int)
|
||||
Chat(c PlayerI, msg string)
|
||||
IsFirst(c PlayerI) bool
|
||||
GetOverChan() chan struct{}
|
||||
|
||||
@@ -6,12 +6,16 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/modules/player/model"
|
||||
|
||||
"github.com/jinzhu/copier"
|
||||
)
|
||||
|
||||
// Compare 比较两个1v1战斗动作的执行优先级(核心逻辑)
|
||||
func (*FightC) Compare(a, b action.BattleActionI) (action.BattleActionI, action.BattleActionI) {
|
||||
// Compare 比较两个战斗动作的执行优先级
|
||||
func (f *FightC) Compare(a, b action.BattleActionI) (action.BattleActionI, action.BattleActionI) {
|
||||
if a == nil {
|
||||
return b, a
|
||||
}
|
||||
if b == nil {
|
||||
return a, b
|
||||
}
|
||||
// 动作本身的优先级比较
|
||||
p1 := b.Priority() - a.Priority()
|
||||
if p1 > 0 { // 对手优先级更高
|
||||
@@ -20,11 +24,22 @@ func (*FightC) Compare(a, b action.BattleActionI) (action.BattleActionI, action.
|
||||
return a, b
|
||||
}
|
||||
|
||||
if speedA, speedB := f.actionSpeed(a), f.actionSpeed(b); speedA.Cmp(speedB) != 0 {
|
||||
if speedA.Cmp(speedB) > 0 {
|
||||
return a, b
|
||||
}
|
||||
return b, a
|
||||
}
|
||||
if a.GetActorIndex() != b.GetActorIndex() {
|
||||
if a.GetActorIndex() < b.GetActorIndex() {
|
||||
return a, b
|
||||
}
|
||||
return b, a
|
||||
}
|
||||
|
||||
return a, b // 速度相同时,发起方优先
|
||||
}
|
||||
|
||||
const maxPendingActionsPerPlayer = 2
|
||||
|
||||
func (f *FightC) openActionWindow() {
|
||||
f.actionMu.Lock()
|
||||
f.acceptActions = true
|
||||
@@ -39,6 +54,7 @@ func (f *FightC) closeActionWindow() {
|
||||
f.pendingActions = f.pendingActions[:0]
|
||||
f.actionRound.Store(0)
|
||||
f.actionMu.Unlock()
|
||||
|
||||
}
|
||||
|
||||
func (f *FightC) submitAction(act action.BattleActionI) {
|
||||
@@ -57,16 +73,15 @@ func (f *FightC) submitAction(act action.BattleActionI) {
|
||||
f.actionMu.Unlock()
|
||||
return
|
||||
}
|
||||
count := 0
|
||||
replaceIndex := -1
|
||||
for i, pending := range f.pendingActions {
|
||||
if pending == nil || pending.GetPlayerID() != act.GetPlayerID() {
|
||||
if pending == nil || actionSlotKeyFromAction(pending) != actionSlotKeyFromAction(act) {
|
||||
continue
|
||||
}
|
||||
count++
|
||||
replaceIndex = i
|
||||
break
|
||||
}
|
||||
if count >= maxPendingActionsPerPlayer && replaceIndex >= 0 {
|
||||
if replaceIndex >= 0 {
|
||||
f.pendingActions[replaceIndex] = act
|
||||
} else {
|
||||
f.pendingActions = append(f.pendingActions, act)
|
||||
@@ -223,6 +238,10 @@ func (f *FightC) Capture(c common.PlayerI, id uint32) {
|
||||
|
||||
}
|
||||
|
||||
func (f *FightC) c(c common.PlayerI, cacthid, itemid uint32) {
|
||||
f.UseItemAt(c, cacthid, itemid, 0, 0)
|
||||
}
|
||||
|
||||
func (f *FightC) UseItem(c common.PlayerI, cacthid, itemid uint32) {
|
||||
f.UseItemAt(c, cacthid, itemid, 0, 0)
|
||||
}
|
||||
@@ -258,21 +277,51 @@ func (f *FightC) ReadyFight(c common.PlayerI) {
|
||||
|
||||
// buildFightStartInfo 构建战斗开始时需要发送给双方的信息
|
||||
func (f *FightC) buildFightStartInfo() info.FightStartOutboundInfo {
|
||||
var startInfo info.FightStartOutboundInfo
|
||||
|
||||
// 复制双方初始宠物信息(取列表第一个宠物)
|
||||
if len(f.ReadyInfo.OurPetList) > 0 {
|
||||
_ = copier.Copy(&startInfo.Info1, &f.ReadyInfo.OurPetList[0])
|
||||
startInfo.Info1.UserID = f.ReadyInfo.OurInfo.UserID
|
||||
startInfo := info.FightStartOutboundInfo{}
|
||||
ourInfos := f.collectFightPetInfos(f.Our)
|
||||
oppInfos := f.collectFightPetInfos(f.Opp)
|
||||
startInfo.Infos = append(startInfo.Infos, ourInfos...)
|
||||
startInfo.Infos = append(startInfo.Infos, oppInfos...)
|
||||
startInfo.InfoLen = uint32(len(startInfo.Infos))
|
||||
if len(ourInfos) > 0 {
|
||||
startInfo.Info1 = ourInfos[0]
|
||||
}
|
||||
if len(f.ReadyInfo.OpponentPetList) > 0 {
|
||||
_ = copier.Copy(&startInfo.Info2, &f.ReadyInfo.OpponentPetList[0])
|
||||
startInfo.Info2.UserID = f.ReadyInfo.OpponentInfo.UserID
|
||||
if len(oppInfos) > 0 {
|
||||
startInfo.Info2 = oppInfos[0]
|
||||
}
|
||||
|
||||
return startInfo
|
||||
}
|
||||
|
||||
func (f *FightC) collectFightPetInfos(inputs []*input.Input) []info.FightPetInfo {
|
||||
infos := make([]info.FightPetInfo, 0, len(inputs))
|
||||
for actorIndex, fighter := range inputs {
|
||||
if fighter == nil || fighter.Player == nil {
|
||||
continue
|
||||
}
|
||||
currentPet := fighter.PrimaryCurPet()
|
||||
if currentPet == nil {
|
||||
continue
|
||||
}
|
||||
fightInfo := info.FightPetInfo{
|
||||
UserID: fighter.Player.GetInfo().UserID,
|
||||
ActorIndex: uint32(actorIndex),
|
||||
ControllerUserID: currentPet.ControllerUserID,
|
||||
ID: currentPet.Info.ID,
|
||||
Name: currentPet.Info.Name,
|
||||
CatchTime: currentPet.Info.CatchTime,
|
||||
Hp: currentPet.Info.Hp,
|
||||
MaxHp: currentPet.Info.MaxHp,
|
||||
Level: currentPet.Info.Level,
|
||||
Catchable: uint32(fighter.CanCapture),
|
||||
}
|
||||
if fighter.AttackValue != nil {
|
||||
fightInfo.Prop = fighter.AttackValue.Prop
|
||||
}
|
||||
infos = append(infos, fightInfo)
|
||||
}
|
||||
return infos
|
||||
}
|
||||
|
||||
// checkBothPlayersReady 检查PVP战斗中双方是否都已准备完成
|
||||
// 参数c为当前准备的玩家,返回true表示双方均准备完成
|
||||
func (f *FightC) checkBothPlayersReady(currentPlayer common.PlayerI) bool {
|
||||
|
||||
45
logic/service/fight/action_test.go
Normal file
45
logic/service/fight/action_test.go
Normal file
@@ -0,0 +1,45 @@
|
||||
package fight
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/action"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSubmitActionKeepsDifferentActorSlots(t *testing.T) {
|
||||
f := &FightC{
|
||||
acceptActions: true,
|
||||
pendingActions: make([]action.BattleActionI, 0, 4),
|
||||
}
|
||||
f.actionRound.Store(1)
|
||||
|
||||
first := &action.SelectSkillAction{BaseAction: action.BaseAction{PlayerID: 1001, ActorIndex: 0}}
|
||||
second := &action.SelectSkillAction{BaseAction: action.BaseAction{PlayerID: 1001, ActorIndex: 1}}
|
||||
|
||||
f.submitAction(first)
|
||||
f.submitAction(second)
|
||||
|
||||
if got := len(f.pendingActions); got != 2 {
|
||||
t.Fatalf("expected 2 pending actions, got %d", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSubmitActionReplacesSameActorSlot(t *testing.T) {
|
||||
f := &FightC{
|
||||
acceptActions: true,
|
||||
pendingActions: make([]action.BattleActionI, 0, 4),
|
||||
}
|
||||
f.actionRound.Store(1)
|
||||
|
||||
first := &action.SelectSkillAction{BaseAction: action.BaseAction{PlayerID: 1001, ActorIndex: 0}}
|
||||
replacement := &action.SelectSkillAction{BaseAction: action.BaseAction{PlayerID: 1001, ActorIndex: 0, TargetIndex: 1}}
|
||||
|
||||
f.submitAction(first)
|
||||
f.submitAction(replacement)
|
||||
|
||||
if got := len(f.pendingActions); got != 1 {
|
||||
t.Fatalf("expected 1 pending action, got %d", got)
|
||||
}
|
||||
if f.pendingActions[0] != replacement {
|
||||
t.Fatalf("expected replacement action to be kept")
|
||||
}
|
||||
}
|
||||
@@ -21,13 +21,14 @@ func (e *NewSel0) SwitchOut(in *input.Input) bool {
|
||||
return true
|
||||
}
|
||||
func (e *NewSel0) IsOwner() bool {
|
||||
if e.Ctx().Our == nil {
|
||||
source := e.SourceInput()
|
||||
if source == nil {
|
||||
return false
|
||||
}
|
||||
if e.Ctx().Our.CurPet[0] == nil {
|
||||
if source.CurPet[0] == nil {
|
||||
return false
|
||||
}
|
||||
return e.ID().GetCatchTime() == e.Ctx().Our.CurPet[0].Info.CatchTime
|
||||
return e.ID().GetCatchTime() == source.CurPet[0].Info.CatchTime
|
||||
}
|
||||
|
||||
// 免疫"能力(battle_lv)下降"
|
||||
@@ -41,7 +42,7 @@ func (e *NewSel1) PropBefer(in *input.Input, prop int8, level int8) bool {
|
||||
if !e.IsOwner() {
|
||||
return true
|
||||
}
|
||||
if in == e.Ctx().Our {
|
||||
if in == e.SourceInput() {
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ func (e *NewSel2) EFFect_Befer(in *input.Input, effEffect input.Effect) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
if in != e.Ctx().Opp {
|
||||
if in != e.OpponentInput() {
|
||||
return true
|
||||
}
|
||||
if input.IS_Stat(effEffect) {
|
||||
|
||||
@@ -64,8 +64,8 @@ type ARENA_OWENR_ACCE struct {
|
||||
// 表示"宠物王加入"的入站消息数据
|
||||
type PetKingJoinInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2413" struc:"skip"`
|
||||
Type uint32 // 战斗类型:5=单精灵,6=多精灵,11=精灵大师赛 (对应Java的@UInt long type)
|
||||
FightType uint32 // 仅当Type为11时有效 (对应Java的@UInt long fightType)
|
||||
Type uint32 // 战斗类型:5=单精灵,6=多精灵,11=精灵大师赛
|
||||
FightType uint32 // 仅当Type为11时有效
|
||||
}
|
||||
|
||||
// HandleFightInviteInboundInfo 处理战斗邀请的入站消息
|
||||
@@ -122,13 +122,13 @@ type LoadPercentInboundInfo struct {
|
||||
type UsePetItemInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2406" struc:"skip"`
|
||||
// 字段首字母大写以导出(对应Java的可访问性,配合@Data的getter/setter)
|
||||
CatchTime uint32 `description:"精灵捕获时间" codec:"catchTime"` // @UInt long 对应Go的uint32(无符号64位)
|
||||
CatchTime uint32 `description:"精灵捕获时间" codec:"catchTime"`
|
||||
ItemId uint32 `description:"使用的物品ID" codec:"itemId"` // 结构体标签模拟@FieldDescription和@AutoCodec注解
|
||||
Reversed1 uint32 `description:"填充字段 0" codec:"reversed1"` // reversed1对应原Java的填充字段
|
||||
}
|
||||
type ChatInfo struct {
|
||||
Head common.TomeeHeader `cmd:"50002" struc:"skip"`
|
||||
Reserve uint32 `json:"reserve" fieldDescription:"填充 默认值为0" uint:"true"` // @UInt long reserve,无符号长整数
|
||||
Reserve uint32 `json:"reserve" fieldDescription:"填充 默认值为0" uint:"true"`
|
||||
MessageLen uint32 `struc:"sizeof=Message"`
|
||||
Message string `json:"message" fieldDescription:"消息内容, 结束符为utf-8的数字0"` // 消息内容,包含utf-8空字符('\x00')作为结束符
|
||||
}
|
||||
|
||||
@@ -17,11 +17,11 @@ type Effect1044 struct {
|
||||
func (e *Effect1044) OnSkill() bool {
|
||||
// 检查对手是否有能力提升状态可以吸取
|
||||
|
||||
for i, v := range e.Ctx().Opp.Prop[:] {
|
||||
for i, v := range e.OpponentInput().Prop[:] {
|
||||
if v > 0 {
|
||||
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) {
|
||||
if e.OpponentInput().SetProp(e.CarrierInput(), int8(i), 0) {
|
||||
e.can = true
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), v)
|
||||
e.CarrierInput().SetProp(e.CarrierInput(), int8(i), v)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,52 +21,57 @@ type Effect1097 struct {
|
||||
}
|
||||
|
||||
func (e *Effect1097) Skill_Use() bool {
|
||||
source := e.SourceInput()
|
||||
target := e.OpponentInput()
|
||||
if source == nil || target == nil {
|
||||
return true
|
||||
}
|
||||
skill := e.Ctx().SkillEntity
|
||||
if skill == nil || skill.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
|
||||
if skill.AttackTime != 0 && e.Ctx().Our.SumDamage.Cmp(alpacadecimal.NewFromInt(280)) < 0 {
|
||||
tiredEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(info.PetStatus.Tired))
|
||||
if skill.AttackTime != 0 && source.SumDamage.Cmp(alpacadecimal.NewFromInt(280)) < 0 {
|
||||
tiredEffect := source.InitEffect(input.EffectType.Status, int(info.PetStatus.Tired))
|
||||
if tiredEffect != nil {
|
||||
tiredEffect.Duration(1)
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, tiredEffect)
|
||||
target.AddEffect(source, tiredEffect)
|
||||
}
|
||||
}
|
||||
|
||||
if e.Ctx().Opp.CurPet[0].Info.Hp > 0 {
|
||||
disableAttack := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1097, 1, 0)
|
||||
if target.CurPet[0].Info.Hp > 0 {
|
||||
disableAttack := source.InitEffect(input.EffectType.Sub, 1097, 1, 0)
|
||||
if disableAttack != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, disableAttack)
|
||||
target.AddEffect(source, disableAttack)
|
||||
}
|
||||
}
|
||||
|
||||
if e.starFuryActive {
|
||||
if e.Ctx().Opp.CurPet[0].Info.Hp <= 0 {
|
||||
if target.CurPet[0].Info.Hp <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
success, _, _ := e.Input.Player.Roll(50, 100)
|
||||
success, _, _ := source.Player.Roll(50, 100)
|
||||
if success {
|
||||
blindEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(info.PetStatus.Blind))
|
||||
blindEffect := source.InitEffect(input.EffectType.Status, int(info.PetStatus.Blind))
|
||||
if blindEffect != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, blindEffect)
|
||||
target.AddEffect(source, blindEffect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
disableStatus := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1097, 2, 1)
|
||||
disableStatus := source.InitEffect(input.EffectType.Sub, 1097, 2, 1)
|
||||
if disableStatus != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, disableStatus)
|
||||
target.AddEffect(source, disableStatus)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
if e.Ctx().Opp.CurPet[0].Info.Hp <= 0 {
|
||||
if target.CurPet[0].Info.Hp <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
success, _, _ := e.Input.Player.Roll(50, 100)
|
||||
success, _, _ := source.Player.Roll(50, 100)
|
||||
if !success {
|
||||
return true
|
||||
}
|
||||
@@ -80,7 +85,7 @@ func (e *Effect1097) Skill_Use() bool {
|
||||
}
|
||||
|
||||
e.starFuryActive = true
|
||||
executeExtraSkill(e.Ctx().Our, e.Ctx().Opp, furySkill)
|
||||
executeExtraSkill(source, target, furySkill)
|
||||
e.starFuryActive = false
|
||||
return true
|
||||
}
|
||||
@@ -153,11 +158,15 @@ func (e *Effect1098) SetArgs(t *input.Input, a ...int) {
|
||||
}
|
||||
|
||||
func (e *Effect1098) SkillHit() bool {
|
||||
source := e.SourceInput()
|
||||
if source == nil {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
|
||||
success, _, _ := e.Input.Player.Roll(e.critChance, 100)
|
||||
success, _, _ := source.Player.Roll(e.critChance, 100)
|
||||
if success {
|
||||
e.Ctx().SkillEntity.XML.CritRate = 16
|
||||
}
|
||||
@@ -165,6 +174,11 @@ func (e *Effect1098) SkillHit() bool {
|
||||
}
|
||||
|
||||
func (e *Effect1098) Skill_Use() bool {
|
||||
source := e.SourceInput()
|
||||
target := e.OpponentInput()
|
||||
if source == nil || target == nil {
|
||||
return true
|
||||
}
|
||||
skill := e.Ctx().SkillEntity
|
||||
if skill == nil {
|
||||
return true
|
||||
@@ -181,18 +195,18 @@ func (e *Effect1098) Skill_Use() bool {
|
||||
}
|
||||
|
||||
if e.starFuryActive {
|
||||
priorityEffect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1098, 2)
|
||||
priorityEffect := source.InitEffect(input.EffectType.Sub, 1098, 2)
|
||||
if priorityEffect != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, priorityEffect)
|
||||
source.AddEffect(source, priorityEffect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
if e.Ctx().Opp.CurPet[0].Info.Hp <= 0 {
|
||||
if target.CurPet[0].Info.Hp <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
success, _, _ := e.Input.Player.Roll(50, 100)
|
||||
success, _, _ := source.Player.Roll(50, 100)
|
||||
if !success {
|
||||
return true
|
||||
}
|
||||
@@ -210,7 +224,7 @@ func (e *Effect1098) Skill_Use() bool {
|
||||
}
|
||||
|
||||
e.starFuryActive = true
|
||||
executeExtraSkill(e.Ctx().Our, e.Ctx().Opp, furySkill)
|
||||
executeExtraSkill(source, target, furySkill)
|
||||
e.starFuryActive = false
|
||||
return true
|
||||
}
|
||||
@@ -235,7 +249,11 @@ func (e *Effect1098Sub) ComparePre(fattack, sattack *action.SelectSkillAction) b
|
||||
return true
|
||||
}
|
||||
|
||||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||||
source := e.SourceInput()
|
||||
if source == nil {
|
||||
return true
|
||||
}
|
||||
current := actionByPlayer(fattack, sattack, source.UserID)
|
||||
if current == nil || current.SkillEntity == nil || current.SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
@@ -254,12 +272,17 @@ type Effect1099 struct {
|
||||
}
|
||||
|
||||
func (e *Effect1099) Skill_Use() bool {
|
||||
source := e.SourceInput()
|
||||
target := e.OpponentInput()
|
||||
if source == nil || target == nil {
|
||||
return true
|
||||
}
|
||||
cleared := false
|
||||
for i, level := range e.Ctx().Opp.Prop[:] {
|
||||
for i, level := range target.Prop[:] {
|
||||
if level <= 0 {
|
||||
continue
|
||||
}
|
||||
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) {
|
||||
if target.SetProp(source, int8(i), 0) {
|
||||
cleared = true
|
||||
}
|
||||
}
|
||||
@@ -267,9 +290,9 @@ func (e *Effect1099) Skill_Use() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
immuneEffect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1099, int(e.Args()[0].IntPart()))
|
||||
immuneEffect := source.InitEffect(input.EffectType.Sub, 1099, int(e.Args()[0].IntPart()))
|
||||
if immuneEffect != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, immuneEffect)
|
||||
source.AddEffect(source, immuneEffect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -293,7 +316,7 @@ func (e *Effect1099Sub) EFFect_Befer(in *input.Input, effEffect input.Effect) bo
|
||||
e.Alive(false)
|
||||
return true
|
||||
}
|
||||
if in != e.Ctx().Opp || !input.IS_Stat(effEffect) {
|
||||
if in != e.OpponentInput() || !input.IS_Stat(effEffect) {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -311,23 +334,33 @@ type Effect1100 struct {
|
||||
}
|
||||
|
||||
func (e *Effect1100) Skill_Use_ex() bool {
|
||||
source := e.SourceInput()
|
||||
target := e.OpponentInput()
|
||||
if source == nil || target == nil {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
|
||||
e.triggered = true
|
||||
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, randomStatus1100())
|
||||
statusEffect := source.InitEffect(input.EffectType.Status, randomStatus1100())
|
||||
if statusEffect != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
||||
target.AddEffect(source, statusEffect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1100) TurnEnd() {
|
||||
source := e.SourceInput()
|
||||
if !e.triggered && e.Duration() == 1 {
|
||||
boostEffect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1100, int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()))
|
||||
if source == nil {
|
||||
e.EffectNode.TurnEnd()
|
||||
return
|
||||
}
|
||||
boostEffect := source.InitEffect(input.EffectType.Sub, 1100, int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()))
|
||||
if boostEffect != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, boostEffect)
|
||||
source.AddEffect(source, boostEffect)
|
||||
}
|
||||
}
|
||||
e.EffectNode.TurnEnd()
|
||||
@@ -364,6 +397,8 @@ type Effect1101 struct {
|
||||
}
|
||||
|
||||
func (e *Effect1101) DamageFloor(zone *info.DamageZone) bool {
|
||||
source := e.SourceInput()
|
||||
target := e.OpponentInput()
|
||||
if zone == nil || zone.Type != info.DamageType.Red {
|
||||
return true
|
||||
}
|
||||
@@ -371,22 +406,33 @@ func (e *Effect1101) DamageFloor(zone *info.DamageZone) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
|
||||
if source == nil {
|
||||
return true
|
||||
}
|
||||
success, _, _ := source.Player.Roll(int(e.Args()[0].IntPart()), 100)
|
||||
if !success {
|
||||
return true
|
||||
}
|
||||
|
||||
zone.Damage = e.Ctx().Opp.CurPet[0].GetMaxHP()
|
||||
if target == nil {
|
||||
return true
|
||||
}
|
||||
zone.Damage = target.CurPet[0].GetMaxHP()
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1101) Skill_Use() bool {
|
||||
source := e.SourceInput()
|
||||
target := e.OpponentInput()
|
||||
if source == nil || target == nil {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.AttackTime == 0 {
|
||||
e.Ctx().Our.CurPet[0].Info.Hp = 0
|
||||
source.CurPet[0].Info.Hp = 0
|
||||
}
|
||||
|
||||
zeroRandomSkillPP(e.Ctx().Opp, int(e.Args()[1].IntPart()))
|
||||
applyAllPropDown(e.Ctx().Our, e.Ctx().Opp, int8(e.Args()[2].IntPart()))
|
||||
zeroRandomSkillPP(target, int(e.Args()[1].IntPart()))
|
||||
applyAllPropDown(source, target, int8(e.Args()[2].IntPart()))
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -398,13 +444,13 @@ func executeExtraSkill(attacker, defender *input.Input, skill *info.SkillEntity)
|
||||
skill.XML.MustHit = 1
|
||||
skill.AttackTimeC(attacker.Prop[5])
|
||||
|
||||
defender.Exec(func(effect input.Effect) bool {
|
||||
defender.ExecWithOpponent(attacker, func(effect input.Effect) bool {
|
||||
effect.Ctx().SkillEntity = skill
|
||||
effect.SkillHit_ex()
|
||||
return true
|
||||
})
|
||||
|
||||
attacker.Exec(func(effect input.Effect) bool {
|
||||
attacker.ExecWithOpponent(defender, func(effect input.Effect) bool {
|
||||
effect.Ctx().SkillEntity = skill
|
||||
effect.SkillHit()
|
||||
return true
|
||||
@@ -415,7 +461,7 @@ func executeExtraSkill(attacker, defender *input.Input, skill *info.SkillEntity)
|
||||
originalProps[0], originalProps[1] = attacker.Prop, defender.Prop
|
||||
originalPetInfo[0], originalPetInfo[1] = attacker.CurPet[0].Info, defender.CurPet[0].Info
|
||||
|
||||
attacker.Exec(func(effect input.Effect) bool {
|
||||
attacker.ExecWithOpponent(defender, func(effect input.Effect) bool {
|
||||
effect.Ctx().SkillEntity = skill
|
||||
effect.CalculatePre()
|
||||
return true
|
||||
@@ -440,7 +486,7 @@ func executeExtraSkill(attacker, defender *input.Input, skill *info.SkillEntity)
|
||||
sumDamage = sumDamage.Mul(alpacadecimal.NewFromInt(2))
|
||||
}
|
||||
|
||||
attacker.Exec(func(effect input.Effect) bool {
|
||||
attacker.ExecWithOpponent(defender, func(effect input.Effect) bool {
|
||||
effect.Ctx().SkillEntity = skill
|
||||
effect.OnSkill()
|
||||
return true
|
||||
@@ -452,7 +498,7 @@ func executeExtraSkill(attacker, defender *input.Input, skill *info.SkillEntity)
|
||||
})
|
||||
|
||||
if defender.CurPet[0].Info.Hp > 0 {
|
||||
defender.Exec(func(effect input.Effect) bool {
|
||||
defender.ExecWithOpponent(attacker, func(effect input.Effect) bool {
|
||||
effect.Ctx().SkillEntity = skill
|
||||
effect.Skill_Use_ex()
|
||||
return true
|
||||
@@ -460,19 +506,19 @@ func executeExtraSkill(attacker, defender *input.Input, skill *info.SkillEntity)
|
||||
}
|
||||
|
||||
if attacker.CurPet[0].Info.Hp > 0 {
|
||||
attacker.Exec(func(effect input.Effect) bool {
|
||||
attacker.ExecWithOpponent(defender, func(effect input.Effect) bool {
|
||||
effect.Ctx().SkillEntity = skill
|
||||
effect.Skill_Use()
|
||||
return true
|
||||
})
|
||||
}
|
||||
|
||||
defender.Exec(func(effect input.Effect) bool {
|
||||
defender.ExecWithOpponent(attacker, func(effect input.Effect) bool {
|
||||
effect.Ctx().SkillEntity = skill
|
||||
effect.Action_end_ex()
|
||||
return true
|
||||
})
|
||||
attacker.Exec(func(effect input.Effect) bool {
|
||||
attacker.ExecWithOpponent(defender, func(effect input.Effect) bool {
|
||||
effect.Ctx().SkillEntity = skill
|
||||
effect.Action_end()
|
||||
return true
|
||||
|
||||
@@ -19,7 +19,7 @@ type Effect1146 struct {
|
||||
func (e *Effect1146) OnSkill() bool {
|
||||
// 1. 命中判定失败,不触发
|
||||
count := 0
|
||||
for _, v := range e.Ctx().Opp.Prop[:] {
|
||||
for _, v := range e.OpponentInput().Prop[:] {
|
||||
if v > 0 {
|
||||
count++
|
||||
}
|
||||
@@ -29,7 +29,7 @@ func (e *Effect1146) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: e.Args()[1],
|
||||
})
|
||||
|
||||
@@ -63,17 +63,17 @@ func (e *Effect1263) Skill_Use() bool {
|
||||
}
|
||||
|
||||
divisor := e.Args()[0]
|
||||
if e.Ctx().Our.CurPet[0].GetHP().Cmp(e.Ctx().Opp.CurPet[0].GetHP()) < 0 {
|
||||
if e.CarrierInput().CurPet[0].GetHP().Cmp(e.OpponentInput().CurPet[0].GetHP()) < 0 {
|
||||
divisor = e.Args()[1]
|
||||
}
|
||||
|
||||
damage := e.Ctx().Opp.CurPet[0].GetMaxHP().Div(divisor)
|
||||
damage := e.OpponentInput().CurPet[0].GetMaxHP().Div(divisor)
|
||||
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)
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, damage)
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -95,9 +95,9 @@ func (e *Effect1265) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 {
|
||||
return true
|
||||
}
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1265, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
||||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1265, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
||||
if effect != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), effect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -142,9 +142,9 @@ func (e *Effect1266) Skill_Use_ex() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1266, int(e.Args()[1].IntPart()))
|
||||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1266, int(e.Args()[1].IntPart()))
|
||||
if effect != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, effect)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), effect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -191,13 +191,13 @@ func (e *Effect1267) Skill_Use_ex() bool {
|
||||
}
|
||||
|
||||
e.triggered = true
|
||||
applyOneOfStatuses(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
|
||||
applyOneOfStatuses(e.CarrierInput(), e.OpponentInput(), int(e.Args()[1].IntPart()))
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1267) TurnEnd() {
|
||||
if !e.triggered && e.Duration() == 1 {
|
||||
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
|
||||
e.OpponentInput().CancelTurn(e.CarrierInput())
|
||||
}
|
||||
e.EffectNode.TurnEnd()
|
||||
}
|
||||
@@ -208,12 +208,12 @@ type Effect1268 struct {
|
||||
}
|
||||
|
||||
func (e *Effect1268) Skill_Use() bool {
|
||||
if len(e.Args()) == 0 || e.Ctx().Opp.CurPet[0].Info.Hp > 0 {
|
||||
if len(e.Args()) == 0 || e.OpponentInput().CurPet[0].Info.Hp > 0 {
|
||||
return true
|
||||
}
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1268, int(e.Args()[0].IntPart()))
|
||||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1268, int(e.Args()[0].IntPart()))
|
||||
if effect != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), effect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -232,7 +232,7 @@ func (e *Effect1268Sub) TurnStart(fattack, sattack *action.SelectSkillAction) {
|
||||
e.Alive(false)
|
||||
return
|
||||
}
|
||||
applyOneOfStatuses(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
|
||||
applyOneOfStatuses(e.CarrierInput(), e.OpponentInput(), int(e.Args()[0].IntPart()))
|
||||
e.Alive(false)
|
||||
}
|
||||
|
||||
@@ -246,12 +246,12 @@ func (e *Effect1269) SkillHit_ex() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
damage := e.Ctx().Opp.CurPet[0].GetMaxHP().Div(e.Args()[1])
|
||||
damage := e.OpponentInput().CurPet[0].GetMaxHP().Div(e.Args()[1])
|
||||
if damage.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, damage)
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -266,12 +266,12 @@ func (e *Effect1270) OnSkill() bool {
|
||||
}
|
||||
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()))
|
||||
applyStatusByID(e.CarrierInput(), e.OpponentInput(), int(e.Args()[1].IntPart()))
|
||||
return true
|
||||
}
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1270, int(e.Args()[2].IntPart()))
|
||||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1270, int(e.Args()[2].IntPart()))
|
||||
if effect != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, effect)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), effect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -319,14 +319,14 @@ func (e *Effect1271) OnSkill() bool {
|
||||
|
||||
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()))
|
||||
applyStatusByID(e.CarrierInput(), e.OpponentInput(), int(e.Args()[2].IntPart()))
|
||||
e.triggered = true
|
||||
return true
|
||||
}
|
||||
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1271, int(e.Args()[3].IntPart()), int(e.Args()[4].IntPart()), int(e.Args()[5].IntPart()))
|
||||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1271, int(e.Args()[3].IntPart()), int(e.Args()[4].IntPart()), int(e.Args()[5].IntPart()))
|
||||
if effect != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), effect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -351,7 +351,7 @@ func (e *Effect1271Sub) OnSkill() bool {
|
||||
}
|
||||
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()))
|
||||
applyStatusByID(e.CarrierInput(), e.OpponentInput(), int(e.Args()[2].IntPart()))
|
||||
}
|
||||
e.remaining--
|
||||
if e.remaining <= 0 {
|
||||
@@ -366,11 +366,11 @@ type Effect1272 struct {
|
||||
}
|
||||
|
||||
func (e *Effect1272) OnSkill() bool {
|
||||
shield := e.Ctx().Our.CurrentShield()
|
||||
shield := e.CarrierInput().CurrentShield()
|
||||
if shield.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: shield})
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: shield})
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -383,14 +383,14 @@ func (e *Effect1273) OnSkill() bool {
|
||||
if len(e.Args()) == 0 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Our.CurPet[0].GetHP().Cmp(e.Ctx().Our.CurPet[0].GetMaxHP()) != 0 {
|
||||
if e.CarrierInput().CurPet[0].GetHP().Cmp(e.CarrierInput().CurPet[0].GetMaxHP()) != 0 {
|
||||
return true
|
||||
}
|
||||
damage := e.Ctx().Our.CurPet[0].GetMaxHP().Div(e.Args()[0])
|
||||
damage := e.CarrierInput().CurPet[0].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.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -404,12 +404,12 @@ func (e *Effect1274) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
chance := int(e.Args()[0].IntPart())
|
||||
if e.Ctx().Opp.HasPropSub() {
|
||||
if e.OpponentInput().HasPropSub() {
|
||||
chance *= 2
|
||||
}
|
||||
success, _, _ := e.Input.Player.Roll(chance, 100)
|
||||
if success {
|
||||
applyStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
|
||||
applyStatusByID(e.CarrierInput(), e.OpponentInput(), int(e.Args()[1].IntPart()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -423,10 +423,10 @@ func (e *Effect1275) Skill_Use() bool {
|
||||
if len(e.Args()) == 0 {
|
||||
return true
|
||||
}
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Our.CurPet[0].GetHP()})
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1275, int(e.Args()[0].IntPart()))
|
||||
e.CarrierInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.CarrierInput().CurPet[0].GetHP()})
|
||||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1275, int(e.Args()[0].IntPart()))
|
||||
if effect != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), effect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -468,10 +468,10 @@ func (e *Effect1276) Skill_Use() bool {
|
||||
if len(e.Args()) == 0 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
damage := e.Ctx().Our.CurPet[0].GetHP().Div(e.Args()[0])
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Our.CurPet[0].GetHP()})
|
||||
damage := e.CarrierInput().CurPet[0].GetHP().Div(e.Args()[0])
|
||||
e.CarrierInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.CarrierInput().CurPet[0].GetHP()})
|
||||
if damage.Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -482,19 +482,19 @@ type Effect1277 struct {
|
||||
}
|
||||
|
||||
func (e *Effect1277) Skill_Use() bool {
|
||||
if e.Ctx().Our.CurPet[0].GetHP().Cmp(e.Ctx().Opp.CurPet[0].GetHP()) > 0 {
|
||||
if e.CarrierInput().CurPet[0].GetHP().Cmp(e.OpponentInput().CurPet[0].GetHP()) > 0 {
|
||||
leave := alpacadecimal.NewFromInt(1)
|
||||
if e.Ctx().Our.CurPet[0].GetHP().Cmp(leave) > 0 {
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Our.CurPet[0].GetHP().Sub(leave)})
|
||||
if e.CarrierInput().CurPet[0].GetHP().Cmp(leave) > 0 {
|
||||
e.CarrierInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.CarrierInput().CurPet[0].GetHP().Sub(leave)})
|
||||
}
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: alpacadecimal.NewFromInt(int64(grand.N(350, 550)))})
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: alpacadecimal.NewFromInt(int64(grand.N(350, 550)))})
|
||||
return true
|
||||
}
|
||||
|
||||
lost := e.Ctx().Our.CurPet[0].GetHP()
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: lost})
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: lost})
|
||||
applyStatusByID(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.Paralysis))
|
||||
lost := e.CarrierInput().CurPet[0].GetHP()
|
||||
e.CarrierInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: lost})
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: lost})
|
||||
applyStatusByID(e.CarrierInput(), e.OpponentInput(), int(info.PetStatus.Paralysis))
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -509,12 +509,12 @@ func (e *Effect1278) OnSkill() bool {
|
||||
}
|
||||
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()))
|
||||
applyStatusByID(e.CarrierInput(), e.OpponentInput(), int(e.Args()[1].IntPart()))
|
||||
return true
|
||||
}
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1278, int(e.Args()[2].IntPart()))
|
||||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1278, int(e.Args()[2].IntPart()))
|
||||
if effect != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), effect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -536,7 +536,7 @@ func (e *Effect1278Sub) DamageLockEx(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || e.remaining <= 0 {
|
||||
return true
|
||||
}
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: zone.Damage})
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: zone.Damage})
|
||||
zone.Damage = alpacadecimal.Zero
|
||||
e.remaining--
|
||||
if e.remaining <= 0 {
|
||||
@@ -555,17 +555,17 @@ func (e *Effect1279) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
reversed := false
|
||||
for i, v := range e.Ctx().Our.Prop[:] {
|
||||
if v < 0 && e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), -2*v) {
|
||||
for i, v := range e.CarrierInput().Prop[:] {
|
||||
if v < 0 && e.CarrierInput().SetProp(e.CarrierInput(), int8(i), -2*v) {
|
||||
reversed = true
|
||||
}
|
||||
}
|
||||
if !reversed {
|
||||
return true
|
||||
}
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1279, int(e.Args()[0].IntPart()))
|
||||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1279, int(e.Args()[0].IntPart()))
|
||||
if effect != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, effect)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), effect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -614,9 +614,9 @@ func (e *Effect1280) OnSkill() bool {
|
||||
if percent > max {
|
||||
percent = max
|
||||
}
|
||||
damage := e.Ctx().Our.CurPet[0].GetHP().Mul(alpacadecimal.NewFromInt(int64(percent))).Div(alpacadecimal.NewFromInt(100))
|
||||
damage := e.CarrierInput().CurPet[0].GetHP().Mul(alpacadecimal.NewFromInt(int64(percent))).Div(alpacadecimal.NewFromInt(100))
|
||||
if damage.Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||||
}
|
||||
e.bonus += int(e.Args()[1].IntPart())
|
||||
return true
|
||||
@@ -628,20 +628,20 @@ type Effect1281 struct {
|
||||
}
|
||||
|
||||
func (e *Effect1281) Skill_Use() bool {
|
||||
shield := e.Ctx().Our.CurrentShield()
|
||||
shield := e.CarrierInput().CurrentShield()
|
||||
if shield.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: shield})
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: shield})
|
||||
if shield.Cmp(alpacadecimal.NewFromInt(300)) > 0 {
|
||||
dmg := e.Ctx().Our.CurPet[0].GetMaxHP().Div(alpacadecimal.NewFromInt(3))
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: dmg})
|
||||
dmg := e.CarrierInput().CurPet[0].GetMaxHP().Div(alpacadecimal.NewFromInt(3))
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Percent, Damage: dmg})
|
||||
return true
|
||||
}
|
||||
if shield.Cmp(alpacadecimal.NewFromInt(300)) < 0 {
|
||||
val := e.Ctx().Our.CurPet[0].GetMaxHP().Div(alpacadecimal.NewFromInt(3))
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, val)
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: val})
|
||||
val := e.CarrierInput().CurPet[0].GetMaxHP().Div(alpacadecimal.NewFromInt(3))
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, val)
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Percent, Damage: val})
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -655,7 +655,7 @@ func (e *Effect1282) Skill_Use() bool {
|
||||
if len(e.Args()) == 0 {
|
||||
return true
|
||||
}
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[0]})
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[0]})
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -673,7 +673,7 @@ func (e *Effect1283) OnSkill() bool {
|
||||
boost *= 2
|
||||
}
|
||||
for i := 0; i < 6; i++ {
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), boost)
|
||||
e.CarrierInput().SetProp(e.CarrierInput(), int8(i), boost)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -687,9 +687,9 @@ func (e *Effect1284) Skill_Use() bool {
|
||||
if len(e.Args()) == 0 || !e.IsFirst() {
|
||||
return true
|
||||
}
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1284, int(e.Args()[0].IntPart()))
|
||||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1284, int(e.Args()[0].IntPart()))
|
||||
if effect != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, effect)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), effect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -729,10 +729,10 @@ type Effect1285 struct {
|
||||
}
|
||||
|
||||
func (e *Effect1285) Skill_Use() bool {
|
||||
if len(e.Args()) == 0 || e.Ctx().Opp.CurPet[0].Info.Hp == 0 {
|
||||
if len(e.Args()) == 0 || e.OpponentInput().CurPet[0].Info.Hp == 0 {
|
||||
return true
|
||||
}
|
||||
zeroRandomSkillPP(e.Ctx().Opp, int(e.Args()[0].IntPart()))
|
||||
zeroRandomSkillPP(e.OpponentInput(), int(e.Args()[0].IntPart()))
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -754,13 +754,13 @@ func (e *Effect1287) OnSkill() bool {
|
||||
if len(e.Args()) < 2 {
|
||||
return true
|
||||
}
|
||||
absorbed := clearPositivePropsTo(e.Ctx().Opp, e.Ctx().Our)
|
||||
absorbed := clearPositivePropsTo(e.OpponentInput(), e.CarrierInput())
|
||||
if !absorbed {
|
||||
return true
|
||||
}
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1287, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
||||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1287, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
||||
if effect != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), effect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -79,9 +79,9 @@ func (e *Effect1288) Skill_Use() bool {
|
||||
if len(e.Args()) < 3 {
|
||||
return true
|
||||
}
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1288, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()))
|
||||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1288, 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)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), effect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -119,20 +119,20 @@ func (e *Effect1289) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
reflected := false
|
||||
for i, v := range e.Ctx().Our.Prop[:] {
|
||||
for i, v := range e.CarrierInput().Prop[:] {
|
||||
if v >= 0 {
|
||||
continue
|
||||
}
|
||||
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 2*v) {
|
||||
if e.OpponentInput().SetProp(e.CarrierInput(), int8(i), 2*v) {
|
||||
reflected = true
|
||||
}
|
||||
}
|
||||
if !reflected {
|
||||
return true
|
||||
}
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1289, int(e.Args()[0].IntPart()))
|
||||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1289, int(e.Args()[0].IntPart()))
|
||||
if effect != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, effect)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), effect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -173,18 +173,18 @@ func (e *Effect1290) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
heal := e.Ctx().Our.CurPet[0].GetMaxHP().Div(e.Args()[0])
|
||||
heal := e.CarrierInput().CurPet[0].GetMaxHP().Div(e.Args()[0])
|
||||
if heal.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
low := false
|
||||
if e.Args()[1].Cmp(alpacadecimal.Zero) > 0 {
|
||||
threshold := e.Ctx().Our.CurPet[0].GetMaxHP().Div(e.Args()[1])
|
||||
low = e.Ctx().Our.CurPet[0].GetHP().Cmp(threshold) < 0
|
||||
threshold := e.CarrierInput().CurPet[0].GetMaxHP().Div(e.Args()[1])
|
||||
low = e.CarrierInput().CurPet[0].GetHP().Cmp(threshold) < 0
|
||||
}
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, heal)
|
||||
if low {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: heal})
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: heal})
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -196,12 +196,12 @@ func (e *Effect1291) Skill_Use() bool {
|
||||
if len(e.Args()) < 3 {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) <= 0 {
|
||||
if e.CarrierInput().SumDamage.Cmp(e.Args()[0]) <= 0 {
|
||||
return true
|
||||
}
|
||||
success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
|
||||
if success {
|
||||
applyRandomNStatuses(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()), effect1291Statuses)
|
||||
applyRandomNStatuses(e.CarrierInput(), e.OpponentInput(), int(e.Args()[2].IntPart()), effect1291Statuses)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -210,10 +210,10 @@ func (e *Effect1291) Skill_Use() bool {
|
||||
type Effect1292 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1292) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||||
if e.Ctx().Our.CurPet[0].GetHP().Cmp(e.Ctx().Opp.CurPet[0].GetHP()) >= 0 {
|
||||
if e.CarrierInput().CurPet[0].GetHP().Cmp(e.OpponentInput().CurPet[0].GetHP()) >= 0 {
|
||||
return true
|
||||
}
|
||||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||||
current := actionByPlayer(fattack, sattack, e.CarrierInput().UserID)
|
||||
if current == nil || current.SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
@@ -228,9 +228,9 @@ func (e *Effect1293) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 {
|
||||
return true
|
||||
}
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1293, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
||||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1293, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
||||
if effect != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), effect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -258,7 +258,7 @@ func (e *Effect1293Sub) DamageLockEx(zone *info.DamageZone) bool {
|
||||
}
|
||||
zone.Damage = alpacadecimal.Zero
|
||||
for i := 0; i < 6; i++ {
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), int8(e.boost))
|
||||
e.CarrierInput().SetProp(e.CarrierInput(), int8(i), int8(e.boost))
|
||||
}
|
||||
e.remaining--
|
||||
if e.remaining <= 0 {
|
||||
@@ -271,17 +271,17 @@ func (e *Effect1293Sub) DamageLockEx(zone *info.DamageZone) bool {
|
||||
type Effect1294 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1294) Skill_Use() bool {
|
||||
cleared := clearBothProps(e.Ctx().Our, e.Ctx().Opp)
|
||||
cleared := clearBothProps(e.CarrierInput(), e.OpponentInput())
|
||||
if cleared {
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Status, 1294)
|
||||
effect := e.CarrierInput().InitEffect(input.EffectType.Status, 1294)
|
||||
if effect != nil {
|
||||
applyRandomNStatuses(e.Ctx().Our, e.Ctx().Opp, 2, effect1291Statuses)
|
||||
applyRandomNStatuses(e.CarrierInput(), e.OpponentInput(), 2, effect1291Statuses)
|
||||
}
|
||||
return true
|
||||
}
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1294)
|
||||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1294)
|
||||
if effect != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), effect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -289,9 +289,9 @@ func (e *Effect1294) Skill_Use() bool {
|
||||
type Effect1294Sub struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1294Sub) TurnEnd() {
|
||||
damage := e.Ctx().Opp.CurPet[0].GetMaxHP().Div(alpacadecimal.NewFromInt(3))
|
||||
damage := e.OpponentInput().CurPet[0].GetMaxHP().Div(alpacadecimal.NewFromInt(3))
|
||||
if damage.Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||||
}
|
||||
e.Alive(false)
|
||||
}
|
||||
@@ -303,9 +303,9 @@ func (e *Effect1295) Skill_Use() bool {
|
||||
if len(e.Args()) == 0 || !e.IsFirst() {
|
||||
return true
|
||||
}
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1295, int(e.Args()[0].IntPart()))
|
||||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1295, int(e.Args()[0].IntPart()))
|
||||
if effect != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), effect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -313,7 +313,7 @@ func (e *Effect1295) Skill_Use() bool {
|
||||
type Effect1295Sub struct{ FixedDuration1Base }
|
||||
|
||||
func (e *Effect1295Sub) EFFect_Befer(in *input.Input, effEffect input.Effect) bool {
|
||||
if in != e.Ctx().Opp || !input.IS_Stat(effEffect) {
|
||||
if in != e.OpponentInput() || !input.IS_Stat(effEffect) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@@ -330,7 +330,7 @@ func (e *Effect1296) DamageLockEx(zone *info.DamageZone) bool {
|
||||
if !ok {
|
||||
return true
|
||||
}
|
||||
applyAnyStatus(e.Ctx().Our, e.Ctx().Our, effect1296Statuses[0])
|
||||
applyAnyStatus(e.CarrierInput(), e.CarrierInput(), effect1296Statuses[0])
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -341,16 +341,16 @@ func (e *Effect1297) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 {
|
||||
return true
|
||||
}
|
||||
before := activeTurnEffectCount(e.Ctx().Opp)
|
||||
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
|
||||
before := activeTurnEffectCount(e.OpponentInput())
|
||||
e.OpponentInput().CancelTurn(e.CarrierInput())
|
||||
if before > 0 {
|
||||
applyAnyStatus(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
|
||||
applyAnyStatus(e.CarrierInput(), e.OpponentInput(), int(e.Args()[0].IntPart()))
|
||||
return true
|
||||
}
|
||||
damage := e.Ctx().Opp.CurPet[0].GetMaxHP().Div(e.Args()[1])
|
||||
damage := e.OpponentInput().CurPet[0].GetMaxHP().Div(e.Args()[1])
|
||||
if damage.Cmp(alpacadecimal.Zero) > 0 {
|
||||
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)
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, damage)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -359,12 +359,12 @@ func (e *Effect1297) Skill_Use() bool {
|
||||
type Effect1298 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1298) Skill_Use() bool {
|
||||
cleared := clearPositiveProps(e.Ctx().Opp, e.Ctx().Our)
|
||||
cleared := clearPositiveProps(e.OpponentInput(), e.CarrierInput())
|
||||
if !cleared {
|
||||
return true
|
||||
}
|
||||
for _, pet := range e.Ctx().Opp.AllPet {
|
||||
if pet == nil || !pet.Alive() || pet == e.Ctx().Opp.CurPet[0] {
|
||||
for _, pet := range e.OpponentInput().AllPet {
|
||||
if pet == nil || !pet.Alive() || pet == e.OpponentInput().CurPet[0] {
|
||||
continue
|
||||
}
|
||||
damage := pet.GetMaxHP().Div(alpacadecimal.NewFromInt(4))
|
||||
@@ -383,11 +383,11 @@ func (e *Effect1299) SkillHit_ex() bool {
|
||||
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Our.SumDamage.Cmp(alpacadecimal.NewFromInt(300)) >= 0 {
|
||||
if e.CarrierInput().SumDamage.Cmp(alpacadecimal.NewFromInt(300)) >= 0 {
|
||||
return true
|
||||
}
|
||||
for _, pet := range e.Ctx().Opp.AllPet {
|
||||
if pet == nil || !pet.Alive() || pet == e.Ctx().Opp.CurPet[0] {
|
||||
for _, pet := range e.OpponentInput().AllPet {
|
||||
if pet == nil || !pet.Alive() || pet == e.OpponentInput().CurPet[0] {
|
||||
continue
|
||||
}
|
||||
pet.Info.ModelHP(-100)
|
||||
@@ -399,7 +399,7 @@ func (e *Effect1299) Skill_Use_ex() bool {
|
||||
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
healBench(e.Ctx().Our, alpacadecimal.NewFromInt(100))
|
||||
healBench(e.CarrierInput(), alpacadecimal.NewFromInt(100))
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -413,7 +413,7 @@ func (e *Effect1300) DamageDivEx(zone *info.DamageZone) bool {
|
||||
reduce := zone.Damage.Mul(e.Args()[1]).Div(alpacadecimal.NewFromInt(100))
|
||||
zone.Damage = zone.Damage.Sub(reduce)
|
||||
if zone.Damage.Cmp(e.Args()[2]) > 0 {
|
||||
applyRandomNStatuses(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[3].IntPart()), effect1291Statuses)
|
||||
applyRandomNStatuses(e.CarrierInput(), e.OpponentInput(), int(e.Args()[3].IntPart()), effect1291Statuses)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -422,12 +422,12 @@ func (e *Effect1300) DamageDivEx(zone *info.DamageZone) bool {
|
||||
type Effect1301 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1301) Skill_Use() bool {
|
||||
if e.Ctx().Our.CurPet[0].GetHP().Cmp(alpacadecimal.NewFromInt(300)) >= 0 {
|
||||
if e.CarrierInput().CurPet[0].GetHP().Cmp(alpacadecimal.NewFromInt(300)) >= 0 {
|
||||
return true
|
||||
}
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Our.CurPet[0].GetHP()})
|
||||
for _, pet := range e.Ctx().Opp.AllPet {
|
||||
if pet == nil || !pet.Alive() || pet == e.Ctx().Opp.CurPet[0] {
|
||||
e.CarrierInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.CarrierInput().CurPet[0].GetHP()})
|
||||
for _, pet := range e.OpponentInput().AllPet {
|
||||
if pet == nil || !pet.Alive() || pet == e.OpponentInput().CurPet[0] {
|
||||
continue
|
||||
}
|
||||
damage := pet.GetMaxHP().Div(alpacadecimal.NewFromInt(2))
|
||||
@@ -449,12 +449,12 @@ func (e *Effect1302) OnSkill() bool {
|
||||
boost *= 2
|
||||
}
|
||||
for i := 0; i < 6; i++ {
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), boost)
|
||||
e.CarrierInput().SetProp(e.CarrierInput(), int8(i), boost)
|
||||
}
|
||||
if success {
|
||||
return true
|
||||
}
|
||||
clearPositiveProps(e.Ctx().Opp, e.Ctx().Our)
|
||||
clearPositiveProps(e.OpponentInput(), e.CarrierInput())
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -462,14 +462,14 @@ func (e *Effect1302) OnSkill() bool {
|
||||
type Effect1303 struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect1303) OnSkill() bool {
|
||||
base := e.Ctx().Opp.CurPet[0].GetMaxHP().Div(alpacadecimal.NewFromInt(3))
|
||||
if e.Ctx().Our.CurPet[0].GetHP().Cmp(e.Ctx().Our.CurPet[0].GetMaxHP().Div(alpacadecimal.NewFromInt(2))) < 0 {
|
||||
base := e.OpponentInput().CurPet[0].GetMaxHP().Div(alpacadecimal.NewFromInt(3))
|
||||
if e.CarrierInput().CurPet[0].GetHP().Cmp(e.CarrierInput().CurPet[0].GetMaxHP().Div(alpacadecimal.NewFromInt(2))) < 0 {
|
||||
base = base.Mul(alpacadecimal.NewFromInt(2))
|
||||
}
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: base})
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, base)
|
||||
if e.Ctx().Our.CurPet[0].GetHP().Cmp(e.Ctx().Our.CurPet[0].GetMaxHP()) == 0 {
|
||||
healBench(e.Ctx().Our, alpacadecimal.NewFromInt(100))
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Percent, Damage: base})
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, base)
|
||||
if e.CarrierInput().CurPet[0].GetHP().Cmp(e.CarrierInput().CurPet[0].GetMaxHP()) == 0 {
|
||||
healBench(e.CarrierInput(), alpacadecimal.NewFromInt(100))
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -494,7 +494,7 @@ func (e *Effect1305) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
live, dead := 0, 0
|
||||
for _, pet := range e.Ctx().Our.AllPet {
|
||||
for _, pet := range e.CarrierInput().AllPet {
|
||||
if pet == nil {
|
||||
continue
|
||||
}
|
||||
@@ -504,9 +504,9 @@ func (e *Effect1305) OnSkill() bool {
|
||||
dead++
|
||||
}
|
||||
}
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, alpacadecimal.NewFromInt(int64(live)*e.Args()[0].IntPart()))
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, alpacadecimal.NewFromInt(int64(live)*e.Args()[0].IntPart()))
|
||||
if dead > 0 {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: alpacadecimal.NewFromInt(int64(dead) * e.Args()[1].IntPart())})
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: alpacadecimal.NewFromInt(int64(dead) * e.Args()[1].IntPart())})
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -515,11 +515,11 @@ func (e *Effect1305) OnSkill() bool {
|
||||
type Effect1306 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1306) Skill_Use() bool {
|
||||
if e.Ctx().Our.SumDamage.Cmp(alpacadecimal.NewFromInt(350)) >= 0 {
|
||||
if e.CarrierInput().SumDamage.Cmp(alpacadecimal.NewFromInt(350)) >= 0 {
|
||||
return true
|
||||
}
|
||||
for _, pet := range e.Ctx().Opp.AllPet {
|
||||
if pet == nil || !pet.Alive() || pet == e.Ctx().Opp.CurPet[0] {
|
||||
for _, pet := range e.OpponentInput().AllPet {
|
||||
if pet == nil || !pet.Alive() || pet == e.OpponentInput().CurPet[0] {
|
||||
continue
|
||||
}
|
||||
pet.Info.ModelHP(-100)
|
||||
@@ -531,10 +531,10 @@ func (e *Effect1306) Skill_Use() bool {
|
||||
type Effect1307 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1307) Skill_Use() bool {
|
||||
if e.Ctx().Opp.CurPet[0].Info.Hp == 0 {
|
||||
if e.OpponentInput().CurPet[0].Info.Hp == 0 {
|
||||
return true
|
||||
}
|
||||
healBench(e.Ctx().Our, alpacadecimal.NewFromInt(100))
|
||||
healBench(e.CarrierInput(), alpacadecimal.NewFromInt(100))
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -551,7 +551,7 @@ func (e *Effect1309) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
damage := e.Args()[0]
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: damage})
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: damage})
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -562,12 +562,12 @@ func (e *Effect1310) OnSkill() bool {
|
||||
if len(e.Args()) == 0 {
|
||||
return true
|
||||
}
|
||||
if !clearPositiveProps(e.Ctx().Opp, e.Ctx().Our) {
|
||||
if !clearPositiveProps(e.OpponentInput(), e.CarrierInput()) {
|
||||
return true
|
||||
}
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1310, int(e.Args()[0].IntPart()))
|
||||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1310, int(e.Args()[0].IntPart()))
|
||||
if effect != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), effect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -590,7 +590,7 @@ func (e *Effect1310Sub) ComparePre(fattack, sattack *action.SelectSkillAction) b
|
||||
e.Alive(false)
|
||||
return true
|
||||
}
|
||||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||||
current := actionByPlayer(fattack, sattack, e.CarrierInput().UserID)
|
||||
if current != nil && current.SkillEntity != nil {
|
||||
current.SkillEntity.XML.Priority += 7
|
||||
}
|
||||
@@ -609,7 +609,7 @@ func (e *Effect1311) Skill_Use_ex() bool {
|
||||
return true
|
||||
}
|
||||
for i := 0; i < 6; i++ {
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), -int8(e.Args()[1].IntPart()))
|
||||
e.OpponentInput().SetProp(e.CarrierInput(), int8(i), -int8(e.Args()[1].IntPart()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -622,17 +622,17 @@ func (e *Effect1312) OnSkill() bool {
|
||||
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) {
|
||||
for i, v := range e.CarrierInput().Prop[:] {
|
||||
if v < 0 && e.CarrierInput().SetProp(e.CarrierInput(), int8(i), 0) {
|
||||
cleared = true
|
||||
}
|
||||
}
|
||||
if !cleared {
|
||||
return true
|
||||
}
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1312, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
||||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1312, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
||||
if effect != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), effect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -659,7 +659,7 @@ func (e *Effect1312Sub) ComparePre(fattack, sattack *action.SelectSkillAction) b
|
||||
e.Alive(false)
|
||||
return true
|
||||
}
|
||||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||||
current := actionByPlayer(fattack, sattack, e.CarrierInput().UserID)
|
||||
if current != nil && current.SkillEntity != nil {
|
||||
current.SkillEntity.XML.Priority += e.priority
|
||||
}
|
||||
|
||||
@@ -24,12 +24,12 @@ func (e *Effect138) DamageLockEx(t *info.DamageZone) bool {
|
||||
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() != info.Category.STATUS {
|
||||
|
||||
// 反弹1/n造成的伤害
|
||||
damageToBounce := e.Ctx().Opp.SumDamage.Div(e.Args()[1]) // 1/n
|
||||
damageToBounce := e.OpponentInput().SumDamage.Div(e.Args()[1]) // 1/n
|
||||
damageZone := &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: damageToBounce,
|
||||
}
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, damageZone)
|
||||
e.OpponentInput().Damage(e.CarrierInput(), damageZone)
|
||||
if t.Type == info.DamageType.Fixed {
|
||||
t.Damage = alpacadecimal.Zero
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@ type Effect143 struct {
|
||||
// ----------------------
|
||||
func (e *Effect143) OnSkill() bool {
|
||||
|
||||
for i, v := range e.Ctx().Opp.Prop[:] {
|
||||
for i, v := range e.OpponentInput().Prop[:] {
|
||||
if v > 0 {
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), -2*v)
|
||||
e.OpponentInput().SetProp(e.CarrierInput(), int8(i), -2*v)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -46,11 +46,11 @@ func randomSkillPPZero(target *input.Input, count int) {
|
||||
type Effect1448 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1448) Damage_Mul(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 || e.Ctx().Our.CurPet[0] == nil {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 || e.CarrierInput().CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
maxHP := e.Ctx().Our.CurPet[0].GetMaxHP()
|
||||
curHP := e.Ctx().Our.CurPet[0].GetHP()
|
||||
maxHP := e.CarrierInput().CurPet[0].GetMaxHP()
|
||||
curHP := e.CarrierInput().CurPet[0].GetHP()
|
||||
if curHP.Mul(e.Args()[0]).Cmp(maxHP) >= 0 {
|
||||
return true
|
||||
}
|
||||
@@ -65,9 +65,9 @@ func (e *Effect1449) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 {
|
||||
return true
|
||||
}
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1449, e.SideEffectArgs...)
|
||||
eff := e.CarrierInput().InitEffect(input.EffectType.Sub, 1449, e.SideEffectArgs...)
|
||||
if eff != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), eff)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -82,7 +82,7 @@ func (e *Effect1449Sub) Heal_Pre(_ action.BattleActionI, amount *int) bool {
|
||||
}
|
||||
damage := alpacadecimal.NewFromInt(int64(*amount)).Div(e.Args()[1])
|
||||
if damage.Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||||
e.CarrierInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||||
}
|
||||
*amount = 0
|
||||
return true
|
||||
@@ -96,14 +96,14 @@ func (e *Effect1450) Skill_Use() bool {
|
||||
return true
|
||||
}
|
||||
drain := e.Args()[0]
|
||||
for _, s := range e.Ctx().Opp.CurPet[0].Info.SkillList {
|
||||
for _, s := range e.OpponentInput().CurPet[0].Info.SkillList {
|
||||
if s.PP < uint32(e.Args()[1].IntPart()) {
|
||||
drain = drain.Mul(alpacadecimal.NewFromInt(2))
|
||||
break
|
||||
}
|
||||
}
|
||||
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)
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: drain})
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, drain)
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -114,12 +114,12 @@ func (e *Effect1451) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Our.CurPet[0].GetHP().Cmp(e.Ctx().Opp.CurPet[0].GetHP()) > 0 {
|
||||
e.Ctx().Our.AddShield(e.Args()[0])
|
||||
if e.CarrierInput().CurPet[0].GetHP().Cmp(e.OpponentInput().CurPet[0].GetHP()) > 0 {
|
||||
e.CarrierInput().AddShield(e.Args()[0])
|
||||
return true
|
||||
}
|
||||
heal := e.Ctx().Our.CurPet[0].GetMaxHP().Div(e.Args()[1])
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
|
||||
heal := e.CarrierInput().CurPet[0].GetMaxHP().Div(e.Args()[1])
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, heal)
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -130,9 +130,9 @@ func (e *Effect1452) Skill_Use() bool {
|
||||
if len(e.Args()) == 0 {
|
||||
return true
|
||||
}
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1452, e.SideEffectArgs...)
|
||||
eff := e.CarrierInput().InitEffect(input.EffectType.Sub, 1452, e.SideEffectArgs...)
|
||||
if eff != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), eff)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -151,9 +151,9 @@ func (e *Effect1452Sub) Damage_Mul(zone *info.DamageZone) bool {
|
||||
type Effect1453 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1453) Skill_Use() bool {
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1453, e.SideEffectArgs...)
|
||||
eff := e.CarrierInput().InitEffect(input.EffectType.Sub, 1453, e.SideEffectArgs...)
|
||||
if eff != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), eff)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -196,7 +196,7 @@ func (e *Effect1455) Damage_Mul(zone *info.DamageZone) bool {
|
||||
maxHits := int(e.Args()[1].IntPart())
|
||||
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(int64(maxHits)))
|
||||
if maxHits > 0 {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Opp.CurPet[0].GetHP()})
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.OpponentInput().CurPet[0].GetHP()})
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -208,12 +208,12 @@ func (e *Effect1456) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 {
|
||||
return true
|
||||
}
|
||||
maxHP := e.Ctx().Our.CurPet[0].GetMaxHP()
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Our.CurPet[0].GetHP()})
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: maxHP.Div(e.Args()[0])})
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1456, e.SideEffectArgs...)
|
||||
maxHP := e.CarrierInput().CurPet[0].GetMaxHP()
|
||||
e.CarrierInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.CarrierInput().CurPet[0].GetHP()})
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Percent, Damage: maxHP.Div(e.Args()[0])})
|
||||
eff := e.CarrierInput().InitEffect(input.EffectType.Sub, 1456, e.SideEffectArgs...)
|
||||
if eff != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), eff)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -236,10 +236,10 @@ func (e *Effect1457) OnSkill() bool {
|
||||
}
|
||||
success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
|
||||
if success {
|
||||
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()))
|
||||
addStatusByID(e.CarrierInput(), e.OpponentInput(), int(e.Args()[2].IntPart()))
|
||||
return true
|
||||
}
|
||||
randomSkillPPZero(e.Ctx().Opp, int(e.Args()[3].IntPart()))
|
||||
randomSkillPPZero(e.OpponentInput(), int(e.Args()[3].IntPart()))
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -247,9 +247,9 @@ func (e *Effect1457) OnSkill() bool {
|
||||
type Effect1458 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1458) Skill_Use() bool {
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1458, e.SideEffectArgs...)
|
||||
eff := e.CarrierInput().InitEffect(input.EffectType.Sub, 1458, e.SideEffectArgs...)
|
||||
if eff != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), eff)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -267,7 +267,7 @@ func (e *Effect1458Sub) SkillHit_ex() bool {
|
||||
}
|
||||
if len(e.Args()) >= 4 {
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[2].IntPart()), 100); ok {
|
||||
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[3].IntPart()))
|
||||
addStatusByID(e.CarrierInput(), e.OpponentInput(), int(e.Args()[3].IntPart()))
|
||||
}
|
||||
}
|
||||
return true
|
||||
@@ -281,12 +281,12 @@ func (e *Effect1459) ActionStart(a, b *action.SelectSkillAction) bool {
|
||||
return true
|
||||
}
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
|
||||
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
|
||||
addStatusByID(e.CarrierInput(), e.OpponentInput(), int(e.Args()[1].IntPart()))
|
||||
return true
|
||||
}
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1459, e.SideEffectArgs...)
|
||||
eff := e.CarrierInput().InitEffect(input.EffectType.Sub, 1459, e.SideEffectArgs...)
|
||||
if eff != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), eff)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -322,10 +322,10 @@ func (e *Effect1461) Skill_Use() bool {
|
||||
if len(e.Args()) == 0 {
|
||||
return true
|
||||
}
|
||||
heal := e.Ctx().Our.CurPet[0].GetMaxHP().Div(e.Args()[0])
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
|
||||
if e.Ctx().Our.CurPet[0].GetHP().Cmp(e.Ctx().Opp.CurPet[0].GetHP()) < 0 {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: heal})
|
||||
heal := e.CarrierInput().CurPet[0].GetMaxHP().Div(e.Args()[0])
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, heal)
|
||||
if e.CarrierInput().CurPet[0].GetHP().Cmp(e.OpponentInput().CurPet[0].GetHP()) < 0 {
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Percent, Damage: heal})
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -334,9 +334,9 @@ func (e *Effect1461) Skill_Use() bool {
|
||||
type Effect1462 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1462) Skill_Use() bool {
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1462, e.SideEffectArgs...)
|
||||
eff := e.CarrierInput().InitEffect(input.EffectType.Sub, 1462, e.SideEffectArgs...)
|
||||
if eff != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), eff)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -349,7 +349,7 @@ func (e *Effect1462Sub) DamageAdd(zone *info.DamageZone) bool {
|
||||
}
|
||||
bonus := e.Args()[1]
|
||||
boosted := false
|
||||
for _, v := range e.Ctx().Our.Prop[:] {
|
||||
for _, v := range e.CarrierInput().Prop[:] {
|
||||
if v > 0 {
|
||||
boosted = true
|
||||
break
|
||||
@@ -369,9 +369,9 @@ func (e *Effect1463) ActionStart(a, b *action.SelectSkillAction) bool {
|
||||
if !e.IsFirst() {
|
||||
return true
|
||||
}
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1463)
|
||||
eff := e.CarrierInput().InitEffect(input.EffectType.Sub, 1463)
|
||||
if eff != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), eff)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -382,11 +382,11 @@ func (e *Effect1463Sub) DamageLock(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Damage.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Our.CurPet[0].GetHP().Cmp(zone.Damage) > 0 {
|
||||
if e.CarrierInput().CurPet[0].GetHP().Cmp(zone.Damage) > 0 {
|
||||
return true
|
||||
}
|
||||
zone.Damage = alpacadecimal.Zero
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurPet[0].GetMaxHP())
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, e.CarrierInput().CurPet[0].GetMaxHP())
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -394,14 +394,14 @@ func (e *Effect1463Sub) DamageLock(zone *info.DamageZone) bool {
|
||||
type Effect1464 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1464) OnSkill() bool {
|
||||
if e.Ctx().Opp.CurPet[0].Info.Hp > 0 || len(e.Args()) < 3 {
|
||||
if e.OpponentInput().CurPet[0].Info.Hp > 0 || len(e.Args()) < 3 {
|
||||
return true
|
||||
}
|
||||
if !e.Ctx().Opp.StatEffect_Exist(info.EnumPetStatus(e.Args()[0].IntPart())) {
|
||||
if !e.OpponentInput().StatEffect_Exist(info.EnumPetStatus(e.Args()[0].IntPart())) {
|
||||
return true
|
||||
}
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok {
|
||||
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()))
|
||||
addStatusByID(e.CarrierInput(), e.OpponentInput(), int(e.Args()[2].IntPart()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -419,8 +419,8 @@ func (e *Effect1465) ActionStart(a, b *action.SelectSkillAction) bool {
|
||||
}
|
||||
return true
|
||||
}
|
||||
for i := range e.Ctx().Opp.Prop[:] {
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), int8(-e.Args()[0].IntPart()))
|
||||
for i := range e.OpponentInput().Prop[:] {
|
||||
e.OpponentInput().SetProp(e.CarrierInput(), int8(i), int8(-e.Args()[0].IntPart()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -429,9 +429,9 @@ func (e *Effect1465) ActionStart(a, b *action.SelectSkillAction) bool {
|
||||
type Effect1466 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1466) Skill_Use() bool {
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1466, e.SideEffectArgs...)
|
||||
eff := e.CarrierInput().InitEffect(input.EffectType.Sub, 1466, e.SideEffectArgs...)
|
||||
if eff != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), eff)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -443,7 +443,7 @@ func (e *Effect1466Sub) SkillHit_ex() bool {
|
||||
return true
|
||||
}
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok {
|
||||
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()))
|
||||
addStatusByID(e.CarrierInput(), e.OpponentInput(), int(e.Args()[2].IntPart()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -465,7 +465,7 @@ func (e *Effect1467) Skill_Use() bool {
|
||||
}
|
||||
indexes := grand.Perm(6)
|
||||
for i := 0; i < count && i < len(indexes); i++ {
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, int8(indexes[i]), int8(boost))
|
||||
e.CarrierInput().SetProp(e.CarrierInput(), int8(indexes[i]), int8(boost))
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -478,7 +478,7 @@ func (e *Effect1468) Skill_Use() bool {
|
||||
return true
|
||||
}
|
||||
triggered := false
|
||||
for _, target := range []*input.Input{e.Ctx().Our, e.Ctx().Opp} {
|
||||
for _, target := range []*input.Input{e.CarrierInput(), e.OpponentInput()} {
|
||||
for _, eff := range target.Effects {
|
||||
if eff != nil && eff.Alive() {
|
||||
eff.Alive(false)
|
||||
@@ -487,8 +487,8 @@ func (e *Effect1468) Skill_Use() bool {
|
||||
}
|
||||
}
|
||||
if triggered {
|
||||
damageByFixed(e.Ctx().Our, e.Ctx().Opp, e.Args()[0].IntPart())
|
||||
randomSkillPPZero(e.Ctx().Opp, int(e.Args()[1].IntPart()))
|
||||
damageByFixed(e.CarrierInput(), e.OpponentInput(), e.Args()[0].IntPart())
|
||||
randomSkillPPZero(e.OpponentInput(), int(e.Args()[1].IntPart()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -497,9 +497,9 @@ func (e *Effect1468) Skill_Use() bool {
|
||||
type Effect1469 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1469) Skill_Use() bool {
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1469, e.SideEffectArgs...)
|
||||
eff := e.CarrierInput().InitEffect(input.EffectType.Sub, 1469, e.SideEffectArgs...)
|
||||
if eff != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), eff)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -521,7 +521,7 @@ func (e *Effect1470) SkillHit() bool {
|
||||
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
e.Ctx().SkillEntity.XML.Power += int(e.Ctx().Our.CurPet[0].Info.Dv)
|
||||
e.Ctx().SkillEntity.XML.Power += int(e.CarrierInput().CurPet[0].Info.Dv)
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -533,7 +533,7 @@ func (e *Effect1471) Skill_Use() bool {
|
||||
return true
|
||||
}
|
||||
removed := false
|
||||
for _, eff := range e.Ctx().Opp.Effects {
|
||||
for _, eff := range e.OpponentInput().Effects {
|
||||
if eff != nil && eff.Alive() {
|
||||
eff.Alive(false)
|
||||
removed = true
|
||||
@@ -541,12 +541,12 @@ func (e *Effect1471) Skill_Use() bool {
|
||||
}
|
||||
if removed {
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
|
||||
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
|
||||
addStatusByID(e.CarrierInput(), e.OpponentInput(), int(e.Args()[1].IntPart()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
heal := e.Ctx().Our.CurPet[0].GetMaxHP().Div(e.Args()[2])
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
|
||||
heal := e.CarrierInput().CurPet[0].GetMaxHP().Div(e.Args()[2])
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, heal)
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -558,7 +558,7 @@ func (e *Effect1472) Damage_Mul(zone *info.DamageZone) bool {
|
||||
return true
|
||||
}
|
||||
boosted := false
|
||||
for _, v := range e.Ctx().Our.Prop[:] {
|
||||
for _, v := range e.CarrierInput().Prop[:] {
|
||||
if v > 0 {
|
||||
boosted = true
|
||||
break
|
||||
|
||||
@@ -15,9 +15,9 @@ func (e *Effect146) Skill_Use_ex() bool {
|
||||
chance := e.Args()[1].IntPart() // m%
|
||||
success, _, _ := e.Input.Player.Roll(int(chance), 100)
|
||||
if success {
|
||||
poisonEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(info.PetStatus.Poisoned))
|
||||
poisonEffect := e.CarrierInput().InitEffect(input.EffectType.Status, int(info.PetStatus.Poisoned))
|
||||
if poisonEffect != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, poisonEffect)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), poisonEffect)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ func (e *Effect1473) Skill_Use() bool {
|
||||
return true
|
||||
}
|
||||
cleared := false
|
||||
for _, eff := range e.Ctx().Opp.Effects {
|
||||
for _, eff := range e.OpponentInput().Effects {
|
||||
if eff == nil || !eff.Alive() {
|
||||
continue
|
||||
}
|
||||
@@ -25,7 +25,7 @@ func (e *Effect1473) Skill_Use() bool {
|
||||
cleared = true
|
||||
}
|
||||
if cleared {
|
||||
randomSkillPPZero(e.Ctx().Opp, int(e.Args()[0].IntPart()))
|
||||
randomSkillPPZero(e.OpponentInput(), int(e.Args()[0].IntPart()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -34,9 +34,9 @@ func (e *Effect1473) Skill_Use() bool {
|
||||
type Effect1474 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1474) Skill_Use() bool {
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1474, e.SideEffectArgs...)
|
||||
eff := e.CarrierInput().InitEffect(input.EffectType.Sub, 1474, e.SideEffectArgs...)
|
||||
if eff != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), eff)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -47,11 +47,11 @@ type Effect1474Sub struct {
|
||||
}
|
||||
|
||||
func (e *Effect1474Sub) PropBefer(in *input.Input, prop, level int8) bool {
|
||||
if in != e.Ctx().Our || level >= 0 {
|
||||
if in != e.CarrierInput() || level >= 0 {
|
||||
return true
|
||||
}
|
||||
e.removed++
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: e.Args()[1],
|
||||
})
|
||||
@@ -62,9 +62,9 @@ func (e *Effect1474Sub) PropBefer(in *input.Input, prop, level int8) bool {
|
||||
type Effect1475 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1475) Skill_Use() bool {
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1475, e.SideEffectArgs...)
|
||||
eff := e.CarrierInput().InitEffect(input.EffectType.Sub, 1475, e.SideEffectArgs...)
|
||||
if eff != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), eff)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -87,11 +87,11 @@ func (e *Effect1476) Skill_Use() bool {
|
||||
return true
|
||||
}
|
||||
delta := int8(-e.Args()[0].IntPart())
|
||||
if e.Ctx().Our.CurPet[0].GetHP().Mul(e.Args()[1]).Cmp(e.Ctx().Our.CurPet[0].GetMaxHP()) < 0 {
|
||||
if e.CarrierInput().CurPet[0].GetHP().Mul(e.Args()[1]).Cmp(e.CarrierInput().CurPet[0].GetMaxHP()) < 0 {
|
||||
delta *= 2
|
||||
}
|
||||
for i := range e.Ctx().Opp.Prop[:] {
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), delta)
|
||||
for i := range e.OpponentInput().Prop[:] {
|
||||
e.OpponentInput().SetProp(e.CarrierInput(), int8(i), delta)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -104,7 +104,7 @@ func (e *Effect1477) Skill_Use() bool {
|
||||
return true
|
||||
}
|
||||
cleared := false
|
||||
for _, target := range []*input.Input{e.Ctx().Our, e.Ctx().Opp} {
|
||||
for _, target := range []*input.Input{e.CarrierInput(), e.OpponentInput()} {
|
||||
for _, eff := range target.Effects {
|
||||
if eff == nil || !eff.Alive() {
|
||||
continue
|
||||
@@ -114,9 +114,9 @@ func (e *Effect1477) Skill_Use() bool {
|
||||
}
|
||||
}
|
||||
if cleared {
|
||||
drain := e.Ctx().Opp.CurPet[0].GetMaxHP().Div(e.Args()[0])
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: drain})
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, drain)
|
||||
drain := e.OpponentInput().CurPet[0].GetMaxHP().Div(e.Args()[0])
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Percent, Damage: drain})
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, drain)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -125,9 +125,9 @@ func (e *Effect1477) Skill_Use() bool {
|
||||
type Effect1478 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1478) Skill_Use() bool {
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1478, e.SideEffectArgs...)
|
||||
eff := e.CarrierInput().InitEffect(input.EffectType.Sub, 1478, e.SideEffectArgs...)
|
||||
if eff != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), eff)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -135,7 +135,7 @@ func (e *Effect1478) Skill_Use() bool {
|
||||
type Effect1478Sub struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect1478Sub) SwitchOut(in *input.Input) bool {
|
||||
if in == e.Ctx().Opp {
|
||||
if in == e.OpponentInput() {
|
||||
e.Alive(false)
|
||||
}
|
||||
return true
|
||||
@@ -148,10 +148,10 @@ func (e *Effect1479) Skill_Use() bool {
|
||||
if len(e.Args()) == 0 {
|
||||
return true
|
||||
}
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Our.CurPet[0].GetHP()})
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1479, e.SideEffectArgs...)
|
||||
e.CarrierInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.CarrierInput().CurPet[0].GetHP()})
|
||||
eff := e.CarrierInput().InitEffect(input.EffectType.Sub, 1479, e.SideEffectArgs...)
|
||||
if eff != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), eff)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -194,7 +194,7 @@ func (e *Effect1481) Damage_Mul(zone *info.DamageZone) bool {
|
||||
return true
|
||||
}
|
||||
chance := int(e.Args()[0].IntPart())
|
||||
for _, v := range e.Ctx().Opp.Prop[:] {
|
||||
for _, v := range e.OpponentInput().Prop[:] {
|
||||
if v < 0 {
|
||||
chance *= 2
|
||||
break
|
||||
@@ -217,10 +217,10 @@ func (e *Effect1482) Skill_Use() bool {
|
||||
return true
|
||||
}
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
|
||||
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
|
||||
addStatusByID(e.CarrierInput(), e.OpponentInput(), int(e.Args()[1].IntPart()))
|
||||
return true
|
||||
}
|
||||
for _, eff := range e.Ctx().Opp.Effects {
|
||||
for _, eff := range e.OpponentInput().Effects {
|
||||
if eff != nil && eff.Alive() {
|
||||
eff.Alive(false)
|
||||
}
|
||||
@@ -232,9 +232,9 @@ func (e *Effect1482) Skill_Use() bool {
|
||||
type Effect1483 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1483) Skill_Use() bool {
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1483, e.SideEffectArgs...)
|
||||
eff := e.CarrierInput().InitEffect(input.EffectType.Sub, 1483, e.SideEffectArgs...)
|
||||
if eff != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), eff)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -243,9 +243,9 @@ type Effect1483Sub struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect1483Sub) Skill_Use() bool {
|
||||
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Crit > 0 {
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1483, e.SideEffectArgs...)
|
||||
eff := e.CarrierInput().InitEffect(input.EffectType.Sub, 1483, e.SideEffectArgs...)
|
||||
if eff != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), eff)
|
||||
}
|
||||
}
|
||||
return true
|
||||
@@ -262,10 +262,10 @@ func (e *Effect1483Sub) SkillHit_ex() bool {
|
||||
type Effect1484 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1484) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||||
if e.Ctx().Our.CurPet[0].GetHP().Mul(alpacadecimal.NewFromInt(2)).Cmp(e.Ctx().Our.CurPet[0].GetMaxHP()) >= 0 {
|
||||
if e.CarrierInput().CurPet[0].GetHP().Mul(alpacadecimal.NewFromInt(2)).Cmp(e.CarrierInput().CurPet[0].GetMaxHP()) >= 0 {
|
||||
return true
|
||||
}
|
||||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||||
current := actionByPlayer(fattack, sattack, e.CarrierInput().UserID)
|
||||
if current != nil && current.SkillEntity != nil {
|
||||
current.SkillEntity.XML.Priority += 1
|
||||
}
|
||||
@@ -280,7 +280,7 @@ func (e *Effect1485) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
boosted := false
|
||||
for _, v := range e.Ctx().Opp.Prop[:] {
|
||||
for _, v := range e.OpponentInput().Prop[:] {
|
||||
if v > 0 {
|
||||
boosted = true
|
||||
break
|
||||
@@ -290,11 +290,11 @@ func (e *Effect1485) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
|
||||
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
|
||||
addStatusByID(e.CarrierInput(), e.OpponentInput(), int(e.Args()[1].IntPart()))
|
||||
return true
|
||||
}
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[2].IntPart()), 100); ok {
|
||||
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[3].IntPart()))
|
||||
addStatusByID(e.CarrierInput(), e.OpponentInput(), int(e.Args()[3].IntPart()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -307,7 +307,7 @@ func (e *Effect1486) Damage_Mul(zone *info.DamageZone) bool {
|
||||
return true
|
||||
}
|
||||
chance := int(e.Args()[0].IntPart())
|
||||
if e.Ctx().Our.HasShield() {
|
||||
if e.CarrierInput().HasShield() {
|
||||
chance *= 2
|
||||
}
|
||||
if chance > 100 {
|
||||
@@ -323,10 +323,10 @@ func (e *Effect1486) Damage_Mul(zone *info.DamageZone) bool {
|
||||
type Effect1487 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1487) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||||
if !e.Ctx().Our.HasShield() {
|
||||
if !e.CarrierInput().HasShield() {
|
||||
return true
|
||||
}
|
||||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||||
current := actionByPlayer(fattack, sattack, e.CarrierInput().UserID)
|
||||
if current != nil && current.SkillEntity != nil {
|
||||
current.SkillEntity.XML.Priority += 1
|
||||
}
|
||||
@@ -341,7 +341,7 @@ func (e *Effect1488) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
|
||||
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
|
||||
addStatusByID(e.CarrierInput(), e.OpponentInput(), int(e.Args()[1].IntPart()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -354,12 +354,12 @@ func (e *Effect1489) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
|
||||
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
|
||||
addStatusByID(e.CarrierInput(), e.OpponentInput(), int(e.Args()[1].IntPart()))
|
||||
return true
|
||||
}
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1489, e.SideEffectArgs...)
|
||||
eff := e.CarrierInput().InitEffect(input.EffectType.Sub, 1489, e.SideEffectArgs...)
|
||||
if eff != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), eff)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -384,12 +384,12 @@ func (e *Effect1490) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
|
||||
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
|
||||
addStatusByID(e.CarrierInput(), e.OpponentInput(), int(e.Args()[1].IntPart()))
|
||||
return true
|
||||
}
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1490, e.SideEffectArgs...)
|
||||
eff := e.CarrierInput().InitEffect(input.EffectType.Sub, 1490, e.SideEffectArgs...)
|
||||
if eff != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), eff)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -410,7 +410,7 @@ func (e *Effect1491) ComparePre(fattack, sattack *action.SelectSkillAction) bool
|
||||
if !e.ISNaturalEnemy() {
|
||||
return true
|
||||
}
|
||||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||||
current := actionByPlayer(fattack, sattack, e.CarrierInput().UserID)
|
||||
if current != nil && current.SkillEntity != nil {
|
||||
current.SkillEntity.XML.Priority += 1
|
||||
}
|
||||
@@ -425,7 +425,7 @@ func (e *Effect1492) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
down := false
|
||||
for _, v := range e.Ctx().Opp.Prop[:] {
|
||||
for _, v := range e.OpponentInput().Prop[:] {
|
||||
if v < 0 {
|
||||
down = true
|
||||
break
|
||||
@@ -434,7 +434,7 @@ func (e *Effect1492) OnSkill() bool {
|
||||
if !down {
|
||||
return true
|
||||
}
|
||||
applyRandomStatuses1507(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
|
||||
applyRandomStatuses1507(e.CarrierInput(), e.OpponentInput(), int(e.Args()[0].IntPart()))
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -442,10 +442,10 @@ func (e *Effect1492) OnSkill() bool {
|
||||
type Effect1493 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1493) Skill_Use() bool {
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Our.CurPet[0].GetHP()})
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1493)
|
||||
e.CarrierInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.CarrierInput().CurPet[0].GetHP()})
|
||||
eff := e.CarrierInput().InitEffect(input.EffectType.Sub, 1493)
|
||||
if eff != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), eff)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -453,7 +453,7 @@ func (e *Effect1493) Skill_Use() bool {
|
||||
type Effect1493Sub struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1493Sub) SwitchIn(in *input.Input) bool {
|
||||
if in != e.Ctx().Our {
|
||||
if in != e.CarrierInput() {
|
||||
return true
|
||||
}
|
||||
e.Duration(3)
|
||||
@@ -464,11 +464,11 @@ func (e *Effect1493Sub) SwitchIn(in *input.Input) bool {
|
||||
type Effect1494 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1494) OnSkill() bool {
|
||||
if len(e.Args()) < 2 || e.Ctx().Our.CurPet[0].GetHP().Cmp(e.Ctx().Our.CurPet[0].GetMaxHP()) != 0 {
|
||||
if len(e.Args()) < 2 || e.CarrierInput().CurPet[0].GetHP().Cmp(e.CarrierInput().CurPet[0].GetMaxHP()) != 0 {
|
||||
return true
|
||||
}
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
|
||||
randomSkillPPZero(e.Ctx().Opp, int(e.Args()[1].IntPart()))
|
||||
randomSkillPPZero(e.OpponentInput(), int(e.Args()[1].IntPart()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -481,7 +481,7 @@ func (e *Effect1495) Skill_Use() bool {
|
||||
return true
|
||||
}
|
||||
swapped := false
|
||||
for _, i := range e.Ctx().Opp.Prop[:] {
|
||||
for _, i := range e.OpponentInput().Prop[:] {
|
||||
if i > 0 {
|
||||
swapped = true
|
||||
break
|
||||
@@ -491,7 +491,7 @@ func (e *Effect1495) Skill_Use() bool {
|
||||
return true
|
||||
}
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
|
||||
randomSkillPPZero(e.Ctx().Opp, int(e.Args()[1].IntPart()))
|
||||
randomSkillPPZero(e.OpponentInput(), int(e.Args()[1].IntPart()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -503,11 +503,11 @@ func (e *Effect1496) Skill_Use() bool {
|
||||
if len(e.Args()) < 3 {
|
||||
return true
|
||||
}
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Our.CurPet[0].GetHP()})
|
||||
e.Ctx().Our.AddShield(e.Args()[0])
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1496, e.SideEffectArgs...)
|
||||
e.CarrierInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.CarrierInput().CurPet[0].GetHP()})
|
||||
e.CarrierInput().AddShield(e.Args()[0])
|
||||
eff := e.CarrierInput().InitEffect(input.EffectType.Sub, 1496, e.SideEffectArgs...)
|
||||
if eff != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), eff)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -516,7 +516,7 @@ type Effect1496Sub struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect1496Sub) TurnEnd() {
|
||||
if len(e.Args()) >= 3 {
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Args()[2])
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, e.Args()[2])
|
||||
}
|
||||
e.EffectNode.TurnEnd()
|
||||
}
|
||||
@@ -525,9 +525,9 @@ func (e *Effect1496Sub) TurnEnd() {
|
||||
type Effect1497 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1497) Skill_Use() bool {
|
||||
heal := e.Ctx().Our.CurrentShield().Add(e.Ctx().Opp.CurrentShield())
|
||||
heal := e.CarrierInput().CurrentShield().Add(e.OpponentInput().CurrentShield())
|
||||
if heal.Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, heal)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ func (e *Effect149) OnSkill() bool {
|
||||
if success1 {
|
||||
effectType1 := int(e.Args()[2].IntPart()) // 第一个异常状态类型
|
||||
|
||||
statusEffect1 := e.Ctx().Our.InitEffect(input.EffectType.Status, effectType1)
|
||||
statusEffect1 := e.CarrierInput().InitEffect(input.EffectType.Status, effectType1)
|
||||
if statusEffect1 != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect1)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), statusEffect1)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,9 +30,9 @@ func (e *Effect149) OnSkill() bool {
|
||||
if success2 {
|
||||
effectType2 := int(e.Args()[3].IntPart()) // 第二个异常状态类型
|
||||
|
||||
statusEffect2 := e.Ctx().Our.InitEffect(input.EffectType.Status, effectType2)
|
||||
statusEffect2 := e.CarrierInput().InitEffect(input.EffectType.Status, effectType2)
|
||||
if statusEffect2 != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect2)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), statusEffect2)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ type Effect150 struct {
|
||||
}
|
||||
|
||||
func (e *Effect150) Skill_Use() bool {
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Opp, 1, int8(e.SideEffectArgs[1]))
|
||||
e.OpponentInput().SetProp(e.OpponentInput(), 1, int8(e.SideEffectArgs[1]))
|
||||
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Opp, 3, int8(e.SideEffectArgs[1]))
|
||||
e.OpponentInput().SetProp(e.OpponentInput(), 3, int8(e.SideEffectArgs[1]))
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
|
||||
@@ -14,19 +14,19 @@ type Effect155 struct {
|
||||
|
||||
func (e *Effect155) OnSkill() bool {
|
||||
// 恢复全部体力
|
||||
maxHp := e.Ctx().Our.CurPet[0].GetMaxHP()
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, maxHp)
|
||||
maxHp := e.CarrierInput().CurPet[0].GetMaxHP()
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, maxHp)
|
||||
|
||||
// 消除所有能力下降
|
||||
|
||||
for i := 0; i < 6; i++ {
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), 0)
|
||||
e.CarrierInput().SetProp(e.CarrierInput(), int8(i), 0)
|
||||
}
|
||||
// 使自己进入睡眠n回合
|
||||
sleepEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(info.PetStatus.Sleep))
|
||||
sleepEffect := e.CarrierInput().InitEffect(input.EffectType.Status, int(info.PetStatus.Sleep))
|
||||
if sleepEffect != nil {
|
||||
sleepEffect.Duration(int(e.Args()[0].IntPart())) // n回合
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sleepEffect)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), sleepEffect)
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
@@ -12,15 +12,15 @@ type Effect156 struct {
|
||||
|
||||
func (e *Effect156) Skill_Use() bool {
|
||||
|
||||
for i, v := range e.Ctx().Opp.Prop[:] {
|
||||
for i, v := range e.OpponentInput().Prop[:] {
|
||||
if v > 0 {
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0)
|
||||
e.OpponentInput().SetProp(e.CarrierInput(), int8(i), 0)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
addSubEffect(e.Ctx().Our, e.Ctx().Opp, &e.EffectNode, &Effect156_sub{}, e.SideEffectArgs[0])
|
||||
addSubEffect(e.CarrierInput(), e.OpponentInput(), &e.EffectNode, &Effect156_sub{}, e.SideEffectArgs[0])
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ type Effect156_sub struct {
|
||||
|
||||
func (e *Effect156_sub) EFFect_Befer(in *input.Input, effEffect input.Effect) bool {
|
||||
|
||||
if in != e.Ctx().Our {
|
||||
if in != e.CarrierInput() {
|
||||
return true
|
||||
}
|
||||
if input.IS_Stat(effEffect) {
|
||||
|
||||
@@ -13,9 +13,9 @@ func (e *Effect157) Skill_Use_ex() bool {
|
||||
if e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Our, 1, -1)
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Our, 3, -1)
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Our, 5, -1)
|
||||
e.OpponentInput().SetProp(e.CarrierInput(), 1, -1)
|
||||
e.OpponentInput().SetProp(e.CarrierInput(), 3, -1)
|
||||
e.OpponentInput().SetProp(e.CarrierInput(), 5, -1)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
238
logic/service/fight/effect/1609_1613.go
Normal file
238
logic/service/fight/effect/1609_1613.go
Normal file
@@ -0,0 +1,238 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"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"
|
||||
)
|
||||
|
||||
const titanSpiritItemID = 1400352
|
||||
|
||||
// Effect 1609: 召唤自己的伙伴进行5-10次攻击,布布犬发起时可额外令自身下回合攻击造成的伤害翻倍
|
||||
type Effect1609 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1609) SkillHit() bool {
|
||||
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().SkillEntity.AttackTime == 0 {
|
||||
return true
|
||||
}
|
||||
hits := 5 + grand.Intn(6)
|
||||
if hits > 1 {
|
||||
e.Ctx().SkillEntity.AttackTime += uint32(hits - 1)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1609) Skill_Use() bool {
|
||||
if e.Ctx().Our == nil || e.Ctx().Our.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
if strings.TrimSpace(e.Ctx().Our.CurPet[0].PetInfo.DefName) != "布布犬" {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1609)
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1609Sub struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect1609Sub) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.Duration(1)
|
||||
e.CanStack(false)
|
||||
}
|
||||
|
||||
func (e *Effect1609Sub) Damage_Mul(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1610: 召唤自己的伙伴进行5-10次攻击,布布熊发起时可额外令对手下回合属性技能失效
|
||||
type Effect1610 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1610) SkillHit() bool {
|
||||
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().SkillEntity.AttackTime == 0 {
|
||||
return true
|
||||
}
|
||||
hits := 5 + grand.Intn(6)
|
||||
if hits > 1 {
|
||||
e.Ctx().SkillEntity.AttackTime += uint32(hits - 1)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1610) Skill_Use() bool {
|
||||
if e.Ctx().Opp == nil || e.Ctx().Our == nil || e.Ctx().Our.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
if strings.TrimSpace(e.Ctx().Our.CurPet[0].PetInfo.DefName) != "布布熊" {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Opp.InitEffect(input.EffectType.Sub, 1610)
|
||||
if sub != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1610Sub struct {
|
||||
FixedDuration1Base
|
||||
}
|
||||
|
||||
func (e *Effect1610Sub) SkillHit_ex() bool {
|
||||
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
e.Ctx().SkillEntity.SetNoSide()
|
||||
e.Ctx().SkillEntity.AttackTime = 0
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1611: 攻击命中后5%的概率汲取泰坦源脉的力量,本次攻击造成5倍伤害且战斗结束后获得5000泰坦之灵(每日上限50000)
|
||||
type Effect1611 struct {
|
||||
node.EffectNode
|
||||
rolled bool
|
||||
triggered bool
|
||||
rewarded bool
|
||||
}
|
||||
|
||||
func (e *Effect1611) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.Duration(-1)
|
||||
}
|
||||
|
||||
func (e *Effect1611) SkillHit() bool {
|
||||
e.rolled = false
|
||||
e.triggered = false
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1611) Damage_Mul(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
if !e.rolled {
|
||||
e.rolled = true
|
||||
if ok, _, _ := e.Input.Player.Roll(5, 100); ok {
|
||||
e.triggered = true
|
||||
e.rewarded = true
|
||||
}
|
||||
}
|
||||
if !e.triggered {
|
||||
return true
|
||||
}
|
||||
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(5))
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1611) OnBattleEnd() bool {
|
||||
if !e.rewarded {
|
||||
return true
|
||||
}
|
||||
player := e.Ctx().Our.Player
|
||||
if player == nil || player.GetInfo().UserID == 0 {
|
||||
return true
|
||||
}
|
||||
count, err := share.GlobalCounterManager.GetCount(&share.DailyPeriod, player.GetInfo().UserID, 1611)
|
||||
if err != nil && err != share.ErrCacheMiss {
|
||||
return true
|
||||
}
|
||||
if err == share.ErrCacheMiss {
|
||||
count = 0
|
||||
}
|
||||
if count >= 10 {
|
||||
return true
|
||||
}
|
||||
if !player.ItemAdd(titanSpiritItemID, 5000) {
|
||||
return true
|
||||
}
|
||||
_, _ = share.GlobalCounterManager.IncrCount(&share.DailyPeriod, player.GetInfo().UserID, 1611)
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1612: {0}回合内受到的伤害低于{1}时{2}%令对手{3},未触发则附加{4}点固定伤害
|
||||
type Effect1612 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1612) Skill_Use() bool {
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1612, e.SideEffectArgs...)
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1612Sub struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect1612Sub) DamageSubEx(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 5 {
|
||||
return true
|
||||
}
|
||||
if zone.Damage.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
threshold := e.Args()[1]
|
||||
chance := int(e.Args()[2].IntPart())
|
||||
statusID := int(e.Args()[3].IntPart())
|
||||
fallback := e.Args()[4]
|
||||
triggered := false
|
||||
if zone.Damage.Cmp(threshold) < 0 && chance > 0 && statusID > 0 {
|
||||
if ok, _, _ := e.Input.Player.Roll(chance, 100); ok {
|
||||
addStatusByID(e.Ctx().Our, e.Ctx().Opp, statusID)
|
||||
triggered = true
|
||||
}
|
||||
}
|
||||
if !triggered && fallback.Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: fallback})
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1613: 自身不处于能力提升状态则吸取对手{0}点体力,若先出手则额外吸取{1}点体力
|
||||
type Effect1613 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1613) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 || e.Ctx().Opp == nil {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Our == nil || e.Ctx().Our.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
drain := alpacadecimal.Zero
|
||||
if !e.Ctx().Our.HasPropADD() {
|
||||
drain = drain.Add(e.Args()[0])
|
||||
}
|
||||
if e.IsFirst() {
|
||||
drain = drain.Add(e.Args()[1])
|
||||
}
|
||||
if drain.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
damageByFixed(e.Ctx().Our, e.Ctx().Opp, drain.IntPart())
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, drain)
|
||||
return true
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 1609, &Effect1609{})
|
||||
input.InitEffect(input.EffectType.Sub, 1609, &Effect1609Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1610, &Effect1610{})
|
||||
input.InitEffect(input.EffectType.Sub, 1610, &Effect1610Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1611, &Effect1611{})
|
||||
input.InitEffect(input.EffectType.Skill, 1612, &Effect1612{})
|
||||
input.InitEffect(input.EffectType.Sub, 1612, &Effect1612Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1613, &Effect1613{})
|
||||
}
|
||||
211
logic/service/fight/effect/1614_1619.go
Normal file
211
logic/service/fight/effect/1614_1619.go
Normal file
@@ -0,0 +1,211 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
element "blazing/common/data/Element"
|
||||
"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 1614: {0}回合内对手使用攻击技能后{1}%令对手{2},未触发则令对手全属性-{3}
|
||||
type Effect1614 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1614) Skill_Use() bool {
|
||||
if len(e.Args()) < 4 || e.Ctx().Opp == nil {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Opp.InitEffect(input.EffectType.Sub, 1614, e.SideEffectArgs...)
|
||||
if sub != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1614Sub struct {
|
||||
RoundEffectSideArg0Base
|
||||
attempted bool
|
||||
triggered bool
|
||||
}
|
||||
|
||||
func (e *Effect1614Sub) Skill_Use() bool {
|
||||
if e.triggered || e.attempted || len(e.Args()) < 4 {
|
||||
return true
|
||||
}
|
||||
skill := e.Ctx().SkillEntity
|
||||
if skill == nil || skill.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
e.attempted = true
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok {
|
||||
if addStatusByID(e.Ctx().Opp, e.Ctx().Our, int(e.Args()[2].IntPart())) {
|
||||
e.triggered = true
|
||||
e.Alive(false)
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1614Sub) TurnEnd() {
|
||||
if e.Duration() == 1 && !e.triggered && len(e.Args()) >= 4 {
|
||||
applyAllPropDown(e.Ctx().Opp, e.Ctx().Our, int8(e.Args()[3].IntPart()))
|
||||
}
|
||||
e.EffectNode.TurnEnd()
|
||||
}
|
||||
|
||||
// Effect 1616: 当回合使用的技能克制对手时获得本系属性加成
|
||||
type Effect1616 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1616) Damage_Mul(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
mul, err := element.Calculator.GetOffensiveMultiplier(e.Ctx().SkillEntity.GetType().ID, e.Ctx().Opp.CurPet[0].GetType().ID)
|
||||
if err != nil || mul <= 1 {
|
||||
return true
|
||||
}
|
||||
zone.Damage = zone.Damage.Mul(hundred.Add(alpacadecimal.NewFromInt(20))).Div(hundred)
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1617: {0}回合内受到攻击后{1}%使对手{2},未触发则自身全属性+{3}
|
||||
type Effect1617 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1617) Skill_Use() bool {
|
||||
if len(e.Args()) < 4 || e.Ctx().Opp == nil {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Opp.InitEffect(input.EffectType.Sub, 1617, e.SideEffectArgs...)
|
||||
if sub != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1617Sub struct {
|
||||
RoundEffectSideArg0Base
|
||||
attempted bool
|
||||
triggered bool
|
||||
}
|
||||
|
||||
func (e *Effect1617Sub) Skill_Use() bool {
|
||||
if e.triggered || e.attempted || len(e.Args()) < 4 {
|
||||
return true
|
||||
}
|
||||
skill := e.Ctx().SkillEntity
|
||||
if skill == nil || skill.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
e.attempted = true
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok {
|
||||
if addStatusByID(e.Ctx().Opp, e.Ctx().Our, int(e.Args()[2].IntPart())) {
|
||||
e.triggered = true
|
||||
e.Alive(false)
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1617Sub) TurnEnd() {
|
||||
if e.Duration() == 1 && !e.triggered && len(e.Args()) >= 4 {
|
||||
applyAllPropUp(e.Ctx().Opp, int8(e.Args()[3].IntPart()))
|
||||
}
|
||||
e.EffectNode.TurnEnd()
|
||||
}
|
||||
|
||||
// Effect 1618: {0}回合内每回合结束时令对手随机{1}个技能PP值归零
|
||||
type Effect1618 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1618) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 || e.Ctx().Opp == nil {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1618, e.SideEffectArgs...)
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1618Sub struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect1618Sub) TurnEnd() {
|
||||
if e.Duration() > 0 && len(e.Args()) >= 2 && e.Ctx().Opp != nil {
|
||||
count := int(e.Args()[1].IntPart())
|
||||
zeroRandomSkillPP(e.Ctx().Opp, count)
|
||||
}
|
||||
e.EffectNode.TurnEnd()
|
||||
}
|
||||
|
||||
// Effect 1619: 50%复制对手当回合释放的技能,未触发则恢复自身最大体力的1/2且令对手全属性-1
|
||||
type Effect1619 struct {
|
||||
node.EffectNode
|
||||
copyAttempted bool
|
||||
copySucceeded bool
|
||||
fallbackApplied bool
|
||||
}
|
||||
|
||||
func (e *Effect1619) ActionStart(fattack, sattack *action.SelectSkillAction) bool {
|
||||
if e.copyAttempted || e.Ctx().Opp == nil {
|
||||
return true
|
||||
}
|
||||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||||
if current == nil || current.SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
opponent := actionByPlayer(fattack, sattack, e.Ctx().Opp.UserID)
|
||||
if opponent == nil || opponent.SkillEntity == nil || opponent.SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
e.copyAttempted = true
|
||||
if ok, _, _ := e.Input.Player.Roll(50, 100); !ok {
|
||||
return true
|
||||
}
|
||||
clone := cloneSkillEntity(opponent.SkillEntity)
|
||||
if clone == nil {
|
||||
return true
|
||||
}
|
||||
current.SkillEntity = clone
|
||||
e.copySucceeded = true
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1619) Skill_Use() bool {
|
||||
if !e.copyAttempted || e.copySucceeded || e.fallbackApplied || e.Ctx().Opp == nil || e.Ctx().Our == nil || e.Ctx().Our.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
heal := e.Ctx().Our.CurPet[0].GetMaxHP().Div(alpacadecimal.NewFromInt(2))
|
||||
if heal.Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.Ctx().Our.Heal(
|
||||
e.Ctx().Our,
|
||||
&action.SelectSkillAction{BaseAction: action.BaseAction{PlayerID: e.Ctx().Our.UserID}},
|
||||
heal,
|
||||
)
|
||||
}
|
||||
applyAllPropDown(e.Ctx().Opp, e.Ctx().Our, 1)
|
||||
e.fallbackApplied = true
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1619) TurnEnd() {
|
||||
e.copyAttempted = false
|
||||
e.copySucceeded = false
|
||||
e.fallbackApplied = false
|
||||
e.EffectNode.TurnEnd()
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 1614, &Effect1614{})
|
||||
input.InitEffect(input.EffectType.Sub, 1614, &Effect1614Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1616, &Effect1616{})
|
||||
input.InitEffect(input.EffectType.Skill, 1617, &Effect1617{})
|
||||
input.InitEffect(input.EffectType.Sub, 1617, &Effect1617Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1618, &Effect1618{})
|
||||
input.InitEffect(input.EffectType.Sub, 1618, &Effect1618Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1619, &Effect1619{})
|
||||
}
|
||||
221
logic/service/fight/effect/1620_1624.go
Normal file
221
logic/service/fight/effect/1620_1624.go
Normal file
@@ -0,0 +1,221 @@
|
||||
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 1620: 对手基础速度值高于{0}则下回合先制-1
|
||||
type Effect1620 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1620) Skill_Use() bool {
|
||||
if len(e.Args()) < 1 || e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
threshold := e.Args()[0].IntPart()
|
||||
if threshold < 0 {
|
||||
threshold = 0
|
||||
}
|
||||
if int64(e.Ctx().Opp.CurPet[0].PetInfo.Spd) <= threshold {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1620, -1)
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1620Sub struct {
|
||||
node.EffectNode
|
||||
priority int
|
||||
}
|
||||
|
||||
func (e *Effect1620Sub) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.Duration(1)
|
||||
e.CanStack(false)
|
||||
if len(a) > 0 {
|
||||
e.priority = a[0]
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Effect1620Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||||
if current == nil || current.SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
current.SkillEntity.XML.Priority += e.priority
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1621: {0}%令对手所有技能PP值-{1},自身满体力时效果翻倍
|
||||
type Effect1621 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1621) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 || e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); !ok {
|
||||
return true
|
||||
}
|
||||
amount := int(e.Args()[1].IntPart())
|
||||
if amount <= 0 {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Our != nil && e.Ctx().Our.CurPet[0] != nil &&
|
||||
e.Ctx().Our.CurPet[0].Info.Hp == e.Ctx().Our.CurPet[0].Info.MaxHp {
|
||||
amount *= 2
|
||||
}
|
||||
e.Ctx().Opp.DelPP(amount)
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1622: {0}回合内每回合{1}%对手属性技能无效,未触发则下{2}次受到的攻击伤害减少{3}%
|
||||
type Effect1622 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1622) Skill_Use() bool {
|
||||
if len(e.Args()) < 4 || e.Ctx().Opp == nil {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1622,
|
||||
int(e.Args()[0].IntPart()),
|
||||
int(e.Args()[1].IntPart()),
|
||||
int(e.Args()[2].IntPart()),
|
||||
int(e.Args()[3].IntPart()),
|
||||
)
|
||||
if sub != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1622Sub struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect1622Sub) SkillHit_ex() 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 {
|
||||
e.Ctx().SkillEntity.SetNoSide()
|
||||
e.Ctx().SkillEntity.AttackTime = 0
|
||||
return true
|
||||
}
|
||||
count := int(e.Args()[2].IntPart())
|
||||
percent := int(e.Args()[3].IntPart())
|
||||
if count <= 0 || percent <= 0 {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Opp.InitEffect(input.EffectType.Sub, 16221, count, percent)
|
||||
if sub != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Opp, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1622DamageSub struct {
|
||||
node.EffectNode
|
||||
remaining int
|
||||
reduction alpacadecimal.Decimal
|
||||
}
|
||||
|
||||
func (e *Effect1622DamageSub) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.CanStack(false)
|
||||
e.Duration(-1)
|
||||
if len(a) > 0 {
|
||||
e.remaining = a[0]
|
||||
}
|
||||
if len(a) > 1 {
|
||||
if a[1] < 0 {
|
||||
a[1] = 0
|
||||
}
|
||||
e.reduction = alpacadecimal.NewFromInt(int64(a[1]))
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Effect1622DamageSub) DamageDivEx(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || e.remaining <= 0 || e.reduction.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
if zone.Damage.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
factor := hundred.Sub(e.reduction)
|
||||
if factor.Cmp(alpacadecimal.Zero) < 0 {
|
||||
factor = alpacadecimal.Zero
|
||||
}
|
||||
zone.Damage = zone.Damage.Mul(factor).Div(hundred)
|
||||
e.remaining--
|
||||
if e.remaining <= 0 {
|
||||
e.Alive(false)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1623: 若对手是{0}精灵则下{1}回合对手受到的伤害提高{2}%
|
||||
type Effect1623 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1623) Skill_Use() bool {
|
||||
if len(e.Args()) < 3 || e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
if int(e.Ctx().Opp.CurPet[0].PetInfo.Type) != int(e.Args()[0].IntPart()) {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1623,
|
||||
int(e.Args()[1].IntPart()),
|
||||
int(e.Args()[2].IntPart()),
|
||||
)
|
||||
if sub != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1623Sub struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect1623Sub) Damage_Mul(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
|
||||
return true
|
||||
}
|
||||
if zone.Damage.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
percent := e.Args()[1]
|
||||
if percent.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
zone.Damage = zone.Damage.Mul(hundred.Add(percent)).Div(hundred)
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1624: 对手不处于异常状态时随机附加{0}种异常状态
|
||||
type Effect1624 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1624) Skill_Use() bool {
|
||||
if len(e.Args()) < 1 || e.Ctx().Opp == nil || e.Args()[0].IntPart() <= 0 {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Opp.StatEffect_Exist_all() {
|
||||
return true
|
||||
}
|
||||
applyRandomStatuses1394(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
|
||||
return true
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 1620, &Effect1620{})
|
||||
input.InitEffect(input.EffectType.Sub, 1620, &Effect1620Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1621, &Effect1621{})
|
||||
input.InitEffect(input.EffectType.Skill, 1622, &Effect1622{})
|
||||
input.InitEffect(input.EffectType.Sub, 1622, &Effect1622Sub{})
|
||||
input.InitEffect(input.EffectType.Sub, 16221, &Effect1622DamageSub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1623, &Effect1623{})
|
||||
input.InitEffect(input.EffectType.Sub, 1623, &Effect1623Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1624, &Effect1624{})
|
||||
}
|
||||
267
logic/service/fight/effect/1625_1629.go
Normal file
267
logic/service/fight/effect/1625_1629.go
Normal file
@@ -0,0 +1,267 @@
|
||||
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"
|
||||
)
|
||||
|
||||
// Effect 1625: 造成的伤害高于{0}则{1}%令自身全属性+{2}
|
||||
type Effect1625 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1625) Skill_Use() bool {
|
||||
if len(e.Args()) < 3 || e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) <= 0 {
|
||||
return true
|
||||
}
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok {
|
||||
applyAllPropUp(e.Ctx().Our, int8(e.Args()[2].IntPart()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1626: 后出手时将当回合护盾所承受的伤害值以百分比伤害的形式{0}%反弹给对手
|
||||
type Effect1626 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1626) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||||
if current == nil || fattack == nil || fattack.PlayerID == e.Ctx().Our.UserID || len(e.Args()) == 0 {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1626, int(e.Args()[0].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1626Sub struct {
|
||||
FixedDuration1Base
|
||||
absorbed alpacadecimal.Decimal
|
||||
}
|
||||
|
||||
func (e *Effect1626Sub) Damage_Shield(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Damage.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
absorbed := alpacadecimal.Min(e.Ctx().Our.CurrentShield(), zone.Damage)
|
||||
if absorbed.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
e.absorbed = e.absorbed.Add(absorbed)
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1626Sub) TurnEnd() {
|
||||
if len(e.Args()) > 0 && e.absorbed.Cmp(alpacadecimal.Zero) > 0 {
|
||||
damage := e.absorbed.Mul(e.Args()[0]).Div(hundred)
|
||||
if damage.Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||||
}
|
||||
}
|
||||
e.EffectNode.TurnEnd()
|
||||
}
|
||||
|
||||
// Effect 1627: {0}回合做{1}-{2}次攻击,若本回合攻击次数达到最大则必定秒杀对手
|
||||
type Effect1627 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1627) Skill_Use() bool {
|
||||
if len(e.Args()) < 3 {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1627, e.SideEffectArgs...)
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1627Sub struct {
|
||||
RoundEffectArg0Base
|
||||
ohko bool
|
||||
}
|
||||
|
||||
func (e *Effect1627Sub) SkillHit() bool {
|
||||
e.ohko = false
|
||||
if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().SkillEntity.AttackTime == 0 {
|
||||
return true
|
||||
}
|
||||
minHits := int(e.Args()[1].IntPart())
|
||||
maxHits := int(e.Args()[2].IntPart())
|
||||
if minHits <= 0 {
|
||||
minHits = 1
|
||||
}
|
||||
if maxHits < minHits {
|
||||
maxHits = minHits
|
||||
}
|
||||
|
||||
hits := minHits
|
||||
if maxHits > minHits {
|
||||
hits += grand.Intn(maxHits - minHits + 1)
|
||||
}
|
||||
if hits > 1 {
|
||||
e.Ctx().SkillEntity.AttackTime += uint32(hits - 1)
|
||||
}
|
||||
e.ohko = hits == maxHits
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1627Sub) OnSkill() bool {
|
||||
if !e.ohko || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.AttackTime == 0 || e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil || e.Ctx().Opp.CurPet[0].Info.Hp == 0 {
|
||||
return true
|
||||
}
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: e.Ctx().Opp.CurPet[0].GetHP(),
|
||||
})
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1628: 每次使用该技能击败对手则恢复自身全部体力,同时重置该技能使用次数并使该技能攻击威力提升{0}点,未击败对手时令自身下回合攻击技能先制+{1}
|
||||
type Effect1628 struct {
|
||||
node.EffectNode
|
||||
bonusPower int
|
||||
}
|
||||
|
||||
func (e *Effect1628) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
if old := t.GetEffect(input.EffectType.Skill, 1628); old != nil {
|
||||
if prev, ok := old.(*Effect1628); ok {
|
||||
e.bonusPower = prev.bonusPower
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Effect1628) SkillHit() bool {
|
||||
if e.bonusPower == 0 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
e.Ctx().SkillEntity.XML.Power += e.bonusPower
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1628) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 || e.Ctx().Our == nil || e.Ctx().Our.CurPet[0] == nil || e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Opp.CurPet[0].Info.Hp == 0 {
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurPet[0].GetMaxHP())
|
||||
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Info != nil {
|
||||
e.Ctx().SkillEntity.Info.PP = uint32(e.Ctx().SkillEntity.XML.MaxPP)
|
||||
}
|
||||
e.bonusPower += int(e.Args()[0].IntPart())
|
||||
return true
|
||||
}
|
||||
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1628, int(e.Args()[1].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1628Sub struct {
|
||||
node.EffectNode
|
||||
remaining int
|
||||
priority int
|
||||
}
|
||||
|
||||
func (e *Effect1628Sub) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.Duration(-1)
|
||||
e.CanStack(false)
|
||||
e.remaining = 1
|
||||
if len(a) > 0 {
|
||||
e.priority = a[0]
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Effect1628Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||||
if e.remaining <= 0 {
|
||||
e.Alive(false)
|
||||
return true
|
||||
}
|
||||
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 += e.priority
|
||||
e.remaining--
|
||||
if e.remaining <= 0 {
|
||||
e.Alive(false)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1629: {0}基础速度值{1}{2}则自身下回合先制+{3}
|
||||
type Effect1629 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1629) Skill_Use() bool {
|
||||
if len(e.Args()) < 4 {
|
||||
return true
|
||||
}
|
||||
compareTarget := e.Ctx().Our
|
||||
if int(e.Args()[1].IntPart()) != 0 {
|
||||
compareTarget = e.Ctx().Opp
|
||||
}
|
||||
if compareTarget == nil || compareTarget.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
speed := alpacadecimal.NewFromInt(int64(compareTarget.CurPet[0].PetInfo.Spd))
|
||||
if !effectCompareByMode(int(e.Args()[2].IntPart()), speed, e.Args()[0]) {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1629, int(e.Args()[3].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1629Sub struct {
|
||||
node.EffectNode
|
||||
remaining int
|
||||
priority int
|
||||
}
|
||||
|
||||
func (e *Effect1629Sub) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.Duration(-1)
|
||||
e.CanStack(false)
|
||||
e.remaining = 1
|
||||
if len(a) > 0 {
|
||||
e.priority = a[0]
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Effect1629Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||||
if e.remaining <= 0 {
|
||||
e.Alive(false)
|
||||
return true
|
||||
}
|
||||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||||
if current == nil || current.SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
current.SkillEntity.XML.Priority += e.priority
|
||||
e.remaining--
|
||||
if e.remaining <= 0 {
|
||||
e.Alive(false)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 1625, &Effect1625{})
|
||||
input.InitEffect(input.EffectType.Skill, 1626, &Effect1626{})
|
||||
input.InitEffect(input.EffectType.Sub, 1626, &Effect1626Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1627, &Effect1627{})
|
||||
input.InitEffect(input.EffectType.Sub, 1627, &Effect1627Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1628, &Effect1628{})
|
||||
input.InitEffect(input.EffectType.Sub, 1628, &Effect1628Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1629, &Effect1629{})
|
||||
input.InitEffect(input.EffectType.Sub, 1629, &Effect1629Sub{})
|
||||
}
|
||||
197
logic/service/fight/effect/1630_1634.go
Normal file
197
logic/service/fight/effect/1630_1634.go
Normal file
@@ -0,0 +1,197 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"math"
|
||||
|
||||
"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 1630: 若对手当回合使用的技能为攻击技能则自身必定先出手且命中后{0}%令对手{1}
|
||||
type Effect1630 struct {
|
||||
node.EffectNode
|
||||
armed bool
|
||||
}
|
||||
|
||||
func (e *Effect1630) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||||
e.armed = false
|
||||
if len(e.Args()) < 2 || e.Ctx().Opp == nil {
|
||||
return true
|
||||
}
|
||||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||||
oppAction := actionByPlayer(fattack, sattack, e.Ctx().Opp.UserID)
|
||||
if current == nil || current.SkillEntity == nil || oppAction == nil || oppAction.SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
if oppAction.SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
current.SkillEntity.XML.Priority = math.MaxInt
|
||||
e.armed = true
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1630) OnSkill() bool {
|
||||
if !e.armed || len(e.Args()) < 2 || e.Ctx().Opp == nil || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.AttackTime == 0 {
|
||||
return true
|
||||
}
|
||||
chance := int(e.Args()[0].IntPart())
|
||||
if chance <= 0 {
|
||||
e.armed = false
|
||||
return true
|
||||
}
|
||||
success, _, _ := e.Input.Player.Roll(chance, 100)
|
||||
if success {
|
||||
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[1].IntPart()))
|
||||
if statusEffect != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
||||
}
|
||||
}
|
||||
e.armed = false
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1631: {0}回合内每回合若自身未受到攻击伤害则回合结束后附加对手最大体力1/{1}的百分比伤害(自身体力为0时也可触发)
|
||||
type Effect1631 struct {
|
||||
RoundEffectArg0Base
|
||||
hitThisRound bool
|
||||
}
|
||||
|
||||
func (e *Effect1631) DamageSubEx(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
|
||||
return true
|
||||
}
|
||||
if zone.Damage.Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.hitThisRound = true
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1631) TurnEnd() {
|
||||
if !e.hitThisRound && len(e.Args()) >= 2 && e.Ctx().Opp != nil && e.Ctx().Opp.CurPet[0] != nil {
|
||||
denom := e.Args()[1]
|
||||
if denom.Cmp(alpacadecimal.Zero) > 0 {
|
||||
damage := e.Ctx().Opp.CurPet[0].GetMaxHP().Div(denom)
|
||||
if damage.Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Percent,
|
||||
Damage: damage,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
e.hitThisRound = false
|
||||
e.EffectNode.TurnEnd()
|
||||
}
|
||||
|
||||
// Effect 1632: 吸取对手{0}点体力,若对手任意1项技能PP值小于{1}点则额外吸取{2}点体力
|
||||
type Effect1632 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect1632) Skill_Use() bool {
|
||||
if len(e.Args()) < 3 || e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil || e.Ctx().Our == nil {
|
||||
return true
|
||||
}
|
||||
drain := alpacadecimal.Zero
|
||||
if e.Args()[0].Cmp(alpacadecimal.Zero) > 0 {
|
||||
drain = drain.Add(e.Args()[0])
|
||||
}
|
||||
threshold := int(e.Args()[1].IntPart())
|
||||
if threshold > 0 {
|
||||
for _, skill := range e.Ctx().Opp.CurPet[0].Info.SkillList {
|
||||
if int(skill.PP) < threshold {
|
||||
if e.Args()[2].Cmp(alpacadecimal.Zero) > 0 {
|
||||
drain = drain.Add(e.Args()[2])
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if drain.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
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
|
||||
}
|
||||
|
||||
// Effect 1633: 使自身体力百分比与对手体力百分比对调,自身体力百分比高于对手时{0}%令对手{1}
|
||||
type Effect1633 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func clampHP(dec alpacadecimal.Decimal, max uint32) uint32 {
|
||||
value := dec.IntPart()
|
||||
if value < 0 {
|
||||
return 0
|
||||
}
|
||||
if int64(value) > int64(max) {
|
||||
return max
|
||||
}
|
||||
return uint32(value)
|
||||
}
|
||||
|
||||
func (e *Effect1633) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 || e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil || e.Ctx().Our == nil || e.Ctx().Our.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
ourPet := e.Ctx().Our.CurPet[0]
|
||||
oppPet := e.Ctx().Opp.CurPet[0]
|
||||
ourMax := ourPet.GetMaxHP()
|
||||
oppMax := oppPet.GetMaxHP()
|
||||
if ourMax.Cmp(alpacadecimal.Zero) <= 0 || oppMax.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
ourPercent := ourPet.GetHP().Div(ourMax)
|
||||
oppPercent := oppPet.GetHP().Div(oppMax)
|
||||
shouldInflict := ourPercent.Cmp(oppPercent) > 0
|
||||
ourPet.Info.Hp = clampHP(oppPercent.Mul(ourMax), ourPet.Info.MaxHp)
|
||||
oppPet.Info.Hp = clampHP(ourPercent.Mul(oppMax), oppPet.Info.MaxHp)
|
||||
if shouldInflict && e.Args()[0].Cmp(alpacadecimal.Zero) > 0 {
|
||||
chance := int(e.Args()[0].IntPart())
|
||||
success, _, _ := e.Input.Player.Roll(chance, 100)
|
||||
if success {
|
||||
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[1].IntPart()))
|
||||
if statusEffect != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1634: 自身体力低于250时必定先手
|
||||
type Effect1634 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect1634) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||||
if e.Ctx().Our == nil || e.Ctx().Our.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
if int64(e.Ctx().Our.CurPet[0].Info.Hp) >= 250 {
|
||||
return true
|
||||
}
|
||||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||||
if current == nil || current.SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
current.SkillEntity.XML.Priority = math.MaxInt
|
||||
return true
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 1630, &Effect1630{})
|
||||
input.InitEffect(input.EffectType.Skill, 1631, &Effect1631{})
|
||||
input.InitEffect(input.EffectType.Skill, 1632, &Effect1632{})
|
||||
input.InitEffect(input.EffectType.Skill, 1633, &Effect1633{})
|
||||
input.InitEffect(input.EffectType.Skill, 1634, &Effect1634{})
|
||||
}
|
||||
181
logic/service/fight/effect/1635_1639.go
Normal file
181
logic/service/fight/effect/1635_1639.go
Normal file
@@ -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"
|
||||
"github.com/gogf/gf/v2/util/grand"
|
||||
)
|
||||
|
||||
// Effect 1635: 立刻恢复自身{0}点体力,{1}回合后恢复自身全部体力
|
||||
type Effect1635 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1635) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 || e.Ctx().Our == nil {
|
||||
return true
|
||||
}
|
||||
if e.Args()[0].Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Args()[0])
|
||||
}
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1635, int(e.Args()[1].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1635Sub struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect1635Sub) TurnEnd() {
|
||||
if e.Duration() == 1 && e.Ctx().Our != nil && e.Ctx().Our.CurPet[0] != nil {
|
||||
heal := e.Ctx().Our.CurPet[0].GetMaxHP().Sub(e.Ctx().Our.CurPet[0].GetHP())
|
||||
if heal.Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
|
||||
}
|
||||
}
|
||||
e.EffectNode.TurnEnd()
|
||||
}
|
||||
|
||||
// Effect 1636: 涵双1回合释放4-8张玫瑰卡牌进行攻击,每张卡牌额外附加50点固定伤害,自身体力低于最大体力的1/3时效果翻倍
|
||||
type Effect1636 struct {
|
||||
node.EffectNode
|
||||
bonus alpacadecimal.Decimal
|
||||
}
|
||||
|
||||
func (e *Effect1636) SkillHit() bool {
|
||||
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().SkillEntity.AttackTime == 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
hits := 4 + grand.Intn(5)
|
||||
if e.Ctx().Our != nil && e.Ctx().Our.CurPet[0] != nil {
|
||||
threshold := e.Ctx().Our.CurPet[0].GetMaxHP().Div(alpacadecimal.NewFromInt(3))
|
||||
if e.Ctx().Our.CurPet[0].GetHP().Cmp(threshold) < 0 {
|
||||
hits *= 2
|
||||
}
|
||||
}
|
||||
if hits > 1 {
|
||||
e.Ctx().SkillEntity.AttackTime += uint32(hits - 1)
|
||||
}
|
||||
e.bonus = alpacadecimal.NewFromInt(int64(hits * 50))
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1636) DamageAdd(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || e.bonus.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
zone.Damage = zone.Damage.Add(e.bonus)
|
||||
e.bonus = alpacadecimal.Zero
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1637: {0}回合内若对手使用属性技能,则使用属性技能后的下{1}回合属性技能命中效果失效
|
||||
type Effect1637 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1637) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 || e.Ctx().Opp == nil {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Opp.InitEffect(input.EffectType.Sub, 1637, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1637Sub struct {
|
||||
RoundEffectArg0Base
|
||||
triggered bool
|
||||
}
|
||||
|
||||
func (e *Effect1637Sub) ActionStart(fattack, sattack *action.SelectSkillAction) bool {
|
||||
if e.triggered || len(e.Args()) < 2 {
|
||||
return true
|
||||
}
|
||||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||||
if current == nil || current.SkillEntity == nil || current.SkillEntity.Category() != info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 16371, int(e.Args()[1].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Opp, sub)
|
||||
}
|
||||
e.triggered = true
|
||||
e.Alive(false)
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect16371Sub struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect16371Sub) SkillHit_ex() bool {
|
||||
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
e.Ctx().SkillEntity.SetNoSide()
|
||||
e.Ctx().SkillEntity.AttackTime = 0
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1638: {0}回合内若自身未受到攻击伤害则令对手全属性-{1}
|
||||
type Effect1638 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1638) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 || e.Ctx().Our == nil {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1638, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1638Sub struct {
|
||||
RoundEffectArg0Base
|
||||
touched bool
|
||||
}
|
||||
|
||||
func (e *Effect1638Sub) DamageSubEx(zone *info.DamageZone) bool {
|
||||
if zone != nil && zone.Type == info.DamageType.Red && zone.Damage.Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.touched = true
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1638Sub) TurnEnd() {
|
||||
if !e.touched && len(e.Args()) >= 2 {
|
||||
applyAllPropDown(e.Ctx().Our, e.Ctx().Opp, int8(e.Args()[1].IntPart()))
|
||||
}
|
||||
e.touched = false
|
||||
e.EffectNode.TurnEnd()
|
||||
}
|
||||
|
||||
// Effect 1639: 自身处于能力提升状态时100%打出致命一击
|
||||
type Effect1639 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1639) SkillHit() bool {
|
||||
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().SkillEntity.AttackTime == 0 {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Our == nil || !e.Ctx().Our.HasPropADD() {
|
||||
return true
|
||||
}
|
||||
e.Ctx().SkillEntity.XML.CritRate = 16
|
||||
return true
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 1635, &Effect1635{})
|
||||
input.InitEffect(input.EffectType.Sub, 1635, &Effect1635Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1636, &Effect1636{})
|
||||
input.InitEffect(input.EffectType.Skill, 1637, &Effect1637{})
|
||||
input.InitEffect(input.EffectType.Sub, 1637, &Effect1637Sub{})
|
||||
input.InitEffect(input.EffectType.Sub, 16371, &Effect16371Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1638, &Effect1638{})
|
||||
input.InitEffect(input.EffectType.Sub, 1638, &Effect1638Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1639, &Effect1639{})
|
||||
}
|
||||
134
logic/service/fight/effect/1640_1644.go
Normal file
134
logic/service/fight/effect/1640_1644.go
Normal file
@@ -0,0 +1,134 @@
|
||||
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 1640: 出手时若自身满体力则100%打出致命一击
|
||||
type Effect1640 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1640) SkillHit() bool {
|
||||
if e.Ctx().Our == nil || e.Ctx().Our.CurPet[0] == nil || e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().SkillEntity.AttackTime == 0 {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Our.CurPet[0].GetHP().Cmp(e.Ctx().Our.CurPet[0].GetMaxHP()) < 0 {
|
||||
return true
|
||||
}
|
||||
e.Ctx().SkillEntity.XML.CritRate = 16
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1641: 自身处于能力提升状态时造成伤害的{0}%恢复自身体力值,当前体力低于最大体力的1/{1}时附加等量百分比伤害
|
||||
type Effect1641 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1641) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 || e.Ctx().Our == nil || e.Ctx().Our.CurPet[0] == nil || e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
if !e.Ctx().Our.HasPropADD() || e.Ctx().Our.SumDamage.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
heal := e.Ctx().Our.SumDamage.Mul(e.Args()[0]).Div(hundred)
|
||||
if heal.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
|
||||
|
||||
if e.Args()[1].Cmp(alpacadecimal.Zero) > 0 {
|
||||
threshold := e.Ctx().Our.CurPet[0].GetMaxHP().Div(e.Args()[1])
|
||||
if e.Ctx().Our.CurPet[0].GetHP().Cmp(threshold) < 0 {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: heal})
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1642: 消除对手能力提升状态,消除成功则{0}%随机为对手任意技能散布{1}枚致命印记
|
||||
type Effect1642 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1642) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 || e.Ctx().Opp == nil {
|
||||
return true
|
||||
}
|
||||
if !clearPositiveProps(e.Ctx().Opp, e.Ctx().Our) {
|
||||
return true
|
||||
}
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
|
||||
spreadFatalMarks(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1643: 对手每存在1层致命裂痕则附加{0}点真实伤害
|
||||
type Effect1643 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1643) OnSkill() bool {
|
||||
layers := fatalMarkCount(e.Ctx().Opp)
|
||||
if len(e.Args()) == 0 || layers <= 0 {
|
||||
return true
|
||||
}
|
||||
damage := e.Args()[0].Mul(alpacadecimal.NewFromInt(int64(layers)))
|
||||
if damage.Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: damage})
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1644: {0}回合内对手使用攻击技能则随机进入{1}种异常状态,未触发则随机为对手任意技能散布{2}枚致命印记
|
||||
type Effect1644 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1644) Skill_Use() bool {
|
||||
if len(e.Args()) < 3 || e.Ctx().Opp == nil {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Opp.InitEffect(input.EffectType.Sub, 1644, e.SideEffectArgs...)
|
||||
if sub != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1644Sub struct {
|
||||
RoundEffectArg0Base
|
||||
triggered bool
|
||||
}
|
||||
|
||||
func (e *Effect1644Sub) Action_end() bool {
|
||||
if e.triggered || 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
|
||||
}
|
||||
if e.Args()[1].IntPart() > 0 {
|
||||
applyRandomStatuses1507(e.Ctx().Opp, e.Ctx().Our, int(e.Args()[1].IntPart()))
|
||||
}
|
||||
e.triggered = true
|
||||
e.Alive(false)
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1644Sub) TurnEnd() {
|
||||
if e.Duration() == 1 && !e.triggered && len(e.Args()) >= 3 {
|
||||
spreadFatalMarks(e.Ctx().Opp, e.Ctx().Our, int(e.Args()[2].IntPart()))
|
||||
}
|
||||
e.EffectNode.TurnEnd()
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 1640, &Effect1640{})
|
||||
input.InitEffect(input.EffectType.Skill, 1641, &Effect1641{})
|
||||
input.InitEffect(input.EffectType.Skill, 1642, &Effect1642{})
|
||||
input.InitEffect(input.EffectType.Skill, 1643, &Effect1643{})
|
||||
input.InitEffect(input.EffectType.Skill, 1644, &Effect1644{})
|
||||
input.InitEffect(input.EffectType.Sub, 1644, &Effect1644Sub{})
|
||||
}
|
||||
213
logic/service/fight/effect/1645_1649.go
Normal file
213
logic/service/fight/effect/1645_1649.go
Normal file
@@ -0,0 +1,213 @@
|
||||
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 1645: {0}回合内对手使用属性技能则自身下{1}次受到的攻击伤害减少{2}%
|
||||
type Effect1645 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1645) Skill_Use() bool {
|
||||
if len(e.Args()) < 3 || e.Ctx().Opp == nil {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Opp.InitEffect(input.EffectType.Sub, 1645, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1645Sub struct {
|
||||
RoundEffectArg0Base
|
||||
triggered bool
|
||||
}
|
||||
|
||||
func (e *Effect1645Sub) Skill_Use() bool {
|
||||
if e.triggered || len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Opp.InitEffect(input.EffectType.Sub, 16451, int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
e.triggered = true
|
||||
e.Alive(false)
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1645ReduceSub struct {
|
||||
node.EffectNode
|
||||
remaining int
|
||||
reduce alpacadecimal.Decimal
|
||||
}
|
||||
|
||||
func (e *Effect1645ReduceSub) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.Duration(-1)
|
||||
e.CanStack(false)
|
||||
if len(a) > 0 {
|
||||
e.remaining = a[0]
|
||||
}
|
||||
if len(a) > 1 {
|
||||
e.reduce = alpacadecimal.NewFromInt(int64(a[1]))
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Effect1645ReduceSub) DamageDivEx(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || e.remaining <= 0 || e.reduce.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
zone.Damage = zone.Damage.Mul(hundred.Sub(e.reduce)).Div(hundred)
|
||||
e.remaining--
|
||||
if e.remaining <= 0 {
|
||||
e.Alive(false)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1646: 全属性+{0},对手存在致命裂痕时强化效果翻倍
|
||||
type Effect1646 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1646) Skill_Use() bool {
|
||||
if len(e.Args()) == 0 || e.Ctx().Our == nil {
|
||||
return true
|
||||
}
|
||||
boost := int8(e.Args()[0].IntPart())
|
||||
if fatalMarkCount(e.Ctx().Opp) > 0 {
|
||||
boost *= 2
|
||||
}
|
||||
applyAllPropUp(e.Ctx().Our, boost)
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1647: {0}回合内每回合使用技能吸取对手最大体力的1/{1},吸取体力时若自身体力低于最大体力的1/{2}则吸取效果翻倍,对手免疫百分比伤害时额外附加{3}点真实伤害
|
||||
type Effect1647 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1647) Skill_Use() bool {
|
||||
if len(e.Args()) < 4 || e.Ctx().Our == nil {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1647, e.SideEffectArgs...)
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1647Sub struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect1647Sub) OnSkill() bool {
|
||||
if len(e.Args()) < 4 || e.Ctx().Our == nil || e.Ctx().Our.CurPet[0] == nil || e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().SkillEntity == nil || e.Args()[1].Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
drain := e.Ctx().Opp.CurPet[0].GetMaxHP().Div(e.Args()[1])
|
||||
if e.Args()[2].Cmp(alpacadecimal.Zero) > 0 {
|
||||
threshold := e.Ctx().Our.CurPet[0].GetMaxHP().Div(e.Args()[2])
|
||||
if e.Ctx().Our.CurPet[0].GetHP().Cmp(threshold) < 0 {
|
||||
drain = drain.Mul(alpacadecimal.NewFromInt(2))
|
||||
}
|
||||
}
|
||||
if drain.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
before := e.Ctx().Opp.CurPet[0].GetHP()
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: drain})
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, drain)
|
||||
if e.Ctx().Opp.CurPet[0].GetHP().Cmp(before) == 0 && e.Args()[3].Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: e.Args()[3]})
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1648: 附加自身最大体力{0}%的百分比伤害并恢复等量体力值,对手存在致命裂痕时转变为等量的真实伤害
|
||||
type Effect1648 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1648) OnSkill() bool {
|
||||
if len(e.Args()) == 0 || e.Ctx().Our == nil || e.Ctx().Our.CurPet[0] == nil || e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
damage := e.Ctx().Our.CurPet[0].GetMaxHP().Mul(e.Args()[0]).Div(hundred)
|
||||
if damage.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
zone := &info.DamageZone{Type: info.DamageType.Percent, Damage: damage}
|
||||
if fatalMarkCount(e.Ctx().Opp) > 0 {
|
||||
zone.Type = info.DamageType.True
|
||||
}
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, zone)
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1649: {0}%概率造成的攻击伤害为{1}倍,对手每存在1层致命裂痕则概率提升{2}%,未触发则{3}回合内令对手使用的属性技能无效
|
||||
type Effect1649 struct {
|
||||
node.EffectNode
|
||||
resolved bool
|
||||
}
|
||||
|
||||
func (e *Effect1649) Damage_Mul(zone *info.DamageZone) bool {
|
||||
if e.resolved || zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 4 || e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
chance := int(e.Args()[0].IntPart()) + fatalMarkCount(e.Ctx().Opp)*int(e.Args()[2].IntPart())
|
||||
if chance > 100 {
|
||||
chance = 100
|
||||
}
|
||||
if ok, _, _ := e.Input.Player.Roll(chance, 100); ok {
|
||||
mul := int(e.Args()[1].IntPart())
|
||||
if mul < 1 {
|
||||
mul = 1
|
||||
}
|
||||
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(int64(mul)))
|
||||
e.resolved = true
|
||||
return true
|
||||
}
|
||||
|
||||
sub := e.Ctx().Opp.InitEffect(input.EffectType.Sub, 16494, int(e.Args()[3].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
e.resolved = true
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1649) TurnEnd() {
|
||||
e.resolved = false
|
||||
e.EffectNode.TurnEnd()
|
||||
}
|
||||
|
||||
type Effect1649BlockSub struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect1649BlockSub) SkillHit_ex() bool {
|
||||
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
e.Ctx().SkillEntity.SetNoSide()
|
||||
e.Ctx().SkillEntity.AttackTime = 0
|
||||
return true
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 1645, &Effect1645{})
|
||||
input.InitEffect(input.EffectType.Sub, 1645, &Effect1645Sub{})
|
||||
input.InitEffect(input.EffectType.Sub, 16451, &Effect1645ReduceSub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1646, &Effect1646{})
|
||||
input.InitEffect(input.EffectType.Skill, 1647, &Effect1647{})
|
||||
input.InitEffect(input.EffectType.Sub, 1647, &Effect1647Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1648, &Effect1648{})
|
||||
input.InitEffect(input.EffectType.Skill, 1649, &Effect1649{})
|
||||
input.InitEffect(input.EffectType.Sub, 16494, &Effect1649BlockSub{})
|
||||
}
|
||||
@@ -10,8 +10,8 @@ type Effect165 struct {
|
||||
}
|
||||
|
||||
func (e *Effect165) Skill_Use() bool {
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, 1, int8(e.SideEffectArgs[1]))
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, 3, int8(e.SideEffectArgs[1]))
|
||||
e.CarrierInput().SetProp(e.CarrierInput(), 1, int8(e.SideEffectArgs[1]))
|
||||
e.CarrierInput().SetProp(e.CarrierInput(), 3, int8(e.SideEffectArgs[1]))
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
|
||||
287
logic/service/fight/effect/1650_1654.go
Normal file
287
logic/service/fight/effect/1650_1654.go
Normal file
@@ -0,0 +1,287 @@
|
||||
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"
|
||||
)
|
||||
|
||||
const fatalMarkDamagePercent = 10
|
||||
|
||||
func fatalMarkSkillIDs(target *input.Input) []int {
|
||||
if target == nil || target.CurPet[0] == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
ids := make([]int, 0, len(target.CurPet[0].Skills))
|
||||
for _, skill := range target.CurPet[0].Skills {
|
||||
if skill == nil {
|
||||
continue
|
||||
}
|
||||
ids = append(ids, skill.XML.ID)
|
||||
}
|
||||
if len(ids) > 0 {
|
||||
return ids
|
||||
}
|
||||
|
||||
ids = make([]int, 0, len(target.CurPet[0].Info.SkillList))
|
||||
for _, skillInfo := range target.CurPet[0].Info.SkillList {
|
||||
ids = append(ids, int(skillInfo.ID))
|
||||
}
|
||||
return ids
|
||||
}
|
||||
|
||||
func addFatalMark(owner, target *input.Input, skillID int) bool {
|
||||
if owner == nil || target == nil || skillID == 0 {
|
||||
return false
|
||||
}
|
||||
sub := target.InitEffect(input.EffectType.Sub, 1650, skillID)
|
||||
if sub == nil {
|
||||
return false
|
||||
}
|
||||
target.AddEffect(owner, sub)
|
||||
return true
|
||||
}
|
||||
|
||||
func spreadFatalMarks(owner, target *input.Input, count int) {
|
||||
if owner == nil || target == nil || target.CurPet[0] == nil || count <= 0 {
|
||||
return
|
||||
}
|
||||
|
||||
ids := fatalMarkSkillIDs(target)
|
||||
if len(ids) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
for i := 0; i < count; i++ {
|
||||
skillID := ids[grand.Intn(len(ids))]
|
||||
if addFatalMark(owner, target, skillID) {
|
||||
target.CurPet[0].FatalCrackLayers++
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func fatalMarkCount(target *input.Input) int {
|
||||
if target == nil || target.CurPet[0] == nil {
|
||||
return 0
|
||||
}
|
||||
return target.CurPet[0].FatalCrackLayers
|
||||
}
|
||||
|
||||
func consumeFatalMarkTransform(target *input.Input) (int, bool) {
|
||||
if target == nil {
|
||||
return 0, false
|
||||
}
|
||||
eff := target.GetEffect(input.EffectType.Sub, 1651)
|
||||
if eff == nil {
|
||||
return 0, false
|
||||
}
|
||||
sub, ok := eff.(*Effect1651Sub)
|
||||
if !ok || sub.remaining <= 0 {
|
||||
return 0, false
|
||||
}
|
||||
divisor := sub.divisor
|
||||
if divisor <= 0 {
|
||||
divisor = 1
|
||||
}
|
||||
sub.remaining--
|
||||
if sub.remaining <= 0 {
|
||||
sub.Alive(false)
|
||||
}
|
||||
return divisor, true
|
||||
}
|
||||
|
||||
// Effect 1650: 命中后{0}%随机为对手任意技能散布{1}枚致命印记,若对手当前精灵致命裂痕≥{2}层则额外散布{3}枚致命印记
|
||||
type Effect1650 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1650) SkillHit() bool {
|
||||
if len(e.Args()) < 4 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().SkillEntity.AttackTime == 0 || e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); !ok {
|
||||
return true
|
||||
}
|
||||
|
||||
count := int(e.Args()[1].IntPart())
|
||||
if fatalMarkCount(e.Ctx().Opp) >= int(e.Args()[2].IntPart()) {
|
||||
count += int(e.Args()[3].IntPart())
|
||||
}
|
||||
spreadFatalMarks(e.Ctx().Our, e.Ctx().Opp, count)
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1650MarkSub struct {
|
||||
node.EffectNode
|
||||
trackedPet *info.BattlePetEntity
|
||||
skillID int
|
||||
}
|
||||
|
||||
func (e *Effect1650MarkSub) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.Duration(-1)
|
||||
e.CanStack(true)
|
||||
e.trackedPet = t.CurPet[0]
|
||||
if len(a) > 0 {
|
||||
e.skillID = a[0]
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Effect1650MarkSub) Skill_Use() bool {
|
||||
if e.trackedPet == nil || e.skillID == 0 || e.Ctx().Our == nil || e.Ctx().Our.CurPet[0] != e.trackedPet || e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().SkillEntity.XML.ID != e.skillID {
|
||||
return true
|
||||
}
|
||||
|
||||
var damage alpacadecimal.Decimal
|
||||
if divisor, ok := consumeFatalMarkTransform(e.Ctx().Our); ok {
|
||||
damage = e.trackedPet.GetMaxHP().Div(alpacadecimal.NewFromInt(int64(divisor)))
|
||||
} else {
|
||||
damage = e.trackedPet.GetMaxHP().Mul(alpacadecimal.NewFromInt(fatalMarkDamagePercent)).Div(hundred)
|
||||
}
|
||||
if damage.Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.Ctx().Our.Damage(e.Ctx().Opp, &info.DamageZone{Type: info.DamageType.True, Damage: damage})
|
||||
}
|
||||
if e.trackedPet.FatalCrackLayers > 0 {
|
||||
e.trackedPet.FatalCrackLayers--
|
||||
}
|
||||
e.Alive(false)
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1650MarkSub) SwitchOut(in *input.Input) bool {
|
||||
if in == e.Ctx().Our {
|
||||
e.Alive(false)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1651: 当回合击败对手则令对手下{0}次触发致命印记真实伤害效果转变为1/{1}
|
||||
type Effect1651 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1651) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 || e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil || e.Ctx().Opp.CurPet[0].Info.Hp > 0 {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Opp.InitEffect(input.EffectType.Sub, 1651, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1651Sub struct {
|
||||
node.EffectNode
|
||||
remaining int
|
||||
divisor int
|
||||
}
|
||||
|
||||
func (e *Effect1651Sub) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.Duration(-1)
|
||||
e.CanStack(false)
|
||||
if len(a) > 0 {
|
||||
e.remaining = a[0]
|
||||
}
|
||||
if len(a) > 1 {
|
||||
e.divisor = a[1]
|
||||
}
|
||||
}
|
||||
|
||||
// Effect 1652: 释放技能时自身每损失{0}%的体力值则此技能威力提升{1}点
|
||||
type Effect1652 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1652) SkillHit() bool {
|
||||
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().SkillEntity.AttackTime == 0 || e.Ctx().Our == nil || e.Ctx().Our.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
if e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
maxHP := e.Ctx().Our.CurPet[0].GetMaxHP()
|
||||
if maxHP.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
lostPercent := maxHP.Sub(e.Ctx().Our.CurPet[0].GetHP()).Mul(hundred).Div(maxHP)
|
||||
tiers := int(lostPercent.Div(e.Args()[0]).IntPart())
|
||||
if tiers <= 0 {
|
||||
return true
|
||||
}
|
||||
setSkillPowerOverride(e.Ctx().SkillEntity, tiers*int(e.Args()[1].IntPart()))
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1653: 释放技能时对手每残留{0}%的体力值则此技能附加{1}点固定伤害
|
||||
type Effect1653 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1653) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().SkillEntity.AttackTime == 0 || e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
if e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
maxHP := e.Ctx().Opp.CurPet[0].GetMaxHP()
|
||||
if maxHP.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
remainPercent := e.Ctx().Opp.CurPet[0].GetHP().Mul(hundred).Div(maxHP)
|
||||
tiers := int(remainPercent.Div(e.Args()[0]).IntPart())
|
||||
if tiers <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
damage := e.Args()[1].Mul(alpacadecimal.NewFromInt(int64(tiers)))
|
||||
if damage.Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: damage})
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1654: 当回合击败对手则令对手下只登场精灵首次使用的技能所附加的效果失效
|
||||
type Effect1654 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1654) Skill_Use() bool {
|
||||
if e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil || e.Ctx().Opp.CurPet[0].Info.Hp > 0 {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Opp.InitEffect(input.EffectType.Sub, 1654)
|
||||
if sub != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1654Sub struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1654Sub) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.Duration(-1)
|
||||
e.CanStack(false)
|
||||
}
|
||||
|
||||
func (e *Effect1654Sub) OnSkill() bool {
|
||||
if e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
e.Ctx().SkillEntity.SetNoSide()
|
||||
e.Alive(false)
|
||||
return true
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 1650, &Effect1650{})
|
||||
input.InitEffect(input.EffectType.Sub, 1650, &Effect1650MarkSub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1651, &Effect1651{})
|
||||
input.InitEffect(input.EffectType.Sub, 1651, &Effect1651Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1652, &Effect1652{})
|
||||
input.InitEffect(input.EffectType.Skill, 1653, &Effect1653{})
|
||||
input.InitEffect(input.EffectType.Skill, 1654, &Effect1654{})
|
||||
input.InitEffect(input.EffectType.Sub, 1654, &Effect1654Sub{})
|
||||
}
|
||||
219
logic/service/fight/effect/1655_1659.go
Normal file
219
logic/service/fight/effect/1655_1659.go
Normal file
@@ -0,0 +1,219 @@
|
||||
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"
|
||||
)
|
||||
|
||||
// Effect 1655: {0}回合内每回合结束后{1}%恢复自身所有技能{2}点PP值
|
||||
type Effect1655 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1655) Skill_Use() bool {
|
||||
if len(e.Args()) < 3 || e.Ctx().Our == nil {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1655, 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 Effect1655Sub struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect1655Sub) TurnEnd() {
|
||||
if len(e.Args()) >= 3 {
|
||||
chance := int(e.Args()[1].IntPart())
|
||||
amount := int(e.Args()[2].IntPart())
|
||||
if chance > 0 && amount > 0 {
|
||||
if ok, _, _ := e.Input.Player.Roll(chance, 100); ok {
|
||||
e.Ctx().Our.HealPP(amount)
|
||||
}
|
||||
}
|
||||
}
|
||||
e.EffectNode.TurnEnd()
|
||||
}
|
||||
|
||||
// Effect 1656: 100%复制对手当回合释放的技能,若对手当回合使用的技能为攻击技能则令对手随机1个技能PP值归零,若对手当回合使用的技能为属性技能则令对手下回合先制-2
|
||||
type Effect1656 struct {
|
||||
node.EffectNode
|
||||
applied bool
|
||||
}
|
||||
|
||||
func (e *Effect1656) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||||
if e.applied || e.Ctx().Our == nil || e.Ctx().Opp == nil {
|
||||
return true
|
||||
}
|
||||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||||
opponent := actionByPlayer(fattack, sattack, e.Ctx().Opp.UserID)
|
||||
if current == nil || opponent == nil || opponent.SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
clone := cloneSkillEntity(opponent.SkillEntity)
|
||||
if clone == nil {
|
||||
return true
|
||||
}
|
||||
current.SkillEntity = clone
|
||||
e.applied = true
|
||||
|
||||
if opponent.SkillEntity.Category() == info.Category.STATUS {
|
||||
sub := e.Ctx().Opp.InitEffect(input.EffectType.Sub, 1656, 2)
|
||||
if sub != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
} else {
|
||||
zeroRandomSkillPP(e.Ctx().Opp, 1)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1656) Action_end() bool {
|
||||
e.applied = false
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1656Sub struct {
|
||||
FixedDuration1Base
|
||||
priority int
|
||||
}
|
||||
|
||||
func (e *Effect1656Sub) SetArgs(t *input.Input, a ...int) {
|
||||
e.FixedDuration1Base.SetArgs(t, a...)
|
||||
e.CanStack(false)
|
||||
if len(a) > 0 {
|
||||
e.priority = a[0]
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Effect1656Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||||
if e.priority == 0 {
|
||||
return true
|
||||
}
|
||||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||||
if current == nil || current.SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
current.SkillEntity.XML.Priority -= e.priority
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1657: 己方每有一只精灵死亡则附加{0}点固定伤害,对手体力高于最大体力的1/{1}时转变为{2}点
|
||||
type Effect1657 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1657) Skill_Use() bool {
|
||||
if len(e.Args()) < 3 || e.Ctx().Our == nil || e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
dead := countPets(e.Ctx().Our, false)
|
||||
if dead <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
perDead := e.Args()[0]
|
||||
if e.Args()[1].Cmp(alpacadecimal.Zero) > 0 {
|
||||
threshold := e.Ctx().Opp.CurPet[0].GetMaxHP().Div(e.Args()[1])
|
||||
if e.Ctx().Opp.CurPet[0].GetHP().Cmp(threshold) > 0 {
|
||||
perDead = e.Args()[2]
|
||||
}
|
||||
}
|
||||
|
||||
damage := perDead.Mul(alpacadecimal.NewFromInt(int64(dead)))
|
||||
if damage.Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: damage})
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1658: 3回合内每回合80%闪避对手攻击,未触发时自身处于圣念状态则使对手随机1项技能PP值归零,自身处于邪念状态则使对手失明
|
||||
type Effect1658 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1658) Skill_Use() bool {
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1658, 3, 80)
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1658Sub struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect1658Sub) SkillHit_ex() bool {
|
||||
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().SkillEntity.AttackTime == 0 || e.Ctx().Opp == nil {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().SkillEntity.AttackTime == 2 {
|
||||
return true
|
||||
}
|
||||
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok {
|
||||
e.Ctx().SkillEntity.SetMiss()
|
||||
return true
|
||||
}
|
||||
|
||||
if e.Ctx().Our.StatEffect_Exist(petStatus2077Holy) {
|
||||
zeroRandomSkillPP(e.Ctx().Opp, 1)
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Our.StatEffect_Exist(petStatus2077Evil) {
|
||||
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.Blind))
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1659: 随机附加给对手{0}-{1}点固定伤害,若打出致命一击则效果转变为吸取对手{2}-{3}点体力
|
||||
type Effect1659 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1659) Skill_Use() bool {
|
||||
if len(e.Args()) < 4 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.AttackTime == 0 || e.Ctx().Opp == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
if e.Ctx().SkillEntity.Crit != 0 {
|
||||
minDrain := int(e.Args()[2].IntPart())
|
||||
maxDrain := int(e.Args()[3].IntPart())
|
||||
if maxDrain < minDrain {
|
||||
maxDrain = minDrain
|
||||
}
|
||||
value := minDrain
|
||||
if maxDrain > minDrain {
|
||||
value += grand.Intn(maxDrain - minDrain + 1)
|
||||
}
|
||||
if value > 0 {
|
||||
damage := alpacadecimal.NewFromInt(int64(value))
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: damage})
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
minDamage := int(e.Args()[0].IntPart())
|
||||
maxDamage := int(e.Args()[1].IntPart())
|
||||
if maxDamage < minDamage {
|
||||
maxDamage = minDamage
|
||||
}
|
||||
value := minDamage
|
||||
if maxDamage > minDamage {
|
||||
value += grand.Intn(maxDamage - minDamage + 1)
|
||||
}
|
||||
if value > 0 {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: alpacadecimal.NewFromInt(int64(value))})
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 1655, &Effect1655{})
|
||||
input.InitEffect(input.EffectType.Sub, 1655, &Effect1655Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1656, &Effect1656{})
|
||||
input.InitEffect(input.EffectType.Sub, 1656, &Effect1656Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1657, &Effect1657{})
|
||||
input.InitEffect(input.EffectType.Skill, 1658, &Effect1658{})
|
||||
input.InitEffect(input.EffectType.Sub, 1658, &Effect1658Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1659, &Effect1659{})
|
||||
}
|
||||
@@ -17,7 +17,7 @@ func (e *Effect166) Skill_Use_ex() bool {
|
||||
if success {
|
||||
effectType := int8(e.Args()[1].IntPart()) // XX类型
|
||||
effectValue := int8(e.Args()[2].IntPart()) // 等级k
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Our, effectType, effectValue)
|
||||
e.OpponentInput().SetProp(e.CarrierInput(), effectType, effectValue)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@ func (e *Effect169) OnSkill() bool {
|
||||
success, _, _ := e.Input.Player.Roll(int(chance), 100)
|
||||
if success {
|
||||
// 添加异常状态
|
||||
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[2].IntPart())) // 以麻痹为例
|
||||
statusEffect := e.CarrierInput().InitEffect(input.EffectType.Status, int(e.Args()[2].IntPart())) // 以麻痹为例
|
||||
if statusEffect != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), statusEffect)
|
||||
}
|
||||
}
|
||||
return true
|
||||
|
||||
@@ -18,10 +18,10 @@ func (e *Effect170) Skill_Use() bool {
|
||||
if e.IsFirst() { // 先出手
|
||||
|
||||
// 回复1/n的最大体力值
|
||||
maxHp := e.Ctx().Our.CurPet[0].GetMaxHP()
|
||||
maxHp := e.CarrierInput().CurPet[0].GetMaxHP()
|
||||
healAmount := maxHp.Div(e.Args()[0]) // 1/n
|
||||
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, healAmount)
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, healAmount)
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
@@ -12,7 +12,7 @@ type Effect171 struct {
|
||||
|
||||
func (e *Effect171) ComparePre(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) bool {
|
||||
|
||||
if e.ID().GetCatchTime() != e.Ctx().Our.CurPet[0].Info.CatchTime {
|
||||
if !e.IsOwner() {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ func (e *Effect171) ComparePre(fattack *action.SelectSkillAction, sattack *actio
|
||||
return true
|
||||
}
|
||||
//先手是自己
|
||||
if fattack.PlayerID == e.Ctx().Our.UserID {
|
||||
if fattack.PlayerID == e.CarrierInput().UserID {
|
||||
return true
|
||||
}
|
||||
if sattack == nil {
|
||||
|
||||
@@ -16,9 +16,9 @@ func (e *Effect173) OnSkill() bool {
|
||||
chance := e.Args()[0].IntPart()
|
||||
success, _, _ := e.Input.Player.Roll(int(chance), 100)
|
||||
if success {
|
||||
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[1].IntPart())) // 以麻痹为例
|
||||
statusEffect := e.CarrierInput().InitEffect(input.EffectType.Status, int(e.Args()[1].IntPart())) // 以麻痹为例
|
||||
if statusEffect != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), statusEffect)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,17 +11,17 @@ type Effect175 struct {
|
||||
}
|
||||
|
||||
func (e *Effect175) OnSkill() bool {
|
||||
if e.Ctx().Opp.StatEffect_Exist_all() { // 对手处于异常状态
|
||||
if e.OpponentInput().StatEffect_Exist_all() { // 对手处于异常状态
|
||||
chance := e.Args()[0].IntPart()
|
||||
success, _, _ := e.Input.Player.Roll(int(chance), 100)
|
||||
if success {
|
||||
effectType := int(e.Args()[1].IntPart()) // XX类型
|
||||
effectValue := int(e.Args()[2].IntPart()) // 等级k
|
||||
|
||||
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, effectType)
|
||||
statusEffect := e.CarrierInput().InitEffect(input.EffectType.Status, effectType)
|
||||
if statusEffect != nil {
|
||||
statusEffect.SetArgs(e.Ctx().Our, effectValue)
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, statusEffect)
|
||||
statusEffect.SetArgs(e.CarrierInput(), effectValue)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), statusEffect)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,9 +30,9 @@ func (e *Effect176) OnSkill() bool {
|
||||
randomIndex := grand.Intn(len(statusTypes))
|
||||
selectedStatus := statusTypes[randomIndex]
|
||||
|
||||
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, selectedStatus)
|
||||
statusEffect := e.CarrierInput().InitEffect(input.EffectType.Status, selectedStatus)
|
||||
if statusEffect != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), statusEffect)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,10 +12,10 @@ type Effect177 struct {
|
||||
|
||||
func (e *Effect177) Skill_Use_ex() bool {
|
||||
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.AttackTime == 0 {
|
||||
maxHp := e.Ctx().Our.CurPet[0].GetMaxHP()
|
||||
maxHp := e.CarrierInput().CurPet[0].GetMaxHP()
|
||||
healAmount := maxHp.Div(e.Args()[1]) // 1/m
|
||||
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, healAmount)
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, healAmount)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
"github.com/gogf/gf/v2/util/grand"
|
||||
)
|
||||
|
||||
// Effect 1770: 开启战魂附体:免疫对手下1次攻击技能造成的伤害,若对手使用的攻击技能PP值为满则自身额外免疫下1次受到的固定伤害和百分比伤害
|
||||
@@ -419,25 +420,17 @@ func (e *Effect1780) OnSkill() bool {
|
||||
shield = e.Ctx().Opp.CurPet[0].GetMaxHP().Div(e.Args()[1])
|
||||
}
|
||||
if shield.Cmp(alpacadecimal.Zero) > 0 {
|
||||
if capShield := e.Args()[4]; capShield.Cmp(alpacadecimal.Zero) > 0 {
|
||||
current := e.Ctx().Our.CurrentShield()
|
||||
if current.Cmp(capShield) < 0 {
|
||||
remain := capShield.Sub(current)
|
||||
if shield.Cmp(remain) > 0 {
|
||||
shield = remain
|
||||
}
|
||||
} else {
|
||||
shield = alpacadecimal.Zero
|
||||
}
|
||||
}
|
||||
if shield.Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.Ctx().Our.AddShield(shield)
|
||||
if capShield := e.Args()[4]; capShield.Cmp(alpacadecimal.Zero) > 0 && shield.Cmp(capShield) > 0 {
|
||||
shield = capShield
|
||||
}
|
||||
}
|
||||
|
||||
if e.Args()[2].Cmp(alpacadecimal.Zero) > 0 {
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1780, int(e.Args()[2].IntPart()), int(e.Args()[3].IntPart()))
|
||||
if sub != nil {
|
||||
if s, ok := sub.(*Effect1780Sub); ok {
|
||||
s.shield = shield
|
||||
}
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
}
|
||||
@@ -447,6 +440,7 @@ func (e *Effect1780) OnSkill() bool {
|
||||
type Effect1780Sub struct {
|
||||
node.EffectNode
|
||||
remaining int
|
||||
shield alpacadecimal.Decimal
|
||||
}
|
||||
|
||||
func (e *Effect1780Sub) SetArgs(t *input.Input, a ...int) {
|
||||
@@ -457,6 +451,15 @@ func (e *Effect1780Sub) SetArgs(t *input.Input, a ...int) {
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Effect1780Sub) SwitchIn(in *input.Input) bool {
|
||||
if in != e.Ctx().Our || e.shield.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
in.AddShield(e.shield)
|
||||
e.shield = alpacadecimal.Zero
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1780Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||||
if e.remaining <= 0 {
|
||||
e.Alive(false)
|
||||
@@ -536,34 +539,29 @@ func (e *Effect1783) Skill_Use() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
cleared := false
|
||||
for _, target := range []*input.Input{e.Ctx().Our, e.Ctx().Opp} {
|
||||
for _, eff := range target.Effects {
|
||||
if eff == nil || !eff.Alive() {
|
||||
continue
|
||||
}
|
||||
id := eff.ID()
|
||||
if id.GetEffectType() != input.EffectType.Sub {
|
||||
continue
|
||||
}
|
||||
eff.Alive(false)
|
||||
cleared = true
|
||||
}
|
||||
}
|
||||
beforeOur := countTurnEffects(e.Ctx().Our)
|
||||
beforeOpp := countTurnEffects(e.Ctx().Opp)
|
||||
|
||||
e.Ctx().Our.CancelTurn(e.Ctx().Our)
|
||||
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
|
||||
|
||||
afterOur := countTurnEffects(e.Ctx().Our)
|
||||
afterOpp := countTurnEffects(e.Ctx().Opp)
|
||||
|
||||
cleared := afterOur < beforeOur || afterOpp < beforeOpp
|
||||
if cleared {
|
||||
st := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[0].IntPart()))
|
||||
if st != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, st)
|
||||
if statusID := int(e.Args()[0].IntPart()); statusID > 0 {
|
||||
if st := e.Ctx().Our.InitEffect(input.EffectType.Status, statusID); st != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, st)
|
||||
}
|
||||
if st := e.Ctx().Our.InitEffect(input.EffectType.Status, statusID); st != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, st)
|
||||
}
|
||||
}
|
||||
oppStatus := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[0].IntPart()))
|
||||
if oppStatus != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, oppStatus)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
if e.Args()[1].Cmp(alpacadecimal.Zero) > 0 {
|
||||
failure := (beforeOur > 0 && afterOur > 0) || (beforeOpp > 0 && afterOpp > 0)
|
||||
if failure && e.Args()[1].Cmp(alpacadecimal.Zero) > 0 {
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1783, int(e.Args()[1].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||||
@@ -628,18 +626,26 @@ func (e *Effect1784) Skill_Use() bool {
|
||||
|
||||
type Effect1784Sub struct {
|
||||
RoundEffectArg0Base
|
||||
blocked bool
|
||||
}
|
||||
|
||||
func (e *Effect1784Sub) TurnStart(fattack, sattack *action.SelectSkillAction) {
|
||||
e.blocked = false
|
||||
}
|
||||
|
||||
func (e *Effect1784Sub) DamageLockEx(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || e.Ctx().Our == nil || e.Ctx().Our.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
if e.blocked {
|
||||
return true
|
||||
}
|
||||
currentHP := e.Ctx().Our.CurPet[0].GetHP()
|
||||
if zone.Damage.Cmp(currentHP) >= 0 {
|
||||
return true
|
||||
}
|
||||
zone.Damage = alpacadecimal.Zero
|
||||
e.Alive(false)
|
||||
e.blocked = true
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -785,12 +791,82 @@ func (e *Effect1786Debuff) SkillHit_ex() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func restoreRandomPP(owner *input.Input, attempts int) {
|
||||
if owner == nil || owner.CurPet[0] == nil || attempts <= 0 {
|
||||
return
|
||||
}
|
||||
skills := owner.CurPet[0].Info.SkillList
|
||||
if len(skills) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
for i := 0; i < attempts; i++ {
|
||||
idx := grand.N(0, len(skills))
|
||||
skill := &skills[idx]
|
||||
if xmlSkill, ok := xmlres.SkillMap[int(skill.ID)]; ok {
|
||||
maxPP := uint32(xmlSkill.MaxPP)
|
||||
if maxPP == 0 || skill.PP >= maxPP {
|
||||
continue
|
||||
}
|
||||
skill.PP++
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Effect 1787: 沙之力量觉醒,使自身下{0}次攻击获得鳞天之尘效果
|
||||
type Effect1787 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect1787) Skill_Use() bool { return true }
|
||||
func (e *Effect1787) Skill_Use() bool {
|
||||
if len(e.Args()) == 0 {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1787, int(e.Args()[0].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1787Sub struct {
|
||||
node.EffectNode
|
||||
remaining int
|
||||
}
|
||||
|
||||
func (e *Effect1787Sub) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.Duration(-1)
|
||||
if len(a) > 0 {
|
||||
e.remaining = a[0]
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Effect1787Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||||
if e.remaining <= 0 {
|
||||
return true
|
||||
}
|
||||
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++
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1787Sub) Damage_Mul(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || e.remaining <= 0 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(180)).Div(alpacadecimal.NewFromInt(100))
|
||||
restoreRandomPP(e.Ctx().Our, 2)
|
||||
e.remaining--
|
||||
if e.remaining <= 0 {
|
||||
e.Alive(false)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1788: {0}%令对手{1},未触发则附加自身最大体力的{2}%的百分比伤害,若对手免疫百分比伤害则转变为真实伤害
|
||||
type Effect1788 struct {
|
||||
@@ -816,10 +892,17 @@ func (e *Effect1788) Skill_Use() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
before := e.Ctx().Opp.CurPet[0].GetHP()
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Percent,
|
||||
Damage: damage,
|
||||
})
|
||||
if e.Ctx().Opp.CurPet[0].GetHP().Cmp(before) == 0 {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.True,
|
||||
Damage: damage,
|
||||
})
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -980,6 +1063,7 @@ func init() {
|
||||
input.InitEffect(input.EffectType.Sub, 1786, &Effect1786Sub{})
|
||||
input.InitEffect(input.EffectType.Sub, 1786, &Effect1786Debuff{})
|
||||
input.InitEffect(input.EffectType.Skill, 1787, &Effect1787{})
|
||||
input.InitEffect(input.EffectType.Sub, 1787, &Effect1787Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1788, &Effect1788{})
|
||||
input.InitEffect(input.EffectType.Skill, 1789, &Effect1789{})
|
||||
input.InitEffect(input.EffectType.Skill, 1780, &Effect1780{})
|
||||
|
||||
@@ -14,10 +14,10 @@ type Effect178 struct {
|
||||
}
|
||||
|
||||
func (e *Effect178) Skill_Use_ex() bool {
|
||||
damageDone := e.Ctx().Our.SumDamage
|
||||
damageDone := e.CarrierInput().SumDamage
|
||||
var healAmount alpacadecimal.Decimal
|
||||
|
||||
if e.Ctx().Our.CurPet[0].Type == e.Ctx().Opp.CurPet[0].Type {
|
||||
if e.CarrierInput().CurPet[0].Type == e.OpponentInput().CurPet[0].Type {
|
||||
// 属性相同,1/m
|
||||
healAmount = damageDone.Div(e.Args()[1])
|
||||
} else {
|
||||
@@ -25,7 +25,7 @@ func (e *Effect178) Skill_Use_ex() bool {
|
||||
healAmount = damageDone.Div(e.Args()[0])
|
||||
}
|
||||
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, healAmount)
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, healAmount)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ func (e *Effect179) SkillHit() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
if e.Ctx().Our.CurPet[0].Type == e.Ctx().Opp.CurPet[0].Type {
|
||||
if e.CarrierInput().CurPet[0].Type == e.OpponentInput().CurPet[0].Type {
|
||||
// 属性相同,技能威力提升n
|
||||
e.Ctx().SkillEntity.XML.Power += int(e.Args()[0].IntPart())
|
||||
}
|
||||
|
||||
@@ -11,17 +11,17 @@ type Effect184 struct {
|
||||
}
|
||||
|
||||
func (e *Effect184) OnSkill() bool {
|
||||
if e.Ctx().Opp.HasPropADD() { // 对手处于能力提升状态
|
||||
if e.OpponentInput().HasPropADD() { // 对手处于能力提升状态
|
||||
chance := e.Args()[0].IntPart()
|
||||
success, _, _ := e.Input.Player.Roll(int(chance), 100)
|
||||
if success {
|
||||
effectType := int(e.Args()[1].IntPart()) // XX类型
|
||||
effectValue := int(e.Args()[2].IntPart()) // 等级k
|
||||
|
||||
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, effectType)
|
||||
statusEffect := e.CarrierInput().InitEffect(input.EffectType.Status, effectType)
|
||||
if statusEffect != nil {
|
||||
statusEffect.SetArgs(e.Ctx().Our, effectValue)
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, statusEffect)
|
||||
statusEffect.SetArgs(e.CarrierInput(), effectValue)
|
||||
e.CarrierInput().AddEffect(e.CarrierInput(), statusEffect)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,12 +15,12 @@ func (e *Effect188) SkillHit() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
if e.Ctx().Opp.StatEffect_Exist_all() { // 对手处于异常状态
|
||||
if e.OpponentInput().StatEffect_Exist_all() { // 对手处于异常状态
|
||||
// 威力翻倍
|
||||
e.Ctx().SkillEntity.XML.Power *= 2
|
||||
|
||||
// 消除对手相应的防御能力提升效果
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Our, 1, 0)
|
||||
e.OpponentInput().SetProp(e.CarrierInput(), 1, 0)
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
@@ -15,9 +15,9 @@ func (e *Effect190) Skill_Use_ex() bool {
|
||||
}
|
||||
|
||||
// 消除对手所有能力强化状态
|
||||
for i, v := range e.Ctx().Opp.Prop[:] {
|
||||
for i, v := range e.OpponentInput().Prop[:] {
|
||||
if v > 0 {
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0)
|
||||
e.OpponentInput().SetProp(e.CarrierInput(), int8(i), 0)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ func (e *Effect193) SkillHit() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
if e.Ctx().Opp.StatEffect_Exist(info.EnumPetStatus(e.Args()[0].IntPart())) { // 对手处于异常状态
|
||||
if e.OpponentInput().StatEffect_Exist(info.EnumPetStatus(e.Args()[0].IntPart())) { // 对手处于异常状态
|
||||
// 设定必定暴击
|
||||
e.Ctx().SkillEntity.XML.CritRate = 16
|
||||
}
|
||||
|
||||
@@ -15,16 +15,16 @@ type Effect194 struct {
|
||||
}
|
||||
|
||||
func (e *Effect194) Skill_Use() bool {
|
||||
damageDone := e.Ctx().Our.SumDamage
|
||||
damageDone := e.CarrierInput().SumDamage
|
||||
|
||||
var healAmount alpacadecimal.Decimal
|
||||
if e.Ctx().Opp.StatEffect_Exist(info.EnumPetStatus(e.Args()[1].IntPart())) { // 假设有检查异常状态的方法
|
||||
if e.OpponentInput().StatEffect_Exist(info.EnumPetStatus(e.Args()[1].IntPart())) { // 假设有检查异常状态的方法
|
||||
healAmount = damageDone.Div(e.Args()[2]) // 1/m
|
||||
} else {
|
||||
healAmount = damageDone.Div(e.Args()[0]) // 1/n
|
||||
}
|
||||
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, healAmount)
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, healAmount)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -16,14 +16,14 @@ func (e *Effect196) OnSkill() bool {
|
||||
effectValue := e.Args()[5].IntPart() // 等级-k
|
||||
success, _, _ := e.Input.Player.Roll(int(chance), 100)
|
||||
if success {
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Opp, int8(e.Args()[3].IntPart()), int8(effectValue))
|
||||
e.OpponentInput().SetProp(e.OpponentInput(), int8(e.Args()[3].IntPart()), int8(effectValue))
|
||||
}
|
||||
} else { // 后出手
|
||||
chance := e.Args()[1].IntPart() // j%
|
||||
effectValue := e.Args()[2].IntPart() // 等级-k
|
||||
success, _, _ := e.Input.Player.Roll(int(chance), 100)
|
||||
if success {
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Opp, int8(e.Args()[0].IntPart()), int8(effectValue))
|
||||
e.OpponentInput().SetProp(e.OpponentInput(), int8(e.Args()[0].IntPart()), int8(effectValue))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,10 +11,10 @@ type Effect197 struct {
|
||||
|
||||
func (e *Effect197) SwitchOut(in *input.Input) bool {
|
||||
if e.Input == in {
|
||||
if !e.Ctx().Our.CurPet[0].Alive() { // 被击败
|
||||
for i, v := range e.Ctx().Opp.Prop[:] {
|
||||
if !e.CarrierInput().CurPet[0].Alive() { // 被击败
|
||||
for i, v := range e.OpponentInput().Prop[:] {
|
||||
if v > 0 {
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Opp, int8(i), 0)
|
||||
e.OpponentInput().SetProp(e.OpponentInput(), int8(i), 0)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ func (e *Effect198) OnSkill() bool {
|
||||
|
||||
// 随机选择n种能力
|
||||
for i := 0; i < numStats; i++ {
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(grand.Intn(5)), reduction)
|
||||
e.OpponentInput().SetProp(e.CarrierInput(), int8(grand.Intn(5)), reduction)
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
@@ -11,11 +11,11 @@ type Effect199 struct {
|
||||
|
||||
func (e *Effect199) SwitchOut(in *input.Input) bool {
|
||||
if e.Input == in {
|
||||
if !e.Ctx().Our.CurPet[0].Alive() { // 被击败
|
||||
if !e.CarrierInput().CurPet[0].Alive() { // 被击败
|
||||
// 设置下一个出场精灵的增益效果
|
||||
effectType := int8(e.Args()[0].IntPart()) // xx类型
|
||||
effectValue := int8(e.Args()[1].IntPart()) // 等级+k
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, effectType, effectValue)
|
||||
e.CarrierInput().SetProp(e.CarrierInput(), effectType, effectValue)
|
||||
}
|
||||
e.Alive(false)
|
||||
}
|
||||
|
||||
@@ -11,15 +11,15 @@ type Effect200 struct {
|
||||
}
|
||||
|
||||
func (e *Effect200) OnSkill() bool {
|
||||
if e.Ctx().Opp.HasPropADD() {
|
||||
if e.OpponentInput().HasPropADD() {
|
||||
chance := e.Args()[0].IntPart()
|
||||
success, _, _ := e.Input.Player.Roll(int(chance), 100)
|
||||
if success {
|
||||
effectType := int(e.Args()[1].IntPart()) // XX类型
|
||||
|
||||
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, effectType)
|
||||
statusEffect := e.CarrierInput().InitEffect(input.EffectType.Status, effectType)
|
||||
if statusEffect != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), statusEffect)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -853,17 +853,16 @@ func (e *Effect2090) Skill_Use() bool {
|
||||
if e.Ctx().Our == nil || e.Ctx().Opp == nil || e.Ctx().Our.CurPet[0] == nil || e.Ctx().Opp.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Our.CurPet[0].GetMaxHP().Cmp(e.Ctx().Opp.CurPet[0].GetMaxHP()) <= 0 {
|
||||
return true
|
||||
}
|
||||
if len(e.Ctx().Opp.CurPet[0].Info.SkillList) < 5 {
|
||||
return true
|
||||
}
|
||||
pp := e.Ctx().Opp.CurPet[0].Info.SkillList[4].PP
|
||||
if pp <= 0 {
|
||||
return true
|
||||
if e.Ctx().Our.CurPet[0].GetMaxHP().Cmp(e.Ctx().Opp.CurPet[0].GetMaxHP()) > 0 {
|
||||
pp := e.Ctx().Opp.CurPet[0].Info.SkillList[4].PP
|
||||
if pp <= 0 {
|
||||
return true
|
||||
}
|
||||
e.Ctx().Opp.CurPet[0].Info.SkillList[4].PP = 0
|
||||
}
|
||||
e.Ctx().Opp.CurPet[0].Info.SkillList[4].PP = 0
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -964,7 +963,7 @@ func (e *Effect2093Sub) Skill_Use() bool {
|
||||
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)
|
||||
if e.Ctx().Opp.CurPet[0].Info.Hp >= before {
|
||||
return true
|
||||
addTimedStatus(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[4].IntPart()), int(e.Args()[3].IntPart()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -986,7 +985,8 @@ func (e *Effect2094) Damage_Mul(zone *info.DamageZone) bool {
|
||||
zone.Damage = zone.Damage.Mul(hundred.Add(bonus)).Div(hundred)
|
||||
}
|
||||
if count > int(e.Args()[1].IntPart()) {
|
||||
extra := alpacadecimal.NewFromInt(int64(count) * e.Args()[2].IntPart())
|
||||
extraCount := count - int(e.Args()[1].IntPart())
|
||||
extra := alpacadecimal.NewFromInt(int64(extraCount) * e.Args()[2].IntPart())
|
||||
if extra.Cmp(alpacadecimal.Zero) > 0 {
|
||||
zone.Damage = zone.Damage.Add(extra)
|
||||
}
|
||||
|
||||
@@ -53,6 +53,8 @@ const (
|
||||
status2136ReturnLife = 2136
|
||||
status2138ShadowSeed = 2138
|
||||
status2139ShadowRoot = 2139
|
||||
petStatusInfect = 27 // 0-255 ID from legacy data
|
||||
statusLingMoCore = 2300 // placeholder ID for 灵茉之芯 stacks
|
||||
)
|
||||
|
||||
var effect2137StatusRounds = []info.EnumPetStatus{
|
||||
@@ -162,11 +164,36 @@ func hasShadowSeed(target *input.Input) bool {
|
||||
return getAliveStatusEffect(target, status2138ShadowSeed) != nil
|
||||
}
|
||||
|
||||
func drainMaxHP2121(owner, target *input.Input, percent alpacadecimal.Decimal) bool {
|
||||
if owner == nil || target == nil || target.CurPet[0] == nil || percent.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return false
|
||||
}
|
||||
damage := target.CurPet[0].GetMaxHP().Mul(percent).Div(hundred)
|
||||
if damage.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return false
|
||||
}
|
||||
before := target.CurPet[0].GetHP()
|
||||
target.Damage(owner, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||||
owner.Heal(owner, &action.SelectSkillAction{}, damage)
|
||||
return target.CurPet[0].GetHP().Cmp(before) < 0
|
||||
}
|
||||
|
||||
func lingMoCoreCount2123(target *input.Input) int {
|
||||
eff := getAliveStatusEffect(target, statusLingMoCore)
|
||||
if eff == nil {
|
||||
return 0
|
||||
}
|
||||
if eff.Stack() > 0 {
|
||||
return eff.Stack()
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
// Effect 2120: 自身为对手天敌时n回合内受到攻击的伤害减少m%
|
||||
type Effect2120 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect2120) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 {
|
||||
if len(e.Args()) < 2 || !e.ISNaturalEnemy() {
|
||||
return true
|
||||
}
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2120, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
||||
@@ -177,20 +204,27 @@ func (e *Effect2120) Skill_Use() bool {
|
||||
}
|
||||
|
||||
func (e *Effect2120) DamageDivEx(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 || !e.ISNaturalEnemy() {
|
||||
return true
|
||||
}
|
||||
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(100 - int64(e.Args()[1].IntPart()))).Div(alpacadecimal.NewFromInt(100))
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect2120Sub struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect2120Sub) DamageDivEx(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
|
||||
return true
|
||||
}
|
||||
zone.Damage = zone.Damage.Mul(hundred.Sub(e.Args()[1])).Div(hundred)
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 2121: 未击败对手则己方场下精灵吸取对手最大体力的n%
|
||||
type Effect2121 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect2121) Skill_Use() bool {
|
||||
if len(e.Args()) == 0 || e.Ctx().Opp.CurPet[0] == nil || e.Ctx().Opp.CurPet[0].Info.Hp <= 0 {
|
||||
if len(e.Args()) == 0 || e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil || e.Ctx().Opp.CurPet[0].Info.Hp <= 0 {
|
||||
return true
|
||||
}
|
||||
if drainMaxHP2121(e.Ctx().Our, e.Ctx().Opp, e.Args()[0]) {
|
||||
return true
|
||||
}
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2121, int(e.Args()[0].IntPart()))
|
||||
@@ -206,23 +240,18 @@ type Effect2121Sub struct {
|
||||
|
||||
func (e *Effect2121Sub) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.Duration(-1)
|
||||
e.CanStack(false)
|
||||
e.Duration(1)
|
||||
}
|
||||
|
||||
func (e *Effect2121Sub) TurnEnd() {
|
||||
if len(e.Args()) == 0 || e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil || e.Ctx().Our == nil || e.Ctx().Our.CurPet[0] == nil {
|
||||
return
|
||||
}
|
||||
heal := e.Ctx().Opp.CurPet[0].GetMaxHP().Mul(e.Args()[0]).Div(alpacadecimal.NewFromInt(100))
|
||||
if heal.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return
|
||||
}
|
||||
before := e.Ctx().Opp.CurPet[0].Info.Hp
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: heal})
|
||||
healBench2121(e.Ctx().Our, heal)
|
||||
if e.Ctx().Opp.CurPet[0].Info.Hp < before {
|
||||
func (e *Effect2121Sub) OnSkill() bool {
|
||||
if len(e.Args()) == 0 || e.Ctx().Opp == nil || e.Ctx().Our == nil {
|
||||
e.Alive(false)
|
||||
return true
|
||||
}
|
||||
drainMaxHP2121(e.Ctx().Our, e.Ctx().Opp, e.Args()[0])
|
||||
e.Alive(false)
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 2122: 获得护罩,护罩消失时自身所有技能PP值+{1}
|
||||
@@ -277,19 +306,32 @@ func (e *Effect2122Sub) ShieldChange(before, after alpacadecimal.Decimal) bool {
|
||||
type Effect2123 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect2123) Skill_Use() bool {
|
||||
if len(e.Args()) == 0 {
|
||||
if len(e.Args()) == 0 || e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
if !clearTargetEffects(e.Ctx().Our, e.Ctx().Opp) {
|
||||
before := activeTurnEffectCount(e.Ctx().Opp)
|
||||
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
|
||||
if before <= 0 {
|
||||
damage := e.Ctx().Opp.CurPet[0].GetMaxHP().Div(e.Args()[0])
|
||||
if damage.Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||||
}
|
||||
return true
|
||||
}
|
||||
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.Poisoned))
|
||||
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.Sleep))
|
||||
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.DrainHP))
|
||||
|
||||
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, petStatusInfect)
|
||||
extraCount := lingMoCoreCount2123(e.Ctx().Our)
|
||||
statuses := []int{
|
||||
int(info.PetStatus.Poisoned),
|
||||
int(info.PetStatus.Sleep),
|
||||
int(info.PetStatus.DrainHP),
|
||||
}
|
||||
if extraCount > len(statuses) {
|
||||
extraCount = len(statuses)
|
||||
}
|
||||
for i := 0; i < extraCount; i++ {
|
||||
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, statuses[i])
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -304,6 +346,9 @@ func (e *Effect2124) Damage_Mul(zone *info.DamageZone) bool {
|
||||
if e.Ctx().Our.HasPropADD() || e.Ctx().Opp.HasPropSub() {
|
||||
chance *= 2
|
||||
}
|
||||
if chance > 100 {
|
||||
chance = 100
|
||||
}
|
||||
if ok, _, _ := e.Input.Player.Roll(chance, 100); ok {
|
||||
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
|
||||
}
|
||||
|
||||
@@ -47,6 +47,22 @@ func clearRoundEffects2229(target *input.Input) bool {
|
||||
return cleared
|
||||
}
|
||||
|
||||
func triggerOwnNewSelEffects2229(target *input.Input) {
|
||||
if target == nil || target.CurPet[0] == nil {
|
||||
return
|
||||
}
|
||||
catchTime := target.CurPet[0].Info.CatchTime
|
||||
for _, eff := range target.Effects {
|
||||
if eff == nil || !eff.Alive() || eff.ID().GetEffectType() != input.EffectType.NewSel {
|
||||
continue
|
||||
}
|
||||
if eff.ID().GetCatchTime() != catchTime {
|
||||
continue
|
||||
}
|
||||
eff.SwitchIn(target)
|
||||
}
|
||||
}
|
||||
|
||||
// Effect 2220: 将自身攻击和特攻中最高的能力值作为自身的能力值进行攻击
|
||||
type Effect2220 struct{ node.EffectNode }
|
||||
|
||||
@@ -247,43 +263,37 @@ func (e *Effect2226Sub) ActionStart(a, b *action.SelectSkillAction) bool {
|
||||
type Effect2228 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect2228) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 {
|
||||
if len(e.Args()) < 2 || e.Ctx().Our == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2228, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect2228Sub struct {
|
||||
RoundEffectArg0Base
|
||||
remaining int
|
||||
reduce alpacadecimal.Decimal
|
||||
reduce alpacadecimal.Decimal
|
||||
}
|
||||
|
||||
func (e *Effect2228Sub) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.Duration(-1)
|
||||
if len(a) > 0 {
|
||||
e.remaining = a[0]
|
||||
}
|
||||
e.RoundEffectArg0Base.SetArgs(t, a...)
|
||||
if len(a) > 1 {
|
||||
e.reduce = alpacadecimal.NewFromInt(int64(a[1]))
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Effect2228Sub) Damage_Mul(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || e.remaining <= 0 {
|
||||
func (e *Effect2228Sub) DamageDivEx(zone *info.DamageZone) bool {
|
||||
if zone == nil {
|
||||
return true
|
||||
}
|
||||
if zone.Type != info.DamageType.Fixed && zone.Type != info.DamageType.Percent {
|
||||
return true
|
||||
}
|
||||
zone.Damage = zone.Damage.Mul(hundred.Sub(e.reduce)).Div(hundred)
|
||||
e.remaining--
|
||||
if e.remaining <= 0 {
|
||||
e.Alive(false)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -291,11 +301,13 @@ func (e *Effect2228Sub) Damage_Mul(zone *info.DamageZone) bool {
|
||||
type Effect2227 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect2227) Skill_Use() bool {
|
||||
if len(e.Args()) == 0 {
|
||||
if len(e.Args()) == 0 || e.Ctx().Opp == nil {
|
||||
return true
|
||||
}
|
||||
clearPositiveProps(e.Ctx().Opp, e.Ctx().Our)
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2227, int(e.Args()[0].IntPart()))
|
||||
if !clearPositiveProps(e.Ctx().Opp, e.Ctx().Our) {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Opp.InitEffect(input.EffectType.Sub, 2227, int(e.Args()[0].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
@@ -309,38 +321,75 @@ type Effect2227Sub struct {
|
||||
|
||||
func (e *Effect2227Sub) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.CanStack(false)
|
||||
e.Duration(-1)
|
||||
if len(a) > 0 {
|
||||
e.remaining = a[0]
|
||||
}
|
||||
t.CanChange = 1
|
||||
}
|
||||
|
||||
func (e *Effect2227Sub) ActionStart(a, b *action.SelectSkillAction) bool {
|
||||
func (e *Effect2227Sub) TurnEnd() {
|
||||
if e.remaining <= 0 {
|
||||
e.Ctx().Our.CanChange = 0
|
||||
e.Alive(false)
|
||||
return true
|
||||
}
|
||||
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() != info.Category.STATUS {
|
||||
e.Ctx().SkillEntity.SetMiss()
|
||||
return
|
||||
}
|
||||
e.remaining--
|
||||
if e.remaining <= 0 {
|
||||
e.Ctx().Our.CanChange = 0
|
||||
e.Alive(false)
|
||||
return
|
||||
}
|
||||
if e.Ctx().Our != nil && e.Ctx().Our.CurPet[0] != nil && e.Ctx().Our.CurPet[0].Info.Hp > 0 {
|
||||
e.Ctx().Our.CanChange = 1
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Effect2227Sub) SwitchOut(in *input.Input) bool {
|
||||
if in == e.Ctx().Our && e.Ctx().Our != nil {
|
||||
e.Ctx().Our.CanChange = 0
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 2229: 使用技能后自身全属性+1,回合类效果被消除、能力提升效果被消除、吸取时触发自身的登场效果
|
||||
// Effect 2229: {0}回合内使用技能则全属性+1,自身回合类效果、能力提升效果被消除、吸取时触发自身的登场效果
|
||||
type Effect2229 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect2229) OnSkill() bool {
|
||||
if e.Ctx().Our == nil || e.Ctx().Our.CurPet[0] == nil {
|
||||
func (e *Effect2229) Skill_Use() bool {
|
||||
if len(e.Args()) == 0 || e.Ctx().Our == nil {
|
||||
return true
|
||||
}
|
||||
clearRoundEffects2229(e.Ctx().Our)
|
||||
clearPositiveProps(e.Ctx().Our, e.Ctx().Our)
|
||||
for i := range e.Ctx().Our.Prop[:] {
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), 1)
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2229, int(e.Args()[0].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect2229Sub struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect2229Sub) OnSkill() bool {
|
||||
applyAllPropUp(e.Ctx().Our, 1)
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect2229Sub) PropBefer(source *input.Input, prop, level int8) bool {
|
||||
if source != e.Ctx().Our || level >= 0 {
|
||||
return true
|
||||
}
|
||||
if int(prop) < 0 || int(prop) >= len(e.Ctx().Our.Prop) {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Our.Prop[prop] > 0 {
|
||||
triggerOwnNewSelEffects2229(e.Ctx().Our)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect2229Sub) Heal_Pre(ac action.BattleActionI, value *int) bool {
|
||||
if value != nil && *value > 0 {
|
||||
triggerOwnNewSelEffects2229(e.Ctx().Our)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -785,6 +834,7 @@ func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 2228, &Effect2228{})
|
||||
input.InitEffect(input.EffectType.Sub, 2228, &Effect2228Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 2229, &Effect2229{})
|
||||
input.InitEffect(input.EffectType.Sub, 2229, &Effect2229Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 2230, &Effect2230{})
|
||||
input.InitEffect(input.EffectType.Sub, 2230, &Effect2230Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 2231, &Effect2231{})
|
||||
|
||||
@@ -17,7 +17,7 @@ func (e *Effect400) SkillHit() bool {
|
||||
if e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Our.CurPet[0].PetInfo.Type != e.Ctx().Opp.CurPet[0].PetInfo.Type {
|
||||
if e.CarrierInput().CurPet[0].PetInfo.Type != e.OpponentInput().CurPet[0].PetInfo.Type {
|
||||
return true
|
||||
}
|
||||
e.Ctx().SkillEntity.XML.Power *= 2
|
||||
@@ -107,7 +107,7 @@ func (e *Effect610) ComparePre(fattack, sattack *action.SelectSkillAction) bool
|
||||
if !e.ISNaturalEnemy() {
|
||||
return true
|
||||
}
|
||||
if fattack == nil || fattack.PlayerID == e.Ctx().Our.UserID {
|
||||
if fattack == nil || fattack.PlayerID == e.CarrierInput().UserID {
|
||||
return true
|
||||
}
|
||||
if sattack == nil || sattack.SkillEntity == nil {
|
||||
@@ -129,7 +129,7 @@ func (e *Effect611) OnSkill() bool {
|
||||
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: e.Args()[1],
|
||||
})
|
||||
|
||||
@@ -17,12 +17,12 @@ func (e *Effect403) OnSkill() bool {
|
||||
if success {
|
||||
boostValue := int8(e.Args()[1].IntPart())
|
||||
// 检查属性是否相同
|
||||
if e.Ctx().Our.CurPet[0].Type == e.Ctx().Opp.CurPet[0].Type {
|
||||
if e.CarrierInput().CurPet[0].Type == e.OpponentInput().CurPet[0].Type {
|
||||
boostValue *= 2
|
||||
}
|
||||
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, 4, boostValue)
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, 2, boostValue)
|
||||
e.CarrierInput().SetProp(e.CarrierInput(), 4, boostValue)
|
||||
e.CarrierInput().SetProp(e.CarrierInput(), 2, boostValue)
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
@@ -17,7 +17,7 @@ func (e *Effect407) Skill_Use() bool {
|
||||
effectValue := int8(e.Args()[1].IntPart()) // 等级+n
|
||||
duration := int(e.Args()[2].IntPart()) // 持续m回合
|
||||
|
||||
addSubEffect(e.Ctx().Our, e.Ctx().Our, &e.EffectNode, &Effect407_sub{
|
||||
addSubEffect(e.CarrierInput(), e.CarrierInput(), &e.EffectNode, &Effect407_sub{
|
||||
effectType: effectType,
|
||||
effectValue: effectValue,
|
||||
}, duration)
|
||||
@@ -32,7 +32,7 @@ type Effect407_sub struct {
|
||||
}
|
||||
|
||||
func (e *Effect407_sub) ActionStart(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) bool {
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, e.effectType, e.effectValue)
|
||||
e.CarrierInput().SetProp(e.CarrierInput(), e.effectType, e.effectValue)
|
||||
return true
|
||||
|
||||
}
|
||||
|
||||
@@ -16,10 +16,10 @@ func (e *Effect410) OnSkill() bool {
|
||||
success, _, _ := e.Input.Player.Roll(int(chance), 100)
|
||||
|
||||
if success {
|
||||
maxHp := e.Ctx().Our.CurPet[0].GetMaxHP()
|
||||
maxHp := e.CarrierInput().CurPet[0].GetMaxHP()
|
||||
healAmount := maxHp.Div(e.Args()[1]) // 1/m
|
||||
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, healAmount)
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, healAmount)
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
@@ -11,8 +11,8 @@ type Effect412 struct {
|
||||
}
|
||||
|
||||
func (e *Effect412) HookPP(count *int) bool {
|
||||
maxHp := e.Ctx().Our.CurPet[0].GetMaxHP()
|
||||
currentHp := e.Ctx().Our.CurPet[0].GetHP()
|
||||
maxHp := e.CarrierInput().CurPet[0].GetMaxHP()
|
||||
currentHp := e.CarrierInput().CurPet[0].GetHP()
|
||||
threshold := maxHp.Div(e.Args()[0]) // 1/n
|
||||
|
||||
if currentHp.Cmp(threshold) < 0 {
|
||||
|
||||
@@ -16,11 +16,11 @@ type Effect417 struct {
|
||||
func (e *Effect417) SkillHit_ex() bool {
|
||||
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() != info.Category.STATUS {
|
||||
// 是攻击技能
|
||||
damageDone := e.Ctx().Our.SumDamage
|
||||
damageDone := e.CarrierInput().SumDamage
|
||||
healPercent := e.Args()[0].Div(alpacadecimal.NewFromInt(100)) // m%
|
||||
healAmount := damageDone.Mul(healPercent)
|
||||
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, healAmount)
|
||||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, healAmount)
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
@@ -11,8 +11,8 @@ type Effect418 struct {
|
||||
}
|
||||
|
||||
func (e *Effect418) OnSkill() bool {
|
||||
if e.Ctx().Opp.HasPropADD() {
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(e.SideEffectArgs[0]), int8(e.SideEffectArgs[1]))
|
||||
if e.OpponentInput().HasPropADD() {
|
||||
e.OpponentInput().SetProp(e.CarrierInput(), int8(e.SideEffectArgs[0]), int8(e.SideEffectArgs[1]))
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -11,14 +11,14 @@ type Effect420 struct {
|
||||
|
||||
func (e *Effect420) PropBefer(in *input.Input, prop int8, level int8) bool {
|
||||
|
||||
if in == e.Ctx().Our {
|
||||
if in == e.CarrierInput() {
|
||||
return true
|
||||
}
|
||||
|
||||
//能力下降类
|
||||
if level == 0 {
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Our, 0, int8(e.SideEffectArgs[0]))
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Our, 1, int8(e.SideEffectArgs[0]))
|
||||
e.OpponentInput().SetProp(e.CarrierInput(), 0, int8(e.SideEffectArgs[0]))
|
||||
e.OpponentInput().SetProp(e.CarrierInput(), 1, int8(e.SideEffectArgs[0]))
|
||||
|
||||
}
|
||||
return true
|
||||
|
||||
@@ -14,7 +14,7 @@ type Effect422 struct {
|
||||
}
|
||||
|
||||
func (e *Effect422) Skill_Use() bool {
|
||||
damageDone := e.Ctx().Our.SumDamage
|
||||
damageDone := e.CarrierInput().SumDamage
|
||||
percent := e.Args()[0].Div(alpacadecimal.NewFromInt(100)) // X%
|
||||
|
||||
additionalDamage := damageDone.Mul(percent)
|
||||
@@ -24,7 +24,7 @@ func (e *Effect422) Skill_Use() bool {
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: additionalDamage,
|
||||
}
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, damageZone)
|
||||
e.OpponentInput().Damage(e.CarrierInput(), damageZone)
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
@@ -10,7 +10,7 @@ type Effect424 struct {
|
||||
}
|
||||
|
||||
func (e *Effect424) Skill_Use() bool {
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Our, 4, int8(e.Args()[1].IntPart()))
|
||||
e.OpponentInput().SetProp(e.CarrierInput(), 4, int8(e.Args()[1].IntPart()))
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ func (e *Effect425) Skill_Use() bool {
|
||||
// 随机选择n项属性
|
||||
for i := 0; i < numStats; i++ {
|
||||
t := int8(grand.Intn(6))
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Our, t, changeValue)
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, t, -changeValue)
|
||||
e.OpponentInput().SetProp(e.CarrierInput(), t, changeValue)
|
||||
e.CarrierInput().SetProp(e.CarrierInput(), t, -changeValue)
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
@@ -16,9 +16,9 @@ func (e *Effect427) Skill_Use() bool {
|
||||
}
|
||||
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() != info.Category.STATUS {
|
||||
// 降低对手防御
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Opp, 1, int8(e.SideEffectArgs[1]))
|
||||
e.OpponentInput().SetProp(e.OpponentInput(), 1, int8(e.SideEffectArgs[1]))
|
||||
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Opp, 3, int8(e.SideEffectArgs[1]))
|
||||
e.OpponentInput().SetProp(e.OpponentInput(), 3, int8(e.SideEffectArgs[1]))
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
@@ -21,7 +21,7 @@ func (e *Effect428) Skill_Use() bool {
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: e.Args()[0],
|
||||
}
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, damageZone)
|
||||
e.OpponentInput().Damage(e.CarrierInput(), damageZone)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -13,10 +13,10 @@ type Effect430 struct {
|
||||
func (e *Effect430) Skill_Use() bool {
|
||||
var isadd bool
|
||||
// 检查对手是否有能力强化状态
|
||||
for i, v := range e.Ctx().Opp.Prop[:] {
|
||||
for i, v := range e.OpponentInput().Prop[:] {
|
||||
if v > 0 {
|
||||
|
||||
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) {
|
||||
if e.OpponentInput().SetProp(e.CarrierInput(), int8(i), 0) {
|
||||
isadd = true
|
||||
}
|
||||
return true
|
||||
@@ -31,7 +31,7 @@ func (e *Effect430) Skill_Use() bool {
|
||||
effectType := int8(e.Args()[0].IntPart()) // XX类型
|
||||
effectValue := int8(e.Args()[1].IntPart()) // 等级m
|
||||
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, effectType, effectValue)
|
||||
e.CarrierInput().SetProp(e.CarrierInput(), effectType, effectValue)
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@@ -11,15 +11,15 @@ type Effect434 struct {
|
||||
}
|
||||
|
||||
func (e *Effect434) OnSkill() bool {
|
||||
if e.Ctx().Our.HasPropADD() { // 自身处于能力强化状态
|
||||
if e.CarrierInput().HasPropADD() { // 自身处于能力强化状态
|
||||
chance := e.Args()[0].IntPart()
|
||||
success, _, _ := e.Input.Player.Roll(int(chance), 100)
|
||||
if success {
|
||||
effectType := int(e.Args()[1].IntPart()) // XX类型,比如麻痹
|
||||
|
||||
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, effectType)
|
||||
statusEffect := e.CarrierInput().InitEffect(input.EffectType.Status, effectType)
|
||||
if statusEffect != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), statusEffect)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ type Effect437 struct {
|
||||
|
||||
func (e *Effect437) OnSkill() bool {
|
||||
|
||||
if e.Ctx().Opp.HasPropADD() {
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Opp, int8(e.SideEffectArgs[0]), int8(e.SideEffectArgs[1]))
|
||||
if e.OpponentInput().HasPropADD() {
|
||||
e.OpponentInput().SetProp(e.OpponentInput(), int8(e.SideEffectArgs[0]), int8(e.SideEffectArgs[1]))
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ type Effect440 struct {
|
||||
func (e *Effect440) Skill_Use() bool {
|
||||
// 创建一个延迟生效的效果,在下一回合开始生效
|
||||
|
||||
addSubEffect(e.Ctx().Our, e.Ctx().Opp, &e.EffectNode, &Effect440_sub{
|
||||
addSubEffect(e.CarrierInput(), e.OpponentInput(), &e.EffectNode, &Effect440_sub{
|
||||
m: int(e.Args()[1].IntPart()),
|
||||
}, int(e.Args()[0].IntPart()))
|
||||
return true
|
||||
|
||||
@@ -15,10 +15,10 @@ func (e *Effect442) OnSkill() bool {
|
||||
chance := e.Args()[0].IntPart()
|
||||
success, _, _ := e.Input.Player.Roll(int(chance), 100)
|
||||
if success {
|
||||
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[1].IntPart())) // 以麻痹为例
|
||||
statusEffect := e.CarrierInput().InitEffect(input.EffectType.Status, int(e.Args()[1].IntPart())) // 以麻痹为例
|
||||
if statusEffect != nil {
|
||||
statusEffect.SetArgs(e.Ctx().Our, 1)
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
||||
statusEffect.SetArgs(e.CarrierInput(), 1)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), statusEffect)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,12 +15,12 @@ type Effect443 struct {
|
||||
func (e *Effect443) Skill_Use_ex() bool {
|
||||
damageThreshold := alpacadecimal.NewFromInt(int64(e.Args()[1].IntPart()))
|
||||
|
||||
if e.Ctx().Our.SumDamage.Cmp(damageThreshold) > 0 {
|
||||
if e.CarrierInput().SumDamage.Cmp(damageThreshold) > 0 {
|
||||
// 对手疲惫x回合
|
||||
tiredEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(info.PetStatus.Tired))
|
||||
tiredEffect := e.CarrierInput().InitEffect(input.EffectType.Status, int(info.PetStatus.Tired))
|
||||
if tiredEffect != nil {
|
||||
tiredEffect.Duration(int(e.Args()[2].IntPart())) // x回合
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, tiredEffect)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), tiredEffect)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,9 +12,9 @@ type Effect444 struct {
|
||||
|
||||
func (e *Effect444) OnSkill() bool {
|
||||
// 降低对手所有技能PP
|
||||
e.Ctx().Opp.DelPP(1)
|
||||
e.OpponentInput().DelPP(1)
|
||||
|
||||
e.Ctx().Our.HealPP(1)
|
||||
e.CarrierInput().HealPP(1)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ type Effect626 struct {
|
||||
func (e *Effect626) Skill_Use() bool {
|
||||
|
||||
for i := 0; i < e.SideEffectArgs[0]; i++ {
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, int8(grand.Intn(6)), int8(e.SideEffectArgs[1]))
|
||||
e.CarrierInput().SetProp(e.CarrierInput(), int8(grand.Intn(6)), int8(e.SideEffectArgs[1]))
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
@@ -11,15 +11,15 @@ type Effect449 struct {
|
||||
}
|
||||
|
||||
func (e *Effect449) OnSkill() bool {
|
||||
if e.Ctx().Opp.HasPropSub() {
|
||||
if e.OpponentInput().HasPropSub() {
|
||||
chance := e.Args()[0].IntPart() // N%
|
||||
success, _, _ := e.Input.Player.Roll(int(chance), 100)
|
||||
if success {
|
||||
effectType := int(e.Args()[1].IntPart()) // XX类型
|
||||
|
||||
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, effectType)
|
||||
statusEffect := e.CarrierInput().InitEffect(input.EffectType.Status, effectType)
|
||||
if statusEffect != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), statusEffect)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ type Effect453 struct {
|
||||
func (e *Effect453) Skill_Use() bool {
|
||||
// 检查对手是否有能力强化状态
|
||||
ispwoer := false
|
||||
for i, v := range e.Ctx().Opp.Prop[:] {
|
||||
for i, v := range e.OpponentInput().Prop[:] {
|
||||
if v > 0 {
|
||||
e.Ctx().Our.SetProp(e.Ctx().Opp, int8(i), 0)
|
||||
e.CarrierInput().SetProp(e.OpponentInput(), int8(i), 0)
|
||||
ispwoer = true
|
||||
return true
|
||||
}
|
||||
@@ -25,9 +25,9 @@ func (e *Effect453) Skill_Use() bool {
|
||||
// 如果成功消除了状态,对对手施加异常状态
|
||||
effectType := int(e.Args()[0].IntPart()) // XX类型,比如麻痹
|
||||
|
||||
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, effectType)
|
||||
statusEffect := e.CarrierInput().InitEffect(input.EffectType.Status, effectType)
|
||||
if statusEffect != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
||||
e.OpponentInput().AddEffect(e.CarrierInput(), statusEffect)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ func (e *Effect454) ComparePre(fattack *action.SelectSkillAction, sattack *actio
|
||||
return true
|
||||
}
|
||||
//先手是自己
|
||||
if fattack.PlayerID == e.Ctx().Our.UserID {
|
||||
if fattack.PlayerID == e.CarrierInput().UserID {
|
||||
return true
|
||||
}
|
||||
if sattack == nil {
|
||||
@@ -27,8 +27,8 @@ func (e *Effect454) ComparePre(fattack *action.SelectSkillAction, sattack *actio
|
||||
if sattack.SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
maxHp := e.Ctx().Our.CurPet[0].GetMaxHP()
|
||||
currentHp := e.Ctx().Our.CurPet[0].GetHP()
|
||||
maxHp := e.CarrierInput().CurPet[0].GetMaxHP()
|
||||
currentHp := e.CarrierInput().CurPet[0].GetHP()
|
||||
|
||||
threshold := maxHp.Div(e.Args()[0]) // 1/n
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user