sprechen mit dem Geist enthüllt den Auftrag.
This commit is contained in:
@@ -285,6 +285,14 @@ class ActionModul:
|
|||||||
self.setFehler("diesen Gegenstand sehe ich hier nicht.")
|
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):
|
def hilfe(self,parsedCommand):
|
||||||
if parsedCommand.gegenstand == 'befehle':
|
if parsedCommand.gegenstand == 'befehle':
|
||||||
self.world.printBefehle()
|
self.world.printBefehle()
|
||||||
|
15
World.py
15
World.py
@@ -150,6 +150,17 @@ class World:
|
|||||||
|
|
||||||
return None
|
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):
|
def findItemImInventar(self,itemname):
|
||||||
|
|
||||||
for itemid in self.inventar:
|
for itemid in self.inventar:
|
||||||
@@ -280,6 +291,10 @@ class World:
|
|||||||
self.RAUM_FELD = '11'
|
self.RAUM_FELD = '11'
|
||||||
self.RAUM_KLEINES_FELD = '12'
|
self.RAUM_KLEINES_FELD = '12'
|
||||||
|
|
||||||
|
# Personen
|
||||||
|
|
||||||
|
self.PERSON_GEIST = '4'
|
||||||
|
|
||||||
|
|
||||||
self.fehler = ''
|
self.fehler = ''
|
||||||
parser = WorldParser.WorldParser(self)
|
parser = WorldParser.WorldParser(self)
|
||||||
|
2
tomb.py
2
tomb.py
@@ -58,6 +58,8 @@ def verarbeiteBefehl(parsedCommand):
|
|||||||
actionmodul.hilfe(parsedCommand)
|
actionmodul.hilfe(parsedCommand)
|
||||||
elif id == '24':
|
elif id == '24':
|
||||||
actionmodul.schlage(parsedCommand)
|
actionmodul.schlage(parsedCommand)
|
||||||
|
elif id == '25':
|
||||||
|
actionmodul.sprich(parsedCommand)
|
||||||
elif id == '-1':
|
elif id == '-1':
|
||||||
world.fehler = 'Ich verstehe diesen Befehl nicht'
|
world.fehler = 'Ich verstehe diesen Befehl nicht'
|
||||||
else:
|
else:
|
||||||
|
23
world.xml
23
world.xml
@@ -115,6 +115,11 @@
|
|||||||
<command name='hilfe' id='28' key='23' />
|
<command name='hilfe' id='28' key='23' />
|
||||||
<command name='schlage' id='29' key='24' />
|
<command name='schlage' id='29' key='24' />
|
||||||
<command name='boxe' id='30' key='24' />
|
<command name='boxe' id='30' key='24' />
|
||||||
|
<command name='norden' id='31' key='5' />
|
||||||
|
<command name='süd' id='32' key='7' />
|
||||||
|
<command name='westen' id='33' key='8' />
|
||||||
|
<command name='sprich' id='34' key='25' />
|
||||||
|
|
||||||
|
|
||||||
</commandset>
|
</commandset>
|
||||||
|
|
||||||
@@ -162,10 +167,8 @@
|
|||||||
|
|
||||||
</items>
|
</items>
|
||||||
<personen>
|
<personen>
|
||||||
<person name=' Fisch' id='2' raum='2' bewegung='0' />
|
<person name='Fisch' id='2' raum='10' bewegung='0' />
|
||||||
<person name='Folterknecht' id='3' raum='2' bewegung='1' />
|
<person name='Geist' id='4' raum='2' bewegung='0' />
|
||||||
<person name='Geist' id='4' raum='3' bewegung='0' />
|
|
||||||
<person name='Maus' id='4' raum='2' bewegung='0' />
|
|
||||||
</personen>
|
</personen>
|
||||||
<messages>
|
<messages>
|
||||||
<pickup text='Das ist zu schwer' id='1' />
|
<pickup text='Das ist zu schwer' id='1' />
|
||||||
@@ -200,10 +203,20 @@
|
|||||||
<text id='item-19'>
|
<text id='item-19'>
|
||||||
Der Boxsack trägt die Aufschrift: Eigentum von Maddes. Außerdem hat jemand ein großes V draufgemalt.
|
Der Boxsack trägt die Aufschrift: Eigentum von Maddes. Außerdem hat jemand ein großes V draufgemalt.
|
||||||
</text>
|
</text>
|
||||||
|
<text id='item-20'>
|
||||||
|
Die ist mausetot.
|
||||||
|
</text>
|
||||||
<text id='hilfe'>
|
<text id='hilfe'>
|
||||||
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
|
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.
|
auch ganze Sätze wie "nimm das Schwert" verstanden werden.
|
||||||
|
Die Liste der möglichen Befehle erhälst du mit "hilfe befehle"
|
||||||
|
</text>
|
||||||
|
<text id='geist'>
|
||||||
|
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.
|
||||||
</text>
|
</text>
|
||||||
</texte>
|
</texte>
|
||||||
</welt>
|
</welt>
|
||||||
|
Reference in New Issue
Block a user