Auto bis Tal.

This commit is contained in:
Olli Graf
2022-05-27 19:20:36 +02:00
parent 227271ad09
commit 6ae6f3efd8
5 changed files with 146 additions and 16 deletions

View File

@@ -277,10 +277,33 @@ class ActionModul(ActionBasics):
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.world.aktuellerRaum.richtungen[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')
else:
self.verliere(parsedCommand)
def klettere(self, parsedCommand):
@@ -292,7 +315,7 @@ class ActionModul(ActionBasics):
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):
ranke = self.findItemImInventarOderAktuellerRaum(self.world.ITEM_BOHNENRANKE)
if ranke.zustand == Gegenstand.GROSS:
self.ac.rauf()
@@ -301,15 +324,8 @@ class ActionModul(ActionBasics):
else:
self.setFehler('Eine Leiter sehe ich hier nicht.')
def insInventar(self, item):
logging.debug(f'neu ins Inventar: {item.name}')
self.world.inventar[item.id] = item
def moveItemVonRaumNachInventar(self,item):
logging.debug(f'moveItemVonRaumNachInventar(): entferne aus aktuellen Raum {item.name}')
del self.world.aktuellerRaum.items[item.id]
logging.debug(f'moveItemVonRaumNachInventar(): ins Inventar {item.name}')
self.insInventar(item)
def nimm(self,parsedCommand):
item = self.world.findItemInAktuellerRaum(parsedCommand.gegenstand)
@@ -354,11 +370,6 @@ class ActionModul(ActionBasics):
self.setFehler("diesen Gegenstand sehe ich hier nicht.")
def isItemAndAktRaum(self,item, itemid, raumid):
return self.isItem(item, itemid) and self.isAktuellerRaum(raumid)
def isItem(self, item, itemid):
return item.id == itemid
def sprich(self,parsedCommand):
geist = self.world.findPersonImAktuellenRaum(parsedCommand.gegenstand)