This repository has been archived by the owner on Jul 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentity.py
36 lines (33 loc) · 1.45 KB
/
entity.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
#!/usr/bin/env python3
class Entity:
def __init__(self, name = "nome", hp = 10, velocity = 10,
strength = 10, intelligence = 10, hand = None, items = [], lvl = 1 ):
from random import random
self.name = name
self.lvl = lvl
self.hp = hp
self.velocity = velocity + int(random() * 10)
self.strength = strength + int(random() * 10)
self.intelligence = intelligence + int(random() * 10)
self.hand = hand
self.items = items
class Player(Entity):
def __init__(self):
Entity.__init__(self)
self.name = str(input("What is your name?\n"))
a = 1
while a == 1:
sure = input("Your name is: %s, are you sure?\n" % self.name)
while sure not in ["no", "yes"]:
sure = input("Your name is: %s, are you sure?\n" % self.name)
if sure == "no":
self.name = str(input("What is your name?\n"))
else: a = 2
classi = ("chemist", "developer", "engineer")
alleanze = ("empire", "rebels")
self.classe = str(input("Select your class (chemist|developer|engineer)\n"))
while self.classe not in classi:
self.classe = str(input("Choose your class (chemist|developer|engineer)\n"))
self.alleanza = str(input("Choose your faction (empire|rebels)\n"))
while self.alleanza not in alleanze:
self.alleanza = str(input("Choose your faction(empire|rebels)\n"))