X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=koperkapel%2Fworld.py;h=befc1a0a6b6d22ac51c9a46133a01309315c42ae;hb=0a4ee2b80d2af7627366380919dbe6d5204e2999;hp=8097eb2ccf993b2a15fd91231717c042d5fe8c68;hpb=111540d13839e7d7e684feba986837ac9d7f6322;p=koperkapel.git diff --git a/koperkapel/world.py b/koperkapel/world.py index 8097eb2..befc1a0 100644 --- a/koperkapel/world.py +++ b/koperkapel/world.py @@ -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)