Guest User

Untitled

a guest
Jan 17th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.25 KB | None | 0 0
  1. class quick_game_of_scythe(object):
  2. """Return a number of players of count *players* where each player has a score"""
  3. def __init__(self, player, score)
  4.  
  5. class player(object):
  6. """Return a Player whose faction is *faction* and player board is *player board*"""
  7. def __init__(self, player_board, faction_mat)
  8.  
  9. class Score(object):
  10. """ A Score of ABC Bank with a Checking Account.
  11. A score has the following properties:
  12. Attributes:
  13. Faction: Which Faction they were
  14. Player: Which mat were they using?
  15.  
  16. Gold = Amount of Unspent gold
  17. Popularity thresholds: 0-6: Tier 1, 7-12: Tier 2, 13-18: Tier 3
  18. Stars: Number of Stars
  19. Territories: Number of owned territories (inc factories, flags, traps)
  20. Resources: Total count // 2 * some number
  21. Structure tiles: which one of the 7 is used
  22. """
  23.  
  24. def __init__(self, color, player_board, gold=0, popularity=0, stars=0, territories=0, resources=0, structure_gold=0):
  25. """Return a Score whose faction is *faction* and starting score is *gold* with popularity."""
  26. self.color = color
  27. self.player_board = player_board
  28. self.gold = gold
  29. self.popularity = popularity
  30. self.stars = stars
  31. self.territories = territories
  32. self.resources = resources
  33. self.structure_gold = structure_gold
  34.  
  35. def gold_score(self):
  36. """Calculate the Gold from the Popularity Track"""
  37. if self.popularity < 7:
  38. self.gold += (self.stars * 3 + self.territories * 2 + self.resources // 2 + self.structure_gold)
  39. return self.gold
  40. elif self.popularity < 13:
  41. self.gold += (self.stars * 4 + self.territories * 3 + (self.resources // 2) * 2 + self.structure_gold)
  42. return self.gold
  43. else:
  44. self.gold += (self.stars * 5 + self.territories * 4 + (self.resources // 2) * 3 + self.structure_gold)
  45. return self.gold
  46.  
  47. def game_of_scythe(players):
  48. while players == 0:
  49. print scores
  50. break
  51. #for i in scores:
  52. else:
  53. # Faction
  54. while True:
  55. faction_player = raw_input("What Faction, Player Mat combination was player {} playing? \n > Example: Saxony, Industrial || Rusviet, 2A \n > ".format(players))
  56. if faction_player = "!options":
  57. return """Factions | Player Board
  58. Saxony / Black | Industrial / 1
  59. Polandia / White | Militant / 2A
  60. Albion / Green | Agricultural /
  61. Nordic / Blue | Mechanical
  62. Rusviet / Red | Patriotic
  63. Togawa / Purple | Engineering
  64. Crimea / Yellow | Innovative"""
  65. else:
  66. faction, mat = map(str, faction_player.split(','))
  67. break
  68.  
  69. print('Ah, player {} was playing as: {} with the {} mat!'.format(players, faction, mat))
  70.  
  71. # "Stating Gold"
  72. while True:
  73. start_gold = int(raw_input("And how much Gold in coins did they end the game with (before scoring)? \n > "))
  74. if start_gold < 0:
  75. print('Sorry, I don\'t believe that\'s how much gold they have...')
  76. elif start_gold > 100:
  77. print('Sorry, I don\'t believe that\'s how much gold they have...')
  78. else:
  79. print('So, {} ended the game with {} coins. Let\'s start determining their score!'.format(faction, start_gold))
  80. break
  81.  
  82.  
  83. # popularity Add flair on tiers?
  84. pop = int(raw_input("And how much Popularity did {} accrue? \n > ".format(faction)))
  85. if pop < 7:
  86. print("Ah, so Tier 1, jerk...")
  87. elif pop < 13:
  88. print("Tier 2, well done!")
  89. elif pop < 19:
  90. print("Wow, Tier 3 of Scoring!")
  91. else:
  92. print("That's not a real score!")
  93.  
  94. # stars
  95. stars = int(raw_input("And how many Stars did {} place? \n > ".format(faction)))
  96. if stars > 6:
  97. print("That's not a real amount of Stars you can have! Start over!")
  98. game_of_scythe(players)
  99.  
  100. # territories
  101. print("""And how many Territories (in hexes) did {} control at the end of game?\nRemember, the Factory counts as 3 hexes, Albion's Flagged Territories count as 2 hexes.\nControl of Territories = Units (non-Airship) > Structure > Traps / Tokens
  102. """.format(faction))
  103. hexes = int(raw_input(" > "))
  104.  
  105. # resources
  106. resources = int(raw_input("And how many total resources did {} end with on those hexes? \n > ".format(faction)))
  107.  
  108. # structure gold
  109. struct_bonus = int(raw_input("How much Structure Bonus Gold did {} earn? \n > ".format(faction)))
  110.  
  111. # final tally:
  112. endscore = Score(faction, mat, start_gold, pop, stars, hexes, resources, struct_bonus)
  113. print("Okay, so the {} {} scored {}!").format(
  114. mat, faction, endscore.gold_score())
  115. scores.append([faction, mat, endscore.gold])
  116. players -= 1
  117. game_of_scythe(players)
  118.  
  119.  
  120. players = int(raw_input("How many players were in this game of Scythe (including Automa)? \n > "))
  121. scores = []
  122.  
  123. game_of_scythe(players)
Add Comment
Please, Sign In to add comment