From SRB2 Wiki
Jump to: navigation, search

A_UnidusBall is an action that is used as the thinker for the Unidus' spike balls and the Egg Mobile's pinch phase spike balls. When this action is called every tic, the actor will rotate around its target until the conditions are right for the actor to thrust itself away from its target. The angle increment given to the actor each use of this action is determined by the actor's Speed Object property – this should be the angle in degrees multiplied by FRACUNIT; it is recommended that the angle value itself should be an integer, so that the actor's rotation around its target does not lead to the actor making sudden jumps in its orbit.[confirm? – discuss]

The exact behavior of the throwing behavior depends on the value given for Var1:

Var1 Effect
0 The actor will not be thrown.
1 Unidus spikeball behavior: if the actor's target itself has a target Object (e.g. a player), the absolute angle formed between this Object and the actor's target compared to the absolute angle formed by the actor and the actor's target determines whether the actor is thrown at this target Object (the actor's target's target) or not: if the two angles are between the angle given by 3× the actor's Speed property (keeping in mind that this should be a multiple of FRACUNIT as stated above), the actor is thrown towards the destination Object at a speed determined by the actor's Damage property.
2 Egg Mobile spikeball behavior: the secondary Object flag MF2_SKULLFLY is of special significance here. The actor's target should initially be in a state without MF2_SKULLFLY applied (presumably a stationary phase before the dash attack), but then later this flag is to be applied (the dash attack itself). If the actor's target loses MF2_SKULLFLY afterwards (such as when crashing into a wall), the actor will be thrown outwards away from its target at a speed determined by the actor's Damage property.
Object Property Use
Speed Angle increment
Damage Thrust speed

  Actions – Rotational movement [view]