-- ScreenError("ERROR: stucco.lua is used for object "..object.desc.DescFileName);

function Initialize() local health;
	if object.desc.Class == "Bridge" then health = 50000
	elseif object.desc.Class == "House" then health = 3000
	elseif object.desc.Class == "Stand" then health = 500
	end
	object.SetHealth(health);
end

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

	if health <= 0 then
		object.Die();
	end
end

function CheckDirectDamage(WeaponDamage, Caliber, Point, Distance, ZoneId)
	CheckDamage(WeaponDamage);
end

function CheckSplashDamageZones(DetonationDamage, Caliber, Zones)
	for k,v in pairs(Zones) do
		CheckDamage(DetonationDamage * v.DistanceFactor)
	end
end

function Debug()
	ScreenWarning(object.desc.Class..", desc "..object.desc.DescFileName..", hp="..object.GetHealth())
end
