-- Now place this wonder and record the placement.
plot:SetFeatureType(feature_type_to_place)
table.insert(self.placed_natural_wonder, wonder_number);
self:PlaceResourceImpact(x, y, 6, math.floor(iH / 8)) -- Natural Wonders layer -- adan_eslavo (was 5)
self:PlaceResourceImpact(x, y, 1, 1) -- Strategic layer
self:PlaceResourceImpact(x, y, 2, 1) -- Luxury layer
self:PlaceResourceImpact(x, y, 3, 1) -- Bonus layer
self:PlaceResourceImpact(x, y, 5, 3) -- City State layer
self:PlaceResourceImpact(x, y, 7, 1) -- Marble layer
local plotIndex = y * iW + x + 1;
self.playerCollisionData[plotIndex] = true -- Record exact plot of wonder in the collision list.
-- MOD.Barathor: Fixed: Added a check for the Great Barrier Reef being placed. If so, it appropriately applies impact values to its second tile to avoid buggy collisions with water resources.
-- MOD.Barathor: Start
-- MOD.adan_eslavo: adaptation to 3-tile GBR (now tiles around center blocked);
if (self.wonder_list[wonder_number] == "FEATURE_REEF") then
--print("Great Barrier Reef placed... applying impact values to its southeast tile as well.")
for i = 0, DirectionTypes.NUM_DIRECTION_TYPES - 1 do
local pBarrierPlot = Map.PlotDirection(x, y, i)
if pBarrierPlot:GetFeatureType() == GameInfoTypes.FEATURE_REEF then
local iBarrierX = pBarrierPlot:GetX()
local iBarrierY = pBarrierPlot:GetY()
self:PlaceResourceImpact(iBarrierX, iBarrierY, 1, 1) -- Strategic layer
self:PlaceResourceImpact(iBarrierX, iBarrierY, 2, 1) -- Luxury layer
self:PlaceResourceImpact(iBarrierX, iBarrierY, 3, 1) -- Bonus layer
local iBarrierPlotIndex = iBarrierY * iW + iBarrierX + 1
self.playerCollisionData[iBarrierPlotIndex] = true -- Record exact plot of wonder in the collision list.
end
end
elseif (self.wonder_list[wonder_number] == "FEATURE_SALAR_A") then
for i = 0, DirectionTypes.NUM_DIRECTION_TYPES - 1 do
local pSalarPlot = Map.PlotDirection(x, y, i)
if pSalarPlot:GetFeatureType() == GameInfoTypes.FEATURE_SALAR_B then
local iSalarX = pSalarPlot:GetX()
local iSalarY = pSalarPlot:GetY()
self:PlaceResourceImpact(iSalarX, iSalarY, 1, 1) -- Strategic layer
self:PlaceResourceImpact(iSalarX, iSalarY, 2, 1) -- Luxury layer
self:PlaceResourceImpact(iSalarX, iSalarY, 3, 1) -- Bonus layer
local iSalarPlotIndex = iSalarY * iW + iSalarX + 1
self.playerCollisionData[iSalarPlotIndex] = true -- Record exact plot of wonder in the collision list.
break
end
end
elseif (self.wonder_list[wonder_number] == "FEATURE_BERMUDA_A") then
local pBermudaPlotSE = Map.PlotDirection(x, y, DirectionTypes.DIRECTION_SOUTHEAST)
local pBermudaPlotSW = Map.PlotDirection(x, y, DirectionTypes.DIRECTION_SOUTHWEST)
local iBermudaX = pBermudaPlotSE:GetX()
local iBermudaY = pBermudaPlotSE:GetY()
self:PlaceResourceImpact(iBermudaX, iBermudaY, 1, 1) -- Strategic layer
self:PlaceResourceImpact(iBermudaX, iBermudaY, 2, 1) -- Luxury layer
self:PlaceResourceImpact(iBermudaX, iBermudaY, 3, 1) -- Bonus layer
local iBermudaPlotIndex = iBermudaY * iW + iBermudaX + 1
self.playerCollisionData[iBermudaPlotIndex] = true -- Record exact plot of wonder in the collision list.
local iBermudaX = pBermudaPlotSW:GetX()
local iBermudaY = pBermudaPlotSW:GetY()
self:PlaceResourceImpact(iBermudaX, iBermudaY, 1, 1) -- Strategic layer
self:PlaceResourceImpact(iBermudaX, iBermudaY, 2, 1) -- Luxury layer
self:PlaceResourceImpact(iBermudaX, iBermudaY, 3, 1) -- Bonus layer
local iBermudaPlotIndex = iBermudaY * iW + iBermudaX + 1
self.playerCollisionData[iBermudaPlotIndex] = true -- Record exact plot of wonder in the collision list.
elseif (self.wonder_list[wonder_number] == "FEATURE_CAUSEWAY_A") then
for i = 0, DirectionTypes.NUM_DIRECTION_TYPES - 1 do
local pCausewayPlot = Map.PlotDirection(x, y, i)
if pCausewayPlot:GetFeatureType() == GameInfoTypes.FEATURE_CAUSEWAY_B then
local iCausewayX = pCausewayPlot:GetX()
local iCausewayY = pCausewayPlot:GetY()
self:PlaceResourceImpact(iCausewayX, iCausewayY, 1, 1) -- Strategic layer
self:PlaceResourceImpact(iCausewayX, iCausewayY, 2, 1) -- Luxury layer
self:PlaceResourceImpact(iCausewayX, iCausewayY, 3, 1) -- Bonus layer
local iCausewayPlotIndex = iCausewayY * iW + iCausewayX + 1
self.playerCollisionData[iCausewayPlotIndex] = true -- Record exact plot of wonder in the collision list.
break
end
end
end
-- MOD.Barathor: End