CaptainMidnight
Warlord
- Joined
- Apr 16, 2006
- Messages
- 141
I've been trying to convert tsentom "sea faring trait code" so that it only affects a unique unit. However, my python skills are akin to a monkey tampering with a clockwork device so I was hoping some one could help me out.
The aim is to have a unit that develops as new techs are acquired. I want to have a tech that increases movement and another to increase strength. Any help will be appreciated!
The aim is to have a unit that develops as new techs are acquired. I want to have a tech that increases movement and another to increase strength. Any help will be appreciated!
Code:
def onTechAcquired(self, argsList):
'Tech Acquired'
iTechType, iTeam, iPlayer, bAnnounce = argsList
# Note that iPlayer may be NULL (-1) and not a refer to a player object
# Show tech splash when applicable
if (iPlayer > -1 and bAnnounce and not CyInterface().noTechSplash()):
if (gc.getGame().isFinalInitialized() and not gc.getGame().GetWorldBuilderMode()):
if (iPlayer == CyGame().getActivePlayer()):
popupInfo = CyPopupInfo()
popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON_SCREEN)
popupInfo.setData1(iTechType)
popupInfo.setText(u"showTechSplash")
popupInfo.addPopup(iPlayer)
## Sea Trait Start ##
pPlayer = gc.getPlayer(iPlayer)
if iTechType == gc.getInfoTypeForString('TECH_ASTRONOMY'):
iSea = gc.getInfoTypeForString('UNIT_VENICE_GALLEAS')
pTeam = gc.getTeam(pPlayer.getTeam())
pTeam.changeExtraMoves(iSea, 1)
## Sea Trait End ##