From 0ff17aac135f4fe034017317581e4d769c8c5203 Mon Sep 17 00:00:00 2001 From: Olli Graf Date: Sat, 11 Jun 2022 14:08:42 +0200 Subject: [PATCH] uto: bis zur Klippe. --- ActionModul.py | 9 ++++-- TestModule.py | 38 ++++++++++++++++++++--- World.py | 2 ++ data/__pycache__/Raum.cpython-38.pyc | Bin 3814 -> 3889 bytes data/__pycache__/__init__.cpython-38.pyc | Bin 136 -> 134 bytes tomb.py | 4 +++ world.xml | 1 + 7 files changed, 48 insertions(+), 6 deletions(-) diff --git a/ActionModul.py b/ActionModul.py index c7e9ff5..91d31c7 100644 --- a/ActionModul.py +++ b/ActionModul.py @@ -415,9 +415,10 @@ class ActionModul(ActionBasics): def nimm(self,parsedCommand): + logging.debug(f'start nimm() {parsedCommand.gegenstand}') item = self.world.findItemInAktuellerRaum(parsedCommand.gegenstand) - logging.debug(f'nimm(): item == {item}') + logging.debug(f'nimm(): item == {item.name}') if item != None: if item.imobil: text = self.world.msg[item.pickupmsg] @@ -459,9 +460,10 @@ class ActionModul(ActionBasics): def spring(self,parsedCommand): - if self.isRaum(self.world.RAUM_KLIPPE): + if self.isAktuellerRaum(self.world.RAUM_KLIPPE): weste = self.world.findItemImInventarById(self.world.ITEM_SCHWIMMWESTE) + logging.debug(f'weste={weste.zustand}') if weste != None and weste.zustand == weste.ANGEZOGEN: imwasser = self.world.findRaumById(self.world.RAUM_WASSER) @@ -565,11 +567,14 @@ class ActionModul(ActionBasics): def entzuende(self,parsedCommand): + logging.debug(f'entzünde {parsedCommand.gegenstand}') item = self.world.findItemImInventar(parsedCommand.gegenstand) if item == None: self.setFehler('Das besitzt du nicht.') + return + logging.debug(f'item={item}') if self.isItem(item, self.world.ITEM_FACKEL): self.toggleFackel(item) diff --git a/TestModule.py b/TestModule.py index cf627dc..a4a004a 100644 --- a/TestModule.py +++ b/TestModule.py @@ -44,7 +44,6 @@ class TestModule: 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 @@ -147,9 +146,7 @@ class TestModule: self.testTeich() logging.debug('===== Beginn Testmodul Stier =====') - pcmd = self.parseInput('nimm Fisch') - self.ac.nimm(pcmd) - + # zum Bach self.ac.west() self.schrittzaehler += 1 @@ -358,3 +355,36 @@ class TestModule: self.ac.ost() self.schrittzaehler += 1 + + def testKlippe(self): + self.testInsel() + logging.debug('===== Beginn Testmodul Klippe =====') + + pcmd = self.parseInput('entzünde Fackel') + self.ac.entzuende(pcmd) + self.schrittzaehler += 1 + + #Loch + self.ac.runter() + self.schrittzaehler += 1 + + pcmd = self.parseInput('nimm Schwimmweste') + self.ac.nimm(pcmd) + self.schrittzaehler += 1 + + # Insel + self.ac.rauf() + self.schrittzaehler += 1 + # return + + #Beiboot + self.ac.ost() + self.schrittzaehler += 1 + #Boot + self.ac.rauf() + self.schrittzaehler += 1 + + #klippe + self.ac.nord() + self.schrittzaehler += 1 + diff --git a/World.py b/World.py index cff38b7..14d5dc9 100644 --- a/World.py +++ b/World.py @@ -169,6 +169,7 @@ class World: return raum return None + def sucheRaumName(self,name): if name == None: return self.aktuellerRaum @@ -214,6 +215,7 @@ class World: logging.debug(f'item.raumid={item.raumid}') logging.debug(f'findItemInAktuellerRaum() {itemname} - {item.name}') if item.raumid == raum.id and item.name.lower() == itemname.lower(): + logging.debug(f'return {item.name}') return item logging.debug(f'Item {itemname} nicht im aktuellen Raum gefunden') diff --git a/data/__pycache__/Raum.cpython-38.pyc b/data/__pycache__/Raum.cpython-38.pyc index bef0cda2bee63ea762ec52a60cf729f7145a421c..3689a35cd31abd4da69cb109867ed1763895bfdd 100644 GIT binary patch delta 1002 zcmZ`&&uF<6UCKg z;j2=VEcmS)N=f*leu!U2H&+qTD%a?o0v=qH((pdG5>ArgDnSN*1+An-M@C>G7`Xd% zV{#dK4tMK_CKkI*DkCEI?4dnOPv4a0oad$f9EjcV9+e63>d% z@AQXu0uB5ULRt|YencazV`z#n&ypFNV#d+r(6NkrM3Y0BEol#au=zO= zLOIfvp2DX{K2JU26NjUK-Uj6-ftVCgdEuDh)%h_Zwc(ptox4pb?+}~}f|y3)>Od}P z)rVLPVb Jnu_T$_80PVs4oBj delta 907 zcmaJ<&ubG=5YF4(?7q$ZNQ^ev*o}#)#iW`ws7dihq!>sJ9;#3eVp&o)q^Y{XOYA{= z^CSp@a}_-4#ZwWA2hU!;_vA?g{{RmnIP)~EhfVh}A8+5h`M!BGvs3uyxvP$oO5pdw zgZ1xx#|;(MhLKXwhU)&(UhCV5z<^ImnQ{24EJIaYHu4mvxG+}lvJ>z{z0T$!t?jZR zeAeD)OXw6DLPZlg?N7n8z(Fw4M)b!O`v})K7Y?jB z9=zdYc&=}j&(g&t!8rmMY|u_JQ1lYyj7GIeXVM|zKx7deO|+4Mz?oRwr{6Vh`zI-^ zfKXB81O7_M(-^51G`qv~~QI+2PxXO#{oDhMqY)lMypS zMUU9iMep&$VJJ?+OEbq7;GNk9JC&cmKsRDiX_F2mo?tGlr1F>8lcSyfpdXFKy(p{& z!7v(*gFsA8_B@8(fGvI#exz>sRNP7PsF8=4{0`i=iqq@RK!R1YNgWzkhc5iKwq}=z zI_5QN@WPH*4}RJ8`c=9!wVl+;d&Esya%O9yiR^EW#gO(P=XMI0iS7!)LCfUqkj@4? zb-jRk_McZ$$tx{%glH2nRnSSr+%q0L8VrWfK+sUhITkc$f+j#vWd+qhP_m*0KV9Fd MWprHGjFI7g0P$jx<^TWy diff --git a/data/__pycache__/__init__.cpython-38.pyc b/data/__pycache__/__init__.cpython-38.pyc index b7d618cfc2d6e19f3bc07da91e32e4f687bfc0b3..75c81d11f34fc34bd158ea14957692b67ef2365e 100644 GIT binary patch delta 51 zcmeBRY-8jJ<>lpK0D=mh$w?D=tfjT}GxBp&_49LbGW7$B^0QL2OH%a|w< delta 53 zcmZo;>|o>x<>lpK0D=R1w#QB6v6j`<&&bbB)z8n#$ +