Files
bl/logic/service/fight/effect/effect_status.go

74 lines
1.6 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/shopspring/decimal"
)
// 施加一个基类effect
type EffectStatus struct {
node.EffectNode
Status info.EnumBattleStatus
}
type StatusNotSkill struct {
EffectStatus
}
// 不能出手
func (e *StatusNotSkill) Skill_Hit_Pre(input.Ctx) bool {
return false
}
// 扣血类
type DrainHP struct {
EffectStatus
}
func (e *DrainHP) Skill_Hit_Pre(input input.Ctx) bool {
input.DamageZone = &info.DamageZone{
Type: info.DamageType.True, //状态类扣除无法被减伤
Damage: decimal.NewFromUint64(uint64(e.Input.CurrentPet.Info.MaxHp)).
Div(decimal.NewFromInt(8)),
}
e.Input.Damage(input)
return true
}
// 被寄生种子 扣血类
type StatusDrainedHP struct {
DrainHP
}
func (e *StatusDrainedHP) Skill_Hit_Pre(input input.Ctx) bool {
e.DrainHP.Skill_Hit_Pre(input) //先调用父类扣血
//TODO 寄生种子 给对面回血待实现回血buff
// input.CurrentPet.Info.Hp = -e.Input.CurrentPet.Info.MaxHp / 8
return true
}
func init() {
//麻痹,疲惫,害怕,石化,都是无法行动
tt := func(t info.EnumBattleStatus, f *StatusNotSkill) {
f.Status = t
input.InitEffect(input.EffectType.Status, int(t), f)
}
input.InitEffect(input.EffectType.Status, int(info.PetStatus.DrainHP), &EffectStatus{}) //寄生种子
tt(info.PetStatus.Paralysis, &StatusNotSkill{})
tt(info.PetStatus.Tired, &StatusNotSkill{})
tt(info.PetStatus.Sleep, &StatusNotSkill{})
tt(info.PetStatus.Petrified, &StatusNotSkill{})
}