```feat(fight): 新增特性实现及逻辑优化
1. 实现NewSel114免疫瞬杀特性逻辑 2. 完善NewSel113异常状态伤害锁定逻辑 3. 修复Effect13技能效果添加错误 4. 优化ParasiticSeed状态切换处理 5. 移除无用TODO注释和废弃代码
This commit is contained in:
@@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
// NewSel112 受到物理时使自身的一种 battle_lv 提升1个等级,可提升n次;(a1: which blv, a2: max_blv_up_times)
|
||||
// TODO: 实现受到物理时使自身的一种 battle_lv 提升1个等级,可提升n次;(a1: which blv, a2: max_blv_up_times)的核心逻辑
|
||||
|
||||
type NewSel112 struct {
|
||||
NewSel0
|
||||
count int
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// todo "只有当自己处于异常状态时才会受到伤害"
|
||||
@@ -10,6 +13,25 @@ type NewSel113 struct {
|
||||
count int
|
||||
}
|
||||
|
||||
func (e *NewSel404) DamageLock(t *info.DamageZone) bool {
|
||||
//魂印特性有不在场的情况,绑定时候将精灵和特性绑定
|
||||
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
|
||||
return true
|
||||
}
|
||||
if t.Type != info.DamageType.Red {
|
||||
return true
|
||||
}
|
||||
for _, v := range e.Ctx().Our.Effects {
|
||||
if v.Alive() && input.IS_Stat(v) {
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
t.Damage = alpacadecimal.Zero
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 113, &NewSel113{})
|
||||
}
|
||||
|
||||
39
logic/service/fight/boss/NewSeIdx_114.go
Normal file
39
logic/service/fight/boss/NewSeIdx_114.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/action"
|
||||
"blazing/logic/service/fight/input"
|
||||
)
|
||||
|
||||
// 免疫瞬杀
|
||||
type NewSel114 struct {
|
||||
NewSel0
|
||||
v *input.Effect
|
||||
}
|
||||
|
||||
func (e *NewSel114) TurnStart(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) {
|
||||
// TODO: 实现若遇到天敌, 则战斗开始时连续害怕 n 回合;(a1: n)的核心逻辑
|
||||
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
|
||||
return
|
||||
}
|
||||
|
||||
for _, v := range e.Ctx().Opp.Opp.Effects {
|
||||
|
||||
if v.ID().GetEffectType() == input.EffectType.NewSel && v.ID().Suffix() == 32 {
|
||||
v.Alive()
|
||||
e.v = &v
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
func (e *NewSel114) TurnEnd() {
|
||||
if e.v != nil {
|
||||
e.Alive(true)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 114, &NewSel114{})
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
// TODO: 实现若遇到天敌, 则战斗开始时连续害怕 n 回合;(a1: n)的核心逻辑
|
||||
type NewSel14 struct {
|
||||
NewSel0
|
||||
conut int
|
||||
}
|
||||
|
||||
func (e *NewSel14) TurnStart(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) {
|
||||
@@ -16,6 +17,8 @@ func (e *NewSel14) TurnStart(fattack *action.SelectSkillAction, sattack *action.
|
||||
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
|
||||
return
|
||||
}
|
||||
|
||||
//xmlres.PetMAP[e.Ctx().Our.CurrentPet.ID].SpAtk
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 14, &NewSel14{})
|
||||
|
||||
@@ -38,6 +38,6 @@ func (e *Effect13) OnSkill() bool {
|
||||
}
|
||||
eff.Duration(e.EffectNode.SideEffectArgs[0] - 1)
|
||||
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Opp, eff)
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -98,6 +98,14 @@ type ParasiticSeed struct {
|
||||
Status info.EnumPetStatus // 状态类型枚举
|
||||
}
|
||||
|
||||
func (e *ParasiticSeed) SwitchOut(in *input.Input) bool {
|
||||
|
||||
if in == e.Ctx().Our {
|
||||
e.Alive(false)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// 技能命中前触发寄生效果
|
||||
func (e *ParasiticSeed) ActionStartEx(attacker, defender *action.SelectSkillAction) bool {
|
||||
// 过滤特定类型单位(假设1是植物类型,使用枚举替代魔法数字)
|
||||
@@ -179,7 +187,7 @@ func (e *Weakened) DamageDivEx(t *info.DamageZone) bool {
|
||||
// 1. 定义衰弱等级对应的倍率表(索引对应等级,0级无倍率)
|
||||
// 索引0: 0%(未衰弱)、1:25%、2:50%、3:100%、4:250%、5:500%
|
||||
weakenedMultiples := []alpacadecimal.Decimal{
|
||||
alpacadecimal.Zero, // 0级
|
||||
alpacadecimal.Zero, // 0级
|
||||
alpacadecimal.NewFromFloat(0.25), // 1级(25%)
|
||||
alpacadecimal.NewFromFloat(0.5), // 2级(50%)
|
||||
alpacadecimal.NewFromFloat(1.0), // 3级(100%)
|
||||
|
||||
Reference in New Issue
Block a user