TSAGE: R2R - Some refactoring in scene 1337

This commit is contained in:
Strangerke 2013-12-22 12:41:03 +01:00
parent badfd14f74
commit abd0770cdb

View File

@ -3158,14 +3158,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 {
} 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 +3235,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 {
} 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 +3313,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 {
} 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);
@ -4097,13 +4091,11 @@ void Scene1337::Action11::signal() {
} // while
scene->_displayHelpFl = true;
scene->subC4CEC();
} else {
if (scene->_actionIdx2 != 2) {
} else if (scene->_actionIdx2 != 2) {
int tmpVal = scene->getFreeHandCard(scene->_actionIdx2);
scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx2]._handCard[tmpVal];
}
}
}
scene->_actionCard1->_card.postInit();
scene->_actionCard1->_card.hide();
@ -4264,8 +4256,7 @@ void Scene1337::Action12::signal() {
}
}
scene->subC4CEC();
} else {
if (scene->_actionIdx1 != 1) {
} else if (scene->_actionIdx1 != 1) {
switch (scene->_actionIdx1) {
case 0:
scene->_actionCard3 = &scene->_gameBoardSide[0]._handCard[scene->getFreeHandCard(0)];
@ -4279,7 +4270,6 @@ void Scene1337::Action12::signal() {
} else {
scene->_actionCard3 = &scene->_gameBoardSide[1]._handCard[scene->getFreeHandCard(1)];
}
}
scene->_actionCard1->_card.postInit();
scene->_actionCard1->_card.hide();
@ -4553,14 +4543,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 {
} 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);
@ -5514,17 +5502,16 @@ void Scene1337::handleClick(int arg1, Common::Point pt) {
displayDialog(_discardPile._cardId);
else
actionDisplay(1330, 7, 159, 10, 1, 200, 0, 7, 0, 154, 154);
} else if (_helpIcon._bounds.contains(pt)) {
} else if (_helpIcon._bounds.contains(pt))
actionDisplay(1330, 43, 159, 10, 1, 200, 0, 7, 0, 154, 154);
} else if (_stockCard.isIn(pt)) {
else if (_stockCard.isIn(pt))
actionDisplay(1330, 4, 159, 10, 1, 200, 0, 7, 0, 154, 154);
} else if ( (_gameBoardSide[2]._emptyStationPos.isIn(pt))
else if ( (_gameBoardSide[2]._emptyStationPos.isIn(pt))
|| (_gameBoardSide[3]._emptyStationPos.isIn(pt))
|| (_gameBoardSide[0]._emptyStationPos.isIn(pt))
|| (_gameBoardSide[1]._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))
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);
@ -5565,7 +5552,6 @@ void Scene1337::handleClick(int arg1, Common::Point pt) {
}
}
}
}
if (arg1 != 1)
return;
@ -6078,8 +6064,7 @@ void Scene1337::handlePlayer3() {
discardCard(&_gameBoardSide[3]._delayCard);
return;
default:
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)) {
playAntiDelayCard(&_gameBoardSide[3]._handCard[i], &_gameBoardSide[3]._delayCard);
return;
@ -6401,9 +6386,8 @@ void Scene1337::handlePlayer2() {
} else {
actionDisplay(1330, 37, 159, 10, 1, 200, 0, 7, 0, 154, 154);
}
} else {
} else if ((_selectedCard._cardId == 26) || (_selectedCard._cardId == 30) ||(_selectedCard._cardId == 32) || (_selectedCard._cardId == 28)) {
// Check anti-delay card
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)) {
@ -6633,7 +6617,6 @@ void Scene1337::handlePlayer2() {
}
}
}
}
} else {
g_globals->_scenePalette.signalListeners();
R2_GLOBALS._sceneObjects->draw();