feat: 新增战斗效果1253-1262
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:
164
logic/service/fight/effect/1253_1257.go
Normal file
164
logic/service/fight/effect/1253_1257.go
Normal file
@@ -0,0 +1,164 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// Effect 1253: 击败对手则自身能力提升等级翻倍
|
||||
type Effect1253 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect1253) Skill_Use() bool {
|
||||
if e.Ctx().Opp.CurrentPet.Info.Hp > 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
for i, v := range e.Ctx().Our.Prop[:] {
|
||||
if v > 0 {
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), v)
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1254: 先出手时消除对手回合类效果
|
||||
type Effect1254 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect1254) Skill_Use() bool {
|
||||
if e.IsFirst() {
|
||||
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1255: {0}回合内每回合使用技能则{1}%令对手{2},未触发则附加对手最大体力1/{3}的百分比伤害
|
||||
type Effect1255 struct {
|
||||
RoundEffectArg0Base
|
||||
}
|
||||
|
||||
func (e *Effect1255) OnSkill() bool {
|
||||
if len(e.Args()) < 4 {
|
||||
return true
|
||||
}
|
||||
|
||||
success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
|
||||
if success {
|
||||
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[2].IntPart()))
|
||||
if statusEffect != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
if e.Args()[3].Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[3])
|
||||
if damage.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Percent,
|
||||
Damage: damage,
|
||||
})
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1256: 造成的伤害低于{0}时令对手{1},未触发则自身下{2}次攻击造成的伤害额外提升{3}%
|
||||
type Effect1256 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect1256) Skill_Use() bool {
|
||||
if len(e.Args()) < 4 {
|
||||
return true
|
||||
}
|
||||
|
||||
if e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) < 0 {
|
||||
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 := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1256, int(e.Args()[2].IntPart()), int(e.Args()[3].IntPart()))
|
||||
if effect != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1256Sub struct {
|
||||
node.EffectNode
|
||||
remaining int
|
||||
percent alpacadecimal.Decimal
|
||||
}
|
||||
|
||||
func (e *Effect1256Sub) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.Duration(-1)
|
||||
if len(a) > 0 {
|
||||
e.remaining = a[0]
|
||||
}
|
||||
if len(a) > 1 {
|
||||
e.percent = alpacadecimal.NewFromInt(int64(a[1]))
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Effect1256Sub) Damage_Mul(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || e.remaining <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(100).Add(e.percent)).Div(alpacadecimal.NewFromInt(100))
|
||||
e.remaining--
|
||||
if e.remaining <= 0 {
|
||||
e.Alive(false)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1257: 对手不处于异常状态则吸取对手最大体力的1/{0}
|
||||
type Effect1257 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect1257) OnSkill() bool {
|
||||
if len(e.Args()) == 0 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Opp.StatEffect_Exist_all() {
|
||||
return true
|
||||
}
|
||||
|
||||
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])
|
||||
if damage.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Percent,
|
||||
Damage: damage,
|
||||
})
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, nil, damage)
|
||||
return true
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 1253, &Effect1253{})
|
||||
input.InitEffect(input.EffectType.Skill, 1254, &Effect1254{})
|
||||
input.InitEffect(input.EffectType.Skill, 1255, &Effect1255{})
|
||||
input.InitEffect(input.EffectType.Skill, 1256, &Effect1256{})
|
||||
input.InitEffect(input.EffectType.Sub, 1256, &Effect1256Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1257, &Effect1257{})
|
||||
}
|
||||
236
logic/service/fight/effect/1258_1262.go
Normal file
236
logic/service/fight/effect/1258_1262.go
Normal file
@@ -0,0 +1,236 @@
|
||||
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 1258: 造成的攻击伤害若高于{0}则自身免疫下{1}次受到的异常状态
|
||||
type Effect1258 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect1258) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 || e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1258, int(e.Args()[1].IntPart()))
|
||||
if effect != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1258Sub struct {
|
||||
node.EffectNode
|
||||
remaining int
|
||||
}
|
||||
|
||||
func (e *Effect1258Sub) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.Duration(-1)
|
||||
if len(a) > 0 {
|
||||
e.remaining = a[0]
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Effect1258Sub) EFFect_Befer(in *input.Input, effEffect input.Effect) bool {
|
||||
if e.remaining <= 0 {
|
||||
e.Alive(false)
|
||||
return true
|
||||
}
|
||||
if in != e.Ctx().Opp || !input.IS_Stat(effEffect) {
|
||||
return true
|
||||
}
|
||||
|
||||
e.remaining--
|
||||
if e.remaining <= 0 {
|
||||
e.Alive(false)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Effect 1259: {0}回合内有{1}%概率免疫对手攻击伤害,未触发则对手{2}
|
||||
type Effect1259 struct {
|
||||
RoundEffectArg0Base
|
||||
}
|
||||
|
||||
func (e *Effect1259) DamageLockEx(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 3 {
|
||||
return true
|
||||
}
|
||||
|
||||
success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
|
||||
if success {
|
||||
zone.Damage = alpacadecimal.Zero
|
||||
return true
|
||||
}
|
||||
|
||||
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[2].IntPart()))
|
||||
if statusEffect != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1260: 将自身能力下降状态双倍反馈给对手,反馈成功则{0}回合内免疫能力下降效果
|
||||
type Effect1260 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect1260) OnSkill() bool {
|
||||
if len(e.Args()) == 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
reflected := false
|
||||
for i, v := range e.Ctx().Our.Prop[:] {
|
||||
if v >= 0 {
|
||||
continue
|
||||
}
|
||||
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 2*v) {
|
||||
reflected = true
|
||||
}
|
||||
}
|
||||
if !reflected {
|
||||
return true
|
||||
}
|
||||
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1260, int(e.Args()[0].IntPart()))
|
||||
if effect != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1260Sub struct {
|
||||
RoundEffectArg0Base
|
||||
}
|
||||
|
||||
func (e *Effect1260Sub) PropBefer(in *input.Input, prop int8, level int8) bool {
|
||||
if in == e.Ctx().Opp && level < 0 {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1261: 吸取对手能力提升状态,吸取成功则附加{0}点固定伤害
|
||||
type Effect1261 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect1261) OnSkill() bool {
|
||||
if len(e.Args()) == 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
absorbed := false
|
||||
for i, v := range e.Ctx().Opp.Prop[:] {
|
||||
if v <= 0 {
|
||||
continue
|
||||
}
|
||||
if !e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) {
|
||||
continue
|
||||
}
|
||||
absorbed = true
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), v)
|
||||
}
|
||||
if !absorbed {
|
||||
return true
|
||||
}
|
||||
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: e.Args()[0],
|
||||
})
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1262: 获得{0}点护盾,护盾消失时使对手下{1}次攻击技能无效
|
||||
type Effect1262 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect1262) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
e.Ctx().Our.AddShield(e.Args()[0])
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1262, int(e.Args()[1].IntPart()))
|
||||
if effect != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1262Sub struct {
|
||||
node.EffectNode
|
||||
triggered bool
|
||||
}
|
||||
|
||||
func (e *Effect1262Sub) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.Duration(-1)
|
||||
}
|
||||
|
||||
func (e *Effect1262Sub) Damage_Shield(zone *info.DamageZone) bool {
|
||||
if e.triggered || e.Ctx().Our.CurrentShield().Cmp(alpacadecimal.Zero) > 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
e.triggered = true
|
||||
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2062, int(e.Args()[0].IntPart()))
|
||||
if effect != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, effect)
|
||||
}
|
||||
e.Alive(false)
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1262DisableSub struct {
|
||||
node.EffectNode
|
||||
remaining int
|
||||
}
|
||||
|
||||
func (e *Effect1262DisableSub) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.Duration(-1)
|
||||
if len(a) > 0 {
|
||||
e.remaining = a[0]
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Effect1262DisableSub) ActionStart(a, b *action.SelectSkillAction) bool {
|
||||
if e.remaining <= 0 {
|
||||
e.Alive(false)
|
||||
return true
|
||||
}
|
||||
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
|
||||
e.Ctx().SkillEntity.SetMiss()
|
||||
e.remaining--
|
||||
if e.remaining <= 0 {
|
||||
e.Alive(false)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 1258, &Effect1258{})
|
||||
input.InitEffect(input.EffectType.Sub, 1258, &Effect1258Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1259, &Effect1259{})
|
||||
input.InitEffect(input.EffectType.Skill, 1260, &Effect1260{})
|
||||
input.InitEffect(input.EffectType.Sub, 1260, &Effect1260Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1261, &Effect1261{})
|
||||
input.InitEffect(input.EffectType.Skill, 1262, &Effect1262{})
|
||||
input.InitEffect(input.EffectType.Sub, 1262, &Effect1262Sub{})
|
||||
input.InitEffect(input.EffectType.Sub, 2062, &Effect1262DisableSub{})
|
||||
}
|
||||
@@ -535,6 +535,16 @@ var effectInfoByID = map[int]string{
|
||||
1250: "{0}回合内自身能力提升状态消失则下回合自身必定致命一击",
|
||||
1251: "自身体力低于200时必定先手",
|
||||
1252: "自身体力低于1/{0}时造成的伤害为{1}倍,低于1/{2}时伤害为{3}倍",
|
||||
1253: "击败对手则自身能力提升等级翻倍",
|
||||
1254: "先出手时消除对手回合类效果",
|
||||
1255: "{0}回合内每回合使用技能则{1}%令对手{2},未触发则附加对手最大体力1/{3}的百分比伤害",
|
||||
1256: "造成的伤害低于{0}时令对手{1},未触发则自身下{2}次攻击造成的伤害额外提升{3}%",
|
||||
1257: "对手不处于异常状态则吸取对手最大体力的1/{0}",
|
||||
1258: "造成的攻击伤害若高于{0}则自身免疫下{1}次受到的异常状态",
|
||||
1259: "{0}回合内有{1}%概率免疫对手攻击伤害,未触发则对手{2}",
|
||||
1260: "将自身能力下降状态双倍反馈给对手,反馈成功则{0}回合内免疫能力下降效果",
|
||||
1261: "吸取对手能力提升状态,吸取成功则附加{0}点固定伤害",
|
||||
1262: "获得{0}点护盾,护盾消失时使对手下{1}次攻击技能无效",
|
||||
1393: "{0}回合内每回合使用技能则造成伤害前令对手防御-{1}、速度-{2},未触发则附加对手最大体力1/{3}的百分比伤害",
|
||||
1394: "{0}回合内对手使用属性技能则随机进入{1}种异常状态",
|
||||
1395: "若先出手则必定打出致命一击",
|
||||
|
||||
Reference in New Issue
Block a user