diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ddfdd05 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +#### python +.venv +__pycache__ + + +#### misc +.projectile \ No newline at end of file diff --git a/app.py b/app.py new file mode 100644 index 0000000..fb854b0 --- /dev/null +++ b/app.py @@ -0,0 +1,25 @@ +from engine import Engine +from player import Player +from enemy import Enemy + +# ENGINE SECTIONS +eng = Engine() + +# PLAYER SECTION +player = Player("キーウィ") + +# DUMMY SECTION +dummykid = Enemy() + + +# GAME TEST + +player.show_stats() +print("") +dummykid.show_dummy() + +roll = eng.roll_d20() + +if roll < 10: + eng.figth_mode(player, dummykid) + diff --git a/enemy.py b/enemy.py new file mode 100644 index 0000000..710fa50 --- /dev/null +++ b/enemy.py @@ -0,0 +1,12 @@ + + +class Enemy: + + def __init__(self): + self.name = "Dummy" + self.hp = 10 + self.mp = 0 + + def show_dummy(self): + print(f"Name: {self.name}") + print(f"HP: {self.hp}") diff --git a/engine.py b/engine.py new file mode 100644 index 0000000..64949af --- /dev/null +++ b/engine.py @@ -0,0 +1,39 @@ +import random +from player import Player +from enemy import Enemy +from time import sleep + +class Engine: + def roll_d20(self): + return random.randint(1,20) + + + def roll_d10(self): + return random.randint(1,10) + + + def roll_d6(self): + return random.randint(1,6) + + + def figth_mode(self, player: Player, enemy: Enemy): + """ + --- FIGHT MODE ___ + player: PlayerClass + enemy: EnemyClass + """ + + print("--- FIGHT MODE ___") + print(f"{player.name} vs. {enemy.name}") + + INIT_PLAYER = self.roll_d10() + INIT_ENEMY = self.roll_d10() + + if INIT_PLAYER > INIT_ENEMY: + print(f"PLAYER ROLL: {INIT_PLAYER}") + print(f"ENEMY ROLL: {INIT_ENEMY}") + print("FIGHT OFF, CHICKEN") + else: + print("YOU GOT SOME TROUBLE, MATE") + + diff --git a/player.py b/player.py new file mode 100644 index 0000000..d2c3553 --- /dev/null +++ b/player.py @@ -0,0 +1,31 @@ + + +class Player: + STATs = { + "INT": 5, + "REF": 7, + "DEX": 7, + "TECH": 7, + "COOL": 7, + "WILL": 5, + "LUCK": 8, + "MOVE": 6, + "BODY": 5, + "EMP": 5 + } + + HP = 0 + HP_MAX = 0 + + def __init__(self, name): + self.HP = 35 + self.HP_MAX = 35 + self.name = name + + def show_stats(self): + print(f"Name: {self.name}") + print(f"HP: {self.HP}/{self.HP_MAX}") + + for k, v in self.STATs.items(): + print(f"{k}: {v}") +