dofile("Scripts/utils.lua");
dofile("Scripts/Init/units.lua");
dofile("Scripts/Init/vehicle2.lua");

function Main()
	AIparts:Run();
end

function Initialize()
	BasicInit();
	V2Init();
end

function CheckDamage(Damage, Point)
	local health = object.GetHealth() - Damage;
	if health < 0 then health = 0 end
	object.SetHealth(health);

	if health <= 0 then
		for _,v in pairs(frames) do
			object.SetGroupDamage(1, v.active);
		end
		body.frame.active = body.frame.destroyed
		object.SetGroupVisible(false, body.frame.normal);
		object.SetGroupVisible(true, body.frame.active);
		object.SetGroupDamage(1, body.frame.active);
		object.Die();
	end
end
