MNUE
This commit is contained in:
parent
f272b1b281
commit
c5930053e4
5 changed files with 86 additions and 41 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -4,4 +4,7 @@ __pycache__
|
|||
|
||||
|
||||
#### misc
|
||||
.projectile
|
||||
.projectile
|
||||
auto-save-list
|
||||
.\#*
|
||||
.kateproject
|
||||
|
|
10
README.md
Normal file
10
README.md
Normal file
|
@ -0,0 +1,10 @@
|
|||
# Untitled Cyberbonk 2077
|
||||
|
||||
Projekt gry RPG (czy coś, nie wiem) napisany w Pythonie w celu nauki
|
||||
|
||||
# Autor
|
||||
sysek
|
||||
|
||||
# License
|
||||
|
||||
This work is licensed under CC BY-NC-SA 4.0
|
48
app.py
48
app.py
|
@ -1,10 +1,14 @@
|
|||
from engine import Engine
|
||||
from game import Game
|
||||
from player import Player
|
||||
from enemy import Enemy
|
||||
|
||||
# ENGINE SECTIONS
|
||||
# ENGINE SECTION
|
||||
eng = Engine()
|
||||
|
||||
# GAME SECTION
|
||||
game = Game()
|
||||
|
||||
# PLAYER SECTION
|
||||
player = Player("キーウィ")
|
||||
|
||||
|
@ -12,14 +16,40 @@ player = Player("キーウィ")
|
|||
dummykid = Enemy()
|
||||
|
||||
|
||||
# GAME TEST
|
||||
def logo():
|
||||
logo = """
|
||||
⣀⡀⠀⠀⠀⠀⠀⠀⠀⡔⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡠⢚⣉⣠⡽⠂⠀⠀⠀⠀⡰⢋⡼⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⢴⡆⠀⠀
|
||||
⠀⠀⠀⠀⠀⢀⡤⠐⢊⣥⠶⠛⠁⢀⠄⡆⣠⠤⣤⠞⢠⠿⢥⡤⠀⠀⠠⢤⠀⠀⠀⠤⠤⠤⡄⢠⠤⠄⠤⠀⠀⠀⠒⣆⡜⣿⣄⠀⡤⢤⠖⣠⣀⠤⢒⣭⠶⠛⠃⠀⠀
|
||||
⢀⣀⡠⢴⣎⣥⣴⣾⣟⡓⠒⠒⠒⠺⣄⡋⢀⡾⢃⣴⢖⣢⣞⢁⣋⣉⣹⠏⠚⠛⢛⣉⣤⡴⢞⠃⣰⠾⠟⣛⣩⢵⢶⡟⣰⠇⠘⡼⢡⡟⣀⡋⢵⡞⠋⠁⠀⠀⠀⠀⠀
|
||||
⠈⠢⠄⠤⠤⠤⠤⠤⠴⠤⠴⠶⠶⢾⠟⣱⡿⢤⢿⣕⠾⣿⣿⣩⡭⢤⠞⣰⠶⢤⣀⡉⠓⢾⡍⣠⠴⠾⠛⠹⠡⣟⡁⢰⢏⣼⡇⢰⣿⢀⠟⠳⣤⣌⣦⡀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⢃⡼⠋⠛⠾⠚⠁⠀⠈⠉⠀⠀⠸⣄⠏⠀⠀⠈⠙⠓⡟⣰⠏⠀⠀⠀⠘⠾⠛⠳⠞⠉⠁⠙⠋⠙⠚⠀⠀⠀⠙⠛⢿⣷⣤⣀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣜⡵⠟⠀⠀⠀⠀⠀⠀⣼⣿⣾⣿⣽⣽⣿⣿⢏⢫⣻⡹⡽⣰⢏⣯⠍⡭⡍⣭⢩⡭⢩⡍⡏⡏⣯⡍⣍⠙⡭⢹⣄⣤⠄⢠⠉⠓⢿⣕⡄
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⣯⠃⠀⠀⠀⠀⠀⠀⠀⣸⣿⣿⣿⣿⣿⣽⣾⣾⣟⣯⣣⣱⣾⣟⣞⣸⣇⣳⣃⣿⣛⣷⣬⠧⠳⠇⠿⢧⢿⢀⣷⢸⠧⢾⢃⠇⠀⠀⠀⠀⠁
|
||||
"""
|
||||
print(logo)
|
||||
|
||||
player.show_stats()
|
||||
print("")
|
||||
dummykid.show_dummy()
|
||||
|
||||
roll = eng.roll_d20()
|
||||
loop = True
|
||||
while loop is True:
|
||||
logo()
|
||||
if player is False:
|
||||
print("--- CREATE CHARACTER ___")
|
||||
game.create_character()
|
||||
else:
|
||||
print(f"--- HELLO {player.name} ___")
|
||||
print("--- WARNING, TEST MODE ___")
|
||||
print("? What you would like to do today?")
|
||||
print("戦う [f]ight mode")
|
||||
print("顔 show [c]haracter")
|
||||
|
||||
if roll < 10:
|
||||
eng.figth_mode(player, dummykid)
|
||||
|
||||
# breakpoint()
|
||||
timetochoose = input(">___ ")
|
||||
|
||||
if timetochoose == "Q" or timetochoose == "q":
|
||||
loop = False
|
||||
elif timetochoose == "F" or timetochoose == "f":
|
||||
print("### tutaj będzie fight mode ###")
|
||||
# game.figth_mode()
|
||||
elif timetochoose == 'C' or timetochoose == 'c':
|
||||
player.show_stats()
|
||||
|
|
36
engine.py
36
engine.py
|
@ -1,39 +1,13 @@
|
|||
import random
|
||||
from player import Player
|
||||
from enemy import Enemy
|
||||
from time import sleep
|
||||
from os import system
|
||||
|
||||
|
||||
class Engine:
|
||||
def roll_d20(self):
|
||||
return random.randint(1,20)
|
||||
return random.randint(1, 20)
|
||||
|
||||
|
||||
def roll_d10(self):
|
||||
return random.randint(1,10)
|
||||
|
||||
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")
|
||||
|
||||
|
||||
return random.randint(1, 6)
|
||||
|
|
28
game.py
Normal file
28
game.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
# from engine import Engine
|
||||
from player import Player
|
||||
from enemy import Enemy
|
||||
|
||||
|
||||
class Game:
|
||||
def figth_mode(self, player: Player, enemy: Enemy):
|
||||
"""
|
||||
--- FIGHT MODE ___
|
||||
player: Player Class
|
||||
enemy: Enemy Class
|
||||
"""
|
||||
|
||||
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")
|
||||
|
||||
def create_character(self):
|
||||
pass
|
Loading…
Add table
Reference in a new issue