```
refactor(fight): 统一Action方法命名规范 将Action_start和Action_start_ex方法重命名为ActionStart和ActionStartEx, 使其符合Go语言驼峰命名规范。同时更新接口定义和所有相关调用处的方法名。 - 重命名Action_start为ActionStart - 重命名Action_start_ex为ActionStartEx - 更新interface.go中的方法定义 - 更新所有实现类中的方法签名 - 更新fightc.go中的方法
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 { //比较前对优先级的修改 {
|
||||
|
||||
@@ -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 用于前端返回的称号信息
|
||||
|
||||
Reference in New Issue
Block a user