def onUnitBuilt(self, argsList):
'Unit Completed'
pCity = argsList[0]
pUnit = argsList[1]
pPlayer = gc.getPlayer(pUnit.getOwner())
if ( pCity.getNumActiveBuilding(gc.getInfoTypeForString('BUILDING_FLAVIAN_AMPHITHEATRE'))==true ):
### FA_chance = Chance in % to get a Unique Unit (UU) of the same Unitclass instead of the Standart Unit (SU) ###
FA_chance = 50
chance = CyGame().getSorenRandNum(100, "Random for UU")
if (chance < FA_chance):
iUnitClassType = pUnit.getUnitClassType()
### Same UnitClass (UC) = UUs and/or EDUs ###
lgleicheUC = []
for i in range(gc.getNumUnitInfos()):
if ( gc.getUnitInfo(i).getUnitClassType() == iUnitClassType ):
lgleicheUC.append(i)
if ( len(lgleicheUC) >= 2 ):
### Choose the UnitClass UU (lgleicheUC[0] = Standard Unit) ###
chance = CyGame().getSorenRandNum(len(lgleicheUC) - 1, "Random for UU")
iNewUU = lgleicheUC[chance + 1]
### Check (not replace UU with same UU) ###
iUnitType = pUnit.getUnitType()
if ( iUnitType != iNewUU ):
### Create/Converte Unit ###
iX = pUnit.getX()
iY = pUnit.getY()
pNewUnit = pPlayer.initUnit( iNewUU, iX, iY, UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION )
pNewUnit.convert(pUnit)
### Ausgabe ###
UnitInfo = gc.getUnitInfo(iUnitType)
UnitInfo2 = gc.getUnitInfo(iNewUU)
CyInterface().addMessage(pPlayer.getID(),false,15,CyTranslator().getText("TXT_KEY_FLAVIAN_AMPHITHEATRE_GAMETXT1",( pCity.getName(), UnitInfo2.getDescription(), UnitInfo.getDescription() )),'',0,'art/Interface/Buttons/Buildings/Flavian.dds',ColorTypes(11),iX,iY,True,True)
### message: In %s1 the Flavian Amphitheatre provides a %s2 instead of a %s3 ###