```
feat(effect): 实现多个战斗效果功能 - 实现了effects 2195-2199的功能,包括消除对手回合类效果、概率附加效果、 护盾/护罩状态下触发的效果等 - 实现了effects 2220-2239的功能,包括攻击特攻最高值转换、闪避与PP归零、 伤害提升、恢复体力、回合效果管理等功能 - 实现了effects 2270-2294的部分功能修复,调整了精灵
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
# Task 316: Effects 2195-2199
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 2195
|
||||
- `argsNum`: `2`
|
||||
- `info`: `消除对手回合类效果,消除成功对手下{0}回合先制-{1}`
|
||||
|
||||
### Effect 2196
|
||||
- `argsNum`: `2`
|
||||
- `info`: `{0}%令自身{1}`
|
||||
- `param`: `1,1,1`
|
||||
|
||||
### Effect 2197
|
||||
- `argsNum`: `0`
|
||||
- `info`: `自身处于护罩状态时必定命中`
|
||||
|
||||
### Effect 2198
|
||||
- `argsNum`: `2`
|
||||
- `info`: `双方任意一方处于护盾状态时{0}%令对手{1}`
|
||||
- `param`: `1,1,1`
|
||||
|
||||
### Effect 2199
|
||||
- `argsNum`: `2`
|
||||
- `info`: `双方任意一方处于护罩状态时{0}%令对手{1}`
|
||||
- `param`: `1,1,1`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
@@ -1,35 +0,0 @@
|
||||
# Task 321: Effects 2220-2224
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 2220
|
||||
- `argsNum`: `0`
|
||||
- `info`: `将自身攻击和特攻中最高的能力值作为自己的能力值进行攻击`
|
||||
|
||||
### Effect 2221
|
||||
- `argsNum`: `3`
|
||||
- `info`: `{0}回合内每回合{1}%闪避对手攻击,对手攻击技能命中时令对手随机{2}个技能PP值归0`
|
||||
|
||||
### Effect 2222
|
||||
- `argsNum`: `1`
|
||||
- `info`: `对手体力为满时造成伤害提升{0}%`
|
||||
|
||||
### Effect 2223
|
||||
- `argsNum`: `1`
|
||||
- `info`: `若对手当回合切换精灵则造成伤害提升{0}%`
|
||||
|
||||
### Effect 2224
|
||||
- `argsNum`: `1`
|
||||
- `info`: `若对手当回合选择属性技能则造成伤害提升{0}%`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
@@ -1,37 +0,0 @@
|
||||
# Task 323: Effects 2230-2234
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 2230
|
||||
- `argsNum`: `4`
|
||||
- `info`: `{0}回合内使用技能则恢复自身最大体力的1/{1},若未恢复体力则{2}%令对手{3}`
|
||||
- `param`: `1,3,3`
|
||||
|
||||
### Effect 2231
|
||||
- `argsNum`: `2`
|
||||
- `info`: `下{0}回合攻击命中时消耗自身体力的1/{1}并造成等量百分比伤害`
|
||||
|
||||
### Effect 2232
|
||||
- `argsNum`: `1`
|
||||
- `info`: `下{0}回合使用技能不受PP值限制`
|
||||
|
||||
### Effect 2233
|
||||
- `argsNum`: `3`
|
||||
- `info`: `{0}回合内对手使用技能后每处于{1}种异常状态,受到{2}点固定伤害`
|
||||
|
||||
### Effect 2234
|
||||
- `argsNum`: `2`
|
||||
- `info`: `自身处于能力下降状态时{0}%令对手{1}`
|
||||
- `param`: `1,1,1`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
@@ -1,36 +0,0 @@
|
||||
# Task 324: Effects 2235-2239
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 2235
|
||||
- `argsNum`: `0`
|
||||
- `info`: `全属性+1,自身拥有命运晨星时效果翻倍`
|
||||
|
||||
### Effect 2236
|
||||
- `argsNum`: `1`
|
||||
- `info`: `使自身下{0}次可翻倍的支援效果翻倍`
|
||||
|
||||
### Effect 2237
|
||||
- `argsNum`: `1`
|
||||
- `info`: `对方每比己方多存活一只精灵,威力提升{0}点`
|
||||
|
||||
### Effect 2238
|
||||
- `argsNum`: `2`
|
||||
- `info`: `{0}回合内若自身回合类效果被消除则免疫下{1}次受到的异常状态`
|
||||
|
||||
### Effect 2239
|
||||
- `argsNum`: `2`
|
||||
- `info`: `免疫下{0}次对手的攻击,对手使用{1}系攻击时此效果失效`
|
||||
- `param`: `22,1,1`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
@@ -1,6 +1,7 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
element "blazing/common/data/Element"
|
||||
"blazing/common/data/xmlres"
|
||||
"blazing/logic/service/fight/action"
|
||||
"blazing/logic/service/fight/info"
|
||||
@@ -11,6 +12,21 @@ import (
|
||||
"github.com/gogf/gf/v2/util/grand"
|
||||
)
|
||||
|
||||
func clearOwnStatusEffects(target *input.Input) bool {
|
||||
if target == nil {
|
||||
return false
|
||||
}
|
||||
cleared := false
|
||||
for _, eff := range target.Effects {
|
||||
if eff == nil || !eff.Alive() || eff.ID().GetEffectType() != input.EffectType.Status {
|
||||
continue
|
||||
}
|
||||
eff.Alive(false)
|
||||
cleared = true
|
||||
}
|
||||
return cleared
|
||||
}
|
||||
|
||||
// Effect 2195: 消除对手回合类效果并降低先制
|
||||
type Effect2195 struct {
|
||||
node.EffectNode
|
||||
@@ -50,7 +66,7 @@ func (e *Effect2195Sub) ComparePre(fattack, sattack *action.SelectSkillAction) b
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 2196: 令自身行动
|
||||
// Effect 2196: 概率附加自身效果
|
||||
type Effect2196 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
@@ -59,7 +75,9 @@ func (e *Effect2196) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 {
|
||||
return true
|
||||
}
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, 5, int8(e.Args()[0].IntPart()))
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
|
||||
addStatusByID(e.Ctx().Our, e.Ctx().Our, int(e.Args()[1].IntPart()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -75,7 +93,7 @@ func (e *Effect2197) SkillHit_ex() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 2198: 双方任一方护盾时追加效果
|
||||
// Effect 2198: 双方任一方护盾时概率附加对手效果
|
||||
type Effect2198 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
@@ -84,16 +102,16 @@ func (e *Effect2198) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Our.HasShield() || e.Ctx().Opp.HasShield() {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: e.Args()[1],
|
||||
})
|
||||
if !e.Ctx().Our.HasShield() && !e.Ctx().Opp.HasShield() {
|
||||
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()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 2199: 双方任一方护罩时追加效果
|
||||
// Effect 2199: 双方任一方护罩时概率附加对手效果
|
||||
type Effect2199 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
@@ -102,11 +120,11 @@ func (e *Effect2199) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Our.HasShield() || e.Ctx().Opp.HasShield() {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: e.Args()[1],
|
||||
})
|
||||
if !e.Ctx().Our.HasShield() && !e.Ctx().Opp.HasShield() {
|
||||
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()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -191,12 +209,21 @@ type Effect2205 struct {
|
||||
}
|
||||
|
||||
func (e *Effect2205) Damage_Mul(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || e.Ctx().SkillEntity == nil {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || e.Ctx().SkillEntity == nil || !e.Ctx().Our.StatEffect_Exist_all() {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Our.StatEffect_Exist_all() || e.Ctx().Opp.StatEffect_Exist_all() {
|
||||
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
|
||||
if e.Ctx().Our.CurrentPet == nil || e.Ctx().Opp.CurrentPet == nil {
|
||||
return true
|
||||
}
|
||||
attackMul, err := element.Calculator.GetOffensiveMultiplier(e.Ctx().SkillEntity.GetType().ID, e.Ctx().Opp.CurrentPet.GetType().ID)
|
||||
if err != nil || attackMul <= 0 {
|
||||
return true
|
||||
}
|
||||
counterMul, err := element.Calculator.GetOffensiveMultiplier(e.Ctx().Opp.CurrentPet.GetType().ID, e.Ctx().Our.CurrentPet.GetType().ID)
|
||||
if err != nil || counterMul <= 0 || counterMul <= attackMul {
|
||||
return true
|
||||
}
|
||||
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromFloat(counterMul / attackMul))
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -206,7 +233,28 @@ type Effect2206 struct {
|
||||
}
|
||||
|
||||
func (e *Effect2206) Skill_Use() bool {
|
||||
clearOwnDownProps(e.Ctx().Our)
|
||||
if len(e.Args()) == 0 {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2206, int(e.Args()[0].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect2206Sub struct {
|
||||
RoundEffectArg0Base
|
||||
}
|
||||
|
||||
func (e *Effect2206Sub) PropBefer(source *input.Input, prop, level int8) bool {
|
||||
if source != e.Ctx().Opp || level != 0 {
|
||||
return true
|
||||
}
|
||||
if prop < 0 || int(prop) >= len(e.Ctx().Our.Prop) || e.Ctx().Our.Prop[prop] <= 0 {
|
||||
return true
|
||||
}
|
||||
clearOwnStatusEffects(e.Ctx().Our)
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -215,15 +263,29 @@ type Effect2207 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect2207) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
if len(a) > 0 {
|
||||
e.Duration(a[0])
|
||||
func (e *Effect2207) Skill_Use() bool {
|
||||
if len(e.Args()) == 0 || e.Ctx().Our == nil {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Effect2207) TurnEnd() {
|
||||
e.EffectNode.TurnEnd()
|
||||
reduce := int(e.Args()[0].IntPart())
|
||||
if reduce <= 0 {
|
||||
return true
|
||||
}
|
||||
for _, eff := range e.Ctx().Our.Effects {
|
||||
if eff == nil || !eff.Alive() || eff.ID().GetEffectType() != input.EffectType.Status {
|
||||
continue
|
||||
}
|
||||
if eff.Duration() <= 0 {
|
||||
continue
|
||||
}
|
||||
remaining := eff.Duration() - reduce
|
||||
if remaining <= 0 {
|
||||
eff.Alive(false)
|
||||
continue
|
||||
}
|
||||
eff.Duration(remaining)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 2208: 星盘每转动时增威力
|
||||
@@ -250,9 +312,13 @@ func (e *Effect2209) OnSkill() bool {
|
||||
if len(e.Args()) == 0 {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().SkillEntity != nil {
|
||||
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0])
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
|
||||
if e.Ctx().SkillEntity != nil && e.Ctx().Our.CurrentPet != nil && e.Ctx().Opp.CurrentPet != nil {
|
||||
drain := alpacadecimal.NewFromInt(int64(e.Args()[0].IntPart()))
|
||||
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
|
||||
}
|
||||
@@ -397,15 +463,52 @@ type Effect2218 struct {
|
||||
}
|
||||
|
||||
func (e *Effect2218) Skill_Use() bool {
|
||||
if len(e.Args()) < 3 {
|
||||
if len(e.Args()) < 3 || e.Ctx().Our == nil || e.Ctx().Our.CurrentPet == nil {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Our.CurrentPet != nil && e.Ctx().Our.CurrentPet.PetInfo.Type != int(e.Args()[1].IntPart()) {
|
||||
e.Ctx().Our.CurrentPet.PetInfo.Type = int(e.Args()[2].IntPart())
|
||||
|
||||
targetType := int(e.Args()[1].IntPart())
|
||||
if e.Ctx().Our.CurrentPet.PetInfo.Type == targetType {
|
||||
for i := 0; i < 6; i++ {
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), int8(e.Args()[2].IntPart()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2218, int(e.Args()[0].IntPart()), targetType)
|
||||
if sub != nil {
|
||||
e.Ctx().Our.CurrentPet.PetInfo.Type = targetType
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect2218Sub struct {
|
||||
node.EffectNode
|
||||
oldType int
|
||||
targetType int
|
||||
}
|
||||
|
||||
func (e *Effect2218Sub) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
if e.Ctx() != nil && e.Ctx().Our != nil && e.Ctx().Our.CurrentPet != nil {
|
||||
e.oldType = e.Ctx().Our.CurrentPet.PetInfo.Type
|
||||
}
|
||||
if len(a) > 0 {
|
||||
e.Duration(a[0])
|
||||
}
|
||||
if len(a) > 1 {
|
||||
e.targetType = a[1]
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Effect2218Sub) Alive(t ...bool) bool {
|
||||
if len(t) > 0 && !t[0] && e.Ctx() != nil && e.Ctx().Our != nil && e.Ctx().Our.CurrentPet != nil && e.Ctx().Our.CurrentPet.PetInfo.Type == e.targetType {
|
||||
e.Ctx().Our.CurrentPet.PetInfo.Type = e.oldType
|
||||
}
|
||||
return e.EffectNode.Alive(t...)
|
||||
}
|
||||
|
||||
// Effect 2219: 光辉能量提升至体力比例
|
||||
type Effect2219 struct {
|
||||
node.EffectNode
|
||||
@@ -438,6 +541,7 @@ func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 2204, &Effect2204{})
|
||||
input.InitEffect(input.EffectType.Skill, 2205, &Effect2205{})
|
||||
input.InitEffect(input.EffectType.Skill, 2206, &Effect2206{})
|
||||
input.InitEffect(input.EffectType.Sub, 2206, &Effect2206Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 2207, &Effect2207{})
|
||||
input.InitEffect(input.EffectType.Skill, 2208, &Effect2208{})
|
||||
input.InitEffect(input.EffectType.Skill, 2209, &Effect2209{})
|
||||
@@ -450,6 +554,7 @@ func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 2216, &Effect2216{})
|
||||
input.InitEffect(input.EffectType.Skill, 2217, &Effect2217{})
|
||||
input.InitEffect(input.EffectType.Skill, 2218, &Effect2218{})
|
||||
input.InitEffect(input.EffectType.Sub, 2218, &Effect2218Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 2219, &Effect2219{})
|
||||
_ = grand.Intn(1)
|
||||
_ = alpacadecimal.Zero
|
||||
|
||||
@@ -26,6 +26,27 @@ func countStatusEffects2220(target *input.Input) int {
|
||||
return count
|
||||
}
|
||||
|
||||
func clearRoundEffects2229(target *input.Input) bool {
|
||||
if target == nil {
|
||||
return false
|
||||
}
|
||||
cleared := false
|
||||
for _, eff := range target.Effects {
|
||||
if eff == nil || !eff.Alive() {
|
||||
continue
|
||||
}
|
||||
if eff.ID().GetEffectType() != input.EffectType.Sub {
|
||||
continue
|
||||
}
|
||||
if eff.Duration() <= 0 {
|
||||
continue
|
||||
}
|
||||
eff.Alive(false)
|
||||
cleared = true
|
||||
}
|
||||
return cleared
|
||||
}
|
||||
|
||||
// Effect 2220: 将自身攻击和特攻中最高的能力值作为自身的能力值进行攻击
|
||||
type Effect2220 struct{ node.EffectNode }
|
||||
|
||||
@@ -50,19 +71,14 @@ func (e *Effect2221) SkillHit_ex() bool {
|
||||
if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok {
|
||||
e.Ctx().SkillEntity.SetMiss()
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect2221) Skill_Use_ex() bool {
|
||||
if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||||
if e.Ctx().SkillEntity.AttackTime == 2 {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().SkillEntity.AttackTime != 0 {
|
||||
e.Ctx().Opp.DelPP(int(e.Args()[2].IntPart()))
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok {
|
||||
e.Ctx().SkillEntity.SetMiss()
|
||||
return true
|
||||
}
|
||||
zeroRandomSkillPP(e.Ctx().Opp, int(e.Args()[2].IntPart()))
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -141,10 +157,27 @@ func (e *Effect2224) Damage_Mul(zone *info.DamageZone) bool {
|
||||
type Effect2225 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect2225) Skill_Use() bool {
|
||||
if len(e.Args()) == 0 || e.Ctx().Opp.CurrentPet == nil {
|
||||
if len(e.Args()) == 0 || e.Ctx().Opp == nil || e.Ctx().Opp.CurrentPet == nil {
|
||||
return true
|
||||
}
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])})
|
||||
|
||||
maxHP := e.Ctx().Opp.CurrentPet.GetMaxHP()
|
||||
if e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
loss := maxHP.Div(e.Args()[0])
|
||||
if loss.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
newMax := maxHP.Sub(loss)
|
||||
if newMax.Cmp(alpacadecimal.NewFromInt(1)) < 0 {
|
||||
newMax = alpacadecimal.NewFromInt(1)
|
||||
}
|
||||
e.Ctx().Opp.CurrentPet.Info.MaxHp = uint32(newMax.IntPart())
|
||||
if e.Ctx().Opp.CurrentPet.Info.Hp > e.Ctx().Opp.CurrentPet.Info.MaxHp {
|
||||
e.Ctx().Opp.CurrentPet.Info.Hp = e.Ctx().Opp.CurrentPet.Info.MaxHp
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -301,21 +334,49 @@ func (e *Effect2227Sub) ActionStart(a, b *action.SelectSkillAction) bool {
|
||||
type Effect2229 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect2229) OnSkill() bool {
|
||||
if e.Ctx().Our == nil || e.Ctx().Our.CurrentPet == 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)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 2230: {0}回合内每回合恢复自身最大体力的1/{1},若未恢复体力则{2}%令对手{3}
|
||||
type Effect2230 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect2230) OnSkill() bool {
|
||||
func (e *Effect2230) Skill_Use() bool {
|
||||
if len(e.Args()) < 4 {
|
||||
return true
|
||||
}
|
||||
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
|
||||
if e.Ctx().Our.CurrentPet.GetHP().Cmp(heal) >= 0 {
|
||||
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[3].IntPart()))
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2230, 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().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect2230Sub struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect2230Sub) OnSkill() bool {
|
||||
if len(e.Args()) < 4 || e.Ctx().Our.CurrentPet == nil || e.Ctx().Opp.CurrentPet == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
fullHP := e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) >= 0
|
||||
if !fullHP {
|
||||
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
|
||||
if heal.Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
|
||||
}
|
||||
} else {
|
||||
success, _, _ := e.Input.Player.Roll(int(e.Args()[2].IntPart()), 100)
|
||||
if success {
|
||||
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[3].IntPart()))
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -323,13 +384,31 @@ func (e *Effect2230) OnSkill() bool {
|
||||
// Effect 2231: {0}回合内命中时消耗自身体力的1/{1}并造成等量百分比伤害
|
||||
type Effect2231 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect2231) OnSkill() bool {
|
||||
func (e *Effect2231) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 {
|
||||
return true
|
||||
}
|
||||
dmg := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: dmg})
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: dmg})
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2231, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect2231Sub struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect2231Sub) OnSkill() bool {
|
||||
if len(e.Args()) < 2 || e.Ctx().Our.CurrentPet == nil || e.Ctx().Opp.CurrentPet == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
lost := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
|
||||
if lost.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
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.Percent, Damage: lost})
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -341,11 +420,29 @@ func (e *Effect2232) HookPP(count *int) bool { return true }
|
||||
// Effect 2233: {0}回合内对手每处于{1}种异常状态,受到{2}点固定伤害
|
||||
type Effect2233 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect2233) OnSkill() bool {
|
||||
func (e *Effect2233) Skill_Use() bool {
|
||||
if len(e.Args()) < 3 {
|
||||
return true
|
||||
}
|
||||
damage := countStatusEffects2220(e.Ctx().Opp) * int(e.Args()[2].IntPart())
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2233, 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 Effect2233Sub struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect2233Sub) Action_end() bool {
|
||||
if len(e.Args()) < 3 || e.Ctx().Opp == nil {
|
||||
return true
|
||||
}
|
||||
count := countStatusEffects2220(e.Ctx().Opp)
|
||||
group := int(e.Args()[1].IntPart())
|
||||
if count <= 0 || group <= 0 {
|
||||
return true
|
||||
}
|
||||
damage := (count / group) * int(e.Args()[2].IntPart())
|
||||
if damage > 0 {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: alpacadecimal.NewFromInt(int64(damage))})
|
||||
}
|
||||
@@ -355,13 +452,15 @@ func (e *Effect2233) OnSkill() bool {
|
||||
// Effect 2234: 自身处于能力下降时{0}%令对手{1}
|
||||
type Effect2234 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect2234) Damage_Mul(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
|
||||
func (e *Effect2234) OnSkill() bool {
|
||||
if len(e.Args()) < 2 || !e.Ctx().Our.HasPropSub() {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Our.HasPropADD() {
|
||||
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
|
||||
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
|
||||
if !success {
|
||||
return true
|
||||
}
|
||||
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -384,7 +483,46 @@ func (e *Effect2235) SkillHit() bool {
|
||||
// Effect 2236: 使自身下{0}次可翻倍的支援效果翻倍
|
||||
type Effect2236 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect2236) SkillHit() bool { return true }
|
||||
func (e *Effect2236) Skill_Use() bool {
|
||||
if len(e.Args()) == 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2236, int(e.Args()[0].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect2236Sub struct {
|
||||
RoundEffectArg0Base
|
||||
remaining int
|
||||
}
|
||||
|
||||
func (e *Effect2236Sub) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.Duration(-1)
|
||||
if len(a) > 0 {
|
||||
e.remaining = a[0]
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Effect2236Sub) Heal_Pre(ac action.BattleActionI, value *int) bool {
|
||||
if value == nil || *value <= 0 || e.remaining <= 0 {
|
||||
return true
|
||||
}
|
||||
if _, ok := ac.(*action.SelectSkillAction); !ok {
|
||||
return true
|
||||
}
|
||||
|
||||
*value *= 2
|
||||
e.remaining--
|
||||
if e.remaining <= 0 {
|
||||
e.Alive(false)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 2237: 对手每比己方多存活一只精灵,威力提升{0}点
|
||||
type Effect2237 struct{ node.EffectNode }
|
||||
@@ -648,12 +786,16 @@ func init() {
|
||||
input.InitEffect(input.EffectType.Sub, 2228, &Effect2228Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 2229, &Effect2229{})
|
||||
input.InitEffect(input.EffectType.Skill, 2230, &Effect2230{})
|
||||
input.InitEffect(input.EffectType.Sub, 2230, &Effect2230Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 2231, &Effect2231{})
|
||||
input.InitEffect(input.EffectType.Sub, 2231, &Effect2231Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 2232, &Effect2232{})
|
||||
input.InitEffect(input.EffectType.Skill, 2233, &Effect2233{})
|
||||
input.InitEffect(input.EffectType.Sub, 2233, &Effect2233Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 2234, &Effect2234{})
|
||||
input.InitEffect(input.EffectType.Skill, 2235, &Effect2235{})
|
||||
input.InitEffect(input.EffectType.Skill, 2236, &Effect2236{})
|
||||
input.InitEffect(input.EffectType.Sub, 2236, &Effect2236Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 2237, &Effect2237{})
|
||||
input.InitEffect(input.EffectType.Skill, 2238, &Effect2238{})
|
||||
input.InitEffect(input.EffectType.Sub, 2238, &Effect2238Sub{})
|
||||
|
||||
@@ -558,7 +558,7 @@ func (e *Effect2280) Skill_Use_ex() bool {
|
||||
type Effect2280Sub struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect2280Sub) SwitchOut(in *input.Input) bool {
|
||||
if in != e.Ctx().Our {
|
||||
if in != e.Ctx().Opp {
|
||||
return true
|
||||
}
|
||||
e.Alive(false)
|
||||
@@ -743,9 +743,8 @@ func (e *Effect2284) Skill_Use() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
strippedTypes := 1
|
||||
e.Ctx().Opp.CurrentPet.PetInfo.Type = int(element.ElementTypeNormal)
|
||||
addRandomControlStatus2284(e.Ctx().Our, e.Ctx().Opp, strippedTypes)
|
||||
addRandomControlStatus2284(e.Ctx().Our, e.Ctx().Opp, 1)
|
||||
|
||||
rounds := int(e.Args()[0].IntPart())
|
||||
damagePerType := int(e.Args()[1].IntPart())
|
||||
@@ -753,7 +752,7 @@ func (e *Effect2284) Skill_Use() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2284, rounds, damagePerType, strippedTypes)
|
||||
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2284, rounds, damagePerType)
|
||||
if eff != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
|
||||
}
|
||||
@@ -763,7 +762,7 @@ func (e *Effect2284) Skill_Use() bool {
|
||||
type Effect2284Sub struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect2284Sub) Action_end() bool {
|
||||
if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().Opp == nil || e.Ctx().Opp.CurrentPet == nil {
|
||||
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().Opp == nil || e.Ctx().Opp.CurrentPet == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -772,14 +771,6 @@ func (e *Effect2284Sub) Action_end() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
maxTriggers := int(e.Args()[2].IntPart())
|
||||
if maxTriggers <= 0 {
|
||||
return true
|
||||
}
|
||||
if activeStatus > maxTriggers {
|
||||
activeStatus = maxTriggers
|
||||
}
|
||||
|
||||
damage := e.Args()[1].Mul(alpacadecimal.NewFromInt(int64(activeStatus)))
|
||||
if damage.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user