diff --git a/ActionModul.py b/ActionModul.py index 0c5045d..8899342 100644 --- a/ActionModul.py +++ b/ActionModul.py @@ -285,6 +285,14 @@ class ActionModul: self.setFehler("diesen Gegenstand sehe ich hier nicht.") + def sprich(self,parsedCommand): + geist = self.world.findPersonImAktuellenRaum(parsedCommand.gegenstand) + + if geist != None: + self.world.printText('geist') + else: + self.setFehler(f'{parsedCommand.gegenstand} ist nicht im Raum.') + def hilfe(self,parsedCommand): if parsedCommand.gegenstand == 'befehle': self.world.printBefehle() diff --git a/World.py b/World.py index 6ec91ad..b90773b 100644 --- a/World.py +++ b/World.py @@ -150,6 +150,17 @@ class World: return None + def findPersonImAktuellenRaum(self, personname): + raum = self.aktuellerRaum + + for persid in raum.personen: + person = raum.personen[persid] + + if person.name.lower() == personname.lower(): + return person + return None + + def findItemImInventar(self,itemname): for itemid in self.inventar: @@ -279,6 +290,10 @@ class World: self.RAUM_TEICH = '10' self.RAUM_FELD = '11' self.RAUM_KLEINES_FELD = '12' + + # Personen + + self.PERSON_GEIST = '4' self.fehler = '' diff --git a/tomb.py b/tomb.py index e29902b..1aa9136 100755 --- a/tomb.py +++ b/tomb.py @@ -58,6 +58,8 @@ def verarbeiteBefehl(parsedCommand): actionmodul.hilfe(parsedCommand) elif id == '24': actionmodul.schlage(parsedCommand) + elif id == '25': + actionmodul.sprich(parsedCommand) elif id == '-1': world.fehler = 'Ich verstehe diesen Befehl nicht' else: diff --git a/world.xml b/world.xml index a9d11b2..8794884 100644 --- a/world.xml +++ b/world.xml @@ -115,6 +115,11 @@ + + + + + @@ -162,10 +167,8 @@ - - - - + + @@ -200,10 +203,20 @@ Der Boxsack trägt die Aufschrift: Eigentum von Maddes. Außerdem hat jemand ein großes V draufgemalt. + + Die ist mausetot. + - Das Grab des Azteken ist ein klassisches Textadventure. + Das Grab des Azteken ist ein klassisches Textadventure. Es ist eine Adaption des gleichnamigen Adventures vom C64. Du bedienst es durch Befehle wie "nimm Schwert" oder "gehe Süd". Die Eingabe ist so flexibel wie möglich gestaltet, so dass auch ganze Sätze wie "nimm das Schwert" verstanden werden. + Die Liste der möglichen Befehle erhälst du mit "hilfe befehle" + + + Ich bin der Geist deines Großonkels Henry. Mein ganzes Leben habe ich damit verbracht, das Himmelsgrab der Azteken zu finden, wie zuvor + mein Vater. + Leider erfolglos. + Jetztmusst du dich auf die Suche machen, so dass ich endlich meinen Frieden finden kann.