```feat(fight): 新增战斗效果60/699/700并优化宠物物品使用逻辑
This commit is contained in:
@@ -52,12 +52,8 @@ func (h Controller) UsePetItemOutOfFight(data *item.C2S_USE_PET_ITEM_OUT_OF_FIGH
|
||||
}
|
||||
oldPetCatchTime := currentPet.CatchTime
|
||||
oldPet := c.Service.Pet.PetInfo_One_Unscoped(currentPet.OldCatchTime)
|
||||
|
||||
copier.CopyWithOption(currentPet, oldPet.Data, copier.Option{DeepCopy: true})
|
||||
// println("currentPet.CatchTime", currentPet.CatchTime, currentPet.OldCatchTime)
|
||||
currentPet = &oldPet.Data
|
||||
currentPet.CatchTime = oldPetCatchTime
|
||||
|
||||
currentPet.EffectInfo = oldPet.Data.EffectInfo
|
||||
} else {
|
||||
handler := item.PetItemRegistry.GetHandler(data.ItemID)
|
||||
if handler == nil {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 60. 受到攻击时n%几率使受到的伤害降低m点(a1: n, a2: m)
|
||||
@@ -10,6 +13,25 @@ type NewSel60 struct {
|
||||
NewSel0
|
||||
}
|
||||
|
||||
func (e *NewSel60) Damage_SUB_ex(t *info.DamageZone) bool {
|
||||
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
if t.Type != info.DamageType.Red {
|
||||
return true
|
||||
}
|
||||
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
|
||||
if !success {
|
||||
return true
|
||||
}
|
||||
t.Damage = t.Damage.Sub(alpacadecimal.NewFromInt(int64(e.Args()[1].IntPart())))
|
||||
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 60, &NewSel60{})
|
||||
}
|
||||
|
||||
39
logic/service/fight/boss/NewSeIdx_699.go
Normal file
39
logic/service/fight/boss/NewSeIdx_699.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 60. "20%弹60点固定伤害" StarLevel="0
|
||||
|
||||
type NewSel699 struct {
|
||||
NewSel0
|
||||
}
|
||||
|
||||
func (e *NewSel699) Skill_Use_ex() bool {
|
||||
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
|
||||
if !success {
|
||||
return true
|
||||
}
|
||||
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: alpacadecimal.Min(e.Ctx().Opp.SumDamage, e.Args()[1]),
|
||||
})
|
||||
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 699, &NewSel699{})
|
||||
}
|
||||
29
logic/service/fight/boss/NewSeIdx_700.go
Normal file
29
logic/service/fight/boss/NewSeIdx_700.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/action"
|
||||
"blazing/logic/service/fight/input"
|
||||
)
|
||||
|
||||
// 60.回复造成伤害的6%
|
||||
|
||||
type NewSel700 struct {
|
||||
NewSel0
|
||||
}
|
||||
|
||||
func (e *NewSel700) Skill_Useed() bool {
|
||||
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
e.Input.Heal(
|
||||
e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Div(e.Args()[1]),
|
||||
)
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 700, &NewSel700{})
|
||||
}
|
||||
@@ -901,11 +901,11 @@
|
||||
|
||||
<!-- 乱舞(基础Idx=1064) -->
|
||||
<NewSeIdx Idx="1064" Stat="1" Eid="503" Args="0 0" CanReset="1" Desc="乱舞" Intro="群体攻击提升5%的攻击伤害并增加一个攻击目标" StarLevel="0" />
|
||||
<NewSeIdx Idx="2064" Stat="1" Eid="504" Args="6 0" CanReset="1" Desc="乱舞" Intro="群体攻击提升6%的攻击伤害并增加一个攻击目标" StarLevel="1" />
|
||||
<NewSeIdx Idx="3064" Stat="1" Eid="504" Args="7 0" CanReset="1" Desc="乱舞" Intro="群体攻击提升8%的攻击伤害并增加一个攻击目标" StarLevel="2" />
|
||||
<NewSeIdx Idx="4064" Stat="1" Eid="504" Args="8 0" CanReset="1" Desc="乱舞" Intro="群体攻击提升10%的攻击伤害并增加一个攻击目标" StarLevel="3" />
|
||||
<NewSeIdx Idx="5064" Stat="1" Eid="504" Args="9 0" CanReset="1" Desc="乱舞" Intro="群体攻击提升11%的攻击伤害并增加一个攻击目标" StarLevel="4" />
|
||||
<NewSeIdx Idx="6064" Stat="1" Eid="504" Args="10 0" CanReset="1" Desc="乱舞" Intro="群体攻击提升12%的攻击伤害并增加一个攻击目标" StarLevel="5" />
|
||||
<NewSeIdx Idx="2064" Stat="1" Eid="503" Args="6 0" CanReset="1" Desc="乱舞" Intro="群体攻击提升6%的攻击伤害并增加一个攻击目标" StarLevel="1" />
|
||||
<NewSeIdx Idx="3064" Stat="1" Eid="503" Args="7 0" CanReset="1" Desc="乱舞" Intro="群体攻击提升8%的攻击伤害并增加一个攻击目标" StarLevel="2" />
|
||||
<NewSeIdx Idx="4064" Stat="1" Eid="503" Args="8 0" CanReset="1" Desc="乱舞" Intro="群体攻击提升10%的攻击伤害并增加一个攻击目标" StarLevel="3" />
|
||||
<NewSeIdx Idx="5064" Stat="1" Eid="503" Args="9 0" CanReset="1" Desc="乱舞" Intro="群体攻击提升11%的攻击伤害并增加一个攻击目标" StarLevel="4" />
|
||||
<NewSeIdx Idx="6064" Stat="1" Eid="503" Args="10 0" CanReset="1" Desc="乱舞" Intro="群体攻击提升12%的攻击伤害并增加一个攻击目标" StarLevel="5" />
|
||||
|
||||
<!-- 强袭(基础Idx=1065) -->
|
||||
<NewSeIdx Idx="1065" Stat="1" Eid="65" Args="1 3" CanReset="1" Desc="强袭" Intro="物理攻击伤害增加3%" StarLevel="0" />
|
||||
|
||||
Reference in New Issue
Block a user