comparison gamelib/missions.py @ 247:594c45f0f685

Don't reward science or schematics when we know everything
author Neil Muller <drnlmuller@gmail.com>
date Sun, 13 May 2012 00:50:18 +0200
parents f5d9a063013b
children 7a6396ea2cc6
comparison
equal deleted inserted replaced
246:235b1faf590e 247:594c45f0f685
637 "Your rival may not be the sharpest tool in the shed, but even a" 637 "Your rival may not be the sharpest tool in the shed, but even a"
638 " fool invests in some defenses. You'll need to be better prepared" 638 " fool invests in some defenses. You'll need to be better prepared"
639 " in the future.") 639 " in the future.")
640 640
641 def _succ(self, msg, state): 641 def _succ(self, msg, state):
642 reward = choice(('schematic', 'science', 642 possible_rewards = ['schematic', 'science']
643 'money', 'money', 'money', 'money', 'money', 643 possible_rewards.extend(['money'] * 5)
644 'nothing', 'nothing', 'nothing')) 644 possible_rewards.extend(['nothing'] * 3)
645 if not state.lab.new_research:
646 possible_rewards.remove('science')
647 if not state.lab.new_schematics:
648 possible_rewards.remove('schematic')
649 reward = choice(possible_rewards)
645 if reward == 'nothing': 650 if reward == 'nothing':
646 self.succeed("%s Unfortunately, not only are these people working" 651 self.succeed("%s Unfortunately, not only are these people working"
647 " on ideas you've already covered, they're flat broke." % msg, 652 " on ideas you've already covered, they're flat broke." % msg,
648 money=0, rep=1) 653 money=0, rep=1)
649 elif reward == 'money': 654 elif reward == 'money':