Skip to content

Commit

Permalink
5.2 Show version update. And cleaned up runtime arguments
Browse files Browse the repository at this point in the history
Removed what felt like unneeded argument alternatives, no more -f or -fast or -fastmode, just -fast, and same goes for the rest. 

New -version argument, shows game version (also date).
New __date__ dunder.
Shows version (and date) in start banner now.

Moved new show_version and show_sysargs (was show_help) func to output.py
  • Loading branch information
0n1udra committed May 11, 2021
1 parent f3f400d commit 5ddc26d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 28 deletions.
20 changes: 19 additions & 1 deletion source/game_files/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,23 @@ def idots(*args):


# ========== Extra ==========
def show_version(game_version, version_date):
print(f"\n Version: {game_version} ({version_date})")
exit(0)

def show_sysargs():
print("""
-help -- This help page.
-version -- Show version.
-textcrawl -- Disable text crawl effect.
-hideart -- Diable ASCII art.
-hidehud -- Disable game HUD.
-hidehints -- Disable game hints.
-hardmode -- Enable Hardcore mode.
-fast -- Enable Fast mode, goes through storyline actions as quick as possible. Also disables text crawl and ascii art.
-slime -- Enables: hud, hints | Disables: textcrawl, art, hardcore""")
exit(0)

def show_art(art):
"""
Prints out ASCII art line by line or all at once depending on textcrawl boolean.
Expand Down Expand Up @@ -147,13 +164,14 @@ def show_history(arg):
for line in log_data[-lines:]: print(line, end='')
print('\n-------------------- History --------------------')

def show_start_banner():
def show_start_banner(game_version, version_date):
"""Show game title, tips, and player stats/inv."""

show_art('great sage')
print(f"""
----------Tensei Shitara Slime Datta Ken (That Time I Got Reincarnated as a Slime)----------
{game_art.rimuru_art.banner}
- Version: {game_version} ({version_date})
- Basic commands: stats, inv, info, /settings, /exit, and /help for more commands and help.
- To set game settings like hardcore mode or hints use '/settings', e.g. '/settings hardcore on', '/settings hints off'.
- Game will only save at specific points in the story, look out for '< Game Saved >' message.
Expand Down
42 changes: 15 additions & 27 deletions source/start_game.py
Original file line number Diff line number Diff line change
@@ -1,52 +1,40 @@
import pathlib, sys, os
from game_files.functions import show_start_banner, game_load, get_any, ask_on_off, update_rimuru_output
from game_files.functions import show_start_banner, game_load, ask_on_off, update_rimuru_output, show_sysargs, show_version
from chapters.tensei_0 import ch0

__version__ = "5.1 Alpha"
__version__ = "5.2 Alpha"
__date__ = '5/11/2021'
__author__ = "D Thomas"
__email__ = "[email protected]"
__license__ = "GPL 3"
__status__ = "Development"

def help_page():
print("""
-h -- This help page.
-f -- Fast mode, goes through storyline actions as quick as possible. Also disables text crawl and ascii art.
-t -- Disable text crawl effect.
-a -- Hides ASCII art.
-hud -- Hide game HUD.
-hard -- Enable Hardcore mode.
-hints -- Hide game hints.
-slime -- Enables: hud, hints | Disables: textcrawl, art, hardcore
""")
exit(0)

if __name__ == '__main__':
if '-h' in sys.argv: help_page()
if '-help' in sys.argv: show_sysargs()
if '-version' in sys.argv: show_version(__version__, __date__)

save_path = os.path.dirname(os.path.abspath(__file__)) + '/game.save'

# Loads game save and updates rimuru object from game_functions.
rimuru = game_load(save_path)
rimuru.source_folder_path = str(pathlib.Path(__file__).parent.absolute())
update_rimuru_output(rimuru) # Updates rimuru object for ouput.py file... idk, idk.
update_rimuru_output(rimuru) # Updates rimuru object for ouput.py file... idk, idk, you just have to...

if get_any(sys.argv, ['-f', '-fast', '-fastmode']): rimuru.fast_mode = True
if get_any(sys.argv, ['-t', '-text', '-textcrawl']): rimuru.textcrawl = False
if get_any(sys.argv, ['-a', '-art', '-hideart']): rimuru.show_art = False
if get_any(sys.argv, ['-hud', '-hidehud']): rimuru.show_actions = True
if '-textcrawl' in sys.argv: rimuru.textcrawl = False
if '-hideart' in sys.argv: rimuru.show_art = False
if '-hidehud' in sys.argv: rimuru.show_actions = True
if '-hard' in sys.argv: rimuru.hardcore = True
if '-hints' in sys.argv: rimuru.show_hints = False
if '-slime' in sys.argv: # For debug.
# For debugging.
if '-fast' in sys.argv: rimuru.fast_mode = True
if '-slime' in sys.argv:
rimuru.textcrawl = rimuru.show_art = rimuru.hardcore = False
rimuru.show_actions = rimuru.show_hints = True

# Only asks player if variables are not already set.
if rimuru.textcrawl is None:
rimuru.textcrawl = ask_on_off('textcrawl', 'Enable textcrawl effect (Recommended for easier reading)')
if rimuru.show_actions is None:
rimuru.show_actions = ask_on_off('Show Actions', "Show playable actions? (Recommended for first timers)")
if rimuru.textcrawl is None: rimuru.textcrawl = ask_on_off('textcrawl', 'Enable textcrawl effect (Recommended for easier reading)')
if rimuru.show_actions is None: rimuru.show_actions = ask_on_off('Show Actions', "Show playable actions? (Recommended for first timers)")

show_start_banner()
show_start_banner(__version__, __date__)
ch0(rimuru) # Can be used for debugging.
rimuru.current_location_object(rimuru)

0 comments on commit 5ddc26d

Please sign in to comment.