A_FireBullets

From ZDoom Wiki

Jump to: navigation, search

A_FireBullets (angle spread_horz, angle spread_vert, int numbullets, int damage [, string pufftype [,bool UseAmmo [, float range]]])


Defines a custom hitscan attack for weapons. You have to specify the horizontal and vertical spread, the amount of bullets and the damage per bullet.

The first bullet fired in the Fire (not Hold) sequence normally ignores the spread and is always perfectly accurate. Setting numbullets to a negative value removes this effect.

UseAmmo determines if the attack uses ammo or not. The attack uses ammo if it's set to true. (Default is true.)

The damage formula is damage * ((random()%3)+1). For example, if damage is 4, the possible results are 4, 8 or 12. The average damage actually dealt by each bullet will therefore be damage * 2.

Optionally you can specify a puff type that is spawned when hitting a wall or a non-bleeding actor. The puff also determines the damage type of the attack.

range specifies the maximum distance of the attack.

Examples

Fire:
     TRIF A 5 Bright A_FireBullets(0,0,1,10,"RiflePuff",1)
     TRIF B 5 Bright
     TRIG A 10
     TRIG B 0 A_ReFire
     Goto Ready
Personal tools