Documentation ¶
Overview ¶
Package shield provide a handler to keep track of shields and add shields etc...
Index ¶
- type Handler
- func (s *Handler) Add(shd Shield)
- func (h *Handler) AddShieldBonusMod(key string, dur int, f ShieldBonusModFunc)
- func (s *Handler) Count() int
- func (s *Handler) Get(t ShieldType) Shield
- func (s *Handler) OnDamage(char int, dmg float64, ele attributes.Element) float64
- func (h *Handler) PlayerIsShielded() bool
- func (h *Handler) ShieldBonus() (amt float64)
- func (h *Handler) ShieldBonusModIsActive(key string) bool
- func (s *Handler) ShieldStrength(ele attributes.Element) float64
- func (s *Handler) Tick()
- type Shield
- type ShieldBonusModFunc
- type ShieldType
- type Tmpl
- func (t *Tmpl) CurrentHP() float64
- func (t *Tmpl) Desc() string
- func (t *Tmpl) Element() attributes.Element
- func (t *Tmpl) Expiry() int
- func (t *Tmpl) Key() int
- func (t *Tmpl) OnDamage(dmg float64, ele attributes.Element, bonus float64) (float64, bool)
- func (t *Tmpl) OnExpire()
- func (t *Tmpl) OnOverwrite()
- func (t *Tmpl) ShieldOwner() int
- func (t *Tmpl) ShieldStrength(ele attributes.Element, bonus float64) float64
- func (t *Tmpl) Type() ShieldType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler keeps track of all the active shields Note that there's no need to distinguish between characters here since the shields are shared However we do care which is active since only active is shielded
func (*Handler) AddShieldBonusMod ¶
func (h *Handler) AddShieldBonusMod(key string, dur int, f ShieldBonusModFunc)
func (*Handler) Get ¶
func (s *Handler) Get(t ShieldType) Shield
func (*Handler) PlayerIsShielded ¶
func (*Handler) ShieldBonus ¶
TODO: this probably should be affected by hitlag as well
func (*Handler) ShieldBonusModIsActive ¶
func (*Handler) ShieldStrength ¶ added in v1.2.2
func (s *Handler) ShieldStrength(ele attributes.Element) float64
type Shield ¶
type Shield interface { ShieldOwner() int Key() int Type() ShieldType ShieldStrength(ele attributes.Element, bonus float64) float64 OnDamage(dmg float64, ele attributes.Element, bonus float64) (float64, bool) //return dmg taken and shield stays OnExpire() OnOverwrite() Expiry() int CurrentHP() float64 Element() attributes.Element Desc() string }
type ShieldBonusModFunc ¶
type ShieldType ¶
type ShieldType int
const ( ShieldCrystallize ShieldType = iota //lasts 15 seconds ShieldNoelleSkill ShieldNoelleA1 ShieldZhongliJadeShield ShieldDionaSkill ShieldBeidouThunderShield ShieldXinyanSkill ShieldXinyanC2 ShieldKaeyaC4 ShieldYanfeiC4 ShieldBell ShieldYunjinSkill ShieldThomaSkill ShieldCandaceSkill ShieldLaylaSkill ShieldBaizhuBurst ShieldKiraraSkill EndShieldType )
type Tmpl ¶
type Tmpl struct { ActorIndex int Name string Src int ShieldType ShieldType Ele attributes.Element HP float64 Expires int }
func (*Tmpl) Element ¶
func (t *Tmpl) Element() attributes.Element
func (*Tmpl) OnOverwrite ¶
func (t *Tmpl) OnOverwrite()
func (*Tmpl) ShieldOwner ¶ added in v1.13.0
func (*Tmpl) ShieldStrength ¶ added in v1.2.2
func (t *Tmpl) ShieldStrength(ele attributes.Element, bonus float64) float64
func (*Tmpl) Type ¶
func (t *Tmpl) Type() ShieldType
Click to show internal directories.
Click to hide internal directories.