Documentation ¶
Overview ¶
Package player contains player related tracking and functionalities: - tracking characters on the team - handling animations state - handling normal attack state - handling character stats and attributes - handling shielding
Index ¶
- Constants
- Variables
- type Delays
- type DrainInfo
- type Handler
- func (h *Handler) AbilStamCost(i int, a action.Action, p map[string]int) float64
- func (h *Handler) Active() int
- func (h *Handler) ActiveChar() *character.CharWrapper
- func (h *Handler) AddChar(char *character.CharWrapper) int
- func (h *Handler) AddStamPercentMod(key string, dur int, f StamPercentModFunc)
- func (h *Handler) Adjust(src string, char int, amt float64)
- func (h *Handler) ApplyHitlag(char int, factor, dur float64)
- func (h *Handler) ByIndex(i int) *character.CharWrapper
- func (h *Handler) ByKey(k keys.Char) (*character.CharWrapper, bool)
- func (h *Handler) CharIsActive(k keys.Char) bool
- func (h *Handler) Chars() []*character.CharWrapper
- func (h *Handler) CombatByIndex(i int) combat.Character
- func (h *Handler) DistributeParticle(p character.Particle)
- func (h *Handler) Drain(di DrainInfo)
- func (p *Handler) Exec(t action.Action, k keys.Char, param map[string]int) error
- func (h *Handler) Heal(info HealInfo)
- func (h *Handler) HealIndex(info *HealInfo, index int)
- func (h *Handler) InitializeTeam() error
- func (h *Handler) LowestHPChar() *character.CharWrapper
- func (h *Handler) ResetAllNormalCounter()
- func (h *Handler) RestoreStam(v float64)
- func (h *Handler) SetActive(i int)
- func (h *Handler) StamPercentMod(a action.Action) (amt float64)
- func (h *Handler) StamPercentModIsActive(key string) bool
- func (h *Handler) Tick()
- type HealInfo
- type HealType
- type Opt
- type StamPercentModFunc
Constants ¶
const ( MaxStam = 240 StamCDFrames = 90 SwapCDFrames = 60 )
Variables ¶
var ErrActionNoOp = errors.New("action is a noop")
var ErrActionNotReady = errors.New("action is not ready yet; cannot be executed")
ErrActionNotReady is returned if the requested action is not ready; this could be due to any of the following:
- Insufficient energy (burst only)
- Ability on cooldown
- Player currently in animation
var ErrPlayerNotReady = errors.New("player still in animation; cannot execute action")
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct { Opt //handlers *animation.AnimationHandler Shields *shield.Handler infusion.InfusionHandler //stam Stam float64 LastStamUse int //swap SwapCD int //last action LastAction struct { UsedAt int Type action.Action Param map[string]int Char int } // contains filtered or unexported fields }
func (*Handler) AbilStamCost ¶
func (*Handler) ActiveChar ¶
func (h *Handler) ActiveChar() *character.CharWrapper
func (*Handler) AddStamPercentMod ¶
func (h *Handler) AddStamPercentMod(key string, dur int, f StamPercentModFunc)
TODO: not sure if this is affected by hitlag?
func (*Handler) ApplyHitlag ¶
func (*Handler) Chars ¶
func (h *Handler) Chars() []*character.CharWrapper
func (*Handler) DistributeParticle ¶
func (*Handler) Exec ¶
Exec mirrors the idea of the in game buttons where you can press the button but it may be greyed out. If grey'd out it will return ErrActionNotReady. Otherwise if action was executed successfully then it will return nil
The function takes 2 params:
- ActionType
- Param
Just like in game this will always try and execute on the currently active character ¶
This function can be called as many times per frame as desired. However, it will only execute if the animation state allows for it
Note that although wait is not strictly a button in game, it is still a valid action. When wait is executed, it will simply put the player in a lock animation state for the requested number of frames
func (*Handler) InitializeTeam ¶
InitializeTeam will set up resonance event hooks and calculate all character base stats
func (*Handler) LowestHPChar ¶ added in v1.7.0
func (h *Handler) LowestHPChar() *character.CharWrapper
returns the char with the lowest HP
func (*Handler) ResetAllNormalCounter ¶
func (h *Handler) ResetAllNormalCounter()
func (*Handler) RestoreStam ¶
func (*Handler) StamPercentModIsActive ¶
Directories ¶
Path | Synopsis |
---|---|
package animation provides a simple way of tracking the current animation state at any given frame, as well as if the current frame is in animation lock or not
|
package animation provides a simple way of tracking the current animation state at any given frame, as well as if the current frame is in animation lock or not |
Package shield provide a handler to keep track of shields and add shields etc...
|
Package shield provide a handler to keep track of shields and add shields etc... |