本文整理匯總了Python中PlayerUtil.getActiveTeamAndID方法的典型用法代碼示例。如果您正苦於以下問題:Python PlayerUtil.getActiveTeamAndID方法的具體用法?Python PlayerUtil.getActiveTeamAndID怎麽用?Python PlayerUtil.getActiveTeamAndID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PlayerUtil
的用法示例。
在下文中一共展示了PlayerUtil.getActiveTeamAndID方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: checkIfIsAnyOrHasMetAllTeams
# 需要導入模塊: import PlayerUtil [as 別名]
# 或者: from PlayerUtil import getActiveTeamAndID [as 別名]
def checkIfIsAnyOrHasMetAllTeams(self, *eTeams):
"""
Calls check() only if the active team is any or has met all of the given teams.
"""
eActiveTeam, activeTeam = PlayerUtil.getActiveTeamAndID()
for eTeam in eTeams:
if eActiveTeam != eTeam and not activeTeam.isHasMet(eTeam):
return
self.check()
示例2: check
# 需要導入模塊: import PlayerUtil [as 別名]
# 或者: from PlayerUtil import getActiveTeamAndID [as 別名]
def check(self):
#DLP
if CyGame().isPitbossHost():
return
if (not Civ4lertsOpt.isShowWorstEnemyAlert()):
return
eActivePlayer = PlayerUtil.getActivePlayerID()
eActiveTeam, activeTeam = PlayerUtil.getActiveTeamAndID()
enemies = self.enemies[eActivePlayer]
newEnemies = AttitudeUtil.getWorstEnemyTeams()
delayedMessages = {}
for eTeam, eNewEnemy in newEnemies.iteritems():
if activeTeam.isHasMet(eTeam):
eOldEnemy = enemies[eTeam]
if eOldEnemy != -1 and not gc.getTeam(eOldEnemy).isAlive():
eOldEnemy = -1
enemies[eTeam] = -1
if eActiveTeam != eNewEnemy and not activeTeam.isHasMet(eNewEnemy):
eNewEnemy = -1
if eOldEnemy != eNewEnemy:
enemies[eTeam] = eNewEnemy
if eNewEnemy == -1:
if eOldEnemy == eActiveTeam:
message = BugUtil.getText("TXT_KEY_CIV4LERTS_ON_YOU_NO_WORST_ENEMY", gc.getTeam(eTeam).getName())
else:
message = BugUtil.getText("TXT_KEY_CIV4LERTS_ON_NO_WORST_ENEMY",
(gc.getTeam(eTeam).getName(), gc.getTeam(eOldEnemy).getName()))
elif eOldEnemy == -1:
message = None # handled below
if eNewEnemy not in delayedMessages:
delayedMessages[eNewEnemy] = gc.getTeam(eTeam).getName()
else:
delayedMessages[eNewEnemy] += u", " + gc.getTeam(eTeam).getName()
else:
if eOldEnemy == eActiveTeam:
message = BugUtil.getText("TXT_KEY_CIV4LERTS_ON_SWITCH_WORST_ENEMY_FROM_YOU",
(gc.getTeam(eTeam).getName(), gc.getTeam(eNewEnemy).getName()))
elif eNewEnemy == eActiveTeam:
message = BugUtil.getText("TXT_KEY_CIV4LERTS_ON_SWITCH_WORST_ENEMY_TO_YOU",
(gc.getTeam(eTeam).getName(), gc.getTeam(eOldEnemy).getName()))
else:
message = BugUtil.getText("TXT_KEY_CIV4LERTS_ON_SWITCH_WORST_ENEMY",
(gc.getTeam(eTeam).getName(), gc.getTeam(eNewEnemy).getName(), gc.getTeam(eOldEnemy).getName()))
if message:
addMessageNoIcon(eActivePlayer, message)
for eEnemy, haters in delayedMessages.iteritems():
if eActiveTeam == eEnemy:
message = BugUtil.getText("TXT_KEY_CIV4LERTS_ON_YOU_WORST_ENEMY", haters)
else:
message = BugUtil.getText("TXT_KEY_CIV4LERTS_ON_WORST_ENEMY", (haters, gc.getTeam(eEnemy).getName()))
addMessageNoIcon(eActivePlayer, message)