From ZDoom Wiki
Jump to: navigation, search

A_CustomBulletAttack (float horz_spread, float vert_spread, int numbullets, int damageperbullet, string pufftype [, float range [, int flags]])


A customizable hitscan attack. Fires a number of bullets with the specified damage and spread. The bullet puff and range can also be specified, as well as whether the actor uses its current target for aiming purposes.


  • horz_spread: The horizontal spread, in degrees.
  • vert_spread: The vertical spread, in degrees.
  • numbullets: The number of bullets to fire.
  • damageperbullet: The amount of damage each bullet does. Unless the NORANDOM flag is set, this is multiplied by a random value between 1 and 3.
  • pufftype: The puff to spawn when a wall is hit.
  • range: The maximum range of the bullets.
  • flags:
    • CBAF_AIMFACING: If set, the attack will be fired in the direction the actor is currently facing, rather than at the actor's current target.
    • CBAF_NORANDOM: If set, the damage per bullet is not randomized.
    • CBAF_EXPLICITANGLE: If set, the horizontal and vertical spread are used as explicitly stated, instead of being used as a range for random spread.
    • CBAF_NOPITCH: If set, the vertical angle is not adjusted to aim at the target.
    • CBAF_NORANDOMPUFFZ: If set, the random z offset given to the puff when spawned is disabled. (New from 2.7.1)


ACTOR Sniper : ShotgunGuy
    SPOS E 2 A_FaceTarget
    SPOS E 0 A_PlaySound("weapons/sshotf")
    SPOS F 3 Bright A_CustomBulletAttack(2, 2, 1, 20)
    SPOS E 5
    Goto See