// Headshot script
#library "HEADS"
#include "zcommon.acs"

str HeadshotActors[2] = { "HeadshotTarget1", "HeadshotTarget1Strong" };

// Called when the actor spawns
script 625 (int spawnheight, int typetospawn)
{
	ACS_ExecuteWithResult(626,spawnheight,typetospawn,0,0);
	if (GetActorProperty(0,APROP_Health) > 0)
	{
	delay(1);
	restart;
	}
}

// Actual headspawn script
//
// Headshot actor will have frame time of 1 tic, then disappear
// Uses A_Explode

script 626 (int heighttospawn, int headspawner)
{
	int x,y,z,angle;
	x = GetActorX(0);
    y = GetActorY(0);
    z = GetActorZ(0) + heighttospawn * 1.0;
	angle = GetActorAngle(0) >> 8;
	Spawn(HeadshotActors[headspawner],x,y,z,0,angle);
}