战斗修改
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
package node
|
||||
|
||||
// 返回false阻止继续运行
|
||||
// 回合开始
|
||||
func (this *EffectNode) PreBattleStart() bool {
|
||||
|
||||
return true
|
||||
|
||||
}
|
||||
|
||||
// 返回false阻止继续运行
|
||||
// 回合开始
|
||||
func (this *EffectNode) OnBattleStart() bool {
|
||||
|
||||
return true
|
||||
|
||||
}
|
||||
|
||||
//回合结束前
|
||||
|
||||
func (this *EffectNode) PreBattleEnd() bool {
|
||||
return true
|
||||
|
||||
}
|
||||
|
||||
//回合结束
|
||||
|
||||
func (this *EffectNode) OnBattleEnd() bool {
|
||||
return true
|
||||
|
||||
}
|
||||
@@ -1,10 +1,13 @@
|
||||
package node
|
||||
|
||||
import "blazing/logic/service/fight/action"
|
||||
|
||||
// 治疗相关触发
|
||||
func (this *EffectNode) OnBeforeHeal() bool {
|
||||
// 治疗前触发 回复翻倍效果
|
||||
func (e *EffectNode) Heal_Pre(action.BattleActionI) bool {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
|
||||
func (this *EffectNode) OnHeal() bool {
|
||||
func (e *EffectNode) Heal(_ action.BattleActionI) bool {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
package node
|
||||
|
||||
import "blazing/logic/service/fight/input"
|
||||
|
||||
// 切精灵返回false,重写change方法来实现切换效果
|
||||
// 精灵切换相关触发
|
||||
func (e *EffectNode) OnSwitchIn() bool {
|
||||
return true
|
||||
|
||||
func (e *EffectNode) OnSwitchIn(ctx input.Ctx) bool {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
|
||||
func (e *EffectNode) OnSwitchOut() bool {
|
||||
func (e *EffectNode) OnSwitchOut(ctx input.Ctx) bool {
|
||||
//下场默认清除effect
|
||||
if e.Owner { //清除对方的我方施加uff
|
||||
e.NotALive()
|
||||
@@ -14,13 +17,13 @@ func (e *EffectNode) OnSwitchOut() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *EffectNode) OnOwnerSwitchIn() bool {
|
||||
func (e *EffectNode) OnOwnerSwitchIn(ctx input.Ctx) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *EffectNode) OnOwnerSwitchOut(ctx input.Ctx) bool {
|
||||
//自身下场清除掉自身的回合效果
|
||||
//this.GetBattle().Effects[this.GetInput().UserID].RemoveEffect(this)
|
||||
e.NotALive()
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *EffectNode) OnOwnerSwitchOut() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
package node
|
||||
|
||||
// 堆叠(Stack)相关触发
|
||||
func (this *EffectNode) OnStackBefore() bool {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
|
||||
func (this *EffectNode) OnStack() bool {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
|
||||
func (this *EffectNode) OnBeforeConsumeStack() bool {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
|
||||
func (this *EffectNode) OnConsumeStack() bool {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
@@ -1,41 +1,21 @@
|
||||
package node
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
)
|
||||
|
||||
// 回合开始前
|
||||
func (e *EffectNode) PreTurnStart() bool {
|
||||
return true
|
||||
|
||||
func (e *EffectNode) Turn_Start(ctx input.Ctx) {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
|
||||
// 回合开始
|
||||
func (e *EffectNode) OnTurnStart(opp *input.Input) {
|
||||
|
||||
//处理异常状态
|
||||
|
||||
}
|
||||
|
||||
func (e *EffectNode) OnActionEnd() bool {
|
||||
|
||||
//处理异常状态
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *EffectNode) PreActionStart() bool {
|
||||
|
||||
//处理异常状态
|
||||
return true
|
||||
}
|
||||
|
||||
// 回合结束一次性effect清楚掉
|
||||
|
||||
func (e *EffectNode) TurnEnd(opp *input.Input) {
|
||||
func (e *EffectNode) Turn_End(ctx input.Ctx) {
|
||||
|
||||
if e.duration == 0 { // 保留 (负数表示永久)
|
||||
e.NotALive()
|
||||
}
|
||||
e.duration--
|
||||
|
||||
}
|
||||
|
||||
func (e *EffectNode) OnDefeat(*input.Input, *info.SkillEntity) bool {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
package node
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
)
|
||||
|
||||
func (this *EffectNode) BeforeMultiHit() bool {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
|
||||
// 回合结束前
|
||||
func (this *EffectNode) BeforeCalculateDamage(opp *input.Input, skill *info.SkillEntity) {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
|
||||
func (this *EffectNode) PreDamage() bool {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
|
||||
func (this *EffectNode) CalculateDamage(opp *input.Input, skill *info.SkillEntity) {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
|
||||
func (this *EffectNode) OnDamage() bool {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
|
||||
func (this *EffectNode) Shield() bool {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
|
||||
func (this *EffectNode) PostDamage() bool {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
|
||||
func (this *EffectNode) OnDefeat() bool {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
|
||||
func (this *EffectNode) BeferProp(in *input.Input, prop, level int8, ptype info.EnumAbilityOpType) bool {
|
||||
return true
|
||||
}
|
||||
@@ -1,48 +1,38 @@
|
||||
package node
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
)
|
||||
|
||||
func (e *EffectNode) OnSkillPP() bool {
|
||||
func (e *EffectNode) Damage_ADD(ctx input.Ctx) bool {
|
||||
return true
|
||||
|
||||
}
|
||||
|
||||
func (e *EffectNode) Damage_Mul(ctx input.Ctx) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// 使用技能前
|
||||
func (e *EffectNode) CanSkill(opp *input.Input) bool {
|
||||
|
||||
return e.Input.CurrentPet.HP != 0
|
||||
func (e *EffectNode) Damage_Floor(ctx input.Ctx) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// 命中前 攻击伤害结算
|
||||
func (e *EffectNode) PreSkill(opp *input.Input, skill *info.SkillEntity) {
|
||||
|
||||
}
|
||||
func (e *EffectNode) PreAttacked(*input.Input, *info.SkillEntity) {
|
||||
|
||||
}
|
||||
func (e *EffectNode) BeforeSkill(opp *input.Input, skill *info.SkillEntity) {
|
||||
|
||||
func (e *EffectNode) Damage_DIV(ctx input.Ctx) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// 使用技能时,不可被继承,继承Miss和Hit就行
|
||||
func (e *EffectNode) OnSkill(opp *input.Input, skill *info.SkillEntity) {
|
||||
|
||||
if e.Hit() { //没命中
|
||||
e.OnHit(opp, skill)
|
||||
} else {
|
||||
e.OnMiss(opp, skill)
|
||||
}
|
||||
|
||||
func (e *EffectNode) Damage_SUB(ctx input.Ctx) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// miss
|
||||
func (e *EffectNode) OnMiss(opp *input.Input, skill *info.SkillEntity) {
|
||||
|
||||
func (e *EffectNode) Damage_Lock(ctx input.Ctx) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect interface {
|
||||
OnMiss(opp *input.Input, skill *info.SkillEntity)
|
||||
OnHit(opp *input.Input, skill *info.SkillEntity)
|
||||
func (e *EffectNode) Damage_Locked(ctx input.Ctx) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *EffectNode) Damage_Shield(ctx input.Ctx) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
16
logic/service/fight/node/fight.go
Normal file
16
logic/service/fight/node/fight.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package node
|
||||
|
||||
import "blazing/logic/service/fight/input"
|
||||
|
||||
// 回合结束一次性effect清楚掉
|
||||
|
||||
func (e *EffectNode) Fight_Start(ctx input.Ctx) bool {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
func (e *EffectNode) PreBattleEnd(ctx input.Ctx) bool {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
|
||||
func (e *EffectNode) OnBattleEnd(ctx input.Ctx) bool {
|
||||
panic("not implemented") // TODO: Implement
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package node
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
)
|
||||
|
||||
// 受击触发
|
||||
func (this *EffectNode) Attack(*input.Input, *info.DamageZone) {
|
||||
}
|
||||
|
||||
// 受击触发
|
||||
func (this *EffectNode) BeforeAttack(*input.Input, *info.DamageZone) {
|
||||
}
|
||||
|
||||
// 受击触发
|
||||
func (this *EffectNode) Attacked(*input.Input, *info.DamageZone) {
|
||||
}
|
||||
|
||||
// 受击触发
|
||||
func (this *EffectNode) BeforeAttacked(*input.Input, *info.DamageZone) {
|
||||
}
|
||||
|
||||
// 受击触发
|
||||
func (this *EffectNode) FloorDamage(*input.Input, *info.DamageZone) {
|
||||
}
|
||||
|
||||
// 受击触发
|
||||
func (this *EffectNode) LockDamage(*input.Input, *info.DamageZone) {
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package node
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
)
|
||||
|
||||
@@ -29,20 +30,24 @@ func (this *EffectNode) Alive() bool {
|
||||
return !this.notAlive
|
||||
|
||||
}
|
||||
func (e *EffectNode) GetInput() *input.Input {
|
||||
|
||||
func (this *EffectNode) NotALive() {
|
||||
|
||||
this.notAlive = true
|
||||
return e.Input
|
||||
|
||||
}
|
||||
func (this *EffectNode) GetOwner() bool {
|
||||
func (e *EffectNode) NotALive() {
|
||||
|
||||
return this.Owner
|
||||
e.notAlive = true
|
||||
|
||||
}
|
||||
func (this *EffectNode) SetOwner(b bool) {
|
||||
func (e *EffectNode) GetOwner() bool {
|
||||
|
||||
this.Owner = b
|
||||
return e.Owner
|
||||
|
||||
}
|
||||
func (e *EffectNode) SetOwner(b bool) {
|
||||
|
||||
e.Owner = b
|
||||
|
||||
}
|
||||
func (this *EffectNode) Stack(t ...int) int {
|
||||
@@ -89,3 +94,9 @@ func (this *EffectNode) AttackTime(*input.Input, *input.Input) bool {
|
||||
return true
|
||||
|
||||
}
|
||||
func (e *EffectNode) EFFect_Befer() {
|
||||
|
||||
}
|
||||
func (e *EffectNode) Prop_Befer(in *input.Input, prop int8, level int8, ptype info.EnumAbilityOpType) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
53
logic/service/fight/node/skill.go
Normal file
53
logic/service/fight/node/skill.go
Normal file
@@ -0,0 +1,53 @@
|
||||
package node
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
)
|
||||
|
||||
func (e *EffectNode) Skill_Pre(ctx input.Ctx) {
|
||||
|
||||
}
|
||||
|
||||
func (e *EffectNode) Skill_PreUse(ctx input.Ctx) {
|
||||
|
||||
}
|
||||
|
||||
func (e *EffectNode) OnSkill(ctx input.Ctx) {
|
||||
if e.Effect != nil {
|
||||
if e.Hit() { //没命中
|
||||
e.OnHit(ctx.Input, ctx.SkillEntity)
|
||||
} else {
|
||||
e.OnMiss(ctx.Input, ctx.SkillEntity)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (e *EffectNode) Skill_Can(ctx input.Ctx) bool {
|
||||
|
||||
return e.Input.CurrentPet.HP != 0
|
||||
}
|
||||
|
||||
func (e *EffectNode) Skill_Use(ctx input.Ctx) bool {
|
||||
return true
|
||||
}
|
||||
func (e *EffectNode) Skill_Useed(ctx input.Ctx) bool {
|
||||
if e.Effect != nil {
|
||||
if e.Input.CurrentPet.Info.Hp == 0 {
|
||||
e.OnDefeat(ctx.Input, ctx.SkillEntity) //死亡
|
||||
|
||||
} else {
|
||||
e.OnAlive(ctx.Input, ctx.SkillEntity) //存活
|
||||
}
|
||||
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect interface {
|
||||
OnMiss(opp *input.Input, skill *info.SkillEntity)
|
||||
OnHit(opp *input.Input, skill *info.SkillEntity)
|
||||
OnDefeat(opp *input.Input, skill *info.SkillEntity) bool //如果需要死亡
|
||||
OnAlive(opp *input.Input, skill *info.SkillEntity) bool //如果需要存活
|
||||
}
|
||||
Reference in New Issue
Block a user