A_InfoState is an action that switches the actor's state to one of a selection of anchor states for the actor's Object type, determined by the value of Var1 – all Object type anchor states except PainState
are selectable with this action. In SRB2, this action is used by the auxiliary states S_SPAWNSTATE
to S_RAISESTATE
to allow quick access to their corresponding anchor states. Listed below are the possible values of Var1 with the anchor states that would be called by them, along with the auxiliary state that calls A_InfoState
with each value of Var1.
Var1
|
Anchor state
|
Auxiliary state
|
0
|
SpawnState
|
S_SPAWNSTATE
|
1
|
SeeState
|
S_SEESTATE
|
2
|
MeleeState
|
S_MELEESTATE
|
3
|
MissileState
|
S_MISSILESTATE
|
4
|
DeathState
|
S_DEATHSTATE
|
5
|
XDeathState
|
S_XDEATHSTATE
|
6
|
RaiseState
|
S_RAISESTATE
|
If the actor is already at the state A_InfoState
is trying to send it to, the action will do nothing. Unlike all other actions, Lua cannot be used to replace A_InfoState
with a function using the same name.
Code – A_InfoState
|
|
// Function: A_InfoState
//
// Description: Set mobj state to one predefined in mobjinfo.
//
// var1:
// if var1 == 0, set actor to spawnstate
// else if var1 == 1, set actor to seestate
// else if var1 == 2, set actor to meleestate
// else if var1 == 3, set actor to missilestate
// else if var1 == 4, set actor to deathstate
// else if var1 == 5, set actor to xdeathstate
// else if var1 == 6, set actor to raisestate
// var2 = unused
//
void A_InfoState(mobj_t *actor)
{
INT32 locvar1 = var1;
switch (locvar1)
{
case 0:
if (actor->state != &states[actor->info->spawnstate])
P_SetMobjState(actor, actor->info->spawnstate);
break;
case 1:
if (actor->state != &states[actor->info->seestate])
P_SetMobjState(actor, actor->info->seestate);
break;
case 2:
if (actor->state != &states[actor->info->meleestate])
P_SetMobjState(actor, actor->info->meleestate);
break;
case 3:
if (actor->state != &states[actor->info->missilestate])
P_SetMobjState(actor, actor->info->missilestate);
break;
case 4:
if (actor->state != &states[actor->info->deathstate])
P_SetMobjState(actor, actor->info->deathstate);
break;
case 5:
if (actor->state != &states[actor->info->xdeathstate])
P_SetMobjState(actor, actor->info->xdeathstate);
break;
case 6:
if (actor->state != &states[actor->info->raisestate])
P_SetMobjState(actor, actor->info->raisestate);
break;
default:
break;
}
}
|
|