Update Kanjin-Engine

This commit is contained in:
KansaiGaijin
2022-01-23 16:29:18 +13:00
committed by GitHub
parent 3d03350096
commit 687c4df0b4

View File

@@ -3,6 +3,8 @@ from random import randint
from functions import startGame, typingPrint, typingInput from functions import startGame, typingPrint, typingInput
from enum import Enum, auto from enum import Enum, auto
# pyinstaller --onefile --paths=C:\Users\kasai\PycharmProjects\pythonProject\Kanjin\KanjinEngine.py
class Player: class Player:
"""Character Creation""" """Character Creation"""
@@ -168,11 +170,12 @@ class Player:
stats.append(str(val)) stats.append(str(val))
rolls = [] rolls = []
print("Please assign a stat to a selected attribute by entering the number then the attribute.\n" typingPrint("Please assign a stat to a selected attribute by entering the number then the attribute.\n"
"For example, '10 strength' will assign the stat 10 to your strength, if you have a 10 showing.\n") "For example, '10 strength' will assign the stat 10 to your strength, if you have a 10 showing.\n",
print("Please select a stat and an attribute") time)
print("Your rolled stats are:\n" + ', '.join(stats) + "\n") typingPrint("Please select a stat and an attribute.\n\n", time)
print("Your attributes are:\n" + ', '.join(attributes) + "\n") typingPrint("Your rolled stats are:\n" + ', '.join(stats) + "\n\n", time)
typingPrint("Your attributes are:\n" + ', '.join(attributes) + "\n\n", time)
# Allocate # Allocate
while len(stats) != 0: while len(stats) != 0:
@@ -185,11 +188,11 @@ class Player:
if len(stats) == 0: if len(stats) == 0:
print("") print("")
break break
print("The remaining options are:\n") typingPrint("The remaining options are:\n", time)
print(', '.join(stats)) typingPrint(', '.join(stats), time)
print(', '.join(attributes)) typingPrint(', '.join(attributes), time)
else: else:
print("Error. Input was not recognised. Please try again with 'Number' + 'Attribute'.") typingPrint("Error. Input was not recognised. Please try again with 'Number' + 'Attribute'.", time)
continue continue
@@ -344,7 +347,8 @@ tornRags = Armor(
magical=False magical=False
) )
user = Player("Jamie", "Male", 29, "Elf", "Mage") # user = Player("Jamie", "Male", 29, "Elf", "Mage")
user = Player(startGame())
class Begin(Scene): class Begin(Scene):
@@ -353,14 +357,7 @@ class Begin(Scene):
desc = d.read() desc = d.read()
def enter(self): def enter(self):
# print("")
# typingPrint(f'{Begin.name}', time)
# print("")
# typingPrint(f'\n{self.desc}\n'
# f'\n', time)
# user = Player(*startGame())
user.new_char() user.new_char()
return "tutorial"
class CaveEntrance(Scene): class CaveEntrance(Scene):
@@ -370,7 +367,8 @@ class CaveEntrance(Scene):
has_visited = False has_visited = False
def enter(self): def enter(self):
typingPrint(f'\n===========\n{self.name}', time) typingPrint(f'\n===========\n'
f'{self.name}', time)
if not self.has_visited: if not self.has_visited:
typingPrint(self.descTrue, time) typingPrint(self.descTrue, time)
else: else:
@@ -379,10 +377,8 @@ class CaveEntrance(Scene):
action = input(">> ") action = input(">> ")
if action == "shoot!": if action == "shoot!":
print("result")
return "death" return "death"
elif action == "dodge": elif action == "dodge":
print("result")
return "pod" return "pod"
else: else:
print("error") print("error")