Represents a state on an Actor
or StateProvider
. Data in State
is
read-only and is copied as needed to its respective locations for modification,
as it is merely a look into the global constant state table.
struct State
{
readonly uint8 Frame;
readonly State NextState;
readonly int Sprite;
readonly int16 Tics;
readonly int Misc1;
readonly int Misc2;
readonly uint16 TicRange;
readonly uint8 UseFlags;
readonly bool bCanRaise;
readonly bool bDeHackEd;
readonly bool bFast;
readonly bool bFullBright;
readonly bool bNoDelay;
readonly bool bSameFrame;
readonly bool bSlow;
int DistanceTo(State other);
bool InStateSequence(State base);
bool ValidateSpriteFrame();
textureid, bool, vector2 GetSpriteTexture(int rotation, int skin = 0, vector2 scale = (0, 0));
}
The sprite frame of this state.
A pointer to the next state in the global state table.
The sprite ID of this state.
The number of game ticks this state lasts.
Primarily used in DeHackEd compatibility. Don't use this.
The maximum amount of tics to add for random tic durations, or 0
if the
duration is not random. For example, TNT1 A random(5, 7)
would have a Tics
value of 5
and a TicRange
of 2
.
The scope of this state. See Action Scoping. Can have any of the
DefaultStateUsage
flags.
State has the CanRaise
flag, allowing A_VileChase
to target this actor for
healing without entering an infinitely long state.
true
if the state has been modified by DeHackEd.
State has the Fast
flag, halving the duration when fast monsters is enabled.
State has the Bright
flag, making it fully bright regardless of other
lighting conditions.
State has the NoDelay
flag, forcing the associated action function to be run
if the actor is in its first tic.
true
if the state's frame is to be kept from the last frame used, i.e., is
#
.
State has the Slow
flag, doubling the duration when slow monsters is enabled.
Returns the offset between this state and other
in the global frame table.
Only works if both states are owned by the same actor.
Returns true
if this state is within a contiguous state sequence beginning
with base
.
Returns true
if the sprite frame actually exists.
Returns the texture, if the texture should be flipped horizontally, and scaling
of this state's sprite. Scaling will return scale
unless skin
is nonzero.
skin
determines the player skin used.