A_FireBFG
Jump to navigation
Jump to search
action void A_FireBFG()
Usage
Fires a BFGBall from the current weapon.
Autoaim is disabled by default through the "Allow BFG aiming" DMFlag. This can be circumvented by spawning it manually:
A_FireProjectile("BFGBall", 0, 1);
Examples
This is taken directly from the BFG9000.
Fire:
BFGG A 20 A_BFGsound;
BFGG B 10 A_GunFlash;
BFGG B 10 A_FireBFG;
BFGG B 20 A_ReFire;
Goto Ready;
ZScript definition
| Note: The ZScript definition below is for reference and may be different in the current version of UZDoom. The most up-to-date version of this code can be found on UZDoom GitHub. |
action void A_FireBFG()
{
if (player == null)
{
return;
}
Weapon weap = player.ReadyWeapon;
if (weap != null && invoker == weap && stateinfo != null && stateinfo.mStateType == STATE_Psprite)
{
if (!weap.DepleteAmmo (weap.bAltFire, true, deh.BFGCells))
return;
}
SpawnPlayerMissile("BFGBall", angle, nofreeaim:sv_nobfgaim);
}