Changeset 6.1.44
- Timestamp:
- 08/21/2016 04:08:39 AM (8 years ago)
- branch-nick:
- state
- revision id:
- dsowen@fugue88.ws-20160821040839-xv2bnfiuxv5lyayg
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main.py
r6.1.43 r6.1.44 100 100 self.team = team 101 101 102 def perform_mission(self): 103 failures = 0 104 for i in self.team: 105 if self.shared.role_deck[i] == "SPY": 106 if not self.shared.players[i].perform_mission(): 107 failures = failures + 1 108 109 success = failures < required_failures(self.shared.player_count, self.shared.mission) 110 111 for p in self.shared.players: 112 p.observe_mission(success, failures) 113 114 if success: 115 print("Mission succeeded") 116 self.shared.wins += 1 117 else: 118 print("Mission had {} failures".format(failures)) 119 self.shared.losses += 1 120 121 return AdvanceMission(self.shared) 122 102 123 103 124 def main(player_count): … … 119 140 120 141 shared = Shared(player_count, players, role_deck) 121 122 def perform_mission():123 failures = 0124 for i in state.team:125 if state.shared.role_deck[i] == "SPY":126 if not state.shared.players[i].perform_mission():127 failures = failures + 1128 129 success = failures < required_failures(state.shared.player_count, state.shared.mission)130 131 for p in state.shared.players:132 p.observe_mission(success, failures)133 134 if success:135 print("Mission succeeded")136 state.shared.wins += 1137 else:138 print("Mission had {} failures".format(failures))139 state.shared.losses += 1140 141 return AdvanceMission(shared)142 143 142 state = AdvanceMission(shared) 144 143 … … 149 148 state = state.do() 150 149 elif isinstance(state, PerformMission): 151 state = perform_mission()150 state = state.perform_mission() 152 151 153 152 if shared.team_failures == 5:
Note: See TracChangeset
for help on using the changeset viewer.