修改各buff实现

This commit is contained in:
1
2025-08-27 15:29:34 +00:00
parent d5139816df
commit 5cc9daadbc
7 changed files with 91 additions and 15 deletions

View File

@@ -10,6 +10,7 @@ import (
*/
type Effect62 struct {
node.EffectNode
Hide bool // 是否隐藏 正常是命中就可用,镇魂歌是回合数到才可用
}
func init() {
@@ -22,16 +23,9 @@ func (this *Effect62) ID() int {
return 62
}
// 激活,可以被断回合
func (this *Effect62) OnActive() bool {
this.Available = true
return true
}
func (this *Effect62) OnDamage() bool {
if this.Available { //如果本可用
if this.Hide { //如果本可用
//直接秒杀对方
@@ -39,3 +33,17 @@ func (this *Effect62) OnDamage() bool {
return true
}
func (this *Effect62) TurnEnd() bool {
this.EffectNode.TurnEnd() //先调用回合
if this.Duration(0) != 1 { //说明还没到生效节点
this.Hide = true //隐藏效果
}
return true
}
// 激活回合,比如说镇魂歌秒杀
func (this *Effect62) OnActive() bool {
return !this.Hide //返回是否隐藏,正常的话都是可以使用的
}

View File

@@ -0,0 +1,41 @@
package effect
import (
"blazing/logic/service/fight/battle/node"
"blazing/logic/service/fight/info"
)
/**
* 当次攻击击败对方时减少对方下次出战精灵的最大体力1/n
*/
type Effect67 struct {
node.EffectNode
}
func init() {
info.NodeM.AddEffect(&Effect67{})
}
// 重写EFFectID
func (this *Effect67) ID() int {
this.EffectNode.ParamSize(1) //设置参数个数
return 67
}
// 重写死亡,如果击败,就出触发死亡事件,判断是目标精灵
func (this *Effect67) OnDefeat() bool {
return true
}
// 登场是下一只 减少对方下次出战精灵的最大体力1/n
func (this *Effect67) OnSwitchIn() bool {
return true
}
// 下场不消除buff
func (this *Effect67) OnSwitchOut() bool {
//下场默认清除effect
panic("not implemented") // TODO: Implement
}

View File

@@ -0,0 +1,25 @@
package effect
import (
"blazing/logic/service/fight/battle/node"
"blazing/logic/service/fight/info"
)
/**
* 连续使用每次威力增加n最高威力m
*/
type Effect9 struct {
node.EffectNode
skillid int //记录使用的技能 如果技能变了就删除effect
UseSkillCount int //技能使用了多少次切换后置0
}
func init() {
info.NodeM.AddEffect(&Effect9{})
}
// 重写EFFectID
func (this *Effect9) ID() int {
this.EffectNode.ParamSize(2) //设置参数个数
return 9
}

View File

@@ -8,6 +8,6 @@ func (this *EffectNode) PreActive() bool {
}
// 激活回合,比如说镇魂歌秒杀
func (f *EffectNode) OnActive() bool {
panic("not implemented") // TODO: Implement
func (this *EffectNode) OnActive() bool {
return true
}

View File

@@ -11,12 +11,13 @@ func (this *EffectNode) OnTurnStart() bool {
return true
}
// 如果是次数类的,那就相当于重写回合结束计数器
func (this *EffectNode) PreTurnEnd() bool {
panic("not implemented") // TODO: Implement
}
// 回合结束一次性effect清楚掉
// 如果是次数类的,那就相当于重写回合结束计数器
func (this *EffectNode) TurnEnd() bool {
this.duration--
// if this.duration > 0 {

View File

@@ -13,12 +13,12 @@ type EffectNode struct {
ctx context.Context //节点上下文
duration int // 默认为-1 持续回合/次0 = 即时生效,>0 = 回合数 ,负数是永久) 次数相当于重写回合
stacks int // 当前层数
paramSize int
stacks int // 当前层数
paramSize int
maxStack int // 最大叠加层数 ,正常都是不允许叠加的,除了衰弱特殊效果 ,异常和能力的叠层
SideEffectArgs []int // 附加效果参数
Available bool // 是否可用 正常是命中就可用,镇魂歌是回合数到才可用
Success bool // 是否执行成功 成功XXX失败XXX
Success bool // 是否执行成功 成功XXX失败XXX
}

View File

@@ -45,6 +45,7 @@ type BattleSkillEntity struct {
isCritical bool //技能是否暴击
ATTACK_COUNT_ZONE int //攻击次数
DamageValue decimal.Decimal // 伤害值
// 技能类型属性
//SkillType EnumCategory // 技能类型(物理/特殊/状态)