Skip to content

Commit

Permalink
MADS: Fixes for recharging durafail batteries
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Jun 2, 2014
1 parent d1100ac commit 72e7d55
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
4 changes: 0 additions & 4 deletions engines/mads/game.h
Expand Up @@ -39,10 +39,6 @@ namespace MADS {

class MADSEngine;

enum {
PLAYER_INVENTORY = 2
};

enum KernelMode {
KERNEL_GAME_LOAD = 0, KERNEL_SECTION_PRELOAD = 1, KERNEL_SECTION_INIT = 2,
KERNEL_ROOM_PRELOAD = 3, KERNEL_ROOM_INIT = 4, KERNEL_ACTIVE_CODE = 5
Expand Down
2 changes: 1 addition & 1 deletion engines/mads/inventory.h
Expand Up @@ -30,7 +30,7 @@
namespace MADS {

enum {
NOWHERE = 1
PLAYER_INVENTORY = 2, NOWHERE = 1
};

class MADSEngine;
Expand Down
24 changes: 12 additions & 12 deletions engines/mads/nebular/game_nebular.cpp
Expand Up @@ -217,7 +217,7 @@ void GameNebular::initializeGlobals() {
_objects.setRoom(OBJ_PLANT_STALK, NOWHERE);

_globals[kLeavesStatus] = LEAVES_ON_GROUND;
_globals[kDurafailRecharged] = true;
_globals[kDurafailRecharged] = 1;
_globals[kPenlightCellStatus] = FIRST_TIME_CHARGED_DURAFAIL;
break;

Expand All @@ -227,7 +227,7 @@ void GameNebular::initializeGlobals() {

_globals[kLeavesStatus] = LEAVES_ON_GROUND;
_globals[kPenlightCellStatus] = FIRST_TIME_UNCHARGED_DURAFAIL;
_globals[kDurafailRecharged] = false;
_globals[kDurafailRecharged] = 0;
break;
}

Expand Down Expand Up @@ -550,15 +550,14 @@ void GameNebular::doObjectAction() {
case 1:
_objects.addToInventory(OBJ_DURAFAIL_CELLS);
dialogs.showItem(OBJ_DURAFAIL_CELLS,
_difficulty != 1 || _globals[kDurafailRecharged] ? 415 : 414);
_difficulty != DIFFICULTY_HARD || _globals[kDurafailRecharged] ? 415 : 414);
break;
case 2:
_objects.addToInventory(OBJ_DURAFAIL_CELLS);
if (_difficulty == 1) {
if (_difficulty == DIFFICULTY_HARD) {
dialogs.showItem(OBJ_DURAFAIL_CELLS, 416);
} else {
_globals[kHandsetCellStatus] = 0;
}
}
_globals[kHandsetCellStatus] = 0;
break;
case 3:
_objects.addToInventory(OBJ_PHONE_CELLS);
Expand All @@ -567,6 +566,7 @@ void GameNebular::doObjectAction() {
case 4:
_objects.addToInventory(OBJ_PHONE_CELLS);
dialogs.showItem(OBJ_PHONE_CELLS, 417);
_globals[kHandsetCellStatus] = 0;
break;
default:
dialogs.show(478);
Expand All @@ -592,16 +592,16 @@ void GameNebular::doObjectAction() {
if (_globals[kPenlightCellStatus]) {
dialogs.show(424);
} else {
_objects.setRoom(OBJ_DURAFAIL_CELLS, PLAYER_INVENTORY);
_globals[kPenlightCellStatus] = _difficulty != 1 || _globals[kDurafailRecharged] ? 1 : 2;
_objects.setRoom(OBJ_DURAFAIL_CELLS, NOWHERE);
_globals[kPenlightCellStatus] = _difficulty != DIFFICULTY_HARD || _globals[kDurafailRecharged] ? 1 : 2;
dialogs.show(423);
}
} else if (action.isAction(VERB_PUT, NOUN_DURAFAIL_CELLS, NOUN_PHONE_HANDSET)) {
if (_globals[kHandsetCellStatus]) {
dialogs.show(424);
dialogs.show(426);
} else {
_objects.setRoom(OBJ_DURAFAIL_CELLS, PLAYER_INVENTORY);
_globals[kDurafailRecharged] = _difficulty != 1 || _globals[kHandsetCellStatus] ? 1 : 2;
_objects.setRoom(OBJ_DURAFAIL_CELLS, NOWHERE);
_globals[kHandsetCellStatus] = _difficulty != DIFFICULTY_HARD || _globals[kHandsetCellStatus] ? 1 : 2;
dialogs.show(425);
}
} else if (action.isAction(VERB_SET, NOUN_TIMEBOMB)) {
Expand Down

0 comments on commit 72e7d55

Please sign in to comment.