function TNTWorker(iPlayer, iUnit, iUnitType, iByCiv)
print("TNTWorker called")
local pPlayer = Players[iPlayer]
local pUnit = pPlayer:GetUnitByID(iUnit)
print( tostring(pPlayer:GetCivilizationType()) )
print( tostring(GameInfoTypes["CIVILIZATION_ALTJAPAN"]) )
print( tostring(pUnit) )
if iUnitType == GameInfoTypes["UNIT_WORKER"] then
print("Is worker...")
local pPlot = pUnit:GetPlot()
if pPlayer:GetCivilizationType() == GameInfoTypes["CIVILIZATION_ALTJAPAN"] then
print("...from AltJapan")
--pUnit:Kill(false, -1) --with or without the kill here, it still doesn't work.
local pPlotUnit = pPlot:GetUnit()
print( tostring(iByCiv) )
print( tostring(iPlayer) )
pPlotUnit:Kill(false, -1)
for direction = 0, DirectionTypes.NUM_DIRECTION_TYPES - 1, 1 do
local pAdjacentPlot = Map.PlotDirection(pPlot:GetX(), pPlot:GetY(), direction)
if pAdjacentPlot and pAdjacentPlot:IsUnit() then
local damUnit = pAdjacentPlot:GetUnit()
damUnit:ChangeDamage(-15, -1)
end
end
end
end
end