// Function: A_BossFireShot
//
// Description: Shoot an object at your target ala Bosses:
//
// var1 = object # to shoot
// var2:
// 0 - Boss 1 Left side
// 1 - Boss 1 Right side
// 2 - Boss 3 Left side upper
// 3 - Boss 3 Left side lower
// 4 - Boss 3 Right side upper
// 5 - Boss 3 Right side lower
//
void A_BossFireShot(mobj_t *actor)
{
fixed_t x, y, z;
INT32 locvar1 = var1;
INT32 locvar2 = var2;
mobj_t *missile;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_BossFireShot", actor))
return;
#endif
if (!actor->target)
return;
A_FaceTarget(actor);
switch (locvar2)
{
case 0:
x = actor->x + P_ReturnThrustX(actor, actor->angle+ANGLE_90, FixedMul(43*FRACUNIT, actor->scale));
y = actor->y + P_ReturnThrustY(actor, actor->angle+ANGLE_90, FixedMul(43*FRACUNIT, actor->scale));
if (actor->eflags & MFE_VERTICALFLIP)
z = actor->z + actor->height - FixedMul(48*FRACUNIT, actor->scale);
else
z = actor->z + FixedMul(48*FRACUNIT, actor->scale);
break;
case 1:
x = actor->x + P_ReturnThrustX(actor, actor->angle-ANGLE_90, FixedMul(43*FRACUNIT, actor->scale));
y = actor->y + P_ReturnThrustY(actor, actor->angle-ANGLE_90, FixedMul(43*FRACUNIT, actor->scale));
if (actor->eflags & MFE_VERTICALFLIP)
z = actor->z + actor->height - FixedMul(48*FRACUNIT, actor->scale);
else
z = actor->z + FixedMul(48*FRACUNIT, actor->scale);
break;
case 2:
x = actor->x + P_ReturnThrustX(actor, actor->angle-ANGLE_90, FixedMul(56*FRACUNIT, actor->scale));
y = actor->y + P_ReturnThrustY(actor, actor->angle-ANGLE_90, FixedMul(56*FRACUNIT, actor->scale));
if (actor->eflags & MFE_VERTICALFLIP)
z = actor->z + actor->height - FixedMul(42*FRACUNIT, actor->scale);
else
z = actor->z + FixedMul(42*FRACUNIT, actor->scale);
break;
case 3:
x = actor->x + P_ReturnThrustX(actor, actor->angle-ANGLE_90, FixedMul(58*FRACUNIT, actor->scale));
y = actor->y + P_ReturnThrustY(actor, actor->angle-ANGLE_90, FixedMul(58*FRACUNIT, actor->scale));
if (actor->eflags & MFE_VERTICALFLIP)
z = actor->z + actor->height - FixedMul(30*FRACUNIT, actor->scale);
else
z = actor->z + FixedMul(30*FRACUNIT, actor->scale);
break;
case 4:
x = actor->x + P_ReturnThrustX(actor, actor->angle+ANGLE_90, FixedMul(56*FRACUNIT, actor->scale));
y = actor->y + P_ReturnThrustY(actor, actor->angle+ANGLE_90, FixedMul(56*FRACUNIT, actor->scale));
if (actor->eflags & MFE_VERTICALFLIP)
z = actor->z + actor->height - FixedMul(42*FRACUNIT, actor->scale);
else
z = actor->z + FixedMul(42*FRACUNIT, actor->scale);
break;
case 5:
x = actor->x + P_ReturnThrustX(actor, actor->angle+ANGLE_90, FixedMul(58*FRACUNIT, actor->scale));
y = actor->y + P_ReturnThrustY(actor, actor->angle+ANGLE_90, FixedMul(58*FRACUNIT, actor->scale));
if (actor->eflags & MFE_VERTICALFLIP)
z = actor->z + actor->height - FixedMul(30*FRACUNIT, actor->scale);
else
z = actor->z + FixedMul(30*FRACUNIT, actor->scale);
break;
default:
x = actor->x;
y = actor->y;
z = actor->z + actor->height/2;
break;
}
missile = P_SpawnXYZMissile(actor, actor->target, locvar1, x, y, z);
if (missile && actor->tracer && (actor->tracer->flags & MF_BOSS)) // Don't harm your papa.
P_SetTarget(&missile->target, actor->tracer);
}