Mercurial > sypikslang
comparison gamelib/missions.py @ 180:8868ac7ece8b
Tweak steal research mission
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Sat, 12 May 2012 12:28:39 +0200 |
parents | 71db080a1fbf |
children | 07e81cd0cdd6 |
comparison
equal
deleted
inserted
replaced
179:71db080a1fbf | 180:8868ac7ece8b |
---|---|
569 NO_EQUIP_FAILURE = ( | 569 NO_EQUIP_FAILURE = ( |
570 "Your rival may not be the sharpest tool in the shed, but even a" | 570 "Your rival may not be the sharpest tool in the shed, but even a" |
571 " fool invests in some defenses. You'll need to be better prepared" | 571 " fool invests in some defenses. You'll need to be better prepared" |
572 " in the future.") | 572 " in the future.") |
573 | 573 |
574 def succeed(self, msg, state): | 574 def _succ(self, msg, state): |
575 reward = choice(('schematic', 'science', | 575 reward = choice(('schematic', 'science', |
576 'money', 'money', 'money', 'money', 'money', | 576 'money', 'money', 'money', 'money', 'money', |
577 'nothing', 'nothing', 'nothing')) | 577 'nothing', 'nothing', 'nothing')) |
578 if reward == 'nothing': | 578 if reward == 'nothing': |
579 msg = msg + (" Unfortunately, not only are these people working" | 579 self.succeed("%s Unfortunately, not only are these people working" |
580 " on ideas you've already covered, they're flat broke.") | 580 " on ideas you've already covered, they're flat broke." % msg, |
581 raise Result(SUCCESS, msg, money=0, rep=1) | 581 money=0, rep=1) |
582 elif reward == 'money': | 582 elif reward == 'money': |
583 msg = msg + (" While their research yields nothing of interest," | 583 self.succeed("%s While their research yields nothing of interest," |
584 " you can repurpose their funding to more worthy causes.") | 584 " you can repurpose their funding to more worthy causes." |
585 raise Result(SUCCESS, msg, money=randint(1000, 2000), rep=1) | 585 % msg, money=randint(1000, 2000), rep=1) |
586 elif reward == 'schematic': | 586 elif reward == 'schematic': |
587 msg = msg + (" You find the plans for a new device. How did" | 587 self.succeed("%s You find the plans for a new device. How did" |
588 " these fools stumble upon this?") | 588 " these fools stumble upon this?" % msg, |
589 raise Result(SUCCESS, msg, money=0, rep=randint(2, 5), | 589 money=0, rep=randint(2, 5), |
590 new_schematic=choice(state.lab.new_schematics)) | 590 new_schematic=choice(state.lab.new_schematics)) |
591 # New science | 591 # New science |
592 msg = msg + (" Their notes are most illuminating. You realise you have" | 592 self.succeed("%s Their notes are most illuminating. You realise you" |
593 " sadly neglected research into this field.") | 593 " have sadly neglected research into this field." % msg, |
594 raise Result(SUCCESS, msg, money=0, rep=randint(2, 5), | 594 money=0, rep=randint(2, 5), |
595 new_science=choice(state.lab.new_research)) | 595 new_science=choice(state.lab.new_research)) |
596 | 596 |
597 def attempt_with(self, categorised, state): | 597 def attempt_with(self, categorised, state): |
598 | 598 |
599 self.use_equipment(categorised) | 599 self.use_equipment(categorised) |
600 | 600 |
602 self.fail( | 602 self.fail( |
603 "While overwhelming force is always a tempting choice," | 603 "While overwhelming force is always a tempting choice," |
604 " total destruction of the lab will not help you cause.") | 604 " total destruction of the lab will not help you cause.") |
605 | 605 |
606 if cat.AI in categorised: | 606 if cat.AI in categorised: |
607 self.succeed("Your AI easily takes control of the lab's network.", | 607 self._succ("Your AI easily takes control of the lab's network.", |
608 state) | 608 state) |
609 | 609 |
610 if self.combat_power(categorised) > randint(20, 40): | 610 if self.combat_power(categorised) > randint(20, 40): |
611 self.succeed( | 611 self._succ( |
612 "The resistance is stiff, but your forces prevail" | 612 "The resistance is stiff, but your forces prevail" |
613 " thanks to your superior technology.", state) | 613 " thanks to your superior technology.", state) |
614 else: | 614 else: |
615 self.fail( | 615 self.fail( |
616 "The lab is surprisingly well defended for an operation" | 616 "The lab is surprisingly well defended for an operation" |