本文整理汇总了Python中ige.IDataHolder.IDataHolder.missileDefBase方法的典型用法代码示例。如果您正苦于以下问题:Python IDataHolder.missileDefBase方法的具体用法?Python IDataHolder.missileDefBase怎么用?Python IDataHolder.missileDefBase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ige.IDataHolder.IDataHolder
的用法示例。
在下文中一共展示了IDataHolder.missileDefBase方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: makeShipFullSpec
# 需要导入模块: from ige.IDataHolder import IDataHolder [as 别名]
# 或者: from ige.IDataHolder.IDataHolder import missileDefBase [as 别名]
def makeShipFullSpec(player, name, hullID, eqIDs, improvements, raiseExs = True):
if not hullID:
raise GameException("Ship's hull must be specified.")
hull = Rules.techs[hullID]
if not hull.isShipHull:
raise GameException("Ship's hull must be specified.")
ship = IDataHolder()
ship.type = Const.T_SHIP
# initial values
hullTechEff = Rules.techImprEff[player.techs.get(hullID, Rules.techBaseImprovement)]
ship.name = name
ship.hullID = hullID
ship.eqIDs = eqIDs
ship.level = hull.level
ship.combatClass = hull.combatClass
ship.improvements = improvements
ship.buildProd = hull.buildProd
ship.buildSRes = copy.copy(hull.buildSRes)
# stats grouped as "Base"
ship.operEn = hull.operEn
ship.storEn = hull.storEn * hullTechEff
ship.weight = hull.weight
ship.slots = 0
ship.scannerPwr = max(hull.scannerPwr * hullTechEff, Rules.scannerMinPwr)
ship.engPwr = 0
ship.engStlPwr = 0
ship.speed = 0.0
ship.battleSpeed = 0.0
# stats grouped as "Signature"
ship.signature = hull.signature
ship.negsignature = 0
ship.minSignature = hull.minSignature
ship.signatureCloak = 1.0
ship.signatureDecloak = 1.0
# stats grouped as "Combat"
ship.combatAttBase = hull.combatAtt * hullTechEff
ship.combatAtt = 0
ship.combatAttMultiplier = 1.0
ship.combatDefBase = hull.combatDef * hullTechEff
ship.combatDef = 0
ship.combatDefMultiplier = 1.0
ship.missileDefBase = hull.missileDef * hullTechEff
ship.missileDef = 0
ship.missileDefMultiplier = 1.0
ship.weaponIDs = []
ship.isMilitary = 0
ship.baseExp = 0
combatExtra = 0
# stats grouped as "Sturdiness"
ship.autoRepairFix = hull.autoRepairFix
ship.autoRepairPerc = hull.autoRepairPerc
ship.shieldRechargeFix = hull.shieldRechargeFix
ship.shieldRechargePerc = hull.shieldRechargePerc
ship.hardShield = 0.0
ship.shieldHP = 0
ship.maxHP = int(hull.maxHP * hullTechEff)
ship.damageAbsorb = 0
shieldPerc = 0.0
# stats grouped as "Deployables"
ship.deployStructs = []
ship.deployHandlers = []
ship.upgradeTo = 0
counter = {}
installations = {}
equipCounter = {}
for techID in eqIDs:
tech = Rules.techs[techID]
techEff = Rules.techImprEff[player.techs.get(techID, Rules.techBaseImprovement)]
if eqIDs[techID] < 0 and raiseExs:
raise GameException("Invalid equipment count (less than 0).")
for i in xrange(0, eqIDs[techID]):
counter[tech.subtype] = 1 + counter.get(tech.subtype, 0)
installations[techID] = 1 + installations.get(techID, 0)
_checkValidity(ship, tech, installations, equipCounter, raiseExs)
# add values
_moduleBase(ship, tech, techEff)
_moduleSignature(ship, tech)
_moduleCombat(ship, tech, techEff, combatExtra)
_moduleSturdiness(ship, tech, techEff, shieldPerc)
_moduleDeployables(ship, tech)
_checkValidityWhole(ship, hull, counter, raiseExs)
_finalizeBase(ship, hull)
_finalizeSignature(ship, hull)
_finalizeCombat(ship)
_finalizeSturdiness(ship, shieldPerc)
_setCombatPower(ship, combatExtra)
return ship