def minesReport((damageCaused, killsCaused, minesTriggered)): lines = [] techs = minesTriggered.keys() for techID in techs: techName = client.getTechInfo(techID).name.encode() text = _('%d of the %s detonated, causing %d damage, killing %d ships in the process.') %\ (minesTriggered[techID], techName, damageCaused.get(techID, 0), killsCaused.get(techID, 0)) lines.append(text) return '\n'.join(lines)
def techID2Name(techID): if techID >= 1000: return _(client.getTechInfo(techID).name.encode()) else: return client.getPlayer().shipDesigns[techID].name