当前位置: 首页>>代码示例>>Python>>正文


Python IDataHolder.combatPwr方法代码示例

本文整理汇总了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]
开发者ID:OuterDeepSpace,项目名称:OuterDeepSpace,代码行数:50,代码来源:IFleet.py

示例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
开发者ID:ospaceteam,项目名称:outerspace,代码行数:44,代码来源:ShipUtils.py


注:本文中的ige.IDataHolder.IDataHolder.combatPwr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。