changeset 118:bc9da66ec333

merge
author Rizmari Versfeld <rizziepit@gmail.com>
date Wed, 09 May 2012 23:23:00 +0200
parents 94258a86f773 (current diff) a8a46c14d467 (diff)
children 9a30162f2a9c
files
diffstat 4 files changed, 94 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/lab.py	Wed May 09 23:22:42 2012 +0200
+++ b/gamelib/lab.py	Wed May 09 23:23:00 2012 +0200
@@ -43,9 +43,13 @@
             if schematic.STARTING_PRODUCT:
                 self._gain_science(schematic())
 
-        # We get three random sciences with no prerequisites.
-        new_science = []
-        for _ in range(3):
+        # We start with Physics, because it's not Philately.
+        physics = research.Physics()
+        self._gain_science(physics)
+        new_science = [physics]
+
+        # We get two other random sciences with no prerequisites.
+        for _ in range(2):
             science = choice(self.find_new_research())()
             self._gain_science(science)
             new_science.append(science)
--- a/gamelib/research.py	Wed May 09 23:22:42 2012 +0200
+++ b/gamelib/research.py	Wed May 09 23:23:00 2012 +0200
@@ -5,36 +5,70 @@
     SCIENCE_TYPE = 'research'
 
 
-class Tesla(ResearchArea):
-    NAME = "Tesla"
-
-
-class Robotics(ResearchArea):
-    NAME = "Robotics"
-
-
-class Rocketry(ResearchArea):
-    NAME = "Rocketry"
-
-
-class Biogenetics(ResearchArea):
-    NAME = "Biogenetics"
+class Physics(ResearchArea):
+    NAME = "Physics"
 
 
 class Psychology(ResearchArea):
     NAME = "Psychology"
 
 
-class Fusion(ResearchArea):
-    NAME = "Fusion"
+class MedicalExperiments(ResearchArea):
+    NAME = "Medical Experiments"
+
+
+class Meteorology(ResearchArea):
+    NAME = "Meteorology"
 
 
-class Medical(ResearchArea):
-    NAME = "Medical Experiments"
+class Biogenetics(ResearchArea):
+    NAME = "Biogenetics"
+    PREREQUISITES = (
+        (MedicalExperiments, 2),
+        )
+
+
+class Oceanography(ResearchArea):
+    NAME = "Oceanography"
+    PREREQUISITES = (
+        (Physics, 1),
+        (Meteorology, 1),
+        )
 
 
 class Lasers(ResearchArea):
     NAME = "Lasers"
+    PREREQUISITES = (
+        (Physics, 2),
+        )
+
+
+class Fusion(ResearchArea):
+    NAME = "Fusion"
+    PREREQUISITES = (
+        (Physics, 10),
+        )
+
+
+class Electrickery(ResearchArea):
+    NAME = "Electrickery"
+    PREREQUISITES = (
+        (Physics, 1),
+        )
+
+
+class Rocketry(ResearchArea):
+    NAME = "Rocketry"
+    PREREQUISITES = (
+        (Physics, 3),
+        )
+
+
+class Robotics(ResearchArea):
+    NAME = "Robotics"
+    PREREQUISITES = (
+        (Electrickery, 3),
+        )
 
 
 class Space(ResearchArea):
@@ -45,6 +79,14 @@
         )
 
 
+class MarineBiology(ResearchArea):
+    NAME = "Marine Biology"
+    PREREQUISITES = (
+        (Biogenetics, 2),
+        (Oceanography, 2),
+        )
+
+
 class ArtificialIntelligence(ResearchArea):
     NAME = "Artificial Intelligence"
     PREREQUISITES = (
--- a/gamelib/schematics.py	Wed May 09 23:22:42 2012 +0200
+++ b/gamelib/schematics.py	Wed May 09 23:23:00 2012 +0200
@@ -15,6 +15,8 @@
     'DOOMSDAY_DEVICE',
     'PATHOGEN',
     'MIND_CONTROL',
+    'BEAST',
+    'AQUATIC',
     )
 
 
@@ -85,7 +87,7 @@
     COST = 300
     CATEGORIES = (cat.HAND_WEAPON,)
     PREREQUISITES = (
-        (research.Tesla, 1),
+        (research.Electrickery, 1),
         )
 
 
@@ -94,7 +96,7 @@
     COST = 1000
     CATEGORIES = (cat.VEHICLE,)
     PREREQUISITES = (
-        (research.Tesla, 3),
+        (research.Electrickery, 3),
         )
 
 
@@ -114,3 +116,23 @@
     PREREQUISITES = (
         (research.Psychology, 2),
         )
+
+
+class GiantSquid(Schematic):
+    NAME = "giant squid"
+    COST = 50000
+    CATEGORIES = (cat.BEAST, cat.AQUATIC)
+    PREREQUISITES = (
+        (research.MarineBiology, 20),
+        (research.Biogenetics, 15),
+        )
+
+
+class SharksWithFrickinLasers(Schematic):
+    NAME = "sharks with frickin' lasers"
+    COST = 20000
+    CATEGORIES = (cat.BEAST, cat.AQUATIC)
+    PREREQUISITES = (
+        (research.MarineBiology, 10),
+        (research.Lasers, 7),
+        )
--- a/gamelib/tests/test_lab.py	Wed May 09 23:22:42 2012 +0200
+++ b/gamelib/tests/test_lab.py	Wed May 09 23:23:00 2012 +0200
@@ -6,9 +6,9 @@
 
 LAB_DATA = {
     'science': {
-        'research.Robotics': 1,
+        'research.Physics': 5,
         'research.Rocketry': 2,
-        'research.Tesla': 3,
+        'research.Electrickery': 3,
         },
     }
 
@@ -34,7 +34,7 @@
     def test_find_new_research(self):
         lab = Lab(LAB_DATA)
         new_research = lab.find_new_research()
-        self.assertTrue(research.Space in new_research)
+        self.assertTrue(research.Lasers in new_research)
         self.assertTrue(research.ArtificialIntelligence not in new_research)
 
     def test_save_data(self):