Skip to content

Commit

Permalink
Fix conditions for completion of demo game
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kjetil-kilhavn committed Jun 4, 2023
1 parent f7613ce commit 966daee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src/zaxage_demo_01.prog.abap
Expand Up @@ -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 ).
Expand Down Expand Up @@ -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.

Expand Down
3 changes: 2 additions & 1 deletion src/zcl_axage_demo1.clas.abap
Expand Up @@ -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.
Expand Down

0 comments on commit 966daee

Please sign in to comment.