fix(fight): 战斗修改
This commit is contained in:
@@ -1,28 +1,24 @@
|
||||
package node
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/input"
|
||||
)
|
||||
|
||||
// 切精灵返回false,重写change方法来实现切换效果
|
||||
// 精灵切换相关触发
|
||||
|
||||
func (e *EffectNode) OnSwitchIn(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) OnSwitchIn() bool {
|
||||
//panic("not implemented") // TODO: Implement
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *EffectNode) OnSwitchOut(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) OnSwitchOut() bool {
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *EffectNode) OnOwnerSwitchIn(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) OnOwnerSwitchIn() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// 自身下场,清除掉技能效果
|
||||
func (e *EffectNode) OnOwnerSwitchOut(ctx input.Ctx) bool {
|
||||
// e.Input.AttackValue = info.NewAttackValue(e.Input.UserID)
|
||||
func (e *EffectNode) OnOwnerSwitchOut() bool {
|
||||
// e.Input.AttackValue = info.NewAttackValue(e.Input.UserID)
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -9,10 +9,10 @@ import (
|
||||
func (e *EffectNode) Compare_Pre(fattack, sattack *action.SelectSkillAction) bool {
|
||||
return false
|
||||
}
|
||||
func (e *EffectNode) Turn_Start(ctx input.Ctx) {
|
||||
func (e *EffectNode) Turn_Start() {
|
||||
//panic("not implemented") // TODO: Implement
|
||||
}
|
||||
func (e *EffectNode) Turn_End(ctx input.Ctx) {
|
||||
func (e *EffectNode) Turn_End() {
|
||||
|
||||
if e.duration == 0 { // 保留 (负数表示永久)
|
||||
|
||||
@@ -21,7 +21,7 @@ func (e *EffectNode) Turn_End(ctx input.Ctx) {
|
||||
} else {
|
||||
e.trunl.Do(func() {
|
||||
|
||||
if ctx.Input.FightC.IsFirst(ctx.Input.Player) { //如果对方先手
|
||||
if e.Ctx().Opp.FightC.IsFirst(e.Ctx().Opp.Player) { //如果对方先手
|
||||
e.duration++
|
||||
// e.Alive(true)
|
||||
}
|
||||
|
||||
@@ -1,38 +1,34 @@
|
||||
package node
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/input"
|
||||
)
|
||||
|
||||
func (e *EffectNode) Damage_ADD(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) Damage_ADD() bool {
|
||||
return true
|
||||
|
||||
}
|
||||
|
||||
func (e *EffectNode) Damage_Mul(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) Damage_Mul() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *EffectNode) Damage_Floor(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) Damage_Floor() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *EffectNode) Damage_DIV(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) Damage_DIV_ex() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *EffectNode) Damage_SUB(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) Damage_SUB_ex() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *EffectNode) Damage_Lock(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) Damage_Lock() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *EffectNode) Damage_Locked(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) Damage_Lock_ex() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *EffectNode) Damage_Shield(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) Damage_Shield() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
package node
|
||||
|
||||
import "blazing/logic/service/fight/input"
|
||||
|
||||
// 回合结束一次性effect清楚掉
|
||||
|
||||
func (e *EffectNode) Fight_Start(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) Fight_Start() bool {
|
||||
//战斗开始应该注入魂印
|
||||
//panic("not implemented") // TODO: Implement
|
||||
return true
|
||||
}
|
||||
func (e *EffectNode) PreBattleEnd(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) PreBattleEnd() bool {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
|
||||
func (e *EffectNode) OnBattleEnd(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) OnBattleEnd() bool {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ type EffectNode struct {
|
||||
alive bool // 是否失效 effect返回值是否被取消,是否被删除
|
||||
hit bool
|
||||
trunl sync.Once
|
||||
ctx input.Ctx
|
||||
//增加owner target,如果owner target都为自身,就回合效果结束后再使用回合效果
|
||||
}
|
||||
|
||||
@@ -39,7 +40,11 @@ func (e *EffectNode) GetInput() *input.Input {
|
||||
return e.Input
|
||||
|
||||
}
|
||||
func (e *EffectNode) Ctx() *input.Ctx {
|
||||
|
||||
return &e.ctx
|
||||
|
||||
}
|
||||
func (e *EffectNode) Stack(t ...int) int {
|
||||
if len(t) > 0 {
|
||||
e.stacks = t[0]
|
||||
|
||||
@@ -5,23 +5,23 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
)
|
||||
|
||||
func (e *EffectNode) Skill_Pre(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) Skill_Pre() bool {
|
||||
return true
|
||||
}
|
||||
func (e *EffectNode) Calculate_Pre(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) Calculate_Pre() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *EffectNode) Skill_Hit_Pre(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) Skill_Hit_Pre() bool {
|
||||
return true
|
||||
}
|
||||
func (e *EffectNode) Skill_Hit(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) Skill_Hit() bool {
|
||||
return true
|
||||
}
|
||||
func (e *EffectNode) Skill_Hit_to(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) Skill_Hit_ex() bool {
|
||||
return true
|
||||
}
|
||||
func (e *EffectNode) OnSkill(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) OnSkill() bool {
|
||||
// if e.Effect != nil {
|
||||
// if e.Hit() { //没命中
|
||||
// e.Effect.OnHit(ctx.Input, ctx.SkillEntity)
|
||||
@@ -32,15 +32,15 @@ func (e *EffectNode) OnSkill(ctx input.Ctx) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *EffectNode) Skill_Can(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) Skill_Can() bool {
|
||||
|
||||
return e.Input.CurrentPet.HP != 0
|
||||
}
|
||||
|
||||
func (e *EffectNode) Skill_Use(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) Skill_Use_ex() bool {
|
||||
return true
|
||||
}
|
||||
func (e *EffectNode) Skill_Useed(ctx input.Ctx) bool {
|
||||
func (e *EffectNode) Skill_Useed() bool {
|
||||
// if e.Effect != nil {
|
||||
// if e.Input.CurrentPet.Info.Hp == 0 {
|
||||
// e.OnDefeat(ctx.Input, ctx.SkillEntity) //死亡
|
||||
|
||||
Reference in New Issue
Block a user