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


Python Orc.berserk_factor_check方法代码示例

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


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

示例1: OrcTest

# 需要导入模块: from orc import Orc [as 别名]
# 或者: from orc.Orc import berserk_factor_check [as 别名]
class OrcTest (unittest.TestCase):
    def setUp(self):
        self.orc = Orc("Gosho", 100, 1.25)

    def test_orc_init(self):

        self.assertEqual(self.orc.name, "Gosho")
        self.assertEqual(self.orc.health, 100)
        self.assertEqual(self.orc.berserk_factor, 1.25)

    def test_get_health(self):

        self.assertEqual(self.orc.get_health(), 100)

    def test_is_alive_return_false(self):

        self.orc.fight_health = 0
        self.assertFalse(self.orc.is_alive())

    def test_is_alive(self):

        self.assertTrue(self.orc.is_alive())

    def test_take_damage(self):

        self.assertEqual(80, self.orc.take_damage(20))

    def test_take_damage_more_than_health(self):

        self.assertEqual(0, self.orc.take_damage(120))

    def test_take_healing_to_dead_person(self):

        self.orc.health = 0
        self.assertFalse(self.orc.take_healing(20))

    def test_take_healing_more_than_full_health(self):

        self.orc.health = 90
        self.assertFalse(self.orc.take_healing(100))

    def test_take_healing_true(self):

        self.orc.health = 40

    def test_berserk_factor_below_one(self):
        self.orc.berserk_factor = 0.4
        self.assertEqual(self.orc.berserk_factor_check(), 1)

    def test_berserk_factor_over_two(self):
        self.orc.berserk_factor = 2.14
        self.assertEqual(self.orc.berserk_factor_check(), 2)

    def test_orc_attack_with_weapon(self):
        self.orc.equip_weapon(Weapon("Pipe", 35, 0.5))
        self.assertEqual(self.orc.attack(), 70)

    def test_orc_attack_without_weapon(self):
        self.assertEqual(self.orc.attack(), 0)
开发者ID:JusttRelaxx,项目名称:HackBulgaria,代码行数:61,代码来源:the_orc_test.py

示例2: OrcTest

# 需要导入模块: from orc import Orc [as 别名]
# 或者: from orc.Orc import berserk_factor_check [as 别名]
class OrcTest (unittest.TestCase):
    def setUp(self):
        self.orc = Orc("The DragonSlayer killer", 100, 1.5)

    def test_hero_init(self):

        self.assertEqual(self.orc.name, "The DragonSlayer killer")
        self.assertEqual(self.orc.maxhealth, 100)
        self.assertEqual(self.orc.berserk_factor, 1.5)

    def test_get_health(self):

        self.assertEqual(self.orc.get_health(), 100)

    def test_is_alive_return_false(self):

        self.orc.maxhealth = 0
        self.assertFalse(self.orc.is_alive())

    def test_is_alive(self):

        self.assertTrue(self.orc.is_alive())

    def test_take_damage(self):

        self.assertEqual(80, self.orc.take_damage(20))

    def test_take_damage_more_than_health(self):

        self.assertEqual(0,self.orc.take_damage(120))

    def test_take_healing_to_dead_person(self):

        self.orc.maxhealth = 0
        self.assertFalse(self.orc.take_healing(20))

    def test_take_healing_more_than_enough(self):

        self.orc.maxhealth = 90
        self.assertFalse(self.orc.take_healing(100))

    def test_take_healing_true(self):

        self.orc.maxhealth = 40

    def test_berserk_factor_below_one(self):
        self.orc.berserk_factor = 0.5
        self.assertEqual(self.orc.berserk_factor_check(), 1)

    def test_berserk_factor_above_two(self):
        self.orc.berserk_factor = 2.15
        self.assertEqual(self.orc.berserk_factor_check(), 2)
开发者ID:modzozo,项目名称:hack101,代码行数:54,代码来源:orcTest.py


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