mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-13 12:10:30 +00:00
TWINE: implemented parts of the new game + option from lba1 classic
This commit is contained in:
parent
bd99e76dfa
commit
03ae234c5e
@ -27,6 +27,7 @@
|
||||
#include "common/events.h"
|
||||
#include "common/keyboard.h"
|
||||
#include "common/scummsys.h"
|
||||
#include "common/str.h"
|
||||
#include "common/system.h"
|
||||
#include "common/util.h"
|
||||
#include "graphics/cursorman.h"
|
||||
@ -97,6 +98,14 @@ static MenuSettings createMainMenu(bool lba1) {
|
||||
return settings;
|
||||
}
|
||||
|
||||
static MenuSettings createLba1ClassicNewGame() {
|
||||
MenuSettings settings;
|
||||
settings.addButton(TextId::kReturnMenu);
|
||||
settings.addButton(TextId::kNewGame);
|
||||
settings.addButton(TextId::kNewGamePlus);
|
||||
return settings;
|
||||
}
|
||||
|
||||
static MenuSettings createGiveUpMenu() {
|
||||
MenuSettings settings;
|
||||
settings.setButtonsBoxHeight(240);
|
||||
@ -157,9 +166,14 @@ static MenuSettings createVolumeMenu() {
|
||||
|
||||
const char *MenuSettings::getButtonText(Text *text, int buttonIndex) {
|
||||
if (_buttonTexts[buttonIndex].empty()) {
|
||||
const TextId textId = getButtonTextId(buttonIndex);
|
||||
TextId textId = getButtonTextId(buttonIndex);
|
||||
char dialText[256] = "";
|
||||
text->getMenuText(textId, dialText, sizeof(dialText));
|
||||
if (textId == TextId::kNewGamePlus) {
|
||||
text->getMenuText(TextId::kNewGame, dialText, sizeof(dialText));
|
||||
Common::strlcat(dialText, "+", sizeof(dialText));
|
||||
} else {
|
||||
text->getMenuText(textId, dialText, sizeof(dialText));
|
||||
}
|
||||
_buttonTexts[buttonIndex] = dialText;
|
||||
}
|
||||
return _buttonTexts[buttonIndex].c_str();
|
||||
@ -174,6 +188,7 @@ Menu::Menu(TwinEEngine *engine) {
|
||||
_saveManageMenuState = _priv::createSaveManageMenu();
|
||||
_giveUpMenuState = _priv::createGiveUpMenu();
|
||||
_mainMenuState = _priv::createMainMenu(engine->isLBA1());
|
||||
_newGameMenuState = _priv::createLba1ClassicNewGame();
|
||||
_advOptionsMenuState = _priv::createAdvancedOptionsMenu();
|
||||
|
||||
Common::fill(&_behaviourAnimState[0], &_behaviourAnimState[4], 0);
|
||||
@ -740,6 +755,34 @@ int32 Menu::optionsMenu() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32 Menu::newGameClassicMenu() {
|
||||
_engine->restoreFrontBuffer();
|
||||
|
||||
ScopedCursor scoped(_engine);
|
||||
for (;;) {
|
||||
switch (processMenu(&_newGameMenuState)) {
|
||||
case (int32)TextId::kReturnGame:
|
||||
case (int32)TextId::kReturnMenu: {
|
||||
return 0;
|
||||
}
|
||||
case (int32)TextId::kNewGamePlus:
|
||||
case (int32)TextId::kNewGame: {
|
||||
_engine->_gameState->_endGameItems = true;
|
||||
if (_engine->_menuOptions->newGameMenu()) {
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kQuitEngine:
|
||||
return kQuitEngine;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const byte cursorArrow[] = {
|
||||
1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
1, 0, 1, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
@ -789,6 +832,12 @@ EngineState Menu::run() {
|
||||
switch (processMenu(&_mainMenuState)) {
|
||||
case (int32)TextId::toNewGame:
|
||||
case (int32)TextId::kNewGame: {
|
||||
if (_engine->isLba1Classic()) {
|
||||
if (newGameClassicMenu()) {
|
||||
return EngineState::GameLoop;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (_engine->_menuOptions->newGameMenu()) {
|
||||
return EngineState::GameLoop;
|
||||
}
|
||||
|
@ -153,6 +153,7 @@ private:
|
||||
MenuSettings _saveManageMenuState;
|
||||
MenuSettings _giveUpMenuState;
|
||||
MenuSettings _mainMenuState;
|
||||
MenuSettings _newGameMenuState;
|
||||
MenuSettings _advOptionsMenuState;
|
||||
MenuSettings _optionsMenuState;
|
||||
|
||||
@ -240,6 +241,8 @@ public:
|
||||
/** Process hero behaviour menu */
|
||||
void processBehaviourMenu();
|
||||
|
||||
int32 newGameClassicMenu();
|
||||
|
||||
/** Process in-game inventory menu */
|
||||
void processInventoryMenu();
|
||||
};
|
||||
|
@ -551,6 +551,27 @@ void GameState::addGas(int16 value) {
|
||||
setGas(_inventoryNumGas + value);
|
||||
}
|
||||
|
||||
// late game items from lba1 classic new game +
|
||||
void GameState::handleLateGameItems() {
|
||||
if (!_endGameItems) {
|
||||
return;
|
||||
}
|
||||
debug("Give end game items");
|
||||
_endGameItems = false;
|
||||
_magicLevelIdx = 4;
|
||||
setMaxMagicPoints();
|
||||
giveItem(InventoryItems::kiUseSabre);
|
||||
giveItem(InventoryItems::kiProtoPack);
|
||||
giveItem(InventoryItems::kiHolomap);
|
||||
giveItem(InventoryItems::kiTunic);
|
||||
giveItem(InventoryItems::kiMagicBall);
|
||||
giveItem(InventoryItems::kSendellsMedallion);
|
||||
giveItem(InventoryItems::kiPenguin);
|
||||
giveItem(InventoryItems::kGasItem);
|
||||
giveItem(InventoryItems::kiCloverLeaf);
|
||||
addGas(10);
|
||||
}
|
||||
|
||||
int16 GameState::setKashes(int16 value) {
|
||||
_inventoryNumKashes = CLIP<int16>(value, 0, 999);
|
||||
if (_engine->_gameState->_inventoryNumKashes >= 500) {
|
||||
|
@ -119,6 +119,7 @@ public:
|
||||
|
||||
/** Its using FunFrock Sabre */
|
||||
bool _usingSabre = false;
|
||||
bool _endGameItems = false;
|
||||
|
||||
/**
|
||||
* Inventory used flags
|
||||
@ -173,6 +174,8 @@ public:
|
||||
int16 setMaxMagicPoints();
|
||||
int16 setLeafBoxes(int16 val);
|
||||
|
||||
void handleLateGameItems();
|
||||
|
||||
void addGas(int16 value);
|
||||
void addKeys(int16 val);
|
||||
void addKashes(int16 val);
|
||||
|
@ -601,6 +601,7 @@ void Scene::changeScene() {
|
||||
debug(2, "Scene %i music track id: %i", _currentSceneIdx, _sceneMusic);
|
||||
_engine->_music->playTrackMusic(_sceneMusic);
|
||||
}
|
||||
_engine->_gameState->handleLateGameItems();
|
||||
}
|
||||
|
||||
ActorStruct *Scene::getActor(int32 actorIdx) {
|
||||
|
@ -492,6 +492,7 @@ enum class TextId : int16 {
|
||||
kReturnGame = 15,
|
||||
kSaveSettings = 16,
|
||||
kNewGame = 20,
|
||||
kNewGamePlus = 255,
|
||||
kContinueGame = 21,
|
||||
kQuit = 22,
|
||||
kOptions = 23,
|
||||
|
Loading…
x
Reference in New Issue
Block a user