From 23730e99ec9bd60785d2ecc8301e6dadc95f28e2 Mon Sep 17 00:00:00 2001 From: Olli Graf Date: Wed, 27 Apr 2022 20:57:24 +0200 Subject: [PATCH] Klettern am Rankgitter. Planke --- ActionModul.py | 14 ++++++++++++-- World.py | 4 ++-- tomb.py | 2 ++ world.xml | 6 ++++-- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ActionModul.py b/ActionModul.py index a8400cb..19915e2 100644 --- a/ActionModul.py +++ b/ActionModul.py @@ -24,6 +24,16 @@ class ActionModul: self.world.stdscr.addstr(zeile,0,item.name) zeile = zeile +1 + def klettere(self, parsedCommand): + item = self.world.findItemInAktuellerRaum(parsedCommand.gegenstand) + + if item != None: + if item.id == self.world.ITEM_RANKGITTER: + self.rauf() + else: + self.setFehler('Das sehe ich hier nicht.') + + def oeffne(self,parsedCommand): item = self.world.findItemImInventarOderAktuellerRaum(parsedCommand.gegenstand); @@ -125,7 +135,7 @@ class ActionModul: self.untersucheAktuellenRaum(parsedCommand) def ziehe(self,parsedCommand): - item = self.world.findIteminAktuellerRaum(parsedCommand.gegenstand) + item = self.world.findItemInAktuellerRaum(parsedCommand.gegenstand) if item != None: #alter Code! @@ -135,7 +145,7 @@ class ActionModul: self.setFehler('Das sehe ich hier nicht.') def nimm(self,parsedCommand): - item = self.world.findIteminAktuellerRaum(parsedCommand.gegenstand) + item = self.world.findItemInAktuellerRaum(parsedCommand.gegenstand) if item != None: if item.imobil: diff --git a/World.py b/World.py index 5267aef..55127b9 100644 --- a/World.py +++ b/World.py @@ -85,11 +85,11 @@ class World: item = self.findItemImInventar(itemname) if item == None: - item = self.findIteminAktuellerRaum(itemname) + item = self.findItemInAktuellerRaum(itemname) return item - def findIteminAktuellerRaum(self,itemname): + def findItemInAktuellerRaum(self,itemname): raum = self.aktuellerRaum for itemid in raum.items: diff --git a/tomb.py b/tomb.py index ad48c2a..bd7da9b 100755 --- a/tomb.py +++ b/tomb.py @@ -47,6 +47,8 @@ def verarbeiteBefehl(parsedCommand): actionmodul.stelle(parsedCommand) elif id == '20': actionmodul.oeffne(parsedCommand) + elif id == '21': + actionmodul.klettere(parsedCommand) elif id == '-1': world.fehler = 'Ich verstehe diesen Befehl nicht' else: diff --git a/world.xml b/world.xml index 2816e7c..dcc5797 100644 --- a/world.xml +++ b/world.xml @@ -47,7 +47,7 @@ Du hast das Dach erklommen. - Du hast das Dach erklommen. + Du hast das Dach erklommen. Aus dem Schornstein riecht es leicht nach verbranntem Buchenholz. @@ -79,6 +79,7 @@ + @@ -114,7 +115,8 @@ - + +