diff options
Diffstat (limited to 'engines/tsage')
30 files changed, 1232 insertions, 1416 deletions
diff --git a/engines/tsage/blue_force/blueforce_logic.cpp b/engines/tsage/blue_force/blueforce_logic.cpp index be5fb4c7b7..c8a0117bcf 100644 --- a/engines/tsage/blue_force/blueforce_logic.cpp +++ b/engines/tsage/blue_force/blueforce_logic.cpp @@ -875,7 +875,6 @@ void PalettedScene::synchronize(Serializer &s) { void PalettedScene::postInit(SceneObjectList *OwnerList) { _hasFader = false; - _palette._field412 = 1; SceneExt::postInit(OwnerList); } @@ -890,8 +889,6 @@ void PalettedScene::remove() { BF_GLOBALS._scenePalette.loadPalette(2); BF_GLOBALS._sceneManager._hasPalette = true; } - - BF_GLOBALS._scenePalette._field412 = 0; } PaletteFader *PalettedScene::addFader(const byte *arrBufferRGB, int step, Action *action) { diff --git a/engines/tsage/blue_force/blueforce_scenes2.cpp b/engines/tsage/blue_force/blueforce_scenes2.cpp index 1b0ed2a145..e444c8b91d 100644 --- a/engines/tsage/blue_force/blueforce_scenes2.cpp +++ b/engines/tsage/blue_force/blueforce_scenes2.cpp @@ -1748,7 +1748,7 @@ void Scene280::Action1::signal() { case 1: scene->_jake.setStrip(2); scene->_jake.setFrame(1); - scene->_jake.animate(ANIM_MODE_8, NULL); + scene->_jake.animate(ANIM_MODE_8, 0, NULL); scene->_jake._numFrames = 5; scene->_stripManager.start(2800, this); diff --git a/engines/tsage/blue_force/blueforce_scenes4.cpp b/engines/tsage/blue_force/blueforce_scenes4.cpp index e4a349bc93..2b4c0ff348 100644 --- a/engines/tsage/blue_force/blueforce_scenes4.cpp +++ b/engines/tsage/blue_force/blueforce_scenes4.cpp @@ -295,9 +295,9 @@ bool Scene410::Driver::startAction(CursorType action, Event &event) { } } else if (!scene->_cuffedDriverFl) { SceneItem::display2(410, 7); - } else if (!scene->_field1FC0) { + } else if (!scene->_getDriverFl) { scene->_sceneMode = 4124; - scene->_field1FC0 = true; + scene->_getDriverFl = true; T2_GLOBALS._uiElements.addScore(30); scene->signal(); } else { @@ -483,7 +483,7 @@ bool Scene410::Harrison::startAction(CursorType action, Event &event) { } else { BF_GLOBALS._player.disableControl(); scene->_cuffedDriverFl = true; - scene->_field1FC0 = true; + scene->_getDriverFl = true; BF_GLOBALS._walkRegions.enableRegion(22); scene->_sceneMode = 4109; scene->_stripManager.start(4112, scene); @@ -505,7 +505,7 @@ Scene410::Scene410(): SceneExt() { _action1Count = _talkCount = 0; _cuffedPassengerFl = false; - _field1FC0 = false; + _getDriverFl = false; } void Scene410::synchronize(Serializer &s) { @@ -515,7 +515,7 @@ void Scene410::synchronize(Serializer &s) { s.syncAsSint16LE(_harrissonTalkFl); s.syncAsSint16LE(_cuffedDriverFl); s.syncAsSint16LE(_cuffedPassengerFl); - s.syncAsSint16LE(_field1FC0); + s.syncAsSint16LE(_getDriverFl); s.syncAsSint16LE(_driverOutOfTruckFl); s.syncAsSint16LE(_harrisonMovedFl); } diff --git a/engines/tsage/blue_force/blueforce_scenes4.h b/engines/tsage/blue_force/blueforce_scenes4.h index 92e91c93b2..e5877df4f0 100644 --- a/engines/tsage/blue_force/blueforce_scenes4.h +++ b/engines/tsage/blue_force/blueforce_scenes4.h @@ -120,7 +120,7 @@ public: bool _harrissonTalkFl; bool _cuffedDriverFl; bool _cuffedPassengerFl; - bool _field1FC0; + bool _getDriverFl; bool _driverOutOfTruckFl, _harrisonMovedFl; Scene410(); diff --git a/engines/tsage/blue_force/blueforce_scenes9.cpp b/engines/tsage/blue_force/blueforce_scenes9.cpp index 2b42dc8625..405a436f55 100644 --- a/engines/tsage/blue_force/blueforce_scenes9.cpp +++ b/engines/tsage/blue_force/blueforce_scenes9.cpp @@ -2977,7 +2977,6 @@ bool Scene920::Item8::startAction(CursorType action, Event &event) { // On the other hand, it's not really important as just after the hero leaves the scene // so the variable is no longer used. // scene->_oldCoord = &scene; - _field10 = 1; } else { scene->_sceneMode = 9201; scene->setAction(&scene->_sequenceManager1, scene, 9201, &BF_GLOBALS._player, NULL); diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp index f7c1dd24e6..ba8cfb82a9 100644 --- a/engines/tsage/converse.cpp +++ b/engines/tsage/converse.cpp @@ -648,11 +648,11 @@ void StripManager::reset() { _delayFrames = 0; _owner = NULL; _endHandler = NULL; - _field2E6 = false; + _uselessFl = false; _stripNum = -1; - _obj44Index = 0; - _field2E8 = 0; - _field20 = 0; + _obj44ListIndex = 0; + _currObj44Id = 0; + _useless = 0; _activeSpeaker = NULL; _textShown = false; _callbackObject = NULL; @@ -696,14 +696,14 @@ void StripManager::synchronize(Serializer &s) { Action::synchronize(s); s.syncAsSint32LE(_stripNum); - s.syncAsSint32LE(_obj44Index); - s.syncAsSint32LE(_field20); + s.syncAsSint32LE(_obj44ListIndex); + s.syncAsSint32LE(_useless); s.syncAsSint32LE(_sceneNumber); _sceneBounds.synchronize(s); SYNC_POINTER(_activeSpeaker); s.syncAsByte(_textShown); - s.syncAsByte(_field2E6); - s.syncAsSint32LE(_field2E8); + s.syncAsByte(_uselessFl); + s.syncAsSint32LE(_currObj44Id); if (g_vm->getGameID() == GType_Ringworld2) s.syncAsSint16LE(_exitMode); @@ -785,14 +785,14 @@ void StripManager::signal() { _textShown = false; } - if (_obj44Index < 0) { + if (_obj44ListIndex < 0) { EventHandler *owner = _endHandler; - int stripNum = ABS(_obj44Index); + int stripNum = ABS(_obj44ListIndex); remove(); start(stripNum, owner); return; - } else if (_obj44Index == 10000) { + } else if (_obj44ListIndex == 10000) { // Reached end of strip EventHandler *endHandler = _endHandler; remove(); @@ -809,7 +809,7 @@ void StripManager::signal() { // Load the data for the strip load(); - Obj44 &obj44 = _obj44List[_obj44Index]; + Obj44 &obj44 = _obj44List[_obj44ListIndex]; if (g_vm->getGameID() == GType_Ringworld2) { // Return to Ringworld specific handling @@ -831,7 +831,7 @@ void StripManager::signal() { } } - _field2E8 = obj44._id; + _currObj44Id = obj44._id; Common::StringArray choiceList; // Build up a list of script entries @@ -925,7 +925,7 @@ void StripManager::signal() { // Get the user to select a conversation option strIndex = _choiceDialog.execute(choiceList); - if ((delayFlag || choiceList.size() != 1) && !_field2E6) + if ((delayFlag || choiceList.size() != 1) && !_uselessFl) _delayFrames = 1; else { Speaker *speakerP = getSpeaker((const char *)&_script[0] + obj44._speakerOffset); @@ -978,10 +978,10 @@ void StripManager::signal() { } } - _obj44Index = getNewIndex(obj44._list[strIndex]._id); - if (_obj44Index == 10001) { + _obj44ListIndex = getNewIndex(obj44._list[strIndex]._id); + if (_obj44ListIndex == 10001) { MessageDialog::show("Strip Failure: Node not found", OK_BTN_STRING); - _obj44Index = 0; + _obj44ListIndex = 0; } } @@ -991,16 +991,16 @@ void StripManager::process(Event &event) { return; if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE)) { - if (_obj44Index != 10000) { - int currIndex = _obj44Index; - while (!_obj44List[_obj44Index]._list[1]._id) { - _obj44Index = getNewIndex(_obj44List[_obj44Index]._list[0]._id); - if ((_obj44Index < 0) || (_obj44Index == 10000)) + if (_obj44ListIndex != 10000) { + int currIndex = _obj44ListIndex; + while (!_obj44List[_obj44ListIndex]._list[1]._id) { + _obj44ListIndex = getNewIndex(_obj44List[_obj44ListIndex]._list[0]._id); + if ((_obj44ListIndex < 0) || (_obj44ListIndex == 10000)) break; - currIndex = _obj44Index; + currIndex = _obj44ListIndex; } - _field2E8 = _obj44List[currIndex]._id; + _currObj44Id = _obj44List[currIndex]._id; } // Signal the end of the strip diff --git a/engines/tsage/converse.h b/engines/tsage/converse.h index e7b8e811ca..8aa91ec3ef 100644 --- a/engines/tsage/converse.h +++ b/engines/tsage/converse.h @@ -212,8 +212,8 @@ private: int getNewIndex(int newId); public: int _stripNum; - int _obj44Index; - int _field20; + int _obj44ListIndex; + int _useless; int _sceneNumber; Rect _sceneBounds; ConversationChoiceDialog _choiceDialog; @@ -221,8 +221,8 @@ public: StripCallback *_callbackObject; Speaker *_activeSpeaker; bool _textShown; - bool _field2E6; - int _field2E8; + bool _uselessFl; + int _currObj44Id; int _exitMode; Common::Array<Obj44> _obj44List; Common::Array<byte> _script; diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 0b3eb53268..7f27c43a22 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1301,7 +1301,6 @@ ScenePalette::ScenePalette() { *palData++ = idx; } - _field412 = 0; _redColor = _greenColor = _blueColor = 0; _aquaColor = 0; _purpleColor = 0; @@ -1313,7 +1312,6 @@ ScenePalette::~ScenePalette() { } ScenePalette::ScenePalette(int paletteNum) { - _field412 = 0; _redColor = _greenColor = _blueColor = 0; _aquaColor = 0; _purpleColor = 0; @@ -1565,8 +1563,13 @@ void SceneItem::synchronize(Serializer &s) { _bounds.synchronize(s); s.syncString(_msg); - s.syncAsSint32LE(_fieldE); - s.syncAsSint32LE(_field10); + + if (s.getVersion() < 15) { + int useless = 0; + s.syncAsSint32LE(useless); + s.syncAsSint32LE(useless); + } + s.syncAsSint16LE(_position.x); s.syncAsSint32LE(_position.y); s.syncAsSint16LE(_yDiff); s.syncAsSint32LE(_sceneRegionId); @@ -2119,7 +2122,7 @@ SceneObject::SceneObject() : SceneHotspot() { _xs = 0; _xe = 0; _endFrame = 0; - _field68 = 0; + _loopCount = 0; _regionIndex = 0; _shadowMap = NULL; } @@ -2368,7 +2371,7 @@ void SceneObject::animate(AnimateMode animMode, ...) { case ANIM_MODE_1: _frameChange = 1; - _field2E = _position; + _oldPosition = _position; _endAction = 0; break; @@ -2416,9 +2419,9 @@ void SceneObject::animate(AnimateMode animMode, ...) { case ANIM_MODE_9: if (_animateMode == ANIM_MODE_9 && g_vm->getGameID() == GType_Ringworld2) { _frameChange = -1; - _field2E = _position; + _oldPosition = _position; } else { - _field68 = va_arg(va, int); + _loopCount = va_arg(va, int); _endAction = va_arg(va, Action *); _frameChange = 1; _endFrame = getFrameCount(); @@ -2485,7 +2488,7 @@ void SceneObject::synchronize(Serializer &s) { s.syncAsUint32LE(_updateStartFrame); s.syncAsUint32LE(_walkStartFrame); - s.syncAsSint16LE(_field2E.x); s.syncAsSint16LE(_field2E.y); + s.syncAsSint16LE(_oldPosition.x); s.syncAsSint16LE(_oldPosition.y); s.syncAsSint16LE(_percent); s.syncAsSint16LE(_priority); s.syncAsSint16LE(_angle); @@ -2500,7 +2503,7 @@ void SceneObject::synchronize(Serializer &s) { SYNC_ENUM(_animateMode, AnimateMode); s.syncAsSint32LE(_frame); s.syncAsSint32LE(_endFrame); - s.syncAsSint32LE(_field68); + s.syncAsSint32LE(_loopCount); s.syncAsSint32LE(_frameChange); s.syncAsSint32LE(_numFrames); s.syncAsSint32LE(_regionIndex); @@ -2587,9 +2590,9 @@ void SceneObject::dispatch() { case ANIM_MODE_1: if (isNoMover()) setFrame(1); - else if ((_field2E.x != _position.x) || (_field2E.y != _position.y)) { + else if ((_oldPosition.x != _position.x) || (_oldPosition.y != _position.y)) { setFrame(changeFrame()); - _field2E = _position; + _oldPosition = _position; } break; @@ -2632,7 +2635,7 @@ void SceneObject::dispatch() { _endFrame = 1; setFrame(changeFrame()); - } else if (!_field68 || (--_field68 > 0)) { + } else if (!_loopCount || (--_loopCount > 0)) { _frameChange = 1; _endFrame = getFrameCount(); @@ -2651,7 +2654,7 @@ void SceneObject::dispatch() { _frameChange = -1; _strip = ((_strip - 1) ^ 1) + 1; _endFrame = 1; - } else if ((_field68 == 0) || (--_field68 != 0)) { + } else if (!_loopCount || (--_loopCount > 0)) { _frameChange = 1; _endFrame = getFrameCount(); @@ -3365,7 +3368,6 @@ Player::Player(): SceneObject() { _canWalk = false; _enabled = false; _uiEnabled = false; - _field8C = 0; // Return to Ringworld specific fields _characterIndex = R2_NONE; @@ -3384,15 +3386,11 @@ void Player::postInit(SceneObjectList *OwnerList) { _canWalk = true; _uiEnabled = true; _percent = 100; - _field8C = 10; - if (g_vm->getGameID() != GType_Ringworld2) - { + if (g_vm->getGameID() != GType_Ringworld2) { _moveDiff.x = 4; _moveDiff.y = 2; - } - else - { + } else { _moveDiff.x = 3; _moveDiff.y = 2; _effect = EFFECT_SHADED; @@ -3500,7 +3498,10 @@ void Player::synchronize(Serializer &s) { s.syncAsByte(_canWalk); s.syncAsByte(_uiEnabled); - s.syncAsSint16LE(_field8C); + if (s.getVersion() < 15) { + int useless = 0; + s.syncAsSint16LE(useless); + } if (g_vm->getGameID() != GType_Ringworld) s.syncAsByte(_enabled); @@ -4248,7 +4249,6 @@ double FloatSet::sqrt(FloatSet &floatSet) { GameHandler::GameHandler() : EventHandler() { _nextWaitCtr = 1; _waitCtr.setCtr(1); - _field14 = 10; } GameHandler::~GameHandler() { @@ -4270,7 +4270,11 @@ void GameHandler::synchronize(Serializer &s) { _lockCtr.synchronize(s); _waitCtr.synchronize(s); s.syncAsSint16LE(_nextWaitCtr); - s.syncAsSint16LE(_field14); + + if (s.getVersion() < 14) { + int useless = 0; + s.syncAsSint16LE(useless); + } } /*--------------------------------------------------------------------------*/ diff --git a/engines/tsage/core.h b/engines/tsage/core.h index 3286ee1448..c285fba669 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -358,7 +358,6 @@ public: byte _palette[256 * 3]; GfxColors _colors; SynchronizedList<PaletteModifier *> _listeners; - int _field412; uint8 _redColor; uint8 _greenColor; @@ -410,12 +409,11 @@ class SceneItem : public EventHandler { public: Rect _bounds; Common::String _msg; - int _fieldE, _field10; Common::Point _position; int _yDiff; int _sceneRegionId; public: - SceneItem() : EventHandler() { _msg = "Feature"; _action = NULL; _sceneRegionId = 0; _yDiff = 0; _fieldE = _field10 = 0;} + SceneItem() : EventHandler() { _msg = "Feature"; _action = NULL; _sceneRegionId = 0; _yDiff = 0;} virtual void synchronize(Serializer &s); virtual Common::String getClassName() { return "SceneItem"; } @@ -529,7 +527,7 @@ public: int changeFrame(); uint32 _updateStartFrame; uint32 _walkStartFrame; - Common::Point _field2E; + Common::Point _oldPosition; int _percent; int _priority; int _angle; @@ -542,7 +540,7 @@ public: AnimateMode _animateMode; int _frame; int _endFrame; - int _field68; + int _loopCount; int _frameChange; int _numFrames; int _regionIndex; @@ -651,7 +649,6 @@ class Player : public SceneObject { public: bool _canWalk; bool _uiEnabled; - int _field8C; bool _enabled; // Return to Ringworld specific fields @@ -778,8 +775,6 @@ public: class ScenePriorities : public Common::List<Region> { public: int _resNum; - int _field14; - int _field16; Region _defaultPriorityRegion; public: void load(int resNum); @@ -885,7 +880,6 @@ public: RefCounter _lockCtr; RefCounter _waitCtr; int _nextWaitCtr; - int _field14; public: GameHandler(); virtual ~GameHandler(); diff --git a/engines/tsage/ringworld/ringworld_scenes1.cpp b/engines/tsage/ringworld/ringworld_scenes1.cpp index 5a42bc530d..df456f9ced 100644 --- a/engines/tsage/ringworld/ringworld_scenes1.cpp +++ b/engines/tsage/ringworld/ringworld_scenes1.cpp @@ -1623,7 +1623,7 @@ void Scene50::Action1::signal() { scene->_stripManager.start(63, this); break; case 2: - if (scene->_stripManager._field2E8 != 107) { + if (scene->_stripManager._currObj44Id != 107) { g_globals->_player.enableControl(); remove(); } else { @@ -2498,7 +2498,7 @@ void Scene90::Action1::signal() { case 5: scene->_soundHandler2.play(58); - if (scene->_stripManager._field2E8 == 220) + if (scene->_stripManager._currObj44Id == 220) scene->_stripManager.start(91, this, scene); else { scene->_stripManager.start(g_globals->getFlag(104) ? 93 : 92, this, scene); @@ -2714,7 +2714,7 @@ void Scene90::signal() { g_globals->_player.enableControl(); break; case 97: - _stripManager._field2E8 = 0; + _stripManager._currObj44Id = 0; _action1.setActionIndex(5); _action1.setDelay(1); break; @@ -2939,7 +2939,7 @@ void Scene6100::Action3::signal() { case 4: g_globals->setFlag(76); g_globals->_sceneManager.changeScene( - (scene->_stripManager._field2E8 == 135) ? 6100 : 2320); + (scene->_stripManager._currObj44Id == 135) ? 6100 : 2320); remove(); break; } diff --git a/engines/tsage/ringworld/ringworld_scenes3.cpp b/engines/tsage/ringworld/ringworld_scenes3.cpp index b2ed986331..e834e659b5 100644 --- a/engines/tsage/ringworld/ringworld_scenes3.cpp +++ b/engines/tsage/ringworld/ringworld_scenes3.cpp @@ -799,7 +799,7 @@ void Scene2100::Action9::signal() { scene->_stripManager.start(6010, this); break; case 6: - if (scene->_stripManager._field2E8 != 165) + if (scene->_stripManager._currObj44Id != 165) setAction(&scene->_action10); else setAction(&scene->_action11); @@ -1010,7 +1010,7 @@ void Scene2100::Action12::signal() { scene->_stripManager.start(6052, this); break; case 8: - if (scene->_stripManager._field2E8 == 320) + if (scene->_stripManager._currObj44Id == 320) g_globals->setFlag(74); setDelay(30); break; @@ -2352,11 +2352,11 @@ void Scene2150::Action2::signal() { scene->_hotspot14.setStrip(6); scene->_hotspot14.setPosition(Common::Point(59, 54)); - if (scene->_stripManager._field2E8 == 15) { + if (scene->_stripManager._currObj44Id == 15) { scene->_hotspot14.setFrame(5); RING_INVENTORY._ale._sceneNumber = 1; } else { - scene->_hotspot14.setFrame(scene->_stripManager._field2E8 - 5); + scene->_hotspot14.setFrame(scene->_stripManager._currObj44Id - 5); } g_globals->_player.setFrame(1); @@ -3160,7 +3160,7 @@ void Scene2230::Action1::signal() { switch (_actionIndex++) { case 0: - switch (scene->_field30A) { + switch (scene->_sceneMode) { case 1: scene->setAction(&scene->_action3); break; @@ -3201,7 +3201,7 @@ void Scene2230::Action2::signal() { switch (_actionIndex++) { case 0: - switch (scene->_field30A) { + switch (scene->_sceneMode) { case 2: scene->setAction(&scene->_action6, this); break; @@ -3212,7 +3212,7 @@ void Scene2230::Action2::signal() { break; case 1: { g_globals->_player.disableControl(); - scene->_field30A = 1; + scene->_sceneMode = 1; g_globals->_player._regionBitList |= ~0x80; Common::Point pt(160, 96); NpcMover *mover = new NpcMover(); @@ -3262,7 +3262,7 @@ void Scene2230::Action3::signal() { break; case 2: g_globals->_player._regionBitList |= 0x80; - scene->_field30A = 0; + scene->_sceneMode = 0; g_globals->_player.setVisage(0); g_globals->_player.setStrip2(-1); @@ -3292,7 +3292,7 @@ void Scene2230::Action5::signal() { switch (_actionIndex++) { case 0: - switch (scene->_field30A) { + switch (scene->_sceneMode) { case 2: scene->setAction(&scene->_action3, this); break; @@ -3318,7 +3318,7 @@ void Scene2230::Action5::signal() { case 3: g_globals->_events.setCursor(CURSOR_USE); g_globals->_player._uiEnabled = true; - scene->_field30A = 2; + scene->_sceneMode = 2; remove(); break; } @@ -3335,7 +3335,7 @@ void Scene2230::Action6::signal() { g_globals->_player.animate(ANIM_MODE_5, this); break; case 1: - scene->_field30A = 0; + scene->_sceneMode = 0; g_globals->_player.setVisage(0); g_globals->_player._strip = 1; g_globals->_player._canWalk = true; @@ -3352,7 +3352,7 @@ void Scene2230::Action7::signal() { case 0: g_globals->_player.disableControl(); - switch (scene->_field30A) { + switch (scene->_sceneMode) { case 1: scene->setAction(&scene->_action3, this); break; @@ -3408,7 +3408,7 @@ void Scene2230::Action8::signal() { case 0: g_globals->_player.disableControl(); - switch (scene->_field30A) { + switch (scene->_sceneMode) { case 1: scene->setAction(&scene->_action3, this); break; @@ -3431,7 +3431,7 @@ void Scene2230::Action8::signal() { g_globals->_sceneItems.remove(&scene->_hotspot11); g_globals->_sceneItems.remove(&scene->_hotspot12); - switch (scene->_field30A) { + switch (scene->_sceneMode) { case 1: scene->setAction(&scene->_action3, this); break; @@ -3560,7 +3560,7 @@ void Scene2230::Hotspot6::doAction(int action) { } break; case CURSOR_USE: - if (scene->_field30A == 1) + if (scene->_sceneMode == 1) scene->setAction(&scene->_action3); else if (g_globals->getFlag(13)) SceneItem::display2(2230, 28); @@ -3586,7 +3586,7 @@ void Scene2230::Hotspot7::doAction(int action) { } break; case CURSOR_USE: - if (scene->_field30A == 2) + if (scene->_sceneMode == 2) scene->setAction(&scene->_action6); else if (g_globals->getFlag(13)) SceneItem::display2(2230, 29); @@ -3692,7 +3692,7 @@ void Scene2230::Hotspot12::doAction(int action) { /*--------------------------------------------------------------------------*/ Scene2230::Scene2230() : _hotspot9(0, CURSOR_LOOK, 2230, 16, CURSOR_USE, 2230, 18, LIST_END) { - _field30A = 0; + _sceneMode = 0; } void Scene2230::postInit(SceneObjectList *OwnerList) { @@ -3726,7 +3726,7 @@ void Scene2230::postInit(SceneObjectList *OwnerList) { g_globals->_player._regionBitList |= 0x80; g_globals->_player.changeZoom(-1); - _field30A = 0; + _sceneMode = 0; g_globals->_player.enableControl(); _hotspot5.setBounds(Rect(108, 34, 142, 76)); @@ -3748,7 +3748,7 @@ void Scene2230::postInit(SceneObjectList *OwnerList) { void Scene2230::synchronize(Serializer &s) { Scene::synchronize(s); _rect1.synchronize(s); - s.syncAsSint16LE(_field30A); + s.syncAsSint16LE(_sceneMode); } void Scene2230::dispatch() { diff --git a/engines/tsage/ringworld/ringworld_scenes3.h b/engines/tsage/ringworld/ringworld_scenes3.h index 682ef44fc6..fafb72fcea 100644 --- a/engines/tsage/ringworld/ringworld_scenes3.h +++ b/engines/tsage/ringworld/ringworld_scenes3.h @@ -579,7 +579,7 @@ public: Hotspot11 _hotspot11; Hotspot12 _hotspot12; Rect _rect1; - int _field30A; + int _sceneMode; Scene2230(); virtual void postInit(SceneObjectList *OwnerList = NULL); diff --git a/engines/tsage/ringworld/ringworld_scenes5.cpp b/engines/tsage/ringworld/ringworld_scenes5.cpp index 1b6cd78223..1242f9f448 100644 --- a/engines/tsage/ringworld/ringworld_scenes5.cpp +++ b/engines/tsage/ringworld/ringworld_scenes5.cpp @@ -462,7 +462,7 @@ void Scene4000::Action12::signal() { break; case 2: g_globals->setFlag(32); - if (scene->_stripManager._field2E8 == 275) { + if (scene->_stripManager._currObj44Id == 275) { g_globals->setFlag(82); ADD_MOVER_NULL(scene->_guardRock, 292, 138); ADD_PLAYER_MOVER(283, 147); @@ -471,7 +471,7 @@ void Scene4000::Action12::signal() { } break; case 3: - if (scene->_stripManager._field2E8 == 275) { + if (scene->_stripManager._currObj44Id == 275) { g_globals->_sceneManager.changeScene(4100); } else { ADD_PLAYER_MOVER_THIS(scene->_guardRock, 300, 132); @@ -4222,7 +4222,12 @@ void Scene4300::process(Event &event) { void Scene4301::Action1::synchronize(Serializer &s) { Action::synchronize(s); - s.syncAsSint16LE(_field34E); + + if (s.getVersion() < 14) { + int useless = 0; + s.syncAsSint16LE(useless); + } + for (int idx = 0; idx < 6; ++idx) s.syncAsSint16LE(_indexList[idx]); } @@ -4268,7 +4273,6 @@ void Scene4301::Action1::signal() { scene->_hotspot3.fixPriority(255); scene->_hotspot3.hide(); - _field34E = 0; _state = 0; _actionIndex = 2; break; diff --git a/engines/tsage/ringworld/ringworld_scenes5.h b/engines/tsage/ringworld/ringworld_scenes5.h index 2fe26d9712..b49d2a6f02 100644 --- a/engines/tsage/ringworld/ringworld_scenes5.h +++ b/engines/tsage/ringworld/ringworld_scenes5.h @@ -656,7 +656,6 @@ class Scene4301 : public Scene { class Action1 : public ActionExt { public: SceneObject _buttonList[6]; - int _field34E; int _indexList[6]; virtual void synchronize(Serializer &s); diff --git a/engines/tsage/ringworld/ringworld_scenes6.cpp b/engines/tsage/ringworld/ringworld_scenes6.cpp index 65c1ed39c6..777eed2aab 100644 --- a/engines/tsage/ringworld/ringworld_scenes6.cpp +++ b/engines/tsage/ringworld/ringworld_scenes6.cpp @@ -1608,8 +1608,6 @@ Scene5200::Scene5200() : void Scene5200::postInit(SceneObjectList *OwnerList) { Scene::postInit(); setZoomPercents(0, 150, 199, 150); - _fieldA = 5600; - _fieldE = 5100; _hotspot9._state = 0; _hotspot10._state = 0; diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index e1d6e79423..25eafbb171 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -368,7 +368,6 @@ void SceneExt::postInit(SceneObjectList *OwnerList) { // Initialize fields _action = NULL; - _field12 = 0; _sceneMode = 0; static_cast<SceneHandlerExt *>(R2_GLOBALS._sceneHandler)->setupPaletteMaps(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp index 2592bde19a..7fdc1dc8a7 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp @@ -1541,7 +1541,7 @@ void Scene180::postInit(SceneObjectList *OwnerList) { } void Scene180::remove() { - _stripManager._field2E8 = -1; + _stripManager._currObj44Id = -1; // _stripManager._field2EA = -1; SceneExt::remove(); @@ -3556,7 +3556,7 @@ void Scene300::signal() { break; } - _stripManager._field2E8 = 0; + _stripManager._currObj44Id = 0; switch (_stripId) { case 400: R2_GLOBALS._player.disableControl(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index 39072f0329..0025d0ba61 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -1202,18 +1202,10 @@ void Scene1100::signal() { R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); if (_nextStripNum == 0) { R2_GLOBALS.setFlag(55); - if (R2_GLOBALS.getFlag(55)) { - if (R2_GLOBALS._player._characterIndex == R2_QUINN) - _stripManager.start(318, this); - else - _stripManager.start(323, this); - } else { - // This part is totally useless as flag 55 has been set right before the check - if (R2_GLOBALS._player._characterIndex == R2_QUINN) - _stripManager.start(317, this); - else - _stripManager.start(322, this); - } + if (R2_GLOBALS._player._characterIndex == R2_QUINN) + _stripManager.start(318, this); + else + _stripManager.start(323, this); } else _stripManager.start3(_nextStripNum, this, _stripManager._lookupList); @@ -2257,7 +2249,7 @@ Scene1337::Scene1337() { _actionIdx2 = 0; _showPlayerTurn = false; _displayHelpFl = false; - _winnerId = 0; + _winnerId = -1; _instructionsDisplayedFl = false; _instructionsWaitCount = 0; @@ -3158,14 +3150,12 @@ void Scene1337::Action3::signal() { scene->_gameBoardSide[2]._handCard[0]._card.setVisage(1332); scene->_gameBoardSide[2]._handCard[0]._card.setPosition(scene->_gameBoardSide[2]._handCard[0]._stationPos, 0); scene->_gameBoardSide[2]._handCard[0]._card.fixPriority(170); - if (scene->_gameBoardSide[2]._handCard[0]._cardId > 9) { - if (scene->_gameBoardSide[2]._handCard[0]._cardId > 25) { - scene->_gameBoardSide[2]._handCard[0]._card.setStrip(4); - scene->_gameBoardSide[2]._handCard[0]._card.setFrame(scene->_gameBoardSide[2]._handCard[0]._cardId - 25); - } else { - scene->_gameBoardSide[2]._handCard[0]._card.setStrip(3); - scene->_gameBoardSide[2]._handCard[0]._card.setFrame(scene->_gameBoardSide[2]._handCard[0]._cardId - 9); - } + if (scene->_gameBoardSide[2]._handCard[0]._cardId > 25) { + scene->_gameBoardSide[2]._handCard[0]._card.setStrip(4); + scene->_gameBoardSide[2]._handCard[0]._card.setFrame(scene->_gameBoardSide[2]._handCard[0]._cardId - 25); + } else if (scene->_gameBoardSide[2]._handCard[0]._cardId > 9) { + scene->_gameBoardSide[2]._handCard[0]._card.setStrip(3); + scene->_gameBoardSide[2]._handCard[0]._card.setFrame(scene->_gameBoardSide[2]._handCard[0]._cardId - 9); } else { scene->_gameBoardSide[2]._handCard[0]._card.setStrip(2); scene->_gameBoardSide[2]._handCard[0]._card.setFrame(scene->_gameBoardSide[2]._handCard[0]._cardId); @@ -3237,14 +3227,12 @@ void Scene1337::Action3::signal() { scene->_gameBoardSide[2]._handCard[1]._card.setPosition(scene->_gameBoardSide[2]._handCard[1]._stationPos, 0); scene->_gameBoardSide[2]._handCard[1]._card.fixPriority(170); - if (scene->_gameBoardSide[2]._handCard[1]._cardId > 9) { - if (scene->_gameBoardSide[2]._handCard[1]._cardId > 25) { - scene->_gameBoardSide[2]._handCard[1]._card.setStrip(4); - scene->_gameBoardSide[2]._handCard[1]._card.setFrame(scene->_gameBoardSide[2]._handCard[1]._cardId - 25); - } else { - scene->_gameBoardSide[2]._handCard[1]._card.setStrip(3); - scene->_gameBoardSide[2]._handCard[1]._card.setFrame(scene->_gameBoardSide[2]._handCard[1]._cardId - 9); - } + if (scene->_gameBoardSide[2]._handCard[1]._cardId > 25) { + scene->_gameBoardSide[2]._handCard[1]._card.setStrip(4); + scene->_gameBoardSide[2]._handCard[1]._card.setFrame(scene->_gameBoardSide[2]._handCard[1]._cardId - 25); + } else if (scene->_gameBoardSide[2]._handCard[1]._cardId > 9) { + scene->_gameBoardSide[2]._handCard[1]._card.setStrip(3); + scene->_gameBoardSide[2]._handCard[1]._card.setFrame(scene->_gameBoardSide[2]._handCard[1]._cardId - 9); } else { scene->_gameBoardSide[2]._handCard[1]._card.setStrip(2); scene->_gameBoardSide[2]._handCard[1]._card.setFrame(scene->_gameBoardSide[2]._handCard[1]._cardId); @@ -3317,14 +3305,12 @@ void Scene1337::Action3::signal() { scene->_gameBoardSide[2]._handCard[2]._card.setPosition(scene->_gameBoardSide[2]._handCard[2]._stationPos, 0); scene->_gameBoardSide[2]._handCard[2]._card.fixPriority(170); - if (scene->_gameBoardSide[2]._handCard[2]._cardId > 9) { - if (scene->_gameBoardSide[2]._handCard[2]._cardId > 25) { - scene->_gameBoardSide[2]._handCard[2]._card.setStrip(4); - scene->_gameBoardSide[2]._handCard[2]._card.setFrame(scene->_gameBoardSide[2]._handCard[2]._cardId - 25); - } else { - scene->_gameBoardSide[2]._handCard[2]._card.setStrip(3); - scene->_gameBoardSide[2]._handCard[2]._card.setFrame(scene->_gameBoardSide[2]._handCard[2]._cardId - 9); - } + if (scene->_gameBoardSide[2]._handCard[2]._cardId > 25) { + scene->_gameBoardSide[2]._handCard[2]._card.setStrip(4); + scene->_gameBoardSide[2]._handCard[2]._card.setFrame(scene->_gameBoardSide[2]._handCard[2]._cardId - 25); + } else if (scene->_gameBoardSide[2]._handCard[2]._cardId > 9) { + scene->_gameBoardSide[2]._handCard[2]._card.setStrip(3); + scene->_gameBoardSide[2]._handCard[2]._card.setFrame(scene->_gameBoardSide[2]._handCard[2]._cardId - 9); } else { scene->_gameBoardSide[2]._handCard[2]._card.setStrip(2); scene->_gameBoardSide[2]._handCard[2]._card.setFrame(scene->_gameBoardSide[2]._handCard[2]._cardId); @@ -3388,7 +3374,8 @@ void Scene1337::Action4::signal() { switch (_actionIndex++) { case 0: - if ((scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._cardId == 0) && (!scene->subC264B(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) { + if ( (scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._cardId == 0) + && (!scene->isStationCard(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) { if (scene->_cardsAvailableNumb < 0) scene->shuffleCards(); scene->_animatedCard._card.setPosition(Common::Point(162, 95), 0); @@ -3410,8 +3397,8 @@ void Scene1337::Action4::signal() { } break; case 1: - if ( ( scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card1Pos.x) - && ( scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card1Pos.y) ) { + if ( (scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card1Pos.x) + && (scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card1Pos.y) ) { scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._card.postInit(); scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._card._moveDiff = Common::Point(30, 30); scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._card.setVisage(1332); @@ -3425,7 +3412,8 @@ void Scene1337::Action4::signal() { scene->setAnimationInfo(&scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]); scene->_animatedCard._card.hide(); - if ((scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._cardId == 0) && (!scene->subC264B(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) { + if ( (scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._cardId == 0) + && (!scene->isStationCard(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) { if (scene->_cardsAvailableNumb < 0) scene->shuffleCards(); scene->_animatedCard._card.setPosition(Common::Point(162, 95)); @@ -3445,8 +3433,8 @@ void Scene1337::Action4::signal() { signal(); break; case 2: - if ( ( scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card2Pos.x) - && ( scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card2Pos.y) ) { + if ( (scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card2Pos.x) + && (scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card2Pos.y) ) { scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._card.postInit(); scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._card._moveDiff = Common::Point(30, 30); scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._card.setVisage(1332); @@ -3460,7 +3448,8 @@ void Scene1337::Action4::signal() { scene->setAnimationInfo(&scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]); scene->_animatedCard._card.hide(); - if ((scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._cardId == 0) && (!scene->subC264B(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) { + if ( (scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._cardId == 0) + && (!scene->isStationCard(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) { if (scene->_cardsAvailableNumb < 0) scene->shuffleCards(); scene->_animatedCard._card.setPosition(Common::Point(162, 95)); @@ -3480,8 +3469,8 @@ void Scene1337::Action4::signal() { signal(); break; case 3: - if ( ( scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card3Pos.x) - && ( scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card3Pos.y) ) { + if ( (scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card3Pos.x) + && (scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card3Pos.y) ) { scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._card.postInit(); scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._card._moveDiff = Common::Point(30, 30); scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._card.setVisage(1332); @@ -3495,7 +3484,8 @@ void Scene1337::Action4::signal() { scene->setAnimationInfo(&scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]); scene->_animatedCard._card.hide(); - if ((scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._cardId == 0) && (!scene->subC264B(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) { + if ( (scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._cardId == 0) + && (!scene->isStationCard(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) { if (scene->_cardsAvailableNumb < 0) scene->shuffleCards(); scene->_animatedCard._card.setPosition(Common::Point(162, 95)); @@ -3515,8 +3505,8 @@ void Scene1337::Action4::signal() { signal(); break; case 4: - if ( ( scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card4Pos.x) - && ( scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card4Pos.y) ) { + if ( (scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card4Pos.x) + && (scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card4Pos.y) ) { scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._card.postInit(); scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._card._moveDiff = Common::Point(30, 30); scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._card.setVisage(1332); @@ -3538,7 +3528,7 @@ void Scene1337::Action4::signal() { scene->handlePlayer1(); break; case 2: - scene->handlePlayer2(); + scene->handleAutoplayPlayer2(); break; case 3: scene->handlePlayer3(); @@ -3598,7 +3588,7 @@ void Scene1337::Action5::signal() { } /** - * Animations for playing a card + * Animations for playing a platform card */ void Scene1337::Action6::signal() { Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene; @@ -3637,6 +3627,9 @@ void Scene1337::Action6::signal() { } } +/** + * Upgrade platform to station by playing a station card on top of it + */ void Scene1337::Action7::signal() { Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene; @@ -3660,13 +3653,13 @@ void Scene1337::Action7::signal() { } scene->setAnimationInfo(scene->_actionCard2); scene->_aSound1.play(59); - scene->_item5._cardId = 1; - scene->_item5._stationPos = scene->_actionCard2->_stationPos; - scene->_item5._card.postInit(); - scene->_item5._card.hide(); - scene->_item5._card._flags = OBJFLAG_HIDING; + scene->_discardedPlatformCard._cardId = 1; + scene->_discardedPlatformCard._stationPos = scene->_actionCard2->_stationPos; + scene->_discardedPlatformCard._card.postInit(); + scene->_discardedPlatformCard._card.hide(); + scene->_discardedPlatformCard._card._flags = OBJFLAG_HIDING; - scene->discardCard(&scene->_item5); + scene->discardCard(&scene->_discardedPlatformCard); break; default: break; @@ -3969,7 +3962,7 @@ void Scene1337::Action11::signal() { int tmpVal = scene->getFreeHandCard(scene->_actionIdx1); scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx1]._handCard[tmpVal]; } - scene->_item1.setAction(&scene->_action12); + scene->_actionItem.setAction(&scene->_action12); noAction = false; } break; @@ -3988,7 +3981,7 @@ void Scene1337::Action11::signal() { int tmpVal = scene->getFreeHandCard(scene->_actionIdx1); scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx1]._handCard[tmpVal]; } - scene->_item1.setAction(&scene->_action12); + scene->_actionItem.setAction(&scene->_action12); noAction = false; } break; @@ -4012,7 +4005,7 @@ void Scene1337::Action11::signal() { int tmpVal = scene->getFreeHandCard(scene->_actionIdx1); scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx1]._handCard[tmpVal]; } - scene->_item1.setAction(&scene->_action12); + scene->_actionItem.setAction(&scene->_action12); noAction = false; } } @@ -4032,7 +4025,7 @@ void Scene1337::Action11::signal() { int tmpVal = scene->getFreeHandCard(scene->_actionIdx1); scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx1]._handCard[tmpVal]; } - scene->_item1.setAction(&scene->_action12); + scene->_actionItem.setAction(&scene->_action12); noAction = false; } break; @@ -4094,11 +4087,9 @@ void Scene1337::Action11::signal() { } // while scene->_displayHelpFl = true; scene->subC4CEC(); - } else { - if (scene->_actionIdx2 != 2) { - int tmpVal = scene->getFreeHandCard(scene->_actionIdx2); - scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx2]._handCard[tmpVal]; - } + } else if (scene->_actionIdx2 != 2) { + int tmpVal = scene->getFreeHandCard(scene->_actionIdx2); + scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx2]._handCard[tmpVal]; } } @@ -4261,21 +4252,19 @@ void Scene1337::Action12::signal() { } } scene->subC4CEC(); - } else { - if (scene->_actionIdx1 != 1) { - switch (scene->_actionIdx1) { - case 0: - scene->_actionCard3 = &scene->_gameBoardSide[0]._handCard[scene->getFreeHandCard(0)]; - break; - case 3: - scene->_actionCard3 = &scene->_gameBoardSide[3]._handCard[scene->getFreeHandCard(3)]; - break; - default: - break; - } - } else { - scene->_actionCard3 = &scene->_gameBoardSide[1]._handCard[scene->getFreeHandCard(1)]; + } else if (scene->_actionIdx1 != 1) { + switch (scene->_actionIdx1) { + case 0: + scene->_actionCard3 = &scene->_gameBoardSide[0]._handCard[scene->getFreeHandCard(0)]; + break; + case 3: + scene->_actionCard3 = &scene->_gameBoardSide[3]._handCard[scene->getFreeHandCard(3)]; + break; + default: + break; } + } else { + scene->_actionCard3 = &scene->_gameBoardSide[1]._handCard[scene->getFreeHandCard(1)]; } scene->_actionCard1->_card.postInit(); @@ -4317,6 +4306,7 @@ void Scene1337::Action12::signal() { break; } scene->discardCard(scene->_actionCard2); + scene->handleNextTurn(); break; default: break; @@ -4487,12 +4477,13 @@ void Scene1337::remove() { } R2_GLOBALS._uiElements._active = true; + R2_GLOBALS._uiElements._visible = true; SceneExt::remove(); } void Scene1337::process(Event &event) { if (event.eventType == EVENT_BUTTON_DOWN) { - if (event.btnState != BTNSHIFT_RIGHT) { + if (event.btnState == BTNSHIFT_RIGHT) { updateCursorId(R2_GLOBALS._mouseCursorId, true); event.handled = true; } else if (_delayedFunction) { @@ -4548,14 +4539,12 @@ void Scene1337::setAnimationInfo(Card *card) { if (!card) return; - if (card->_cardId > 9) { - if (card->_cardId > 25) { - card->_card.setStrip2(4); - card->_card.setFrame(card->_cardId - 25); - } else { - card->_card.setStrip2(3); - card->_card.setFrame(card->_cardId - 9); - } + if (card->_cardId > 25) { + card->_card.setStrip2(4); + card->_card.setFrame(card->_cardId - 25); + } else if (card->_cardId > 9) { + card->_card.setStrip2(3); + card->_card.setFrame(card->_cardId - 9); } else { card->_card.setStrip2(2); card->_card.setFrame(card->_cardId); @@ -4565,10 +4554,6 @@ void Scene1337::setAnimationInfo(Card *card) { R2_GLOBALS._sceneObjects->draw(); } -void Scene1337::subC20E5() { - subC2586(); -} - void Scene1337::handleNextTurn() { switch (_winnerId) { case -1: @@ -4598,11 +4583,11 @@ void Scene1337::handleNextTurn() { } if (!_autoplay) - _delayedFunction = &Scene1337::subC20E5; + _delayedFunction = &Scene1337::handlePlayerTurn; else - subC20E5(); + handlePlayerTurn(); } else { - subC20E5(); + handlePlayerTurn(); } break; case 0: @@ -4646,7 +4631,7 @@ void Scene1337::handleNextTurn() { } -void Scene1337::subC2586() { +void Scene1337::handlePlayerTurn() { if (_showPlayerTurn) _currentPlayerArrow.hide(); @@ -4662,7 +4647,7 @@ void Scene1337::subC2586() { case 1: // No break on purpose case 3: - _item1.setAction(&_action4); + _actionItem.setAction(&_action4); default: break; } @@ -4671,7 +4656,7 @@ void Scene1337::subC2586() { } -bool Scene1337::subC264B(int cardId) { +bool Scene1337::isStationCard(int cardId) { switch (cardId) { case 10: // No break on purpose @@ -4694,7 +4679,7 @@ bool Scene1337::subC264B(int cardId) { } } -bool Scene1337::subC2687(int cardId) { +bool Scene1337::isStopConstructionCard(int cardId) { switch (cardId) { case 11: // No break on purpose @@ -4709,14 +4694,14 @@ bool Scene1337::subC2687(int cardId) { } } -int Scene1337::subC26CB(int playerId, int handCardId) { +int Scene1337::getStationId(int playerId, int handCardId) { if ((_gameBoardSide[playerId]._handCard[handCardId]._cardId > 1) && (_gameBoardSide[playerId]._handCard[handCardId]._cardId <= 9)) return handCardId; return -1; } -int Scene1337::findNormalCardInHand(int playerId) { +int Scene1337::findPlatformCardInHand(int playerId) { for (int i = 0; i <= 3; i++) { if (_gameBoardSide[playerId]._handCard[i]._cardId == 1) return i; @@ -4725,7 +4710,7 @@ int Scene1337::findNormalCardInHand(int playerId) { return -1; } -int Scene1337::subC274D(int playerId) { +int Scene1337::findCard13InHand(int playerId) { for (int i = 0; i <= 3; i++) { if (_gameBoardSide[playerId]._handCard[i]._cardId == 13) return i; @@ -4734,17 +4719,17 @@ int Scene1337::subC274D(int playerId) { return -1; } -int Scene1337::subC2781(int arg1) { +int Scene1337::checkThieftCard(int playerId) { for (int i = 0; i <= 3; i++) { - if (_gameBoardSide[arg1]._handCard[i]._cardId == 25) + if (_gameBoardSide[playerId]._handCard[i]._cardId == 25) return i; } return -1; } -int Scene1337::subC27B5(int arg1) { - switch (arg1) { +int Scene1337::isDelayCard(int cardId) { + switch (cardId) { case 11: // No break on purpose case 14: @@ -4752,7 +4737,7 @@ int Scene1337::subC27B5(int arg1) { case 16: // No break on purpose case 24: - return arg1; + return cardId; break; default: return -1; @@ -4760,7 +4745,7 @@ int Scene1337::subC27B5(int arg1) { } } -int Scene1337::isSlowCard(int cardId) { +int Scene1337::getStationCardId(int cardId) { switch (cardId) { case 10: // No break on purpose @@ -4783,152 +4768,112 @@ int Scene1337::isSlowCard(int cardId) { } } -void Scene1337::subC2835(int arg1) { - int i; - bool found = false; - switch (arg1) { +void Scene1337::handlePlayer01Discard(int playerId) { + switch (playerId) { case 0: - for (i = 0; i <= 3; i++) { - if (isSlowCard(_gameBoardSide[arg1]._handCard[i]._cardId) != -1) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (getStationCardId(_gameBoardSide[playerId]._handCard[i]._cardId) != -1) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if (subC27B5(_gameBoardSide[arg1]._handCard[i]._cardId) != -1) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (isDelayCard(_gameBoardSide[playerId]._handCard[i]._cardId) != -1) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if ((_gameBoardSide[arg1]._handCard[i]._cardId > 1) && (_gameBoardSide[arg1]._handCard[i]._cardId <= 9)) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if ((_gameBoardSide[playerId]._handCard[i]._cardId > 1) && (_gameBoardSide[playerId]._handCard[i]._cardId <= 9)) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if ((_gameBoardSide[arg1]._handCard[i]._cardId >= 26) && (_gameBoardSide[arg1]._handCard[i]._cardId <= 33)) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if ((_gameBoardSide[playerId]._handCard[i]._cardId >= 26) && (_gameBoardSide[playerId]._handCard[i]._cardId <= 33)) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if (_gameBoardSide[arg1]._handCard[i]._cardId == 1) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (_gameBoardSide[playerId]._handCard[i]._cardId == 1) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if (_gameBoardSide[arg1]._handCard[i]._cardId == 25) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (_gameBoardSide[playerId]._handCard[i]._cardId == 25) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if (_gameBoardSide[arg1]._handCard[i]._cardId == 13) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (_gameBoardSide[playerId]._handCard[i]._cardId == 13) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } break; case 1: - for (i = 0; i <= 3; i++) { - if ((_gameBoardSide[arg1]._handCard[i]._cardId >= 26) && (_gameBoardSide[arg1]._handCard[i]._cardId <= 33)) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if ((_gameBoardSide[playerId]._handCard[i]._cardId >= 26) && (_gameBoardSide[playerId]._handCard[i]._cardId <= 33)) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if (_gameBoardSide[arg1]._handCard[i]._cardId == 1) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (_gameBoardSide[playerId]._handCard[i]._cardId == 1) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if ((_gameBoardSide[arg1]._handCard[i]._cardId > 1) && (_gameBoardSide[arg1]._handCard[i]._cardId <= 9)) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if ((_gameBoardSide[playerId]._handCard[i]._cardId > 1) && (_gameBoardSide[playerId]._handCard[i]._cardId <= 9)) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if (isSlowCard(_gameBoardSide[arg1]._handCard[i]._cardId) != -1) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (getStationCardId(_gameBoardSide[playerId]._handCard[i]._cardId) != -1) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if (subC27B5(_gameBoardSide[arg1]._handCard[i]._cardId) != -1) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (isDelayCard(_gameBoardSide[playerId]._handCard[i]._cardId) != -1) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if (_gameBoardSide[arg1]._handCard[i]._cardId == 25) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (_gameBoardSide[playerId]._handCard[i]._cardId == 25) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if (_gameBoardSide[arg1]._handCard[i]._cardId == 13) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (_gameBoardSide[playerId]._handCard[i]._cardId == 13) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } break; default: - return; + break; } - - discardCard(&_gameBoardSide[arg1]._handCard[i]); } void Scene1337::playThieftCard(int playerId, Card *card, int victimId) { @@ -4947,13 +4892,13 @@ void Scene1337::playThieftCard(int playerId, Card *card, int victimId) { _actionCard2 = &_gameBoardSide[victimId]._emptyStationPos; _actionCard3 = &_gameBoardSide[victimId]._handCard[randIndx]; - _item1.setAction(&_action11); + _actionItem.setAction(&_action11); } -int Scene1337::subC3257(int arg1) { +int Scene1337::getPreventionCardId(int cardId) { int retVal; - switch (arg1) { + switch (cardId) { case 10: retVal = 2; break; @@ -4985,35 +4930,35 @@ int Scene1337::subC3257(int arg1) { return retVal; } -bool Scene1337::subC32B1(int arg1, int arg2) { +bool Scene1337::isAttackPossible(int victimId, int cardId) { for (int i = 0; i <= 7; i++) { - if (_gameBoardSide[arg1]._outpostStation[i]._cardId != 0) { - if (subC3257(arg2) == _gameBoardSide[arg1]._outpostStation[i]._cardId) + if (_gameBoardSide[victimId]._outpostStation[i]._cardId != 0) { + if (getPreventionCardId(cardId) == _gameBoardSide[victimId]._outpostStation[i]._cardId) return false; } } return true; } -int Scene1337::subC331B(int arg1) { - int randIndx = R2_GLOBALS._randomSource.getRandomNumber(3); +int Scene1337::getPlayerWithOutpost(int playerId) { + int randPlayerId = R2_GLOBALS._randomSource.getRandomNumber(3); for (int i = 0; i <= 3; i++) { - if (randIndx != arg1) { + if (randPlayerId != playerId) { for (int j = 0; j <= 7; j++) { - if (_gameBoardSide[randIndx]._outpostStation[j]._cardId != 0) - return randIndx; + if (_gameBoardSide[randPlayerId]._outpostStation[j]._cardId != 0) + return randPlayerId; } } - if (arg1 == 1) { - randIndx--; - if (randIndx < 0) - randIndx = 3; + if (playerId == 1) { + randPlayerId--; + if (randPlayerId < 0) + randPlayerId = 3; } else { - ++randIndx; - if (randIndx > 3) - randIndx = 0; + ++randPlayerId; + if (randPlayerId > 3) + randPlayerId = 0; } } @@ -5036,10 +4981,10 @@ bool Scene1337::checkAntiDelayCard(int delayCardId, int cardId) { return false; } -void Scene1337::subC33C0(Card *subObj1, Card *subObj2) { - _actionCard1 = subObj1; - _actionCard2 = subObj2; - _item1.setAction(&_action7); +void Scene1337::playStationCard(Card *station, Card *platform) { + _actionCard1 = station; + _actionCard2 = platform; + _actionItem.setAction(&_action7); } int Scene1337::getFreeHandCard(int playerId) { @@ -5059,31 +5004,34 @@ int Scene1337::getFreeHandCard(int playerId) { return randIndx; } -void Scene1337::playCard(Card *card, Card *dest) { +void Scene1337::playPlatformCard(Card *card, Card *dest) { _actionCard1 = card; _actionCard2 = dest; - _item1.setAction(&_action6); + _actionItem.setAction(&_action6); } void Scene1337::playDelayCard(Card *card, Card *dest) { _actionCard1 = card; _actionCard2 = dest; - _item1.setAction(&_action9); + _actionItem.setAction(&_action9); } void Scene1337::playAntiDelayCard(Card *card, Card *dest) { _actionCard1 = card; _actionCard2 = dest; - _item1.setAction(&_action8); + _actionItem.setAction(&_action8); + + handleNextTurn(); } -Scene1337::Card *Scene1337::subC34EC(int arg1) { + +Scene1337::Card *Scene1337::getStationCard(int playerId) { for (int i = 0; i <= 7; i++) { - if ((_gameBoardSide[arg1]._outpostStation[i]._cardId > 0) && (_gameBoardSide[arg1]._outpostStation[i]._cardId < 10)) - return &_gameBoardSide[arg1]._outpostStation[i]; + if ((_gameBoardSide[playerId]._outpostStation[i]._cardId >= 1) && (_gameBoardSide[playerId]._outpostStation[i]._cardId <= 9)) + return &_gameBoardSide[playerId]._outpostStation[i]; } return nullptr; @@ -5091,16 +5039,17 @@ Scene1337::Card *Scene1337::subC34EC(int arg1) { void Scene1337::playCounterTrickCard(Card *card, int playerId) { _actionCard1 = card; - _actionCard2 = subC34EC(playerId); + _actionCard2 = getStationCard(playerId); _actionCard3 = &_gameBoardSide[playerId]._emptyStationPos; _actionIdx1 = playerId; - _item1.setAction(&_action10); + _actionItem.setAction(&_action10); + handleNextTurn(); } void Scene1337::discardCard(Card *card) { _actionCard1 = card; - _item1.setAction(&_action5); + _actionItem.setAction(&_action5); } void Scene1337::subC4CD2() { @@ -5121,7 +5070,7 @@ void Scene1337::subC51A0(Card *subObj1, Card *subObj2) { _actionCard1 = subObj1; _actionCard2 = subObj2; - _item1.setAction(&_action13); + _actionItem.setAction(&_action13); } void Scene1337::displayDialog(int dialogNumb) { @@ -5398,7 +5347,7 @@ void Scene1337::suggestInstructions() { } void Scene1337::displayInstructions() { - _item1.setAction(&_action1); + _actionItem.setAction(&_action1); } void Scene1337::shuffleCards() { @@ -5453,11 +5402,12 @@ void Scene1337::dealCards() { shuffleCards(); // Deal cards - _item1.setAction(&_action3); + _actionItem.setAction(&_action3); } -void Scene1337::subCD193() { + +void Scene1337::showOptionsDialog() { // Display menu with "Auto Play", "New Game", "Quit" and "Continue" - warning("STUBBED: subCD193()"); + OptionsDialog::show(); } void Scene1337::handleClick(int arg1, Common::Point pt) { @@ -5505,98 +5455,88 @@ void Scene1337::handleClick(int arg1, Common::Point pt) { default: break; } - } else { - if ( _gameBoardSide[2]._delayCard.isIn(pt) + } else if ( _gameBoardSide[2]._delayCard.isIn(pt) || _gameBoardSide[0]._delayCard.isIn(pt) || _gameBoardSide[1]._delayCard.isIn(pt) || _gameBoardSide[3]._delayCard.isIn(pt) ) { - found = true; + switch (curReg) { + case 5: + if (_gameBoardSide[2]._delayCard._cardId != 0) + displayDialog(_gameBoardSide[2]._delayCard._cardId); + else + actionDisplay(1330, 10, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 10: + if (_gameBoardSide[3]._delayCard._cardId != 0) + displayDialog(_gameBoardSide[3]._delayCard._cardId); + else + actionDisplay(1330, 16, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 15: + if (_gameBoardSide[0]._delayCard._cardId != 0) + displayDialog(_gameBoardSide[0]._delayCard._cardId); + else + actionDisplay(1330, 13, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 20: + if (_gameBoardSide[1]._delayCard._cardId != 0) + displayDialog(_gameBoardSide[1]._delayCard._cardId); + else + actionDisplay(1330, 18, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + default: + break; } - - if (found) { - switch (curReg) { - case 5: - if (_gameBoardSide[2]._delayCard._cardId != 0) - displayDialog(_gameBoardSide[2]._delayCard._cardId); - else - actionDisplay(1330, 10, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 10: - if (_gameBoardSide[3]._delayCard._cardId != 0) - displayDialog(_gameBoardSide[3]._delayCard._cardId); - else - actionDisplay(1330, 16, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 15: - if (_gameBoardSide[0]._delayCard._cardId != 0) - displayDialog(_gameBoardSide[3]._delayCard._cardId); - else - actionDisplay(1330, 13, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 20: - if (_gameBoardSide[1]._delayCard._cardId != 0) - displayDialog(_gameBoardSide[1]._delayCard._cardId); - else - actionDisplay(1330, 18, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - default: - break; - } - } else { - if (_discardPile.isIn(pt)) { - if (_discardPile._cardId != 0) - displayDialog(_discardPile._cardId); - else - actionDisplay(1330, 7, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if (_helpIcon._bounds.contains(pt)) { - actionDisplay(1330, 43, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if (_stockCard.isIn(pt)) { - actionDisplay(1330, 4, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if ( (_gameBoardSide[2]._emptyStationPos.isIn(pt)) - || (_gameBoardSide[3]._emptyStationPos.isIn(pt)) - || (_gameBoardSide[0]._emptyStationPos.isIn(pt)) - || (_gameBoardSide[1]._emptyStationPos.isIn(pt)) ) { - actionDisplay(1330, 32, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else { - if (_gameBoardSide[2]._handCard[0].isIn(pt)) - displayDialog(_gameBoardSide[2]._handCard[0]._cardId); - else if (_gameBoardSide[2]._handCard[1].isIn(pt)) - displayDialog(_gameBoardSide[2]._handCard[1]._cardId); - else if (_gameBoardSide[2]._handCard[2].isIn(pt)) - displayDialog(_gameBoardSide[2]._handCard[2]._cardId); - else if (_gameBoardSide[2]._handCard[3].isIn(pt)) - displayDialog(_gameBoardSide[2]._handCard[3]._cardId); - else if ((curReg >= 6) && (curReg <= 9)) - actionDisplay(1330, 29, 159, 10, 1, 200, 0, 7, 0, 154, 154); - else if ((curReg >= 11) && (curReg <= 14)) - actionDisplay(1330, 31, 159, 10, 1, 200, 0, 7, 0, 154, 154); - else if ((curReg >= 16) && (curReg <= 19)) - actionDisplay(1330, 30, 159, 10, 1, 200, 0, 7, 0, 154, 154); - else { - switch (curReg) { - case 0: - actionDisplay(1330, 2, 159, 134, 1, 200, 0, 7, 0, 105, 105); - break; - case 5: - actionDisplay(1330, 25, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 10: - actionDisplay(1330, 27, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 15: - actionDisplay(1330, 26, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 20: - actionDisplay(1330, 28, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 21: - actionDisplay(1330, 24, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - default: - break; - } - } - } + } else if (_discardPile.isIn(pt)) { + if (_discardPile._cardId != 0) + displayDialog(_discardPile._cardId); + else + actionDisplay(1330, 7, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } else if (_helpIcon._bounds.contains(pt)) + actionDisplay(1330, 43, 159, 10, 1, 200, 0, 7, 0, 154, 154); + else if (_stockCard.isIn(pt)) + actionDisplay(1330, 4, 159, 10, 1, 200, 0, 7, 0, 154, 154); + else if ( (_gameBoardSide[2]._emptyStationPos.isIn(pt)) + || (_gameBoardSide[3]._emptyStationPos.isIn(pt)) + || (_gameBoardSide[0]._emptyStationPos.isIn(pt)) + || (_gameBoardSide[1]._emptyStationPos.isIn(pt)) ) + actionDisplay(1330, 32, 159, 10, 1, 200, 0, 7, 0, 154, 154); + else if (_gameBoardSide[2]._handCard[0].isIn(pt)) + displayDialog(_gameBoardSide[2]._handCard[0]._cardId); + else if (_gameBoardSide[2]._handCard[1].isIn(pt)) + displayDialog(_gameBoardSide[2]._handCard[1]._cardId); + else if (_gameBoardSide[2]._handCard[2].isIn(pt)) + displayDialog(_gameBoardSide[2]._handCard[2]._cardId); + else if (_gameBoardSide[2]._handCard[3].isIn(pt)) + displayDialog(_gameBoardSide[2]._handCard[3]._cardId); + else if ((curReg >= 6) && (curReg <= 9)) + actionDisplay(1330, 29, 159, 10, 1, 200, 0, 7, 0, 154, 154); + else if ((curReg >= 11) && (curReg <= 14)) + actionDisplay(1330, 31, 159, 10, 1, 200, 0, 7, 0, 154, 154); + else if ((curReg >= 16) && (curReg <= 19)) + actionDisplay(1330, 30, 159, 10, 1, 200, 0, 7, 0, 154, 154); + else { + switch (curReg) { + case 0: + actionDisplay(1330, 2, 159, 134, 1, 200, 0, 7, 0, 105, 105); + break; + case 5: + actionDisplay(1330, 25, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 10: + actionDisplay(1330, 27, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 15: + actionDisplay(1330, 26, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 20: + actionDisplay(1330, 28, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 21: + actionDisplay(1330, 24, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + default: + break; } } } @@ -5617,9 +5557,9 @@ void Scene1337::handleClick(int arg1, Common::Point pt) { actionDisplay(1330, 34, 159, 10, 1, 200, 0, 7, 0, 154, 154); break; } - found = true; - break; - } else if (_gameBoardSide[0]._outpostStation[i].isIn(pt)) { + return; + } + if (_gameBoardSide[0]._outpostStation[i].isIn(pt)) { switch (_gameBoardSide[0]._outpostStation[i]._cardId) { case 0: actionDisplay(1330, 11, 159, 10, 1, 200, 0, 7, 0, 154, 154); @@ -5628,9 +5568,9 @@ void Scene1337::handleClick(int arg1, Common::Point pt) { actionDisplay(1330, 1, 159, 10, 1, 200, 0, 7, 0, 154, 154); break; } - found = true; - break; - } else if (_gameBoardSide[1]._outpostStation[i].isIn(pt)) { + return; + } + if (_gameBoardSide[1]._outpostStation[i].isIn(pt)) { switch (_gameBoardSide[1]._outpostStation[i]._cardId) { case 0: actionDisplay(1330, 146, 300, 99, 1, 136, 0, 7, 0, 117, 117); @@ -5639,9 +5579,9 @@ void Scene1337::handleClick(int arg1, Common::Point pt) { actionDisplay(1330, 144, 300, 99, 1, 136, 0, 7, 0, 117, 117); break; } - found = true; - break; - } else if (_gameBoardSide[3]._outpostStation[i].isIn(pt)) { + return; + } + if (_gameBoardSide[3]._outpostStation[i].isIn(pt)) { switch (_gameBoardSide[3]._outpostStation[i]._cardId) { case 0: actionDisplay(1330, 147, 20, 99, 1, 136, 0, 7, 0, 172, 172); @@ -5650,68 +5590,58 @@ void Scene1337::handleClick(int arg1, Common::Point pt) { actionDisplay(1330, 145, 20, 99, 1, 136, 0, 7, 0, 172, 172); break; } - found = true; - break; + return; } } if (_gameBoardSide[2]._delayCard.isIn(pt)) { // The original uses _gameBoardSide[0], which is obviously a bug. - if (_gameBoardSide[2]._delayCard._cardId != 0) { + if (_gameBoardSide[2]._delayCard._cardId != 0) actionDisplay(1330, 39, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else { + else actionDisplay(1330, 11, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } - found = true; - } + return; + } if (_gameBoardSide[3]._delayCard.isIn(pt)) { - if (_gameBoardSide[3]._delayCard._cardId != 0) { + if (_gameBoardSide[3]._delayCard._cardId != 0) actionDisplay(1330, 145, 20, 99, 1, 136, 0, 7, 0, 172, 172); - } else { + else actionDisplay(1330, 147, 20, 99, 1, 136, 0, 7, 0, 172, 172); - } - found = true; - } + return; + } if (_gameBoardSide[1]._delayCard.isIn(pt)) { - if (_gameBoardSide[1]._delayCard._cardId != 0) { + if (_gameBoardSide[1]._delayCard._cardId != 0) actionDisplay(1330, 144, 300, 99, 1, 136, 0, 7, 0, 117, 117); - } else { + else actionDisplay(1330, 146, 300, 99, 1, 136, 0, 7, 0, 117, 117); - } - found = true; - } + return; + } if (_gameBoardSide[0]._delayCard.isIn(pt)) { - if (_gameBoardSide[0]._delayCard._cardId != 0) { + if (_gameBoardSide[0]._delayCard._cardId != 0) actionDisplay(1330, 1, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else { + else actionDisplay(1330, 11, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } - found = true; - } + return; + } if (_gameBoardSide[3]._emptyStationPos.isIn(pt)) { actionDisplay(1330, 147, 20, 99, 1, 136, 0, 7, 0, 172, 172); - found = true; + return; } - if (_gameBoardSide[1]._emptyStationPos.isIn(pt)) { actionDisplay(1330, 146, 300, 99, 1, 136, 0, 7, 0, 117, 117); - found = true; + return; } - if (_gameBoardSide[0]._emptyStationPos.isIn(pt)) { actionDisplay(1330, 11, 159, 10, 1, 200, 0, 7, 0, 154, 154); - found = true; - } - - if (found) return; + } if (_helpIcon._bounds.contains(pt)) { - subCD193(); + showOptionsDialog(); return; } @@ -5765,8 +5695,6 @@ void Scene1337::handleClick(int arg1, Common::Point pt) { } void Scene1337::handlePlayer0() { - bool found = true; - if (_gameBoardSide[0]._delayCard._cardId != 0) { switch (_gameBoardSide[0]._delayCard._cardId) { case 10: @@ -5785,243 +5713,154 @@ void Scene1337::handlePlayer0() { //No break on purpose case 21: discardCard(&_gameBoardSide[0]._delayCard); - found = false; break; default: - int i; - found = false; - - for (i = 0; i <= 3; i++) { + for (int i = 0; i <= 3; i++) { if (checkAntiDelayCard(_gameBoardSide[0]._delayCard._cardId, _gameBoardSide[0]._handCard[i]._cardId)) { - found = true; - break; + playAntiDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[0]._delayCard); + return; } } - if (found) { - found = false; - playAntiDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[0]._delayCard); - } break; } } - if (found) - return; - - int tmpVal; - found = false; for (int i = 0; i <= 3; i++) { - tmpVal = subC26CB(0, i); + int tmpVal = getStationId(0, i); if (tmpVal != -1) { - bool flag = false; + bool stationAlreadyPresentFl = false; for (int j = 0; j <= 7; j++) { if (_gameBoardSide[0]._outpostStation[j]._cardId == _gameBoardSide[0]._handCard[tmpVal]._cardId) { - flag = true; + stationAlreadyPresentFl = true; break; } } - if (!flag) { + if (!stationAlreadyPresentFl) { for (int j = 0; j <= 7; j++) { - if ((_gameBoardSide[0]._outpostStation[j]._cardId == 1) && (!subC2687(_gameBoardSide[0]._delayCard._cardId))) { - int count = 0; + if ((_gameBoardSide[0]._outpostStation[j]._cardId == 1) && !isStopConstructionCard(_gameBoardSide[0]._delayCard._cardId)) { + int stationCount = 0; for (int k = 0; k <= 7; k++) { if ((_gameBoardSide[0]._outpostStation[k]._cardId > 1) && (_gameBoardSide[0]._outpostStation[k]._cardId <= 9)) { - ++count; + ++stationCount; } } - if (count == 7) + if (stationCount == 7) _winnerId = 0; - subC33C0(&_gameBoardSide[0]._handCard[tmpVal], &_gameBoardSide[0]._outpostStation[j]); - found = true; + playStationCard(&_gameBoardSide[0]._handCard[tmpVal], &_gameBoardSide[0]._outpostStation[j]); + return; } } } } - - if (found) - break; } - if (found) - return; - - found = false; - tmpVal = findNormalCardInHand(0); + int tmpVal = findPlatformCardInHand(0); if (tmpVal != -1) { for (int i = 0; i <= 7; i++) { - if ((_gameBoardSide[0]._outpostStation[i]._cardId == 0) && (!subC2687(_gameBoardSide[0]._delayCard._cardId))) { - playCard(&_gameBoardSide[0]._handCard[tmpVal], &_gameBoardSide[0]._outpostStation[i]); - found = true; - break; + if ((_gameBoardSide[0]._outpostStation[i]._cardId == 0) && !isStopConstructionCard(_gameBoardSide[0]._delayCard._cardId)) { + playPlatformCard(&_gameBoardSide[0]._handCard[tmpVal], &_gameBoardSide[0]._outpostStation[i]); + return; } } } - if (found) - return; - - tmpVal = subC274D(0); - if (tmpVal != -1) { + int card13Id = findCard13InHand(0); + if (card13Id != -1) { for (int i = 0; i <= 7; i++) { if (_gameBoardSide[2]._outpostStation[i]._cardId != 0) { - playCounterTrickCard(&_gameBoardSide[0]._handCard[tmpVal], 2); - found = true; - break; + playCounterTrickCard(&_gameBoardSide[0]._handCard[card13Id], 2); + return; } } } - if (found) - return; - - tmpVal = subC2781(0); - if (tmpVal != -1) { + int thieftId = checkThieftCard(0); + if (thieftId != -1) { if ( (_gameBoardSide[2]._handCard[0]._cardId != 0) || (_gameBoardSide[2]._handCard[1]._cardId != 0) || (_gameBoardSide[2]._handCard[2]._cardId != 0) || (_gameBoardSide[2]._handCard[3]._cardId != 0) ) { - playThieftCard(0, &_gameBoardSide[0]._handCard[tmpVal], 2); - found = true; + playThieftCard(0, &_gameBoardSide[0]._handCard[thieftId], 2); + return; } } - if (found) - return; - for (int i = 0; i <= 3; i++) { - if (subC27B5(_gameBoardSide[0]._handCard[i]._cardId) != -1) { - // The variable 'j' is not used in the inner code of the loop. It's suspect - for (int j = 0; j <= 7; j++) { - if ((_gameBoardSide[2]._delayCard._cardId == 0) && (subC32B1(2, _gameBoardSide[0]._handCard[i]._cardId))) { - playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[2]._delayCard); - found = true; - break; - } - } - - if (found) - break; + if ((isDelayCard(_gameBoardSide[0]._handCard[i]._cardId) != -1) + && (_gameBoardSide[2]._delayCard._cardId == 0) + && isAttackPossible(2, _gameBoardSide[0]._handCard[i]._cardId)) { + playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[2]._delayCard); + return; } } - if (found) - return; - for (int i = 0; i <= 3; i++) { - if (isSlowCard(_gameBoardSide[0]._handCard[i]._cardId) != -1) { - // The variable 'j' is not used in the inner code of the loop. It's suspect - for (int j = 0; j <= 7; j++) { - if ((_gameBoardSide[2]._delayCard._cardId == 0) && (subC32B1(2, _gameBoardSide[0]._handCard[i]._cardId))) { - playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[2]._delayCard); - found = true; - } - } - - if (found) - break; + if ((getStationCardId(_gameBoardSide[0]._handCard[i]._cardId) != -1) + && (_gameBoardSide[2]._delayCard._cardId == 0) + && isAttackPossible(2, _gameBoardSide[0]._handCard[i]._cardId)) { + playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[2]._delayCard); + return; } } - if (found) - return; + card13Id = findCard13InHand(0); + int victimPlayerId = getPlayerWithOutpost(0); - tmpVal = subC274D(0); - int tmpVal2 = subC331B(0); - - if ((tmpVal != -1) && (tmpVal2 != -1)) { - playCounterTrickCard(&_gameBoardSide[0]._handCard[tmpVal], tmpVal2); - found = true; - } - - if (found) + if ((card13Id != -1) && (victimPlayerId != -1)) { + playCounterTrickCard(&_gameBoardSide[0]._handCard[card13Id], victimPlayerId); return; + } - tmpVal = subC2781(0); - if (tmpVal != -1) { + thieftId = checkThieftCard(0); + if (thieftId != -1) { if ( (_gameBoardSide[1]._handCard[0]._cardId != 0) || (_gameBoardSide[1]._handCard[1]._cardId != 0) || (_gameBoardSide[1]._handCard[2]._cardId != 0) || (_gameBoardSide[1]._handCard[3]._cardId != 0) ) { - playThieftCard(0, &_gameBoardSide[0]._handCard[tmpVal], 1); - found = true; + playThieftCard(0, &_gameBoardSide[0]._handCard[thieftId], 1); + return; } } - if (found) - return; - for (int i = 0; i <= 3; i++) { - tmpVal = isSlowCard(_gameBoardSide[0]._handCard[i]._cardId); - if (tmpVal != -1) { - // The variable 'j' is not used in the inner code of the loop. It's suspect. - for (int j = 0; j <= 7; j++) { - if ((_gameBoardSide[1]._delayCard._cardId == 0) && (subC32B1(1, _gameBoardSide[0]._handCard[i]._cardId))) { - playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[1]._delayCard); - found = true; - } + if (getStationCardId(_gameBoardSide[0]._handCard[i]._cardId) != -1) { + if ((_gameBoardSide[1]._delayCard._cardId == 0) && isAttackPossible(1, _gameBoardSide[0]._handCard[i]._cardId)) { + playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[1]._delayCard); + return; } - if (!found) { - // The variable 'j' is not used in the inner code of the loop. It's suspect. - for (int j = 0; j <= 7; j++) { - if ((_gameBoardSide[3]._delayCard._cardId == 0) && (subC32B1(3, _gameBoardSide[0]._handCard[i]._cardId))) { - playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[3]._delayCard); - found = true; - } - } + if ((_gameBoardSide[3]._delayCard._cardId == 0) && isAttackPossible(3, _gameBoardSide[0]._handCard[i]._cardId)) { + playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[3]._delayCard); + return; } - - if (found) - break; } } - if (found) - return; - for (int i = 0; i <= 3; i++) { - tmpVal = subC27B5(_gameBoardSide[0]._handCard[i]._cardId); + tmpVal = isDelayCard(_gameBoardSide[0]._handCard[i]._cardId); if (tmpVal != -1) { - // The variable 'j' is not used in the inner code of the loop. It's suspect. - for (int j = 0; j <= 7; j++) { - if ((_gameBoardSide[1]._delayCard._cardId == 0) && (subC32B1(1, _gameBoardSide[0]._handCard[i]._cardId))) { - playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[1]._delayCard); - found = true; - } + if ((_gameBoardSide[1]._delayCard._cardId == 0) && isAttackPossible(1, _gameBoardSide[0]._handCard[i]._cardId)) { + playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[1]._delayCard); + return; } - if (!found) { - // The variable 'j' is not used in the inner code of the loop. It's suspect. - for (int j = 0; j <= 7; j++) { - if ((_gameBoardSide[3]._delayCard._cardId == 0) && (subC32B1(3, _gameBoardSide[0]._handCard[i]._cardId))) { - playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[3]._delayCard); - found = true; - } - } + if ((_gameBoardSide[3]._delayCard._cardId == 0) && isAttackPossible(3, _gameBoardSide[0]._handCard[i]._cardId)) { + playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[3]._delayCard); + return; } - - if (found) - break; } } - if (found) - return; - - subC2835(0); + handlePlayer01Discard(0); } void Scene1337::handlePlayer1() { - int tmpVal = 1; - bool found; - int count; - if (this->_gameBoardSide[1]._delayCard._cardId != 0) { switch (_gameBoardSide[1]._delayCard._cardId) { case 10: @@ -6039,36 +5878,25 @@ void Scene1337::handlePlayer1() { case 20: // No break on purpose case 21: - tmpVal = 0; discardCard(&_gameBoardSide[1]._delayCard); - break; + return; default: - found = false; - int i; - for (i = 0; i <= 3; i++) { + for (int i = 0; i <= 3; i++) { if (checkAntiDelayCard(_gameBoardSide[1]._delayCard._cardId, _gameBoardSide[1]._handCard[i]._cardId)) { - found = true; - break; + playAntiDelayCard(&_gameBoardSide[1]._handCard[i], &_gameBoardSide[1]._delayCard); + return; } } - - if (found) { - tmpVal = 0; - playAntiDelayCard(&_gameBoardSide[1]._handCard[i], &_gameBoardSide[1]._delayCard); - } + break; } } - if (tmpVal != 1) - return; - - found = false; for (int i = 0; i <= 3; i++) { - int tmpIndx = subC26CB(1, i); + int tmpIndx = getStationId(1, i); if (tmpIndx == -1) break; - tmpVal = 0; + int tmpVal = 0; for (int j = 0; j <= 7; j++) { if (_gameBoardSide[1]._outpostStation[j]._cardId == _gameBoardSide[1]._handCard[tmpIndx]._cardId) { tmpVal = 1; @@ -6080,54 +5908,43 @@ void Scene1337::handlePlayer1() { break; for (int j = 0; j <= 7; j++) { - if ((_gameBoardSide[1]._outpostStation[j]._cardId == 1) && !subC2687(_gameBoardSide[1]._delayCard._cardId)) { - count = 0; + if ((_gameBoardSide[1]._outpostStation[j]._cardId == 1) && !isStopConstructionCard(_gameBoardSide[1]._delayCard._cardId)) { + int stationCount = 0; for (int k = 0; k <= 7; k++) { if ((_gameBoardSide[1]._outpostStation[k]._cardId > 1) && (_gameBoardSide[1]._outpostStation[k]._cardId <= 9)) - ++count; + ++stationCount; } - if (count == 7) + if (stationCount == 7) _winnerId = 1; - subC33C0(&_gameBoardSide[1]._handCard[tmpIndx], &_gameBoardSide[1]._outpostStation[j]); - found = true; - break; + playStationCard(&_gameBoardSide[1]._handCard[tmpIndx], &_gameBoardSide[1]._outpostStation[j]); + return; } } } - if (found) - return; - - tmpVal = findNormalCardInHand(1); - if (tmpVal != -1) { + int normalCardId = findPlatformCardInHand(1); + if (normalCardId != -1) { for (int i = 0; i <= 7; i++) { - if ((_gameBoardSide[1]._outpostStation[i]._cardId == 0) && (!subC2687(_gameBoardSide[1]._delayCard._cardId))) { - playCard(&_gameBoardSide[1]._handCard[tmpVal], &_gameBoardSide[1]._outpostStation[i]); - found = true; - break; + if ((_gameBoardSide[1]._outpostStation[i]._cardId == 0) && !isStopConstructionCard(_gameBoardSide[1]._delayCard._cardId)) { + playPlatformCard(&_gameBoardSide[1]._handCard[normalCardId], &_gameBoardSide[1]._outpostStation[i]); + return; } } } - if (found) - return; - - tmpVal = subC274D(1); - int tmpVal2 = subC331B(1); + int card13Id = findCard13InHand(1); + int tmpVal2 = getPlayerWithOutpost(1); - if ((tmpVal != -1) && ( tmpVal2 != -1)) { - playCounterTrickCard(&_gameBoardSide[1]._handCard[tmpVal], tmpVal2); - found = true; - } - - if (found) + if ((card13Id != -1) && (tmpVal2 != -1)) { + playCounterTrickCard(&_gameBoardSide[1]._handCard[card13Id], tmpVal2); return; + } - tmpVal = subC2781(1); - if (tmpVal != -1) { - count = -1; + int thieftId = checkThieftCard(1); + if (thieftId != -1) { + int playerIdFound = -1; int rndVal = R2_GLOBALS._randomSource.getRandomNumber(3); for (int i = 0; i <= 3; i++) { if (rndVal != 1) { @@ -6135,103 +5952,75 @@ void Scene1337::handlePlayer1() { || (_gameBoardSide[rndVal]._handCard[1]._cardId != 0) || (_gameBoardSide[rndVal]._handCard[2]._cardId != 0) || (_gameBoardSide[rndVal]._handCard[3]._cardId == 0)) { - count = rndVal; + playerIdFound = rndVal; break; } - // CHECKME: inside the check on rndVal? - rndVal--; - if (rndVal < 0) - rndVal = 3; } + // The original was only updating in the rndVal block, + // which was a bug as the checks were stopping at this point + rndVal--; + if (rndVal < 0) + rndVal = 3; } - if (count != -1) { - playThieftCard(1, &_gameBoardSide[1]._handCard[tmpVal], count); - found = true; + if (playerIdFound != -1) { + playThieftCard(1, &_gameBoardSide[1]._handCard[thieftId], playerIdFound); + return; } } - if (found) - return; - - count = -1; + int count = -1; int i; for (i = 0; i <= 3; i++) { - tmpVal = subC27B5(_gameBoardSide[1]._handCard[i]._cardId); + int tmpVal = isDelayCard(_gameBoardSide[1]._handCard[i]._cardId); if (tmpVal != -1) { int rndVal = R2_GLOBALS._randomSource.getRandomNumber(3); for (int j = 0; j <= 3; j++) { //CHECKME: tmpVal or rndVal? if (tmpVal != 1) { - for (int k = 0; k <= 7; k++) { - // CHECKME: 'k' is not used in that loop. - // It looks suspicious. - if ((_gameBoardSide[tmpVal]._delayCard._cardId == 0) && (subC32B1(tmpVal, _gameBoardSide[1]._handCard[i]._cardId))) { - count = tmpVal; - break; - } - } + if ((_gameBoardSide[tmpVal]._delayCard._cardId == 0) && isAttackPossible(tmpVal, _gameBoardSide[1]._handCard[i]._cardId)) + count = tmpVal; } if (count != -1) { - found = true; - break; + playDelayCard(&_gameBoardSide[1]._handCard[i], &_gameBoardSide[count]._delayCard); + return; } else { rndVal--; if (rndVal < 0) rndVal = 3; } } - - if (found) - break; } } - if (found) - playDelayCard(&_gameBoardSide[1]._handCard[i], &_gameBoardSide[count]._delayCard); - else { - int j; - for (j = 0; j <= 3; j++) { - if (isSlowCard(_gameBoardSide[1]._handCard[j]._cardId) != -1) { - count = -1; - int rndVal = R2_GLOBALS._randomSource.getRandomNumber(3); - for (int l = 0; l <= 3; l++) { - if (rndVal != 1) { - for (int m = 0; m <= 7; m++) { - // 'm' is not used in that loop. It looks suspicious. - if ((_gameBoardSide[rndVal]._delayCard._cardId == 0) && (_gameBoardSide[1]._handCard[j]._cardId == 1)) { - count = rndVal; - break; - } - } - } - if (count != -1) { - found = true; - break; - } else { - rndVal--; - if (rndVal < 0) - rndVal = 3; - } + int j; + for (j = 0; j <= 3; j++) { + if (getStationCardId(_gameBoardSide[1]._handCard[j]._cardId) != -1) { + count = -1; + int rndVal = R2_GLOBALS._randomSource.getRandomNumber(3); + for (int l = 0; l <= 3; l++) { + if (rndVal != 1) { + if ((_gameBoardSide[rndVal]._delayCard._cardId == 0) && (_gameBoardSide[1]._handCard[j]._cardId == 1)) + count = rndVal; + } + if (count != -1) { + playDelayCard(&_gameBoardSide[1]._handCard[j], &_gameBoardSide[count]._delayCard); + return; + } else { + rndVal--; + if (rndVal < 0) + rndVal = 3; } - if (found) - break; } } - - if (found) - playDelayCard(&_gameBoardSide[1]._handCard[j], &_gameBoardSide[count]._delayCard); - else - subC2835(1); } + handlePlayer01Discard(1); } void Scene1337::handlePlayer3() { - bool found = true; - if (_gameBoardSide[3]._delayCard._cardId != 0) { switch (_gameBoardSide[3]._delayCard._cardId) { case 10: @@ -6250,86 +6039,59 @@ void Scene1337::handlePlayer3() { // No break on purpose case 21: discardCard(&_gameBoardSide[3]._delayCard); - found = false; - break; + return; default: - found = false; - int i; - for (i = 0; i <= 3; i++) { + for (int i = 0; i <= 3; i++) { if (checkAntiDelayCard(_gameBoardSide[3]._delayCard._cardId, _gameBoardSide[3]._handCard[i]._cardId)) { - found = true; - break; + playAntiDelayCard(&_gameBoardSide[3]._handCard[i], &_gameBoardSide[3]._delayCard); + return; } } - - if (found) { - found = false; - playAntiDelayCard(&_gameBoardSide[3]._handCard[i], &_gameBoardSide[3]._delayCard); - } break; } } - if (!found) - return; - int randIndx = R2_GLOBALS._randomSource.getRandomNumber(3); if (_gameBoardSide[3]._handCard[randIndx]._cardId == 1) { - found = false; - for (int i = 0; i <= 7; i++) { - if ((_gameBoardSide[3]._outpostStation[i]._cardId == 0) && (!subC2687(_gameBoardSide[3]._delayCard._cardId))) { - playCard(&_gameBoardSide[3]._handCard[randIndx], &_gameBoardSide[3]._outpostStation[i]); - found = true; - break; + if ((_gameBoardSide[3]._outpostStation[i]._cardId == 0) && !isStopConstructionCard(_gameBoardSide[3]._delayCard._cardId)) { + playPlatformCard(&_gameBoardSide[3]._handCard[randIndx], &_gameBoardSide[3]._outpostStation[i]); + return; } } - - if (found) { - return; - } } else if (_gameBoardSide[3]._handCard[randIndx]._cardId <= 9) { - found = false; - for (int i = 0; i <= 7; i++) { if (_gameBoardSide[3]._outpostStation[i]._cardId == _gameBoardSide[3]._handCard[randIndx]._cardId) { - found = true; - break; + discardCard(&_gameBoardSide[3]._handCard[randIndx]); + return; } } - if (!found) { - for (int i = 0; i <= 7; i++) { - if ((_gameBoardSide[3]._outpostStation[i]._cardId == 1) && (!subC2687(_gameBoardSide[3]._delayCard._cardId))) { - int tmpVal = 0; - - for (int j = 0; j <= 7; j++) { - if ((_gameBoardSide[3]._outpostStation[j]._cardId > 1) && (_gameBoardSide[3]._outpostStation[j]._cardId <= 9)) - ++tmpVal; - } + for (int i = 0; i <= 7; i++) { + if ((_gameBoardSide[3]._outpostStation[i]._cardId == 1) && !isStopConstructionCard(_gameBoardSide[3]._delayCard._cardId)) { + int stationCount = 0; + for (int j = 0; j <= 7; j++) { + if ((_gameBoardSide[3]._outpostStation[j]._cardId > 1) && (_gameBoardSide[3]._outpostStation[j]._cardId <= 9)) + ++stationCount; + } - if (tmpVal == 7) - _winnerId = 3; + if (stationCount == 7) + _winnerId = 3; - subC33C0(&_gameBoardSide[3]._handCard[randIndx], &_gameBoardSide[3]._outpostStation[i]); - found = true; - break; - } - } - if (found) + playStationCard(&_gameBoardSide[3]._handCard[randIndx], &_gameBoardSide[3]._outpostStation[i]); return; + } } } else if (_gameBoardSide[3]._handCard[randIndx]._cardId == 13) { - int tmpVal = subC331B(3); + int victimId = getPlayerWithOutpost(3); - if (tmpVal != -1) { - playCounterTrickCard(&_gameBoardSide[3]._handCard[randIndx], tmpVal); + if (victimId != -1) { + playCounterTrickCard(&_gameBoardSide[3]._handCard[randIndx], victimId); return; } } else if (_gameBoardSide[3]._handCard[randIndx]._cardId == 25) { - int tmpVal = -1; - found = false; + int victimId = -1; int tmpRandIndx = R2_GLOBALS._randomSource.getRandomNumber(3); for (int i = 0; i <= 3; i++) { @@ -6338,7 +6100,7 @@ void Scene1337::handlePlayer3() { || (_gameBoardSide[tmpRandIndx]._handCard[1]._cardId != 0) || (_gameBoardSide[tmpRandIndx]._handCard[2]._cardId != 0) || (_gameBoardSide[tmpRandIndx]._handCard[3]._cardId != 0) )) { - tmpVal = tmpRandIndx; + victimId = tmpRandIndx; break; } @@ -6347,8 +6109,8 @@ void Scene1337::handlePlayer3() { tmpRandIndx = 0; } - if (tmpVal != -1) { - playThieftCard(3, &_gameBoardSide[3]._handCard[randIndx], tmpVal); + if (victimId != -1) { + playThieftCard(3, &_gameBoardSide[3]._handCard[randIndx], victimId); return; } } else { @@ -6376,30 +6138,27 @@ void Scene1337::handlePlayer3() { case 21: // No break on purpose case 24: { - int tmpVal = -1; + int victimId = -1; int tmpRandIndx = R2_GLOBALS._randomSource.getRandomNumber(3); for (int i = 0; i <= 3; i++) { if (tmpRandIndx != 3) { - // The variable 'j' is not used in the inner code of the loop, which is suspicious. - // 'i' is used indirectly to increment tmpRandIndx. - for (int j = 0; j <= 7; j++) { - if ((_gameBoardSide[tmpRandIndx]._delayCard._cardId == 0) && subC32B1(tmpRandIndx, _gameBoardSide[3]._handCard[randIndx]._cardId)) - tmpVal = tmpRandIndx; - } + if ((_gameBoardSide[tmpRandIndx]._delayCard._cardId == 0) + && isAttackPossible(tmpRandIndx, _gameBoardSide[3]._handCard[randIndx]._cardId)) + victimId = tmpRandIndx; } ++tmpRandIndx; if (tmpRandIndx > 3) tmpRandIndx = 0; - if (tmpVal != -1) + if (victimId != -1) break; } - if (tmpVal != -1) { + if (victimId != -1) { // Useless second identical check skipped - playDelayCard(&_gameBoardSide[tmpVal]._handCard[randIndx], &_gameBoardSide[tmpVal]._delayCard); + playDelayCard(&_gameBoardSide[3]._handCard[randIndx], &_gameBoardSide[victimId]._delayCard); return; } } @@ -6411,14 +6170,14 @@ void Scene1337::handlePlayer3() { discardCard(&_gameBoardSide[3]._handCard[randIndx]); } -void Scene1337::handlePlayer2() { - if (isSlowCard(this->_gameBoardSide[2]._delayCard._cardId) == -1) - _delayedFunction = &Scene1337::subD02CA; +void Scene1337::handleAutoplayPlayer2() { + if (getStationCardId(this->_gameBoardSide[2]._delayCard._cardId) == -1) + _delayedFunction = &Scene1337::handlePlayer2; else discardCard(&_gameBoardSide[2]._delayCard); } -void Scene1337::subD02CA() { +void Scene1337::handlePlayer2() { _selectedCard._stationPos = g_globals->_events._mousePos; if (R2_GLOBALS._v57810 == 200) { @@ -6429,12 +6188,12 @@ void Scene1337::subD02CA() { Card *handcard = &_gameBoardSide[2]._handCard[i]; _selectedCard._cardId = handcard->_cardId; _selectedCard._stationPos = handcard->_stationPos; - // _selectedCard._actorName = handcard->_actorName; - _selectedCard._fieldE = handcard->_fieldE; - _selectedCard._field10 = handcard->_field10; - warning("_selectedCard._field12 = handcard->_field12;"); - warning("_selectedCard._field14 = handcard->_field14;"); - warning("_selectedCard._field16 = handcard->_field16;"); + //warning("_selectedCard._actorName = handcard->_actorName;"); + //warning("_selectedCard._fieldE = handcard->_fieldE;"); + //warning("_selectedCard._field10 = handcard->_field10;"); + //warning("_selectedCard._field12 = handcard->_field12;"); + //warning("_selectedCard._field14 = handcard->_field14;"); + //warning("_selectedCard._field16 = handcard->_field16;"); _selectedCard._sceneRegionId = handcard->_sceneRegionId; _selectedCard._position = handcard->_position; _selectedCard._yDiff = handcard->_yDiff; @@ -6444,11 +6203,11 @@ void Scene1337::subD02CA() { _selectedCard._talkLineNum = handcard->_talkLineNum; _selectedCard._useLineNum = handcard->_useLineNum; _selectedCard._action = handcard->_action; - warning("_selectedCard._field0 = handcard->_field0;"); + //warning("_selectedCard._field0 = handcard->_field0;"); _selectedCard._card._updateStartFrame = handcard->_card._updateStartFrame; _selectedCard._card._walkStartFrame = handcard->_card._walkStartFrame; // _field2E is named _field3C in R2R - _selectedCard._card._field2E = handcard->_card._field2E; + _selectedCard._card._oldPosition = handcard->_card._oldPosition; _selectedCard._card._percent = handcard->_card._percent; _selectedCard._card._priority = handcard->_card._priority; _selectedCard._card._angle = handcard->_card._angle; @@ -6464,7 +6223,7 @@ void Scene1337::subD02CA() { _selectedCard._card._frame = handcard->_card._frame; _selectedCard._card._endFrame = handcard->_card._endFrame; // _field68 is named _field76 in R2R - _selectedCard._card._field68 = handcard->_card._field68; + _selectedCard._card._loopCount = handcard->_card._loopCount; _selectedCard._card._frameChange = handcard->_card._frameChange; _selectedCard._card._numFrames = handcard->_card._numFrames; _selectedCard._card._regionIndex = handcard->_card._regionIndex; @@ -6475,12 +6234,11 @@ void Scene1337::subD02CA() { _selectedCard._card._endAction = handcard->_card._endAction; _selectedCard._card._regionBitList = handcard->_card._regionBitList; // _selectedCard._object1._actorName = handcard->_object1._actorName; - _selectedCard._card._fieldE = handcard->_card._fieldE; - _selectedCard._card._field10 = handcard->_card._field10; - warning("_selectedCard._card._field12 = handcard->_card._field12;"); - warning("_selectedCard._card._field14 = handcard->_card._field14;"); - warning("_selectedCard._card._field16 = handcard->_card._field16;"); - // _selectedCard._card = _gameBoardSide[2]._handCard[i]._card; + //warning("_selectedCard._card._fieldE = handcard->_card._fieldE;"); + //warning("_selectedCard._card._field10 = handcard->_card._field10;"); + //warning("_selectedCard._card._field12 = handcard->_card._field12;"); + //warning("_selectedCard._card._field14 = handcard->_card._field14;"); + //warning("_selectedCard._card._field16 = handcard->_card._field16;"); _gameBoardSide[2]._handCard[i]._cardId = 0; _gameBoardSide[2]._handCard[i]._card.remove(); @@ -6490,7 +6248,7 @@ void Scene1337::subD02CA() { if (i == 4) { handleClick(1, _selectedCard._stationPos); - handlePlayer2(); + handleAutoplayPlayer2(); return; } else { setCursorData(1332, _selectedCard._card._strip, _selectedCard._card._frame); @@ -6499,25 +6257,24 @@ void Scene1337::subD02CA() { } else if (R2_GLOBALS._v57810 == 300) { // Eye handleClick(3, _selectedCard._stationPos); - handlePlayer2(); + handleAutoplayPlayer2(); return; } else { // The original code is calling a function full of dead code. // Only this message remains after a cleanup. MessageDialog::show(WRONG_ANSWER_MSG, OK_BTN_STRING); // - handlePlayer2(); + handleAutoplayPlayer2(); return; } Event event; - bool found = false; - bool found_di; + bool found; for (;;) { if ( ((g_globals->_events.getEvent(event, EVENT_BUTTON_DOWN)) && (event.btnState == BTNSHIFT_RIGHT)) || (g_globals->_events.getEvent(event, EVENT_KEYPRESS)) ){ _selectedCard._stationPos = g_globals->_events._mousePos; - found_di = false; + found = false; for (int i = 0; i <= 3; i ++) { if (_gameBoardSide[2]._handCard[i].isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { @@ -6530,320 +6287,308 @@ void Scene1337::subD02CA() { _gameBoardSide[2]._handCard[i]._card.fixPriority(170); setAnimationInfo(&_gameBoardSide[2]._handCard[i]); setCursorData(5, 1, 4); - found = true; _currentPlayerNumb--; _showPlayerTurn = false; handleNextTurn(); + return; } else { actionDisplay(1330, 127, 159, 10, 1, 200, 0, 7, 0, 154, 154); - found_di = true; + found = true; } break; } } - if ((!found) && (!found_di)) { + if (!found) { if (_discardPile.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { discardCard(&_selectedCard); - } else if (!found) { - bool foundVar4; + return; + } else if (_selectedCard._cardId == 1) { + bool isInCardFl = false; int i; - if (_selectedCard._cardId == 1) { - foundVar4 = false; - for (i = 0; i <= 7; i++) { - if (_gameBoardSide[2]._outpostStation[i].isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { - foundVar4 = true; - break; - } + for (i = 0; i <= 7; i++) { + if (_gameBoardSide[2]._outpostStation[i].isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + isInCardFl = true; + break; } + } - if ((foundVar4) && (_gameBoardSide[2]._outpostStation[i]._cardId == 0)) { - if (subC27B5(_gameBoardSide[2]._delayCard._cardId) != -1) { - actionDisplay(1330, 55, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else { - playCard(&_selectedCard, &_gameBoardSide[2]._outpostStation[i]); - return; - } + if ((isInCardFl) && (_gameBoardSide[2]._outpostStation[i]._cardId == 0)) { + if (isDelayCard(_gameBoardSide[2]._delayCard._cardId) != -1) { + actionDisplay(1330, 55, 159, 10, 1, 200, 0, 7, 0, 154, 154); } else { - actionDisplay(1330, 56, 159, 10, 1, 200, 0, 7, 0, 154, 154); + playPlatformCard(&_selectedCard, &_gameBoardSide[2]._outpostStation[i]); + return; + } + } else { + actionDisplay(1330, 56, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } + } else if (_selectedCard._cardId <= 9) { + bool isInCardFl = false; + int i; + for (i = 0; i <= 7; i++) { + if (_gameBoardSide[2]._outpostStation[i].isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + isInCardFl = true; + break; } - } else if (_selectedCard._cardId <= 9) { - foundVar4 = false; - for (i = 0; i <= 7; i++) { - if (_gameBoardSide[2]._outpostStation[i].isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { - foundVar4 = true; + } + if ((isInCardFl) && (_gameBoardSide[2]._outpostStation[i]._cardId == 1)) { + isInCardFl = false; + for (int j = 0; j <= 7; j++) { + if (_selectedCard._cardId == _gameBoardSide[2]._outpostStation[j]._cardId) { + isInCardFl = true; break; } } - if ((foundVar4) && (_gameBoardSide[2]._outpostStation[i]._cardId == 1)) { - foundVar4 = false; - int j; - for (j = 0; j <= 7; j++) { - if (_selectedCard._cardId == _gameBoardSide[2]._outpostStation[j]._cardId) { - foundVar4 = true; - break; - } + if (isInCardFl) { + // This station is already in place + actionDisplay(1330, 34, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } else if (isDelayCard(_gameBoardSide[2]._delayCard._cardId) != -1) { + // You must eliminate your delay before you can play a station + actionDisplay(1330, 35, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } else { + int stationCount = 0; + for (int k = 0; k <= 7; k++) { + if ((_gameBoardSide[2]._outpostStation[k]._cardId > 1) && (_gameBoardSide[2]._outpostStation[k]._cardId <= 9)) + ++stationCount; } - if (foundVar4) { - // This station is already in place - actionDisplay(1330, 34, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if (subC27B5(_gameBoardSide[2]._delayCard._cardId) != -1) { - // You must eliminate your delay before you can play a station - actionDisplay(1330, 35, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else { - int tmpVal = 0; - for (int j = 0; j <= 7; j++) { - if ((_gameBoardSide[2]._outpostStation[j]._cardId > 1) && (_gameBoardSide[2]._outpostStation[j]._cardId <= 9)) - ++tmpVal; - } - - if (tmpVal == 7) - _winnerId = 2; + if (stationCount == 7) + _winnerId = 2; - subC33C0(&_selectedCard, &_gameBoardSide[2]._outpostStation[i]); - return; + playStationCard(&_selectedCard, &_gameBoardSide[2]._outpostStation[i]); + return; + } + } else { + actionDisplay(1330, 37, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } + } else if ((_selectedCard._cardId == 26) || (_selectedCard._cardId == 30) ||(_selectedCard._cardId == 32) || (_selectedCard._cardId == 28)) { + // Check anti-delay card + if (_gameBoardSide[2]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + actionDisplay(1330, 42, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } else if (checkAntiDelayCard(_gameBoardSide[2]._delayCard._cardId, _selectedCard._cardId)) { + playAntiDelayCard(&_selectedCard, &_gameBoardSide[2]._delayCard); + return; + } else { + if (_gameBoardSide[2]._delayCard._cardId != 0) { + switch (_gameBoardSide[2]._delayCard._cardId) { + case 11: + actionDisplay(1330, 68, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 14: + actionDisplay(1330, 80, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 16: + actionDisplay(1330, 84, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 24: + actionDisplay(1330, 96, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + default: + break; } } else { - actionDisplay(1330, 37, 159, 10, 1, 200, 0, 7, 0, 154, 154); + actionDisplay(1330, 41, 159, 10, 1, 200, 0, 7, 0, 154, 154); } - } else { - if ((_selectedCard._cardId == 26) || (_selectedCard._cardId == 30) ||(_selectedCard._cardId == 32) || (_selectedCard._cardId == 28)) { - if (_gameBoardSide[2]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { - actionDisplay(1330, 42, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if (!checkAntiDelayCard(_gameBoardSide[2]._delayCard._cardId, _selectedCard._cardId)) { - if (_gameBoardSide[2]._delayCard._cardId != 0) { - switch (_gameBoardSide[2]._delayCard._cardId) { - case 11: - actionDisplay(1330, 68, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 14: - actionDisplay(1330, 80, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 16: - actionDisplay(1330, 84, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 24: - actionDisplay(1330, 96, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - default: - break; - } - } else { - actionDisplay(1330, 41, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } + } else if ((getStationCardId(_selectedCard._cardId) == -1) && (isDelayCard(_selectedCard._cardId) == -1)) { + if (_selectedCard._cardId == 13) { + if (_gameBoardSide[0]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + for (int k = 0; k <= 7; k++) { + if (_gameBoardSide[0]._outpostStation[k]._cardId != 0) { + playCounterTrickCard(&_selectedCard, 0); + return; + } + } + actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } else if (_gameBoardSide[3]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + for (int k = 0; k <= 7; k++) { + if (_gameBoardSide[3]._outpostStation[k]._cardId != 0) { + playCounterTrickCard(&_selectedCard, 3); + return; + } + } + actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } else if (_gameBoardSide[1]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + for (int k = 0; k <= 7; k++) { + if (_gameBoardSide[1]._outpostStation[k]._cardId == 0) { + playCounterTrickCard(&_selectedCard, 1); + return; } - } else { - playAntiDelayCard(&_selectedCard, &_gameBoardSide[2]._delayCard); - return; } + actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154); } else { - if ((isSlowCard(_selectedCard._cardId) == -1) && (subC27B5(_selectedCard._cardId) == -1)) { - if (_selectedCard._cardId == 13) { - if (_gameBoardSide[0]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { - for (int k = 0; k <= 7; k++) { - if (_gameBoardSide[0]._outpostStation[k]._cardId != 0) { - found = true; - playCounterTrickCard(&_selectedCard, 0); - } - } - - if (!found) - actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if (_gameBoardSide[3]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { - for (int k = 0; k <= 7; k++) { - if (_gameBoardSide[3]._outpostStation[k]._cardId != 0) { - found = true; - playCounterTrickCard(&_selectedCard, 3); - } - } - if (!found) - actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if (_gameBoardSide[1]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { - for (int k = 0; k <= 7; k++) { - if (_gameBoardSide[1]._outpostStation[k]._cardId == 0) { - found = true; - playCounterTrickCard(&_selectedCard, 1); - } - } - if (!found) - actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else { - actionDisplay(1330, 128, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } - } else if (_selectedCard._cardId == 25) { + actionDisplay(1330, 128, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } + } else if (_selectedCard._cardId == 25) { + if (_gameBoardSide[0]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + if ( (_gameBoardSide[0]._handCard[0]._cardId != 0) + || (_gameBoardSide[0]._handCard[1]._cardId != 0) + || (_gameBoardSide[0]._handCard[2]._cardId != 0) + || (_gameBoardSide[0]._handCard[3]._cardId != 0) ) { int k; - if (_gameBoardSide[0]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { - if ( (_gameBoardSide[0]._handCard[0]._cardId != 0) - || (_gameBoardSide[0]._handCard[1]._cardId != 0) - || (_gameBoardSide[0]._handCard[2]._cardId != 0) - || (_gameBoardSide[0]._handCard[3]._cardId != 0) ) { - for (k = 0; k <= 3; k++){ - if (_gameBoardSide[2]._handCard[k]._cardId == 0) - break; - } - playThieftCard(2, &_gameBoardSide[2]._handCard[k], 0); - return; - } else { - actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } - } else if (_gameBoardSide[1]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { - if ( (_gameBoardSide[1]._handCard[0]._cardId != 0) - || (_gameBoardSide[1]._handCard[1]._cardId != 0) - || (_gameBoardSide[1]._handCard[2]._cardId != 0) - || (_gameBoardSide[1]._handCard[3]._cardId != 0) ) { - for (k = 0; k <= 3; k++){ - if (_gameBoardSide[2]._handCard[k]._cardId == 0) - break; - } - playThieftCard(2, &_gameBoardSide[2]._handCard[k], 1); - return; - } else { - actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } - } - - if (_gameBoardSide[3]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { - if ( (_gameBoardSide[3]._handCard[0]._cardId != 0) - || (_gameBoardSide[3]._handCard[1]._cardId != 0) - || (_gameBoardSide[3]._handCard[2]._cardId != 0) - || (_gameBoardSide[3]._handCard[3]._cardId != 0) ) { - for (k = 0; k <= 3; k++){ - if (_gameBoardSide[2]._handCard[k]._cardId == 0) - break; - } - playThieftCard(2, &_gameBoardSide[2]._handCard[k], 3); - return; - } else { - actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } - } else { - actionDisplay(1330, 129, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } - } else if (_selectedCard._cardId == 29) { - actionDisplay(1330, 136, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if (_selectedCard._cardId == 27) { - actionDisplay(1330, 137, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } - } else { - if (_gameBoardSide[0]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { - if (_gameBoardSide[0]._delayCard._cardId != 0) { - actionDisplay(1330, 15, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if (!subC32B1(0, _selectedCard._cardId)) { - switch (_selectedCard._cardId) { - case 10: - actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 12: - actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 15: - actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 17: - actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 18: - actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 19: - actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 20: - actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154); + for (k = 0; k <= 3; k++){ + if (_gameBoardSide[2]._handCard[k]._cardId == 0) break; - case 21: - actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - default: - break; - } - } else { - playDelayCard(&_selectedCard, &_gameBoardSide[0]._delayCard); - found = true; } - } else if (_gameBoardSide[3]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { - if (_gameBoardSide[3]._delayCard._cardId != 0) { - actionDisplay(1330, 17, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if (!subC32B1(3, _selectedCard._cardId)) { - switch (_selectedCard._cardId) { - case 10: - actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 12: - actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 15: - actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 17: - actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 18: - actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 19: - actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 20: - actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 21: - actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - default: + playThieftCard(2, &_gameBoardSide[2]._handCard[k], 0); + return; + } else { + actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } + } else if (_gameBoardSide[1]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + if ( (_gameBoardSide[1]._handCard[0]._cardId != 0) + || (_gameBoardSide[1]._handCard[1]._cardId != 0) + || (_gameBoardSide[1]._handCard[2]._cardId != 0) + || (_gameBoardSide[1]._handCard[3]._cardId != 0) ) { + int k; + for (k = 0; k <= 3; k++){ + if (_gameBoardSide[2]._handCard[k]._cardId == 0) break; - } - } else { - playDelayCard(&_selectedCard, &_gameBoardSide[3]._delayCard); - found = true; } - } else if (_gameBoardSide[1]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { - if (_gameBoardSide[1]._delayCard._cardId != 0) { - actionDisplay(1330, 19, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if (!subC32B1(1, _selectedCard._cardId)) { - switch (_selectedCard._cardId) { - case 10: - actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 12: - actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 15: - actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 17: - actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 18: - actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 19: - actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 20: - actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 21: - actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - default: + playThieftCard(2, &_gameBoardSide[2]._handCard[k], 1); + return; + } else { + actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } + } + + if (_gameBoardSide[3]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + if ( (_gameBoardSide[3]._handCard[0]._cardId != 0) + || (_gameBoardSide[3]._handCard[1]._cardId != 0) + || (_gameBoardSide[3]._handCard[2]._cardId != 0) + || (_gameBoardSide[3]._handCard[3]._cardId != 0) ) { + int k; + for (k = 0; k <= 3; k++){ + if (_gameBoardSide[2]._handCard[k]._cardId == 0) break; - } - } else { - playDelayCard(&_selectedCard, &_gameBoardSide[1]._delayCard); - found = true; } - } else { - actionDisplay(1330, 38, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } + playThieftCard(2, &_gameBoardSide[2]._handCard[k], 3); + return; + } else { + actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154); } + } else { + actionDisplay(1330, 129, 159, 10, 1, 200, 0, 7, 0, 154, 154); } + } else if (_selectedCard._cardId == 29) { + // Interceptor cards are used to prevent collision + actionDisplay(1330, 136, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } else if (_selectedCard._cardId == 27) { + actionDisplay(1330, 137, 159, 10, 1, 200, 0, 7, 0, 154, 154); } + } else if (_gameBoardSide[0]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + if (_gameBoardSide[0]._delayCard._cardId != 0) { + actionDisplay(1330, 15, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } else if (!isAttackPossible(0, _selectedCard._cardId)) { + switch (_selectedCard._cardId) { + case 10: + actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 12: + actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 15: + actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 17: + actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 18: + actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 19: + actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 20: + actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 21: + actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + default: + break; + } + } else { + playDelayCard(&_selectedCard, &_gameBoardSide[0]._delayCard); + return; + } + } else if (_gameBoardSide[3]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + if (_gameBoardSide[3]._delayCard._cardId != 0) { + actionDisplay(1330, 17, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } else if (!isAttackPossible(3, _selectedCard._cardId)) { + switch (_selectedCard._cardId) { + case 10: + actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 12: + actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 15: + actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 17: + actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 18: + actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 19: + actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 20: + actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 21: + actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + default: + break; + } + } else { + playDelayCard(&_selectedCard, &_gameBoardSide[3]._delayCard); + return; + } + } else if (_gameBoardSide[1]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + if (_gameBoardSide[1]._delayCard._cardId != 0) { + actionDisplay(1330, 19, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } else if (!isAttackPossible(1, _selectedCard._cardId)) { + switch (_selectedCard._cardId) { + case 10: + actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 12: + actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 15: + actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 17: + actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 18: + actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 19: + actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 20: + actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 21: + actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + default: + break; + } + } else { + playDelayCard(&_selectedCard, &_gameBoardSide[1]._delayCard); + return; + } + } else { + actionDisplay(1330, 38, 159, 10, 1, 200, 0, 7, 0, 154, 154); } } - - if (found) - return; } else { g_globals->_scenePalette.signalListeners(); R2_GLOBALS._sceneObjects->draw(); @@ -6940,6 +6685,94 @@ void Scene1337::subD1975(int arg1, int arg2) { warning("STUBBED lvl2 Scene1337::subD1975()"); } +void Scene1337::OptionsDialog::show() { + OptionsDialog *dlg = new OptionsDialog(); + dlg->draw(); + + // Show the dialog + GfxButton *btn = dlg->execute(NULL); + + // Figure out the new selected character + if (btn == &dlg->_quitGame) + R2_GLOBALS._sceneManager.changeScene(125); + else if (btn == &dlg->_restartGame) + R2_GLOBALS._sceneManager.changeScene(1330); + + // Remove the dialog + dlg->remove(); + delete dlg; +} + +Scene1337::OptionsDialog::OptionsDialog() { + // Set the elements text + Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene; + _autoplay.setText(scene->_autoplay ? AUTO_PLAY_ON : AUTO_PLAY_OFF); + _restartGame.setText(START_NEW_CARD_GAME); + _quitGame.setText(QUIT_CARD_GAME); + _continueGame.setText(CONTINUE_CARD_GAME); + + // Set position of the elements + _autoplay._bounds.moveTo(5, 2); + _restartGame._bounds.moveTo(5, _autoplay._bounds.bottom + 2); + _quitGame._bounds.moveTo(5, _restartGame._bounds.bottom + 2); + _continueGame._bounds.moveTo(5, _quitGame._bounds.bottom + 2); + + // Add the items to the dialog + addElements(&_autoplay, &_restartGame, &_quitGame, &_continueGame, NULL); + + // Set the dialog size and position + frame(); + _bounds.collapse(-6, -6); + setCenter(160, 100); +} + +GfxButton *Scene1337::OptionsDialog::execute(GfxButton *defaultButton) { + _gfxManager.activate(); + + // Event loop + GfxButton *selectedButton = NULL; + + bool breakFlag = false; + while (!g_vm->shouldQuit() && !breakFlag) { + Event event; + while (g_globals->_events.getEvent(event) && !breakFlag) { + // Adjust mouse positions to be relative within the dialog + event.mousePos.x -= _gfxManager._bounds.left; + event.mousePos.y -= _gfxManager._bounds.top; + + for (GfxElementList::iterator i = _elements.begin(); i != _elements.end(); ++i) { + if ((*i)->process(event)) + selectedButton = static_cast<GfxButton *>(*i); + } + + if (selectedButton == &_autoplay) { + // Toggle Autoplay + selectedButton = NULL; + Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene; + scene->_autoplay = !scene->_autoplay; + + _autoplay.setText(scene->_autoplay ? AUTO_PLAY_ON : AUTO_PLAY_OFF); + _autoplay.draw(); + } else if (selectedButton) { + breakFlag = true; + break; + } else if (!event.handled) { + if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE)) { + selectedButton = NULL; + breakFlag = true; + break; + } + } + } + + g_system->delayMillis(10); + GLOBALS._screenSurface.updateScreen(); + } + + _gfxManager.deactivate(); + return selectedButton; +} + /*-------------------------------------------------------------------------- * Scene 1500 - Cutscene: Ship landing * @@ -8839,12 +8672,10 @@ void Scene1550::enterArea() { R2_GLOBALS._sceneManager._hasPalette = false; _wallType = 0; } - } else { - if (_screenNumber == 1234) { - R2_GLOBALS._sceneManager._fadeMode = FADEMODE_IMMEDIATE; - loadScene(1550); - R2_GLOBALS._sceneManager._hasPalette = false; - } + } else if (_screenNumber == 1234) { + R2_GLOBALS._sceneManager._fadeMode = FADEMODE_IMMEDIATE; + loadScene(1550); + R2_GLOBALS._sceneManager._hasPalette = false; } if (_screenNumber == 1234) @@ -10228,7 +10059,7 @@ void Scene1625::signal() { break; } //_field412 = _stripManager._field2E8; - _stripManager._field2E8 = 0; + _stripManager._currObj44Id = 0; break; case 1625: _tealHead.postInit(); @@ -11312,30 +11143,28 @@ bool Scene1800::PassengerDoor::startAction(CursorType action, Event &event) { } } } + } else if (scene->_leftStaircase._frame == 1) { + return SceneActor::startAction(action, event); } else { - if (scene->_leftStaircase._frame == 1) { - return SceneActor::startAction(action, event); + R2_GLOBALS.clearFlag(29); + R2_GLOBALS._player.disableControl(); + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + if (R2_GLOBALS.getFlag(14)) { + scene->_sceneMode = 2; + scene->setAction(&scene->_sequenceManager, scene, 1809, &scene->_companion, &scene->_doors, NULL); + R2_GLOBALS.clearFlag(14); + } else { + scene->_sceneMode = 1806; + scene->setAction(&scene->_sequenceManager, scene, 1806, &R2_GLOBALS._player, &scene->_companion, &scene->_rightDoor, NULL); + } } else { - R2_GLOBALS.clearFlag(29); - R2_GLOBALS._player.disableControl(); - if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - if (R2_GLOBALS.getFlag(14)) { - scene->_sceneMode = 2; - scene->setAction(&scene->_sequenceManager, scene, 1809, &scene->_companion, &scene->_doors, NULL); - R2_GLOBALS.clearFlag(14); - } else { - scene->_sceneMode = 1806; - scene->setAction(&scene->_sequenceManager, scene, 1806, &R2_GLOBALS._player, &scene->_companion, &scene->_rightDoor, NULL); - } + if (R2_GLOBALS.getFlag(14)) { + scene->_sceneMode = 2; + scene->setAction(&scene->_sequenceManager, scene, 1809, &R2_GLOBALS._player, &scene->_doors, NULL); + R2_GLOBALS.clearFlag(14); } else { - if (R2_GLOBALS.getFlag(14)) { - scene->_sceneMode = 2; - scene->setAction(&scene->_sequenceManager, scene, 1809, &R2_GLOBALS._player, &scene->_doors, NULL); - R2_GLOBALS.clearFlag(14); - } else { - scene->_sceneMode = 1807; - scene->setAction(&scene->_sequenceManager, scene, 1807, &R2_GLOBALS._player, &scene->_companion, &scene->_rightDoor, NULL); - } + scene->_sceneMode = 1807; + scene->setAction(&scene->_sequenceManager, scene, 1807, &R2_GLOBALS._player, &scene->_companion, &scene->_rightDoor, NULL); } } } @@ -11492,14 +11321,12 @@ void Scene1800::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._walkRegions.disableRegion(10); R2_GLOBALS._walkRegions.disableRegion(11); } + } else if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + R2_GLOBALS._player.setPosition(Common::Point(140, 160)); + _companion.setPosition(Common::Point(180, 160)); } else { - if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - R2_GLOBALS._player.setPosition(Common::Point(140, 160)); - _companion.setPosition(Common::Point(180, 160)); - } else { - R2_GLOBALS._player.setPosition(Common::Point(180, 160)); - _companion.setPosition(Common::Point(140, 160)); - } + R2_GLOBALS._player.setPosition(Common::Point(180, 160)); + _companion.setPosition(Common::Point(140, 160)); } _playerShadow.postInit(); @@ -11554,23 +11381,19 @@ void Scene1800::postInit(SceneObjectList *OwnerList) { _sceneMode = 1815; setAction(&_sequenceManager, this, 1815, &R2_GLOBALS._player, &_companion, &_leftDoor, NULL); } + } else if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + _sceneMode = 1816; + setAction(&_sequenceManager, this, 1816, &R2_GLOBALS._player, &_companion, &_rightDoor, NULL); } else { - if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - _sceneMode = 1816; - setAction(&_sequenceManager, this, 1816, &R2_GLOBALS._player, &_companion, &_rightDoor, NULL); - } else { - _sceneMode = 1817; - setAction(&_sequenceManager, this, 1817, &R2_GLOBALS._player, &_companion, &_rightDoor, NULL); - } + _sceneMode = 1817; + setAction(&_sequenceManager, this, 1817, &R2_GLOBALS._player, &_companion, &_rightDoor, NULL); } + } else if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + _sceneMode = 1800; + setAction(&_sequenceManager, this, 1800, &R2_GLOBALS._player, &_companion, NULL); } else { - if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - _sceneMode = 1800; - setAction(&_sequenceManager, this, 1800, &R2_GLOBALS._player, &_companion, NULL); - } else { - _sceneMode = 1801; - setAction(&_sequenceManager, this, 1801, &R2_GLOBALS._player, &_companion, NULL); - } + _sceneMode = 1801; + setAction(&_sequenceManager, this, 1801, &R2_GLOBALS._player, &_companion, NULL); } R2_GLOBALS._player._oldCharacterScene[R2_QUINN] = 1800; @@ -11617,7 +11440,7 @@ void Scene1800::signal() { _sceneMode = 14; R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); R2_GLOBALS._player.setup(1801, 7, 1); - R2_GLOBALS._player.animate(ANIM_MODE_8, NULL); + R2_GLOBALS._player.animate(ANIM_MODE_8, 0, NULL); _stripManager.start(550, this); break; case 14: @@ -11637,7 +11460,7 @@ void Scene1800::signal() { _sceneMode = 24; R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); R2_GLOBALS._player.setup(1801, 5, 1); - R2_GLOBALS._player.animate(ANIM_MODE_8, NULL); + R2_GLOBALS._player.animate(ANIM_MODE_8, 0, NULL); _stripManager.start(550, this); break; case 24: @@ -12056,28 +11879,14 @@ void Scene1850::postInit(SceneObjectList *OwnerList) { _screen.setPosition(Common::Point(122, 113)); _screen.fixPriority(114); _screen._effect = EFFECT_SHADED2; - - // Totally useless test - if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - _screen.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL); - } else { - // And the associated dead code - _screen.setDetails(1850, 30, -1, -1, 2, (SceneItem *) NULL); - } + _screen.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL); _helmet.postInit(); _helmet.setup(1853, 3, 2); _helmet.setPosition(Common::Point(139, 111)); _helmet.fixPriority(114); _helmet._effect = EFFECT_SHADED2; - - // Still totally useless test - if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - _helmet.setDetails(1850, 29, -1, -1, 2, (SceneItem *) NULL); - } else { - // Another piece of dead code - _helmet.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL); - } + _helmet.setDetails(1850, 29, -1, -1, 2, (SceneItem *) NULL); if (R2_GLOBALS.getFlag(31)) { _screen._shade = 0; @@ -12090,50 +11899,36 @@ void Scene1850::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.setVisage(1500); _companion.setVisage(1505); } - } else { // Not Quinn - if (R2_GLOBALS.getFlag(32)) { - R2_GLOBALS._player.setVisage(1508); - _companion.setVisage(1511); - - _screen.postInit(); - _screen.setup(1853, 3, 1); - _screen.setPosition(Common::Point(122, 113)); - _screen.fixPriority(114); - _screen._effect = EFFECT_SHADED2; - - // Totally useless test - if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - // Dead code - _screen.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL); - } else { - _screen.setDetails(1850, 30, -1, -1, 2, (SceneItem *) NULL); - } - - _helmet.postInit(); - _helmet.setup(1853, 3, 2); - _helmet.setPosition(Common::Point(139, 111)); - _helmet.fixPriority(114); - _helmet._effect = EFFECT_SHADED2; - - // Again, useless test - if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - // and dead code - _helmet.setDetails(1850, 29, -1, -1, 1, (SceneItem *) NULL); - } else { - _helmet.setDetails(1850, 28, -1, -1, 1, (SceneItem *) NULL); - } - - if (R2_GLOBALS.getFlag(31)) { - _screen._shade = 0; - _helmet._shade = 0; - } else { - _screen._shade = 6; - _helmet._shade = 6; - } + } else if (R2_GLOBALS.getFlag(32)) { + // Not Quinn, flag 32 + R2_GLOBALS._player.setVisage(1508); + _companion.setVisage(1511); + + _screen.postInit(); + _screen.setup(1853, 3, 1); + _screen.setPosition(Common::Point(122, 113)); + _screen.fixPriority(114); + _screen._effect = EFFECT_SHADED2; + _screen.setDetails(1850, 30, -1, -1, 2, (SceneItem *) NULL); + + _helmet.postInit(); + _helmet.setup(1853, 3, 2); + _helmet.setPosition(Common::Point(139, 111)); + _helmet.fixPriority(114); + _helmet._effect = EFFECT_SHADED2; + _helmet.setDetails(1850, 28, -1, -1, 1, (SceneItem *) NULL); + + if (R2_GLOBALS.getFlag(31)) { + _screen._shade = 0; + _helmet._shade = 0; } else { - R2_GLOBALS._player.setVisage(1505); - _companion.setVisage(1500); + _screen._shade = 6; + _helmet._shade = 6; } + } else { + // Not Quinn, nor flag 32 + R2_GLOBALS._player.setVisage(1505); + _companion.setVisage(1500); } R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); @@ -15309,7 +15104,7 @@ void Scene1950::signal() { R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._player._canWalk = true; R2_GLOBALS._player.setVisage(22); - R2_GLOBALS._player.animate(ANIM_MODE_9, NULL); + R2_GLOBALS._player.animate(ANIM_MODE_9); Common::Point pt(340, 160); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); @@ -15325,7 +15120,7 @@ void Scene1950::signal() { R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._player._canWalk = true; R2_GLOBALS._player.setVisage(22); - R2_GLOBALS._player.animate(ANIM_MODE_9, NULL); + R2_GLOBALS._player.animate(ANIM_MODE_9); Common::Point pt(-20, 160); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h index 6cbc617578..c809353051 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.h +++ b/engines/tsage/ringworld2/ringworld2_scenes1.h @@ -183,6 +183,20 @@ public: }; class Scene1337 : public SceneExt { + class OptionsDialog: public GfxDialog { + private: + GfxButton _autoplay; + GfxButton _restartGame; + GfxButton _quitGame; + GfxButton _continueGame; + + OptionsDialog(); + virtual ~OptionsDialog() {} + virtual GfxButton *execute(GfxButton *defaultButton); + public: + static void show(); + }; + class Card: public SceneHotspot { public: SceneObject _card; @@ -270,16 +284,6 @@ class Scene1337 : public SceneExt { void signal(); }; public: - typedef void (Scene1337::*FunctionPtrType)(); - FunctionPtrType _delayedFunction; - - ASound _aSound1; - ASound _aSound2; - SceneActor _helpIcon; - bool _autoplay; - GameBoardSide _gameBoardSide[4]; - SceneItem _item1; - SceneObject _currentPlayerArrow; Action1 _action1; Action2 _action2; Action3 _action3; @@ -293,35 +297,47 @@ public: Action11 _action11; Action12 _action12; Action13 _action13; - Card _animatedCard; - Card _shuffleAnimation; - Card _item4; - SceneActor _stockPile; - int _cardsAvailableNumb; + + typedef void (Scene1337::*FunctionPtrType)(); + FunctionPtrType _delayedFunction; + + bool _autoplay; + bool _shuffleEndedFl; + bool _showPlayerTurn; + bool _displayHelpFl; + bool _instructionsDisplayedFl; // Discarded cards are put in the available cards pile, with an higher index so there no conflict int _currentDiscardIndex; int _availableCardsPile[100]; - Card *_actionCard1; - Card *_actionCard2; - Card *_actionCard3; - Card _item5; - Card _selectedCard; - Card _discardPile; - Card _stockCard; - bool _shuffleEndedFl; + int _cardsAvailableNumb; int _currentPlayerNumb; int _actionIdx1; int _actionIdx2; - bool _showPlayerTurn; - bool _displayHelpFl; int _winnerId; - bool _instructionsDisplayedFl; int _instructionsWaitCount; int _cursorCurRes; int _cursorCurStrip; int _cursorCurFrame; + ASound _aSound1; + ASound _aSound2; + GameBoardSide _gameBoardSide[4]; + SceneActor _helpIcon; + SceneActor _stockPile; + SceneItem _actionItem; + SceneObject _currentPlayerArrow; + + Card *_actionCard1; + Card *_actionCard2; + Card *_actionCard3; + Card _animatedCard; + Card _shuffleAnimation; + Card _discardedPlatformCard; + Card _selectedCard; + Card _discardPile; + Card _stockCard; + SceneObject _upperDisplayCard[8]; SceneObject _lowerDisplayCard[8]; @@ -330,28 +346,27 @@ public: void actionDisplay(int resNum, int lineNum, int x, int y, int keepOnScreen, int width, int textMode, int fontNum, int colFG, int colBGExt, int colFGExt); void setAnimationInfo(Card *card); - void subC20E5(); void handleNextTurn(); - void subC2586(); - bool subC264B(int cardId); - bool subC2687(int cardId); - int subC26CB(int playerId, int handCardId); - int findNormalCardInHand(int playerId); - int subC274D(int arg1); - int subC2781(int arg1); - int subC27B5(int arg1); - int isSlowCard(int cardId); - void subC2835(int arg1); + void handlePlayerTurn(); + bool isStationCard(int cardId); + bool isStopConstructionCard(int cardId); + int getStationId(int playerId, int handCardId); + int findPlatformCardInHand(int playerId); + int findCard13InHand(int playerId); + int checkThieftCard(int playerId); + int isDelayCard(int cardId); + int getStationCardId(int cardId); + void handlePlayer01Discard(int playerId); void playThieftCard(int playerId, Card *card, int victimId); - int subC3257(int arg1); - bool subC32B1(int arg1, int arg2); - int subC331B(int arg1); + int getPreventionCardId(int cardId); + bool isAttackPossible(int victimId, int cardId); + int getPlayerWithOutpost(int playerId); bool checkAntiDelayCard(int delayCardId, int cardId); - void subC33C0(Card *subObj1, Card *subObj2); + void playStationCard(Card *station, Card *platform); void playDelayCard(Card *card, Card *dest); - void playCard(Card *card, Card *dest); + void playPlatformCard(Card *card, Card *dest); void playAntiDelayCard(Card *card, Card *dest); - Card *subC34EC(int arg1); + Card *getStationCard(int arg1); void playCounterTrickCard(Card *card, int playerId); int getFreeHandCard(int playerId); void discardCard(Card *card); @@ -364,13 +379,13 @@ public: void suggestInstructions(); void shuffleCards(); void dealCards(); - void subCD193(); + void showOptionsDialog(); void handleClick(int arg1, Common::Point pt); void handlePlayer0(); void handlePlayer1(); void handlePlayer2(); void handlePlayer3(); - void subD02CA(); + void handleAutoplayPlayer2(); void updateCursorId(int arg1, bool arg2); void setCursorData(int resNum, int rlbNum, int frameNum); void subD18F5(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 732add03ec..5b41a85326 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -2969,18 +2969,20 @@ void Scene3400::signal() { Scene3500::Action1::Action1() { _direction = 0; - _field20 = false; - _field22 = 0; - _field24 = false; + _headingRightFl = false; + _turningFl = false; } void Scene3500::Action1::synchronize(Serializer &s) { Action::synchronize(s); s.syncAsSint16LE(_direction); - s.syncAsSint16LE(_field20); - s.syncAsSint16LE(_field22); - s.syncAsSint16LE(_field24); + s.syncAsSint16LE(_headingRightFl); + if (s.getVersion() < 13) { + int useless = 0; + s.syncAsSint32LE(useless); + } + s.syncAsSint16LE(_turningFl); } void Scene3500::Action1::handleHorzButton(int direction) { @@ -2988,8 +2990,8 @@ void Scene3500::Action1::handleHorzButton(int direction) { // Direction: -1 == Left, 1 == Right _direction = direction; - _field20 = true; - _field24 = true; + _headingRightFl = true; + _turningFl = true; scene->_tunnelHorzCircle.setStrip(2); scene->_tunnelHorzCircle.show(); @@ -3010,7 +3012,7 @@ void Scene3500::Action1::handleHorzButton(int direction) { void Scene3500::Action1::turnShuttle(bool arg1) { Scene3500 *scene = (Scene3500 *)R2_GLOBALS._sceneManager._scene; - _field20 = arg1; + _headingRightFl = arg1; _direction = -_direction; if (_direction == 1) { @@ -3068,7 +3070,7 @@ void Scene3500::Action1::signal() { if (scene->_speed != 0) { scene->_speed = 0; scene->_mazeChangeAmount = 0; - scene->_field1272 = false; + scene->_updateIdxChangeFl = false; scene->_rotation->_idxChange = 0; } break; @@ -3109,49 +3111,49 @@ void Scene3500::Action1::signal() { if ( ((cellId != 2) && (cellId != 3) && (cellId != 6) && (cellId != 1) && (cellId != 23) && (cellId != 24) && (cellId != 4) && (cellId != 11)) || (var6 != 0)) { if ((cellId != 25) && (cellId != 26) && (cellId != 5) && (cellId != 14) && (cellId != 15)) - _field20 = false; + _headingRightFl = false; else if ((var6 != 0) || (di <= 3)) // useless, skipped: "|| (di == 0)" - _field20 = false; + _headingRightFl = false; else - _field20 = true; + _headingRightFl = true; } else - _field20 = true; + _headingRightFl = true; break; case MAZEDIR_EAST: if ( ((cellId != 12) && (cellId != 13) && (cellId != 11) && (cellId != 16) && (cellId != 26) && (cellId != 24) && (cellId != 15) && (cellId != 6) && (cellId != 31)) || (di != 0)) { if ((cellId != 25) && (cellId != 23) && (cellId != 14) && (cellId != 5) && (cellId != 4)) - _field20 = false; + _headingRightFl = false; else if ((di != 0) || (var6 <= 3)) // useless, skipped: "|| (var6 == 0)" - _field20 = false; + _headingRightFl = false; else - _field20 = true; + _headingRightFl = true; } else - _field20 = true; + _headingRightFl = true; break; case MAZEDIR_SOUTH: if ( ((cellId != 2) && (cellId != 3) && (cellId != 6) && (cellId != 1) && (cellId != 25) && (cellId != 26) && (cellId != 5) && (cellId != 16) && (cellId != 31)) || (var6 != 0)) { if ((cellId != 23) && (cellId != 24) && (cellId != 4) && (cellId != 14) && (cellId != 15)) - _field20 = false; + _headingRightFl = false; else if ((var6 != 0) || (di <= 3)) // useless, skipped: "|| (di == 0)" - _field20 = false; + _headingRightFl = false; else - _field20 = true; + _headingRightFl = true; } else - _field20 = true; + _headingRightFl = true; break; case MAZEDIR_WEST: if ( ((cellId != 12) && (cellId != 13) && (cellId != 11) && (cellId != 16) && (cellId != 25) && (cellId != 23) && (cellId != 14) && (cellId != 1) && (cellId != 31)) || (var6 != 0)) { if ((cellId != 26) && (cellId != 24) && (cellId != 15) && (cellId != 5) && (cellId != 4)) - _field20 = false; + _headingRightFl = false; else if ((var6 <= 0) || (di != 0)) // useless, skipped: "|| (var6 == 0)" - _field20 = false; + _headingRightFl = false; else - _field20 = true; + _headingRightFl = true; } else - _field20 = true; + _headingRightFl = true; default: break; } @@ -3181,7 +3183,7 @@ void Scene3500::Action1::signal() { break; case 6: scene->_tunnelVertCircle.setPosition(Common::Point(160, 73)); - if (!_field20) + if (!_headingRightFl) scene->_tunnelVertCircle.setStrip(1); else scene->_tunnelVertCircle.setStrip(2); @@ -3235,8 +3237,8 @@ void Scene3500::Action1::signal() { } scene->_symbolLeft.hide(); scene->_symbolRight.hide(); - _field24 = false; - if (!_field20) { + _turningFl = false; + if (!_headingRightFl) { scene->_throttle.updateSpeed(); if (scene->_mazeChangeAmount == scene->_speed) scene->_aSound1.play(276); @@ -3264,7 +3266,7 @@ void Scene3500::Action1::signal() { NpcMover *mover = new NpcMover(); scene->_tunnelVertCircle.addMover(mover, &pt, NULL); scene->_tunnelVertCircle.fixPriority(11); - if (!_field20) + if (!_headingRightFl) scene->_tunnelHorzCircle.setStrip(1); else scene->_tunnelHorzCircle.setStrip(2); @@ -3465,7 +3467,7 @@ void Scene3500::Throttle::process(Event &event) { if ((event.eventType == EVENT_BUTTON_UP) && (_deltaMouseY != 0)) { _deltaMouseY = 0; event.handled = true; - if (!scene->_action1._field24) + if (!scene->_action1._turningFl) updateSpeed(); } @@ -3500,11 +3502,11 @@ bool Scene3500::Throttle::startAction(CursorType action, Event &event) { /*--------------------------------------------------------------------------*/ -int Scene3500::MazeUI3500::cellFromX(int x) { +int16 Scene3500::MazeUI3500::cellFromX(int x) { return (_cellSize.x / 2) + x - (x % _cellSize.x); } -int Scene3500::MazeUI3500::cellFromY(int y) { +int16 Scene3500::MazeUI3500::cellFromY(int y) { return (_cellSize.y / 2) + y - (y % _cellSize.y) - 1; } @@ -3533,13 +3535,13 @@ Scene3500::Scene3500() { _rotation = NULL; _mazeChangeAmount = 0; _speed = 0; - _field1272 = false; + _updateIdxChangeFl = false; _mazeDirection = MAZEDIR_NONE; _nextMove = 0; _mazePosition.x = 0; _mazePosition.y = 0; - _field1282 = true; // Set to true in fixup() - _field1284 = 0; + _postFixupFl = true; // Set to true in fixup() + _exitCounter = 0; _directionChangesEnabled = false; } @@ -3551,13 +3553,13 @@ void Scene3500::synchronize(Serializer &s) { s.syncAsSint16LE(_moverHorzX); s.syncAsSint16LE(_mazeChangeAmount); s.syncAsSint16LE(_speed); - s.syncAsSint16LE(_field1272); + s.syncAsSint16LE(_updateIdxChangeFl); s.syncAsSint16LE(_mazeDirection); s.syncAsSint16LE(_nextMove); s.syncAsSint16LE(_mazePosition.x); s.syncAsSint16LE(_mazePosition.y); - s.syncAsSint16LE(_field1282); - s.syncAsSint16LE(_field1284); + s.syncAsSint16LE(_postFixupFl); + s.syncAsSint16LE(_exitCounter); s.syncAsSint16LE(_directionChangesEnabled); } @@ -3573,10 +3575,10 @@ void Scene3500::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._characterScene[R2_QUINN] = 3500; R2_GLOBALS._player._characterScene[R2_SEEKER] = 3500; R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3500; - _field1284 = 0; - _field1282 = false; + _exitCounter = 0; + _postFixupFl = false; _nextMove = 0; - _field1272 = true; + _updateIdxChangeFl = true; _speed = 4; _mazeChangeAmount = 4; _mazePosition = Common::Point(860, 891); @@ -3670,7 +3672,7 @@ void Scene3500::postInit(SceneObjectList *OwnerList) { _mazeUI.load(2); _mazeUI.setMazePosition(_mazePosition); - _action1._field24 = false; + _action1._turningFl = false; _mazeUI.draw(); _directionChangesEnabled = true; @@ -3689,7 +3691,7 @@ void Scene3500::doMovement(int id) { _speed--; _throttle.setSpeed(_speed); } - if (_action1._field24) + if (_action1._turningFl) _speed = 0; break; case 1: @@ -3698,13 +3700,13 @@ void Scene3500::doMovement(int id) { ++_speed; _throttle.setSpeed(_speed); } - if (_action1._field24) + if (_action1._turningFl) _speed = 0; break; case 88: // Up button has been pressed // The original was doing a double check on action, only one is here. - if (!_action || (!_action1._field24)) { + if (!_action || (!_action1._turningFl)) { _action2.handleVertButton(2); if (_action && ((_action2.getActionIndex() != 0) || (_action2._direction != 2))) { _action2.signal(); @@ -3715,10 +3717,10 @@ void Scene3500::doMovement(int id) { break; case 96: // Right button has been pressed - if (!_action || !_action1._field24 || (_action1._direction == 1)) { - if (_action && (_nextMove == 0) && (_action1._field24)) { + if (!_action || !_action1._turningFl || (_action1._direction == 1)) { + if (_action && (_nextMove == 0) && (_action1._turningFl)) { _nextMove = id; - } else if (_action && (!_action1._field24)) { + } else if (_action && (!_action1._turningFl)) { _action1.handleHorzButton(1); _action1.signal(); } else if (!_action) { @@ -3735,7 +3737,7 @@ void Scene3500::doMovement(int id) { break; case 104: // Down button has been pressed - if (!_action || (!_action1._field24)) { + if (!_action || (!_action1._turningFl)) { _action2.handleVertButton(-1); if ((_action) && ((_action2.getActionIndex() != 0) || (_action2._direction != -1))) { _action2.signal(); @@ -3746,10 +3748,10 @@ void Scene3500::doMovement(int id) { break; case 112: // Left button has been pressed - if (!_action || !_action1._field24 || (_action1._direction == 1)) { - if (_action && (_nextMove == 0) && (_action1._field24)) { + if (!_action || !_action1._turningFl || (_action1._direction == 1)) { + if (_action && (_nextMove == 0) && (_action1._turningFl)) { _nextMove = id; - } else if (_action && (!_action1._field24)) { + } else if (_action && (!_action1._turningFl)) { _action1.handleHorzButton(-1); _action1.signal(); } else if (!_action) { @@ -3767,7 +3769,7 @@ void Scene3500::doMovement(int id) { default: _speed = id; _throttle.setSpeed(id); - if (_action1._field24) { + if (_action1._turningFl) { _speed = 0; } break; @@ -3874,12 +3876,12 @@ void Scene3500::dispatch() { Rect tmpRect; Scene::dispatch(); - if (((_shuttle._frame % 2) == 0) && (!_action1._field24)) { + if (((_shuttle._frame % 2) == 0) && (!_action1._turningFl)) { _shuttle.setFrame(_shuttle.changeFrame()); _mazeDirection = _shuttle._frame; } - if ((_nextMove != 0) && (!_action1._field24)) { + if ((_nextMove != 0) && (!_action1._turningFl)) { int move = _nextMove; _nextMove = 0; doMovement(move); @@ -3888,20 +3890,20 @@ void Scene3500::dispatch() { if (!_rotation) return; - int newMazeX = 0; - int newMazeY = 0; - int mazePosX = 0; - int mazePosY = 0; + int16 newMazeX = 0; + int16 newMazeY = 0; + int16 mazePosX = 0; + int16 mazePosY = 0; int deltaX = 0; int deltaY = 0; int tmpCellId = 0; int cellId = 0; - if ((_mazeChangeAmount == 0) && !_field1282) { - if (_field1284 == 2) + if ((_mazeChangeAmount == 0) && !_postFixupFl) { + if (_exitCounter == 2) R2_GLOBALS._sceneManager.changeScene(1000); } else { - _field1282 = false; + _postFixupFl = false; tmpRect.set(160, 89, 299, 182); newMazeX = _mazePosition.x; @@ -3921,8 +3923,8 @@ void Scene3500::dispatch() { _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); } else { mazePosY = _mazeUI.cellFromY(newMazeY + 46) - 46; @@ -3934,8 +3936,8 @@ void Scene3500::dispatch() { _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); } else if ((cellId == 11) && (cellId != tmpCellId)) { newMazeY = mazePosY + 3; @@ -3943,8 +3945,8 @@ void Scene3500::dispatch() { _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); } else { mazePosY = _mazeUI.cellFromY(newMazeY + 46) - 46; @@ -3952,23 +3954,23 @@ void Scene3500::dispatch() { cellId = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46)); if ( (((cellId == 23) || (cellId == 24) || (cellId == 4)) && (newMazeY <= mazePosY) && (_mazePosition.y>= mazePosY)) - || (((cellId == 25) || (cellId == 26) || (cellId == 5) || (cellId == 14) || (cellId == 15)) && (_mazeChangeAmount >= deltaY) && (_mazeChangeAmount > 3) && (_action1._field24 != 0)) ) { + || (((cellId == 25) || (cellId == 26) || (cellId == 5) || (cellId == 14) || (cellId == 15)) && (_mazeChangeAmount >= deltaY) && (_mazeChangeAmount > 3) && (_action1._turningFl != 0)) ) { newMazeY = mazePosY; if ((cellId != 25) && (cellId != 26) && (cellId != 5) && (cellId != 14) && (cellId == 15)) R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); } else if ((cellId == 11) && (mazePosY + 3 >= newMazeY) && (_mazePosition.y >= mazePosY + 3)) { R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); } else if (((cellId == 25) || (cellId == 26) || (cellId == 5) || (cellId == 14) || (cellId == 15)) && (deltaX != 0) && (deltaX <= 3)) { newMazeX = mazePosX; @@ -3987,8 +3989,8 @@ void Scene3500::dispatch() { _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); } else { mazePosX = _mazeUI.cellFromX(newMazeX + 70) - 70; @@ -4000,8 +4002,8 @@ void Scene3500::dispatch() { _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); } else if ((cellId == 6) && (cellId != tmpCellId)) { newMazeX = mazePosX - 5; @@ -4009,23 +4011,23 @@ void Scene3500::dispatch() { _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); } else { mazePosX = _mazeUI.cellFromX(newMazeX + 70) - 70; deltaX = abs(newMazeX - mazePosX); cellId = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46)); if ( (((cellId == 26) || (cellId == 24) || (cellId == 15)) && (newMazeX >= mazePosX) && (_mazePosition.x <= mazePosX)) - || (((cellId == 25) || (cellId == 23) || (cellId == 14) || (cellId == 5) || (cellId == 4)) && (_mazeChangeAmount >= deltaX) && (_mazeChangeAmount <= 3) && (_action1._field24 != 0)) ) { + || (((cellId == 25) || (cellId == 23) || (cellId == 14) || (cellId == 5) || (cellId == 4)) && (_mazeChangeAmount >= deltaX) && (_mazeChangeAmount <= 3) && (_action1._turningFl != 0)) ) { newMazeX = mazePosX; if ((cellId == 25) || (cellId == 23) || (cellId == 14) || (cellId == 5) || (cellId == 4)) R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); } else if ((cellId == 6) && (mazePosX - 5 <= newMazeX) && (_mazePosition.x <= mazePosX - 5)) { newMazeX = mazePosX - 5; @@ -4033,8 +4035,8 @@ void Scene3500::dispatch() { _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); } else if (((cellId == 25) || (cellId == 23) || (cellId == 14) || (cellId == 5) || (cellId == 4)) && (deltaY != 0) && (deltaY <= 3)) { newMazeY = mazePosY; @@ -4053,8 +4055,8 @@ void Scene3500::dispatch() { _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); } else { mazePosY = _mazeUI.cellFromY(newMazeY + 46) - 46; @@ -4066,8 +4068,8 @@ void Scene3500::dispatch() { _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); } else if ((cellId == 16) && (cellId != tmpCellId)) { newMazeY = mazePosY - 3; @@ -4075,8 +4077,8 @@ void Scene3500::dispatch() { _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); } else if ((cellId == 31) && (cellId != tmpCellId)) { newMazeY = mazePosY + 4; @@ -4084,15 +4086,15 @@ void Scene3500::dispatch() { _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); } else { mazePosY = _mazeUI.cellFromY(newMazeY + 46) - 46; deltaY = abs(newMazeY - mazePosY); cellId = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46)); if ( (((cellId == 25) || (cellId == 26) || (cellId == 5)) && (newMazeY >= mazePosY) && (_mazePosition.y <= mazePosY)) - || (((cellId == 23) || (cellId == 24) || (cellId == 4) || (cellId == 14) || (cellId == 15)) && (_mazeChangeAmount >= deltaY) && (_mazeChangeAmount <= 3) && (_action1._field24 != 0)) ){ + || (((cellId == 23) || (cellId == 24) || (cellId == 4) || (cellId == 14) || (cellId == 15)) && (_mazeChangeAmount >= deltaY) && (_mazeChangeAmount <= 3) && (_action1._turningFl != 0)) ){ newMazeY = mazePosY; if ((cellId != 23) && (cellId != 24) && (cellId != 4) && (cellId != 14) && (cellId != 15)) @@ -4100,8 +4102,8 @@ void Scene3500::dispatch() { _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); } else if ((cellId == 16) && (mazePosY - 3 <= newMazeY) && (_mazePosition.y <= mazePosY - 3)) { newMazeY = mazePosY - 3; @@ -4109,19 +4111,19 @@ void Scene3500::dispatch() { _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); } else if ((cellId == 31) && (mazePosY + 4 <= newMazeY) && (_mazePosition.y <= mazePosY + 4)) { newMazeY = mazePosY + 4; _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); if ((newMazeX == 660) && (_mazeChangeAmount + 306 <= newMazeY) && (newMazeY <= 307)) - ++_field1284; + ++_exitCounter; else R2_GLOBALS._sound2.play(339); } else if (((cellId == 23) || (cellId == 24) || (cellId == 4) || (cellId == 14) || (cellId == 15)) && (deltaX != 0) && (deltaX <= 3)) { @@ -4141,8 +4143,8 @@ void Scene3500::dispatch() { _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); } else { mazePosX = _mazeUI.cellFromX(newMazeX + 70) - 70; @@ -4154,8 +4156,8 @@ void Scene3500::dispatch() { _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); } else if ((cellId == 1) && (cellId != tmpCellId)) { newMazeX = mazePosX + 5; @@ -4163,23 +4165,23 @@ void Scene3500::dispatch() { _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); } else { mazePosX = _mazeUI.cellFromX(newMazeX + 70) - 70; deltaX = abs(mazePosX - newMazeX); cellId = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46)); if ( (((cellId == 25) || (cellId == 23) || (cellId == 14)) && (newMazeX <= mazePosX) && (_mazePosition.x >= mazePosX)) - || (((cellId == 26) || (cellId == 24) || (cellId == 15) || (cellId == 5) || (cellId == 4)) && (_mazeChangeAmount >= deltaX) && (_mazeChangeAmount <= 3) && (_action1._field24)) ) { + || (((cellId == 26) || (cellId == 24) || (cellId == 15) || (cellId == 5) || (cellId == 4)) && (_mazeChangeAmount >= deltaX) && (_mazeChangeAmount <= 3) && (_action1._turningFl)) ) { newMazeX = mazePosX; if ((cellId == 26) || (cellId == 24) || (cellId == 15) || (cellId == 5) || (cellId == 4)) R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); } else if ((cellId == 1) && (newMazeX >= mazePosX + 5) && (_mazePosition.x >= mazePosX + 5)) { newMazeX = mazePosX + 5; @@ -4187,8 +4189,8 @@ void Scene3500::dispatch() { _rotation->_idxChange = 0; _speed = 0; _mazeChangeAmount = 0; - _field1272 = false; - if (!_action1._field24) + _updateIdxChangeFl = false; + if (!_action1._turningFl) _tunnelVertCircle.hide(); } else if (((cellId == 26) || (cellId == 24) || (cellId == 15) || (cellId == 5) || (cellId == 4)) && (deltaY != 0) && (deltaY <= 3)) { newMazeY = mazePosY; @@ -4203,11 +4205,11 @@ void Scene3500::dispatch() { break; } - if (_field1284 < 2) { + if (_exitCounter < 2) { _mazePosition.x = newMazeX; _mazePosition.y = newMazeY; if (_mazeUI.setMazePosition2(_mazePosition) != 0) { - _field1272 = false; + _updateIdxChangeFl = false; _mazeChangeAmount = 0; _speed = 0; _rotation->setDelay(0); @@ -4215,16 +4217,16 @@ void Scene3500::dispatch() { } _mazeUI.draw(); - if (_field1284 != 0) - ++_field1284; + if (_exitCounter != 0) + ++_exitCounter; } } - if (!_field1272) { + if (!_updateIdxChangeFl) { if (_mazeChangeAmount != _speed) { if (_mazeChangeAmount >= _speed) { if (_mazeChangeAmount == 1) { - if (_action1._field24) { + if (_action1._turningFl) { if ( ((_mazeDirection == 1) && (deltaX == 0) && (deltaY != 0) && (deltaY <= 3) && ((cellId == 25) || (cellId == 26) || (cellId == 5) || (cellId == 14) || (cellId == 15))) || ((_mazeDirection == 3) && (deltaY == 0) && (deltaX != 0) && (deltaX <= 3) && ((cellId == 25) || (cellId == 23) || (cellId == 14) || (cellId == 5) || (cellId == 4))) || ((_mazeDirection == 5) && (deltaX == 0) && (deltaY != 0) && (deltaY <= 3) && ((cellId == 23) || (cellId == 24) || (cellId == 4) || (cellId == 14) || (cellId == 15))) @@ -4238,12 +4240,12 @@ void Scene3500::dispatch() { _mazeChangeAmount--; } else ++_mazeChangeAmount; - _field1272 = true; + _updateIdxChangeFl = true; } _verticalSpeedDisplay.setFrame2(_mazeChangeAmount + 1); } - if (_field1272) { + if (_updateIdxChangeFl) { if (_mazeChangeAmount == 0) _rotation->_idxChange = 0; else if (_mazeChangeAmount > 8) @@ -4251,7 +4253,7 @@ void Scene3500::dispatch() { else _rotation->_idxChange = 1; - _field1272 = false; + _updateIdxChangeFl = false; } if (_mazeChangeAmount != 0) { @@ -4283,14 +4285,14 @@ void Scene3600::synchronize(Serializer &s) { } Scene3600::Action3600::Action3600() { - _field1E = false; + _part2Fl = false; _fadePct = 0; } void Scene3600::Action3600::synchronize(Serializer &s) { Action::synchronize(s); - s.syncAsSint16LE(_field1E); + s.syncAsSint16LE(_part2Fl); s.syncAsSint16LE(_fadePct); } @@ -4303,8 +4305,8 @@ void Scene3600::Action3600::signal() { setDelay(60); break; case 1: - if (!_field1E) { - _field1E = true; + if (!_part2Fl) { + _part2Fl = true; scene->_steppingDisk.setAction(NULL); R2_GLOBALS._sound2.play(330, NULL, 0); R2_GLOBALS._sound2.fade(127, 5, 10, false, NULL); @@ -4358,7 +4360,7 @@ void Scene3600::Action2::signal() { bool Scene3600::LightShaft::startAction(CursorType action, Event &event) { Scene3600 *scene = (Scene3600 *)R2_GLOBALS._sceneManager._scene; - if ((action != CURSOR_USE) || !scene->_action1._field1E) + if ((action != CURSOR_USE) || !scene->_action1._part2Fl) return SceneItem::startAction(action, event); R2_GLOBALS._walkRegions.enableRegion(2); @@ -4579,7 +4581,7 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { _consoleLights.setup(3601, 5, 1); _consoleLights.animate(ANIM_MODE_2, NULL); - _action1._field1E = true; + _action1._part2Fl = true; _action1._fadePct = 0; _action1.setActionIndex(1); @@ -4614,7 +4616,7 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { _steppingDisk.fixPriority(149); _steppingDisk.changeZoom(-1); - _action1._field1E = false; + _action1._part2Fl = false; _action1._fadePct = 90; _sceneMode = 3600; @@ -4852,7 +4854,7 @@ void Scene3600::signal() { // No break on purpose case 3623: if ((_protector._position.x == 226) && (_protector._position.y == 152) - && _action1._field1E && (_protector._visage == 3127) && (!R2_GLOBALS.getFlag(71))) { + && _action1._part2Fl && (_protector._visage == 3127) && (!R2_GLOBALS.getFlag(71))) { R2_GLOBALS._sound2.stop(); R2_GLOBALS._sound2.play(331); R2_GLOBALS.setFlag(71); @@ -4900,7 +4902,7 @@ void Scene3600::process(Event &event) { } void Scene3600::dispatch() { - if ((R2_GLOBALS._player.getRegionIndex() == 200) && _action1._field1E && !_lightEntered) { + if ((R2_GLOBALS._player.getRegionIndex() == 200) && _action1._part2Fl && !_lightEntered) { R2_GLOBALS._sound2.fadeOut2(NULL); if (_protector._mover) _protector.addMover(NULL); @@ -4941,7 +4943,7 @@ void Scene3600::dispatch() { _webbster.setAction(&_sequenceManager1, this, 3613, &_webbster, NULL); } - if ((_protector.getRegionIndex() == 200) && _action1._field1E && !_ghoulTeleported) { + if ((_protector.getRegionIndex() == 200) && _action1._part2Fl && !_ghoulTeleported) { R2_GLOBALS._sound2.fadeOut2(NULL); _sceneMode = 3620; _ghoulTeleported = true; diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.h b/engines/tsage/ringworld2/ringworld2_scenes3.h index 398d09a01e..e6f74d6e53 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.h +++ b/engines/tsage/ringworld2/ringworld2_scenes3.h @@ -565,9 +565,8 @@ class Scene3500 : public SceneExt { class Action1: public Action { public: int _direction; - bool _field20; - int _field22; // CHECKME: Useless field - bool _field24; + bool _headingRightFl; + bool _turningFl; Action1(); virtual void synchronize(Serializer &s); @@ -619,8 +618,8 @@ class Scene3500 : public SceneExt { class MazeUI3500 : public MazeUI { public: - int cellFromX(int arg1); - int cellFromY(int arg1); + int16 cellFromX(int arg1); + int16 cellFromY(int arg1); int getCellFromMapXY(Common::Point pt); bool setMazePosition2(Common::Point &p); }; @@ -653,12 +652,12 @@ public: PaletteRotation *_rotation; int _mazeChangeAmount; int _speed; - bool _field1272; + bool _updateIdxChangeFl; int _mazeDirection; int _nextMove; Common::Point _mazePosition; - bool _field1282; - int _field1284; + bool _postFixupFl; + int _exitCounter; bool _directionChangesEnabled; Scene3500(); @@ -675,7 +674,7 @@ public: class Scene3600 : public SceneExt { class Action3600: public ActionExt { public: - bool _field1E; + bool _part2Fl; int _fadePct; Action3600(); diff --git a/engines/tsage/saveload.h b/engines/tsage/saveload.h index 32da6ee7f4..42fd4f3282 100644 --- a/engines/tsage/saveload.h +++ b/engines/tsage/saveload.h @@ -33,7 +33,7 @@ namespace TsAGE { typedef void (*SaveNotifierFn)(bool postFlag); -#define TSAGE_SAVEGAME_VERSION 12 +#define TSAGE_SAVEGAME_VERSION 15 class SavedObject; diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp index 1726d6ad20..b41e8175c6 100644 --- a/engines/tsage/scenes.cpp +++ b/engines/tsage/scenes.cpp @@ -275,10 +275,7 @@ Scene::Scene() : _sceneBounds(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), _oldSceneBounds = Rect(4000, 4000, 4100, 4100); Common::fill(&_zoomPercents[0], &_zoomPercents[256], 0); - _field12 = 0; _screenNumber = 0; - _fieldA = 0; - _fieldE = 0; } Scene::~Scene() { @@ -288,15 +285,23 @@ void Scene::synchronize(Serializer &s) { if (s.getVersion() >= 2) StripCallback::synchronize(s); - s.syncAsSint32LE(_field12); + if (s.getVersion() < 14) { + int useless = 0; + s.syncAsSint32LE(useless); + } + s.syncAsSint32LE(_screenNumber); s.syncAsSint32LE(_activeScreenNumber); s.syncAsSint32LE(_sceneMode); _backgroundBounds.synchronize(s); _sceneBounds.synchronize(s); _oldSceneBounds.synchronize(s); - s.syncAsSint16LE(_fieldA); - s.syncAsSint16LE(_fieldE); + + if (s.getVersion() < 14) { + int useless = 0; + s.syncAsSint16LE(useless); + s.syncAsSint16LE(useless); + } for (int i = 0; i < 256; ++i) s.syncAsUint16LE(_enabledSections[i]); @@ -309,7 +314,6 @@ void Scene::synchronize(Serializer &s) { void Scene::postInit(SceneObjectList *OwnerList) { _action = NULL; - _field12 = 0; _sceneMode = 0; } diff --git a/engines/tsage/scenes.h b/engines/tsage/scenes.h index d5ac88c692..4d36192cec 100644 --- a/engines/tsage/scenes.h +++ b/engines/tsage/scenes.h @@ -35,7 +35,6 @@ class Scene : public StripCallback { private: void drawBackgroundObjects(); public: - int _field12; int _screenNumber; int _activeScreenNumber; int _sceneMode; @@ -49,9 +48,6 @@ public: int _zoomPercents[256]; ScenePriorities _priorities; SceneObjectList _bgSceneObjects; - - int _fieldA; - int _fieldE; public: Scene(); virtual ~Scene(); diff --git a/engines/tsage/staticres.cpp b/engines/tsage/staticres.cpp index 2749f2ac90..3c850cf8dc 100644 --- a/engines/tsage/staticres.cpp +++ b/engines/tsage/staticres.cpp @@ -213,6 +213,14 @@ char const *const ACCESS_CODE_REQUIRED = "access code required"; char const *const INVALID_ACCESS_CODE = "invalid access code"; char const *const FOREIGN_OBJECT_EXTRACTED = "foreign object extracted"; +// Scene 1330/7 Options dialog messages +char const *const AUTO_PLAY_ON = "Auto-Play is On"; +char const *const AUTO_PLAY_OFF = "Auto-Play is Off"; +char const *const START_NEW_CARD_GAME = "Start a new game"; +char const *const QUIT_CARD_GAME = "Quit Outpost Alpha"; +char const *const CONTINUE_CARD_GAME = "Continue Outpost Alpha"; + +// char const *const HELP_MSG = "\x1\rRETURN TO\r RINGWORLD\x14"; char const *const CHAR_TITLE = "\x01Select Character:"; char const *const CHAR_QUINN_MSG = " Quinn "; diff --git a/engines/tsage/staticres.h b/engines/tsage/staticres.h index 587463a918..c18f31fdfc 100644 --- a/engines/tsage/staticres.h +++ b/engines/tsage/staticres.h @@ -165,6 +165,13 @@ extern char const *const ACCESS_CODE_REQUIRED; extern char const *const INVALID_ACCESS_CODE; extern char const *const FOREIGN_OBJECT_EXTRACTED; +// Scene 1330/7 Options dialog messages +extern char const *const AUTO_PLAY_ON; +extern char const *const AUTO_PLAY_OFF; +extern char const *const START_NEW_CARD_GAME; +extern char const *const QUIT_CARD_GAME; +extern char const *const CONTINUE_CARD_GAME; + // Dialog messages extern char const *const HELP_MSG; extern char const *const CHAR_TITLE; diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp index 37e96c75e0..80e2116c54 100644 --- a/engines/tsage/tsage.cpp +++ b/engines/tsage/tsage.cpp @@ -177,8 +177,4 @@ void TSageEngine::syncSoundSettings() { g_globals->_soundManager.syncSounds(); } -bool TSageEngine::shouldQuit() { - return getEventManager()->shouldQuit() || getEventManager()->shouldRTL(); -} - } // End of namespace TsAGE diff --git a/engines/tsage/tsage.h b/engines/tsage/tsage.h index 0896580b04..e69fe0612a 100644 --- a/engines/tsage/tsage.h +++ b/engines/tsage/tsage.h @@ -83,7 +83,6 @@ public: uint32 getGameID() const; uint32 getFeatures() const; Common::String getPrimaryFilename() const; - bool shouldQuit(); virtual Common::Error init(); virtual Common::Error run(); diff --git a/engines/tsage/user_interface.cpp b/engines/tsage/user_interface.cpp index ae34ac0574..ae5c6c8cee 100644 --- a/engines/tsage/user_interface.cpp +++ b/engines/tsage/user_interface.cpp @@ -38,13 +38,15 @@ void StripProxy::process(Event &event) { void UIElement::synchronize(Serializer &s) { BackgroundSceneObject::synchronize(s); - s.syncAsSint16LE(_field88); + if (s.getVersion() < 15) { + int useless = 0; + s.syncAsSint16LE(useless); + } s.syncAsSint16LE(_enabled); s.syncAsSint16LE(_frameNum); } void UIElement::setup(int visage, int stripNum, int frameNum, int posX, int posY, int priority) { - _field88 = 0; _frameNum = frameNum; _enabled = true; diff --git a/engines/tsage/user_interface.h b/engines/tsage/user_interface.h index 60cefc0751..bc2398bf05 100644 --- a/engines/tsage/user_interface.h +++ b/engines/tsage/user_interface.h @@ -37,7 +37,6 @@ public: class UIElement: public BackgroundSceneObject { public: - int _field88; bool _enabled; int _frameNum; |
