diff --git a/logic/service/fight/boss/NewSeIdx_17.go b/logic/service/fight/boss/NewSeIdx_17.go index afc4ad092..15de42614 100644 --- a/logic/service/fight/boss/NewSeIdx_17.go +++ b/logic/service/fight/boss/NewSeIdx_17.go @@ -12,7 +12,7 @@ type NewSel17 struct { NewSel0 } -func (e *NewSel17) Action_start(a, b *action.SelectSkillAction) bool { +func (e *NewSel17) ActionStart(a, b *action.SelectSkillAction) bool { if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true } diff --git a/logic/service/fight/boss/NewSeIdx_18.go b/logic/service/fight/boss/NewSeIdx_18.go index 989166e7e..44ea1c892 100644 --- a/logic/service/fight/boss/NewSeIdx_18.go +++ b/logic/service/fight/boss/NewSeIdx_18.go @@ -12,7 +12,7 @@ type NewSel18 struct { NewSel0 } -func (e *NewSel18) Action_start(a, b *action.SelectSkillAction) bool { +func (e *NewSel18) ActionStart(a, b *action.SelectSkillAction) bool { if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true } diff --git a/logic/service/fight/boss/NewSeIdx_29.go b/logic/service/fight/boss/NewSeIdx_29.go index 8c4cbdbc0..22dc1cd4f 100644 --- a/logic/service/fight/boss/NewSeIdx_29.go +++ b/logic/service/fight/boss/NewSeIdx_29.go @@ -12,7 +12,7 @@ type NewSel29 struct { NewSel0 } -func (e *NewSel29) Action_start(a, b *action.SelectSkillAction) bool { +func (e *NewSel29) ActionStart(a, b *action.SelectSkillAction) bool { if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true } diff --git a/logic/service/fight/boss/NewSeIdx_405.go b/logic/service/fight/boss/NewSeIdx_405.go index 24bbf80b3..b60694609 100644 --- a/logic/service/fight/boss/NewSeIdx_405.go +++ b/logic/service/fight/boss/NewSeIdx_405.go @@ -10,7 +10,7 @@ type NewSel405 struct { NewSel0 } -func (e *NewSel405) Action_start_ex(fattack, sattack *action.SelectSkillAction) bool { +func (e *NewSel405) ActionStartEx(fattack, sattack *action.SelectSkillAction) bool { //魂印特性有不在场的情况,绑定时候将精灵和特性绑定 if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true diff --git a/logic/service/fight/boss/NewSeIdx_45.go b/logic/service/fight/boss/NewSeIdx_45.go index 261c28814..33ff8301f 100644 --- a/logic/service/fight/boss/NewSeIdx_45.go +++ b/logic/service/fight/boss/NewSeIdx_45.go @@ -12,7 +12,7 @@ type NewSel45 struct { NewSel0 } -func (e *NewSel45) Action_start(a, b *action.SelectSkillAction) bool { +func (e *NewSel45) ActionStart(a, b *action.SelectSkillAction) bool { if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true } diff --git a/logic/service/fight/boss/NewSeIdx_79.go b/logic/service/fight/boss/NewSeIdx_79.go index bdbc97068..a70d27d0a 100644 --- a/logic/service/fight/boss/NewSeIdx_79.go +++ b/logic/service/fight/boss/NewSeIdx_79.go @@ -26,7 +26,7 @@ func (e *NewSel79) DamageDivEx(t *info.DamageZone) bool { return true } -func (e *NewSel79) Action_start(a, b *action.SelectSkillAction) bool { +func (e *NewSel79) ActionStart(a, b *action.SelectSkillAction) bool { if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true } diff --git a/logic/service/fight/boss/NewSeIdx_8_30.go b/logic/service/fight/boss/NewSeIdx_8_30.go index 7eb753b1b..e6d6c32cf 100644 --- a/logic/service/fight/boss/NewSeIdx_8_30.go +++ b/logic/service/fight/boss/NewSeIdx_8_30.go @@ -12,7 +12,7 @@ type NewSel30 struct { NewSel0 } -func (e *NewSel30) Action_start(a, b *action.SelectSkillAction) bool { +func (e *NewSel30) ActionStart(a, b *action.SelectSkillAction) bool { if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true } diff --git a/logic/service/fight/effect/effect_32.go b/logic/service/fight/effect/effect_32.go index eb798fb62..61a9a01ce 100644 --- a/logic/service/fight/effect/effect_32.go +++ b/logic/service/fight/effect/effect_32.go @@ -21,7 +21,7 @@ type Effect32 struct { node.EffectNode } -func (e *Effect32) Action_start(a, b *action.SelectSkillAction) bool { +func (e *Effect32) ActionStart(a, b *action.SelectSkillAction) bool { if e.Ctx().SkillEntity == nil { return true diff --git a/logic/service/fight/effect/effect_58.go b/logic/service/fight/effect/effect_58.go index 05624988d..245ea32bf 100644 --- a/logic/service/fight/effect/effect_58.go +++ b/logic/service/fight/effect/effect_58.go @@ -28,7 +28,7 @@ func (e *Effect58) OnSkill() bool { return true } -func (e *Effect58) Action_start(a, b *action.SelectSkillAction) bool { +func (e *Effect58) ActionStart(a, b *action.SelectSkillAction) bool { if !e.Can { return true diff --git a/logic/service/fight/effect/effect_71.go b/logic/service/fight/effect/effect_71.go index 36e90d66a..3ad3c67bc 100644 --- a/logic/service/fight/effect/effect_71.go +++ b/logic/service/fight/effect/effect_71.go @@ -69,7 +69,7 @@ type Effect71_sub struct { node.EffectNode } -func (e *Effect71_sub) Action_start(a, b *action.SelectSkillAction) bool { +func (e *Effect71_sub) ActionStart(a, b *action.SelectSkillAction) bool { //fmt.Println(e.Ctx().SkillEntity) if e.Ctx().SkillEntity == nil { diff --git a/logic/service/fight/effect/effect_81.go b/logic/service/fight/effect/effect_81.go index 70d92d4ed..1b468c91c 100644 --- a/logic/service/fight/effect/effect_81.go +++ b/logic/service/fight/effect/effect_81.go @@ -26,7 +26,7 @@ func (e *Effect81) OnSkill() bool { return true } -func (e *Effect81) Action_start(a, b *action.SelectSkillAction) bool { +func (e *Effect81) ActionStart(a, b *action.SelectSkillAction) bool { if !e.can { return true diff --git a/logic/service/fight/effect/effect_83.go b/logic/service/fight/effect/effect_83.go index e7b919d19..4bb7d8ad2 100644 --- a/logic/service/fight/effect/effect_83.go +++ b/logic/service/fight/effect/effect_83.go @@ -58,7 +58,7 @@ func (e *Effect83) ComparePre(fattack *action.SelectSkillAction, sattack *action } // /自身雄性,下两回合必定先手;自身雌性,下两回合必定致命一击 -func (e *Effect83) Action_start(a, b *action.SelectSkillAction) bool { +func (e *Effect83) ActionStart(a, b *action.SelectSkillAction) bool { if !e.can { return true diff --git a/logic/service/fight/effect/effect_95.go b/logic/service/fight/effect/effect_95.go index b95bf338f..90f409ba9 100644 --- a/logic/service/fight/effect/effect_95.go +++ b/logic/service/fight/effect/effect_95.go @@ -20,7 +20,7 @@ type Effect95 struct { node.EffectNode } -func (e *Effect95) Action_start(a, b *action.SelectSkillAction) bool { +func (e *Effect95) ActionStart(a, b *action.SelectSkillAction) bool { //fmt.Println(e.Ctx().SkillEntity) if e.Ctx().SkillEntity == nil { diff --git a/logic/service/fight/effect/effect_status.go b/logic/service/fight/effect/effect_status.go index 0bcde7963..bb54c7640 100644 --- a/logic/service/fight/effect/effect_status.go +++ b/logic/service/fight/effect/effect_status.go @@ -32,7 +32,7 @@ type StatusCannotAct struct { } // 技能命中前拦截:阻止出手 -func (e *StatusCannotAct) Action_start(attacker, defender *action.SelectSkillAction) bool { +func (e *StatusCannotAct) ActionStart(attacker, defender *action.SelectSkillAction) bool { return false } @@ -43,9 +43,9 @@ type StatusSleep struct { } // 尝试出手时标记状态 -func (e *StatusSleep) Action_start(attacker, defender *action.SelectSkillAction) bool { +func (e *StatusSleep) ActionStart(attacker, defender *action.SelectSkillAction) bool { e.hasTriedAct = true - return e.StatusCannotAct.Action_start(attacker, defender) + return e.StatusCannotAct.ActionStart(attacker, defender) } // 技能使用后处理:非状态类技能触发后解除睡眠 @@ -66,7 +66,7 @@ type ContinuousDamage struct { } // 技能命中前触发伤害(1/8最大生命值真实伤害) -func (e *ContinuousDamage) Action_start(attacker, defender *action.SelectSkillAction) bool { +func (e *ContinuousDamage) ActionStart(attacker, defender *action.SelectSkillAction) bool { damage := e.calculateDamage() println(damage.IntPart(), "烧伤") e.Ctx().Our.Damage(e.Input, &info.DamageZone{ @@ -99,7 +99,7 @@ type ParasiticSeed struct { } // 技能命中前触发寄生效果 -func (e *ParasiticSeed) Action_start_ex(attacker, defender *action.SelectSkillAction) bool { +func (e *ParasiticSeed) ActionStartEx(attacker, defender *action.SelectSkillAction) bool { // 过滤特定类型单位(假设1是植物类型,使用枚举替代魔法数字) damage := alpacadecimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)). @@ -120,7 +120,7 @@ type Flammable struct { BaseStatus } -func (e *Flammable) Action_start(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) bool { +func (e *Flammable) ActionStart(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) bool { if e.Ctx().SkillEntity == nil { return true } @@ -153,7 +153,7 @@ type Confused struct { BaseStatus } -func (e *Confused) Action_start(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) bool { +func (e *Confused) ActionStart(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) bool { if e.Ctx().SkillEntity == nil { return true } diff --git a/logic/service/fight/fightc.go b/logic/service/fight/fightc.go index 87b8ebcad..a9aa6232e 100644 --- a/logic/service/fight/fightc.go +++ b/logic/service/fight/fightc.go @@ -203,13 +203,13 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction) } currentSkill = originalSkill - // defender.Exec(func(effect input.Effect) bool { //这个是能否使用技能 - // effect.Ctx().SkillEntity = currentSkill - // return effect.Action_start_ex(firstAttack, secondAttack) - // }) + defender.Exec(func(effect input.Effect) bool { //这个是能否使用技能 + effect.Ctx().SkillEntity = currentSkill + return effect.ActionStartEx(firstAttack, secondAttack) + }) canUseSkill := attacker.Exec(func(effect input.Effect) bool { //这个是能否使用技能 effect.Ctx().SkillEntity = currentSkill - return effect.Action_start(firstAttack, secondAttack) + return effect.ActionStart(firstAttack, secondAttack) }) canUse := canUseSkill && action.CanUse(currentSkill) && attacker.CurrentPet.Info.Hp > 0 diff --git a/logic/service/fight/input/interface.go b/logic/service/fight/input/interface.go index 80fba4214..906a35ce3 100644 --- a/logic/service/fight/input/interface.go +++ b/logic/service/fight/input/interface.go @@ -13,10 +13,10 @@ type Effect interface { ComparePre(fattack, sattack *action.SelectSkillAction) bool //比较前对优先级的修改 //技能命中前的返回值代表是否可以出手 ,对命中本身的修改应该是对上下文本身的修改 //对技能修改 行动开始前,注入视为等参数在这里实现 - Action_start_ex(fattack, sattack *action.SelectSkillAction) bool //比较前对优先级的修改 - Action_start(fattack, sattack *action.SelectSkillAction) bool //比较前对优先级的修改 - SkillHit() bool //这是是命中后的对技能的修改,比如变威力 - SkillHit_ex() bool // 技能命中前触发//预处理受击技能 被攻击方效果,比如受击时无效技能这样 + ActionStartEx(fattack, sattack *action.SelectSkillAction) bool //比较前对优先级的修改 + ActionStart(fattack, sattack *action.SelectSkillAction) bool //比较前对优先级的修改 + SkillHit() bool //这是是命中后的对技能的修改,比如变威力 + SkillHit_ex() bool // 技能命中前触发//预处理受击技能 被攻击方效果,比如受击时无效技能这样 CalculatePre() bool //视为 无视效果,相当于这里对敌方的修改 OnSkill() bool // 触发on miss onhit diff --git a/logic/service/fight/node/Turn.go b/logic/service/fight/node/Turn.go index d66906591..dc1e4e9e1 100644 --- a/logic/service/fight/node/Turn.go +++ b/logic/service/fight/node/Turn.go @@ -4,10 +4,10 @@ import ( "blazing/logic/service/fight/action" ) -func (e *EffectNode) Action_start(fattack, sattack *action.SelectSkillAction) bool { +func (e *EffectNode) ActionStart(fattack, sattack *action.SelectSkillAction) bool { return true } -func (e *EffectNode) Action_start_ex(fattack, sattack *action.SelectSkillAction) bool { +func (e *EffectNode) ActionStartEx(fattack, sattack *action.SelectSkillAction) bool { return true } func (e *EffectNode) ComparePre(fattack, sattack *action.SelectSkillAction) bool { //比较前对优先级的修改 { diff --git a/modules/blazing/model/title.go b/modules/blazing/model/title.go index 7af494c32..6b59702c1 100644 --- a/modules/blazing/model/title.go +++ b/modules/blazing/model/title.go @@ -13,7 +13,7 @@ type Title struct { PlayerID uint64 `gorm:"not null;index:idx_player_title_by_player_id;comment:'所属玩家ID'" json:"player_id"` TitleID uint32 `gorm:"not null;comment:'称号ID'" json:"title_id"` //可用称号 - AvailableTitle []uint32 `json:"available_title"` + AvailableTitle []uint32 `gorm:"type:json; comment:'可用称号'" json:"available_title"` } // TitleInfo 用于前端返回的称号信息