当前位置: 首页>>代码示例>>Python>>正文


Python Team.set_sponsor_funds方法代码示例

本文整理汇总了Python中team.Team.set_sponsor_funds方法的典型用法代码示例。如果您正苦于以下问题:Python Team.set_sponsor_funds方法的具体用法?Python Team.set_sponsor_funds怎么用?Python Team.set_sponsor_funds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在team.Team的用法示例。


在下文中一共展示了Team.set_sponsor_funds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: preparation

# 需要导入模块: from team import Team [as 别名]
# 或者: from team.Team import set_sponsor_funds [as 别名]

#.........这里部分代码省略.........
				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: ")
开发者ID:Civil-JE,项目名称:Text-Based-LCS,代码行数:104,代码来源:MSim.py


注:本文中的team.Team.set_sponsor_funds方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。