Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c634711b57 | ||
![]() |
33ee761f32 | ||
![]() |
1249bb74ec | ||
![]() |
6ae6f3efd8 | ||
![]() |
227271ad09 | ||
![]() |
fef412580a | ||
![]() |
c2aca6cf07 | ||
![]() |
1b26d00042 | ||
![]() |
d67f6903c7 | ||
![]() |
15132268d0 | ||
![]() |
0651532a56 | ||
![]() |
e671a22fa2 | ||
![]() |
9fa3e55775 | ||
![]() |
80f4dd484e | ||
![]() |
0a0ffcbc5f | ||
![]() |
5b0b25cec1 | ||
![]() |
85d36993c1 | ||
![]() |
9230a418ae | ||
![]() |
3b29f77d57 | ||
![]() |
fd3187e61e | ||
![]() |
f702995afd | ||
![]() |
fe5ee8b197 |
67
ActionBasics.py
Normal file
67
ActionBasics.py
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
import logging
|
||||||
|
import inspect
|
||||||
|
|
||||||
|
class ActionBasics:
|
||||||
|
|
||||||
|
def __init__(self,world):
|
||||||
|
self.world = world
|
||||||
|
|
||||||
|
def debug(self, method, text):
|
||||||
|
logging.debug(f'ActionBasics: {text}')
|
||||||
|
|
||||||
|
def insInventar(self, item):
|
||||||
|
logging.debug(f'neu ins Inventar: {item.name}')
|
||||||
|
self.world.inventar[item.id] = item
|
||||||
|
|
||||||
|
def setFehler(self,text):
|
||||||
|
self.world.fehler =text
|
||||||
|
|
||||||
|
def clearFehler(self):
|
||||||
|
self.world.fehler = ''
|
||||||
|
|
||||||
|
def moveItemVonRaumNachInventar(self,item):
|
||||||
|
logging.debug(f'entferne aus aktuellen Raum {item.name}')
|
||||||
|
del self.world.aktuellerRaum.items[item.id]
|
||||||
|
logging.debug(f'ins Inventar {item.name}')
|
||||||
|
self.insInventar(item)
|
||||||
|
|
||||||
|
def moveItemVonInventarNachRaum(self,item, nachRaumId):
|
||||||
|
self.ausDemInventar(item)
|
||||||
|
raum = self.world.findRaumById(nachRaumId)
|
||||||
|
raum.items[item.id] = item
|
||||||
|
item.raumid = nachRaumId
|
||||||
|
|
||||||
|
def isItemAndAktRaum(self,item, itemid, raumid):
|
||||||
|
isItem = self.isItem(item,itemid)
|
||||||
|
isRaum = self.isAktuellerRaum(raumid)
|
||||||
|
|
||||||
|
logging.debug(f'isItem={isItem}, isRaum={isRaum}')
|
||||||
|
return isItem and isRaum
|
||||||
|
|
||||||
|
def isItem(self, item, itemid):
|
||||||
|
return item.id == itemid
|
||||||
|
|
||||||
|
def macheWegFrei(self, richtung, raumid):
|
||||||
|
logging.debug(f'Richtung {richtung} führt jetzt zu RaumId {raumid}')
|
||||||
|
self.world.aktuellerRaum.ausgaenge[richtung] = raumid
|
||||||
|
|
||||||
|
def findItemInAktuellerRaumById(self, itemid):
|
||||||
|
for itemid in self.world.aktuellerRaum.items:
|
||||||
|
raum = self.world.aktuellerRaum
|
||||||
|
|
||||||
|
item = self.world.aktuellerRaum.items[itemid]
|
||||||
|
logging.debug(f'{itemid} -{item.id}')
|
||||||
|
if item.id == itemid:
|
||||||
|
return item
|
||||||
|
return None
|
||||||
|
|
||||||
|
def personVonRaumNachRaum(self, person, vonRaumId, nachRaumId):
|
||||||
|
vonRaum = self.world.findRaumById(vonRaumId)
|
||||||
|
nachRaum = self.world.findRaumById(nachRaumId)
|
||||||
|
|
||||||
|
del vonRaum.personen[person.id]
|
||||||
|
nachRaum.personen[person.id] = person
|
||||||
|
person.raumid = nachRaumId
|
||||||
|
|
||||||
|
|
||||||
|
|
343
ActionModul.py
343
ActionModul.py
@@ -1,15 +1,19 @@
|
|||||||
import logging
|
# Actionmdul - hier werden die Kommandos ausgeführt und die Spielwelt entsprend aktualisiert.
|
||||||
|
|
||||||
class ActionModul:
|
import logging
|
||||||
|
from ActionBasics import ActionBasics
|
||||||
|
|
||||||
|
class ActionModul(ActionBasics):
|
||||||
|
|
||||||
def isBlank(self,str):
|
def isBlank(self,str):
|
||||||
if str and len(str.strip()) == 0:
|
logging.debug(f'isBlank(): str=*{str}*')
|
||||||
|
if str != None and len(str.strip()) == 0:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def __init__(self, world):
|
def __init__(self, world):
|
||||||
|
|
||||||
self.world = world
|
super().__init__(world)
|
||||||
|
|
||||||
def warte(self):
|
def warte(self):
|
||||||
print('Du wartest')
|
print('Du wartest')
|
||||||
@@ -30,10 +34,19 @@ class ActionModul:
|
|||||||
if item != None:
|
if item != None:
|
||||||
if item.id == self.world.ITEM_RANKGITTER:
|
if item.id == self.world.ITEM_RANKGITTER:
|
||||||
self.rauf()
|
self.rauf()
|
||||||
|
elif item.id == self.world.ITEM_BOHNENRANKE:
|
||||||
|
if item.zustand == item.GROSS:
|
||||||
|
self.rauf()
|
||||||
|
else:
|
||||||
|
self.setFehler('zum Klettern ist die Bohnenranke zu klein.')
|
||||||
else:
|
else:
|
||||||
self.setFehler('Das sehe ich hier nicht.')
|
self.setFehler('Das sehe ich hier nicht.')
|
||||||
|
|
||||||
|
|
||||||
|
def vanishItem(self, item):
|
||||||
|
item.sichtbar = False
|
||||||
|
self.ausDemInventar(item)
|
||||||
|
|
||||||
def oeffne(self,parsedCommand):
|
def oeffne(self,parsedCommand):
|
||||||
item = self.world.findItemImInventarOderAktuellerRaum(parsedCommand.gegenstand);
|
item = self.world.findItemImInventarOderAktuellerRaum(parsedCommand.gegenstand);
|
||||||
|
|
||||||
@@ -45,41 +58,96 @@ class ActionModul:
|
|||||||
logging.debug('öffne Truhe')
|
logging.debug('öffne Truhe')
|
||||||
schluessel = self.world.findItemImInventarById(self.world.ITEM_KLEINER_SCHLUESSEL)
|
schluessel = self.world.findItemImInventarById(self.world.ITEM_KLEINER_SCHLUESSEL)
|
||||||
|
|
||||||
if schluessel != None:
|
self.vanishItem(schluessel)
|
||||||
|
|
||||||
|
if schluessel != None and item.zustand != item.OFFEN:
|
||||||
item.zustand = item.OFFEN
|
item.zustand = item.OFFEN
|
||||||
self.setFehler('Truhe ist jetzt offen')
|
seil = self.world.findItemById(self.world.ITEM_SEIL)
|
||||||
|
seil.raumid = self.world.aktuellerRaum.id
|
||||||
|
seil.sichtbar = True
|
||||||
|
self.world.aktuellerRaum.items[seil.id] = seil
|
||||||
|
schwert = self.world.findItemById(self.world.ITEM_SCHWERT)
|
||||||
|
schwert.sichtbar = True
|
||||||
|
schwert.raumid = self.world.aktuellerRaum.id
|
||||||
|
self.world.aktuellerRaum.items[schwert.id] = schwert
|
||||||
|
self.setFehler('Aus der Truhe fallen ein Seil und ein Schwert. Der kleine Schlüssel löst sich auf.')
|
||||||
else:
|
else:
|
||||||
self.setFehler('Die Truhe ist verschlossen und dir fehlt der passende Schlüssel.')
|
self.setFehler('Die Truhe ist verschlossen und dir fehlt der passende Schlüssel.')
|
||||||
|
|
||||||
elif item.id == self.world.ITEM_HAUSTUER:
|
elif item.id == self.world.ITEM_HAUSTUER:
|
||||||
if self.world.aktuellerRaum.id == self.world.RAUM_FLUR:
|
if self.isAktuellerRaum(self.world.RAUM_FLUR):
|
||||||
schluessel = self.world.findItemImInventarById(self.world.ITEM_HAUSTUERSCHLUESSEL)
|
schluessel = self.world.findItemImInventarById(self.world.ITEM_HAUSTUERSCHLUESSEL)
|
||||||
|
|
||||||
logging.debug(f'öffne Haustür Schlüssel ist {schluessel}')
|
logging.debug(f'öffne Haustür Schlüssel ist {schluessel}')
|
||||||
if schluessel != None:
|
if schluessel != None:
|
||||||
item.zustand = item.OFFEN
|
item.zustand = item.OFFEN
|
||||||
self.setFehler('Die Haustür ist geöffnet und führt in den Garten.')
|
self.vanishItem(schluessel)
|
||||||
|
self.setFehler('Die Haustür ist geöffnet,der Haustürschlüssel löst sich auf.')
|
||||||
self.world.aktuellerRaum.ausgaenge[self.world.SUED] = self.world.RAUM_GARTEN
|
self.world.aktuellerRaum.ausgaenge[self.world.SUED] = self.world.RAUM_GARTEN
|
||||||
else:
|
else:
|
||||||
logging.debug('öffne Haustür kein Haustürschlüssel')
|
|
||||||
self.setFehler('Die Tür ist verschlossen.')
|
self.setFehler('Die Tür ist verschlossen.')
|
||||||
|
elif item.id == self.world.ITEM_GATTER:
|
||||||
|
logging.debug('Gatter öffnen')
|
||||||
|
if self.isAktuellerRaum(self.world.RAUM_WIESE):
|
||||||
|
stier = self.world.findPersonImAktuellenRaum(self.world.PERSON_STIER)
|
||||||
|
|
||||||
|
logging.debug('Stier ist {stier}')
|
||||||
|
|
||||||
|
if stier != None:
|
||||||
|
item.zustand = item.OFFEN
|
||||||
|
self.macheWegFrei(self.world.SUED,self.world.RAUM_BRACHLAND)
|
||||||
|
self.setFehler('Das Gatter steht offen.')
|
||||||
|
else:
|
||||||
|
self.setFehler(f'Der {stier.name} steht dir im Weg.')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def isAktuellerRaum(self, raumid):
|
||||||
|
return self.world.aktuellerRaum.id == raumid
|
||||||
|
|
||||||
|
def benutze(self, parsedCommand):
|
||||||
|
item = self.world.findItemImInventarOderAktuellerRaum(parsedCommand.gegenstand);
|
||||||
|
|
||||||
|
if item.id ==self.world.ITEM_JACKE:
|
||||||
|
self.setFehler('Also du die Jacke anziehst, findest du einen kleine Schlüssel in der Tasche.')
|
||||||
|
self.findeTruhenschluessel()
|
||||||
|
elif item.id == self.world.ITEM_LEITER:
|
||||||
|
if(self.world.aktuellerRaum.id == self.world.RAUM_ESSZIMMER):
|
||||||
|
logging.debug(f'aktuellerRaum ist {self.world.aktuellerRaum.id}')
|
||||||
|
self.rauf()
|
||||||
|
elif item.id == self.world.ITEM_PLANKE:
|
||||||
|
if self.isAktuellerRaum(self.world.RAUM_BACH):
|
||||||
|
self.baueBruecke()
|
||||||
|
self.setFehler('Du legst die Planke über den Bach und es ensteht eine Brücke.')
|
||||||
|
else:
|
||||||
|
self.setFehler('Das macht hier keinen Sinn.')
|
||||||
|
|
||||||
|
|
||||||
|
def baueBruecke(self):
|
||||||
|
bach = self.world.sucheRaum(self.world.RAUM_BACH)
|
||||||
|
bach.ausgaenge[self.world.OST] = self.world.RAUM_TEICH
|
||||||
|
|
||||||
|
def ausDemInventar(self,item):
|
||||||
|
del self.world.inventar[item.id]
|
||||||
|
self.world.aktuellerRaum.items[item.id] = item
|
||||||
|
item.raumid = self.world.aktuellerRaum.id
|
||||||
|
|
||||||
def verliere(self,parsedCommand):
|
def verliere(self,parsedCommand):
|
||||||
item = self.world.findItemImInventar(parsedCommand.gegenstand);
|
item = self.world.findItemImInventar(parsedCommand.gegenstand);
|
||||||
|
|
||||||
|
|
||||||
|
logging.debug(f'verliere Item {item}')
|
||||||
if item != None:
|
if item != None:
|
||||||
del self.world.inventar[item.id]
|
|
||||||
self.world.aktuellerRaum.items[item.id] = item
|
if self.isAktuellerRaum(self.world.RAUM_BACH):
|
||||||
|
if item.id == self.world.ITEM_PLANKE:
|
||||||
|
self.baueBruecke()
|
||||||
|
self.setFehler('Du legst die Planke über den Bach und es ensteht eine Brücke über den Bach')
|
||||||
|
|
||||||
|
self.ausDemInventar(item)
|
||||||
else:
|
else:
|
||||||
self.setFehler("Diesen Gegenstand besitzt du nicht.")
|
self.setFehler("Diesen Gegenstand besitzt du nicht.")
|
||||||
|
|
||||||
def setFehler(self,text):
|
|
||||||
self.world.fehler =text
|
|
||||||
|
|
||||||
def clearFehler(self):
|
|
||||||
self.world.fehler = ''
|
|
||||||
|
|
||||||
|
|
||||||
def stelle(self,parsedCommand):
|
def stelle(self,parsedCommand):
|
||||||
@@ -87,7 +155,7 @@ class ActionModul:
|
|||||||
|
|
||||||
if item != None:
|
if item != None:
|
||||||
logging.debug('stelle() item.id=' + str(item.id))
|
logging.debug('stelle() item.id=' + str(item.id))
|
||||||
if item.id == self.world.ITEM_GLAS:
|
if item.id == self.world.ITEM_KRUG:
|
||||||
self.world.aktuellerRaum.ausgaenge[self.world.NORD] = '5'
|
self.world.aktuellerRaum.ausgaenge[self.world.NORD] = '5'
|
||||||
self.verliere(parsedCommand)
|
self.verliere(parsedCommand)
|
||||||
self.world.printText('1')
|
self.world.printText('1')
|
||||||
@@ -99,37 +167,105 @@ class ActionModul:
|
|||||||
|
|
||||||
logging.debug(f'raumId {raum.id}')
|
logging.debug(f'raumId {raum.id}')
|
||||||
logging.debug(f'untersucheAktuellenRaum() {parsedCommand.gegenstand} in {self.world.aktuellerRaum.id}')
|
logging.debug(f'untersucheAktuellenRaum() {parsedCommand.gegenstand} in {self.world.aktuellerRaum.id}')
|
||||||
if raum.id == self.world.aktuellerRaum.id:
|
if self.isAktuellerRaum(raum.id):
|
||||||
logging.debug(f'untersuche aktuellen Raum {raum.name}')
|
logging.debug(f'untersuche aktuellen Raum {raum.name}')
|
||||||
if raum.id == '5':
|
|
||||||
#Schlüssel im Keller sichtbar machen
|
|
||||||
logging.debug('mache Schlüssel sichtbar')
|
|
||||||
self.setFehler('Auf dem Boden findest du einen kleinen Schlüssel.')
|
|
||||||
schluessel = self.world.findRaumItemById(self.world.ITEM_KLEINER_SCHLUESSEL)
|
|
||||||
schluessel.sichtbar = True
|
|
||||||
|
|
||||||
|
|
||||||
|
def findeTruhenschluessel(self):
|
||||||
|
schluessel = self.world.findItemById(self.world.ITEM_KLEINER_SCHLUESSEL)
|
||||||
|
|
||||||
|
logging.debug(f'Schlüssel ist sichtbar {schluessel.sichtbar}')
|
||||||
|
if not schluessel.sichtbar:
|
||||||
|
logging.debug('mache Schlüssel sichtbar')
|
||||||
|
self.setFehler('In der Jackentasche findest du einen kleinen Schlüssel.')
|
||||||
|
schluessel.sichtbar = True
|
||||||
|
self.insInventar(schluessel)
|
||||||
|
|
||||||
|
def schlage(self, parsedCommand):
|
||||||
|
item = self.world.findItemInAktuellerRaum(parsedCommand.gegenstand)
|
||||||
|
|
||||||
|
if item.id == self.world.ITEM_BOXSACK:
|
||||||
|
self.setFehler('Der Boxsack sagt: Hmm, hmm?')
|
||||||
|
|
||||||
|
def leere(self, parsedCommand):
|
||||||
|
item = self.world.findItemImInventar(parsedCommand.gegenstand)
|
||||||
|
|
||||||
|
if item.id == self.world.ITEM_KRUG:
|
||||||
|
if self.isAktuellerRaum(self.world.RAUM_BRACHLAND):
|
||||||
|
if item.zustand == item.VOLL:
|
||||||
|
ranke = self.world.findItemById(self.world.ITEM_BOHNENRANKE)
|
||||||
|
|
||||||
|
if ranke.zustand < ranke.GROSS:
|
||||||
|
ranke.zustand = ranke.zustand +1
|
||||||
|
self.setFehler('Die Bohnenranke wächst.')
|
||||||
|
if ranke.zustand == ranke.GROSS:
|
||||||
|
self.world.aktuellerRaum.ausgaenge[self.world.RAUF] = self.world.RAUM_BOHNENRANKE
|
||||||
|
self.setFehler('Die Bohnenranke reicht jetzt bis in die Wolken hinein.')
|
||||||
|
else:
|
||||||
|
self.setFehler('Der Krug ist leer')
|
||||||
|
else:
|
||||||
|
item.zustand = item.LEER
|
||||||
|
|
||||||
|
def fuelle(self, parsedCommand):
|
||||||
|
item = self.world.findItemImInventar(parsedCommand.gegenstand)
|
||||||
|
|
||||||
|
if item.id == self.world.ITEM_KRUG:
|
||||||
|
if self.isAktuellerRaum(self.world.RAUM_TEICH):
|
||||||
|
item.zustand = item.VOLL
|
||||||
|
self.setFehler('Der Krug ist jetzt voll')
|
||||||
|
|
||||||
|
def zeigeItemBeschreibung(self,item):
|
||||||
|
textid = f'item-{item.id}'
|
||||||
|
if item.id == self.world.ITEM_BOHNENRANKE:
|
||||||
|
textid = f'item-{item.id}-{item.zustand}'
|
||||||
|
else:
|
||||||
|
textid = f'item-{item.id}'
|
||||||
|
self.world.printText(textid)
|
||||||
|
|
||||||
def untersuche(self,parsedCommand):
|
def untersuche(self,parsedCommand):
|
||||||
logging.debug(f'untersuche() suche nach Gegenstand: {parsedCommand.gegenstand}')
|
logging.debug(f'untersuche() suche nach Gegenstand: {parsedCommand.gegenstand}')
|
||||||
if parsedCommand.gegenstand == None:
|
if parsedCommand.gegenstand == None:
|
||||||
self.untersucheAktuellenRaum
|
self.untersucheAktuellenRaum()
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
item = self.world.findItemImInventarOderAktuellerRaum(parsedCommand.gegenstand)
|
item = self.world.findItemImInventarOderAktuellerRaum(parsedCommand.gegenstand)
|
||||||
|
if item == None:
|
||||||
|
self.setFehler('Das sehe ich hier nicht')
|
||||||
|
return
|
||||||
|
|
||||||
if item != None:
|
if item != None:
|
||||||
if item.id == '4':
|
if item.id == self.world.ITEM_PFLANZE:
|
||||||
glas = self.world.findRaumItemById(self.world.ITEM_GLAS)
|
krug = self.world.findRaumItemById(self.world.ITEM_KRUG)
|
||||||
logging.debug(f'mache Gegenstand {glas.name} sichtbar')
|
logging.debug(f'mache Gegenstand {krug.name} sichtbar')
|
||||||
glas.sichtbar = True
|
krug.sichtbar = True
|
||||||
|
self.setFehler('Die Pflanze ist in einen Krug gepflanzt.')
|
||||||
elif item.id == self.world.ITEM_BETT:
|
elif item.id == self.world.ITEM_BETT:
|
||||||
# Falltür sichtbar machen
|
# Falltür sichtbar machen
|
||||||
self.world.aktuellerRaum.ausgaenge[self.world.RUNTER] = self.world.RAUM_KELLER
|
self.world.aktuellerRaum.ausgaenge[self.world.RUNTER] = self.world.RAUM_KELLER
|
||||||
|
logging.debug('untersuche(): Keller ist jetzt zugänglich')
|
||||||
self.setFehler('Im Boden unter dem Bett findest du eine Falltür, die nach unten führt.')
|
self.setFehler('Im Boden unter dem Bett findest du eine Falltür, die nach unten führt.')
|
||||||
elif item.id == self.world.ITEM_NACHTSCHRANK:
|
elif item.id == self.world.ITEM_NACHTSCHRANK:
|
||||||
self.setFehler('In der Schublade findest du einen Schlüssel')
|
self.setFehler('In der Schublade findest du einen Schlüssel')
|
||||||
schluessel = self.world.findRaumItemById(self.world.ITEM_HAUSTUERSCHLUESSEL)
|
schluessel = self.world.findRaumItemById(self.world.ITEM_HAUSTUERSCHLUESSEL)
|
||||||
schluessel.sichtbar = True
|
schluessel.sichtbar = True
|
||||||
|
elif item.id == self.world.ITEM_TEICH:
|
||||||
|
fisch = self.world.findItemById(self.world.ITEM_FISCH)
|
||||||
|
|
||||||
|
if fisch.raumid == self.world.RAUM_TEICH:
|
||||||
|
fisch.sichtbar = True
|
||||||
|
self.setFehler('Im Teich schwimmt ein kleiner Fisch')
|
||||||
|
fisch = self.world.findItemById(self.world.ITEM_FISCH)
|
||||||
|
fisch.sichtbar = True
|
||||||
|
elif item.id == self.world.ITEM_JACKE:
|
||||||
|
self.findeTruhenschluessel()
|
||||||
|
elif item.id == self.world.ITEM_FISCH:
|
||||||
|
self.zeigeItemBeschreibung(item)
|
||||||
|
item.sichtbar = False
|
||||||
|
self.ausDemInventar(item)
|
||||||
|
else:
|
||||||
|
self.zeigeItemBeschreibung(item)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
logging.debug('Kein Item gefunden, suche nach Raum')
|
logging.debug('Kein Item gefunden, suche nach Raum')
|
||||||
self.untersucheAktuellenRaum(parsedCommand)
|
self.untersucheAktuellenRaum(parsedCommand)
|
||||||
@@ -144,9 +280,81 @@ class ActionModul:
|
|||||||
else:
|
else:
|
||||||
self.setFehler('Das sehe ich hier nicht.')
|
self.setFehler('Das sehe ich hier nicht.')
|
||||||
|
|
||||||
|
def fange(self, parsedCommand):
|
||||||
|
skip
|
||||||
|
|
||||||
|
def wirf(self,parsedCommand):
|
||||||
|
item = self.world.findItemImInventar(parsedCommand.gegenstand)
|
||||||
|
|
||||||
|
if item == None:
|
||||||
|
self.setFehler('Das besitzt du nicht.')
|
||||||
|
return
|
||||||
|
|
||||||
|
if self.isItemAndAktRaum(item, self.world.ITEM_SEIL,self.world.RAUM_BAUM):
|
||||||
|
self.world.printText('seilwurf')
|
||||||
|
self.macheWegFrei(self.world.RAUF,self.world.RAUM_BAUMHAUS)
|
||||||
|
self.ausDemInventar(item)
|
||||||
|
elif self.isAktuellerRaum(self.world.RAUM_BOHNENRANKE):
|
||||||
|
if self.isItem(item, self.world.ITEM_MAUS):
|
||||||
|
|
||||||
|
elefant = self.findItemInAktuellerRaumById(self.world.ITEM_ELEFANT)
|
||||||
|
|
||||||
|
logging.debug(f'Elefant - {elefant}')
|
||||||
|
if elefant != None:
|
||||||
|
self.world.printText('mauswurf')
|
||||||
|
self.ausDemInventar(item)
|
||||||
|
self.macheWegFrei(self.world.SUED,self.world.RAUM_PFAD)
|
||||||
|
del self.world.aktuellerRaum.items[elefant.id]
|
||||||
|
else:
|
||||||
|
self.setFehler('Der Elefant ist schon geflohen.')
|
||||||
|
else:
|
||||||
|
self.setFehler('Das besitzt du nicht')
|
||||||
|
elif self.isAktuellerRaum(self.world.RAUM_WIESE):
|
||||||
|
logging.debug('Jackenwurf')
|
||||||
|
stier = self.world.findPersonImAktuellenRaumById(self.world.PERSON_STIER)
|
||||||
|
jacke = self.world.findItemImInventarById(self.world.ITEM_JACKE)
|
||||||
|
|
||||||
|
logging.debug(f'Stier {stier},Jacke {jacke}')
|
||||||
|
if stier != None:
|
||||||
|
if jacke != None:
|
||||||
|
self.world.printText('jackewurf')
|
||||||
|
self.personVonRaumNachRaum(stier,self.world.aktuellerRaum.id, self.world.RAUM_FELD)
|
||||||
|
self.moveItemVonInventarNachRaum(jacke, self.world.RAUM_FELD)
|
||||||
|
else:
|
||||||
|
self.setFehler('Die trägst du nicht bei dir.')
|
||||||
|
else:
|
||||||
|
self.verliere(parsedCommand)
|
||||||
|
else:
|
||||||
|
self.verliere(parsedCommand)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def klettere(self, parsedCommand):
|
||||||
|
leiter = self.world.findItemInAktuellerRaum(parsedCommand.gegenstand)
|
||||||
|
|
||||||
|
logging.debug(f'klettere(): Leiter is {leiter}')
|
||||||
|
if leiter != None:
|
||||||
|
if self.isAktuellerRaum(self.world.RAUM_ESSZIMMER):
|
||||||
|
logging.debug(f'aktuellerRaum ist {self.world.aktuellerRaum.id}')
|
||||||
|
self.rauf()
|
||||||
|
elif self.isAktuellerRaum(self.world.RAUM_BRACHLAND):
|
||||||
|
ranke = self.findItemImInventarOderAktuellerRaum(self.world.ITEM_BOHNENRANKE)
|
||||||
|
|
||||||
|
if ranke.zustand == Gegenstand.GROSS:
|
||||||
|
self.ac.rauf()
|
||||||
|
else:
|
||||||
|
self.setFehler('Die Bohnenranke ist zu klein, um daran hoch zu klettern.')
|
||||||
|
else:
|
||||||
|
self.setFehler('Eine Leiter sehe ich hier nicht.')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def nimm(self,parsedCommand):
|
def nimm(self,parsedCommand):
|
||||||
item = self.world.findItemInAktuellerRaum(parsedCommand.gegenstand)
|
item = self.world.findItemInAktuellerRaum(parsedCommand.gegenstand)
|
||||||
|
|
||||||
|
logging.debug(f'nimm(): item == {item}')
|
||||||
if item != None:
|
if item != None:
|
||||||
if item.imobil:
|
if item.imobil:
|
||||||
text = self.world.msg[item.pickupmsg]
|
text = self.world.msg[item.pickupmsg]
|
||||||
@@ -157,21 +365,84 @@ class ActionModul:
|
|||||||
text = self.world.msg[item.pickupmsg]
|
text = self.world.msg[item.pickupmsg]
|
||||||
self.setFehler(text)
|
self.setFehler(text)
|
||||||
else:
|
else:
|
||||||
del self.world.aktuellerRaum.items[item.id]
|
|
||||||
self.world.inventar[item.id] = item
|
aufnehmen = True
|
||||||
|
|
||||||
|
logging.debug(f'nimm(): RaumId== {self.world.aktuellerRaum.id}')
|
||||||
|
if self.isAktuellerRaum(self.world.RAUM_BACH):
|
||||||
|
logging.debug(f'nimm(): ItemId == {item.id}')
|
||||||
|
if item.id == self.world.ITEM_PLANKE:
|
||||||
|
logging.debug('nehme Planke am Bach')
|
||||||
|
self.world.aktuellerRaum.ausgaenge[self.world.SUED] = '-1'
|
||||||
|
elif self.isAktuellerRaum(self.world.RAUM_TEICH):
|
||||||
|
if item.id == self.world.ITEM_FISCH:
|
||||||
|
krug = self.world.findItemImInventarById(self.world.ITEM_KRUG)
|
||||||
|
|
||||||
|
if krug != None:
|
||||||
|
krug.zustand = krug.VOLL
|
||||||
|
self.setFehler('Du schöpfst mit dem Krug und der Fisch ist drin.')
|
||||||
|
else:
|
||||||
|
self.setFehler('Der Fisch ist zu glitschig, um ihn mit der Hand zu fangen.')
|
||||||
|
aufnehmen = False
|
||||||
|
|
||||||
|
if aufnehmen:
|
||||||
|
self.moveItemVonRaumNachInventar(item)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.setFehler("diesen Gegenstand sehe ich hier nicht.")
|
self.setFehler("diesen Gegenstand sehe ich hier nicht.")
|
||||||
|
|
||||||
|
|
||||||
def gehe(self):
|
|
||||||
richtung = self.world.parsedCommand.gegenstand
|
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()
|
||||||
|
else:
|
||||||
|
self.world.printText('hilfe')
|
||||||
|
|
||||||
|
def geheNachItem(parsedCommand):
|
||||||
|
item = self.world.findItemInAktuellerRaum(parsedCommand.gegenstand)
|
||||||
|
|
||||||
|
if item == None:
|
||||||
|
self.setFehler('Das gibts hier nicht.')
|
||||||
|
return
|
||||||
|
if self.isItemAndAktRaum(item, self.world.ITEM_LEITER, self.world.RAUM_ESSZIMMER):
|
||||||
|
self.rauf()
|
||||||
|
else:
|
||||||
|
self.setFehler('Das gibt\'s hier nicht.')
|
||||||
|
|
||||||
|
def gehe(self,parsedCommand):
|
||||||
|
richtung = parsedCommand.gegenstand.lower()
|
||||||
logging.debug("gehe nach " + richtung)
|
logging.debug("gehe nach " + richtung)
|
||||||
|
|
||||||
if richtung == 'nord':
|
if richtung == 'nord':
|
||||||
self.nord()
|
self.geheNach(richtung)
|
||||||
|
elif richtung == 'süd':
|
||||||
|
self.geheNach(richtung)
|
||||||
|
elif richtung == 'west':
|
||||||
|
self.geheNach(richtung)
|
||||||
|
elif richtung == 'ost':
|
||||||
|
self.geheNach(richtung)
|
||||||
|
elif richtung == 'rauf':
|
||||||
|
self.rauf()
|
||||||
|
else:
|
||||||
|
self.geheNachItem(parsedCommand)
|
||||||
|
|
||||||
|
|
||||||
|
def wechsleRaum(self,raum):
|
||||||
|
self.world.aktuellerRaum = raum
|
||||||
|
raum.entdeckt = True
|
||||||
def geheNach(self,richtung):
|
def geheNach(self,richtung):
|
||||||
logging.debug(f'geheNach() Richtung {richtung}')
|
logging.debug(f'Richtung {richtung}')
|
||||||
raum = self.world.aktuellerRaum
|
raum = self.world.aktuellerRaum
|
||||||
|
|
||||||
if raum.ausgaenge[richtung]:
|
if raum.ausgaenge[richtung]:
|
||||||
@@ -184,7 +455,7 @@ class ActionModul:
|
|||||||
self.setFehler("In diese Richtung gibt's keine Ausgang!")
|
self.setFehler("In diese Richtung gibt's keine Ausgang!")
|
||||||
|
|
||||||
if raum != None:
|
if raum != None:
|
||||||
self.world.aktuellerRaum = raum
|
self.wechsleRaum(raum)
|
||||||
else:
|
else:
|
||||||
logging.debug('Kein Raum zur AusgangId')
|
logging.debug('Kein Raum zur AusgangId')
|
||||||
self.setFehler("In diese Richtung gibt's keine Ausgang!")
|
self.setFehler("In diese Richtung gibt's keine Ausgang!")
|
||||||
|
302
TestModule.py
Normal file
302
TestModule.py
Normal file
@@ -0,0 +1,302 @@
|
|||||||
|
# Testdurchläufe
|
||||||
|
import logging
|
||||||
|
import ActionModul
|
||||||
|
|
||||||
|
class TestModule:
|
||||||
|
|
||||||
|
def __init__(self, world):
|
||||||
|
|
||||||
|
logging.debug(f'** init Testmodule {world}')
|
||||||
|
self.world = world
|
||||||
|
self.schrittzaehler = 0
|
||||||
|
self.ac = ActionModul.ActionModul(world)
|
||||||
|
|
||||||
|
def debug(self,msg):
|
||||||
|
logging.debug(f'AUTO: {msg}')
|
||||||
|
|
||||||
|
def parseInput(self, command):
|
||||||
|
return self.world.parseInput(command)
|
||||||
|
|
||||||
|
def testOeffneTruhe(self):
|
||||||
|
pcmd = self.parseInput('nimm Truhe')
|
||||||
|
|
||||||
|
#Auf den Dachboden
|
||||||
|
self.ac.rauf()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
self.ac.nimm(pcmd)
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
#Zurück ins Wohnzimmer
|
||||||
|
self.ac.runter()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
#In den Flur
|
||||||
|
self.ac.sued()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
# Ins Schlafzimmer
|
||||||
|
self.ac.west()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
self.debug(f'aktueller Raum: {self.world.aktuellerRaum.name}')
|
||||||
|
self.debug(f'Ausgänge: {self.world.aktuellerRaum.ausgaenge}')
|
||||||
|
pcmd = self.parseInput('untersuche Bett')
|
||||||
|
|
||||||
|
|
||||||
|
self.ac.untersuche(pcmd)
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
self.debug(f'Ausgänge: {self.world.aktuellerRaum.ausgaenge}')
|
||||||
|
# In den Keller
|
||||||
|
self.ac.runter()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
pcmd = self.parseInput('nimm Jacke')
|
||||||
|
|
||||||
|
self.ac.nimm(pcmd)
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
pcmd = self.parseInput('benutze Jacke')
|
||||||
|
|
||||||
|
self.ac.benutze(pcmd)
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
pcmd = self.parseInput('öffne Truhe')
|
||||||
|
|
||||||
|
self.ac.oeffne(pcmd)
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
pcmd = self.parseInput('nimm Schwert')
|
||||||
|
|
||||||
|
self.ac.nimm(pcmd)
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
pcmd = self.parseInput('nimm Seil')
|
||||||
|
|
||||||
|
self.ac.nimm(pcmd)
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
|
||||||
|
self.world.schrittzaehler = self.schrittzaehler
|
||||||
|
|
||||||
|
|
||||||
|
def testTeich(self):
|
||||||
|
self.testOeffneTruhe()
|
||||||
|
|
||||||
|
#Rauf ins Schlafzimmer
|
||||||
|
self.ac.rauf()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
pcmd = self.parseInput('untersuche Nachtschrank')
|
||||||
|
|
||||||
|
self.ac.untersuche(pcmd)
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
pcmd = self.parseInput('nimm Haustürschlüssel')
|
||||||
|
|
||||||
|
self.ac.nimm(pcmd)
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
#In den Flur
|
||||||
|
self.ac.ost()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
pcmd = self.parseInput('untersuche Pflanze')
|
||||||
|
|
||||||
|
self.ac.untersuche(pcmd)
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
pcmd = self.parseInput('nimm Krug')
|
||||||
|
|
||||||
|
self.ac.nimm(pcmd)
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
pcmd = self.parseInput('öffne Haustür')
|
||||||
|
|
||||||
|
self.ac.oeffne(pcmd)
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
# nach draussen
|
||||||
|
self.ac.sued()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
# aufs Dach
|
||||||
|
self.ac.rauf()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
pcmd = self.parseInput('nimm Planke')
|
||||||
|
self.ac.nimm(pcmd)
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
#Wieder runter
|
||||||
|
self.ac.runter()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
#Zum Bach
|
||||||
|
self.ac.sued()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
pcmd = self.parseInput('verliere Planke')
|
||||||
|
self.ac.verliere(pcmd)
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
#Zum Teich
|
||||||
|
self.ac.ost()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
self.world.schrittzaehler = self.schrittzaehler
|
||||||
|
|
||||||
|
def testStier(self):
|
||||||
|
self.testTeich()
|
||||||
|
|
||||||
|
pcmd = self.parseInput('nimm Fisch')
|
||||||
|
self.ac.nimm(pcmd)
|
||||||
|
|
||||||
|
# zum Bach
|
||||||
|
self.ac.west()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
|
||||||
|
#Aufs Feld
|
||||||
|
self.ac.sued()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
# Kleines Feld
|
||||||
|
self.ac.sued()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
pcmd = self.parseInput('nimm Maus')
|
||||||
|
self.ac.nimm(pcmd)
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
self.ac.nord()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
# Auf die Wiese
|
||||||
|
self.ac.west()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
def testRanke(self):
|
||||||
|
self.testTeich()
|
||||||
|
|
||||||
|
pcmd = self.parseInput('nimm Fisch')
|
||||||
|
self.ac.nimm(pcmd)
|
||||||
|
|
||||||
|
# zum Bach
|
||||||
|
self.ac.west()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
|
||||||
|
#Aufs Feld
|
||||||
|
self.ac.sued()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
# Kleines Feld
|
||||||
|
self.ac.sued()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
pcmd = self.parseInput('nimm Maus')
|
||||||
|
self.ac.nimm(pcmd)
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
self.ac.nord()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
# Auf die Wiese
|
||||||
|
self.ac.west()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
|
||||||
|
# Aufs Brachland
|
||||||
|
self.ac.sued()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
pcmd = self.parseInput('leere Krug')
|
||||||
|
self.ac.leere(pcmd)
|
||||||
|
self.ac.clearFehler()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
# Wiese
|
||||||
|
self.ac.nord()
|
||||||
|
|
||||||
|
# Feld
|
||||||
|
self.ac.ost()
|
||||||
|
|
||||||
|
# Bach
|
||||||
|
self.ac.nord()
|
||||||
|
|
||||||
|
# Teich
|
||||||
|
|
||||||
|
self.ac.ost()
|
||||||
|
pcmd = self.parseInput('fuelle Krug')
|
||||||
|
|
||||||
|
# zum Bach
|
||||||
|
self.ac.west()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
|
||||||
|
#Aufs Feld
|
||||||
|
self.ac.sued()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
# Auf die Wiese
|
||||||
|
self.ac.west()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
|
||||||
|
# Aufs Brachland
|
||||||
|
self.ac.sued()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
pcmd = self.parseInput('leere Krug')
|
||||||
|
self.ac.leere(pcmd)
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
self.world.schrittzaehler = self.schrittzaehler
|
||||||
|
|
||||||
|
def testTal(self):
|
||||||
|
|
||||||
|
self.testRanke()
|
||||||
|
|
||||||
|
self.ac.rauf()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
pcmd = self.parseInput('wirf Maus')
|
||||||
|
self.ac.wirf(pcmd)
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
#Pfad
|
||||||
|
self.ac.sued()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
#südlicherPfad
|
||||||
|
self.ac.sued()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
# östlicher Pfad
|
||||||
|
self.ac.ost()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
# Tal
|
||||||
|
self.ac.sued()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
def testBaumhaus(self):
|
||||||
|
self.testTal()
|
||||||
|
|
||||||
|
# Baum
|
||||||
|
self.ac.sued()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
pcmd = self.parseInput('wirf Seil')
|
||||||
|
self.ac.wirf(pcmd)
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
# Baumhaus
|
||||||
|
self.ac.rauf()
|
||||||
|
self.schrittzaehler += 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
167
World.py
167
World.py
@@ -1,3 +1,6 @@
|
|||||||
|
# Hier wird die Spielwelt verwaltet.
|
||||||
|
# Auch die Terminalausgabe passiert hier.
|
||||||
|
|
||||||
import WorldParser
|
import WorldParser
|
||||||
import ParsedCommand
|
import ParsedCommand
|
||||||
import ActionModul
|
import ActionModul
|
||||||
@@ -18,11 +21,39 @@ class World:
|
|||||||
self.waitForCR()
|
self.waitForCR()
|
||||||
self.printRaum()
|
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):
|
def waitForCR(self):
|
||||||
self.stdscr.addstr(0,0,'Taste für Weiter',curses.color_pair(1))
|
self.stdscr.addstr(0,0,'Taste für Weiter',curses.color_pair(1))
|
||||||
self.stdscr.getch()
|
self.stdscr.getch()
|
||||||
|
|
||||||
|
|
||||||
|
def labelsInventar(self):
|
||||||
|
labels =[]
|
||||||
|
|
||||||
|
for itemid in self.inventar:
|
||||||
|
item = self.inventar[itemid]
|
||||||
|
labels.append(item.name)
|
||||||
|
|
||||||
|
return labels
|
||||||
|
|
||||||
|
def fortschritt(self):
|
||||||
|
anz_raeume, anz_entdeckt = self.zaehleRaeume()
|
||||||
|
return round((anz_entdeckt/anz_raeume) *100,2)
|
||||||
|
|
||||||
def printRaum(self):
|
def printRaum(self):
|
||||||
raum = self.aktuellerRaum
|
raum = self.aktuellerRaum
|
||||||
self.clearScreen()
|
self.clearScreen()
|
||||||
@@ -33,11 +64,12 @@ class World:
|
|||||||
self.stdscr.addstr(3,0,'aktueller Raum: ' + raum.name,curses.color_pair(3))
|
self.stdscr.addstr(3,0,'aktueller Raum: ' + raum.name,curses.color_pair(3))
|
||||||
self.stdscr.addstr(4,0,raum.beschreibung)
|
self.stdscr.addstr(4,0,raum.beschreibung)
|
||||||
self.stdscr.addstr(7,0,'Gegenstände: ' + str(raum.labelsGegenstaende()),curses.color_pair(2))
|
self.stdscr.addstr(7,0,'Gegenstände: ' + str(raum.labelsGegenstaende()),curses.color_pair(2))
|
||||||
self.stdscr.addstr(8,0,'Personen: ' + str(raum.labelsPersonen()),curses.color_pair(2))
|
self.stdscr.addstr(8,0,'Inventar: '+ str(self.labelsInventar()), curses.color_pair(2))
|
||||||
|
self.stdscr.addstr(9,0,'Personen: ' + str(raum.labelsPersonen()),curses.color_pair(2))
|
||||||
|
|
||||||
|
|
||||||
aus = raum.ausgaenge
|
aus = raum.ausgaenge
|
||||||
self.stdscr.addstr(9,0,'mögliche Richtungen: ')
|
self.stdscr.addstr(10,0,'mögliche Richtungen: ')
|
||||||
r = []
|
r = []
|
||||||
if aus[self.NORD] != '-1':
|
if aus[self.NORD] != '-1':
|
||||||
r.append('Norden')
|
r.append('Norden')
|
||||||
@@ -54,6 +86,9 @@ class World:
|
|||||||
|
|
||||||
richtungen =''
|
richtungen =''
|
||||||
ixri = 0
|
ixri = 0
|
||||||
|
anz_raeume, anz_entdeckt = self.zaehleRaeume()
|
||||||
|
progress = (anz_entdeckt/anz_raeume) *100
|
||||||
|
self.stdscr.addstr(6,85,f'Schritte: {self.schrittzaehler}, Räume:{anz_entdeckt}/{anz_raeume}, Fortschritt: {self.fortschritt()}%')
|
||||||
win = curses.newwin(7,35,7,85)
|
win = curses.newwin(7,35,7,85)
|
||||||
win.box()
|
win.box()
|
||||||
win.addstr('Ausgänge:')
|
win.addstr('Ausgänge:')
|
||||||
@@ -63,7 +98,7 @@ class World:
|
|||||||
if ixri +1 < len(r):
|
if ixri +1 < len(r):
|
||||||
richtungen = richtungen + ', '
|
richtungen = richtungen + ', '
|
||||||
ixri = ixri +1
|
ixri = ixri +1
|
||||||
self.stdscr.addstr(9,22,richtungen)
|
self.stdscr.addstr(10,22,richtungen)
|
||||||
self.stdscr.refresh()
|
self.stdscr.refresh()
|
||||||
win.refresh()
|
win.refresh()
|
||||||
|
|
||||||
@@ -89,17 +124,36 @@ class World:
|
|||||||
return item
|
return item
|
||||||
|
|
||||||
|
|
||||||
|
def findItemById(self,id):
|
||||||
|
for itemkey in self.gegenstaende:
|
||||||
|
item = self.gegenstaende[itemkey]
|
||||||
|
|
||||||
|
logging.debug(f'itemkey: {itemkey} item.id= {item.id} - {id}')
|
||||||
|
if item.id == id:
|
||||||
|
logging.debug(f'findItemBy(): return {item.name}')
|
||||||
|
return item
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
|
def findRaumById(self,raumid):
|
||||||
|
|
||||||
|
for rid in self.raumliste:
|
||||||
|
if rid == raumid:
|
||||||
|
return self.raumliste[rid]
|
||||||
|
return None
|
||||||
|
|
||||||
def findItemInAktuellerRaum(self,itemname):
|
def findItemInAktuellerRaum(self,itemname):
|
||||||
raum = self.aktuellerRaum
|
raum = self.aktuellerRaum
|
||||||
|
|
||||||
for itemid in raum.items:
|
for itemid in raum.items:
|
||||||
item = raum.items[itemid]
|
item = raum.items[itemid]
|
||||||
logging.debug('raum.id=' + raum.id)
|
logging.debug(f'raum.id={raum.id}')
|
||||||
logging.debug('item.raumid=' + item.raumid)
|
logging.debug(f'item.raumid={item.raumid}')
|
||||||
logging.debug('findItemInAktuellerRaum() ' + itemname + '-' + item.name)
|
logging.debug(f'findItemInAktuellerRaum() {itemname} - {item.name}')
|
||||||
if item.raumid == raum.id and item.name.lower() == itemname.lower():
|
if item.raumid == raum.id and item.name.lower() == itemname.lower():
|
||||||
return item
|
return item
|
||||||
|
|
||||||
|
logging.debug(f'Item {itemname} nicht im aktuellen Raum gefunden')
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def findRaumItemById(self,id):
|
def findRaumItemById(self,id):
|
||||||
@@ -113,6 +167,27 @@ 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 findPersonImAktuellenRaumById(self, personid):
|
||||||
|
raum = self.aktuellerRaum
|
||||||
|
|
||||||
|
for persid in raum.personen:
|
||||||
|
person = raum.personen[persid]
|
||||||
|
|
||||||
|
if person.id == personid:
|
||||||
|
return person
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def findItemImInventar(self,itemname):
|
def findItemImInventar(self,itemname):
|
||||||
|
|
||||||
for itemid in self.inventar:
|
for itemid in self.inventar:
|
||||||
@@ -130,6 +205,7 @@ class World:
|
|||||||
def ermittleBefehlId(self,befehl):
|
def ermittleBefehlId(self,befehl):
|
||||||
for id in self.befehle:
|
for id in self.befehle:
|
||||||
name = self.befehle[id].name
|
name = self.befehle[id].name
|
||||||
|
logging.debug(f'{befehl} - {name}')
|
||||||
if name == befehl:
|
if name == befehl:
|
||||||
return id
|
return id
|
||||||
return None
|
return None
|
||||||
@@ -150,11 +226,14 @@ class World:
|
|||||||
|
|
||||||
|
|
||||||
def parseInput(self,input):
|
def parseInput(self,input):
|
||||||
|
logging.debug(f'parseInput() {input}')
|
||||||
words = input.split(' ')
|
words = input.split(' ')
|
||||||
parsedCommand = ParsedCommand.ParsedCommand()
|
parsedCommand = ParsedCommand.ParsedCommand()
|
||||||
words = self.removeSortouts(words,parsedCommand)
|
words = self.removeSortouts(words,parsedCommand)
|
||||||
befehlid = self.ermittleBefehlId(words[0])
|
befehlid = self.ermittleBefehlId(words[0])
|
||||||
|
|
||||||
|
logging.debug(f'parseInput() befehlid {befehlid}')
|
||||||
|
|
||||||
if befehlid != None:
|
if befehlid != None:
|
||||||
befehl = self.befehle[befehlid]
|
befehl = self.befehle[befehlid]
|
||||||
parsedCommand.commandid = befehl.id
|
parsedCommand.commandid = befehl.id
|
||||||
@@ -167,7 +246,42 @@ class World:
|
|||||||
|
|
||||||
return parsedCommand
|
return parsedCommand
|
||||||
|
|
||||||
|
def zaehleEntdeckteRaeume(self):
|
||||||
|
count = 0
|
||||||
|
for raumid in self.raumliste:
|
||||||
|
raum = self.raumliste[raumid]
|
||||||
|
if raum .entdeckt:
|
||||||
|
count += 1
|
||||||
|
|
||||||
|
return count
|
||||||
|
|
||||||
|
def zaehleRaeume(self):
|
||||||
|
count = 0
|
||||||
|
entdeckt = 0
|
||||||
|
for raumid in self.raumliste:
|
||||||
|
raum = self.raumliste[raumid]
|
||||||
|
if raum .entdeckt:
|
||||||
|
entdeckt += 1
|
||||||
|
count += 1
|
||||||
|
|
||||||
|
return count, entdeckt
|
||||||
|
|
||||||
|
|
||||||
|
def debug_Items(self):
|
||||||
|
logging.debug('liste Items')
|
||||||
|
logging.debug(self.gegenstaende)
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
for key in self.gegenstaende:
|
||||||
|
item = self.gegenstaende[key]
|
||||||
|
|
||||||
|
logging.debug(f'count= {count}')
|
||||||
|
logging.debug('Itemtyp: ' + str(type(item)))
|
||||||
|
logging.debug(f'Item-IdId:{item.id} - Item-Name:{item.name}')
|
||||||
|
count = count +1
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
self.schrittzaehler = 0
|
||||||
self.raumliste = {}
|
self.raumliste = {}
|
||||||
self.msg = {}
|
self.msg = {}
|
||||||
self.personen = {}
|
self.personen = {}
|
||||||
@@ -194,18 +308,28 @@ class World:
|
|||||||
self.ITEM_TRUHE = '3'
|
self.ITEM_TRUHE = '3'
|
||||||
self.ITEM_PFLANZE = '4'
|
self.ITEM_PFLANZE = '4'
|
||||||
self.ITEM_HAUSTUER = '5'
|
self.ITEM_HAUSTUER = '5'
|
||||||
self.ITEM_GLAS = '6'
|
self.ITEM_KRUG = '6'
|
||||||
self.ITEM_BETT = '7'
|
self.ITEM_BETT = '7'
|
||||||
self.ITEM_NACHTSCHRANK = '8'
|
self.ITEM_NACHTSCHRANK = '8'
|
||||||
self.ITEM_KLEINER_SCHLUESSEL = '9'
|
self.ITEM_KLEINER_SCHLUESSEL = '9'
|
||||||
self.ITEM_JACKE = '10'
|
self.ITEM_JACKE = '10'
|
||||||
self.ITEM_SCHWERT = '11'
|
|
||||||
self.ITEM_SEIL = '12'
|
self.ITEM_SEIL = '12'
|
||||||
self.ITEM_HAUSTUERSCHLUESSEL = '13'
|
self.ITEM_HAUSTUERSCHLUESSEL = '13'
|
||||||
self.ITEM_RANKGITTER = '14'
|
self.ITEM_RANKGITTER = '14'
|
||||||
|
self.ITEM_PLANKE = '15'
|
||||||
|
self.ITEM_TEICH = '16'
|
||||||
|
self.ITEM_FISCH = '17'
|
||||||
|
self.ITEM_SCHWERT = '18'
|
||||||
|
self.ITEM_BOXSACK = '19'
|
||||||
|
self.ITEM_MAUS = '20'
|
||||||
|
self.ITEM_BOHNENRANKE = '21'
|
||||||
|
self.ITEM_ELEFANT = '22'
|
||||||
|
self.ITEM_HAFEN = '23'
|
||||||
|
self.ITEM_GATTER = '25'
|
||||||
|
|
||||||
# Räume
|
# Räume
|
||||||
|
|
||||||
|
self.RAUM_UNDEF = '-1'
|
||||||
self.RAUM_ESSZIMMER = '1'
|
self.RAUM_ESSZIMMER = '1'
|
||||||
self.RAUM_DACHBODEN = '2'
|
self.RAUM_DACHBODEN = '2'
|
||||||
self.RAUM_FLUR = '3'
|
self.RAUM_FLUR = '3'
|
||||||
@@ -213,9 +337,36 @@ class World:
|
|||||||
self.RAUM_KELLER = '5'
|
self.RAUM_KELLER = '5'
|
||||||
self.RAUM_GARTEN = '6'
|
self.RAUM_GARTEN = '6'
|
||||||
self.RAUM_DACH = '7'
|
self.RAUM_DACH = '7'
|
||||||
|
self.RAUM_BACH = '8'
|
||||||
|
self.RAUM_FELD = '9'
|
||||||
|
self.RAUM_TEICH = '10'
|
||||||
|
self.RAUM_FELD = '11'
|
||||||
|
self.RAUM_KLEINES_FELD = '12'
|
||||||
|
self.RAUM_WIESE = '13'
|
||||||
|
self.RAUM_BRACHLAND = '14'
|
||||||
|
self.RAUM_BOHNENRANKE = '15'
|
||||||
|
self.RAUM_PFAD = '16'
|
||||||
|
self.RAUM_PFAD_SUED = '17'
|
||||||
|
self.RAUM_PFAD_OST = '18'
|
||||||
|
self.RAUM_TAL = '19'
|
||||||
|
self.RAUM_BAUM = '20'
|
||||||
|
self.RAUM_TUNNEL = '21'
|
||||||
|
self.RAUM_STRAND = '22'
|
||||||
|
self.RAUM_HAFEN = '23'
|
||||||
|
self.RAUM_BAUMHAUS = '24'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Personen
|
||||||
|
|
||||||
|
self.PERSON_GEIST = '4'
|
||||||
|
self.PERSON_FISCH = '2'
|
||||||
|
self.PERSON_STIER = '5'
|
||||||
|
self.PERSON_ZWERG = '6'
|
||||||
|
|
||||||
|
|
||||||
self.fehler = ''
|
self.fehler = ''
|
||||||
parser = WorldParser.WorldParser(self)
|
parser = WorldParser.WorldParser(self)
|
||||||
parser.parseWorld('world.xml')
|
parser.parseWorld('world.xml')
|
||||||
|
|
||||||
|
|
||||||
|
@@ -5,12 +5,20 @@ import logging
|
|||||||
|
|
||||||
class WorldParser():
|
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):
|
def __init__(self,world):
|
||||||
self.neuerRaum = None
|
self.neuerRaum = None
|
||||||
self.world = world
|
self.world = world
|
||||||
self.textCount = 0
|
self.textCount = 0
|
||||||
|
|
||||||
def parseWorld(self,filename):
|
def parseWorld(self,filename):
|
||||||
|
|
||||||
tree = ET.parse(filename)
|
tree = ET.parse(filename)
|
||||||
root = tree.getroot()
|
root = tree.getroot()
|
||||||
|
|
||||||
@@ -91,22 +99,31 @@ class WorldParser():
|
|||||||
imobil = item.attrib['imobil']
|
imobil = item.attrib['imobil']
|
||||||
visible = item.attrib['visible']
|
visible = item.attrib['visible']
|
||||||
adjektiv = item.attrib['adjektiv']
|
adjektiv = item.attrib['adjektiv']
|
||||||
|
display = item.attrib['display']
|
||||||
raum = self.world.sucheRaum(raumid)
|
raum = self.world.sucheRaum(raumid)
|
||||||
if raum is not None:
|
if raum is not None:
|
||||||
gegenstand.raum = raum.id
|
gegenstand.raum = raum.id
|
||||||
|
raum.items[id] = gegenstand
|
||||||
|
else:
|
||||||
|
if raumid != '-1':
|
||||||
|
logging.error(f'Kann Raum für Gegenstand {gegenstand.name} nicht finden')
|
||||||
|
logging.error(f'Kein Raum für {gegenstand.name}')
|
||||||
|
|
||||||
gegenstand.adjektiv = adjektiv
|
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']
|
gegenstand.imobil = imobil.lower() in ['true','True','1']
|
||||||
logging.debug('itemid= ' + id + ',visible= ' + visible)
|
logging.debug('itemid= ' + id + ',visible= ' + visible)
|
||||||
gegenstand.sichtbar = visible.lower() not in ['false','False','0']
|
gegenstand.sichtbar = visible.lower() not in ['false','False','0']
|
||||||
#logging.debug('Gegenstand ' + gegenstand.name + ' ist sichtbar: ' + str(gegenstand.sichtbar))
|
#logging.debug('Gegenstand ' + gegenstand.name + ' ist sichtbar: ' + str(gegenstand.sichtbar))
|
||||||
gegenstand.pickupmsg = msgid
|
gegenstand.pickupmsg = msgid
|
||||||
print('Item ' + gegenstand.name + ' - Pickup: ' + gegenstand.pickupmsg)
|
# logging.debug('Item ' + gegenstand.name + ' - Pickup: ' + gegenstand.pickupmsg)
|
||||||
|
|
||||||
raum.items[id] = gegenstand
|
|
||||||
self.world.gegenstaende[id] = gegenstand
|
self.world.gegenstaende[id] = gegenstand
|
||||||
else:
|
|
||||||
logging.error(f'Kann Raum für Gegenstand {gegenstand.name} nicht finden')
|
|
||||||
print(f'Kein Raum für {gegenstand.name}')
|
|
||||||
|
|
||||||
# Personen
|
# Personen
|
||||||
for item in root.findall('personen/person'):
|
for item in root.findall('personen/person'):
|
||||||
@@ -118,7 +135,7 @@ class WorldParser():
|
|||||||
person = Person(name,id,raum)
|
person = Person(name,id,raum)
|
||||||
self.world.personen[id] = person
|
self.world.personen[id] = person
|
||||||
raum = self.world.sucheRaum(raumid)
|
raum = self.world.sucheRaum(raumid)
|
||||||
raum.personen[raumid] = person
|
raum.personen[id] = person
|
||||||
|
|
||||||
# Texte
|
# Texte
|
||||||
for item in root.findall('texte/text'):
|
for item in root.findall('texte/text'):
|
||||||
|
10
data/Raum.py
10
data/Raum.py
@@ -15,6 +15,7 @@ class Raum(SuperNode):
|
|||||||
self.personen = {}
|
self.personen = {}
|
||||||
self.beschreibung=beschreibung
|
self.beschreibung=beschreibung
|
||||||
self.pickupmsg = ''
|
self.pickupmsg = ''
|
||||||
|
self.entdeckt = False
|
||||||
self.ausgaenge = {
|
self.ausgaenge = {
|
||||||
'0': '-1', # Nord
|
'0': '-1', # Nord
|
||||||
'1': '-1', # West
|
'1': '-1', # West
|
||||||
@@ -43,6 +44,9 @@ class Raum(SuperNode):
|
|||||||
item = self.items[itemid]
|
item = self.items[itemid]
|
||||||
logging.debug('labelsGegenstaende(): Item ' + self.items[itemid].name + ' ist ' + str(item.sichtbar))
|
logging.debug('labelsGegenstaende(): Item ' + self.items[itemid].name + ' ist ' + str(item.sichtbar))
|
||||||
if item.sichtbar:
|
if item.sichtbar:
|
||||||
|
if item.display != None:
|
||||||
|
labels.append(item.display)
|
||||||
|
else:
|
||||||
labels.append(item.name)
|
labels.append(item.name)
|
||||||
|
|
||||||
return labels
|
return labels
|
||||||
@@ -68,8 +72,14 @@ class Gegenstand(SuperNode):
|
|||||||
self.sichtbar = True
|
self.sichtbar = True
|
||||||
self.imobil = False
|
self.imobil = False
|
||||||
self.adjektiv = None
|
self.adjektiv = None
|
||||||
|
self.display = None
|
||||||
self.GESCHLOSSEN = 0
|
self.GESCHLOSSEN = 0
|
||||||
self.OFFEN = 1
|
self.OFFEN = 1
|
||||||
|
self.KLEIN = 0
|
||||||
|
self.MITTEL = 1
|
||||||
|
self.GROSS = 2
|
||||||
|
self.LEER = 0
|
||||||
|
self.VOLL = 1
|
||||||
self.zustand = self.GESCHLOSSEN
|
self.zustand = self.GESCHLOSSEN
|
||||||
|
|
||||||
class Adjektiv(SuperNode):
|
class Adjektiv(SuperNode):
|
||||||
|
Binary file not shown.
BIN
img/map.png
Normal file
BIN
img/map.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 128 KiB |
54
map.txt
Normal file
54
map.txt
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
|
||||||
|
Wohnzimmer
|
||||||
|
^
|
||||||
|
|
|
||||||
|
V
|
||||||
|
Schlafzimmer<-->Flur
|
||||||
|
^
|
||||||
|
|
|
||||||
|
V
|
||||||
|
Garten
|
||||||
|
^
|
||||||
|
|
|
||||||
|
V
|
||||||
|
Bach<-->Teich
|
||||||
|
^
|
||||||
|
|
|
||||||
|
V
|
||||||
|
Wiese<------->Feld
|
||||||
|
^ ^
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
V V
|
||||||
|
(0)Brachland kleines Feld
|
||||||
|
(1)
|
||||||
|
|
||||||
|
(0)
|
||||||
|
(1)Spitze der Bohnenranke
|
||||||
|
^
|
||||||
|
|
|
||||||
|
|
|
||||||
|
V
|
||||||
|
Pfad
|
||||||
|
^
|
||||||
|
|
|
||||||
|
|
|
||||||
|
V
|
||||||
|
Pfad<--> Pfad
|
||||||
|
^
|
||||||
|
|
|
||||||
|
|
|
||||||
|
V
|
||||||
|
Tal<---> Tunnel <--->Strand
|
||||||
|
^
|
||||||
|
|
|
||||||
|
|
|
||||||
|
V
|
||||||
|
Baum <--> Baumhaus
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
93
tomb.py
93
tomb.py
@@ -1,6 +1,9 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
# Hauptprogramm - Eingabeschleife und Dispatching
|
||||||
|
|
||||||
import World
|
import World
|
||||||
import ActionModul
|
import ActionModul
|
||||||
|
import TestModule
|
||||||
import signal
|
import signal
|
||||||
import sys
|
import sys
|
||||||
import logging
|
import logging
|
||||||
@@ -19,6 +22,8 @@ def verarbeiteBefehl(parsedCommand):
|
|||||||
actionmodul.nimm(parsedCommand)
|
actionmodul.nimm(parsedCommand)
|
||||||
elif id == '3':
|
elif id == '3':
|
||||||
actionmodul.untersuche(parsedCommand)
|
actionmodul.untersuche(parsedCommand)
|
||||||
|
elif id == '4':
|
||||||
|
actionmodul.benutze(parsedCommand)
|
||||||
elif id == '5':
|
elif id == '5':
|
||||||
actionmodul.nord()
|
actionmodul.nord()
|
||||||
elif id == '6':
|
elif id == '6':
|
||||||
@@ -49,6 +54,20 @@ def verarbeiteBefehl(parsedCommand):
|
|||||||
actionmodul.oeffne(parsedCommand)
|
actionmodul.oeffne(parsedCommand)
|
||||||
elif id == '21':
|
elif id == '21':
|
||||||
actionmodul.klettere(parsedCommand)
|
actionmodul.klettere(parsedCommand)
|
||||||
|
elif id == '22':
|
||||||
|
actionmodul.fange(parsedCommand)
|
||||||
|
elif id == '23':
|
||||||
|
actionmodul.hilfe(parsedCommand)
|
||||||
|
elif id == '24':
|
||||||
|
actionmodul.schlage(parsedCommand)
|
||||||
|
elif id == '25':
|
||||||
|
actionmodul.sprich(parsedCommand)
|
||||||
|
elif id == '26':
|
||||||
|
actionmodul.leere(parsedCommand)
|
||||||
|
elif id == '27':
|
||||||
|
actionmodul.fuelle(parsedCommand)
|
||||||
|
elif id == '28':
|
||||||
|
actionmodul.wirf(parsedCommand)
|
||||||
elif id == '-1':
|
elif id == '-1':
|
||||||
world.fehler = 'Ich verstehe diesen Befehl nicht'
|
world.fehler = 'Ich verstehe diesen Befehl nicht'
|
||||||
else:
|
else:
|
||||||
@@ -58,15 +77,17 @@ def handle_SIGINT(sig,frame):
|
|||||||
logging.debug("CTRL-C abgefangen")
|
logging.debug("CTRL-C abgefangen")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
logging.basicConfig(
|
||||||
|
format='%(asctime)-15s [%(levelname)s] %(funcName)s: %(message)s',
|
||||||
|
filename='tomb.log',
|
||||||
|
level=logging.DEBUG)
|
||||||
|
|
||||||
logging.basicConfig(filename='tomb.log', level=logging.DEBUG)
|
|
||||||
signal.signal(signal.SIGINT,handle_SIGINT)
|
signal.signal(signal.SIGINT,handle_SIGINT)
|
||||||
world = World.World()
|
world = World.World()
|
||||||
logging.debug('World initialisiert')
|
logging.debug('World initialisiert')
|
||||||
actionmodul = ActionModul.ActionModul(world)
|
actionmodul = ActionModul.ActionModul(world)
|
||||||
|
|
||||||
def inputLoop(stdscr):
|
def inputLoop(stdscr):
|
||||||
schrittzaehler = 0
|
|
||||||
|
|
||||||
world.stdscr = stdscr
|
world.stdscr = stdscr
|
||||||
curses.echo()
|
curses.echo()
|
||||||
@@ -79,6 +100,7 @@ def inputLoop(stdscr):
|
|||||||
actionmodul.clearFehler()
|
actionmodul.clearFehler()
|
||||||
stdscr.addstr(11,0,'Was nun? ')
|
stdscr.addstr(11,0,'Was nun? ')
|
||||||
command = stdscr.getstr(11,10,40).decode(encoding="utf-8")
|
command = stdscr.getstr(11,10,40).decode(encoding="utf-8")
|
||||||
|
world.schrittzaehler = world.schrittzaehler +1
|
||||||
command = command.rstrip()
|
command = command.rstrip()
|
||||||
if command.startswith('debug:'):
|
if command.startswith('debug:'):
|
||||||
debugcommand = command.split(':',1)
|
debugcommand = command.split(':',1)
|
||||||
@@ -86,17 +108,72 @@ def inputLoop(stdscr):
|
|||||||
logging.debug(f'debugcommand: {debugcommand}')
|
logging.debug(f'debugcommand: {debugcommand}')
|
||||||
|
|
||||||
if debugcommand[1] == 'items':
|
if debugcommand[1] == 'items':
|
||||||
logging.debug('liste Items')
|
debug_Items()
|
||||||
logging.debug(world.gegenstaende)
|
elif debugcommand[1] == 'inventar':
|
||||||
for item in world.gegenstaende:
|
debug_Inventar()
|
||||||
logging.debug(f'Id:{item.id} - Name:{item.name}')
|
elif debugcommand[1] == 'personen':
|
||||||
|
debug_Personen()
|
||||||
|
elif command.startswith('auto:'):
|
||||||
|
command = command.rstrip()
|
||||||
|
if command.startswith('auto:'):
|
||||||
|
debugcommand = command.split(':',1)
|
||||||
|
|
||||||
|
logging.debug(f'debugcommand: {debugcommand}')
|
||||||
|
testmodul = TestModule.TestModule(world)
|
||||||
|
|
||||||
|
if(debugcommand[1] == 'truhe'):
|
||||||
|
testmodul.testOeffneTruhe()
|
||||||
|
elif debugcommand[1] == 'teich':
|
||||||
|
testmodul.testTeich()
|
||||||
|
elif debugcommand[1] == 'ranke':
|
||||||
|
testmodul.testRanke()
|
||||||
|
elif debugcommand[1] == 'tal':
|
||||||
|
testmodul.testTal()
|
||||||
|
elif debugcommand[1] =='baumhaus':
|
||||||
|
testmodul.testBaumhaus()
|
||||||
|
elif debugcommand[1] == 'stier':
|
||||||
|
testmodul.testStier()
|
||||||
|
|
||||||
|
world.fehler = ''
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
actionmodul.clearFehler()
|
||||||
parsedCommand = world.parseInput(command)
|
parsedCommand = world.parseInput(command)
|
||||||
commandid = parsedCommand.commandid
|
commandid = parsedCommand.commandid
|
||||||
verarbeiteBefehl(parsedCommand)
|
verarbeiteBefehl(parsedCommand)
|
||||||
schrittzaehler = schrittzaehler +1
|
|
||||||
actionmodul.raumaction()
|
actionmodul.raumaction()
|
||||||
|
|
||||||
wrapper(inputLoop)
|
def debug_Personen():
|
||||||
|
logging.debug('Personen im aktuellen Raum')
|
||||||
|
|
||||||
|
for pid in world.aktuellerRaum.personen:
|
||||||
|
person = world.personen[pid]
|
||||||
|
|
||||||
|
logging.debug(f'Id: {person.id} - Name: {person.name}')
|
||||||
|
|
||||||
|
def debug_Items():
|
||||||
|
logging.debug('liste Items')
|
||||||
|
logging.debug(world.gegenstaende)
|
||||||
|
count = 0
|
||||||
|
for item in world.gegenstaende:
|
||||||
|
logging.debug(f'count= {count}')
|
||||||
|
logging.debug(f'Itemtyp: {type(item)}')
|
||||||
|
# logging.debug(f'Item-IdId:{item.id} - Item-Name:{item.name}')
|
||||||
|
count = count +1
|
||||||
|
|
||||||
|
def debug_Inventar():
|
||||||
|
logging.debug('liste Items')
|
||||||
|
logging.debug(world.inventar)
|
||||||
|
count = 0
|
||||||
|
for item in world.inventar:
|
||||||
|
logging.debug(f'count= {count}')
|
||||||
|
logging.debug(f'Itemtyp: {type(item)}')
|
||||||
|
# logging.debug(f'Item-IdId:{item.id} - Item-Name:{item.name}')
|
||||||
|
count = count +1
|
||||||
|
|
||||||
|
def main():
|
||||||
|
wrapper(inputLoop)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
262
world.xml
262
world.xml
@@ -4,7 +4,7 @@
|
|||||||
<raum id='1' name='Esszimmer'>
|
<raum id='1' name='Esszimmer'>
|
||||||
<ausgang dir='Sued' nachRaum='3' />
|
<ausgang dir='Sued' nachRaum='3' />
|
||||||
<ausgang dir='Rauf' nachRaum='2' />
|
<ausgang dir='Rauf' nachRaum='2' />
|
||||||
<beschreibung> Vor dem Fenster steht ein Tisch, rechts davon führt eine Leiter nach oben.
|
<beschreibung> Vor dem Fenster steht ein Tisch, rechts davon führt eine Leiter nach oben. In der Ecke steht ein Boxsack.
|
||||||
</beschreibung>
|
</beschreibung>
|
||||||
|
|
||||||
</raum>
|
</raum>
|
||||||
@@ -36,6 +36,7 @@
|
|||||||
</raum>
|
</raum>
|
||||||
<raum id='6' name='Garten'>
|
<raum id='6' name='Garten'>
|
||||||
<ausgang dir='Nord' nachRaum='3' />
|
<ausgang dir='Nord' nachRaum='3' />
|
||||||
|
<ausgang dir='Sued' nachRaum='8' />
|
||||||
<ausgang dir='Rauf' nachRaum='7' />
|
<ausgang dir='Rauf' nachRaum='7' />
|
||||||
Du stehst im Vorgarten, die Haustür führt zurück ins Haus.
|
Du stehst im Vorgarten, die Haustür führt zurück ins Haus.
|
||||||
<beschreibung>
|
<beschreibung>
|
||||||
@@ -47,7 +48,128 @@
|
|||||||
<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. Aus dem Schornstein riecht es leicht nach verbranntem Buchenholz.
|
Du hast das Dach erklommen. Aus dem Schornstein riecht es leicht nach dem letzten Kaminfeuer.
|
||||||
|
</beschreibung>
|
||||||
|
</raum>
|
||||||
|
<raum id='8' name='Bach'>
|
||||||
|
<ausgang dir='Nord' nachRaum= '6' />
|
||||||
|
<ausgang dir='Sued' nachRaum= '11' />
|
||||||
|
|
||||||
|
<beschreibung>
|
||||||
|
Du stehst an einem Bach.
|
||||||
|
</beschreibung>
|
||||||
|
</raum>
|
||||||
|
<raum id='10' name='Teich'>
|
||||||
|
<ausgang dir='West' nachRaum= '8' />
|
||||||
|
|
||||||
|
<beschreibung>
|
||||||
|
Du stehst an einem Teich.
|
||||||
|
</beschreibung>
|
||||||
|
</raum>
|
||||||
|
<raum id='11' name='Feld'>
|
||||||
|
<ausgang dir='Nord' nachRaum= '8' />
|
||||||
|
<ausgang dir='Sued' nachRaum= '12' />
|
||||||
|
<ausgang dir='West' nachRaum= '13' />
|
||||||
|
|
||||||
|
<beschreibung>
|
||||||
|
Ein Feld.
|
||||||
|
</beschreibung>
|
||||||
|
</raum>
|
||||||
|
<raum id='12' name='kleines Feld'>
|
||||||
|
<ausgang dir='Nord' nachRaum= '11' />
|
||||||
|
<ausgang dir='West' nachRaum= '13' />
|
||||||
|
|
||||||
|
<beschreibung>
|
||||||
|
Ein kleineres Feld.
|
||||||
|
</beschreibung>
|
||||||
|
</raum>
|
||||||
|
<raum id='13' name='Wiese'>
|
||||||
|
<ausgang dir='Ost' nachRaum= '11' />
|
||||||
|
|
||||||
|
<beschreibung>
|
||||||
|
Du stehst auf einer umzäunten Wiese, Ein Gatter versperrt den Weg nach Süden.
|
||||||
|
</beschreibung>
|
||||||
|
</raum>
|
||||||
|
<raum id='14' name='Brachland'>
|
||||||
|
|
||||||
|
<beschreibung>
|
||||||
|
Brachland. Hier wächst nicht viel abgesehen von einer einzelnen Bohnenranke.
|
||||||
|
</beschreibung>
|
||||||
|
</raum>
|
||||||
|
<raum id='15' name='Spitze der Bohnenranke'>
|
||||||
|
<ausgang dir='Runter' nachRaum= '14' />
|
||||||
|
|
||||||
|
<beschreibung>
|
||||||
|
Du stehst auf der Spitze der Bohnenranke.
|
||||||
|
</beschreibung>
|
||||||
|
</raum>
|
||||||
|
<raum id='16' name='Pfad'>
|
||||||
|
<ausgang dir='Nord' nachRaum= '15' />
|
||||||
|
<ausgang dir='Sued' nachRaum= '17' />
|
||||||
|
|
||||||
|
<beschreibung>
|
||||||
|
Der Pfad führt weiter nach Süden.
|
||||||
|
</beschreibung>
|
||||||
|
</raum>
|
||||||
|
<raum id='17' name='südlicher Pfad'>
|
||||||
|
<ausgang dir='Nord' nachRaum= '16' />
|
||||||
|
<ausgang dir='Ost' nachRaum= '18' />
|
||||||
|
|
||||||
|
|
||||||
|
<beschreibung>
|
||||||
|
Der Pfad macht eine Biegung in östlicher Richtung.
|
||||||
|
</beschreibung>
|
||||||
|
</raum>
|
||||||
|
<raum id='18' name='östlicher Pfad'>
|
||||||
|
<ausgang dir='West' nachRaum= '17' />
|
||||||
|
<ausgang dir='Sued' nachRaum= '19' />
|
||||||
|
|
||||||
|
|
||||||
|
<beschreibung>
|
||||||
|
Der Pfad macht eine Biegung in östlicher Richtung.
|
||||||
|
</beschreibung>
|
||||||
|
</raum>
|
||||||
|
<raum id='19' name='Tal'>
|
||||||
|
<ausgang dir='West' nachRaum= '17' />
|
||||||
|
<ausgang dir='Ost' nachRaum= '21' />
|
||||||
|
<ausgang dir='Sued' nachRaum= '20' />
|
||||||
|
|
||||||
|
|
||||||
|
<beschreibung>
|
||||||
|
Du stehst in einem Tal, nach Westen führt ein Pfad, in südlicher Richtung entdeckst du in der Ferne einen Baum.
|
||||||
|
Nach Osten führt ein dunkler Tunnel
|
||||||
|
</beschreibung>
|
||||||
|
</raum>
|
||||||
|
<raum id='20' name='Baum'>
|
||||||
|
<ausgang dir='Nord' nachRaum= '18' />
|
||||||
|
<beschreibung>
|
||||||
|
Du stehst unter einem Baum mit einer dichten Baumkrone
|
||||||
|
</beschreibung>
|
||||||
|
</raum>
|
||||||
|
<raum id='21' name='Tunnel'>
|
||||||
|
<ausgang dir='West' nachRaum= '18' />
|
||||||
|
<beschreibung>
|
||||||
|
Im Tunnel ist es dunkel.
|
||||||
|
</beschreibung>
|
||||||
|
</raum>
|
||||||
|
<raum id='22' name='Strand'>
|
||||||
|
<ausgang dir='West' nachRaum= '20' />
|
||||||
|
<ausgang dir='Sued' nachRaum= '22' />
|
||||||
|
<beschreibung>
|
||||||
|
Du stehst am Strand eines großen Sees. In südlicher Richtung scheint ein Hafen zu sein.
|
||||||
|
</beschreibung>
|
||||||
|
</raum>
|
||||||
|
<raum id='23' name='Hafen'>
|
||||||
|
<ausgang dir='Nord' nachRaum= '21' />
|
||||||
|
<ausgang dir='Sued' nachRaum= '22' />
|
||||||
|
<beschreibung>
|
||||||
|
Im Hafen liegt ein Segelschiff angeleint.
|
||||||
|
</beschreibung>
|
||||||
|
</raum>
|
||||||
|
<raum id='24' name='Baumhaus'>
|
||||||
|
<ausgang dir='Runter' nachRaum= '20' />
|
||||||
|
<beschreibung>
|
||||||
|
Das Baumhaus
|
||||||
</beschreibung>
|
</beschreibung>
|
||||||
</raum>
|
</raum>
|
||||||
</ebene>
|
</ebene>
|
||||||
@@ -56,6 +178,7 @@
|
|||||||
<command name='quit' id='0' key='0' />
|
<command name='quit' id='0' key='0' />
|
||||||
<command name='ende' id='0' key='0' />
|
<command name='ende' id='0' key='0' />
|
||||||
<command name='geh' id='1' key='1' />
|
<command name='geh' id='1' key='1' />
|
||||||
|
<command name='gehe' id='27' key='1' />
|
||||||
<command name='nimm' id='2' key='2' />
|
<command name='nimm' id='2' key='2' />
|
||||||
<command name='untersuche' id='3' key='3' />
|
<command name='untersuche' id='3' key='3' />
|
||||||
<command name='benutze' id='4' key='4' />
|
<command name='benutze' id='4' key='4' />
|
||||||
@@ -66,7 +189,6 @@
|
|||||||
<command name='west' id='9' key='8' />
|
<command name='west' id='9' key='8' />
|
||||||
<command name='rauf' id='10' key='9' />
|
<command name='rauf' id='10' key='9' />
|
||||||
<command name='runter' id='11' key='10' />
|
<command name='runter' id='11' key='10' />
|
||||||
<command name='gehe' id='12' key='11' />
|
|
||||||
<command name='inventar' id='13' key='12' />
|
<command name='inventar' id='13' key='12' />
|
||||||
<command name='about' id='14' key='13' />
|
<command name='about' id='14' key='13' />
|
||||||
<command name='verliere' id='15' key='14' />
|
<command name='verliere' id='15' key='14' />
|
||||||
@@ -80,6 +202,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' />
|
<command name='klettere' id='24' key='21' />
|
||||||
|
<command name='fange' id='25' key='22' />
|
||||||
|
<command name='hilfe' id='28' key='23' />
|
||||||
|
<command name='schlage' id='29' 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' />
|
||||||
|
<command name='leere' id='35' key='26' />
|
||||||
|
<command name='fuelle' id='36' key='27' />
|
||||||
|
<command name='fülle' id='37' key='27' />
|
||||||
|
<command name='wirf' id='38' key='28' />
|
||||||
|
|
||||||
|
|
||||||
</commandset>
|
</commandset>
|
||||||
|
|
||||||
@@ -100,43 +235,58 @@
|
|||||||
<sortout name='in' />
|
<sortout name='in' />
|
||||||
<sortout name='und' />
|
<sortout name='und' />
|
||||||
<sortout name='kleiner' />
|
<sortout name='kleiner' />
|
||||||
|
<sortout name='nach' />
|
||||||
|
<sortout name='tote' />
|
||||||
</sortouts>
|
</sortouts>
|
||||||
<items>
|
<items>
|
||||||
<item name='Tisch' id='1' raum='1' imobil='true' adjektiv = '0' msgid='1' visible='true' />
|
<item name='Tisch' display='' id='1' raum='1' imobil='true' adjektiv = '0' msgid='1' visible='true' />
|
||||||
<item name='Leiter' id='2' raum='1' imobil='true' adjektiv = '0' msgid='1' visible='true' />
|
<item name='Leiter' display='' id='2' raum='1' imobil='true' adjektiv = '0' msgid='1' visible='true' />
|
||||||
<item name='Truhe' id='3' raum='2' imobil='false' adjektiv = '0' msgid='4' visible='true' />
|
<item name='Truhe' display='' id='3' raum='2' imobil='false' adjektiv = '0' msgid='4' visible='true' />
|
||||||
<item name='Pflanze' id='4' raum='3' imobil='false' adjektiv = '0' msgid='3' visible='true' />
|
<item name='Pflanze' display='' id='4' raum='3' imobil='false' adjektiv = '0' msgid='3' visible='true' />
|
||||||
<item name='Haustür' id='5' raum='3' imobil='true' adjektiv = '0' msgid='5' visible='true' />
|
<item name='Haustür' display='' id='5' raum='3' imobil='true' adjektiv = '0' msgid='5' visible='true' />
|
||||||
<item name='Glas' id='6' raum='3' imobil='false' adjektiv = '0' msgid='3' visible='false' />
|
<item name='Krug' display='' id='6' raum='3' imobil='false' adjektiv = '0' msgid='3' visible='false' />
|
||||||
<item name='Bett' id='7' raum='4' imobil='true' adjektiv = '0' msgid='1' visible=' true' />
|
<item name='Bett' display='' id='7' raum='4' imobil='true' adjektiv = '0' msgid='1' visible=' true' />
|
||||||
<item name='Nachtschrank' id='8' raum='4' imobil='true' adjektiv = '0' msgid='1' visible=' true' />
|
<item name='Nachtschrank' display='' id='8' raum='4' imobil='true' adjektiv = '0' msgid='1' visible=' true' />
|
||||||
<item name='Schlüssel' id='9' raum='5' imobil='false' adjektiv = '1' msgid='1' visible='false' />
|
<item name='Schlüssel' display='kleiner Schlüssel' id='9' raum='-1' imobil='false' adjektiv = '1' msgid='1' visible='false' />
|
||||||
<item name='Jacke' id='10' raum='5' imobil='false' adjektiv = '0' msgid='1' visible='true' />
|
<item name='Jacke' display='' id='10' raum='5' imobil='false' adjektiv = '0' msgid='1' visible='true' />
|
||||||
<item name='Schwert' id='11' raum='5' imobil='false' adjektiv = '0' msgid='1' visible='false' />
|
<item name='Schwert' display='' 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' display='' id='12' raum='-1' 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' display='' id='13' raum='4' imobil='false' adjektiv = '0' msgid='1' visible='false' />
|
||||||
<item name='Rankgitter' id='14' raum='6' imobil='false' adjektiv = '0' msgid='3' visible='true' />
|
<item name='Rankgitter' display='' 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' />
|
<item name='Planke' display='' id='15' raum='7' imobil='false' adjektiv = '0' msgid='3' visible='true' />
|
||||||
|
<item name='Teich' display='' id='16' raum='10' imobil='true' adjektiv = '0' msgid='2' visible='true' />
|
||||||
|
<item name='Fisch' display='' id='17' raum='10' imobil='false' adjektiv = '0' msgid='0' visible='false' />
|
||||||
|
<item name='Schwert' display='' id='18' raum='-1' imobil='false' adjektiv = '0' msgid='1' visible='false' />
|
||||||
|
<item name='Boxsack' display='' id='19' raum='1' imobil='true' adjektiv = '0' msgid='1' visible='true' />
|
||||||
|
<item name='Maus' display='tote Maus' id='20' raum='12' imobil='false' adjektiv = '0' msgid='1' visible='true' />
|
||||||
|
<item name='Bohnenranke' id='21' display='' raum='14' imobil='true' adjektiv = '0' msgid='8' visible='true' />
|
||||||
|
<item name='Elefant' id='22' display='' raum='15' imobil='true' adjektiv = '0' msgid='9' visible='true' />
|
||||||
|
<item name='Hafen' id='23' display='' raum='21' imobil='true' adjektiv = '0' msgid='10' visible='true' />
|
||||||
|
<item name='Segelschiff' id='24' display='' raum='22' imobil='true' adjektiv = '0' msgid='10' visible='true' />
|
||||||
|
<item name='Gatter' id='25' display='' raum='13' imobil='true' adjektiv = '0' msgid='11' visible='true' />
|
||||||
|
|
||||||
</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='1' />
|
||||||
<person name='Geist' id='4' raum='3' bewegung='0' />
|
<person name='Stier' id='5' raum='13' bewegung='0' />
|
||||||
<person name='Maus' id='4' raum='2' bewegung='0' />
|
<person name='Zwerg' id='6' raum='24' bewegung='0' />
|
||||||
</personen>
|
</personen>
|
||||||
<messages>
|
<messages>
|
||||||
<pickup text='Das ist zu schwer' id='1' />
|
<pickup text='Das ist zu schwer' id='1' />
|
||||||
<pickup text='Daran sind soviel Körperflüssigkeiten runtergelaufen, du möchtest das nicht anfassen' id='2' />
|
<pickup text='Das kannst du nicht mitnehmen' id='2' />
|
||||||
<pickup text='Das ist fest verschraubt' id ='3' />
|
<pickup text='Das ist fest verschraubt' id ='3' />
|
||||||
<pickup text='Daran hebst du dir nur nen Bruch' id='4' />
|
<pickup text='Daran hebst du dir nur nen Bruch' id='4' />
|
||||||
<pickup text='Die Eingangstür ist nicht zum Mitnehmen gedacht.' id='5' />
|
<pickup text='Die Eingangstür ist nicht zum Mitnehmen gedacht.' id='5' />
|
||||||
<pickup text='Das hängt viel zu hoch. Zu kommst nicht dran.' id='6' />
|
<pickup text='Das hängt viel zu hoch. Zu kommst nicht dran.' id='6' />
|
||||||
<pickup text='Kunstdiebstahl? Nö!' id='7' />
|
<pickup text='Kunstdiebstahl? Nö!' id='7' />
|
||||||
|
<pickup text='Die ist fest verwurzelt' id='8' />
|
||||||
|
<pickup text='Der scheint wütend zu werden, wenn man ihm am Rüssel zieht.' id='9' />
|
||||||
|
<pickup text='Das kannst du nicht tragen.' id='10' />
|
||||||
</messages>
|
</messages>
|
||||||
<bewegungen>
|
<bewegungen>
|
||||||
<bewegung id='0' value='' />
|
<bewegung id='0' value='' />
|
||||||
<bewegung id='1' value='1,3' />
|
<bewegung id='1' value='2,5,4,3,1,2' />
|
||||||
</bewegungen>
|
</bewegungen>
|
||||||
<texte>
|
<texte>
|
||||||
<text id='1'>
|
<text id='1'>
|
||||||
@@ -146,15 +296,65 @@
|
|||||||
<text id='2'>
|
<text id='2'>
|
||||||
In einer Schreibtischschublade findest du einen Schlüssel.
|
In einer Schreibtischschublade findest du einen Schlüssel.
|
||||||
</text>
|
</text>
|
||||||
<text id='item-11'>
|
<text id='item-13'>
|
||||||
Der Schlüssel ist etwa 10cm lang und hat eine ringförmige Reide. Der Bart hat drei Zacken und zwei Kerben.
|
Der Schlüssel schimmert etwas bläulich.
|
||||||
</text>
|
</text>
|
||||||
<text id='item-12'>
|
<text id='item-14'>
|
||||||
Zellblock 11-38
|
Mit mehreren Quersprossen reicht das Gitter bis zum Dach. Es ist ziemlich massiv.
|
||||||
</text>
|
</text>
|
||||||
<text id='item-9'>
|
<text id='item-15'>
|
||||||
Das Tor besteht aus schmideeisernen Stäben, die geschmiedete Querträger halten. Das Tor ist an den Seiten in Führungsschienen
|
Die Planke wirkt stabil genug, dein Gewicht zu tragen.
|
||||||
eingelassen. Auf der rechten Seite befindet sich etwa in der Mitte ein Schloss. Hinter dem Tor scheint ein Treppenhaus zu sein.
|
</text>
|
||||||
|
<text id='item-16'>
|
||||||
|
Der Teich wird vom Bach gespeist.Einige Wassertiere leben darin.
|
||||||
|
</text>
|
||||||
|
<text id='item-17'>
|
||||||
|
Der magische Fisch sagt: "Pflanzen brauchen Wasser" und verschwindet.
|
||||||
|
</text>
|
||||||
|
<text id='item-19'>
|
||||||
|
Der Boxsack trägt die Aufschrift: Eigentum von Maddes. Außerdem hat jemand ein großes V draufgemalt.
|
||||||
|
</text>
|
||||||
|
<text id='item-20'>
|
||||||
|
Die ist mausetot.
|
||||||
|
</text>
|
||||||
|
<text id='item-21-0'>
|
||||||
|
Ein Bohnengewächs der märchenhaften Gattung vigna hans in beatitudinem.
|
||||||
|
Sie ist etwas mickrig und braucht Pflege.
|
||||||
|
</text>
|
||||||
|
<text id='item-21-1'>
|
||||||
|
Ein Bohnengewächs der märchenhaften Gattung vigna hans in beatitudinem.
|
||||||
|
Sie reicht dir bis an die Schultern.
|
||||||
|
</text>
|
||||||
|
<text id='item-21-2'>
|
||||||
|
Ein Bohnengewächs der märchenhaften Gattung vigna hans in beatitudinem.
|
||||||
|
Sie wächst bis in die Wolken hinein.
|
||||||
|
</text>
|
||||||
|
<text id='item-22'>
|
||||||
|
Der Elefantbulle ist mindestens fünf Meter größer als du und hat zwei beeindruckende Stoßzähne. Er versperrt den Ausgang.
|
||||||
|
</text>
|
||||||
|
<text id='hilfe'>
|
||||||
|
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".
|
||||||
|
Die Aufgabe gibt dir jemand im Spiel.
|
||||||
|
</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.
|
||||||
|
Jetzt musst du dich auf die Suche machen, so dass ich endlich meinen Frieden finden kann.
|
||||||
|
Suche das Grab im Wolkenreich.Öffne es und ich bin erlöst.
|
||||||
|
</text>
|
||||||
|
<text id='seilwurf'>
|
||||||
|
Du wirfst das Seil Richtung Baumkrone. Dort verfängt es sich so fest, dass du daran klettern kannst.
|
||||||
|
</text>
|
||||||
|
<text id='mauswurf'>
|
||||||
|
Als der Elefant die Maus sieht, bekommt er einen Riesenschreck und flüchtet. Dadurch wird der Weg nach Süden frei.
|
||||||
|
</text>
|
||||||
|
<text id='jackewurf'>
|
||||||
|
Der Stier ist völlig fasziniert, als du die Jacke hin und herschwenkst. Als du sie nach Osten wirfst, schaubt er einmal auf und rennt hinter her.
|
||||||
</text>
|
</text>
|
||||||
</texte>
|
</texte>
|
||||||
</welt>
|
</welt>
|
||||||
|
Reference in New Issue
Block a user