-
Notifications
You must be signed in to change notification settings - Fork 0
/
entity_factories.py
82 lines (77 loc) · 2.16 KB
/
entity_factories.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
from components.ai import HostileEnemy
from components import consumable, equippable
from components.equipment import Equipment
from components.fighter import Fighter
from components.inventory import Inventory
from components.level import Level
from entity import Actor, Item
# Creation of Player Character
player = Actor(
char="@",
color=(255, 255, 255),
name="Player",
ai_cls=HostileEnemy,
equipment=Equipment(),
fighter=Fighter(hp=30, base_defence=2, base_power=5),
inventory=Inventory(capacity=26),
level=Level(level_up_base=200),
)
# Creation of Enemies
orc = Actor(
char="o",
color=(63, 127, 63),
name="Orc",
ai_cls=HostileEnemy,
equipment=Equipment(),
fighter=Fighter(hp=10, base_defence=0, base_power=3),
inventory=Inventory(capacity=0),
level=Level(xp_given=35),
)
troll = Actor(
char="T",
color=(0, 127, 0),
name="Troll",
ai_cls=HostileEnemy,
equipment=Equipment(),
fighter=Fighter(hp=16, base_defence=1, base_power=4),
inventory=Inventory(capacity=0),
level=Level(xp_given=100),
)
# Creation of Consumables
confusion_scroll = Item(
char="~",
color=(207, 63, 255),
name="Confusion Scroll",
consumable=consumable.ConfusionConsumable(number_of_turns=10),
)
fireball_scroll = Item(
char="~",
color=(255, 0, 0),
name="Fireball Scroll",
consumable=consumable.FireballDamageConsumable(damage=12, radius=3),
)
health_potion = Item(
char="!",
color=(127, 0, 255),
name="Health Potion",
consumable=consumable.HealingConsumable(amount=4),
)
lightning_scroll = Item(
char="~",
color=(255, 255, 0),
name="Lightning Scroll",
consumable=consumable.LightningDamageConsumable(damage=20, maximum_range=5),
)
# Creation of Equipment
dagger = Item(
char="/", color=(0, 191, 255), name="Dagger", equippable=equippable.Dagger()
)
sword = Item(
char="/", color=(0, 191, 255), name="Sword", equippable=equippable.Sword()
)
leather_armor = Item(
char="[", color=(139, 69, 19), name="Leather Armor", equippable=equippable.LeatherArmor()
)
chain_mail = Item(
char="[", color=(139, 69, 19), name="Chain Mail", equippable=equippable.ChainMail()
)