A_TrapShot

From SRB2 Wiki
Jump to navigation Jump to search
This article or section is incomplete. It doesn't have all of the necessary core information on this topic. Please help the SRB2 Wiki by finishing this article.
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:
  • Var2 apparently works differently, see code for details

A_TrapShot is an action which is used to shoot a projectile like a Glaregoyle – i.e.: the projectile is fired in a particular direction, rather than firing at a particular Object or point in the map.

Var1's lower 16 bits determines the Object type number of the projectile the actor will fire. This is usually expected to be an Object type with the MF_MISSILE flag (see Projectile for examples), though any Object type is technically allowed. Note that the projectile's SeeSound Object type attribute determines the sound played when spawned, and the Speed attribute determines how fast the projectile will move when fired.

Var2's lower 16 bits determines the vertical angle the projectile is fired at, measured in degrees: 0° is directly forward, 90° is directly upwards, 180° is directly backwards, and 270° is directly downwards. The actor's angle is used as the projectile's own horizontal firing angle.

The position the projectile is fired from can also be modified by this action – Var1's upper 16 bits determines the front/back offset, relative to the actor's center, and Var2's upper 16 bits determines the height offset, relative to the actor's bottom Z position.

  Actions – Projectiles [view]
A_DropMineA_FireShotA_LobShotA_MissileSplitA_MultiShotA_NapalmScatterA_ShootBulletA_SplitShotA_SuperFireShotA_SuperTurretFireA_TrapShotA_TurretFireA_TurretStopA_VileAttackA_VileFireA_VileTargetA_HoodFire