local function DoLivingTerrainSpread(fromPlot, toPlot, fromType, fromStrength)
local toType, toPresent, toStrength, toTurnChopped = toPlot:GetLivingTerrainData()
if toType == -1 or toStrength < 5 then
LivingTerrainGrowHere(toPlot:GetPlotIndex(), fromType)
toPlot:SetLivingTerrainData(fromType, true, 1, -100)
fromStrength = fromStrength - 1
fromPlot:[COLOR="Blue"]SetLivingTerrainStrength[/COLOR](fromStrength)
print("Living terrain has spread to an adjacent (non-living or not very strong) tile ", fromPlot:GetPlotIndex(), fromStrength, toPlot:GetPlotIndex())
else
--may have conflict between spread type and old (currently absent) type; don't want to kill a stronger terrain that was just chopped, so regrow it as own type
if fromType == toType or fromStrength < toStrength + 5 then --re-grow as own type
LivingTerrainGrowHere(toPlot:GetPlotIndex(), toType)
toPlot:SetLivingTerrainData(toType, true, toStrength, toTurnChopped)
print("Living terrain has re-awakened an adjacent tile: ", fromPlot:GetPlotIndex(), toPlot:GetPlotIndex())
else --type must be consistent with current feature or chops get very messy
LivingTerrainGrowHere(toPlot:GetPlotIndex(), fromType)
toPlot:SetLivingTerrainData(fromType, true, toStrength + 1, toTurnChopped)
fromStrength = fromStrength - 1
fromPlot:[COLOR="blue"]SetLivingTerrainStrength[/COLOR](fromStrength)
print("Living terrain has awakened and converted an adjacent (currently absent) living tile ", fromPlot:GetPlotIndex(), toPlot:GetPlotIndex())
print("Was, ", toType, true, toStrength, toTurnChopped)
print("Is now: ", fromType, true, toStrength+1, toTurnChopped)
end
end
return fromStrength
end