Пример #1
0
	def preparation():
		print()
		print("======================================================")
		print()
		if CoreGame.return_week(game) > 1:
			print("Before the next match, you'll have some time to prepare your team! ")
		else:
			print("Before the first match, you'll have some time to prepare your team! ")
		action = input("What would you like to do? Enter 'Help' to see all commands: ")
		while action.lower() != 'continue':
			if action.lower() == "help":
				print("You can do many things between matches, as long as you have the currency for it! There are a variety of ways to earn currency such as winning games")
				print ("and finding sponsors. Below you'll find the list of commands and what they will allow you to do.")
				print ("------------------------------------------------------------------------------------------------------------------------")
				print("Train [Type] [Position]- Allows you to a single member of the team in the skill you choose.")
				print("	Types of training:")
				print("		1v1		(++Brawling, +Mechanics)")
				print("		Gank 		(++Awareness, +Brawling)")
				print("		2v2		(++Mechanics, +Teamwork)")
				print("		Scrim 		(++Teamwork, +Awareness)")
				print("        Ex: Train Mid 1v1")
				print ("	Cost: 500")
				print ('-----')
				print("Sponsor - Look for a new sponsor. If you find one and already have one, you will have to choose which to keep.")
				print ('-----')
				print("League - See the current League standings")
				print ('-----')
				print("Team - See your team's stats")
				print ('-----')
				print("Continue - Continue on to the next match!")
				print ("------------------------------------------------------------------------------------------------------------------------")
			elif "train" in action.lower():
				#Setup Fund check
				if Team.return_funds(teams[0]) >= 500:
					if '1v1' in action.lower():
						if 'top' in action.lower():
							Player.train_player_1v1(players[0][0])
							Team.remove_funds(teams[0], 500)
						if 'mid' in action.lower():
							Player.train_player_1v1(players[0][1])
							Team.remove_funds(teams[0], 500)
						if 'jung' in action.lower():
							Player.train_player_1v1(players[0][2])
							Team.remove_funds(teams[0], 500)
						if 'carry' in action.lower():
							Player.train_player_1v1(players[0][3])
							Team.remove_funds(teams[0], 500)
						if 'sup' in action.lower():
							Player.train_player_1v1(players[0][4])
							Team.remove_funds(teams[0], 500)
					elif 'gank' in action.lower():
						if 'top' in action.lower():
							Player.train_player_gank(players[0][0])
							Team.remove_funds(teams[0], 500)
						if 'mid' in action.lower():
							Player.train_player_gank(players[0][1])
							Team.remove_funds(teams[0], 500)
						if 'jung' in action.lower():
							Player.train_player_gank(players[0][2])
							Team.remove_funds(teams[0], 500)
						if 'carry' in action.lower():
							Player.train_player_gank(players[0][3])
							Team.remove_funds(teams[0], 500)
						if 'sup' in action.lower():
							Player.train_player_gank(players[0][4])
							Team.remove_funds(teams[0], 500)
					elif '2v2' in action.lower():
						if 'top' in action.lower():
							Player.train_player_2v2(players[0][0])
							Team.remove_funds(teams[0], 500)
						if 'mid' in action.lower():
							Player.train_player_2v2(players[0][1])
							Team.remove_funds(teams[0], 500)
						if 'jung' in action.lower():
							Player.train_player_2v2(players[0][2])
							Team.remove_funds(teams[0], 500)
						if 'carry' in action.lower():
							Player.train_player_2v2(players[0][3])
							Team.remove_funds(teams[0], 500)
						if 'sup' in action.lower():
							Player.train_player_2v2(players[0][4])
							Team.remove_funds(teams[0], 500)
					elif 'scrim' in action.lower():
						if 'top' in action.lower():
							Player.train_player_scrim(players[0][0])
							Team.remove_funds(teams[0], 500)
						if 'mid' in action.lower():
							Player.train_player_scrim(players[0][1])
							Team.remove_funds(teams[0], 500)
						if 'jung' in action.lower():
							Player.train_player_scrim(players[0][2])
							Team.remove_funds(teams[0], 500)
						if 'carry' in action.lower():
							Player.train_player_scrim(players[0][3])
							Team.remove_funds(teams[0], 500)
						if 'sup' in action.lower():
							Player.train_player_scrim(players[0][4])
							Team.remove_funds(teams[0], 500)						
				else:
					print("Oh no! You don't have the required funds to do this training! You currently have %d while you need 500! Try again later." % Team.return_funds(teams[0]))
			elif action.lower() == "sponsor":
				totalGames = Team.return_wins(teams[0]) + Team.return_losses(teams[0])
				if totalGames == 0:
					print("There are currently no sponsors who would like to offer you anything. Try playing a game first!")
					print ('')
					#return 0  #This breaks things?
				else:
					winRatio = Team.return_wins[0] / totalGames
					if winRatio >= 0.5 and winRatio <= 0.65:
						sponsorOffer = randint(5,10) * 50
					elif winRatio > 0.65:
						sponsorOffer = randint(5,10) * 75
					elif winRatio < 0.5:
						sponsorOffer = 250		
					if sponsorOffer > sponsorFunds:	
						print("Congratulations! You have found a new sponsor!")
						print("This sponsor will reward you %d for each game you win." % sponsorOffer)
						Team.set_sponsor_funds(teams[0], sponsorOffer)
					else:
						print('There are no sponsors who will give you a better offer than you currently have.')
						print('Tip: Having a better win-rate will give you access to better offers!')
						return sponsorFunds
			elif action.lower() == "league":
				CoreGame.display_team_records(teams)
			elif action.lower() == "team":
				CoreGame.display_player_stats(players)
			elif action.lower() == "funds":
				print('Your teams current funds are: ', Team.return_funds(teams[0]))
			elif action.lower() == "continue":
				break
			else:
				print('Whoops! I don\'t recognize that command. Try entering "Help" to see the available commands.')
			action = input("What would you like to do? Enter 'Help' to see all commands: ")
Пример #2
0
			elif action.lower() == "team":
				CoreGame.display_player_stats(players)
			elif action.lower() == "funds":
				print('Your teams current funds are: ', Team.return_funds(teams[0]))
			elif action.lower() == "continue":
				break
			else:
				print('Whoops! I don\'t recognize that command. Try entering "Help" to see the available commands.')
			action = input("What would you like to do? Enter 'Help' to see all commands: ")
# --------------------init Game----------------------------------------------------------------------------------------
game = CoreGame(1, 0, 7) #week, score, # of teams
# --------------------Constants-----------------------------------------------------------------------------------------
MATCHSETS = [[2,3,4,5,6,7],[3,4,5,6,7,1],[4,6,5,7,1,2],[6,3,5,1,2,7],[6,1,2,4,7,3],[1,3,4,7,5,2],[2,6,3,5,1,4]]
# -------------------Team setup---------------------------------------------------------------------------------------
teams = CoreGame.create_npc_teams(CoreGame.return_numberOfTeams(game))
pcTeam = CoreGame.create_pc_team()
teams.insert(0, pcTeam)
# -------------------player setup---------------------------------------------------------------------------------------
pcPlayers = CoreGame.create_pc_players()
players = CoreGame.create_npc_players(CoreGame.return_numberOfTeams(game))
players.insert(0, pcPlayers)
# -------------------Game Start-----------------------------------------------------------------------------------------
CoreGame.regular_season(teams, players, MATCHSETS, CoreGame.return_numberOfTeams(game))
CoreGame.playoffs(teams)
# -------------------Calculate Score-------------------------------------------------------------------------------------
CoreGame.add_to_score(game, Team.return_funds(teams[0]) * 2)
teamPower = Player.return_total_power(players[0][0]) + Player.return_total_power(players[0][1]) + Player.return_total_power(players[0][2]) + Player.return_total_power(players[0][3]) + Player.return_total_power(players[0][4])
CoreGame.add_to_score(game, teamPower)
hs_check = CoreGame.highscore_check(game)
CoreGame.display_score(game, hs_check)