feat: 新增技能效果 1248-1252
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
# Task 127: Effects 1248-1252
|
||||
|
||||
## 目标
|
||||
|
||||
- 补齐以下 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 1248
|
||||
- `argsNum`: `2`
|
||||
- `info`: `对手处于异常状态时{0}%令对手{1}`
|
||||
- `param`: `1,1,1`
|
||||
|
||||
### Effect 1249
|
||||
- `argsNum`: `1`
|
||||
- `info`: `造成伤害的{0}%恢复自身体力,若对手处于异常状态则附加等量百分比伤害`
|
||||
|
||||
### Effect 1250
|
||||
- `argsNum`: `1`
|
||||
- `info`: `{0}回合内自身能力提升状态消失则下回合自身必定致命一击`
|
||||
|
||||
### Effect 1251
|
||||
- `argsNum`: `0`
|
||||
- `info`: `自身体力低于200时必定先手`
|
||||
|
||||
### Effect 1252
|
||||
- `argsNum`: `4`
|
||||
- `info`: `自身体力低于1/{0}时造成的伤害为{1}倍,低于1/{2}时伤害为{3}倍`
|
||||
|
||||
## 备注
|
||||
|
||||
- 该清单按当前仓库静态注册结果生成;如果某个 effect 实际通过其他模块或运行时路径实现,需要先复核后再落代码。
|
||||
- 对 `201`、`445` 这类占位 effect,优先补核心逻辑或补充明确的不可实现说明。
|
||||
150
logic/service/fight/effect/1248_1252.go
Normal file
150
logic/service/fight/effect/1248_1252.go
Normal file
@@ -0,0 +1,150 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/action"
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
"math"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// Effect 1248: 对手处于异常状态时{0}%令对手{1}
|
||||
type Effect1248 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect1248) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 || !e.Ctx().Opp.StatEffect_Exist_all() {
|
||||
return true
|
||||
}
|
||||
|
||||
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
|
||||
if !success {
|
||||
return true
|
||||
}
|
||||
|
||||
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 1249: 造成伤害的{0}%恢复自身体力,若对手处于异常状态则附加等量百分比伤害
|
||||
type Effect1249 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect1249) Skill_Use() bool {
|
||||
if len(e.Args()) == 0 || e.Ctx().Our.SumDamage.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
healAmount := e.Ctx().Our.SumDamage.Mul(e.Args()[0]).Div(alpacadecimal.NewFromInt(100))
|
||||
if healAmount.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, healAmount)
|
||||
if e.Ctx().Opp.StatEffect_Exist_all() {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Percent,
|
||||
Damage: healAmount,
|
||||
})
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1250: {0}回合内自身能力提升状态消失则下回合自身必定致命一击
|
||||
type Effect1250 struct {
|
||||
RoundEffectArg0Base
|
||||
}
|
||||
|
||||
func (e *Effect1250) PropBefer(source *input.Input, prop int8, level int8) bool {
|
||||
if prop < 0 || int(prop) >= len(e.Ctx().Our.Prop) {
|
||||
return true
|
||||
}
|
||||
if level != 0 || e.Ctx().Our.Prop[prop] <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1250)
|
||||
if effect != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
|
||||
}
|
||||
e.Alive(false)
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1250Sub struct {
|
||||
FixedDuration1Base
|
||||
}
|
||||
|
||||
func (e *Effect1250Sub) ActionStart(a, b *action.SelectSkillAction) bool {
|
||||
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
|
||||
e.Ctx().SkillEntity.XML.CritRate = 16
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1251: 自身体力低于200时必定先手
|
||||
type Effect1251 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect1251) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||||
if e.Ctx().Our.CurrentPet.GetHP().IntPart() >= 200 {
|
||||
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
|
||||
}
|
||||
|
||||
// Effect 1252: 自身体力低于1/{0}时造成的伤害为{1}倍,低于1/{2}时伤害为{3}倍
|
||||
type Effect1252 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect1252) Damage_Mul(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 4 {
|
||||
return true
|
||||
}
|
||||
|
||||
currentHP := e.Ctx().Our.CurrentPet.GetHP()
|
||||
maxHP := e.Ctx().Our.CurrentPet.GetMaxHP()
|
||||
|
||||
if e.Args()[2].Cmp(alpacadecimal.Zero) > 0 {
|
||||
threshold := maxHP.Div(e.Args()[2])
|
||||
if currentHP.Cmp(threshold) < 0 {
|
||||
zone.Mul(int(e.Args()[3].IntPart()))
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
if e.Args()[0].Cmp(alpacadecimal.Zero) > 0 {
|
||||
threshold := maxHP.Div(e.Args()[0])
|
||||
if currentHP.Cmp(threshold) < 0 {
|
||||
zone.Mul(int(e.Args()[1].IntPart()))
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 1248, &Effect1248{})
|
||||
input.InitEffect(input.EffectType.Skill, 1249, &Effect1249{})
|
||||
input.InitEffect(input.EffectType.Skill, 1250, &Effect1250{})
|
||||
input.InitEffect(input.EffectType.Sub, 1250, &Effect1250Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1251, &Effect1251{})
|
||||
input.InitEffect(input.EffectType.Skill, 1252, &Effect1252{})
|
||||
}
|
||||
@@ -530,6 +530,11 @@ var effectInfoByID = map[int]string{
|
||||
1245: "若自身处于能力提升状态则附加给对手等同于自身能力提升状态的能力下降状态,若未满足或未触发则令对手随机{0}项技能PP值归零",
|
||||
1246: "消除双方能力提升、下降状态,消除任意一方成功则令对手下{0}次使用的攻击技能无效",
|
||||
1247: "先出手时使对手当回合内无法通过技能恢复自身体力",
|
||||
1248: "对手处于异常状态时{0}%令对手{1}",
|
||||
1249: "造成伤害的{0}%恢复自身体力,若对手处于异常状态则附加等量百分比伤害",
|
||||
1250: "{0}回合内自身能力提升状态消失则下回合自身必定致命一击",
|
||||
1251: "自身体力低于200时必定先手",
|
||||
1252: "自身体力低于1/{0}时造成的伤害为{1}倍,低于1/{2}时伤害为{3}倍",
|
||||
1393: "{0}回合内每回合使用技能则造成伤害前令对手防御-{1}、速度-{2},未触发则附加对手最大体力1/{3}的百分比伤害",
|
||||
1394: "{0}回合内对手使用属性技能则随机进入{1}种异常状态",
|
||||
1395: "若先出手则必定打出致命一击",
|
||||
|
||||
Reference in New Issue
Block a user