43 lines
834 B
Go
43 lines
834 B
Go
package effect
|
||
|
||
import (
|
||
"blazing/logic/service/fight/info"
|
||
"blazing/logic/service/fight/input"
|
||
|
||
"github.com/alpacahq/alpacadecimal"
|
||
)
|
||
|
||
/**
|
||
* 如果先出手,则受攻击时反弹200%的伤害给对手,持续n回合
|
||
*/
|
||
|
||
func init() {
|
||
t := &Effect73{}
|
||
|
||
input.InitEffect(input.EffectType.Skill, 73, t)
|
||
|
||
}
|
||
|
||
// Effect 73: 若先手攻击,则将所受伤害2倍反击给对手
|
||
type Effect73 struct {
|
||
RoundEffectSideArg0Minus1Base
|
||
}
|
||
|
||
func (e *Effect73) Action_end_ex() bool {
|
||
|
||
if !e.IsFirst() {
|
||
return true
|
||
}
|
||
tt := &info.DamageZone{
|
||
Type: info.DamageType.Fixed,
|
||
Damage: e.Ctx().Opp.SumDamage.Mul(alpacadecimal.NewFromInt(2)),
|
||
}
|
||
maxhp := e.Ctx().Our.CurrentPet.GetMaxHP().Mul(alpacadecimal.NewFromInt(30))
|
||
if tt.Damage.Cmp(maxhp) == 1 {
|
||
tt.Damage = maxhp
|
||
}
|
||
e.Ctx().Opp.Damage(e.Ctx().Our, tt)
|
||
|
||
return true
|
||
}
|