A_SPosAttack
(Redirected from A SposAttack)
Jump to navigation
Jump to search

void A_SPosAttack()
Usage
The attack of Doom's Shotgun Guy. This shoots three bullets and plays the sound "shotguy/attack".
It is equivalent of:
TNT1 A 0 bright A_StartSound("shotguy/attack", CHAN_WEAPON); SPOS F 10 bright A_CustomBulletAttack(22.5, 0, 3, random[SPosAttack](1,5)*3, "BulletPuff", 0, CBAF_NORANDOM);
ZScript definition
void A_SPosAttack()
{
if (target)
{
A_StartSound("shotguy/attack", CHAN_WEAPON);
A_SPosAttackInternal();
}
}
private void A_SPosAttackInternal()
{
if (target)
{
A_FaceTarget();
double bangle = angle;
double slope = AimLineAttack(bangle, MISSILERANGE);
for (int i=0 ; i<3 ; i++)
{
double ang = bangle + Random2[SPosAttack]() * (22.5/256);
int damage = Random[SPosAttack](1, 5) * 3;
LineAttack(ang, MISSILERANGE, slope, damage, "Hitscan", "Bulletpuff");
}
}
}
Examples
See ShotgunGuy.