本文整理汇总了Python中ige.IDataHolder.IDataHolder.combatPwr方法的典型用法代码示例。如果您正苦于以下问题:Python IDataHolder.combatPwr方法的具体用法?Python IDataHolder.combatPwr怎么用?Python IDataHolder.combatPwr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ige.IDataHolder.IDataHolder
的用法示例。
在下文中一共展示了IDataHolder.combatPwr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getScanInfos
# 需要导入模块: from ige.IDataHolder import IDataHolder [as 别名]
# 或者: from ige.IDataHolder.IDataHolder import combatPwr [as 别名]
def getScanInfos(self, tran, obj, scanPwr, player):
if obj.owner == player.oid:
return []
if scanPwr >= Rules.level1InfoScanPwr:
result = IDataHolder()
result._type = T_SCAN
result.scanPwr = scanPwr
result.oid = obj.oid
result.x = obj.x
result.y = obj.y
result.oldX = obj.oldX
result.oldY = obj.oldY
result.eta = obj.eta
result.signature = obj.signature
result.type = obj.type
result.orbiting = obj.orbiting
if obj.orbiting == OID_NONE and obj.actionIndex < len(obj.actions):
target = obj.actions[obj.actionIndex][1]
targetObj = tran.db[target]
if targetObj.type == T_PLANET:
result.target = targetObj.compOf
else:
result.target = target
else:
return []
if scanPwr >= Rules.level2InfoScanPwr:
result.owner = obj.owner
if obj.customname:
result.name = obj.customname
else:
result.name = obj.name
if scanPwr >= Rules.level3InfoScanPwr:
result.isMilitary = obj.isMilitary
result.combatPwr = obj.combatPwr
if scanPwr >= Rules.level4InfoScanPwr:
# provide less information
result.shipScan = {}
owner = tran.db[obj.owner]
for designID, hp, shield, exp in obj.ships:
tech = owner.shipDesigns[designID]
key = tech.name, tech.combatClass, tech.isMilitary
result.shipScan[key] = result.shipScan.get(key, 0) + 1
if scanPwr >= Rules.partnerScanPwr:
result.scannerPwr = obj.scannerPwr
result.allowmerge = obj.allowmerge
result.customname = obj.customname
result.name = obj.name
return [result]
示例2: makeShipMinSpec
# 需要导入模块: from ige.IDataHolder import IDataHolder [as 别名]
# 或者: from ige.IDataHolder.IDataHolder import combatPwr [as 别名]
def makeShipMinSpec(player, name, hullID, eqIDs, improvements,
raiseExs = True):
ship = makeShipFullSpec(player, name, hullID, eqIDs, improvements, raiseExs)
# make 'real' ship spec
spec = IDataHolder()
spec.type = Const.T_SHIP
spec.name = ship.name
spec.hullID = ship.hullID
spec.level = ship.level
spec.eqIDs = ship.eqIDs
spec.improvements = ship.improvements
spec.combatClass = ship.combatClass
spec.signature = ship.signature
spec.scannerPwr = ship.scannerPwr
spec.speed = ship.speed
spec.battleSpeed = ship.battleSpeed
spec.maxHP = ship.maxHP
spec.shieldHP = ship.shieldHP
spec.combatAtt = ship.combatAtt
spec.combatDef = ship.combatDef
spec.missileDef = ship.missileDef
spec.storEn = ship.storEn
spec.operEn = ship.operEn
spec.buildProd = ship.buildProd
spec.buildSRes = ship.buildSRes
spec.weaponIDs = ship.weaponIDs
spec.deployStructs = ship.deployStructs
spec.deployHandlers = ship.deployHandlers
spec.built = 0
spec.buildTurns = 1
spec.upgradeTo = 0
spec.isMilitary = ship.isMilitary
spec.baseExp = ship.baseExp
spec.combatPwr = ship.combatPwr
spec.autoRepairFix = ship.autoRepairFix
spec.autoRepairPerc = ship.autoRepairPerc
spec.shieldRechargeFix = ship.shieldRechargeFix
spec.shieldRechargePerc = ship.shieldRechargePerc
spec.hardShield = ship.hardShield
spec.combatAttMultiplier = ship.combatAttMultiplier
spec.damageAbsorb = ship.damageAbsorb
return spec