jordan
2 months ago
1 changed files with 30 additions and 5 deletions
@ -1,12 +1,37 @@ |
|||||
from random import randint |
from random import randint |
||||
class Personnage: |
class Personnage: |
||||
def __init__ (self, nom, pdv, exp, cat): |
def __init__ (self, nom, cat): |
||||
self.nom = nom |
self.nom = nom |
||||
self.pdv = pdv |
self.pdv = 20 |
||||
self.exp = exp |
self.exp = 1 |
||||
self.cat = cat |
self.cat = cat |
||||
self.inventaire = |
self.inventaire = str() |
||||
|
|
||||
def jet_attaque(self): |
if self.cat == "guerrier": |
||||
|
self.inventaire = str("épée et potion") |
||||
|
self.coefatk = 10 |
||||
|
self.coefdef = 8 |
||||
|
|
||||
|
elif self.cat == "magicien": |
||||
|
self.inventaire = str("bâton et potion") |
||||
|
self.coefatk = 10 |
||||
|
self.coefdef = 7 |
||||
|
|
||||
|
elif self.cat == "voleur": |
||||
|
self.inventaire = str("dague et potion") |
||||
|
self.coefatk = 3 |
||||
|
self.coefdef = 9 |
||||
|
|
||||
|
elif self.cat == "elfe": |
||||
|
self.inventaire = str("arc et potion") |
||||
|
self.coefatk = 8 |
||||
|
self.coefdef = 10 |
||||
|
|
||||
|
else: |
||||
|
raise ValueError ("La classe selectionné n'est pas disponible.") |
||||
|
|
||||
|
def jet_attaque(self): |
||||
|
atkdé = randint(1, 20) |
||||
|
return self.exp * self.coefatk + atkdé |
||||
|
|
||||
|
# |
Loading…
Reference in new issue