aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaromir Wysoglad2019-06-10 09:16:54 +0200
committerThierry Crozat2019-07-28 15:09:14 +0100
commitd4f2b81b075f6f1c5d807584c420949a9c03bec2 (patch)
treefe74d6365705641491605fb9953d9ad54bda89de
parentf022350257ed6b286ab6e208e5469fc36c271837 (diff)
downloadscummvm-rg350-d4f2b81b075f6f1c5d807584c420949a9c03bec2.tar.gz
scummvm-rg350-d4f2b81b075f6f1c5d807584c420949a9c03bec2.tar.bz2
scummvm-rg350-d4f2b81b075f6f1c5d807584c420949a9c03bec2.zip
SUPERNOVA2: Add Monster2N room
-rw-r--r--engines/supernova2/ms2_def.h2
-rw-r--r--engines/supernova2/rooms.cpp44
2 files changed, 44 insertions, 2 deletions
diff --git a/engines/supernova2/ms2_def.h b/engines/supernova2/ms2_def.h
index 4146a11451..20f2036a3a 100644
--- a/engines/supernova2/ms2_def.h
+++ b/engines/supernova2/ms2_def.h
@@ -157,7 +157,7 @@ kStringDirection4, kStringRope, kStringSign, kStringSignDescription, kStringEntr
kStringPyramid, kStringPyramidDescription, kStringSun, kStringSunDescription, kStringSign5Description,
kStringRight, kStringLeft, kStringButton, kStringInscription, kStringTomato,
kStringFunnyDescription, kStringKnife1, kStringKnife1Description, kStringMonster, kStringRopeDescription,
-kStringEyes, kStringMouth, kStringMonster1Description, kString158, kString159,
+kStringEyes, kStringMouth, kStringMonster1Description, kStringNote, kStringNoteDescription,
kString160, kString161, kString162, kStringSlot, kString164,
kString165, kString166, kString167, kString168, kStringExit,
kString170, kStringToothbrush, kString172, kString173, kString174,
diff --git a/engines/supernova2/rooms.cpp b/engines/supernova2/rooms.cpp
index a20a96ddc3..1d2b357691 100644
--- a/engines/supernova2/rooms.cpp
+++ b/engines/supernova2/rooms.cpp
@@ -3139,9 +3139,17 @@ Monster2N::Monster2N(Supernova2Engine *vm, GameManager *gm) {
_vm = vm;
_gm = gm;
- _fileNumber = 6;
+ _fileNumber = 13;
_id = MONSTER2_N;
_shown[0] = kShownTrue;
+ _shown[1] = kShownTrue;
+
+ _objectState[0] = Object(_id, kStringRight, kStringDefaultDescription, G_RIGHT, EXIT, 8, 8, 0, PYR_ENTRANCE, 14);
+ _objectState[1] = Object(_id, kStringLeft, kStringDefaultDescription, G_LEFT, EXIT, 7, 7, 0, PYR_ENTRANCE, 10);
+ _objectState[2] = Object(_id, kStringNote, kStringNoteDescription, NOTE, TAKE | COMBINABLE, 255, 255, 2);
+ _objectState[3] = Object(_id, kStringEyes, kStringDefaultDescription, NULLOBJECT, NULLTYPE, 6, 6, 0);
+ _objectState[4] = Object(_id, kStringMouth, kStringDefaultDescription, MOUTH, NULLTYPE, 1, 1, 0);
+ _objectState[5] = Object(_id, kStringMonster, kStringMonster1Description, MONSTER, NULLTYPE, 0, 0, 0);
}
void Monster2N::onEntrance() {
@@ -3152,6 +3160,40 @@ void Monster2N::animation() {
}
bool Monster2N::interact(Action verb, Object &obj1, Object &obj2) {
+ if (_gm->move(verb, obj1)) {
+ _gm->passageConstruction();
+ _gm->_newRoom = true;
+ } else if ((verb == ACTION_OPEN || verb == ACTION_PULL) && obj1._id == MOUTH) {
+ if (obj1._type & OPENED)
+ _vm->renderMessage(kStringGenericInteract8);
+ else {
+ obj1._type |= OPENED;
+ if (isSectionVisible(kMaxSection - 1))
+ _vm->renderImage(2);
+ else {
+ _objectState[2]._click = 1;
+ _vm->renderImage(3);
+ setSectionVisible(2, kShownFalse);
+ }
+ _vm->playSound(kAudioTaxiOpen);
+ }
+ } else if (verb == ACTION_CLOSE && obj1._id == MOUTH) {
+ if (obj1._type & OPENED) {
+ _vm->renderImage(1);
+ setSectionVisible(2, kShownFalse);
+ obj1._type &= ~OPENED;
+ _vm->playSound(kAudioElevator1);
+ } else
+ _vm->renderMessage(kStringGenericInteract11);
+ } else if (verb == ACTION_TAKE && (obj1._id == ROPE || obj1._id == NOTE)) {
+ _gm->takeObject(obj1);
+ setSectionVisible(3, kShownFalse);
+ setSectionVisible(4, kShownFalse);
+ setSectionVisible(kMaxSection - 1, kShownTrue);
+ } else if (verb == ACTION_USE && Object::combine(obj1, obj2, TKNIFE, MONSTER)) {
+ _vm->renderMessage(kStringPyramid6);
+ } else
+ return false;
return true;
}