diff --git a/ActionModul.py b/ActionModul.py index c7e9ff5..91d31c7 100644 --- a/ActionModul.py +++ b/ActionModul.py @@ -415,9 +415,10 @@ class ActionModul(ActionBasics): def nimm(self,parsedCommand): + logging.debug(f'start nimm() {parsedCommand.gegenstand}') item = self.world.findItemInAktuellerRaum(parsedCommand.gegenstand) - logging.debug(f'nimm(): item == {item}') + logging.debug(f'nimm(): item == {item.name}') if item != None: if item.imobil: text = self.world.msg[item.pickupmsg] @@ -459,9 +460,10 @@ class ActionModul(ActionBasics): def spring(self,parsedCommand): - if self.isRaum(self.world.RAUM_KLIPPE): + if self.isAktuellerRaum(self.world.RAUM_KLIPPE): weste = self.world.findItemImInventarById(self.world.ITEM_SCHWIMMWESTE) + logging.debug(f'weste={weste.zustand}') if weste != None and weste.zustand == weste.ANGEZOGEN: imwasser = self.world.findRaumById(self.world.RAUM_WASSER) @@ -565,11 +567,14 @@ class ActionModul(ActionBasics): def entzuende(self,parsedCommand): + logging.debug(f'entzünde {parsedCommand.gegenstand}') item = self.world.findItemImInventar(parsedCommand.gegenstand) if item == None: self.setFehler('Das besitzt du nicht.') + return + logging.debug(f'item={item}') if self.isItem(item, self.world.ITEM_FACKEL): self.toggleFackel(item) diff --git a/TestModule.py b/TestModule.py index cf627dc..a4a004a 100644 --- a/TestModule.py +++ b/TestModule.py @@ -44,7 +44,6 @@ class TestModule: self.ac.untersuche(pcmd) self.schrittzaehler += 1 - self.debug(f'Ausgänge: {self.world.aktuellerRaum.ausgaenge}') # In den Keller self.ac.runter() self.schrittzaehler += 1 @@ -147,9 +146,7 @@ class TestModule: self.testTeich() logging.debug('===== Beginn Testmodul Stier =====') - pcmd = self.parseInput('nimm Fisch') - self.ac.nimm(pcmd) - + # zum Bach self.ac.west() self.schrittzaehler += 1 @@ -358,3 +355,36 @@ class TestModule: self.ac.ost() self.schrittzaehler += 1 + + def testKlippe(self): + self.testInsel() + logging.debug('===== Beginn Testmodul Klippe =====') + + pcmd = self.parseInput('entzünde Fackel') + self.ac.entzuende(pcmd) + self.schrittzaehler += 1 + + #Loch + self.ac.runter() + self.schrittzaehler += 1 + + pcmd = self.parseInput('nimm Schwimmweste') + self.ac.nimm(pcmd) + self.schrittzaehler += 1 + + # Insel + self.ac.rauf() + self.schrittzaehler += 1 + # return + + #Beiboot + self.ac.ost() + self.schrittzaehler += 1 + #Boot + self.ac.rauf() + self.schrittzaehler += 1 + + #klippe + self.ac.nord() + self.schrittzaehler += 1 + diff --git a/World.py b/World.py index cff38b7..14d5dc9 100644 --- a/World.py +++ b/World.py @@ -169,6 +169,7 @@ class World: return raum return None + def sucheRaumName(self,name): if name == None: return self.aktuellerRaum @@ -214,6 +215,7 @@ class World: logging.debug(f'item.raumid={item.raumid}') logging.debug(f'findItemInAktuellerRaum() {itemname} - {item.name}') if item.raumid == raum.id and item.name.lower() == itemname.lower(): + logging.debug(f'return {item.name}') return item logging.debug(f'Item {itemname} nicht im aktuellen Raum gefunden') diff --git a/data/__pycache__/Raum.cpython-38.pyc b/data/__pycache__/Raum.cpython-38.pyc index bef0cda..3689a35 100644 Binary files a/data/__pycache__/Raum.cpython-38.pyc and b/data/__pycache__/Raum.cpython-38.pyc differ diff --git a/data/__pycache__/__init__.cpython-38.pyc b/data/__pycache__/__init__.cpython-38.pyc index b7d618c..75c81d1 100644 Binary files a/data/__pycache__/__init__.cpython-38.pyc and b/data/__pycache__/__init__.cpython-38.pyc differ diff --git a/tomb.py b/tomb.py index 249bc4c..a7318c6 100755 --- a/tomb.py +++ b/tomb.py @@ -74,6 +74,8 @@ def verarbeiteBefehl(parsedCommand): actionmodul.entzuende(parsedCommand) elif id == '31': actionmodul.loesche(parsedCommand) + elif id == '32': + actionmodul.spring(parsedCommand) elif id == '-1': world.fehler = 'Ich verstehe diesen Befehl nicht' else: @@ -152,6 +154,8 @@ def inputLoop(stdscr): testmodul.testHafen() elif debugcommand[1] == 'insel': testmodul.testInsel() + elif debugcommand[1] == 'klippe': + testmodul.testKlippe() world.fehler = '' diff --git a/world.xml b/world.xml index 5b9ffea..654db1c 100644 --- a/world.xml +++ b/world.xml @@ -301,6 +301,7 @@ +