本文整理汇总了Python中the_tale.game.heroes.relations.MODIFIERS.random方法的典型用法代码示例。如果您正苦于以下问题:Python MODIFIERS.random方法的具体用法?Python MODIFIERS.random怎么用?Python MODIFIERS.random使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类the_tale.game.heroes.relations.MODIFIERS
的用法示例。
在下文中一共展示了MODIFIERS.random方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_witchcraft
# 需要导入模块: from the_tale.game.heroes.relations import MODIFIERS [as 别名]
# 或者: from the_tale.game.heroes.relations.MODIFIERS import random [as 别名]
def test_witchcraft(self):
self.assertEqual(companions.WITCHCRAFT().modify_attribute(MODIFIERS.COMPANION_UNUSUAL_HEAL, 0), 0.0462962962962963)
self.assertEqual(companions.WITCHCRAFT().modify_attribute(MODIFIERS.random(exclude=(MODIFIERS.COMPANION_UNUSUAL_HEAL,)), 0), 0)
self.assertEqual(self.hero.companion_unusual_heal_probability, 0)
self.hero.abilities.add(companions.WITCHCRAFT.get_id(), 3)
self.assertEqual(self.hero.companion_unusual_heal_probability, 0.1388888888888889)
示例2: test_coherence
# 需要导入模块: from the_tale.game.heroes.relations import MODIFIERS [as 别名]
# 或者: from the_tale.game.heroes.relations.MODIFIERS import random [as 别名]
def test_coherence(self):
self.assertEqual(companions.COHERENCE().modify_attribute(MODIFIERS.COMPANION_MAX_COHERENCE, 0), 20)
self.assertEqual(companions.COHERENCE().modify_attribute(MODIFIERS.random(exclude=(MODIFIERS.COMPANION_MAX_COHERENCE,)), 1), 1)
self.assertEqual(self.hero.companion_max_coherence, 20) # coherence lvl 1 — default hero ability
self.hero.abilities.add(companions.COHERENCE.get_id(), 3)
self.assertEqual(self.hero.companion_max_coherence, 60)
示例3: test_service
# 需要导入模块: from the_tale.game.heroes.relations import MODIFIERS [as 别名]
# 或者: from the_tale.game.heroes.relations.MODIFIERS import random [as 别名]
def test_service(self):
self.assertEqual(companions.SERVICE().modify_attribute(MODIFIERS.COMPANION_CONSTRUCT_COHERENCE_SPEED, 1), 1.2)
self.assertEqual(companions.SERVICE().modify_attribute(MODIFIERS.random(exclude=(MODIFIERS.COMPANION_CONSTRUCT_COHERENCE_SPEED,)), 1), 1)
self.assertEqual(self.hero.companion_construct_coherence_speed, 1)
self.hero.abilities.add(companions.SERVICE.get_id(), 3)
self.assertEqual(self.hero.companion_construct_coherence_speed, 1.6)
示例4: test_thoughtful
# 需要导入模块: from the_tale.game.heroes.relations import MODIFIERS [as 别名]
# 或者: from the_tale.game.heroes.relations.MODIFIERS import random [as 别名]
def test_thoughtful(self):
self.assertEqual(companions.THOUGHTFUL().modify_attribute(MODIFIERS.COMPANION_MAX_HEALTH, 1.0), 1.1)
self.assertEqual(companions.THOUGHTFUL().modify_attribute(MODIFIERS.random(exclude=(MODIFIERS.COMPANION_MAX_HEALTH,)), 1), 1)
self.assertEqual(self.hero.companion_max_health_multiplier, 1)
self.hero.abilities.add(companions.THOUGHTFUL.get_id(), 3)
self.assertEqual(self.hero.companion_max_health_multiplier, 1.3)
示例5: test_mage_mechanincs
# 需要导入模块: from the_tale.game.heroes.relations import MODIFIERS [as 别名]
# 或者: from the_tale.game.heroes.relations.MODIFIERS import random [as 别名]
def test_mage_mechanincs(self):
self.assertEqual(companions.MAGE_MECHANICS().modify_attribute(MODIFIERS.COMPANION_CONSTRUCT_HEAL, 0), 0.0462962962962963)
self.assertEqual(companions.MAGE_MECHANICS().modify_attribute(MODIFIERS.random(exclude=(MODIFIERS.COMPANION_CONSTRUCT_HEAL,)), 0), 0)
self.assertEqual(self.hero.companion_construct_heal_probability, 0)
self.hero.abilities.add(companions.MAGE_MECHANICS.get_id(), 3)
self.assertEqual(self.hero.companion_construct_heal_probability, 0.1388888888888889)
示例6: test_sociability
# 需要导入模块: from the_tale.game.heroes.relations import MODIFIERS [as 别名]
# 或者: from the_tale.game.heroes.relations.MODIFIERS import random [as 别名]
def test_sociability(self):
self.assertEqual(companions.SOCIABILITY().modify_attribute(MODIFIERS.COMPANION_LIVING_COHERENCE_SPEED, 1), 1.2)
self.assertEqual(companions.SOCIABILITY().modify_attribute(MODIFIERS.random(exclude=(MODIFIERS.COMPANION_LIVING_COHERENCE_SPEED,)), 1), 1)
self.assertEqual(self.hero.companion_living_coherence_speed, 1)
self.hero.abilities.add(companions.SOCIABILITY.get_id(), 3)
self.assertEqual(self.hero.companion_living_coherence_speed, 1.6)
示例7: test_healing
# 需要导入模块: from the_tale.game.heroes.relations import MODIFIERS [as 别名]
# 或者: from the_tale.game.heroes.relations.MODIFIERS import random [as 别名]
def test_healing(self):
self.assertEqual(companions.HEALING().modify_attribute(MODIFIERS.COMPANION_LIVING_HEAL, 0), 0.0462962962962963)
self.assertEqual(companions.HEALING().modify_attribute(MODIFIERS.random(exclude=(MODIFIERS.COMPANION_LIVING_HEAL,)), 0), 0)
self.assertEqual(self.hero.companion_living_heal_probability, 0)
self.hero.abilities.add(companions.HEALING.get_id(), 3)
self.assertEqual(self.hero.companion_living_heal_probability, 0.1388888888888889)
示例8: test_sacredness
# 需要导入模块: from the_tale.game.heroes.relations import MODIFIERS [as 别名]
# 或者: from the_tale.game.heroes.relations.MODIFIERS import random [as 别名]
def test_sacredness(self):
self.assertEqual(companions.SACREDNESS().modify_attribute(MODIFIERS.COMPANION_UNUSUAL_COHERENCE_SPEED, 1), 1.2)
self.assertEqual(companions.SACREDNESS().modify_attribute(MODIFIERS.random(exclude=(MODIFIERS.COMPANION_UNUSUAL_COHERENCE_SPEED,)), 1), 1)
self.assertEqual(self.hero.companion_unusual_coherence_speed, 1)
self.hero.abilities.add(companions.SACREDNESS.get_id(), 3)
self.assertEqual(self.hero.companion_unusual_coherence_speed, 1.6)
示例9: test_economic
# 需要导入模块: from the_tale.game.heroes.relations import MODIFIERS [as 别名]
# 或者: from the_tale.game.heroes.relations.MODIFIERS import random [as 别名]
def test_economic(self):
self.assertEqual(companions.ECONOMIC().modify_attribute(MODIFIERS.COMPANION_ABILITIES_LEVELS, {}),
{companions_abilities_relations.METATYPE.MONEY: 1})
self.assertEqual(companions.ECONOMIC().modify_attribute(MODIFIERS.random(exclude=(MODIFIERS.COMPANION_ABILITIES_LEVELS,)), {}), {})
self.assertEqual(self.hero.companion_abilities_levels, {})
self.hero.abilities.add(companions.ECONOMIC.get_id(), 3)
self.assertEqual(self.hero.companion_abilities_levels, {companions_abilities_relations.METATYPE.MONEY: 3})
示例10: test_improviser
# 需要导入模块: from the_tale.game.heroes.relations import MODIFIERS [as 别名]
# 或者: from the_tale.game.heroes.relations.MODIFIERS import random [as 别名]
def test_improviser(self):
self.assertEqual(companions.IMPROVISER().modify_attribute(MODIFIERS.COMPANION_ABILITIES_LEVELS, {}),
{companions_abilities_relations.METATYPE.OTHER: 1})
self.assertEqual(companions.IMPROVISER().modify_attribute(MODIFIERS.random(exclude=(MODIFIERS.COMPANION_ABILITIES_LEVELS,)), {}), {})
self.assertEqual(self.hero.companion_abilities_levels, {})
self.hero.abilities.add(companions.IMPROVISER.get_id(), 3)
self.assertEqual(self.hero.companion_abilities_levels, {companions_abilities_relations.METATYPE.OTHER: 3})
示例11: test_comrade
# 需要导入模块: from the_tale.game.heroes.relations import MODIFIERS [as 别名]
# 或者: from the_tale.game.heroes.relations.MODIFIERS import random [as 别名]
def test_comrade(self):
self.assertEqual(companions.COMRADE().modify_attribute(MODIFIERS.COMPANION_ABILITIES_LEVELS, {}),
{companions_abilities_relations.METATYPE.BATTLE: 1})
self.assertEqual(companions.COMRADE().modify_attribute(MODIFIERS.random(exclude=(MODIFIERS.COMPANION_ABILITIES_LEVELS,)), {}), {})
self.assertEqual(self.hero.companion_abilities_levels, {})
self.hero.abilities.add(companions.COMRADE.get_id(), 3)
self.assertEqual(self.hero.companion_abilities_levels, {companions_abilities_relations.METATYPE.BATTLE: 3})
示例12: test_healing
# 需要导入模块: from the_tale.game.heroes.relations import MODIFIERS [as 别名]
# 或者: from the_tale.game.heroes.relations.MODIFIERS import random [as 别名]
def test_healing(self):
self.assertEqual(companions.HEALING().modify_attribute(MODIFIERS.COMPANION_LIVING_HEAL, 0), 0.0462962962962963)
self.assertEqual(companions.HEALING().modify_attribute(MODIFIERS.random(exclude=(MODIFIERS.COMPANION_LIVING_HEAL,)), 0), 0)
companion_record = companions_storage.companions.enabled_companions().next()
self.hero.set_companion(companions_logic.create_companion(companion_record))
with mock.patch('the_tale.game.companions.objects.CompanionRecord.type', game_relations.BEING_TYPE.ANIMAL):
self.assertEqual(self.hero.companion_heal_probability, 0)
self.hero.abilities.add(companions.HEALING.get_id(), 3)
self.assertEqual(self.hero.companion_heal_probability, 0.1388888888888889)
示例13: test_sociability
# 需要导入模块: from the_tale.game.heroes.relations import MODIFIERS [as 别名]
# 或者: from the_tale.game.heroes.relations.MODIFIERS import random [as 别名]
def test_sociability(self):
self.assertEqual(companions.SOCIABILITY().modify_attribute(MODIFIERS.COMPANION_LIVING_COHERENCE_SPEED, 1), 1.2)
self.assertEqual(companions.SOCIABILITY().modify_attribute(MODIFIERS.random(exclude=(MODIFIERS.COMPANION_LIVING_COHERENCE_SPEED,)), 1), 1)
companion_record = companions_storage.companions.enabled_companions().next()
self.hero.set_companion(companions_logic.create_companion(companion_record))
with mock.patch('the_tale.game.companions.objects.CompanionRecord.type', game_relations.BEING_TYPE.ANIMAL):
self.assertEqual(self.hero.companion_coherence_speed, 1)
self.hero.abilities.add(companions.SOCIABILITY.get_id(), 3)
self.assertEqual(self.hero.companion_coherence_speed, 1.6)