diff options
author | Strangerke | 2012-02-12 13:09:07 +0100 |
---|---|---|
committer | Strangerke | 2012-02-12 13:09:07 +0100 |
commit | 93619b96d33619014a0ed18878410ade85295caa (patch) | |
tree | 5600dcb34fe7ea01d4ab8316477926c63062e5c2 | |
parent | 7760f8358a45ae746f07bbbb42f86d19fc85a0c7 (diff) | |
download | scummvm-rg350-93619b96d33619014a0ed18878410ade85295caa.tar.gz scummvm-rg350-93619b96d33619014a0ed18878410ade85295caa.tar.bz2 scummvm-rg350-93619b96d33619014a0ed18878410ade85295caa.zip |
TSAGE: R2R - Scene 1337: Implement 7 functions used by AI
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_logic.cpp | 1 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes1.cpp | 65 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes1.h | 2 |
3 files changed, 54 insertions, 14 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 6a986d58c4..83ca51faf5 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -113,6 +113,7 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { return new Scene1100(); case 1200: return new Scene1200(); + case 1337: case 1330: // Card Game return new Scene1337(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index 7857363482..4395e5c386 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -4033,34 +4033,71 @@ bool Scene1337::subC264B(int arg1) { } } -int Scene1337::subC2687(int arg1) { - warning("STUBBED Scene1337::subC2687()"); - return -1; +bool Scene1337::subC2687(int arg1) { + switch (arg1) { + case 11: + // No break on purpose + case 14: + // No break on purpose + case 16: + // No break on purpose + case 24: + return true; + default: + return false; + } } int Scene1337::subC26CB(int arg1, int arg2) { - warning("STUBBED Scene1337::subC26CB()"); + if ((_arrunkObj1337[arg1]._arr1[arg2]._field34 > 1) && (_arrunkObj1337[arg1]._arr1[arg2]._field34 <= 9)) { + return arg2; + } + return -1; } int Scene1337::subC2719(int arg1) { - warning("STUBBED Scene1337::subC2719()"); + for (int i = 0; i <= 3; i++) { + if (_arrunkObj1337[arg1]._arr1[i]._field34 == 1) + return i; + } + return -1; } int Scene1337::subC274D(int arg1) { - warning("STUBBED Scene1337::subC274D()"); + for (int i = 0; i <= 3; i++) { + if (_arrunkObj1337[arg1]._arr1[i]._field34 == 13) + return i; + } + return -1; } int Scene1337::subC2781(int arg1) { - warning("STUBBED Scene1337::subC2781()"); + for (int i = 0; i <= 3; i++) { + if (_arrunkObj1337[arg1]._arr1[i]._field34 == 25) + return i; + } + return -1; } int Scene1337::subC27B5(int arg1) { - warning("STUBBED Scene1337::subC27B5()"); - return -1; + switch (arg1) { + case 11: + // No break on purpose + case 14: + // No break on purpose + case 16: + // No break on purpose + case 24: + return arg1; + break; + default: + return -1; + break; + } } int Scene1337::subC27F9(int arg1) { @@ -4128,7 +4165,10 @@ int Scene1337::subC3E92(int arg1) { } void Scene1337::subC340B(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2) { - warning("STUBBED Scene1337::subC340B()"); + _field3EF0 = subObj1; + _field3EF4 = subObj2; + + _item1.setAction(&_action6); } void Scene1337::subC3456(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2) { @@ -4392,7 +4432,6 @@ void Scene1337::subCCF26() { } void Scene1337::subCF31D() { - warning("STUBBED Scene1337::subCF31D()"); int tmpVal = 1; bool found; int count; @@ -4456,7 +4495,7 @@ void Scene1337::subCF31D() { for (int j = 0; j <= 7; j++) { if (_arrunkObj1337[1]._arr2[j]._field34 == 1) { - if (subC2687(_arrunkObj1337[1]._arr3[0]._field34) == 0) { + if (!subC2687(_arrunkObj1337[1]._arr3[0]._field34)) { count = 0; for (int k = 0; k <= 7; k++) { if ((_arrunkObj1337[1]._arr2[k]._field34 > 1) && (_arrunkObj1337[1]._arr2[k]._field34 <= 9)) @@ -4480,7 +4519,7 @@ void Scene1337::subCF31D() { tmpVal = subC2719(1); if (tmpVal != -1) { for (int i = 0; i <= 7; i++) { - if ((_arrunkObj1337[1]._arr2[i]._field34 == 0) && (subC2687(_arrunkObj1337[1]._arr3[0]._field34) == 0)) { + if ((_arrunkObj1337[1]._arr2[i]._field34 == 0) && (!subC2687(_arrunkObj1337[1]._arr3[0]._field34))) { subC340B(&_arrunkObj1337[1]._arr1[tmpVal], &_arrunkObj1337[1]._arr2[i]); found = true; } diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h index 1e67029f87..d23ce00793 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.h +++ b/engines/tsage/ringworld2/ringworld2_scenes1.h @@ -317,7 +317,7 @@ public: void subC20F9(); void subC2586(); bool subC264B(int arg1); - int subC2687(int arg1); + bool subC2687(int arg1); int subC26CB(int arg1, int arg2); int subC2719(int arg1); int subC274D(int arg1); |