diff gamelib/missions.py @ 241:f5d9a063013b

Fail very long equipment lists automatically
author Neil Muller <drnlmuller@gmail.com>
date Sun, 13 May 2012 00:16:44 +0200
parents 3731b3ca3b48
children 594c45f0f685
line wrap: on
line diff
--- a/gamelib/missions.py	Sun May 13 00:13:46 2012 +0200
+++ b/gamelib/missions.py	Sun May 13 00:16:44 2012 +0200
@@ -145,6 +145,12 @@
         if not equipment:
             return self.attempt_no_equipment(state)
 
+        # Fail overly complex plans automatically
+        if len(equipment) > 10:
+            self.fail(
+                "Your plan is much too complicated, doctor. Surely there"
+                " is a more elegant solution?")
+
         # Try with some equipment.
         self.attempt_with(self.categorise_equipment(equipment), state)