Documentation ¶
Overview ¶
Package shield provide a handler to keep track of shields and add shields etc...
Index ¶
- type Handler
- func (h *Handler) Add(shd Shield)
- func (h *Handler) AddShieldBonusMod(key string, dur int, f ShieldBonusModFunc)
- func (h *Handler) CharacterIsShielded(char, active int) bool
- func (h *Handler) Count() int
- func (h *Handler) Get(t Type) Shield
- func (h *Handler) List() []Shield
- func (h *Handler) OnDamage(char, active int, dmg float64, ele attributes.Element) float64
- func (h *Handler) ShieldBonus() float64
- func (h *Handler) ShieldBonusModIsActive(key string) bool
- func (h *Handler) Tick()
- type Shield
- type ShieldBonusModFunc
- 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) ShieldTarget() int
- func (t *Tmpl) Type() Type
- type Type
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 However we do care which is active since: - global shields: only active is shielded - 1 character shields: active only shieled if is target of shield
func (*Handler) AddShieldBonusMod ¶
func (h *Handler) AddShieldBonusMod(key string, dur int, f ShieldBonusModFunc)
func (*Handler) CharacterIsShielded ¶
func (*Handler) ShieldBonus ¶
TODO: this probably should be affected by hitlag as well
func (*Handler) ShieldBonusModIsActive ¶
type Shield ¶
type Shield interface { ShieldOwner() int ShieldTarget() int // -1 to apply to all characters, character index otherwise Key() int Type() Type 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 Tmpl ¶
type Tmpl struct { ActorIndex int Target int Name string Src int ShieldType Type 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 ¶
func (*Tmpl) ShieldStrength ¶
func (t *Tmpl) ShieldStrength(ele attributes.Element, bonus float64) float64
func (*Tmpl) ShieldTarget ¶
Click to show internal directories.
Click to hide internal directories.