mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-16 05:30:05 +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/events.h"
|
||||||
#include "common/keyboard.h"
|
#include "common/keyboard.h"
|
||||||
#include "common/scummsys.h"
|
#include "common/scummsys.h"
|
||||||
|
#include "common/str.h"
|
||||||
#include "common/system.h"
|
#include "common/system.h"
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
#include "graphics/cursorman.h"
|
#include "graphics/cursorman.h"
|
||||||
@ -97,6 +98,14 @@ static MenuSettings createMainMenu(bool lba1) {
|
|||||||
return settings;
|
return settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static MenuSettings createLba1ClassicNewGame() {
|
||||||
|
MenuSettings settings;
|
||||||
|
settings.addButton(TextId::kReturnMenu);
|
||||||
|
settings.addButton(TextId::kNewGame);
|
||||||
|
settings.addButton(TextId::kNewGamePlus);
|
||||||
|
return settings;
|
||||||
|
}
|
||||||
|
|
||||||
static MenuSettings createGiveUpMenu() {
|
static MenuSettings createGiveUpMenu() {
|
||||||
MenuSettings settings;
|
MenuSettings settings;
|
||||||
settings.setButtonsBoxHeight(240);
|
settings.setButtonsBoxHeight(240);
|
||||||
@ -157,9 +166,14 @@ static MenuSettings createVolumeMenu() {
|
|||||||
|
|
||||||
const char *MenuSettings::getButtonText(Text *text, int buttonIndex) {
|
const char *MenuSettings::getButtonText(Text *text, int buttonIndex) {
|
||||||
if (_buttonTexts[buttonIndex].empty()) {
|
if (_buttonTexts[buttonIndex].empty()) {
|
||||||
const TextId textId = getButtonTextId(buttonIndex);
|
TextId textId = getButtonTextId(buttonIndex);
|
||||||
char dialText[256] = "";
|
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;
|
_buttonTexts[buttonIndex] = dialText;
|
||||||
}
|
}
|
||||||
return _buttonTexts[buttonIndex].c_str();
|
return _buttonTexts[buttonIndex].c_str();
|
||||||
@ -174,6 +188,7 @@ Menu::Menu(TwinEEngine *engine) {
|
|||||||
_saveManageMenuState = _priv::createSaveManageMenu();
|
_saveManageMenuState = _priv::createSaveManageMenu();
|
||||||
_giveUpMenuState = _priv::createGiveUpMenu();
|
_giveUpMenuState = _priv::createGiveUpMenu();
|
||||||
_mainMenuState = _priv::createMainMenu(engine->isLBA1());
|
_mainMenuState = _priv::createMainMenu(engine->isLBA1());
|
||||||
|
_newGameMenuState = _priv::createLba1ClassicNewGame();
|
||||||
_advOptionsMenuState = _priv::createAdvancedOptionsMenu();
|
_advOptionsMenuState = _priv::createAdvancedOptionsMenu();
|
||||||
|
|
||||||
Common::fill(&_behaviourAnimState[0], &_behaviourAnimState[4], 0);
|
Common::fill(&_behaviourAnimState[0], &_behaviourAnimState[4], 0);
|
||||||
@ -740,6 +755,34 @@ int32 Menu::optionsMenu() {
|
|||||||
return 0;
|
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[] = {
|
static const byte cursorArrow[] = {
|
||||||
1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||||
1, 0, 1, 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)) {
|
switch (processMenu(&_mainMenuState)) {
|
||||||
case (int32)TextId::toNewGame:
|
case (int32)TextId::toNewGame:
|
||||||
case (int32)TextId::kNewGame: {
|
case (int32)TextId::kNewGame: {
|
||||||
|
if (_engine->isLba1Classic()) {
|
||||||
|
if (newGameClassicMenu()) {
|
||||||
|
return EngineState::GameLoop;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (_engine->_menuOptions->newGameMenu()) {
|
if (_engine->_menuOptions->newGameMenu()) {
|
||||||
return EngineState::GameLoop;
|
return EngineState::GameLoop;
|
||||||
}
|
}
|
||||||
|
@ -153,6 +153,7 @@ private:
|
|||||||
MenuSettings _saveManageMenuState;
|
MenuSettings _saveManageMenuState;
|
||||||
MenuSettings _giveUpMenuState;
|
MenuSettings _giveUpMenuState;
|
||||||
MenuSettings _mainMenuState;
|
MenuSettings _mainMenuState;
|
||||||
|
MenuSettings _newGameMenuState;
|
||||||
MenuSettings _advOptionsMenuState;
|
MenuSettings _advOptionsMenuState;
|
||||||
MenuSettings _optionsMenuState;
|
MenuSettings _optionsMenuState;
|
||||||
|
|
||||||
@ -240,6 +241,8 @@ public:
|
|||||||
/** Process hero behaviour menu */
|
/** Process hero behaviour menu */
|
||||||
void processBehaviourMenu();
|
void processBehaviourMenu();
|
||||||
|
|
||||||
|
int32 newGameClassicMenu();
|
||||||
|
|
||||||
/** Process in-game inventory menu */
|
/** Process in-game inventory menu */
|
||||||
void processInventoryMenu();
|
void processInventoryMenu();
|
||||||
};
|
};
|
||||||
|
@ -551,6 +551,27 @@ void GameState::addGas(int16 value) {
|
|||||||
setGas(_inventoryNumGas + 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) {
|
int16 GameState::setKashes(int16 value) {
|
||||||
_inventoryNumKashes = CLIP<int16>(value, 0, 999);
|
_inventoryNumKashes = CLIP<int16>(value, 0, 999);
|
||||||
if (_engine->_gameState->_inventoryNumKashes >= 500) {
|
if (_engine->_gameState->_inventoryNumKashes >= 500) {
|
||||||
|
@ -119,6 +119,7 @@ public:
|
|||||||
|
|
||||||
/** Its using FunFrock Sabre */
|
/** Its using FunFrock Sabre */
|
||||||
bool _usingSabre = false;
|
bool _usingSabre = false;
|
||||||
|
bool _endGameItems = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inventory used flags
|
* Inventory used flags
|
||||||
@ -173,6 +174,8 @@ public:
|
|||||||
int16 setMaxMagicPoints();
|
int16 setMaxMagicPoints();
|
||||||
int16 setLeafBoxes(int16 val);
|
int16 setLeafBoxes(int16 val);
|
||||||
|
|
||||||
|
void handleLateGameItems();
|
||||||
|
|
||||||
void addGas(int16 value);
|
void addGas(int16 value);
|
||||||
void addKeys(int16 val);
|
void addKeys(int16 val);
|
||||||
void addKashes(int16 val);
|
void addKashes(int16 val);
|
||||||
|
@ -601,6 +601,7 @@ void Scene::changeScene() {
|
|||||||
debug(2, "Scene %i music track id: %i", _currentSceneIdx, _sceneMusic);
|
debug(2, "Scene %i music track id: %i", _currentSceneIdx, _sceneMusic);
|
||||||
_engine->_music->playTrackMusic(_sceneMusic);
|
_engine->_music->playTrackMusic(_sceneMusic);
|
||||||
}
|
}
|
||||||
|
_engine->_gameState->handleLateGameItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
ActorStruct *Scene::getActor(int32 actorIdx) {
|
ActorStruct *Scene::getActor(int32 actorIdx) {
|
||||||
|
@ -492,6 +492,7 @@ enum class TextId : int16 {
|
|||||||
kReturnGame = 15,
|
kReturnGame = 15,
|
||||||
kSaveSettings = 16,
|
kSaveSettings = 16,
|
||||||
kNewGame = 20,
|
kNewGame = 20,
|
||||||
|
kNewGamePlus = 255,
|
||||||
kContinueGame = 21,
|
kContinueGame = 21,
|
||||||
kQuit = 22,
|
kQuit = 22,
|
||||||
kOptions = 23,
|
kOptions = 23,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user