From ebdf22f6a6a8c3cf502067f94fedac10c0e7d731 Mon Sep 17 00:00:00 2001 From: Olli Graf Date: Mon, 13 Jun 2022 14:59:55 +0200 Subject: [PATCH] Diamant und Sockel werden sichtbar. --- ActionModul.py | 12 ++++++++---- TestModule.py | 20 ++++++++++++++++++++ World.py | 6 ++++-- WorldParser.py | 3 +++ world.xml | 11 +++++++++-- 5 files changed, 44 insertions(+), 8 deletions(-) diff --git a/ActionModul.py b/ActionModul.py index 3108058..f72e5e0 100644 --- a/ActionModul.py +++ b/ActionModul.py @@ -277,6 +277,7 @@ class ActionModul(ActionBasics): return if item != None: + logging.debug(f'item.id = {item.id}') if item.id == self.world.ITEM_PFLANZE: krug = self.world.findRaumItemById(self.world.ITEM_KRUG) logging.debug(f'mache Gegenstand {krug.name} sichtbar') @@ -309,12 +310,15 @@ class ActionModul(ActionBasics): elif self.isItem(item,self.world.ITEM_KARTE): self.world.printKarte() elif self.isItem(item, self.world.ITEM_KOPF): - self.zeigeItemBeschreibung(item) - diamant = self.world.findItemById(self.world.ITEM_DIAMANT) - - self.macheItemSichtbar(diamant) + self.zeigeItemBeschreibung(item) + diamant = self.world.findItemById(self.world.ITEM_DIAMANT) + self.macheItemSichtbar(diamant) + elif self.isItem(item, self.world.ITEM_MAUER): + self.setFehler('In der Mauer wird ein Sockel sichtbar.') + sockel = self.world.findItemById(self.world.ITEM_SOCKEL) + self.macheItemSichtbar(sockel) else: self.zeigeItemBeschreibung(item) diff --git a/TestModule.py b/TestModule.py index 2cf64c2..755f9c4 100644 --- a/TestModule.py +++ b/TestModule.py @@ -413,4 +413,24 @@ class TestModule: #Statue self.ac.nord() self.schrittzaehler += 1 + + #Kopf + self.ac.rauf() + self.schrittzaehler += 1 + + pcmd = self.parseInput('untersuche Kopf') + self.ac.untersuche(pcmd) + self.schrittzaehler += 1 + + pcmd = self.parseInput('nimm Diamant') + self.ac.nimm(pcmd) + self.schrittzaehler += 1 + + #Statue + self.ac.runter() + self.schrittzaehler += 1 + + def testMauer(self): + self.testStatue() + \ No newline at end of file diff --git a/World.py b/World.py index 647eae3..9c0b8f4 100644 --- a/World.py +++ b/World.py @@ -408,8 +408,10 @@ class World: self.ITEM_DIAMANT = '38' self.ITEM_SOCKEL = '34' self.ITEM_PALME = '40' - self.ITEM_LOCH = '41' + self.ITEM_SOCKEL = '41' self.ITEM_KOPF = '42' + self.ITEM_MAUER = '43' + self.ITEM_LOCH = '44' # Räume @@ -451,7 +453,7 @@ class World: self.RAUM_WALD = '36' self.RAUM_STATUE = '37' self.RAUM_KOPF = '38' - self.RAUM_MAUER = '39' + self.RAUM_MAUER = '41' self.RAUM_GRAB = '40' diff --git a/WorldParser.py b/WorldParser.py index 1a9a856..9d5b9d8 100644 --- a/WorldParser.py +++ b/WorldParser.py @@ -123,6 +123,9 @@ class WorldParser(): gegenstand.pickupmsg = msgid # logging.debug('Item ' + gegenstand.name + ' - Pickup: ' + gegenstand.pickupmsg) + if id in self.world.gegenstaende: + raise ValueError(f'dopplete Item-Id {id}') + self.world.gegenstaende[id] = gegenstand # Personen diff --git a/world.xml b/world.xml index 2edf780..5e60e23 100644 --- a/world.xml +++ b/world.xml @@ -237,12 +237,13 @@ + Du stehst vor einer etwa 10m hohen Statue - + Nach einer kleinen Kletterpartie stehst du auf dem Kopf der Statue. @@ -372,8 +373,10 @@ - + + + @@ -457,6 +460,10 @@ | Club | ---------- + + Die Mauer wurde scheinbar vor ewigen Zeiten aus getrockneten Lehmziegel errichtet und die Fugen + anschlißend mit Lehm verputzt. + Der Kopf repräsentiert einen dir unbekannten Mann, der würdevoll über seine linke Schulter schaut.