From 966daee0495ce78890085c29eb8704a8e67136f6 Mon Sep 17 00:00:00 2001 From: Kjetil Kilhavn Date: Sun, 4 Jun 2023 05:23:00 +0000 Subject: [PATCH] Fix conditions for completion of demo game The demo game states that you should deliver the RFC to the developers. Added condition that you have to be in the same room as bill the developer. --- src/zaxage_demo_01.prog.abap | 15 ++++++++------- src/zcl_axage_demo1.clas.abap | 3 ++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/zaxage_demo_01.prog.abap b/src/zaxage_demo_01.prog.abap index 67a3752..dfb2a10 100644 --- a/src/zaxage_demo_01.prog.abap +++ b/src/zaxage_demo_01.prog.abap @@ -72,14 +72,14 @@ CLASS main IMPLEMENTATION. engine = NEW #( ). - DATA(entrance) = NEW room( - name = 'Entrance' + DATA(entrance) = NEW room( + name = 'Entrance' descr = 'You are in the entrance area. Welcome.' ). - DATA(developer) = NEW room( - name = 'Developers office' + DATA(developer) = NEW room( + name = 'Developers office' descr = 'The developers area. be quiet!' ). - DATA(consulting) = NEW room( - name = 'Consulting Department' + DATA(consulting) = NEW room( + name = 'Consulting Department' descr = 'This is the area where the consultants work. Bring coffee!' ). engine->map->add_room( entrance ). @@ -153,7 +153,8 @@ CLASS main IMPLEMENTATION. result->add( |You are in the { engine->player->location->name }.| ). " { player->location->description }|. text->set_textstream( result->get( ) ). - IF engine->player->location->things->exists( 'RFC' ). + IF engine->player->location = bill_developer->location AND + engine->player->location->things->exists( 'RFC' ). engine->mission_completed = abap_true. ENDIF. diff --git a/src/zcl_axage_demo1.clas.abap b/src/zcl_axage_demo1.clas.abap index b1dca40..22f1291 100644 --- a/src/zcl_axage_demo1.clas.abap +++ b/src/zcl_axage_demo1.clas.abap @@ -97,7 +97,8 @@ CLASS zcl_axage_demo1 IMPLEMENTATION. out->write( interprete( 'EAST' )->get( ) ). out->write( interprete( 'TAKE KNIFE' )->get( ) ). - IF engine->player->location->things->exists( 'RFC' ). + IF engine->player->location = bill_developer->location AND + engine->player->location->things->exists( 'RFC' ). engine->mission_completed = abap_true. out->write( 'Congratulations! You delivered the RFC to the developers!' ). ENDIF.