State
Show declaration
struct State clearScope;
Represents a state on an Actor. Data in State is read-only and is
copied as needed to its respective locations for modification, as it
is merely a view into the global constant state table.
Instance Methods
- 
int DistanceTo(State other)
 - 
Returns the offset between this state and
otherin the global frame table. Only works if both states are owned by the same actor. 
- 
bool InStateSequence(State base)
 - 
Returns
trueif this state is within a contiguous state sequence beginning withbase. 
- 
bool ValidateSpriteFrame()
 - 
Returns
trueif the sprite frame actually exists. 
- 
textureId, bool, vector2 GetSpriteTexture(int rotation, int skin = 0, vector2 scale = (0, 0))
 - 
Returns the texture, if the texture should be flipped horizontally, and scaling of this state's sprite. Scaling will return
scaleunlessskinis nonzero.skindetermines the player skin used. 
Overview of instance methods
DistanceTo, GetSpriteTexture, InStateSequence, ValidateSpriteFrame
Instance Members
Visuals
- 
readOnly uint8 Frame
 - 
The sprite frame of this state. The "A" frame is represented by "0," the "B" frame by "1," etc.
 
- 
readOnly int Sprite
 - 
The sprite ID of this state.
 
Timings
- 
readOnly int16 Tics
 - 
The number of game tics this state lasts.
 
- 
readOnly uint16 TicRange
 - 
The maximum amount of tics to add for random tic durations, or
0if the duration is not random. For example,TNT1 A random(5, 7)would have aTicsvalue of5and aTicRangeof2. 
Data
- 
readOnly State NextState
 - 
A pointer to the next state in the global state table. The next state may not be in the same actor! Be careful when using this.
 
- 
readOnly EStateUseFlags UseFlags
 - 
The action scope of this state.
 
Flags
- 
readOnly bool bCanRaise
 - 
State has the
canRaiseoption, allowingActor.A_VileChaseto target this actor for healing without entering an infinitely long state. 
- 
readOnly bool bFast
 - 
State has the
fastoption, halving the duration when fast monsters is enabled. 
- 
readOnly bool bFullBright
 - 
State has the
brightoption, making it fully bright regardless of lighting conditions. 
- 
readOnly bool bNoDelay
 - 
State has the
noDelayoption, forcing the associated action function to be run if the actor is in its first tic. 
- 
readOnly bool bSameFrame
 - 
State's frame is to be kept from the last frame used, i.e, is
#. 
- 
readOnly bool bSlow
 - 
State has the
slowoption, doubling the duration when slow monsters is enabled. 
Overview of instance members
Frame, Misc1, Misc2, NextState, Sprite, TicRange, Tics, UseFlags, bCanRaise, bDeHackEd, bFast, bFullBright, bNoDelay, bSameFrame, bSlow