Gain more roaches
[koperkapel.git] / koperkapel / world.py
index 8097eb2ccf993b2a15fd91231717c042d5fe8c68..befc1a0a6b6d22ac51c9a46133a01309315c42ae 100644 (file)
@@ -3,6 +3,33 @@
 from .scenes.base import WorldEvent
 
 
+NAMES =[
+        "roupert",
+        "roachel",
+        "roeginald",
+        "roichard",
+        "rory",
+        "roalph",
+        "roabia",
+        "roafi",
+        "roaman",
+        "roemus",
+        "roadley",
+        "roanaell",
+        "roashwan",
+        "roashid",
+        "roaphael",
+        "roenfield",
+        "roani",
+        "roaya",
+        "roaza",
+        "robekka",
+        "rogan",
+        "roiana",
+        "roberta",
+       ]
+
+
 class World:
     """ World and player state. """
 
@@ -20,9 +47,9 @@ class World:
     def _build_initial_state(self):
         state = {}
         state["roaches"] = [
-            self._build_roach("roachel", smart=True),
-            self._build_roach("roeginald", strong=True),
-            self._build_roach("roichard", fast=True),
+            #self._build_roach("roachel", smart=True),
+            #self._build_roach("roeginald", strong=True),
+            #self._build_roach("roichard", fast=True),
             self._build_roach("roupert"),
         ]
         state["serums"] = [
@@ -69,6 +96,14 @@ class World:
     def proxy(self):
         return WorldDictProxy(self._state)
 
+    def add_new_roach(self):
+        roach_names = [x['name'] for x in self.roaches]
+        for cand in NAMES:
+            if cand not in roach_names:
+                roach = self._build_roach(cand)
+                self._state['roaches'].append(roach)
+                break
+
     def apply_event(self, action, *args, **kw):
         if action == "set":
             return self._apply_set(*args, **kw)