refactor(fight/effect): 统一效果初始化接口,重构效果类型管理并优化参数传递逻辑
This commit is contained in:
72
logic/service/fight/input/effecti.go
Normal file
72
logic/service/fight/input/effecti.go
Normal file
@@ -0,0 +1,72 @@
|
||||
package input
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
)
|
||||
|
||||
type Effect interface {
|
||||
OnBattleStart() bool //战斗开始
|
||||
|
||||
OnTurnStart(opp *Input) //回合开始
|
||||
|
||||
UseSkill(opp *Input) bool //使用技能 可以取消用技能节点
|
||||
SkillUseEnd(opp *Input)
|
||||
// OnSkillPP() bool //技能PP减少节点
|
||||
// BeforeMultiHit() bool //多段攻击前
|
||||
// BeforeHit() bool //命中前
|
||||
// OnCritPreDamage() bool //暴击判定成功且伤害计算前触发
|
||||
// PreDamage() bool // 技能伤害计算前触发(增伤 / 减伤等)
|
||||
// OnBeforeCalculateDamage() bool // 最终伤害计算前触发
|
||||
// OnDamage() bool // 造成伤害时触发
|
||||
//使用技能 可以取消用技能节点
|
||||
|
||||
AfterAttr(t *info.BattlePetEntity) //在获取属性前,比如重写对方属性AfterAttr
|
||||
BeferAttr(t *info.BattlePetEntity) //在获取属性后,比如视为对方属性
|
||||
SetArgs(input *Input,param ...int)
|
||||
IsCrit(opp *Input, skill *info.SkillEntity) //是否暴击
|
||||
CalculateDamage(opp *Input, skill *info.SkillEntity) //击判定成功且伤害计算前触发
|
||||
OnBeforeCalculateDamage(opp *Input, skill *info.SkillEntity) // 最终伤害计算前触发
|
||||
// Shield() bool // 护盾值变化时触发
|
||||
// PostDamage() bool // 伤害结算后触发(血量扣除后)
|
||||
IsHit(opp *Input, skill *info.SkillEntity) //闪避率计算,,实际上是修改命中的判断
|
||||
TakeHit(opp *Input, skill *info.SkillEntity) //闪避率计算,,实际上是修改命中的判断
|
||||
//() bool // 暴击伤害结算后触发
|
||||
OnSkill(opp *Input, skill *info.SkillEntity) //闪避率计算,,实际上是修改命中的判断
|
||||
OnMiss() bool // 技能未命中时触发
|
||||
// OnHit() bool // 技能命中时触发
|
||||
// OnMiss() bool // 技能未命中时触发
|
||||
// AfterAttacked() bool // 被攻击后触发(受击判定)
|
||||
|
||||
// SetOwner(bool)
|
||||
// OnDefeat() bool // 精灵被击败时触发
|
||||
|
||||
TurnEnd(opp *Input) //闪避率计算,,实际上是修改命中的判断
|
||||
// // 堆叠(Stack)相关触发
|
||||
// OnStackBefore() bool // 堆叠效果前触发
|
||||
// OnStack() bool // 堆叠效果触发
|
||||
// OnBeforeConsumeStack() bool // 消耗堆叠前触发
|
||||
// OnConsumeStack() bool // 消耗堆叠时触发
|
||||
|
||||
// // 治疗相关触发
|
||||
// OnBeforeHeal() bool // 治疗前触发
|
||||
// OnHeal() bool // 治疗生效时触发
|
||||
|
||||
// // 精灵切换相关触发
|
||||
// OnSwitchIn() bool // 精灵出战 / 上场时触发
|
||||
// OnSwitchOut() bool // 精灵下场时触发
|
||||
// OnOwnerSwitchIn() bool // 所属玩家精灵出战时触发
|
||||
// OnOwnerSwitchOut() bool // 所属玩家精灵下场时触发
|
||||
|
||||
// PreBattleEnd() bool //战斗结束前
|
||||
// OnBattleEnd() bool //战斗结束
|
||||
|
||||
//回合数,然后次数另外维护
|
||||
Duration(...int) int
|
||||
|
||||
Alive() bool
|
||||
Stack(...int) int
|
||||
GetMaxStack() int
|
||||
NotALive()
|
||||
GetOwner() bool // 技能属主,比如寄生和镇魂歌,属主是对方)
|
||||
//GetSkill() *BattleSkillEntity //获得技能ctx
|
||||
}
|
||||
Reference in New Issue
Block a user