All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
fix(game): 修复寒流枪技能中宠物ID错误 - 将寒流枪技能中第二个宠物的ID从505修正为1905 - 移除了未使用的Effect138效果代码(先出手反弹伤害效果) ```
51 lines
1.2 KiB
Go
51 lines
1.2 KiB
Go
package effect
|
||
|
||
import (
|
||
"blazing/logic/service/fight/info"
|
||
"blazing/logic/service/fight/input"
|
||
"blazing/logic/service/fight/node"
|
||
|
||
"github.com/alpacahq/alpacadecimal"
|
||
)
|
||
|
||
// 138 - 先出手时,n回合自己不会受到对手攻击性技能伤害并反弹对手1/n造成的伤害
|
||
type Effect138 struct {
|
||
node.EffectNode
|
||
can bool
|
||
}
|
||
|
||
func (e *Effect138) SetArgs(t *input.Input, a ...int) {
|
||
e.EffectNode.SetArgs(t, a...)
|
||
e.EffectNode.Duration(a[0]) // 持续n回合
|
||
}
|
||
func (e *Effect138) OnSkill() bool {
|
||
if e.IsFirst() { // 先出手
|
||
e.can = true
|
||
}
|
||
return true
|
||
}
|
||
func (e *Effect138) DamageLockEx(t *info.DamageZone) bool {
|
||
if e.can { // 先出手
|
||
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() != info.Category.STATUS {
|
||
|
||
// 反弹1/n造成的伤害
|
||
damageToBounce := e.Ctx().Opp.SumDamage.Div(e.Args()[1]) // 1/n
|
||
damageZone := &info.DamageZone{
|
||
Type: info.DamageType.Fixed,
|
||
Damage: damageToBounce,
|
||
}
|
||
e.Ctx().Opp.Damage(e.Ctx().Our, damageZone)
|
||
if t.Type == info.DamageType.Fixed {
|
||
t.Damage = alpacadecimal.Zero
|
||
}
|
||
|
||
}
|
||
}
|
||
|
||
return true
|
||
}
|
||
func init() {
|
||
input.InitEffect(input.EffectType.Skill, 138, &Effect138{})
|
||
|
||
}
|