A_CustomBulletAttack

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]])


Usage

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.

Parameters

  • 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: (New from 2.5.0)
    • 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. (development version r2530+ only)

Examples

 Sniper replaces Shotgunguy
{
 states
  {
   Missile:
     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
  }
}
Personal tools
Namespaces
Variants
Actions
Navigation
ACS
DECORATE
ZDoom mods
Toolbox