aboutsummaryrefslogtreecommitdiff
path: root/simon/items.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'simon/items.cpp')
-rw-r--r--simon/items.cpp77
1 files changed, 67 insertions, 10 deletions
diff --git a/simon/items.cpp b/simon/items.cpp
index 36c064aec4..29371f31e5 100644
--- a/simon/items.cpp
+++ b/simon/items.cpp
@@ -1010,11 +1010,34 @@ int SimonState::runScript()
case 179:{
if (_game == GAME_SIMON1TALKIE || _game == GAME_SIMON1WIN) {
uint b = getVarOrByte();
- /*uint c = */ getVarOrByte();
+ uint c = getVarOrByte();
uint a = getVarOrByte();
uint d = _array_4[a];
- if (d != 0)
- talk_with_speech(d, b);
+ const char *s = (const char *)getStringPtrByID(_stringid_array_3[a]);
+ ThreeValues *tv;
+
+ switch (b) {
+ case 1:
+ tv = &_threevalues_1;
+ break;
+ case 2:
+ tv = &_threevalues_2;
+ break;
+ case 101:
+ tv = &_threevalues_3;
+ break;
+ case 102:
+ tv = &_threevalues_4;
+ break;
+ default:
+ error("setup text, invalid value %d", b);
+ }
+
+ if (_vk_t_toggle) {
+ talk_with_text(b, c, s, tv->a, tv->b, tv->c);
+ } else if (d != 0) {
+ talk_with_speech(d, b);
+ }
} else if (_game == GAME_SIMON1DEMO || _game == GAME_SIMON1DOS) {
uint b = getVarOrByte();
uint c = getVarOrByte();
@@ -1305,15 +1328,49 @@ void SimonState::o_177()
{
if (_game == GAME_SIMON1TALKIE || _game == GAME_SIMON1WIN) {
uint a = getVarOrByte();
- /*uint b = */ getVarOrByte();
+ uint b = getVarOrByte();
uint offs;
Child2 *child = (Child2 *)findChildOfType(getNextItemPtr(), 2);
- if (child != NULL && child->avail_props & 0x200) {
- offs = getOffsetOfChild2Param(child, 0x200);
- talk_with_speech(child->array[offs], a);
- } else if (child != NULL && child->avail_props & 0x100) {
- offs = getOffsetOfChild2Param(child, 0x100);
- talk_with_speech(child->array[offs] + 3550, a);
+ const char *s = NULL;
+ ThreeValues *tv = NULL;
+ char buf[256];
+
+ if (child != NULL && child->avail_props & 1) {
+ s = (const char *)getStringPtrByID(child->array[0]);
+ switch (a) {
+ case 1:
+ tv = &_threevalues_1;
+ break;
+ case 2:
+ tv = &_threevalues_2;
+ break;
+ case 101:
+ tv = &_threevalues_3;
+ break;
+ case 102:
+ tv = &_threevalues_4;
+ break;
+ default:
+ error("setup text, invalid value %d", a);
+ }
+ }
+
+ if (_vk_t_toggle) {
+ if (child->avail_props & 0x100) {
+ uint x = getOffsetOfChild2Param(child, 0x100);
+ sprintf(buf, "%d%s", child->array[x], s);
+ s = buf;
+ }
+
+ talk_with_text(a, b, s, tv->a, tv->b, tv->c);
+ } else {
+ if (child != NULL && child->avail_props & 0x200) {
+ offs = getOffsetOfChild2Param(child, 0x200);
+ talk_with_speech(child->array[offs], a);
+ } else if (child != NULL && child->avail_props & 0x100) {
+ offs = getOffsetOfChild2Param(child, 0x100);
+ talk_with_speech(child->array[offs] + 3550, a);
+ }
}
} else if ((_game == GAME_SIMON1DEMO) || (_game == GAME_SIMON1DOS)) {
uint a = getVarOrByte();