-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathchecking.py
More file actions
30 lines (26 loc) · 1.04 KB
/
Copy pathchecking.py
File metadata and controls
30 lines (26 loc) · 1.04 KB
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
def check_noble(partie, joueur):
gamer = partie.joueurs[joueur]
for noble in partie.nobles_visibles:
if gamer.bonus["rouge"] >= noble.rouge and \
gamer.bonus["vert"] >= noble.vert and \
gamer.bonus["bleu"] >= noble.bleu and \
gamer.bonus["noir"] >= noble.noir and \
gamer.bonus["blanc"] >= noble.blanc:
gamer.gagne_noble(partie, noble)
def check_point(partie, joueur):
gamer = partie.joueurs[joueur]
if gamer.points >= 15:
print('/!\\------------------------------------------/!\\')
print(f"{gamer.name} a obtenu {gamer.points} points ! Il a gagné la partie !")
print("/!\\------------------------------------------/!\\")
return True
return False
def check_nb_jetons(partie, joueur):
gamer = partie.joueurs[joueur]
while sum(gamer.jetons.values()) > 10:
print("Vous avez trop de jetons en main.")
couleur = input("Quel jeton voulez-vous reposer ?"
"rouge, bleu, vert, blanc, noir")
gamer.jetons[couleur] -= 1
partie.jetons[couleur].nb_jetons += 1
print(f"Vous avez reposé un jeton {couleur}")