def onGoodyReceived(self, argsList):
'Goody received'
iPlayer, pPlot, pUnit, iGoodyType = argsList
####An Land gehen start
if pPlot.isWater():
if iGoodyType in (gc.getInfoTypeForString("GOODY_WARRIOR"), gc.getInfoTypeForString("GOODY_SETTLER"), gc.getInfoTypeForString("GOODY_ENTDECKER"), gc.getInfoTypeForString("GOODY_SCHRIFTSTUECKE"), gc.getInfoTypeForString("GOODY_KUNSTWERK"), gc.getInfoTypeForString("GOODY_ARTEFAKT"), gc.getInfoTypeForString("GOODY_RELIC"), gc.getInfoTypeForString("GOODY_SCHATZ"), gc.getInfoTypeForString("GOODY_SCOUT"), gc.getInfoTypeForString("GOODY_WORKER"), gc.getInfoTypeForString("GOODY_SLAVE")):
iMaxPlotUnit = pPlot.getNumUnits ()-1
for i in xrange(iMaxPlotUnit,-1,-1):
pPlotUnit = pPlot.getUnit(i)
if pPlotUnit.getDomainType () == gc.getInfoTypeForString("DOMAIN_LAND"):
pPlotUnit.jumpToNearestValidPlot()
###An Land gehen end
### barb transform start
if iGoodyType in (gc.getInfoTypeForString("GOODY_BARBARIANS_WEAK"), gc.getInfoTypeForString("GOODY_BARBARIANS_STRONG")):
iX = pPlot.getX()
iY = pPlot.getY()
for iXLoop in xrange(iX-1,iX+2,1):
for iYLoop in xrange(iY-1,iY+2,1):
NewPlot = CyMap().plot(iXLoop,iYLoop)
if NewPlot.isUnit() and NewPlot.isWater():
iMaxPlotUnit = NewPlot.getNumUnits ()-1
for i in xrange(iMaxPlotUnit,-1,-1):
pPlotUnit = NewPlot.getUnit(i)
if pPlotUnit.isBarbarian() and pPlotUnit.getDomainType () == gc.getInfoTypeForString("DOMAIN_LAND"):
newUnit = gc.getPlayer(gc.getBARBARIAN_PLAYER ()).initUnit(gc.getInfoTypeForString("UNIT_TRIREME"), iXLoop,iYLoop, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
pPlotUnit.setDamage(100, False)
###barb transform end
if (not self.__LOG_GOODYRECEIVED):
return
CvUtil.pyPrint('%s received a goody' %(gc.getPlayer(iPlayer).getCivilizationDescription(0)),)