fix(fight): 移除无用依赖并优化技能效果逻辑 - 移除了github.com/alpacahq/alpacadecimal依赖,简化了生命值恢复计算逻辑 - 修复了effect_4_5.go中技能参数索引错误,统一了概率判定和属性设置的参数使用
This commit is contained in:
@@ -4,8 +4,6 @@ import (
|
||||
"blazing/logic/service/fight/action"
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -23,9 +21,8 @@ type Effect43 struct {
|
||||
|
||||
func (e *Effect43) OnSkill() bool {
|
||||
|
||||
tt := alpacadecimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)).Div(alpacadecimal.NewFromInt(int64(e.SideEffectArgs[0])))
|
||||
//fmt.Println("恢复自身最大体量的1/n", tt.IntPart())
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, tt)
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0]))
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -28,12 +28,12 @@ type Effect4 struct {
|
||||
// 技能触发时调用
|
||||
// -----------------------------------------------------------
|
||||
func (e *Effect4) Skill_Use() bool {
|
||||
ok, _, _ := e.Input.Player.Roll(e.SideEffectArgs[0], 100)
|
||||
ok, _, _ := e.Input.Player.Roll(e.SideEffectArgs[1], 100)
|
||||
if !ok {
|
||||
return true
|
||||
}
|
||||
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.SideEffectArgs[1]), int8(e.SideEffectArgs[2]))
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.SideEffectArgs[0]), int8(e.SideEffectArgs[2]))
|
||||
|
||||
return true
|
||||
}
|
||||
@@ -48,12 +48,12 @@ type Effect5 struct {
|
||||
func (e *Effect5) Skill_Use() bool {
|
||||
|
||||
// 概率判定
|
||||
ok, _, _ := e.Input.Player.Roll(e.SideEffectArgs[0], 100)
|
||||
ok, _, _ := e.Input.Player.Roll(e.SideEffectArgs[1], 100)
|
||||
if !ok {
|
||||
return true
|
||||
}
|
||||
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(e.SideEffectArgs[1]), int8(e.SideEffectArgs[2]))
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(e.SideEffectArgs[0]), int8(e.SideEffectArgs[2]))
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -330,12 +330,12 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction)
|
||||
})
|
||||
f.Switch = make(map[uint32]*action.ActiveSwitchAction)
|
||||
if f.closefight && f.Info.Mode == info.BattleMode.PET_MELEE {
|
||||
// f.Broadcast(func(fighter *input.Input) {
|
||||
// if fighter.UserID != f.WinnerId {
|
||||
// fighter.Player.SendPackCmd(2505, &attackValueResult)
|
||||
// }
|
||||
f.Broadcast(func(fighter *input.Input) {
|
||||
if fighter.UserID != f.WinnerId {
|
||||
fighter.Player.SendPackCmd(2505, &attackValueResult)
|
||||
}
|
||||
|
||||
// })
|
||||
})
|
||||
return
|
||||
}
|
||||
f.Broadcast(func(fighter *input.Input) {
|
||||
|
||||
Reference in New Issue
Block a user