Klettern am Rankgitter.

Planke
This commit is contained in:
Olli Graf
2022-04-27 20:57:24 +02:00
parent db0493c49f
commit 23730e99ec
4 changed files with 20 additions and 6 deletions

View File

@@ -24,6 +24,16 @@ class ActionModul:
self.world.stdscr.addstr(zeile,0,item.name) self.world.stdscr.addstr(zeile,0,item.name)
zeile = zeile +1 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): def oeffne(self,parsedCommand):
item = self.world.findItemImInventarOderAktuellerRaum(parsedCommand.gegenstand); item = self.world.findItemImInventarOderAktuellerRaum(parsedCommand.gegenstand);
@@ -125,7 +135,7 @@ class ActionModul:
self.untersucheAktuellenRaum(parsedCommand) self.untersucheAktuellenRaum(parsedCommand)
def ziehe(self,parsedCommand): def ziehe(self,parsedCommand):
item = self.world.findIteminAktuellerRaum(parsedCommand.gegenstand) item = self.world.findItemInAktuellerRaum(parsedCommand.gegenstand)
if item != None: if item != None:
#alter Code! #alter Code!
@@ -135,7 +145,7 @@ class ActionModul:
self.setFehler('Das sehe ich hier nicht.') self.setFehler('Das sehe ich hier nicht.')
def nimm(self,parsedCommand): def nimm(self,parsedCommand):
item = self.world.findIteminAktuellerRaum(parsedCommand.gegenstand) item = self.world.findItemInAktuellerRaum(parsedCommand.gegenstand)
if item != None: if item != None:
if item.imobil: if item.imobil:

View File

@@ -85,11 +85,11 @@ class World:
item = self.findItemImInventar(itemname) item = self.findItemImInventar(itemname)
if item == None: if item == None:
item = self.findIteminAktuellerRaum(itemname) item = self.findItemInAktuellerRaum(itemname)
return item return item
def findIteminAktuellerRaum(self,itemname): def findItemInAktuellerRaum(self,itemname):
raum = self.aktuellerRaum raum = self.aktuellerRaum
for itemid in raum.items: for itemid in raum.items:

View File

@@ -47,6 +47,8 @@ def verarbeiteBefehl(parsedCommand):
actionmodul.stelle(parsedCommand) actionmodul.stelle(parsedCommand)
elif id == '20': elif id == '20':
actionmodul.oeffne(parsedCommand) actionmodul.oeffne(parsedCommand)
elif id == '21':
actionmodul.klettere(parsedCommand)
elif id == '-1': elif id == '-1':
world.fehler = 'Ich verstehe diesen Befehl nicht' world.fehler = 'Ich verstehe diesen Befehl nicht'
else: else:

View File

@@ -47,7 +47,7 @@
<ausgang dir='Runter' nachRaum='6' /> <ausgang dir='Runter' nachRaum='6' />
Du hast das Dach erklommen. Du hast das Dach erklommen.
<beschreibung> <beschreibung>
Du hast das Dach erklommen. Du hast das Dach erklommen. Aus dem Schornstein riecht es leicht nach verbranntem Buchenholz.
</beschreibung> </beschreibung>
</raum> </raum>
</ebene> </ebene>
@@ -79,6 +79,7 @@
<command name='stelle' id='21' key='19' /> <command name='stelle' id='21' key='19' />
<command name='stell' id='22' key='19' /> <command name='stell' id='22' key='19' />
<command name='öffne' id='23' key='20' /> <command name='öffne' id='23' key='20' />
<command name='klettere' id='24' key='21' />
</commandset> </commandset>
@@ -114,7 +115,8 @@
<item name='Schwert' id='11' raum='5' imobil='false' adjektiv = '0' msgid='1' visible='false' /> <item name='Schwert' id='11' raum='5' imobil='false' adjektiv = '0' msgid='1' visible='false' />
<item name='Seil' id='12' raum='5' imobil='false' adjektiv = '0' msgid='1' visible='false' /> <item name='Seil' id='12' raum='5' imobil='false' adjektiv = '0' msgid='1' visible='false' />
<item name='Haustürschlüssel' id='13' raum='4' imobil='false' adjektiv = '0' msgid='1' visible='false' /> <item name='Haustürschlüssel' id='13' raum='4' imobil='false' adjektiv = '0' msgid='1' visible='false' />
<item name='Rankgitter' id='14' raum='6' imobil='false' adjektiv = '0' msgid='1' visible='true' /> <item name='Rankgitter' id='14' raum='6' imobil='false' adjektiv = '0' msgid='3' visible='true' />
<item name='Planke' id='15' raum='7' imobil='false' adjektiv = '0' msgid='3' visible='true' />
</items> </items>
<personen> <personen>