/
test_Fight.py
43 lines (37 loc) · 1021 Bytes
/
test_Fight.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import unittest
from Fight import Fight
from Hero import Hero
from Weapon import Weapon
from Spell import Spell
from Enemy import Enemy
class TestFight(unittest.TestCase):
def test_start_fight(self):
f = Fight()
h = Hero("Geralt", "White wolf", 100, 100, 5)
h.equip(Weapon("Axe", 40))
h.learn(Spell("Storm", 30, 50, 3))
e = Enemy(100, 200, 30)
e.equip(Weapon("Sword", 40))
e.learn(Spell("Fire", 30, 20, 3))
d = 2
h = f.start_fight(h, e, d)
print('=======================')
print(h.known_as(), h.get_health())
if __name__ == '__main__':
unittest.main()
"""
from Fight import Fight
from Hero import Hero
from Weapon import Weapon
from Spell import Spell
from Enemy import Enemy
f = Fight()
h = Hero("Geralt", "White wolf", 200, 100, 5)
h.equip(Weapon("Axe", 40))
h.learn(Spell("Storm", 30, 50, 3))
e = Enemy(100, 40, 10)
e.equip(Weapon("Sword", 40))
e.learn(Spell("Fire", 30, 20, 3))
d = 2
h = f.start_fight(h, e, d)
"""