diff options
author | Paul Gilbert | 2016-06-11 17:11:45 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-15 19:23:16 -0400 |
commit | f4ce2d04c35de96bd8cbc2897b0d4998784bfde3 (patch) | |
tree | 41c23b0c0aa5da99b3db05fc3fbd0767563e0d8f /engines/titanic | |
parent | d13501bd1c78504f7d75443e8f45bcee67900e96 (diff) | |
download | scummvm-rg350-f4ce2d04c35de96bd8cbc2897b0d4998784bfde3.tar.gz scummvm-rg350-f4ce2d04c35de96bd8cbc2897b0d4998784bfde3.tar.bz2 scummvm-rg350-f4ce2d04c35de96bd8cbc2897b0d4998784bfde3.zip |
TITANIC: Added Deskbot dial test methods
Diffstat (limited to 'engines/titanic')
-rw-r--r-- | engines/titanic/true_talk/deskbot_script.cpp | 16 | ||||
-rw-r--r-- | engines/titanic/true_talk/deskbot_script.h | 23 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_npc_script.cpp | 11 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_npc_script.h | 8 |
4 files changed, 39 insertions, 19 deletions
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp index c323c7c55e..019f182b1c 100644 --- a/engines/titanic/true_talk/deskbot_script.cpp +++ b/engines/titanic/true_talk/deskbot_script.cpp @@ -112,20 +112,20 @@ int DeskbotScript::proc36(int id) const { return 0; } -void DeskbotScript::proc38() { - warning("TODO"); +bool DeskbotScript::isDial0Medium() const { + return getDialRegion(0) == 1; } -void DeskbotScript::proc39() { - warning("TODO"); +bool DeskbotScript::isDial0Low() const { + return getDialRegion(0) == 0; } -void DeskbotScript::proc40() { - warning("TODO"); +bool DeskbotScript::isDial1Medium() const { + return getDialRegion(1) == 1; } -void DeskbotScript::proc41() { - warning("TODO"); +bool DeskbotScript::isDial1Low() const { + return getDialRegion(1) == 0; } } // End of namespace Titanic diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h index b75abaa4d5..59438486ab 100644 --- a/engines/titanic/true_talk/deskbot_script.h +++ b/engines/titanic/true_talk/deskbot_script.h @@ -54,10 +54,25 @@ public: virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence); virtual int proc36(int val) const; - virtual void proc38(); - virtual void proc39(); - virtual void proc40(); - virtual void proc41(); + /** + * Returns true if dial 1 is the medium (1) region + */ + virtual bool isDial0Medium() const; + + /** + * Returns true if dial 0 is the low end region + */ + virtual bool isDial0Low() const; + + /** + * Returns true if dial 1 is the medium (1) region + */ + bool isDial1Medium() const; + + /** + * Returns true if dial 1 is the low end region + */ + virtual bool isDial1Low() const; }; } // End of namespace Titanic diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp index 94401da7b5..2bfef608dd 100644 --- a/engines/titanic/true_talk/tt_npc_script.cpp +++ b/engines/titanic/true_talk/tt_npc_script.cpp @@ -345,13 +345,14 @@ uint TTnpcScript::getRangeValue(uint id) { } } -void TTnpcScript::proc20(int v) { - warning("TODO"); +void TTnpcScript::resetRange(int id) { + TTscriptRange *range = findRange(id); + if (range && range->_mode != SF_RANDOM) + range->_priorIndex = 0; } int TTnpcScript::proc21(int v1, int v2, int v3) { - // TODO - return v1; + return v2; } int TTnpcScript::proc22(int id) const { @@ -481,7 +482,7 @@ void TTnpcScript::setDial(int dialNum, int value) { } } -int TTnpcScript::getDialRegion(int dialNum) { +int TTnpcScript::getDialRegion(int dialNum) const { if (dialNum < DIALS_ARRAY_COUNT) { int value = _dialValues[dialNum]; if (value < 50) diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h index 0e4359b7b0..261bc57d7b 100644 --- a/engines/titanic/true_talk/tt_npc_script.h +++ b/engines/titanic/true_talk/tt_npc_script.h @@ -302,7 +302,11 @@ public: */ virtual uint getRangeValue(uint id); - virtual void proc20(int v); + /** + * Resets the prior used index for the specified range + */ + virtual void resetRange(int id); + virtual int proc21(int v1, int v2, int v3); virtual int proc22(int id) const; virtual int proc23() const; @@ -328,7 +332,7 @@ public: /** * Returns a dial's region number */ - virtual int getDialRegion(int dialNum); + virtual int getDialRegion(int dialNum) const; /** * Gets the value for a dial |