當前位置: 首頁>>代碼示例>>Python>>正文


Python Power.artifact_power_randomized方法代碼示例

本文整理匯總了Python中the_tale.game.balance.power.Power.artifact_power_randomized方法的典型用法代碼示例。如果您正苦於以下問題:Python Power.artifact_power_randomized方法的具體用法?Python Power.artifact_power_randomized怎麽用?Python Power.artifact_power_randomized使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在the_tale.game.balance.power.Power的用法示例。


在下文中一共展示了Power.artifact_power_randomized方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: generate_artifact_from_list

# 需要導入模塊: from the_tale.game.balance.power import Power [as 別名]
# 或者: from the_tale.game.balance.power.Power import artifact_power_randomized [as 別名]
    def generate_artifact_from_list(self, artifacts_list, level, rarity):

        artifact_choices = []

        for artifact_record in artifacts_list:
            if artifact_record.state.is_ENABLED and artifact_record.accepted_for_level(level):
                artifact_choices.append(artifact_record)

        if not artifact_choices:
            return None

        artifact_record = random.choice(artifact_choices)

        if artifact_record.is_useless:
            power = Power(0, 0)
        else:
            power = Power.artifact_power_randomized(distribution=artifact_record.power_type.distribution,
                                                    level=level)

        return artifact_record.create_artifact(level=level,
                                               power=power,
                                               rarity=rarity)
開發者ID:Alkalit,項目名稱:the-tale,代碼行數:24,代碼來源:storage.py

示例2: purchase_artifact

# 需要導入模塊: from the_tale.game.balance.power import Power [as 別名]
# 或者: from the_tale.game.balance.power.Power import artifact_power_randomized [as 別名]
    def purchase_artifact(self, rarity, better):
        distribution = self.preferences.archetype.power_distribution

        power = Power.better_artifact_power_randomized(distribution, self.level) if better else Power.artifact_power_randomized(distribution, self.level)

        artifacts_storage.sync()

        artifact = random.choice(artifacts_storage.artifacts).create_artifact(level=self.level,
                                                                              power=power,
                                                                              rarity=rarity)
        self.put_loot(artifact, force=True)

        self.actions.request_replane()

        return artifact
開發者ID:Alkalit,項目名稱:the-tale,代碼行數:17,代碼來源:shop_accessors.py

示例3: increment_equipment_rarity

# 需要導入模塊: from the_tale.game.balance.power import Power [as 別名]
# 或者: from the_tale.game.balance.power.Power import artifact_power_randomized [as 別名]
 def increment_equipment_rarity(self, artifact):
     artifact.rarity = artifacts_relations.RARITY(artifact.rarity.value+1)
     artifact.power = Power.artifact_power_randomized(distribution=artifact.record.power_type.distribution,
                                                      level=self.level)
     artifact.max_integrity = int(artifact.rarity.max_integrity * random.uniform(1-c.ARTIFACT_MAX_INTEGRITY_DELTA, 1+c.ARTIFACT_MAX_INTEGRITY_DELTA))
     self.reset_accessors_cache()
開發者ID:,項目名稱:,代碼行數:8,代碼來源:


注:本文中的the_tale.game.balance.power.Power.artifact_power_randomized方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。