A_SkullAttack

From SRB2 Wiki
Jump to navigation Jump to search
This article or section is outdated and has not been fully updated to reflect the current version of SRB2.

Please help the Wiki by correcting or removing any misinformation, as well as adding any new information to the page.

To do
Update for 2.2.0:
  • Var1 has a new option to be documented
  • Egg Mobile doesn't actually use this for attacking anymore, only for flying away from the player after being hit

A_SkullAttack is the standard attack of the Lost Souls from Doom, repurposed for use in SRB2. If a target is in range, the Object plays its ActiveSound and flies like a missile in a direction relative to it, depending on the value of Var1. If Var1 is 0, it will charge directly at the target; if set to 1, it dashes away from the target; if set to 2, it strafes relative to the target (randomly chooses between left or right). Var2 determines whether the actor will fly both vertically and horizontally (Var2 = 0), or just horizontally (Var2 = 1).

Unlike with actions such as A_Chase, A_SkullAttack doesn't need to be called repeatedly for most purposes – it gives the actor MF2_SKULLFLY, preventing the momentum given (a fixed speed of 20 fracunits/tic) from being lost until the actor crashes into an Object or wall (removing MF2_SKULLFLY), and allowing the actor to bounce off any floor/ceiling it hits. Exclusively for the Egg Mobile and custom Objects with MF_BOSS, the actor additionally spawns ghosts of itself.

Note: The Egg Mobile interprets this slightly differently, charging directly at the target, and dashing through them. This only works for the Egg Mobile, and should not be confused with the action's normal effect. Objects that desire this behavior should either replace the Egg Mobile Object itself, or toggle the flag MF_NOCLIPTHING (which will prevent it from ceasing the attack before colliding with the target, but, since it removes most collision checks against other Things, will also have its own side effects).

  Actions – Movement [view]
A_BubbleRiseA_BunnyHopA_CapeChaseA_ChaseA_FishJumpA_ForceStopA_HomingChaseA_InstaLoopA_KnockBackA_MouseThinkA_MoveAbsoluteA_MoveRelativeA_PushAwayA_ScoreRiseA_SkullAttackA_ThrustA_ZThrust