本文整理汇总了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)
示例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
示例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()