A_CheckAmbush

From SRB2 Wiki
Jump to navigation Jump to search

A_CheckAmbush is an action that calls a state if the actor is "ambushing" its target or tracer – i.e. the actor is located behind the target Object. For example, this action could be used for enemies that attack only when the player is not looking at it. Var1 determines whether the actor's target (0) or tracer (1) is used, and Var2 determines the state to call when this action is successful; see List of states for a full list. If the chosen Object does not exist, this action will do nothing.

The actor is considered to be "behind" the target Object by this action when it is positioned such that it forms an angle within 112.5° either side from the back of the target Object. This can also be interpreted to mean that if the actor is positioned anywhere within 67.5° of the target Object's front, the state will not be called. This does not require the target Object to actually "see" the actor; the state call will fail regardless of whether it can be seen by the target Object or not.

This action originates from the v2.0 modification SRB2Morphed and was added to SRB2 itself in v2.1.

  Actions – Checking [view]
A_BubbleCheckA_CheckAmbushA_CheckHealthA_CheckHeightA_CheckRandomA_CheckRangeA_CheckRingsA_CheckTargetRingsA_CheckThingCountA_CheckTotalRingsA_CheckTrueRangeA_ChickenCheckA_LookA_SearchForPlayers