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


Python ModifiedAttributeDict.getResistance方法代码示例

本文整理汇总了Python中eos.modifiedAttributeDict.ModifiedAttributeDict.getResistance方法的典型用法代码示例。如果您正苦于以下问题:Python ModifiedAttributeDict.getResistance方法的具体用法?Python ModifiedAttributeDict.getResistance怎么用?Python ModifiedAttributeDict.getResistance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eos.modifiedAttributeDict.ModifiedAttributeDict的用法示例。


在下文中一共展示了ModifiedAttributeDict.getResistance方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: handler

# 需要导入模块: from eos.modifiedAttributeDict import ModifiedAttributeDict [as 别名]
# 或者: from eos.modifiedAttributeDict.ModifiedAttributeDict import getResistance [as 别名]
def handler(fit, module, context, **kwargs):
    if "projected" in context:
        # jam formula: 1 - (1- (jammer str/ship str))^(# of jam mods with same str))
        strModifier = 1 - module.getModifiedItemAttr("scan{0}StrengthBonus".format(fit.scanType)) / fit.scanStrength

        if 'effect' in kwargs:
            strModifier *= ModifiedAttributeDict.getResistance(fit, kwargs['effect'])

        fit.ecmProjectedStr *= strModifier
开发者ID:Sectoid,项目名称:Pyfa,代码行数:11,代码来源:doomsdayaoeecm.py

示例2: handler

# 需要导入模块: from eos.modifiedAttributeDict import ModifiedAttributeDict [as 别名]
# 或者: from eos.modifiedAttributeDict.ModifiedAttributeDict import getResistance [as 别名]
def handler(fit, src, context, **kwargs):
    if "projected" in context:
        amount = src.getModifiedItemAttr("powerTransferAmount")
        duration = src.getModifiedItemAttr("duration")

        if 'effect' in kwargs:
            amount *= ModifiedAttributeDict.getResistance(fit, kwargs['effect'])

        fit.addDrain(src, duration, -amount, 0)
开发者ID:Sectoid,项目名称:Pyfa,代码行数:11,代码来源:shipmoduleremotecapacitortransmitter.py

示例3: handler

# 需要导入模块: from eos.modifiedAttributeDict import ModifiedAttributeDict [as 别名]
# 或者: from eos.modifiedAttributeDict.ModifiedAttributeDict import getResistance [as 别名]
def handler(fit, src, context, **kwargs):
    if "projected" in context:
        amount = src.getModifiedItemAttr("{}Amount".format(prefix)) * src.amountActive
        time = src.getModifiedItemAttr("{}Duration".format(prefix))

        if 'effect' in kwargs:
            amount *= ModifiedAttributeDict.getResistance(fit, kwargs['effect'])

        fit.addDrain(src, time, amount, 0)
开发者ID:copyliu,项目名称:Pyfa,代码行数:11,代码来源:fighterabilityenergyneutralizer.py

示例4: handler

# 需要导入模块: from eos.modifiedAttributeDict import ModifiedAttributeDict [as 别名]
# 或者: from eos.modifiedAttributeDict.ModifiedAttributeDict import getResistance [as 别名]
def handler(fit, module, context, **kwargs):
    if "projected" not in context:
        return
    # jam formula: 1 - (1- (jammer str/ship str))^(# of jam mods with same str))
    strModifier = 1 - (module.getModifiedItemAttr("{}Strength{}".format(prefix, fit.scanType)) * module.amountActive) / fit.scanStrength

    if 'effect' in kwargs:
        strModifier *= ModifiedAttributeDict.getResistance(fit, kwargs['effect'])

    fit.ecmProjectedStr *= strModifier
开发者ID:Sectoid,项目名称:Pyfa,代码行数:12,代码来源:fighterabilityecm.py

示例5: handler

# 需要导入模块: from eos.modifiedAttributeDict import ModifiedAttributeDict [as 别名]
# 或者: from eos.modifiedAttributeDict.ModifiedAttributeDict import getResistance [as 别名]
def handler(fit, src, context, **kwargs):
    if "projected" in context and ((hasattr(src, "state") and src.state >= State.ACTIVE) or
                                    hasattr(src, "amountActive")):
        amount = src.getModifiedItemAttr("energyNeutralizerAmount")
        time = src.getModifiedItemAttr("energyNeutralizerDuration")

        if 'effect' in kwargs:
            amount *= ModifiedAttributeDict.getResistance(fit, kwargs['effect'])

        fit.addDrain(src, time, amount, 0)
开发者ID:PaulKPetersonCO,项目名称:Pyfa,代码行数:12,代码来源:entityenergyneutralizerfalloff.py

示例6: handler

# 需要导入模块: from eos.modifiedAttributeDict import ModifiedAttributeDict [as 别名]
# 或者: from eos.modifiedAttributeDict.ModifiedAttributeDict import getResistance [as 别名]
def handler(fit, src, context, **kwargs):
    amount = src.getModifiedItemAttr("powerTransferAmount")
    time = src.getModifiedItemAttr("duration")

    if 'effect' in kwargs:
        amount *= ModifiedAttributeDict.getResistance(fit, kwargs['effect'])

    if "projected" in context:
        fit.addDrain(src, time, amount, 0)
    elif "module" in context:
        src.itemModifiedAttributes.force("capacitorNeed", -amount)
开发者ID:PaulKPetersonCO,项目名称:Pyfa,代码行数:13,代码来源:energynosferatufalloff.py


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