Documentation ¶
Overview ¶
Package action describes the valid actions that any character may take
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action int
const ( InvalidAction Action = iota ActionSkill ActionBurst ActionAttack ActionCharge ActionHighPlunge ActionLowPlunge ActionAim ActionDash ActionJump //following action have to implementations ActionSwap ActionWalk ActionWait // character should stand around and wait EndActionType //these are only used for frames purposes and that's why it's after end ActionSkillHoldFramesOnly )
func StringToAction ¶
func (Action) MarshalJSON ¶ added in v1.2.2
func (*Action) UnmarshalJSON ¶ added in v1.2.2
type ActionFailure ¶ added in v1.2.2
type ActionFailure int
const ( NoFailure ActionFailure = iota SwapCD SkillCD BurstCD InsufficientEnergy InsufficientStamina CharacterDesceased // TODO: need chars to die first )
func (ActionFailure) MarshalJSON ¶ added in v1.2.2
func (e ActionFailure) MarshalJSON() ([]byte, error)
func (ActionFailure) String ¶ added in v1.2.2
func (e ActionFailure) String() string
func (*ActionFailure) UnmarshalJSON ¶ added in v1.2.2
func (e *ActionFailure) UnmarshalJSON(b []byte) error
type ActionInfo ¶
type ActionInfo struct { Frames func(next Action) int `json:"-"` AnimationLength int CanQueueAfter int State AnimationState FramePausedOnHitlag func() bool `json:"-"` OnRemoved func(next AnimationState) `json:"-"` //following are exposed only so we can log it properly CachedFrames [EndActionType]int //TODO: consider removing the cache frames and instead cache the frames function instead TimePassed float64 NormalizedTimePassed float64 UseNormalizedTime func(next Action) bool // contains filtered or unexported fields }
TODO: add a sync.Pool here to save some memory allocs
func (*ActionInfo) AnimationState ¶
func (a *ActionInfo) AnimationState() AnimationState
func (*ActionInfo) CacheFrames ¶
func (a *ActionInfo) CacheFrames()
func (*ActionInfo) CanQueueNext ¶
func (a *ActionInfo) CanQueueNext() bool
func (*ActionInfo) CanUse ¶
func (a *ActionInfo) CanUse(next Action) bool
func (*ActionInfo) QueueAction ¶
func (a *ActionInfo) QueueAction(f func(), delay int)
func (*ActionInfo) Tick ¶
func (a *ActionInfo) Tick() bool
type AnimationState ¶
type AnimationState int
const ( Idle AnimationState = iota NormalAttackState ChargeAttackState PlungeAttackState SkillState BurstState AimState DashState JumpState WalkState SwapState )
func (AnimationState) String ¶
func (a AnimationState) String() string
Click to show internal directories.
Click to hide internal directories.