diff --git a/ActionModul.py b/ActionModul.py
index a133e1d..0c5045d 100644
--- a/ActionModul.py
+++ b/ActionModul.py
@@ -2,8 +2,9 @@ import logging
class ActionModul:
- def isBlank(self,str):
- if str and len(str.strip()) == 0:
+ def isBlank(self,str):
+ logging.debug(f'isBlank(): str=*{str}*')
+ if str != None and len(str.strip()) == 0:
return True
return False
@@ -47,13 +48,15 @@ class ActionModul:
if schluessel != None and item.zustand != item.OFFEN:
item.zustand = item.OFFEN
+ schluessel.sichtbar = False
+ self.ausDemInventar(schluessel)
seil = self.world.findItemById(self.world.ITEM_SEIL)
seil.sichtbar = True
self.world.aktuellerRaum.items[seil.id] = seil
schwert = self.world.findItemById(self.world.ITEM_SCHWERT)
schwert.sichtbar = True
self.world.aktuellerRaum.items[schwert.id] = schwert
- self.setFehler('Aus der Truhe fallen ein Seil und ein Schwert.')
+ self.setFehler('Aus der Truhe fallen ein Seil und ein Schwert. Der kleine Schlüssel löst sich auf.')
else:
self.setFehler('Die Truhe ist verschlossen und dir fehlt der passende Schlüssel.')
@@ -94,7 +97,7 @@ class ActionModul:
def baueBruecke(self):
bach = self.world.sucheRaum(self.world.RAUM_BACH)
- bach.ausgaenge[self.world.SUED] = self.world.RAUM_TEICH
+ bach.ausgaenge[self.world.OST] = self.world.RAUM_TEICH
def ausDemInventar(self,item):
del self.world.inventar[item.id]
@@ -282,8 +285,11 @@ class ActionModul:
self.setFehler("diesen Gegenstand sehe ich hier nicht.")
- def hilfe(self):
- self.world.printText('hilfe')
+ def hilfe(self,parsedCommand):
+ if parsedCommand.gegenstand == 'befehle':
+ self.world.printBefehle()
+ else:
+ self.world.printText('hilfe')
def gehe(self,parsedCommand):
richtung = parsedCommand.gegenstand.lower()
diff --git a/TestModule.py b/TestModule.py
index ee6944a..fafa8e6 100644
--- a/TestModule.py
+++ b/TestModule.py
@@ -123,7 +123,7 @@ class TestModule:
self.schrittzaehler = self.schrittzaehler +1
#Zum Teich
- self.ac.sued()
+ self.ac.ost()
self.schrittzaehler = self.schrittzaehler +1
diff --git a/World.py b/World.py
index 692bdb9..6ec91ad 100644
--- a/World.py
+++ b/World.py
@@ -18,6 +18,21 @@ class World:
self.waitForCR()
self.printRaum()
+ def printBefehle(self):
+ self.clearScreen()
+ befehlar = []
+ count = 0
+ self.stdscr.addstr(5,1,'Das System versteht folgende Befehle:')
+ for befehlid in self.befehle:
+ befehl = self.befehle[befehlid].name
+ befehlar.append(befehl)
+ count = count +1
+ self.stdscr.addstr(6,1, str(befehlar))
+ self.waitForCR()
+
+
+ self.waitForCR()
+
def waitForCR(self):
self.stdscr.addstr(0,0,'Taste für Weiter',curses.color_pair(1))
self.stdscr.getch()
@@ -247,6 +262,7 @@ class World:
self.ITEM_FISCH = '17'
self.ITEM_SCHWERT = '18'
self.ITEM_BOXSACK = '19'
+ self.ITEM_MAUS = '20'
# Räume
@@ -261,6 +277,8 @@ class World:
self.RAUM_BACH = '8'
self.RAUM_FELD = '9'
self.RAUM_TEICH = '10'
+ self.RAUM_FELD = '11'
+ self.RAUM_KLEINES_FELD = '12'
self.fehler = ''
diff --git a/WorldParser.py b/WorldParser.py
index 3aae074..c7b9b05 100644
--- a/WorldParser.py
+++ b/WorldParser.py
@@ -5,12 +5,20 @@ import logging
class WorldParser():
+ def isBlank(self,str):
+ lenstr = len(str.strip())
+ logging.debug(f'isBlank(): {lenstr}')
+ if str == None or lenstr == 0:
+ return True
+ return False
+
def __init__(self,world):
self.neuerRaum = None
self.world = world
self.textCount = 0
def parseWorld(self,filename):
+
tree = ET.parse(filename)
root = tree.getroot()
@@ -91,6 +99,7 @@ class WorldParser():
imobil = item.attrib['imobil']
visible = item.attrib['visible']
adjektiv = item.attrib['adjektiv']
+ display = item.attrib['display']
raum = self.world.sucheRaum(raumid)
if raum is not None:
gegenstand.raum = raum.id
@@ -101,6 +110,12 @@ class WorldParser():
logging.error(f'Kein Raum für {gegenstand.name}')
gegenstand.adjektiv = adjektiv
+ logging.debug(f'display={display}, isBlank={self.isBlank(display)}')
+ if not self.isBlank(display):
+ gegenstand.display = display
+ else:
+ gegenstand.display = None
+
gegenstand.imobil = imobil.lower() in ['true','True','1']
logging.debug('itemid= ' + id + ',visible= ' + visible)
gegenstand.sichtbar = visible.lower() not in ['false','False','0']
diff --git a/data/Raum.py b/data/Raum.py
index a546996..8fd5410 100644
--- a/data/Raum.py
+++ b/data/Raum.py
@@ -43,7 +43,10 @@ class Raum(SuperNode):
item = self.items[itemid]
logging.debug('labelsGegenstaende(): Item ' + self.items[itemid].name + ' ist ' + str(item.sichtbar))
if item.sichtbar:
- labels.append(item.name)
+ if item.display != None:
+ labels.append(item.display)
+ else:
+ labels.append(item.name)
return labels
@@ -68,6 +71,7 @@ class Gegenstand(SuperNode):
self.sichtbar = True
self.imobil = False
self.adjektiv = None
+ self.display = None
self.GESCHLOSSEN = 0
self.OFFEN = 1
self.zustand = self.GESCHLOSSEN
diff --git a/data/__pycache__/Raum.cpython-38.pyc b/data/__pycache__/Raum.cpython-38.pyc
index adc3bb4..ddf33a0 100644
Binary files a/data/__pycache__/Raum.cpython-38.pyc and b/data/__pycache__/Raum.cpython-38.pyc differ
diff --git a/tomb.py b/tomb.py
index 1c91273..e29902b 100755
--- a/tomb.py
+++ b/tomb.py
@@ -55,7 +55,7 @@ def verarbeiteBefehl(parsedCommand):
elif id == '22':
actionmodul.fange(parsedCommand)
elif id == '23':
- actionmodul.hilfe()
+ actionmodul.hilfe(parsedCommand)
elif id == '24':
actionmodul.schlage(parsedCommand)
elif id == '-1':
diff --git a/world.xml b/world.xml
index c7e1cb9..a9d11b2 100644
--- a/world.xml
+++ b/world.xml
@@ -53,25 +53,34 @@
+
Du stehst an einem Bach.
-
+
Du stehst an einem Teich.
-
-
+
+
+
Ein Feld.
+
+
+
+
+ Ein kleineres Feld.
+
+
@@ -127,27 +136,29 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -183,13 +194,12 @@
Die Planke wirkt stabil genug, dein Gewicht zu tragen.
+
+ Der Teich wird vom Bach gespeist.Einige Wassertiere leben darin.
+
Der Boxsack trägt die Aufschrift: Eigentum von Maddes. Außerdem hat jemand ein großes V draufgemalt.
-
- Das Tor besteht aus schmideeisernen Stäben, die geschmiedete Querträger halten. Das Tor ist an den Seiten in Führungsschienen
- eingelassen. Auf der rechten Seite befindet sich etwa in der Mitte ein Schloss. Hinter dem Tor scheint ein Treppenhaus zu sein.
-
Das Grab des Azteken ist ein klassisches Textadventure.
Du bedienst es durch Befehle wie "nimm Schwert" oder "gehe Süd". Die Eingabe ist so flexibel wie möglich gestaltet, so dass