本文整理匯總了Python中team.Team.won_game方法的典型用法代碼示例。如果您正苦於以下問題:Python Team.won_game方法的具體用法?Python Team.won_game怎麽用?Python Team.won_game使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類team.Team
的用法示例。
在下文中一共展示了Team.won_game方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: npc_match
# 需要導入模塊: from team import Team [as 別名]
# 或者: from team.Team import won_game [as 別名]
def npc_match(team1, team2, players, teams):
team1Name = Team.return_name(teams[team1])
team2Name = Team.return_name(teams[team2])
difference= CoreGame.mute_compare_players(team1, team2, players, team1Name, team2Name)
winner = CoreGame.find_winner(0, 0, 0, difference)
if winner == 0:
Team.won_game(teams[team1])
Team.lost_game(teams[team2])
elif winner == 1:
Team.lost_game(teams[team1])
Team.won_game(teams[team2])
示例2: pc_match
# 需要導入模塊: from team import Team [as 別名]
# 或者: from team.Team import won_game [as 別名]
def pc_match(teams, teamToFace, players):
#PC Match
print("Your team will be facing off with %s!" % Team.return_name(teamToFace))
print("Let's see how the lanes match up!")
topDifference = CoreGame.compare_players_top(0, Team.return_id(teamToFace), players, Team.return_name(teams[0]), Team.return_name(teamToFace))
delay(1)
midDifference = CoreGame.compare_players_mid(0, Team.return_id(teamToFace), players, Team.return_name(teams[0]), Team.return_name(teamToFace))
delay(1)
jungDifference = CoreGame.compare_players_jung(0, Team.return_id(teamToFace), players, Team.return_name(teams[0]), Team.return_name(teamToFace))
delay(1)
botDifference = CoreGame.compare_players_bot(0, Team.return_id(teamToFace), players, Team.return_name(teams[0]), Team.return_name(teamToFace))
delay(1)
totalDifference = topDifference + botDifference + midDifference + jungDifference
if totalDifference > 0:
print("It looks like %s has the upper-hand in this game! Let's see how it works out for them!" % Team.return_name(teams[0]))
elif totalDifference < 0:
print("It looks like %s has the upper-hand in this game! Let's see how it works out for them!" % Team.return_name(teamToFace))
elif totalDifference == 0:
print('Neither team seems to have an advantage over the other! Amazing! Let\'s see how this turns out!')
delay(3)
winner = CoreGame.find_winner(topDifference, midDifference, jungDifference, botDifference)
if winner == 0:
print("Your team has won the game! Congratulations!")
CoreGame.add_to_score(game, 1000)
Team.won_game(teams[0])
Team.lost_game(teamToFace)
income = 1000 + Team.return_sponsor_funds(teams[0])
print("Total winnings (including sponsor funds if you have one) are: ", income)
Team.add_funds(teams[0], income)
elif winner == 1:
print("Oh no! It looks like your team wasn't able to pull off a win. Better luck next time!")
Team.won_game(teamToFace)
Team.lost_game(teams[0])
income = 500
print("For losing, your team is still rewarded: ", income)
Team.add_funds(teams[0], income)
else:
print("===================SOMETHING WENT WRONG!========================")
print("Error occured deciding a winner. Something other than 1 or 0 was output.")
print(winner)
return(winner)