// Function: A_Boss7FireMissiles
//
// Description: Shoot 4 missiles of a specific object type at your target ala Black Eggman
//
// var1 = object # to shoot
// var2 = firing sound
//
void A_Boss7FireMissiles(mobj_t *actor)
{
mobj_t dummymo;
INT32 locvar1 = var1;
INT32 locvar2 = var2;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_Boss7FireMissiles", actor))
return;
#endif
if (!actor->target)
{
P_SetMobjState(actor, actor->info->spawnstate);
return;
}
A_FaceTarget(actor);
S_StartSound(NULL, locvar2);
// set dummymo's coordinates
dummymo.x = actor->target->x;
dummymo.y = actor->target->y;
dummymo.z = actor->target->z + FixedMul(16*FRACUNIT, actor->scale); // raised height
P_SpawnXYZMissile(actor, &dummymo, locvar1,
actor->x + P_ReturnThrustX(actor, actor->angle-ANGLE_90, FixedDiv(actor->radius, 3*FRACUNIT/2)+FixedMul(4*FRACUNIT, actor->scale)),
actor->y + P_ReturnThrustY(actor, actor->angle-ANGLE_90, FixedDiv(actor->radius, 3*FRACUNIT/2)+FixedMul(4*FRACUNIT, actor->scale)),
actor->z + FixedDiv(actor->height, 3*FRACUNIT/2));
P_SpawnXYZMissile(actor, &dummymo, locvar1,
actor->x + P_ReturnThrustX(actor, actor->angle+ANGLE_90, FixedDiv(actor->radius, 3*FRACUNIT/2)+FixedMul(4*FRACUNIT, actor->scale)),
actor->y + P_ReturnThrustY(actor, actor->angle+ANGLE_90, FixedDiv(actor->radius, 3*FRACUNIT/2)+FixedMul(4*FRACUNIT, actor->scale)),
actor->z + FixedDiv(actor->height, 3*FRACUNIT/2));
P_SpawnXYZMissile(actor, &dummymo, locvar1,
actor->x + P_ReturnThrustX(actor, actor->angle-ANGLE_90, FixedDiv(actor->radius, 3*FRACUNIT/2)+FixedMul(4*FRACUNIT, actor->scale)),
actor->y + P_ReturnThrustY(actor, actor->angle-ANGLE_90, FixedDiv(actor->radius, 3*FRACUNIT/2)+FixedMul(4*FRACUNIT, actor->scale)),
actor->z + actor->height/2);
P_SpawnXYZMissile(actor, &dummymo, locvar1,
actor->x + P_ReturnThrustX(actor, actor->angle+ANGLE_90, FixedDiv(actor->radius, 3*FRACUNIT/2)+FixedMul(4*FRACUNIT, actor->scale)),
actor->y + P_ReturnThrustY(actor, actor->angle+ANGLE_90, FixedDiv(actor->radius, 3*FRACUNIT/2)+FixedMul(4*FRACUNIT, actor->scale)),
actor->z + actor->height/2);
}