commit da29b8fc1b61f0fddd99597d89b4268f5d4d2363 Author: Alexandre Mouchel Date: Wed Mar 4 23:22:31 2020 +0100 I created with my boyfriend a game to play with him when we are far from each other I already miss him he plans to go to Normandy this weekend but I don't want him to that s too bad what am I going to do ??? dunno dunno I am still crying I want to cry I want to hug him but he wants to code this shitty I don't even like! what a nightmare! no I am kidding I am 100% happy and fine please take care of yourself you're worth it bye bye kitties diff --git a/opale/board.py b/opale/board.py new file mode 100644 index 0000000..b0826da --- /dev/null +++ b/opale/board.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +Created on Wed Mar 4 22:23:56 2020 + +@author: AlexandreMouchel +""" + +class Board(): + + def __init__(self): + self.chasseresse = [] + self.dragonCorail = [] + self.pearl = [] + self.witch = [] + self.dragonPetrified = [] + self.golem = [] + self.guardian = [] + self.horser = [] + self.city = [] + self.underTheBoard = [] + self.roundCity = 0 + + def isFinished(self): + return self.roundCity >= 3 + \ No newline at end of file diff --git a/opale/carte.py b/opale/carte.py new file mode 100644 index 0000000..f8f4939 --- /dev/null +++ b/opale/carte.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +Created on Wed Mar 4 22:33:46 2020 + +@author: AlexandreMouchel +""" + +class Card(): + + def __init__(self, score): + self.score = score + + def __repr__(self): + return type(self).__name__ + "(%d)"%self.score + + +class Chasseresse(Card): + + def __init__(self, score): + Card.__init__(self, score) + + +class DragonCorail(Card): + + def __init__(self, score): + Card.__init__(self, score) + + +class Pearl(Card): + + def __init__(self, score): + Card.__init__(self, score) + + +class Witch(Card): + + def __init__(self, score): + Card.__init__(self, score) + + +class DragonPetrified(Card): + + def __init__(self, score): + Card.__init__(self, score) + + +class Golem(Card): + + def __init__(self, score): + Card.__init__(self, score) + + +class Guardian(Card): + + def __init__(self, score): + Card.__init__(self, score) + + +class Horser(Card): + + def __init__(self, score): + Card.__init__(self, score) + + +class City(Card): + + def __init__(self): + Card.__init__(self, 0) \ No newline at end of file diff --git a/opale/game.py b/opale/game.py new file mode 100644 index 0000000..0be887a --- /dev/null +++ b/opale/game.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +Created on Wed Mar 4 22:20:15 2020 + +@author: AlexandreMouchel +""" + +class Game(): + + def __init__(self): + self.board = Board() + self.player1 = Player() + self.player2 = Player() + self.round = 0 \ No newline at end of file diff --git a/opale/player.py b/opale/player.py new file mode 100644 index 0000000..a5f2575 --- /dev/null +++ b/opale/player.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +Created on Wed Mar 4 22:32:32 2020 + +@author: AlexandreMouchel +""" +import random + +from carte import * + + +class Player(): + + def __init__(self): + self.pioche = [] + self.défausse = [] + self.main = [] + self.dragonPetrified = False + # we are creating the deck + self.pioche += [City() for i in range(6)] + self.pioche += [Chasseresse(1 if i % 3 else 2) for i in range(6)] + self.pioche += [DragonCorail(3 if i % 2 else i) for i in range(1, 5)] + self.pioche += [Pearl((i+2)//2) for i in range(7)] + self.pioche += [Witch(i%2+1) for i in range(4)] + self.pioche += [DragonPetrified(2) for i in range(5)] + self.pioche += [Golem(i+1) for i in range(3)] + self.pioche += [Horser(2 if i == 0 else 1) for i in range(5)] + self.pioche += [Guardian(1) for i in range(6)] + self.pioche += [Guardian(2) for i in range(3)] + self.pioche += [Guardian(3) for i in range(1)] + random.shuffle(self.pioche) + + def pick(self): + for i in range((6 if self.dragonPetrified else 5) - len(self.main)): + self.main.append(self.pioche.pop()) + + +nde = Player() +print(len(nde.pioche)) +nde.pick() +nde.dragonPetrified = True +nde.pick() +print(len(nde.pioche)) +print(nde.main) + +