def print_all_stats(self): print_title_fancily(None, "Character Stats") print() print_text_fancily(" Combat stats") for i in (self.combat_perm_stats): s = (" - %-10s : %d" % (i.upper(), getattr(self, i))) print_text_fancily(s, 0.01, False) print() print_text_fancily(" Adventure stats") for i in (self.adv_perm_stats): s = (' - %-10s : %d' % (i.upper(), getattr(self, i))) print_text_fancily(s, 0.01, False)
def show_character_confirmation(): clear_screen() print_title_fancily(None, "final check") print_text_fancily( "- Now, let's check your character again before we start our journey...") global player input('Press any key to show the avatar of the player ... \n') player.draw_player_avatar() input('Press any key to show the skill tree ... \n') player.draw_player_skill_tree() input('Press any key to show the stats of the character ... \n') player.show_player_stats() time.sleep(1) print_text_fancily(" - Everything seems fine! Let the journey begins!") input('Press any key to begin your yourney ...') begin_journey()
def get_player_name(): clear_screen() print_title_fancily(None, "name selection") print_text_fancily(" - Hey adventurer, what is your name? ") player_name = input(" + My name is [Type in your name here]: ") print() global player player = Player(player_name) print_text_fancily(" - Nice to meet you, %s! " % player_name) time.sleep(0.5) clear_screen() print_text_fancily( " - Every knight needs a shiny armor. Please accept it ...") player.draw_player_avatar() time.sleep(1) print_text_fancily(" __ Press any key to accept the armor __ ") input()
def begin_journey(): clear_screen() print_title_fancily("KnowLand") shape_by_line = WORLD_MAP.split('\n') for a_line in shape_by_line: print(a_line) time.sleep(0.05) time.sleep(0.5) print_text_fancily( "- Welcome to KnowLand, adventurer. Where do you want to go? \n") print(30 * '-') print(" D E S T I N A T I O N ") print(30 * '-') for i in range(len(islands)): print(f'{(i+1):d}. Go to {islands[i]}') print(30 * '-') choice = input('Enter your choice [{}] : '.format(len(islands))) ### Convert string to int type ## choice = islands[int(choice) - 1] explore_island(choice)
def player_select_skill_tree(): global player clear_screen() print_title_fancily(None, "skill-tree") print_text_fancily( ' - Now, your journey cannot begin without some skills.') print_text_fancily(' - Which skill tree do you want?') time.sleep(1) skill_tree = MathTree skill_tree.show() print(30 * '-', "\n") print("1. Select Math Tree") choice = input('Enter your choice [1] : ') print(30 * '-') ### Convert string to int type ## choice = int(choice) if choice == 1: player.skill_tree = skill_tree print_text_fancily(' - Congratulation! You have a skill tree of your own!') time.sleep(1) show_character_confirmation()
def show(self): print_title_fancily(None, "Skill Tree") print_tree(self.head) print()
def draw_player_avatar(self): print_title_fancily(None, "player avatar") self.avatar.show_avatar()
def show_island_name(self): print_title_fancily(self.name, self.description)