SUPERNOVA: Add improved mode

This commit is contained in:
Jaromir Wysoglad 2019-07-01 16:13:58 +02:00 committed by Thierry Crozat
parent c1317bb9c7
commit 61975aa2e2
5 changed files with 73 additions and 6 deletions

View File

@ -29,9 +29,13 @@
#include "supernova/supernova.h"
#define GAMEOPTION_IMPROVED GUIO_GAMEOPTIONS1
static const PlainGameDescriptor supernovaGames[] = {
{"msn1", "Mission Supernova 1"},
{"msn2", "Mission Supernova 2"},
{"msn1-i", "Mission Supernova 1 improved"},
{"msn2-i", "Mission Supernova 2 improved"},
{nullptr, nullptr}
};
@ -56,6 +60,24 @@ static const ADGameDescription gameDescriptions[] = {
ADGF_UNSTABLE,
GUIO1(GUIO_NONE)
},
{
"msn1-i",
nullptr,
AD_ENTRY1s("msn_data.000", "f64f16782a86211efa919fbae41e7568", 24163),
Common::DE_DEU,
Common::kPlatformDOS,
ADGF_UNSTABLE,
GUIO1(GAMEOPTION_IMPROVED)
},
{
"msn1-i",
nullptr,
AD_ENTRY1s("msn_data.000", "f64f16782a86211efa919fbae41e7568", 24163),
Common::EN_ANY,
Common::kPlatformDOS,
ADGF_UNSTABLE,
GUIO1(GAMEOPTION_IMPROVED)
},
// Mission Supernova 2
{
"msn2",
@ -75,6 +97,24 @@ static const ADGameDescription gameDescriptions[] = {
ADGF_UNSTABLE,
GUIO1(GUIO_NONE)
},
{
"msn2-i",
nullptr,
AD_ENTRY1s("ms2_data.000", "e595610cba4a6d24a763e428d05cc83f", 24805),
Common::DE_DEU,
Common::kPlatformDOS,
ADGF_UNSTABLE,
GUIO1(GAMEOPTION_IMPROVED)
},
{
"msn2-i",
nullptr,
AD_ENTRY1s("ms2_data.000", "e595610cba4a6d24a763e428d05cc83f", 24805),
Common::EN_ANY,
Common::kPlatformDOS,
ADGF_UNSTABLE,
GUIO1(GAMEOPTION_IMPROVED)
},
AD_TABLE_END_MARKER
};
}

View File

@ -87,7 +87,8 @@ SupernovaEngine::SupernovaEngine(OSystem *syst)
, _sleepAutoSave(nullptr)
, _sleepAuoSaveVersion(-1)
, _delay(33)
, _textSpeed(kTextSpeed[2]) {
, _textSpeed(kTextSpeed[2])
, _improved(false) {
if (ConfMan.hasKey("textspeed"))
_textSpeed = ConfMan.getInt("textspeed");
@ -95,7 +96,13 @@ SupernovaEngine::SupernovaEngine(OSystem *syst)
_MSPart = 1;
else if (ConfMan.get("gameid") == "msn2")
_MSPart = 2;
else
else if (ConfMan.get("gameid") == "msn1-i") {
_MSPart = 1;
_improved = true;
} else if (ConfMan.get("gameid") == "msn2-i") {
_MSPart = 2;
_improved = true;
} else
_MSPart = 0;
DebugMan.addDebugChannel(kDebugGeneral, "general", "Supernova general debug channel");
}

View File

@ -90,6 +90,7 @@ public:
uint _delay;
int _textSpeed;
char _MSPart;
bool _improved;
Common::Error loadGameStrings();
void init();

View File

@ -1339,10 +1339,26 @@ bool ShipAirlock::interact(Action verb, Object &obj1, Object &obj2) {
}
void ShipAirlock::onEntrance() {
if (!hasSeen())
if (!isSectionVisible(kMaxSection - 1)) {
_vm->renderMessage(kStringShipAirlock4);
setSectionVisible(kMaxSection -1, kShownTrue);
}
if (_vm->_improved && isSectionVisible(kMaxSection - 2)) {
if (_objectState[0].hasProperty(OPENED)) {
_objectState[4].setProperty(WORN);
_objectState[5].setProperty(WORN);
_objectState[6].setProperty(WORN);
interact(ACTION_PRESS, _objectState[2], _gm->_nullObject);
interact(ACTION_PRESS, _objectState[3], _gm->_nullObject);
} else {
_objectState[4].disableProperty(WORN);
_objectState[5].disableProperty(WORN);
_objectState[6].disableProperty(WORN);
interact(ACTION_PRESS, _objectState[3], _gm->_nullObject);
interact(ACTION_PRESS, _objectState[2], _gm->_nullObject);
}
}
setRoomSeen(true);
}
ShipHold::ShipHold(SupernovaEngine *vm, GameManager1 *gm) {
@ -1419,6 +1435,7 @@ bool ShipHold::interact(Action verb, Object &obj1, Object &obj2) {
void ShipHold::onEntrance() {
if (!hasSeen())
_vm->renderMessage(kStringShipHold2);
_gm->_rooms[AIRLOCK]->setSectionVisible(kMaxSection - 2, kShownTrue);
setRoomSeen(true);
_gm->_rooms[COCKPIT]->setRoomSeen(true);
}

View File

@ -2728,7 +2728,8 @@ bool PuzzleFront::interact(Action verb, Object &obj1, Object &obj2) {
if (_gm->move(verb, obj1)) {
_gm->passageConstruction();
_gm->_newRoom = true;
} else if (verb == ACTION_PRESS && obj1._id >= PART0 && obj1._id <= PART15) {
} else if ((verb == ACTION_PRESS || (verb == ACTION_WALK && _vm->_improved))
&& obj1._id >= PART0 && obj1._id <= PART15) {
int pos = obj1._id - PART0;
int newPos = 0;
if (pos > 3 && _gm->_puzzleField[pos - 4] == 255)
@ -3573,7 +3574,8 @@ bool BstDoor::interact(Action verb, Object &obj1, Object &obj2) {
if (_gm->move(verb, obj1)) {
_gm->passageConstruction();
_gm->_newRoom = true;
} else if (verb == ACTION_PRESS && obj1._id >= BST1 && obj1._id <= BST16) {
} else if ((verb == ACTION_PRESS || (verb == ACTION_WALK && _vm->_improved))
&& obj1._id >= BST1 && obj1._id <= BST16) {
int number = obj1._id - (BST1 - 1);
if (isSectionVisible(number))
_vm->renderImage(number + 128);