Initial commit

This commit is contained in:
2026-02-02 04:50:13 +01:00
commit 5b11698731
22592 changed files with 7677434 additions and 0 deletions

View File

@@ -0,0 +1,775 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/font.h"
#include "chewy/globals.h"
#include "chewy/main.h"
#include "chewy/room.h"
#include "chewy/rooms/room00.h"
#include "chewy/sound.h"
namespace Chewy {
namespace Rooms {
#define FLAP_SPRITE 5
#define CH_FLASH 8
#define FLAP_DETAIL 10
#define HOSE_DETAIL 11
#define CH_THROWS_SLIME 12
#define CH_TO_FEEDER 13
#define CH_THROWS_PILLOW 14
#define FEEDER_HOSE 15
#define STERNE_STEHEN 16
#define HOSE1 11
#define HOSE2 38
#define HOSE3 59
#define HEAD1 39
#define HEAD2 46
#define HEAD3 48
void Room0::entry() {
if (isCurInventory(0) || _G(gameState).R0PillowThrow || _G(obj)->checkInventory(0))
_G(det)->hideStaticSpr(6);
if (!_G(flags).LoadGame) {
setPersonPos(150, 100, P_CHEWY, P_RIGHT);
hideCur();
_G(timer_nr)[0] = _G(room)->set_timer(255, 3);
while (!_G(ani_timer)[_G(timer_nr)[0]]._timeFlag && !SHOULD_QUIT) {
setupScreen(DO_SETUP);
}
start_spz(CH_TALK5, 255, ANI_FRONT, P_CHEWY);
startAadWait(2);
showCur();
}
}
bool Room0::timer(int16 timerNr, int16 aniNr) {
bool retval = false;
if (aniNr == 1) {
if (_G(timer_action_ctr) > 0) {
_G(uhr)->resetTimer(timerNr, 0);
--_G(timer_action_ctr);
} else if (!is_chewy_busy() && _G(flags).AutoAniPlay == 0) {
if (!_G(gameState).R0FueterLab)
_G(timer_action_ctr) = 2;
_G(flags).AutoAniPlay = true;
if (!_G(gameState).R0SlimeUsed) {
startAadWait(42);
autoMove(5, P_CHEWY);
setPersonSpr(P_LEFT, P_CHEWY);
if (_G(gameState).R0FueterLab < 3) {
start_spz(CH_TALK3, 255, false, P_CHEWY);
if (_G(gameState).R0FueterLab)
startAadWait(618);
else
startAadWait(43);
++_G(gameState).R0FueterLab;
}
eyeAnim();
} else if (!_G(gameState).R0PillowThrow) {
startAadWait(42);
start_spz(CH_TALK3, 255, false, P_CHEWY);
if (_G(gameState).R0FueterLab < 3) {
startAadWait(43);
++_G(gameState).R0FueterLab;
}
autoMove(3, P_CHEWY);
setPersonPos(191, 120, P_CHEWY, P_LEFT);
}
if (!_G(gameState).R0PillowThrow)
feederAni();
_G(uhr)->resetTimer(timerNr, 0);
_G(flags).AutoAniPlay = false;
}
} else if (timerNr != 3) {
retval = true;
}
return retval;
}
bool Room0::getPillow() {
bool retval = false;
if (!_G(cur)->usingInventoryCursor()) {
hideCur();
_G(flags).AutoAniPlay = true;
autoMove(1, P_CHEWY);
start_spz_wait(CH_LGET_O, 1, false, P_CHEWY);
invent_2_slot(0);
_G(menu_item) = CUR_WALK;
cursorChoice(CUR_WALK);
_G(atds)->setControlBit(174, ATS_ACTIVE_BIT);
_G(det)->hideStaticSpr(6);
_G(flags).AutoAniPlay = false;
showCur();
retval = true;
}
return retval;
}
bool Room0::pullSlime() {
bool retval = false;
if (!_G(cur)->usingInventoryCursor()) {
hideCur();
_G(flags).AutoAniPlay = true;
autoMove(2, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(3, 1, ANI_FRONT);
startSetAILWait(17, 2, ANI_FRONT);
setPersonPos(222, 106, P_CHEWY, P_LEFT);
_G(gameState)._personHide[P_CHEWY] = false;
invent_2_slot(1);
_G(menu_item) = CUR_WALK;
cursorChoice(CUR_WALK);
_G(atds)->setControlBit(175, ATS_ACTIVE_BIT);
_G(flags).AutoAniPlay = false;
showCur();
retval = true;
}
return retval;
}
void Room0::eyeAnim() {
if (!_G(gameState).R0SlimeUsed) {
// Start the eye animation
eyeStart(EYE_START);
if (!_G(gameState).R0SlimeUsed)
eyeWait();
if (_G(gameState).R0SlimeUsed) {
start_aad(124);
checkSlimeEye();
eyeSlimeBack();
autoMove(FUETTER_POS, P_CHEWY);
setPersonPos(199 - CH_HOT_MOV_X, 145 - CH_HOT_MOV_Y, P_CHEWY, P_LEFT);
} else {
eyeShoot();
setPersonPos(199 - CH_HOT_MOV_X, 145 - CH_HOT_MOV_Y, P_CHEWY, P_LEFT);
eyeStart(EYE_END);
}
}
}
void Room0::eyeStart(EyeMode mode) {
AniDetailInfo *adi = _G(det)->getAniDetail(HOSE_DETAIL);
if (mode == EYE_START)
adi->ani_count = adi->start_ani;
else
adi->ani_count = 38;
if (mode == EYE_START) {
trapDoorOpen();
}
bool ende = false;
_G(flags).AniUserAction = true;
if (mode == EYE_START) {
_G(det)->playSound(FLAP_DETAIL, 0);
_G(det)->stopSound(1);
_G(det)->playSound(HOSE_DETAIL, 0);
_G(det)->stopSound(2);
} else {
_G(det)->stopSound(0);
_G(det)->playSound(FLAP_DETAIL, 1);
_G(det)->stopSound(0);
_G(det)->playSound(HOSE_DETAIL, 2);
}
while (!ende) {
clear_prog_ani();
_G(spr_info)[0] = _G(det)->plot_detail_sprite(0, 0, FLAP_DETAIL, FLAP_SPRITE, ANI_HIDE);
_G(spr_info)[0]._zLevel = 190;
if ((adi->ani_count > 11) && (adi->ani_count < 19)) {
_G(spr_info)[1] = _G(det)->plot_detail_sprite(0, 0, HOSE_DETAIL, HOSE1, ANI_HIDE);
_G(spr_info)[1]._zLevel = 191;
}
if (adi->ani_count == 38) {
_G(spr_info)[2] = _G(det)->plot_detail_sprite(0, 0, HOSE_DETAIL, HEAD1, ANI_HIDE);
_G(spr_info)[2]._zLevel = 192;
}
_G(spr_info)[3] = _G(det)->plot_detail_sprite(0, 0, HOSE_DETAIL, adi->ani_count, ANI_HIDE);
_G(spr_info)[3]._zLevel = 193;
get_user_key(NO_SETUP);
setupScreen(NO_SETUP);
SHOULD_QUIT_RETURN;
_G(cur)->updateCursor();
calcEyeClick(3);
_G(out)->copyToScreen();
if (adi->delay_count > 0)
--adi->delay_count;
else {
adi->delay_count = adi->delay + _G(gameState).DelaySpeed;
if (mode == EYE_START) {
++adi->ani_count;
if (adi->ani_count > 38)
ende = true;
} else {
--adi->ani_count;
if (adi->ani_count == adi->start_ani - 1)
ende = true;
}
}
}
clear_prog_ani();
_G(flags).AniUserAction = false;
if (mode == EYE_END) {
trapDoorClose();
}
}
void Room0::eyeWait() {
AniDetailInfo *adi = _G(det)->getAniDetail(HOSE_DETAIL);
adi->ani_count = 39;
adi->delay_count = 15;
_G(flags).AniUserAction = true;
while (adi->ani_count < 46) {
clear_prog_ani();
_G(spr_info)[0] = _G(det)->plot_detail_sprite(0, 0, FLAP_DETAIL, FLAP_SPRITE, ANI_HIDE);
_G(spr_info)[0]._zLevel = 190;
_G(spr_info)[1] = _G(det)->plot_detail_sprite(0, 0, HOSE_DETAIL, HOSE2, ANI_HIDE);
_G(spr_info)[1]._zLevel = 191;
_G(spr_info)[2] = _G(det)->plot_detail_sprite(0, 0, HOSE_DETAIL, adi->ani_count, ANI_HIDE);
_G(spr_info)[2]._zLevel = 192;
get_user_key(NO_SETUP);
setupScreen(NO_SETUP);
_G(cur)->updateCursor();
calcEyeClick(2);
_G(out)->copyToScreen();
if (adi->delay_count > 0) {
--adi->delay_count;
} else {
adi->delay_count = adi->delay + _G(gameState).DelaySpeed;
++adi->ani_count;
}
EVENTS_UPDATE;
SHOULD_QUIT_RETURN;
}
_G(flags).AniUserAction = false;
clear_prog_ani();
}
void Room0::calcEyeClick(int16 aniNr) {
if (mouse_on_prog_ani() == aniNr) {
if (_G(minfo).button != 1 && g_events->_kbInfo._keyCode != Common::KEYCODE_RETURN) {
const uint8 roomNum = _G(room)->_roomInfo->_roomNr;
Common::StringArray desc = _G(atds)->getTextArray(roomNum, 172, ATS_DATA);
if (desc.size() > 0) {
_G(fontMgr)->setFont(_G(font8));
int16 x = g_events->_mousePos.x;
int16 y = g_events->_mousePos.y;
calcTxtXy(&x, &y, desc);
for (int16 i = 0; i < (int16)desc.size(); i++)
printShadowed(x, y + i * 10, 255, 300, 0, _G(scr_width), desc[i].c_str());
}
} else if (_G(minfo).button == 1 || g_events->_kbInfo._keyCode == Common::KEYCODE_RETURN) {
if (isCurInventory(SLIME_INV)) {
delInventory(_G(cur)->getInventoryCursor());
_G(gameState).R0SlimeUsed = true;
} else if (isCurInventory(PILLOW_INV)) {
startAtsWait(172, TXT_MARK_WALK, 14, ATS_DATA);
}
}
}
}
void Room0::eyeShoot() {
AniDetailInfo *adi = _G(det)->getAniDetail(HOSE_DETAIL);
adi->ani_count = 47;
bool endLoopFl = false;
_G(det)->startDetail(CH_FLASH, 1, ANI_FRONT);
while (!endLoopFl) {
clear_prog_ani();
_G(gameState)._personHide[P_CHEWY] = true;
_G(spr_info)[0] = _G(det)->plot_detail_sprite(0, 0, FLAP_DETAIL, FLAP_SPRITE, ANI_HIDE);
_G(spr_info)[0]._zLevel = 190;
_G(spr_info)[1] = _G(det)->plot_detail_sprite(0, 0, HOSE_DETAIL, HOSE2, ANI_HIDE);
_G(spr_info)[1]._zLevel = 191;
if (adi->ani_count < 53) {
_G(spr_info)[2] = _G(det)->plot_detail_sprite(0, 0, HOSE_DETAIL, adi->ani_count, ANI_HIDE);
_G(spr_info)[2]._zLevel = 192;
} else {
_G(spr_info)[2] = _G(det)->plot_detail_sprite(0, 0, HOSE_DETAIL, 47, ANI_HIDE);
_G(spr_info)[2]._zLevel = 192;
if (!_G(det)->get_ani_status(CH_FLASH))
endLoopFl = true;
}
setupScreen(DO_SETUP);
SHOULD_QUIT_RETURN;
if (adi->delay_count > 0)
--adi->delay_count;
else {
adi->delay_count = adi->delay + _G(gameState).DelaySpeed;
++adi->ani_count;
}
}
_G(det)->startDetail(STERNE_STEHEN, 255, ANI_FRONT);
clear_prog_ani();
_G(spr_info)[0] = _G(det)->plot_detail_sprite(0, 0, FLAP_DETAIL, FLAP_SPRITE, ANI_HIDE);
_G(spr_info)[0]._zLevel = 190;
_G(spr_info)[1] = _G(det)->plot_detail_sprite(0, 0, HOSE_DETAIL, HOSE2, ANI_HIDE);
_G(spr_info)[1]._zLevel = 191;
_G(spr_info)[2] = _G(det)->plot_detail_sprite(0, 0, HOSE_DETAIL, HEAD2, ANI_HIDE);
_G(spr_info)[2]._zLevel = 192;
waitShowScreen(30);
clear_prog_ani();
setPersonPos(199 - CH_HOT_MOV_X, 145 - CH_HOT_MOV_Y, P_CHEWY, P_LEFT);
_G(gameState)._personHide[P_CHEWY] = false;
}
void Room0::eyeSlimeBack() {
AniDetailInfo *adi = _G(det)->getAniDetail(HOSE_DETAIL);
adi->ani_count = 53;
bool endLoopFl = false;
_G(flags).AniUserAction = true;
while (!endLoopFl) {
clear_prog_ani();
_G(spr_info)[0] = _G(det)->plot_detail_sprite(0, 0, FLAP_DETAIL, FLAP_SPRITE, ANI_HIDE);
_G(spr_info)[0]._zLevel = 190;
if ((adi->ani_count > 52) && (adi->ani_count < 59)) {
_G(spr_info)[1] = _G(det)->plot_detail_sprite(0, 0, HOSE_DETAIL, HOSE2, ANI_HIDE);
_G(spr_info)[1]._zLevel = 191;
}
if (adi->ani_count == 61) {
_G(spr_info)[2] = _G(det)->plot_detail_sprite(0, 0, HOSE_DETAIL, HOSE3, ANI_HIDE);
_G(spr_info)[2]._zLevel = 192;
}
_G(spr_info)[3] = _G(det)->plot_detail_sprite(0, 0, HOSE_DETAIL, adi->ani_count, ANI_HIDE);
_G(spr_info)[3]._zLevel = 193;
set_ani_screen();
SHOULD_QUIT_RETURN;
if (adi->delay_count > 0)
--adi->delay_count;
else {
adi->delay_count = adi->delay + _G(gameState).DelaySpeed;
++adi->ani_count;
if (adi->ani_count == 77)
endLoopFl = true;
}
}
_G(flags).AniUserAction = false;
clear_prog_ani();
}
void Room0::checkSlimeEye() {
AniDetailInfo *adi = _G(det)->getAniDetail(CH_THROWS_SLIME);
adi->ani_count = adi->start_ani;
if (adi->load_flag) {
_G(det)->load_taf_seq(adi->start_ani, (adi->end_ani - adi->start_ani) + 1, nullptr);
}
while (adi->ani_count < adi->end_ani && !SHOULD_QUIT) {
clear_prog_ani();
_G(gameState)._personHide[P_CHEWY] = true;
_G(spr_info)[0] = _G(det)->plot_detail_sprite(0, 0, FLAP_DETAIL, FLAP_SPRITE, ANI_HIDE);
_G(spr_info)[0]._zLevel = 190;
_G(spr_info)[1] = _G(det)->plot_detail_sprite(0, 0, HOSE_DETAIL, HOSE2, ANI_HIDE);
_G(spr_info)[1]._zLevel = 191;
_G(spr_info)[2] = _G(det)->plot_detail_sprite(0, 0, HOSE_DETAIL, HEAD2, ANI_HIDE);
_G(spr_info)[2]._zLevel = 192;
_G(spr_info)[3] = _G(det)->plot_detail_sprite(0, 0, CH_THROWS_SLIME, adi->ani_count, ANI_HIDE);
_G(spr_info)[3]._zLevel = 193;
setupScreen(DO_SETUP);
if (adi->delay_count > 0)
--adi->delay_count;
else {
adi->delay_count = adi->delay + _G(gameState).DelaySpeed;
++adi->ani_count;
}
}
if (adi->load_flag) {
_G(det)->del_taf_tbl(adi->start_ani, (adi->end_ani - adi->start_ani) + 1, nullptr);
}
clear_prog_ani();
_G(gameState)._personHide[P_CHEWY] = false;
}
void Room0::feederStart(int16 mode) {
AniDetailInfo *adi = _G(det)->getAniDetail(FEEDER_HOSE);
if (!mode)
adi->ani_count = adi->start_ani;
else
adi->ani_count = 135;
if (!mode) {
trapDoorOpen();
_G(det)->playSound(FLAP_DETAIL, 0);
_G(det)->stopSound(1);
_G(det)->playSound(FEEDER_HOSE, 0);
_G(det)->stopSound(2);
} else {
_G(det)->stopSound(0);
_G(det)->playSound(FLAP_DETAIL, 1);
_G(det)->stopSound(0);
_G(det)->playSound(FEEDER_HOSE, 2);
}
bool endLoopFl = false;
if (_G(gameState).R0SlimeUsed)
_G(flags).AniUserAction = true;
while (!endLoopFl) {
clear_prog_ani();
_G(spr_info)[0] = _G(det)->plot_detail_sprite(0, 0, FLAP_DETAIL, FLAP_SPRITE, ANI_HIDE);
_G(spr_info)[0]._zLevel = 190;
_G(spr_info)[1] = _G(det)->plot_detail_sprite(0, 0, FEEDER_HOSE, adi->ani_count, ANI_HIDE);
_G(spr_info)[1]._zLevel = 191;
if (_G(flags).AniUserAction)
get_user_key(NO_SETUP);
EVENTS_UPDATE;
SHOULD_QUIT_RETURN;
setupScreen(NO_SETUP);
_G(cur)->updateCursor();
if (!mode)
calcPillowClick(1);
_G(out)->copyToScreen();
if (adi->delay_count > 0)
--adi->delay_count;
else {
adi->delay_count = adi->delay + _G(gameState).DelaySpeed;
if (!mode) {
++adi->ani_count;
if (adi->ani_count > 135)
endLoopFl = true;
} else {
--adi->ani_count;
if (adi->ani_count == adi->start_ani - 1)
endLoopFl = true;
}
}
}
clear_prog_ani();
_G(flags).AniUserAction = false;
if (mode) {
_G(det)->startDetail(FLAP_DETAIL, 1, ANI_BACK);
while (_G(det)->get_ani_status(FLAP_DETAIL))
set_ani_screen();
}
}
void Room0::feederExtend() {
for (int16 i = 0; i < 30 && !_G(gameState).R0PillowThrow; i++) {
clear_prog_ani();
_G(spr_info)[0] = _G(det)->plot_detail_sprite(0, 0, FLAP_DETAIL, FLAP_SPRITE, ANI_HIDE);
_G(spr_info)[0]._zLevel = 190;
_G(spr_info)[1] = _G(det)->plot_detail_sprite(0, 0, FEEDER_HOSE, 136, ANI_HIDE);
_G(spr_info)[1]._zLevel = 191;
get_user_key(NO_SETUP);
setupScreen(NO_SETUP);
_G(cur)->updateCursor();
calcPillowClick(1);
_G(out)->copyToScreen();
}
clear_prog_ani();
}
void Room0::calcPillowClick(int16 aniNr) {
if (mouse_on_prog_ani() == aniNr) {
if (_G(minfo).button != 1 && g_events->_kbInfo._keyCode != Common::KEYCODE_RETURN) {
const uint8 roomNum = _G(room)->_roomInfo->_roomNr;
Common::StringArray desc = _G(atds)->getTextArray(roomNum, 173, ATS_DATA);
if (desc.size() > 0) {
_G(fontMgr)->setFont(_G(font8));
int16 x = g_events->_mousePos.x;
int16 y = g_events->_mousePos.y;
calcTxtXy(&x, &y, desc);
for (int16 i = 0; i < (int16)desc.size(); i++)
printShadowed(x, y + i * 10, 255, 300, 0, _G(scr_width), desc[i].c_str());
}
} else if (_G(minfo).button == 1 || g_events->_kbInfo._keyCode == Common::KEYCODE_RETURN) {
if (isCurInventory(PILLOW_INV) && _G(gameState).R0SlimeUsed) {
delInventory(_G(cur)->getInventoryCursor());
_G(gameState).R0PillowThrow = true;
} else if (isCurInventory(SLIME_INV)) {
startAtsWait(173, TXT_MARK_WALK, 14, ATS_DATA);
}
}
}
}
void Room0::checkFeed() {
AniDetailInfo *adi = _G(det)->getAniDetail(FEEDER_HOSE);
adi->ani_count = 136;
int16 i = 152;
bool endLoopFl = false;
if (_G(gameState).R0SlimeUsed)
_G(flags).AniUserAction = true;
while (!endLoopFl) {
clear_prog_ani();
_G(spr_info)[0] = _G(det)->plot_detail_sprite(0, 0, FLAP_DETAIL, FLAP_SPRITE, ANI_HIDE);
_G(spr_info)[0]._zLevel = 190;
if (adi->ani_count == 136) {
_G(gameState)._personHide[P_CHEWY] = true;
if (!_G(gameState).R0SlimeUsed)
_G(det)->stopDetail(16);
}
if (adi->ani_count > 138) {
_G(spr_info)[1] = _G(det)->plot_detail_sprite(0, 0, FEEDER_HOSE, 138, ANI_HIDE);
_G(spr_info)[1]._zLevel = 191;
}
if (adi->ani_count > 141) {
_G(spr_info)[2] = _G(det)->plot_detail_sprite(0, 0, FEEDER_HOSE, i, ANI_HIDE);
_G(spr_info)[2]._zLevel = 192;
}
if (adi->ani_count == 138) {
_G(spr_info)[3] = _G(det)->plot_detail_sprite(0, 0, FEEDER_HOSE, 139, ANI_HIDE);
_G(spr_info)[3]._zLevel = 193;
}
_G(spr_info)[4] = _G(det)->plot_detail_sprite(0, 0, FEEDER_HOSE, adi->ani_count, ANI_HIDE);
_G(spr_info)[4]._zLevel = 194;
set_ani_screen();
SHOULD_QUIT_RETURN;
if (adi->delay_count > 0)
--adi->delay_count;
else {
adi->delay_count = adi->delay + _G(gameState).DelaySpeed;
if (adi->ani_count > 141)
++i;
++adi->ani_count;
if (adi->ani_count == 152)
endLoopFl = true;
}
}
adi->ani_count = 138;
_G(det)->startDetail(CH_TO_FEEDER, 2, ANI_FRONT);
endLoopFl = false;
while (!endLoopFl) {
clear_prog_ani();
_G(spr_info)[0] = _G(det)->plot_detail_sprite(0, 0, FLAP_DETAIL, FLAP_SPRITE, ANI_HIDE);
_G(spr_info)[0]._zLevel = 190;
if (adi->ani_count > 138) {
_G(spr_info)[1] = _G(det)->plot_detail_sprite(0, 0, FEEDER_HOSE, 138, ANI_HIDE);
_G(spr_info)[1]._zLevel = 191;
}
if (adi->ani_count == 138) {
_G(spr_info)[2] = _G(det)->plot_detail_sprite(0, 0, FEEDER_HOSE, 139, ANI_HIDE);
_G(spr_info)[2]._zLevel = 192;
}
_G(spr_info)[3] = _G(det)->plot_detail_sprite(0, 0, FEEDER_HOSE, adi->ani_count, ANI_HIDE);
_G(spr_info)[3]._zLevel = 193;
set_ani_screen();
SHOULD_QUIT_RETURN;
if (!_G(det)->get_ani_status(CH_TO_FEEDER))
endLoopFl = true;
if (adi->delay_count > 0)
--adi->delay_count;
else {
adi->delay_count = adi->delay + _G(gameState).DelaySpeed;
if (adi->ani_count > 135)
--adi->ani_count;
}
}
_G(gameState)._personHide[P_CHEWY] = false;
_G(flags).AniUserAction = false;
clear_prog_ani();
}
void Room0::checkPillow() {
AniDetailInfo *adi = _G(det)->getAniDetail(FEEDER_HOSE);
adi->ani_count = 161;
bool endLoopFl = false;
_G(gameState)._personHide[P_CHEWY] = true;
_G(det)->startDetail(CH_THROWS_PILLOW, 1, ANI_FRONT);
bool mode = false;
while (!endLoopFl) {
clear_prog_ani();
if (!_G(det)->get_ani_status(CH_THROWS_PILLOW)) {
mode = true;
_G(gameState)._personHide[P_CHEWY] = false;
setPersonPos(228 - CH_HOT_MOV_X, 143 - CH_HOT_MOV_Y, P_CHEWY, P_LEFT);
}
_G(spr_info)[0] = _G(det)->plot_detail_sprite(0, 0, FLAP_DETAIL, FLAP_SPRITE, ANI_HIDE);
_G(spr_info)[0]._zLevel = 190;
_G(spr_info)[1] = _G(det)->plot_detail_sprite(0, 0, FEEDER_HOSE, 138, ANI_HIDE);
_G(spr_info)[1]._zLevel = 191;
if (mode) {
_G(spr_info)[2] = _G(det)->plot_detail_sprite(0, 0, FEEDER_HOSE, adi->ani_count, ANI_HIDE);
_G(spr_info)[2]._zLevel = 192;
}
setupScreen(DO_SETUP);
SHOULD_QUIT_RETURN;
if (mode) {
if (adi->delay_count > 0)
--adi->delay_count;
else {
adi->delay_count = adi->delay + _G(gameState).DelaySpeed;
--adi->ani_count;
if (adi->ani_count == 151)
endLoopFl = true;
}
}
}
clear_prog_ani();
}
void Room0::trapDoorOpen() {
_G(det)->startDetail(FLAP_DETAIL, 1, ANI_FRONT);
while (_G(det)->get_ani_status(FLAP_DETAIL)) {
set_ani_screen();
SHOULD_QUIT_RETURN;
}
_G(flags).AniUserAction = true;
for (int16 i = 0; i < 25; i++) {
clear_prog_ani();
_G(spr_info)[0] = _G(det)->plot_detail_sprite(0, 0, FLAP_DETAIL, FLAP_SPRITE, ANI_HIDE);
_G(spr_info)[0]._zLevel = 190;
set_ani_screen();
SHOULD_QUIT_RETURN;
}
_G(flags).AniUserAction = false;
clear_prog_ani();
}
void Room0::trapDoorClose() {
_G(det)->startDetail(FLAP_DETAIL, 1, ANI_BACK);
while (_G(det)->get_ani_status(FLAP_DETAIL)) {
set_ani_screen();
EVENTS_UPDATE;
SHOULD_QUIT_RETURN;
}
}
void Room0::feederAni() {
int16 action = false;
feederStart(0);
if (_G(gameState).R0SlimeUsed) {
feederExtend();
if (_G(gameState).R0PillowThrow) {
checkPillow();
feederStart(1);
autoMove(VERSTECK_POS, P_CHEWY);
setupScreen(DO_SETUP);
_G(out)->cls();
flic_cut(FCUT_000);
register_cutscene(1);
_G(gameState)._personRoomNr[P_CHEWY] = 1;
_G(room)->loadRoom(&_G(room_blk), _G(gameState)._personRoomNr[P_CHEWY], &_G(gameState));
setPersonPos(_G(Rdi)->autoMove[4]._x - CH_HOT_MOV_X,
_G(Rdi)->autoMove[4]._y - CH_HOT_MOV_Y, P_CHEWY, P_RIGHT);
_G(moveState)[P_CHEWY]._delayCount = 0;
setShadowPalette(4, false);
_G(fx_blend) = BLEND1;
setupScreen(DO_SETUP);
} else {
action = true;
}
} else {
action = true;
}
if (action) {
checkFeed();
start_spz(CH_EKEL, 3, ANI_FRONT, P_CHEWY);
start_aad(55);
feederStart(1);
}
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,79 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM0_H
#define CHEWY_ROOMS_ROOM0_H
namespace Chewy {
namespace Rooms {
/**
* Prison Cell - Starting room
*/
class Room0 {
private:
/**
* Do the basic eye animation.
*/
enum EyeMode { EYE_START = 0, EYE_END = 1 };
static void eyeStart(EyeMode mode);
/**
* Pause after the eye arrives
*/
static void eyeWait();
/**
* Do the eye shooting animation
*/
static void eyeShoot();
static void eyeSlimeBack();
static void checkSlimeEye();
static void feederStart(int16 mode);
static void checkFeed();
static void checkPillow();
static void feederExtend();
static void trapDoorOpen();
static void trapDoorClose();
static void calcEyeClick(int16 aniNr);
static void calcPillowClick(int16 aniNr);
public:
static void entry();
static bool timer(int16 timerNr, int16 aniNr);
static void eyeAnim();
static void feederAni();
static bool getPillow();
static bool pullSlime();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,64 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room01.h"
namespace Chewy {
namespace Rooms {
void Room1::gottenCard() {
_G(det)->hideStaticSpr(2);
startSetAILWait(4, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
_G(atds)->delControlBit(7, ATS_COUNT_BIT);
}
void Room1::gedAction(int index) {
#define CABLEBOX 1
if (index == 0 && !_G(gameState).R2ElectrocutedBork) {
bool pickedUpCable = false;
if (_G(cur)->getInventoryCursor() == CABLE_INV) {
pickedUpCable = true;
delInventory(_G(cur)->getInventoryCursor());
} else if (_G(obj)->checkInventory(CABLE_INV)) {
pickedUpCable = true;
_G(obj)->del_obj_use(CABLE_INV);
remove_inventory(CABLE_INV);
}
if (pickedUpCable) {
startAadWait(54);
_G(atds)->set_ats_str(8, TXT_MARK_LOOK, 0, ATS_DATA);
_G(gameState).room_s_obj[CABLEBOX].ZustandFlipFlop = 2;
_G(obj)->calc_rsi_flip_flop(CABLEBOX);
_G(obj)->calc_all_static_detail();
}
}
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,37 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM1_H
#define CHEWY_ROOMS_ROOM1_H
namespace Chewy {
namespace Rooms {
class Room1 {
public:
static void gottenCard();
static void gedAction(int index);
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,94 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room02.h"
namespace Chewy {
namespace Rooms {
#define ANI_5 5
#define GRID_FLASHING 7
static const AniBlock ABLOCK4[2] = {
{ GRID_FLASHING, 3, ANI_FRONT, ANI_WAIT, 0 },
{ GRID_FLASHING, 12, ANI_FRONT, ANI_GO, 0 }
};
void Room2::entry() {
if (!_G(gameState).R2ElectrocutedBork)
_G(det)->startDetail(5, 255, ANI_FRONT);
}
void Room2::jump_out_r1(int16 nr) {
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(nr, 1, ANI_FRONT);
setupScreen(DO_SETUP);
_G(det)->stopDetail(6);
setPersonPos(32, 127, P_CHEWY, P_LEFT);
_G(gameState)._personHide[P_CHEWY] = false;
clear_prog_ani();
switchRoom(1);
setShadowPalette(2, true);
}
void Room2::electrifyWalkway1() {
_G(det)->startDetail(ANI_5, 255, ANI_FRONT);
start_spz(CH_TALK6, 255, false, ANI_FRONT);
startAadWait(49);
_G(det)->stopDetail(ANI_5);
_G(det)->startDetail(GRID_FLASHING, 12, ANI_FRONT);
_G(gameState).R2ElectrocutedBork = true;
delInventory(_G(cur)->getInventoryCursor());
_G(atds)->delControlBit(11, ATS_COUNT_BIT);
_G(atds)->delControlBit(11, ATS_ACTION_BIT);
_G(atds)->delControlBit(19, ATS_COUNT_BIT);
_G(atds)->delControlBit(25, ATS_ACTIVE_BIT);
_G(atds)->setControlBit(8, ATS_COUNT_BIT);
_G(atds)->set_all_ats_str(11, 1, ATS_DATA);
}
void Room2::electrifyWalkway2() {
start_spz(CH_TALK12, 255, false, P_CHEWY);
startAadWait(47);
}
void Room2::gedAction(int index) {
if (index == 0) {
_G(det)->stopDetail(5);
if (!_G(gameState).R2ElectrocutedBork)
_G(det)->startDetail(6, 2, ANI_FRONT);
else
startAniBlock(2, ABLOCK4);
jump_out_r1(9);
}
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,40 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM2_H
#define CHEWY_ROOMS_ROOM2_H
namespace Chewy {
namespace Rooms {
class Room2 {
public:
static void entry();
static void jump_out_r1(int16 nr);
static void electrifyWalkway1();
static void electrifyWalkway2();
static void gedAction(int index);
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,422 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room02.h"
#include "chewy/rooms/room03.h"
#include "chewy/rooms/room04.h"
#include "chewy/sound.h"
namespace Chewy {
namespace Rooms {
#define HEADSHOT 0
#define SONDE_ANI 2
#define SONDE_SHOOT 3
#define SONDE_RET 4
#define SONDE_SMOKE 5
#define SONDE_CLEAR 6
#define SONDE_GRAB 7
#define SONDE_GRAB1 8
#define SONDE_SPR_R 118
#define SONDE_SPR_L 120
#define GRID_FLASHING 7
#define SONDE_OBJ 0
#define SONDE_OBJ1 1
static const MovLine SONDE_MPKT[3] = {
{ { 13, 45, 75 }, 1, 2 },
{ { 237, 52, 160 }, 1, 2 },
{ { 4, 83, 180 }, 0, 2 }
};
static const int16 SONDE_PHASEN[4][2] = {
{ 120, 120 },
{ 118, 118 },
{ 141, 141 },
{ 119, 119 }
};
static const AniBlock ABLOCK0[5] = {
{ 6, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 7, 3, ANI_FRONT, ANI_WAIT, 0 },
};
static const AniBlock ABLOCK1[2] = {
{ 10, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 13, 1, ANI_FRONT, ANI_WAIT, 0 },
};
static const AniBlock ABLOCK2[2] = {
{ 12, 1, ANI_FRONT, ANI_WAIT, 0 },
{ GRID_FLASHING, 1, ANI_FRONT, ANI_GO, 0 }
};
static const AniBlock ABLOCK3[2] = {
{ 4, 2, ANI_FRONT, ANI_GO, 0 },
{ 11, 255, ANI_FRONT, ANI_GO, 0 }
};
static const AniBlock ablock5[3] = {
{ 0, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 8, 9, ANI_FRONT, ANI_GO, 0 },
{ 1, 1, ANI_FRONT, ANI_WAIT, 0 },
};
void Room3::entry() {
probeInit();
}
void Room3::terminal() {
showCur();
_G(auto_obj) = 0;
switch (Room4::comp_probe()) {
case 0:
probeTransfer();
_G(spr_info)[0]._image = _G(room_blk)._detImage[120];
_G(spr_info)[0]._x = 250;
_G(spr_info)[0]._y = 2;
_G(spr_info)[0]._zLevel = 0;
if (!_G(gameState).R2ElectrocutedBork) {
_G(det)->stopDetail(5);
startAniBlock(2, ABLOCK3);
if (_G(gameState).R2FussSchleim) {
_G(gameState).R2FussSchleim = false;
_G(gameState).room_s_obj[SIB_SLIME].ZustandFlipFlop = 1;
}
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(8, 1, ANI_FRONT);
setupScreen(DO_SETUP);
_G(det)->stopDetail(6);
clear_prog_ani();
switchRoom(1);
startAniBlock(2, ABLOCK0);
setPersonPos(92, 131, P_CHEWY, P_LEFT);
_G(gameState)._personHide[P_CHEWY] = false;
} else if (!_G(gameState).R2FussSchleim) {
startAniBlock(2, ABLOCK2);
Room2::jump_out_r1(9);
startAadWait(45);
} else {
_G(gameState)._personHide[P_CHEWY] = true;
startAniBlock(2, ABLOCK1);
_G(gameState)._personRoomNr[P_CHEWY] = 5;
clear_prog_ani();
_G(auto_obj) = 0;
_G(room)->loadRoom(&_G(room_blk), _G(gameState)._personRoomNr[P_CHEWY], &_G(gameState));
_G(fx_blend) = BLEND1;
startAniBlock(3, ablock5);
setPersonPos(91, 107, P_CHEWY, P_LEFT);
_G(gameState)._personHide[P_CHEWY] = false;
}
clear_prog_ani();
break;
case 1:
_G(auto_obj) = 1;
_G(mouseLeftClick) = false;
_G(minfo).button = 0;
stopPerson(P_CHEWY);
start_spz(15, 255, false, P_CHEWY);
startAadWait(51);
setupScreen(DO_SETUP);
break;
case 2:
probeCreak();
break;
default:
break;
}
}
void Room3::probeInit() {
_G(auto_obj) = 1;
_G(mov_phasen)[SONDE_OBJ].AtsText = 24;
_G(mov_phasen)[SONDE_OBJ].Lines = 3;
_G(mov_phasen)[SONDE_OBJ].Repeat = 255;
_G(mov_phasen)[SONDE_OBJ].ZoomFak = 20;
_G(auto_mov_obj)[SONDE_OBJ].Id = AUTO_OBJ0;
_G(auto_mov_vector)[SONDE_OBJ].Delay = _G(gameState).DelaySpeed;
_G(auto_mov_obj)[SONDE_OBJ].Mode = true;
init_auto_obj(SONDE_OBJ, &SONDE_PHASEN[0][0], 3, (const MovLine *)SONDE_MPKT);
}
void Room3::probeCreak() {
MovLine sonde_mpkt1[3] = {
{ { 237, 52, 160 }, 0, 2 },
{ { 13, 45, 75 }, 0, 4 },
{ { 4, 100, 180 }, 1, 2 }
};
MovLine sonde_mpkt2[2] = {
{ { 4, 100, 180 }, 1, 3 },
{ { 13, 45, 75 }, 1, 3 }
};
hideCur();
RoomDetailInfo *rdi = _G(det)->getRoomDetailInfo();
_G(det)->load_taf_seq(162, 17, nullptr);
int16 tmp = _G(zoom_horizont);
_G(zoom_horizont) = 100;
_G(auto_obj) = 1;
_G(mov_phasen)[SONDE_OBJ].Lines = 3;
_G(mov_phasen)[SONDE_OBJ].Repeat = 1;
_G(mov_phasen)[SONDE_OBJ].ZoomFak = 20;
_G(auto_mov_obj)[SONDE_OBJ].Id = AUTO_OBJ0;
_G(auto_mov_vector)[SONDE_OBJ].Delay = _G(gameState).DelaySpeed;
_G(auto_mov_obj)[SONDE_OBJ].Mode = true;
init_auto_obj(SONDE_OBJ, &SONDE_PHASEN[0][0], 3, (MovLine*)sonde_mpkt1);
_G(flags).AniUserAction = false;
while (_G(mov_phasen)[SONDE_OBJ].Repeat != -1) {
set_ani_screen();
SHOULD_QUIT_RETURN;
}
_G(det)->startDetail(SONDE_SHOOT, 1, ANI_FRONT);
int16 ende = 0;
while (!ende) {
clear_prog_ani();
if (rdi->Ainfo[SONDE_SHOOT].ani_count == 170) {
_G(gameState)._personHide[P_CHEWY] = true;
_G(det)->startDetail(HEADSHOT, 1, ANI_FRONT);
}
_G(spr_info)[0] = _G(det)->plot_detail_sprite(0, 0, SONDE_ANI, SONDE_SPR_R, ANI_HIDE);
_G(spr_info)[0]._zLevel = 0;
if (rdi->Ainfo[HEADSHOT].ani_count >= 13 && rdi->Ainfo[HEADSHOT].ani_count <= 21) {
_G(spr_info)[1] = _G(det)->plot_detail_sprite(0, 0, HEADSHOT, 21, ANI_HIDE);
_G(spr_info)[1]._zLevel = 190;
} else if (rdi->Ainfo[HEADSHOT].ani_count > 21 && _G(det)->get_ani_status(SONDE_RET) == 0) {
_G(spr_info)[2] = _G(det)->plot_detail_sprite(0, 0, SONDE_RET, 173, ANI_HIDE);
_G(spr_info)[2]._zLevel = 190;
}
if (rdi->Ainfo[SONDE_SHOOT].ani_count == 178)
_G(det)->startDetail(SONDE_RET, 3, ANI_BACK);
if (rdi->Ainfo[HEADSHOT].ani_count == 28)
ende = 1;
set_ani_screen();
SHOULD_QUIT_RETURN;
}
clear_prog_ani();
_G(det)->startDetail(SONDE_SMOKE, 3, ANI_FRONT);
ende = 0;
while (_G(det)->get_ani_status(SONDE_SMOKE)) {
_G(spr_info)[0] = _G(det)->plot_detail_sprite(0, 0, SONDE_ANI, SONDE_SPR_R, ANI_HIDE);
_G(spr_info)[0]._zLevel = 0;
_G(spr_info)[1] = _G(det)->plot_detail_sprite(0, 0, SONDE_RET, 173, ANI_HIDE);
_G(spr_info)[1]._zLevel = 190;
++ende;
if (ende == 3)
_G(gameState)._personHide[P_CHEWY] = false;
set_ani_screen();
SHOULD_QUIT_RETURN;
}
start_spz(15, 255, false, P_CHEWY);
startAadWait(53);
clear_prog_ani();
_G(det)->startDetail(SONDE_CLEAR, 1, ANI_BACK);
while (_G(det)->get_ani_status(SONDE_CLEAR)) {
SHOULD_QUIT_RETURN;
_G(spr_info)[0] = _G(det)->plot_detail_sprite(0, 0, SONDE_ANI, SONDE_SPR_R, ANI_HIDE);
_G(spr_info)[0]._zLevel = 0;
set_ani_screen();
}
clear_prog_ani();
_G(mov_phasen)[SONDE_OBJ].Lines = 2;
_G(mov_phasen)[SONDE_OBJ].Repeat = 1;
_G(mov_phasen)[SONDE_OBJ].ZoomFak = 28;
init_auto_obj(SONDE_OBJ, &SONDE_PHASEN[0][0], 2, (MovLine*)sonde_mpkt2);
while (_G(mov_phasen)[SONDE_OBJ].Repeat != -1) {
set_ani_screen();
SHOULD_QUIT_RETURN;
}
_G(det)->del_taf_tbl(162, 17, nullptr);
_G(zoom_horizont) = tmp;
probeInit();
showCur();
}
void Room3::probeTransfer() {
static const MovLine SONDE_MPKT1[2] = {
{ { 237, 52, 160 }, 0, 2 },
{ { 144, 100, 180 }, 0, 2 }
};
static const MovLine SONDE_MPKT_[4][2] = {
{ { { 144, 100, 180 }, 0, 2 },
{ { 110, 100, 180 }, 0, 2 } },
{ { { 110, 101, 180 }, 0, 3 },
{ { -55, 50, 180 }, 0, 3 } },
{ { { 310, 20, 180 }, 0, 3 },
{ { -55, 20, 180 }, 0, 3 } },
{ { { 310, 2, 180 }, 0, 3 },
{ { 250, 2, 180 }, 0, 3 } }
};
_G(flags).AniUserAction = false;
hideCur();
_G(det)->getRoomDetailInfo();
int16 tmp = _G(zoom_horizont);
_G(zoom_horizont) = 100;
int16 anistart = false;
_G(auto_obj) = 1;
_G(mov_phasen)[SONDE_OBJ].Lines = 2;
_G(mov_phasen)[SONDE_OBJ].Repeat = 1;
_G(mov_phasen)[SONDE_OBJ].ZoomFak = 20;
_G(auto_mov_obj)[SONDE_OBJ].Id = AUTO_OBJ0;
_G(auto_mov_vector)[SONDE_OBJ].Delay = _G(gameState).DelaySpeed;
_G(auto_mov_obj)[SONDE_OBJ].Mode = true;
init_auto_obj(SONDE_OBJ, &SONDE_PHASEN[0][0], 2, (const MovLine *)SONDE_MPKT1);
_G(atds)->set_all_ats_str(24, ATS_ACTIVE_BIT, ATS_DATA);
while (_G(mov_phasen)[SONDE_OBJ].Repeat != -1) {
set_ani_screen();
SHOULD_QUIT_RETURN;
}
_G(det)->startDetail(SONDE_GRAB, 1, ANI_FRONT);
while (_G(det)->get_ani_status(SONDE_GRAB)) {
clear_prog_ani();
_G(spr_info)[0] = _G(det)->plot_detail_sprite(0, 0, SONDE_GRAB, SONDE_SPR_L, ANI_HIDE);
_G(spr_info)[0]._zLevel = 146;
set_ani_screen();
SHOULD_QUIT_RETURN;
}
clear_prog_ani();
_G(auto_obj) = 2;
int16 spr_nr = 140;
for (int16 i = 0; i < 4 && !SHOULD_QUIT; i++) {
_G(mov_phasen)[SONDE_OBJ].Lines = 2;
_G(mov_phasen)[SONDE_OBJ].Repeat = 1;
_G(mov_phasen)[SONDE_OBJ].ZoomFak = 0;
_G(auto_mov_obj)[SONDE_OBJ].Id = AUTO_OBJ0;
_G(auto_mov_obj)[SONDE_OBJ].Mode = true;
_G(auto_mov_vector)[SONDE_OBJ].Delay = _G(gameState).DelaySpeed;
init_auto_obj(SONDE_OBJ, &SONDE_PHASEN[0][0], 2, SONDE_MPKT_[i]);
_G(mov_phasen)[SONDE_OBJ1].Lines = 2;
_G(mov_phasen)[SONDE_OBJ1].Repeat = 1;
_G(mov_phasen)[SONDE_OBJ1].ZoomFak = 0;
_G(auto_mov_obj)[SONDE_OBJ1].Id = AUTO_OBJ1;
_G(auto_mov_obj)[SONDE_OBJ1].Mode = true;
_G(auto_mov_vector)[SONDE_OBJ1].Delay = _G(gameState).DelaySpeed;
init_auto_obj(SONDE_OBJ1, &SONDE_PHASEN[0][0], 2, SONDE_MPKT_[i]);
_G(mov_phasen)[SONDE_OBJ1].Phase[0][0] = spr_nr;
_G(mov_phasen)[SONDE_OBJ1].Phase[0][1] = spr_nr;
while (_G(mov_phasen)[SONDE_OBJ].Repeat != -1) {
SHOULD_QUIT_RETURN;
if (i == 2 || i == 1) {
if (mouse_auto_obj(SONDE_OBJ, 50, 100)) {
if (_G(minfo).button == 1 || g_events->_kbInfo._keyCode == Common::KEYCODE_RETURN) {
if (isCurInventory(SPINAT_INV)) {
_G(atds)->set_split_win(0, 120, 100);
if (_G(gameState)._personRoomNr[P_CHEWY] == 3)
start_aad(50);
else
start_aad(44);
delInventory(_G(cur)->getInventoryCursor());
_G(gameState).R2FussSchleim = true;
_G(mov_phasen)[SONDE_OBJ1].Phase[0][0] = 142;
_G(mov_phasen)[SONDE_OBJ1].Phase[0][1] = 149;
_G(auto_mov_vector)[SONDE_OBJ1].PhAnz = 8;
anistart = true;
}
}
}
}
set_ani_screen();
if (anistart) {
if (_G(auto_mov_vector)[SONDE_OBJ1].PhNr == 7) {
anistart = false;
spr_nr = 149;
_G(mov_phasen)[SONDE_OBJ1].Phase[0][0] = spr_nr;
_G(mov_phasen)[SONDE_OBJ1].Phase[0][1] = spr_nr;
_G(auto_mov_vector)[SONDE_OBJ1].PhAnz = 1;
_G(auto_mov_vector)[SONDE_OBJ1].PhNr = 0;
}
}
}
switch (i) {
case 0:
showCur();
start_aad(52);
_G(flags).AniUserAction = true;
spr_nr = 141;
_G(gameState)._personHide[P_CHEWY] = true;
_G(det)->load_taf_seq(142, 8, nullptr);
break;
case 1:
g_engine->_sound->waitForSpeechToFinish();
_G(atds)->set_all_ats_str(24, 0, ATS_DATA);
_G(mov_phasen)[0].AtsText = 544;
switchRoom(1);
break;
case 2:
g_engine->_sound->waitForSpeechToFinish();
_G(det)->del_taf_tbl(142, 7, nullptr);
_G(flags).AniUserAction = false;
_G(mov_phasen)[0].AtsText = 24;
switchRoom(2);
break;
default:
break;
}
}
_G(flags).AniUserAction = false;
_G(zoom_horizont) = tmp;
_G(auto_obj) = 0;
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,41 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM3_H
#define CHEWY_ROOMS_ROOM3_H
namespace Chewy {
namespace Rooms {
class Room3 {
private:
static void probeCreak();
static void probeTransfer();
static void probeInit();
public:
static void entry();
static void terminal();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,161 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room04.h"
#include "chewy/sound.h"
namespace Chewy {
namespace Rooms {
#define HAND_NORMAL 68
#define HAND_CLICK 69
#define RED_FRAME 70
#define YELLOW_FRAME 71
int16 Room4::comp_probe() {
static const int16 CUR_POS[3][2] = {
{ 83, 106 },
{ 136, 103 },
{ 188, 101 }
};
// This can't be static because it makes them global objects
const Common::Rect CONSOLE_HOTSPOTS[] = {
{ 80, 140, 120, 175 },
{ 140, 140, 170, 175 },
{ 195, 140, 235, 175 }
};
cur_2_inventory();
_G(gameState)._personHide[P_CHEWY] = true;
switchRoom(4);
bool endLoop = false;
// TODO: The original limited the cursor height to 16 pixels
//WRITE_LE_INT16(_G(room_blk)._detImage[HAND_NORMAL] + 2, 16);
//WRITE_LE_INT16(_G(room_blk)._detImage[HAND_CLICK] + 2, 16);
_G(cur)->setCustomRoomCursor(_G(room_blk)._detImage[HAND_NORMAL]);
byte curCursor = HAND_NORMAL;
int16 curX = 1;
int16 sprNr = RED_FRAME;
_G(cur)->move(160, 160);
// Clear any pending keys
g_events->_kbInfo._keyCode = '\0';
g_events->_kbInfo._scanCode = Common::KEYCODE_INVALID;
_G(minfo).button = 0;
_G(mouseLeftClick) = false;
start_aad(46);
while (!endLoop) {
// WORKAROUND: The original constrained the mouse area.
// We don't do that in ScummVM so the below prevents
// potential crashes caused by the hand sprites being
// unloaded if the cursor is moved up too high
if (g_events->_mousePos.y < 135)
g_events->_mousePos.y = 135;
mouseAction();
if (_G(mouseLeftClick)) {
switch (_G(out)->findHotspot(CONSOLE_HOTSPOTS)) {
case 0:
if (curX > 0)
--curX;
else
curX = 2;
_G(det)->playSound(0, 1);
break;
case 1:
endLoop = true;
sprNr = YELLOW_FRAME;
_G(det)->playSound(0, 0);
break;
case 2:
if (curX < 2)
++curX;
else
curX = 0;
_G(det)->playSound(0, 2);
break;
default:
break;
}
}
_G(spr_info)[0]._image = _G(room_blk)._detImage[sprNr];
_G(spr_info)[0]._zLevel = 0;
_G(spr_info)[0]._x = CUR_POS[curX][0];
_G(spr_info)[0]._y = CUR_POS[curX][1];
if (_G(minfo).button == 1 || g_events->_kbInfo._keyCode == Common::KEYCODE_RETURN) {
if (curCursor != HAND_CLICK) {
_G(cur)->setCustomRoomCursor(_G(room_blk)._detImage[HAND_CLICK]);
_G(cur)->setAnimation(HAND_CLICK, HAND_CLICK, -1);
curCursor = HAND_CLICK;
}
} else {
if (curCursor != HAND_NORMAL) {
_G(cur)->setCustomRoomCursor(_G(room_blk)._detImage[HAND_NORMAL]);
_G(cur)->setAnimation(HAND_NORMAL, HAND_NORMAL, -1);
curCursor = HAND_NORMAL;
}
}
cursorChoice(CUR_USER);
if (g_events->_mousePos.y < 124)
g_events->_mousePos.y = 123;
setupScreen(DO_SETUP);
SHOULD_QUIT_RETURN0;
}
g_events->delay(500);
clear_prog_ani();
_G(gameState)._personHide[P_CHEWY] = false;
_G(menu_item) = CUR_WALK;
cursorChoice(_G(menu_item));
_G(moveState)[P_CHEWY]._delayCount = 0;
_G(mouseLeftClick) = false;
_G(minfo).button = 0;
_G(gameState)._personRoomNr[P_CHEWY] = 3;
_G(room)->loadRoom(&_G(room_blk), 3, &_G(gameState));
setPersonPos(110, 139, P_CHEWY, P_LEFT);
_G(fx_blend) = BLEND1;
_G(atds)->stopAad();
return curX;
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,36 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM4_H
#define CHEWY_ROOMS_ROOM4_H
namespace Chewy {
namespace Rooms {
class Room4 {
public:
static int16 comp_probe();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,58 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/ani_dat.h"
#include "chewy/room.h"
#include "chewy/rooms/room05.h"
namespace Chewy {
namespace Rooms {
void Room5::entry() {
if (_G(gameState).R5Terminal)
_G(det)->startDetail(6, 255, ANI_FRONT);
}
void Room5::pushButton() {
if (_G(gameState).R5Terminal) {
int16 strNr;
if (_G(gameState).R5Door == false) {
startSetAILWait(9, 1, ANI_FRONT);
_G(gameState).room_e_obj[6].Attribut = EXIT_TOP;
strNr = 1;
} else {
startSetAILWait(9, 1, ANI_BACK);
_G(gameState).room_e_obj[6].Attribut = 255;
strNr = 0;
}
_G(atds)->set_all_ats_str(29, strNr, ATS_DATA);
_G(gameState).R5Door ^= 1;
_G(obj)->calc_rsi_flip_flop(SIB_DOOR_R5);
} else {
startAadWait(1);
}
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,37 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM5_H
#define CHEWY_ROOMS_ROOM5_H
namespace Chewy {
namespace Rooms {
class Room5 {
public:
static void entry();
static void pushButton();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,130 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/ani_dat.h"
#include "chewy/rooms/room06.h"
namespace Chewy {
namespace Rooms {
static const int16 ROBO_PHASEN[4][2] = {
{ 86, 86 },
{ 86, 86 },
{ 86, 86 },
{ 86, 86 }
};
static const MovLine ROBO_MPKT[3] = {
{ { 168, 71, 180 }, 1, 1 },
{ { 180, 71, 100 }, 1, 2 },
{ { 60, 210, 110 }, 1, 16 }
};
static const AniBlock ABLOCK6[3] = {
{ 3, 1, ANI_FRONT, ANI_GO, 0 },
{ 13, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 14, 4, ANI_FRONT, ANI_GO, 0 },
};
static const AniBlock ABLOCK7[2] = {
{ 1, 2, ANI_FRONT, ANI_WAIT, 0 },
{ 2, 1, ANI_FRONT, ANI_GO, 0 },
};
void Room6::entry() {
_G(zoom_horizont) = 80;
_G(flags).ZoomMov = true;
_G(zoom_mov_fak) = 2;
if (_G(gameState).R6BolaSchild && _G(gameState).R6RaumBetreten < 2) {
_G(det)->startDetail(7, 255, ANI_FRONT);
_G(atds)->delControlBit(44, ATS_ACTIVE_BIT);
if (!_G(flags).LoadGame)
++_G(gameState).R6RaumBetreten;
if (_G(gameState).R6RaumBetreten == 2) {
hideCur();
_G(det)->stopDetail(7);
init_robo();
wait_auto_obj(0);
_G(gameState).R6BolaOk = true;
_G(obj)->show_sib(SIB_BOLA_BUTTON_R6);
_G(obj)->hide_sib(SIB_BOLA_R6);
_G(atds)->setControlBit(44, ATS_ACTIVE_BIT);
showCur();
}
}
}
void Room6::init_robo() {
#define ROBO_OBJ 0
_G(auto_obj) = 1;
_G(mov_phasen)[ROBO_OBJ].AtsText = 44;
_G(mov_phasen)[ROBO_OBJ].Lines = 3;
_G(mov_phasen)[ROBO_OBJ].Repeat = 1;
_G(mov_phasen)[ROBO_OBJ].ZoomFak = 0;
_G(auto_mov_obj)[ROBO_OBJ].Id = AUTO_OBJ0;
_G(auto_mov_vector)[ROBO_OBJ].Delay = _G(gameState).DelaySpeed;
_G(auto_mov_obj)[ROBO_OBJ].Mode = true;
init_auto_obj(ROBO_OBJ, &ROBO_PHASEN[0][0], 3, (const MovLine *)ROBO_MPKT);
}
void Room6::bola_button() {
if (!_G(gameState).R6BolaBecher) {
_G(det)->hideStaticSpr(0);
startSetAILWait(0, 1, ANI_FRONT);
if (_G(gameState).R6BolaOk) {
_G(gameState).R6BolaBecher = true;
_G(det)->showStaticSpr(0);
startAniBlock(2, ABLOCK7);
_G(obj)->calc_rsi_flip_flop(SIB_BOLA_FLECK_R6);
waitDetail(2);
_G(obj)->calc_rsi_flip_flop(SIB_BOLA_SCHACHT);
_G(atds)->delControlBit(42, ATS_ACTIVE_BIT);
_G(atds)->set_ats_str(41, TXT_MARK_LOOK, 1, ATS_DATA);
_G(obj)->calc_rsi_flip_flop(SIB_BOLA_BUTTON_R6);
_G(obj)->hide_sib(SIB_BOLA_BUTTON_R6);
} else {
_G(gameState)._personHide[P_CHEWY] = true;
startAniBlock(3, ABLOCK6);
while (_G(det)->get_ani_status(3) && !SHOULD_QUIT) {
if (!_G(det)->get_ani_status(14)) {
setPersonPos(220, 89, P_CHEWY, P_LEFT);
_G(gameState)._personHide[P_CHEWY] = false;
}
setupScreen(DO_SETUP);
}
_G(det)->showStaticSpr(0);
++_G(gameState).R6BolaJoke;
int16 diaNr = (_G(gameState).R6BolaJoke < 3) ? 3 : 4;
start_spz(CH_TALK5, 244, false, 0);
startAadWait(diaNr);
}
_G(obj)->calc_rsi_flip_flop(SIB_BOLA_BUTTON_R6);
}
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,40 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM6_H
#define CHEWY_ROOMS_ROOM6_H
namespace Chewy {
namespace Rooms {
class Room6 {
private:
static void init_robo();
public:
static void entry();
static void bola_button();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,187 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/ani_dat.h"
#include "chewy/rooms/room07.h"
namespace Chewy {
namespace Rooms {
static const AniBlock ABLOCK10[4] = {
{ 15, 2, ANI_FRONT, ANI_WAIT, 0 },
{ 16, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 17, 2, ANI_FRONT, ANI_WAIT, 0 },
{ 18, 1, ANI_FRONT, ANI_WAIT, 0 },
};
static const AniBlock ABLOCK25[3] = {
{ 1, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 5, 255, ANI_FRONT, ANI_GO, 0 },
{ 4, 1, ANI_FRONT, ANI_WAIT, 0 },
};
void Room7::entry() {
_G(gameState).ScrollxStep = 2;
}
void Room7::hook(int16 sibNr) {
int16 diaNr;
delInventory(8);
_G(cur)->setInventoryCursor(-1);
_G(menu_item) = CUR_WALK;
cursorChoice(_G(menu_item));
if (_G(gameState).R7RHaken) {
_G(gameState).R7RopeOk = true;
if (sibNr == SIB_LHAKEN_R7) {
_G(obj)->calc_rsi_flip_flop(SIB_LHAKEN_R7);
_G(obj)->calc_rsi_flip_flop(SIB_RHAKEN_R7);
}
_G(atds)->delControlBit(56, ATS_ACTIVE_BIT);
_G(atds)->set_ats_str(55, TXT_MARK_LOOK, 1, ATS_DATA);
diaNr = 9;
} else {
_G(gameState).R7RopeLeft = true;
diaNr = 48;
}
_G(obj)->calc_all_static_detail();
_G(atds)->set_ats_str(54, TXT_MARK_LOOK, 1, ATS_DATA);
startAadWait(diaNr);
}
void Room7::bell() {
hideCur();
if ((!_G(gameState).R7BellCount) ||
(_G(gameState).R7BellCount >= 2 && _G(gameState).R7RopeLeft && !_G(gameState).R7RopeOk)) {
_G(gameState)._personHide[P_CHEWY] = true;
start_aad(5, 0);
startAniBlock(3, ABLOCK25);
_G(det)->showStaticSpr(7);
startSetAILWait(12, 1, ANI_FRONT);
startSetAILWait(11, 1, ANI_FRONT);
_G(det)->hideStaticSpr(7);
_G(det)->stopDetail(5);
setPersonPos(95, 94, P_CHEWY, P_RIGHT);
_G(gameState)._personHide[P_CHEWY] = false;
} else if (_G(gameState).R7BellCount == 1) {
_G(gameState)._personHide[P_CHEWY] = true;
start_aad(6, 0);
startAniBlock(3, ABLOCK25);
_G(det)->showStaticSpr(7);
startSetAILWait(10, 1, ANI_FRONT);
_G(det)->startDetail(13, 1, ANI_FRONT);
setPersonPos(95, 94, P_CHEWY, P_RIGHT);
_G(det)->stopDetail(5);
_G(gameState)._personHide[P_CHEWY] = false;
_G(flags).NoScroll = true;
autoMove(6, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
_G(det)->startDetail(0, 255, ANI_FRONT);
startSetAILWait(13, 1, ANI_FRONT);
flic_cut(FCUT_001);
_G(det)->stopDetail(0);
_G(gameState).scrollx = 0;
_G(gameState).scrolly = 0;
setPersonPos(114, 138, P_CHEWY, -1);
startDetailFrame(19, 1, ANI_FRONT, 6);
startDetailFrame(9, 1, ANI_FRONT, 4);
_G(det)->showStaticSpr(9);
waitDetail(9);
_G(det)->hideStaticSpr(9);
_G(obj)->show_sib(SIB_SCHLOTT_R7);
_G(obj)->calc_rsi_flip_flop(SIB_SCHLOTT_R7);
_G(gameState)._personHide[P_CHEWY] = false;
_G(flags).NoScroll = false;
_G(det)->hideStaticSpr(7);
} else if (!_G(gameState).R7RopeOk) {
_G(gameState)._personHide[P_CHEWY] = true;
start_aad(7, 0);
startAniBlock(3, ABLOCK25);
_G(det)->showStaticSpr(7);
_G(det)->load_taf_seq(192, 74, nullptr);
_G(det)->startDetail(14, 1, ANI_FRONT);
setPersonPos(95, 94, P_CHEWY, P_RIGHT);
_G(det)->stopDetail(5);
_G(gameState)._personHide[P_CHEWY] = false;
_G(flags).NoScroll = true;
autoMove(6, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
_G(det)->startDetail(0, 255, ANI_FRONT);
waitDetail(14);
startAniBlock(4, ABLOCK10);
_G(det)->hideStaticSpr(7);
_G(det)->stopDetail(0);
setPersonPos(181, 130, P_CHEWY, P_RIGHT);
_G(gameState)._personHide[P_CHEWY] = false;
_G(flags).NoScroll = false;
_G(det)->del_taf_tbl(192, 74, nullptr);
} else if (_G(gameState).R7RopeOk && !_G(gameState).R7BorkFlug) {
_G(gameState).R7BorkFlug = true;
_G(gameState)._personHide[P_CHEWY] = true;
start_aad(8, 0);
startSetAILWait(1, 1, ANI_FRONT);
_G(obj)->set_rsi_flip_flop(SIB_TBUTTON2_R7, 255);
_G(obj)->hide_sib(SIB_KLINGEL_R7);
_G(flags).NoPalAfterFlc = false;
register_cutscene(2);
flic_cut(FCUT_002);
setPersonPos(201, 117, P_CHEWY, P_LEFT);
_G(gameState).scrollx = 0;
_G(gameState).scrolly = 0;
_G(gameState)._personHide[P_CHEWY] = false;
}
++_G(gameState).R7BellCount;
showCur();
}
void Room7::gedAction(int index) {
if (index == 0 && _G(gameState).R7BorkFlug && _G(gameState).R7ChewyFlug) {
_G(gameState)._personHide[P_CHEWY] = true;
setPersonPos(180, 124, P_CHEWY, P_LEFT);
startSetAILWait(20, 1, ANI_FRONT);
_G(det)->showStaticSpr(10);
waitShowScreen(10 * _G(gameState).DelaySpeed);
_G(det)->hideStaticSpr(10);
_G(gameState)._personHide[P_CHEWY] = false;
_G(gameState).R7ChewyFlug = false;
}
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,39 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM7_H
#define CHEWY_ROOMS_ROOM7_H
namespace Chewy {
namespace Rooms {
class Room7 {
public:
static void entry();
static void hook(int16 sibNr);
static void bell();
static void gedAction(int index);
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,190 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/ani_dat.h"
#include "chewy/room.h"
#include "chewy/rooms/room08.h"
#include "chewy/dialogs/inventory.h"
namespace Chewy {
namespace Rooms {
static const AniBlock ABLOCK12[2] = {
{ 8, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 9, 2, ANI_FRONT, ANI_GO, 0 },
};
static const AniBlock ABLOCK13[2] = {
{10, 1, ANI_FRONT, ANI_WAIT, 0},
{11, 255, ANI_FRONT, ANI_GO, 0},
};
void Room8::entry() {
_G(gameState).R7ChewyFlug = true;
if (!_G(gameState).R8Folter)
start_folter();
else
stop_folter();
_G(atds)->set_all_ats_str(60, 0, ATS_DATA);
}
void Room8::start_folter() {
_G(atds)->set_all_ats_str(67, 1, ATS_DATA);
_G(det)->stopDetail(19);
_G(det)->startDetail(13, 255, ANI_FRONT);
}
void Room8::stop_folter() {
_G(atds)->set_all_ats_str(67, 0, ATS_DATA);
_G(det)->startDetail(19, 255, ANI_FRONT);
_G(det)->stopDetail(13);
_G(gameState).R8Folter = true;
_G(obj)->hide_sib(SIB_FOLTER_R8);
}
void Room8::hole_kohle() {
if (_G(gameState).R8Kohle) {
startAadWait(604);
} else {
hideCur();
_G(gameState).R8Kohle = true;
autoMove(4, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(12, 1, ANI_FRONT);
cur_2_inventory();
invent_2_slot(KOHLE_HEISS_INV);
_G(gameState)._personHide[P_CHEWY] = false;
showCur();
}
}
void Room8::start_verbrennen() {
hideCur();
if (!_G(cur)->usingInventoryCursor()) {
autoMove(3, P_CHEWY);
start_aad(102, 0);
_G(gameState)._personHide[P_CHEWY] = true;
startAniBlock(2, ABLOCK12);
while (_G(det)->get_ani_status(9)) {
setupScreen(DO_SETUP);
SHOULD_QUIT_RETURN;
if (_G(minfo).button == 1 || g_events->_kbInfo._keyCode == Common::KEYCODE_RETURN) {
if (g_events->_mousePos.x > 146 && g_events->_mousePos.x < 208 &&
g_events->_mousePos.y > 107 && g_events->_mousePos.y < 155)
break;
}
}
_G(det)->stopDetail(9);
setPersonPos(129, 246, P_CHEWY, P_RIGHT);
startAniBlock(2, ABLOCK13);
_G(atds)->set_ats_str(60, TXT_MARK_LOOK, 1, ATS_DATA);
_G(gameState)._personHide[P_CHEWY] = false;
}
showCur();
}
bool Room8::gips_wurf() {
bool actionFl = false;
if (isCurInventory(GIPS_EIMER_INV)) {
hideCur();
actionFl = true;
_G(det)->load_taf_seq(116, 30, nullptr);
autoMove(2, P_CHEWY);
_G(mouseLeftClick) = false;
_G(gameState)._personHide[P_CHEWY] = true;
delInventory(GIPS_EIMER_INV);
startSetAILWait(4, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
startDetailFrame(5, 1, ANI_FRONT, 16);
startSetAILWait(6, 1, ANI_FRONT);
_G(obj)->show_sib(33);
_G(det)->showStaticSpr(14);
waitDetail(5);
_G(gameState).R8GipsWurf = true;
_G(gameState).room_m_obj[MASKE_INV].ZEbene = 0;
_G(obj)->setInventory(MASKE_INV, 181, 251, 8, &_G(room_blk));
_G(det)->del_taf_tbl(116, 30, nullptr);
autoMove(8, P_CHEWY);
_G(flags).AtsAction = false;
_G(menu_item) = CUR_USE;
Dialogs::Inventory::look_screen(INVENTORY_NORMAL, 178);
_G(flags).AtsAction = true;
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(20, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
invent_2_slot(MASKE_INV);
cursorChoice(_G(menu_item));
showCur();
}
return actionFl;
}
void Room8::open_gdoor() {
_G(gameState)._personHide[P_CHEWY] = true;
_G(det)->showStaticSpr(17);
setupScreen(DO_SETUP);
startSetAILWait(7, 1, ANI_FRONT);
_G(det)->showStaticSpr(15);
_G(det)->hideStaticSpr(17);
_G(gameState)._personHide[P_CHEWY] = false;
setPersonPos(204, 274, P_CHEWY, P_LEFT);
_G(atds)->delControlBit(69, ATS_ACTIVE_BIT);
_G(obj)->hide_sib(31);
_G(gameState).R8GTuer = true;
_G(gameState).room_e_obj[15].Attribut = EXIT_BOTTOM;
}
void Room8::talk_nimoy() {
autoMove(9, P_CHEWY);
_G(flags).NoScroll = true;
auto_scroll(0, 120);
if (_G(gameState).R8Folter) {
int16 diaNr = _G(gameState).R8GipsWurf ? 2 : 1;
if (!_G(gameState).R8GTuer)
loadDialogCloseup(diaNr);
else
startAadWait(61);
} else {
startAadWait(603);
loadDialogCloseup(6);
}
_G(flags).NoScroll = false;
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,43 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM8_H
#define CHEWY_ROOMS_ROOM8_H
namespace Chewy {
namespace Rooms {
class Room8 {
public:
static void entry();
static bool gips_wurf();
static void hole_kohle();
static void start_verbrennen();
static void talk_nimoy();
static void start_folter();
static void stop_folter();
static void open_gdoor();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,122 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room09.h"
namespace Chewy {
namespace Rooms {
static const int16 SURIMY_PHASEN[4][2] = {
{ 91, 98 },
{ 91, 98 },
{ 91, 98 },
{ 91, 98 }
};
static const MovLine SURIMY_MPKT[2] = {
{ { 80, 170, 199 }, 2, 6 },
{ { 210, 162, 199 }, 2, 6 }
};
static const MovLine SURIMY_MPKT1[2] = {
{ { 224, 158, 199 }, 2, 6 },
{ { 330, 162, 199 }, 2, 6 }
};
void Room9::entry() {
_G(gameState).R7ChewyFlug = false;
if (!_G(gameState).R9Grid)
setPersonPos(138, 91, P_CHEWY, P_LEFT);
else
_G(det)->showStaticSpr(5);
if (_G(gameState).R9Surimy) {
_G(det)->hideStaticSpr(4);
_G(room)->set_timer_status(7, TIMER_STOP);
}
}
void Room9::gtuer() {
_G(gameState).R9Grid = true;
_G(det)->showStaticSpr(5);
startSetAILWait(6, 1, ANI_FRONT);
setPersonPos(74, 93, P_CHEWY, P_LEFT);
_G(atds)->delControlBit(74, ATS_ACTIVE_BIT);
_G(atds)->delControlBit(75, ATS_ACTIVE_BIT);
_G(atds)->delControlBit(76, ATS_ACTIVE_BIT);
_G(obj)->show_sib(34);
_G(atds)->set_all_ats_str(73, 1, ATS_DATA);
}
void Room9::surimy() {
hideCur();
_G(gameState).R9Surimy = true;
const int16 tmp = _G(moveState)[P_CHEWY].Count;
stopPerson(P_CHEWY);
_G(atds)->setControlBit(75, ATS_ACTIVE_BIT);
_G(det)->hideStaticSpr(4);
_G(room)->set_timer_status(7, TIMER_STOP);
surimy_ani();
start_spz(CH_TALK11, 255, false, P_CHEWY);
startAadWait(56);
_G(gameState).room_e_obj[17].Attribut = EXIT_RIGHT;
_G(moveState)[P_CHEWY].Count = tmp;
get_phase(&_G(moveState)[P_CHEWY], &_G(spieler_mi)[P_CHEWY]);
_G(mov)->continue_auto_go();
showCur();
}
void Room9::surimy_ani() {
_G(det)->load_taf_seq(91, 8, nullptr);
_G(auto_obj) = 1;
_G(mov_phasen)[SURIMY_OBJ].AtsText = 0;
_G(mov_phasen)[SURIMY_OBJ].Lines = 2;
_G(mov_phasen)[SURIMY_OBJ].Repeat = 1;
_G(mov_phasen)[SURIMY_OBJ].ZoomFak = 0;
_G(auto_mov_obj)[SURIMY_OBJ].Id = AUTO_OBJ0;
_G(auto_mov_vector)[SURIMY_OBJ].Delay = _G(gameState).DelaySpeed;
_G(auto_mov_obj)[SURIMY_OBJ].Mode = true;
init_auto_obj(SURIMY_OBJ, &SURIMY_PHASEN[0][0], 2, (const MovLine *)SURIMY_MPKT);
wait_auto_obj(SURIMY_OBJ);
startDetailFrame(0, 1, ANI_FRONT, 15);
_G(det)->startDetail(2, 1, ANI_FRONT);
waitDetail(0);
startSetAILWait(1, 1, ANI_FRONT);
start_spz(CH_EKEL, 2, ANI_FRONT, P_CHEWY);
_G(det)->hideStaticSpr(4);
_G(mov_phasen)[SURIMY_OBJ].Repeat = 1;
init_auto_obj(SURIMY_OBJ, &SURIMY_PHASEN[0][0], _G(mov_phasen)[SURIMY_OBJ].Lines, (const MovLine *)SURIMY_MPKT1);
wait_auto_obj(SURIMY_OBJ);
_G(det)->del_taf_tbl(91, 8, nullptr);
}
void Room9::gedAction(int index) {
if (index == 0 && !_G(gameState).R9Surimy)
surimy();
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,42 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM9_H
#define CHEWY_ROOMS_ROOM9_H
namespace Chewy {
namespace Rooms {
class Room9 {
private:
static void surimy_ani();
public:
static void entry();
static void gedAction(int index);
static void gtuer();
static void surimy();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,68 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room10.h"
namespace Chewy {
namespace Rooms {
void Room10::entry() {
if (!_G(gameState).R10Surimy) {
_G(out)->setPointer(_G(workptr));
_G(out)->map_spr2screen(_G(ablage)[_G(room_blk).AkAblage], _G(gameState).scrollx, _G(gameState).scrolly);
_G(out)->setPointer(nullptr);
_G(fx)->blende1(_G(workptr), _G(pal), 0, 0);
_G(gameState).R10Surimy = true;
_G(fx_blend) = BLEND_NONE;
flic_cut(FCUT_003);
setPersonPos(0, 130, P_CHEWY, P_RIGHT);
autoMove(2, P_CHEWY);
hideCur();
start_spz(CH_TALK6, 255, false, P_CHEWY);
startAadWait(101);
showCur();
} else if (_G(gameState).R10SurimyOk) {
_G(room)->set_timer_status(3, TIMER_STOP);
}
}
void Room10::get_surimy() {
hideCur();
autoMove(4, P_CHEWY);
start_aad(104, 0);
flic_cut(FCUT_005);
_G(gameState).R10SurimyOk = true;
_G(room)->set_timer_status(3, TIMER_STOP);
_G(atds)->set_ats_str(77, TXT_MARK_LOOK, 1, ATS_DATA);
invent_2_slot(18);
delInventory(_G(cur)->getInventoryCursor());
showCur();
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,37 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM10_H
#define CHEWY_ROOMS_ROOM10_H
namespace Chewy {
namespace Rooms {
class Room10 {
public:
static void entry();
static void get_surimy();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,207 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/ani_dat.h"
#include "chewy/room.h"
#include "chewy/rooms/room11.h"
namespace Chewy {
namespace Rooms {
AniBlock ABLOCK17[2] = {
{ 8, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 9, 255, ANI_FRONT, ANI_GO, 0 },
};
AniBlock ABLOCK18[2] = {
{ 7, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 7, 1, ANI_BACK, ANI_WAIT, 0 },
};
void Room11::entry() {
_G(zoom_horizont) = 80;
_G(flags).ZoomMov = true;
_G(zoom_mov_fak) = 2;
if (_G(gameState).R12ChewyBork) {
if (!_G(gameState).R11DoorRightB) {
_G(obj)->calc_rsi_flip_flop(SIB_TBUTTON2_R11);
_G(gameState).R11DoorRightB = exit_flip_flop(5, 22, -1, 98, -1, -1,
EXIT_TOP, -1, (int16)_G(gameState).R11DoorRightB);
_G(obj)->calc_all_static_detail();
}
_G(obj)->hide_sib(SIB_TBUTTON1_R11);
_G(obj)->hide_sib(SIB_SCHLITZ_R11);
_G(obj)->hide_sib(SIB_TBUTTON2_R11);
_G(obj)->hide_sib(SIB_TBUTTON3_R11);
_G(gameState).room_e_obj[20].Attribut = 255;
_G(gameState).room_e_obj[21].Attribut = 255;
_G(atds)->delControlBit(121, ATS_ACTIVE_BIT);
if (!_G(flags).LoadGame) {
startAniBlock(2, ABLOCK17);
autoMove(8, P_CHEWY);
startAadWait(31);
_G(det)->stopDetail(9);
}
_G(det)->showStaticSpr(8);
if (!_G(flags).LoadGame)
autoMove(6, P_CHEWY);
_G(timer_nr)[0] = _G(room)->set_timer(255, 10);
}
}
bool Room11::timer(int16 t_nr, int16 ani_nr) {
if (t_nr == _G(timer_nr)[0])
bork_zwinkert();
return false;
}
void Room11::gedAction(int index) {
switch (index) {
case 0:
chewy_bo_use();
break;
default:
break;
}
}
void Room11::bork_zwinkert() {
if (!_G(flags).AutoAniPlay) {
_G(flags).AutoAniPlay = true;
_G(det)->hideStaticSpr(8);
startAniBlock(2, ABLOCK18);
_G(uhr)->resetTimer(_G(timer_nr)[0], 0);
_G(det)->showStaticSpr(8);
_G(flags).AutoAniPlay = false;
}
}
void Room11::talk_debug() {
if (_G(gameState).R12ChewyBork) {
_G(flags).AutoAniPlay = true;
autoMove(8, P_CHEWY);
startDialogCloseupWait(5);
_G(menu_item) = CUR_WALK;
cursorChoice(CUR_WALK);
_G(flags).AutoAniPlay = false;
}
}
void Room11::chewy_bo_use() {
if (_G(gameState).R12ChewyBork) {
hideCur();
_G(flags).AutoAniPlay = true;
stopPerson(P_CHEWY);
_G(det)->hideStaticSpr(8);
startAniBlock(2, ABLOCK17);
startAadWait(32);
_G(det)->stopDetail(9);
_G(det)->showStaticSpr(8);
autoMove(6, P_CHEWY);
_G(flags).AutoAniPlay = false;
showCur();
}
}
int16 Room11::scanner() {
int16 actionFl = false;
if (!_G(gameState).R12ChewyBork) {
autoMove(7, P_CHEWY);
if (!_G(gameState).R11CardOk) {
actionFl = true;
startAadWait(13);
} else if (isCurInventory(BORK_INV)) {
hideCur();
setupScreen(DO_SETUP);
actionFl = true;
start_aad(105, 0);
flic_cut(FCUT_010);
register_cutscene(4);
_G(gameState).R11TerminalOk = true;
cur_2_inventory();
_G(menu_item) = CUR_TALK;
cursorChoice(_G(menu_item));
startAadWait(12);
showCur();
loadDialogCloseup(3);
} else if (!_G(cur)->usingInventoryCursor()) {
if (!_G(gameState).R11TerminalOk) {
actionFl = true;
flic_cut(FCUT_009);
startAadWait(20);
} else {
actionFl = true;
startAadWait(12);
_G(menu_item) = CUR_TALK;
cursorChoice(_G(menu_item));
loadDialogCloseup(3);
}
}
}
return actionFl;
}
void Room11::get_card() {
if (_G(gameState).R11CardOk) {
cur_2_inventory();
_G(gameState).R11CardOk = false;
_G(obj)->addInventory(_G(gameState).R11IdCardNr, &_G(room_blk));
_G(cur)->setInventoryCursor(_G(gameState).R11IdCardNr);
_G(det)->stopDetail(0);
_G(atds)->set_ats_str(83, TXT_MARK_LOOK, 0, ATS_DATA);
_G(atds)->set_ats_str(84, TXT_MARK_LOOK, 0, ATS_DATA);
}
}
void Room11::put_card() {
if (isCurInventory(RED_CARD_INV) || isCurInventory(YEL_CARD_INV)) {
_G(gameState).R11IdCardNr = _G(cur)->getInventoryCursor();
delInventory(_G(gameState).R11IdCardNr);
_G(det)->startDetail(0, 255, ANI_FRONT);
_G(atds)->set_ats_str(83, TXT_MARK_LOOK, 1, ATS_DATA);
_G(atds)->set_ats_str(84, TXT_MARK_LOOK, 1, ATS_DATA);
_G(gameState).R11CardOk = true;
if (!_G(gameState).R11TerminalOk)
startAadWait(16);
}
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,47 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM11_H
#define CHEWY_ROOMS_ROOM11_H
namespace Chewy {
namespace Rooms {
class Room11 {
private:
static void bork_zwinkert();
static void chewy_bo_use();
public:
static void entry();
static bool timer(int16 t_nr, int16 ani_nr);
static void gedAction(int index);
static void get_card();
static void put_card();
static int16 scanner();
static void talk_debug();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,286 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/ani_dat.h"
#include "chewy/room.h"
#include "chewy/rooms/room12.h"
namespace Chewy {
namespace Rooms {
#define R12_BORK_OBJ 0
static const int16 R12_BORK_PHASEN[4][2] = {
{ 74, 79 },
{ 80, 85 },
{ 62, 67 },
{ 68, 73 }
};
static const MovLine R12_BORK_MPKT[5] = {
{ { 207, 220, 199 }, 2, 6 },
{ { 207, 145, 199 }, 2, 6 },
{ { 30, 145, 199 }, 0, 6 },
{ { 207, 145, 199 }, 1, 6 },
{ { 207, 220, 199 }, 3, 6 }
};
static const MovLine R12_BORK_MPKT1[2] = {
{ { 207, 220, 199 }, 0, 6 },
{ { 170, 145, 199 }, 0, 6 }
};
static const MovLine R12_BORK_MPKT2[3] = {
{ { 170, 145, 199 }, 1, 8 },
{ { 180, 145, 120 }, 1, 8 },
{ { 300, 80, 120 }, 1, 8 }
};
static const AniBlock ABLOCK16[2] = {
{ 0, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 1, 1, ANI_FRONT, ANI_WAIT, 0 },
};
void Room12::entry() {
_G(zoom_horizont) = 150;
_G(timer_nr)[1] = _G(room)->set_timer(254, 20);
if (!_G(gameState).R12Betreten) {
_G(gameState).R12Betreten = true;
hideCur();
for (int16 i = 7; i < 10; i++)
_G(det)->showStaticSpr(i);
_G(flags).NoScroll = true;
auto_scroll(60, 0);
flic_cut(FCUT_015);
_G(flags).NoScroll = false;
for (int16 i = 7; i < 10; i++)
_G(det)->hideStaticSpr(i);
_G(obj)->show_sib(SIB_TALISMAN_R12);
_G(obj)->calc_rsi_flip_flop(SIB_TALISMAN_R12);
_G(obj)->calc_all_static_detail();
autoMove(5, P_CHEWY);
start_spz(CH_TALK12, 255, false, 0);
startAadWait(109);
showCur();
} else if (_G(gameState).R12Talisman && !_G(gameState).R12BorkInRohr)
_G(timer_nr)[0] = _G(room)->set_timer(255, 20);
else if (_G(gameState).R12BorkInRohr && !_G(gameState).R12RaumOk)
_G(det)->showStaticSpr(12);
}
bool Room12::timer(int16 t_nr, int16 ani_nr) {
if (t_nr == _G(timer_nr)[0]) {
if (!is_chewy_busy())
init_bork();
} else if (t_nr == _G(timer_nr)[1] && _G(gameState).R12TransOn) {
_G(gameState).R12TransOn = false;
startAadWait(30);
}
return false;
}
void Room12::init_bork() {
if (!auto_obj_status(R12_BORK_OBJ) && !_G(gameState).R12BorkTalk) {
if (!_G(auto_obj))
_G(det)->load_taf_seq(62, 24, nullptr);
if (!_G(flags).AutoAniPlay && !_G(flags).ChAutoMov) {
_G(auto_obj) = 1;
_G(mov_phasen)[R12_BORK_OBJ].AtsText = 120;
_G(mov_phasen)[R12_BORK_OBJ].Lines = 5;
_G(mov_phasen)[R12_BORK_OBJ].Repeat = 1;
_G(mov_phasen)[R12_BORK_OBJ].ZoomFak = (int16)_G(room)->_roomInfo->_zoomFactor + 20;
_G(auto_mov_obj)[R12_BORK_OBJ].Id = AUTO_OBJ0;
_G(auto_mov_vector)[R12_BORK_OBJ].Delay = _G(gameState).DelaySpeed;
_G(auto_mov_obj)[R12_BORK_OBJ].Mode = true;
init_auto_obj(R12_BORK_OBJ, &R12_BORK_PHASEN[0][0], 5, (const MovLine *)R12_BORK_MPKT);
if (!_G(gameState).R12TalismanOk) {
hideCur();
_G(auto_mov_vector)[R12_BORK_OBJ]._delayCount = 1000;
autoMove(5, P_CHEWY);
_G(auto_mov_vector)[R12_BORK_OBJ]._delayCount = 0;
if (_G(gameState).R12BorkCount < 3) {
++_G(gameState).R12BorkCount;
_G(uhr)->resetTimer(_G(timer_nr)[0], 0);
waitShowScreen(10);
start_spz(CH_TALK3, 255, ANI_FRONT, P_CHEWY);
startAadWait(14);
}
wait_auto_obj(R12_BORK_OBJ);
showCur();
} else {
bork_ok();
}
}
_G(uhr)->resetTimer(_G(timer_nr)[0], 0);
}
}
void Room12::talk_bork() {
if (!_G(gameState).R12TalismanOk) {
startAadWait(28);
}
}
void Room12::bork_ok() {
hideCur();
_G(flags).MouseLeft = true;
_G(auto_mov_vector)[R12_BORK_OBJ]._delayCount = 1000;
autoMove(5, P_CHEWY);
_G(auto_mov_vector)[R12_BORK_OBJ]._delayCount = 0;
_G(gameState).R12BorkTalk = true;
_G(mov_phasen)[R12_BORK_OBJ].Repeat = 1;
_G(mov_phasen)[R12_BORK_OBJ].Lines = 2;
init_auto_obj(R12_BORK_OBJ, &R12_BORK_PHASEN[0][0], 2, (const MovLine *)R12_BORK_MPKT1);
wait_auto_obj(R12_BORK_OBJ);
_G(gameState).R12BorkInRohr = true;
_G(det)->setDetailPos(3, 170, 145);
_G(det)->startDetail(3, 255, ANI_FRONT);
startAadWait(57);
_G(det)->stopDetail(3);
_G(mov_phasen)[R12_BORK_OBJ].Repeat = 1;
_G(mov_phasen)[R12_BORK_OBJ].Lines = 3;
init_auto_obj(R12_BORK_OBJ, &R12_BORK_PHASEN[0][0], 3, (const MovLine *)R12_BORK_MPKT2);
wait_auto_obj(R12_BORK_OBJ);
_G(det)->hideStaticSpr(10);
startSetAILWait(4, 1, ANI_FRONT);
_G(talk_hide_static) = -1;
_G(det)->showStaticSpr(12);
_G(atds)->set_ats_str(118, TXT_MARK_LOOK, 2, ATS_DATA);
_G(obj)->calc_rsi_flip_flop(SIB_ROEHRE_R12);
_G(flags).MouseLeft = false;
showCur();
}
int16 Room12::use_terminal() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursor()) {
action_flag = true;
if (!_G(gameState).R12ChewyBork) {
autoMove(6, P_CHEWY);
startAadWait(110);
if (_G(gameState).R12BorkInRohr && !_G(gameState).R12RaumOk) {
start_spz(CH_TALK5, 255, false, P_CHEWY);
startAadWait(112);
_G(flags).NoScroll = true;
auto_scroll(46, 0);
flic_cut(FCUT_016);
register_cutscene(5);
load_chewy_taf(CHEWY_BORK);
_G(flags).NoScroll = false;
_G(atds)->set_all_ats_str(118, 0, ATS_DATA);
_G(det)->hideStaticSpr(12);
_G(menu_item) = CUR_WALK;
cursorChoice(_G(menu_item));
setPersonPos(108, 90, P_CHEWY, -1);
_G(gameState).R12ChewyBork = true;
_G(gameState).R12RaumOk = true;
autoMove(4, P_CHEWY);
start_spz(68, 255, false, P_CHEWY);
startAadWait(113);
} else if (_G(gameState).R12TalismanOk && !_G(gameState).R12RaumOk) {
use_linke_rohr();
} else {
_G(gameState).R12TransOn = true;
_G(uhr)->resetTimer(_G(timer_nr)[1], 0);
}
} else {
start_aad(114, 0);
}
}
return action_flag;
}
void Room12::use_linke_rohr() {
_G(gameState).R12TalismanOk = false;
_G(gameState).R12ChainLeft = true;
_G(uhr)->disableTimer();
_G(obj)->calc_rsi_flip_flop(SIB_L_ROEHRE_R12);
_G(obj)->calc_rsi_flip_flop(SIB_ROEHRE_R12);
_G(obj)->calc_all_static_detail();
_G(atds)->set_ats_str(118, TXT_MARK_LOOK, 0, ATS_DATA);
_G(atds)->set_ats_str(117, TXT_MARK_LOOK, 1, ATS_DATA);
start_aad(111, 0);
}
int16 Room12::chewy_trans() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursor() && _G(gameState).R12TransOn) {
action_flag = true;
_G(flags).AutoAniPlay = true;
autoMove(9, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startAniBlock(2, ABLOCK16);
setPersonPos(108, 82, P_CHEWY, P_RIGHT);
_G(gameState)._personHide[P_CHEWY] = false;
_G(gameState).R12TransOn = false;
_G(flags).AutoAniPlay = false;
}
return action_flag;
}
int16 Room12::useTransformerTube() {
bool result = false;
if (!_G(cur)->usingInventoryCursor()) {
result = true;
if (_G(gameState).R12ChainLeft) {
_G(gameState).R12ChainLeft = false;
_G(uhr)->enableTimer();
_G(atds)->set_ats_str(117, TXT_MARK_LOOK, 0, ATS_DATA);
} else {
autoMove(7, P_CHEWY);
startAadWait(29);
}
}
return result;
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,47 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM12_H
#define CHEWY_ROOMS_ROOM12_H
namespace Chewy {
namespace Rooms {
class Room12 {
private:
static void bork_ok();
static void init_bork();
public:
static void entry();
static bool timer(int16 t_nr, int16 ani_nr);
static void use_linke_rohr();
static int16 chewy_trans();
static int16 useTransformerTube();
static int16 use_terminal();
static void talk_bork();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,249 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/ani_dat.h"
#include "chewy/room.h"
#include "chewy/rooms/room13.h"
namespace Chewy {
namespace Rooms {
#define R13_BORK_OBJ 0
static const int16 R13_BORK_PHASEN[4][2] = {
{ 92, 97 },
{ 86, 91 },
{ 86, 91 },
{ 68, 73 }
};
static const MovLine R13_BORK_MPKT[3] = {
{ { 168, 140, 162 }, 0, 6 },
{ { 50, 140, 162 }, 0, 6 },
{ { 50, 107, 130 }, 2, 6 }
};
void Room13::entry() {
if (!_G(gameState).R12ChewyBork && !_G(gameState).R13BorkOk) {
_G(out)->cls();
flic_cut(FCUT_012);
setPersonPos(106, 65, P_CHEWY, P_RIGHT);
switchRoom(11);
start_spz(CH_TALK12, 255, false, P_CHEWY);
startAadWait(27);
} else {
if (_G(gameState).R13MonitorStatus)
_G(det)->showStaticSpr(11 - _G(gameState).R13MonitorStatus);
if (!_G(gameState).R13BorkOk) {
_G(det)->showStaticSpr(12);
_G(obj)->hide_sib(SIB_BANDBUTTON_R13);
_G(gameState).R13Bandlauf = true;
_G(atds)->set_ats_str(94, TXT_MARK_LOOK, _G(gameState).R13Bandlauf, ATS_DATA); // conveyor belt
_G(atds)->set_ats_str(97, TXT_MARK_LOOK, _G(gameState).R13Bandlauf, ATS_DATA); // lever
_G(atds)->set_ats_str(93, TXT_MARK_LOOK, _G(gameState).R13Bandlauf, ATS_DATA); // monitor
} else {
_G(atds)->setControlBit(122, ATS_ACTIVE_BIT);
_G(atds)->delControlBit(92, ATS_ACTIVE_BIT);
_G(obj)->show_sib(SIB_BANDBUTTON_R13);
}
if (_G(gameState).R13Bandlauf) {
for (int i = 0; i < 5; ++i)
_G(det)->startDetail(i, 255, false);
}
if (!_G(flags).LoadGame && _G(gameState).R13Band) {
_G(gameState).room_e_obj[25].Attribut = EXIT_TOP;
_G(atds)->setControlBit(100, ATS_ACTIVE_BIT);
_G(gameState).R13Band = false;
}
if (_G(gameState).R21GarbageGrid)
_G(det)->hideStaticSpr(6);
}
}
void Room13::xit() {
_G(gameState).room_e_obj[25].Attribut = EXIT_TOP;
_G(atds)->setControlBit(100, ATS_ACTIVE_BIT);
_G(gameState).R13Band = false;
}
void Room13::gedAction(int index) {
if (index == 2 && _G(gameState).R12ChewyBork) {
stopPerson(P_CHEWY);
talk_bork();
}
}
void Room13::talk_bork() {
if (!_G(gameState).R13BorkOk) {
_G(gameState).R13BorkOk = true;
_G(gameState).R12ChewyBork = false;
_G(det)->showStaticSpr(13);
_G(det)->setDetailPos(10, _G(moveState)[P_CHEWY].Xypos[0], _G(moveState)[P_CHEWY].Xypos[1]);
_G(det)->setStaticPos(12, _G(moveState)[P_CHEWY].Xypos[0], _G(moveState)[P_CHEWY].Xypos[1], false, true);
_G(gameState)._personHide[P_CHEWY] = true;
startAadWait(33);
_G(det)->stopDetail(9);
_G(det)->load_taf_seq(86, 12, nullptr);
_G(gameState)._personHide[P_CHEWY] = false;
_G(det)->hideStaticSpr(12);
_G(auto_obj) = 1;
_G(mov_phasen)[R13_BORK_OBJ].AtsText = 122;
_G(mov_phasen)[R13_BORK_OBJ].Lines = 3;
_G(mov_phasen)[R13_BORK_OBJ].Repeat = 1;
_G(mov_phasen)[R13_BORK_OBJ].ZoomFak = 0;
_G(auto_mov_obj)[R13_BORK_OBJ].Id = AUTO_OBJ0;
_G(auto_mov_vector)[R13_BORK_OBJ].Delay = _G(gameState).DelaySpeed;
_G(auto_mov_obj)[R13_BORK_OBJ].Mode = true;
init_auto_obj(R13_BORK_OBJ, &R13_BORK_PHASEN[0][0], 3, (const MovLine *)R13_BORK_MPKT);
autoMove(9, P_CHEWY);
wait_auto_obj(R13_BORK_OBJ);
autoMove(11, P_CHEWY);
_G(flags).NoScroll = true;
auto_scroll(41, 0);
start_spz(68, 255, false, P_CHEWY);
startAadWait(248);
flic_cut(FCUT_013);
load_chewy_taf(CHEWY_NORMAL);
_G(auto_obj) = 0;
_G(flags).NoScroll = false;
_G(atds)->setControlBit(122, ATS_ACTIVE_BIT);
_G(atds)->delControlBit(92, ATS_ACTIVE_BIT);
_G(obj)->show_sib(SIB_BANDBUTTON_R13);
setPersonPos(153, 138, P_CHEWY, P_LEFT);
startAadWait(34);
startAadWait(249);
_G(obj)->show_sib(SIB_TBUTTON1_R11);
_G(obj)->show_sib(SIB_SCHLITZ_R11);
_G(obj)->show_sib(SIB_TBUTTON2_R11);
_G(obj)->show_sib(SIB_TBUTTON3_R11);
if (_G(gameState).R6DoorRightB)
_G(gameState).room_e_obj[20].Attribut = EXIT_LEFT;
_G(gameState).room_e_obj[21].Attribut = EXIT_TOP;
}
}
void Room13::jmp_band() {
if (!_G(gameState).R13Band && !_G(gameState).R12ChewyBork) {
if (!_G(gameState).R13Bandlauf) {
_G(obj)->hide_sib(SIB_BANDBUTTON_R13);
_G(gameState).room_e_obj[25].Attribut = 255;
_G(atds)->delControlBit(100, ATS_ACTIVE_BIT);
_G(gameState).R13Band = true;
autoMove(3, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(8, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
setPersonPos(292, 98, P_CHEWY, P_RIGHT);
} else {
_G(gameState).R13Surf = true;
_G(mouseLeftClick) = false;
autoMove(12, P_CHEWY);
startAadWait(117);
_G(flags).NoScroll = true;
auto_scroll(76, 0);
flic_cut(FCUT_014);
_G(flags).NoScroll = false;
setPersonPos(195, 226, P_CHEWY, P_LEFT);
_G(gameState).R13Bandlauf = false;
_G(atds)->set_ats_str(94, TXT_MARK_LOOK, _G(gameState).R13Bandlauf, ATS_DATA); // conveyor belt
_G(atds)->set_ats_str(97, TXT_MARK_LOOK, _G(gameState).R13Bandlauf, ATS_DATA); // lever
_G(atds)->set_ats_str(93, TXT_MARK_LOOK, _G(gameState).R13Bandlauf, ATS_DATA); // monitor
_G(obj)->calc_rsi_flip_flop(SIB_BANDBUTTON_R13);
_G(obj)->hide_sib(SIB_BANDBUTTON_R13);
switchRoom(14);
flic_cut(FCUT_017);
register_cutscene(6);
_G(gameState).scrollx = 92;
_G(gameState).scrolly = 120;
_G(gameState)._personHide[P_CHEWY] = true;
waitShowScreen(20);
_G(gameState)._personHide[P_CHEWY] = false;
}
}
}
void Room13::jmp_floor() {
if (_G(gameState).R13Band) {
if (!_G(gameState).R13Surf)
_G(obj)->show_sib(SIB_BANDBUTTON_R13);
_G(gameState).room_e_obj[25].Attribut = EXIT_TOP;
_G(atds)->setControlBit(100, ATS_ACTIVE_BIT);
_G(gameState).R13Band = false;
autoMove(5, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(7, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
setPersonPos(176, 138, P_CHEWY, P_LEFT);
}
}
int16 Room13::monitor_button() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursor()) {
if (_G(gameState).R13Band) {
action_flag = true;
startAadWait(620);
} else if (!_G(gameState).R12ChewyBork) {
action_flag = true;
autoMove(8, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(6, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
if (_G(gameState).R13MonitorStatus)
_G(det)->hideStaticSpr(11 - _G(gameState).R13MonitorStatus);
++_G(gameState).R13MonitorStatus;
if (_G(gameState).R13MonitorStatus > 4)
_G(gameState).R13MonitorStatus = 0;
else
_G(det)->showStaticSpr(11 - _G(gameState).R13MonitorStatus);
_G(atds)->set_ats_str(96, TXT_MARK_LOOK, _G(gameState).R13MonitorStatus, ATS_DATA);
}
}
return action_flag;
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,43 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM13_H
#define CHEWY_ROOMS_ROOM13_H
namespace Chewy {
namespace Rooms {
class Room13 {
public:
static void entry();
static void xit();
static void gedAction(int index);
static int16 monitor_button();
static void jmp_band();
static void jmp_floor();
static void talk_bork();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,198 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room14.h"
#include "chewy/rooms/room23.h"
namespace Chewy {
namespace Rooms {
void Room14::entry() {
_G(gameState).R23GliderExit = 14;
_G(zoom_horizont) = 310;
_G(gameState).ScrollxStep = 2;
if (!_G(gameState).R14Feuer)
_G(obj)->hide_sib(46);
if (!_G(flags).LoadGame) {
if (_G(gameState).R14GleiterAuf) {
setPersonPos(381, 264, P_CHEWY, P_LEFT);
_G(det)->showStaticSpr(6);
_G(gameState).scrollx = 160;
_G(gameState).scrolly = 120;
} else {
_G(gameState).scrollx = 92;
_G(gameState).scrolly = 17;
}
}
}
bool Room14::timer(int16 t_nr, int16 ani_nr) {
if (ani_nr)
eremit_feuer(t_nr, ani_nr);
return false;
}
void Room14::eremit_feuer(int16 t_nr, int16 ani_nr) {
if (!_G(flags).AutoAniPlay && !_G(gameState).R14Feuer) {
_G(flags).AutoAniPlay = true;
_G(det)->hideStaticSpr(9);
startSetAILWait(_G(room)->_roomTimer._objNr[ani_nr], 1, ANI_FRONT);
_G(uhr)->resetTimer(t_nr, 0);
_G(det)->showStaticSpr(9);
_G(det)->startDetail(7, 1, ANI_FRONT);
_G(flags).AutoAniPlay = false;
}
}
int16 Room14::use_schrott() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursor()) {
autoMove(3, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(12, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
if (!_G(gameState).R14Waffe) {
action_flag = true;
_G(gameState).R14Waffe = true;
startAadWait(21);
invent_2_slot(BWAFFE_INV);
}
}
return action_flag;
}
int16 Room14::use_gleiter() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursor()) {
action_flag = true;
autoMove(4, P_CHEWY);
if (!_G(gameState).R14GleiterAuf) {
_G(gameState).R14GleiterAuf = true;
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(10, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
_G(det)->showStaticSpr(6);
_G(atds)->set_ats_str(107, TXT_MARK_LOOK, 1, ATS_DATA);
} else {
_G(gameState).R23GliderExit = 14;
Room23::cockpit();
}
}
return action_flag;
}
void Room14::talk_eremit() {
if (!_G(gameState).R14Feuer) {
autoMove(6, P_CHEWY);
_G(flags).AutoAniPlay = true;
if (_G(gameState).R14Translator) {
loadDialogCloseup(0);
_G(obj)->show_sib(46);
} else {
hideCur();
startAadWait(24);
showCur();
_G(flags).AutoAniPlay = false;
}
}
}
int16 Room14::use_schleim() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursor()) {
autoMove(2, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(11, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
if (!_G(gameState).R14Sicherung) {
action_flag = true;
_G(gameState).R14Sicherung = true;
startAadWait(22);
invent_2_slot(SICHERUNG_INV);
}
}
return action_flag;
}
void Room14::feuer() {
int16 waffe = false;
int16 tmp = _G(cur)->getInventoryCursor();
_G(gameState).R14Feuer = true;
_G(flags).AutoAniPlay = true;
hideCur();
if (isCurInventory(BWAFFE_INV)) {
autoMove(5, P_CHEWY);
waffe = true;
_G(gameState)._personHide[P_CHEWY] = true;
startDetailFrame(8, 1, ANI_FRONT, 11);
startSetAILWait(9, 1, ANI_FRONT);
waitDetail(8);
_G(gameState)._personHide[P_CHEWY] = false;
} else {
autoMove(7, P_CHEWY);
_G(det)->hideStaticSpr(9);
startDetailFrame(2, 1, ANI_FRONT, 9);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(13, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
waitDetail(2);
startSetAILWait(5, 1, ANI_FRONT);
_G(det)->showStaticSpr(9);
}
delInventory(tmp);
_G(det)->startDetail(6, 255, ANI_FRONT);
waitShowScreen(40);
if (waffe)
autoMove(7, P_CHEWY);
startAadWait(26);
_G(det)->hideStaticSpr(9);
startSetAILWait(3, 1, ANI_FRONT);
_G(det)->showStaticSpr(9);
invent_2_slot(FLUXO_INV);
_G(atds)->set_ats_str(105, TXT_MARK_LOOK, 1, ATS_DATA);
_G(gameState).R14FluxoFlex = true;
_G(flags).AutoAniPlay = false;
showCur();
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,46 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM14_H
#define CHEWY_ROOMS_ROOM14_H
namespace Chewy {
namespace Rooms {
class Room14 {
private:
static void eremit_feuer(int16 t_nr, int16 ani_nr);
public:
static void entry();
static bool timer(int16 t_nr, int16 ani_nr);
static void feuer();
static int16 use_schrott();
static int16 use_gleiter();
static int16 use_schleim();
static void talk_eremit();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,61 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room16.h"
#include "chewy/rooms/room23.h"
namespace Chewy {
namespace Rooms {
void Room16::entry() {
_G(zoom_horizont) = 140;
if (!_G(gameState).R16F5Exit) {
_G(det)->showStaticSpr(4);
_G(gameState).room_e_obj[32].Attribut = 255;
_G(atds)->delControlBit(124, ATS_ACTIVE_BIT);
} else {
_G(det)->hideStaticSpr(4);
_G(gameState).room_e_obj[32].Attribut = EXIT_LEFT;
_G(atds)->setControlBit(124, ATS_ACTIVE_BIT);
}
}
int16 Room16::use_gleiter() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursor()) {
action_flag = true;
autoMove(6, P_CHEWY);
_G(gameState).R23GliderExit = 16;
Room23::cockpit();
}
return action_flag;
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,37 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM16_H
#define CHEWY_ROOMS_ROOM16_H
namespace Chewy {
namespace Rooms {
class Room16 {
public:
static void entry();
static int16 use_gleiter();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,342 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/ani_dat.h"
#include "chewy/room.h"
#include "chewy/rooms/room17.h"
#include "chewy/sound.h"
namespace Chewy {
namespace Rooms {
#undef CHEWY_OBJ
#define CHEWY_OBJ 0
static const int16 CHEWY_PHASEN[4][2] = {
{ 0, 0 },
{ 0, 0 },
{ 141, 144 },
{ 177, 177 }
};
static const MovLine CHEWY_MPKT[2] = {
{ { 241, 150, 0 }, 3, 8 },
{ { 241, 350, 0 }, 3, 8 }
};
static const MovLine CHEWY_MPKT1[2] = {
{ { 243, 334, 0 }, 2, 6 },
{ { 243, 150, 0 }, 2, 6 }
};
void Room17::entry() {
if (!_G(gameState).R17EnergyOut) {
_G(det)->startDetail(1, 255, ANI_FRONT);
for (int16 i = 0; i < 3; ++i)
_G(det)->startDetail(6 + i, 255, ANI_FRONT);
}
plot_seil();
if (_G(gameState).R17GridWeg)
_G(det)->hideStaticSpr(5);
if (_G(gameState).R17DoorCommand)
_G(det)->showStaticSpr(7);
if (_G(gameState).R17Location == 1) {
_G(flags).ZoomMov = true;
_G(zoom_mov_fak) = 3;
_G(room)->set_zoom(25);
_G(zoom_horizont) = 0;
_G(gameState).scrollx = 0;
_G(gameState).scrolly = 60;
setPersonPos(242, 146, P_CHEWY, P_LEFT);
xit();
} else if (_G(gameState).R17Location == 3) {
_G(room)->set_zoom(32);
_G(zoom_horizont) = 399;
xit();
} else {
_G(room)->set_zoom(15);
_G(zoom_horizont) = 0;
_G(gameState).room_e_obj[36].Attribut = 255;
_G(gameState).room_e_obj[38].Attribut = 255;
if (_G(gameState).R6DoorLeftF)
_G(gameState).room_e_obj[39].Attribut = EXIT_RIGHT;
else
_G(gameState).room_e_obj[39].Attribut = 255;
if (_G(gameState).R18DoorBridge)
_G(gameState).room_e_obj[35].Attribut = EXIT_LEFT;
else
_G(gameState).room_e_obj[35].Attribut = 255;
}
}
void Room17::xit() {
if (_G(gameState).R17DoorCommand)
_G(gameState).room_e_obj[36].Attribut = EXIT_TOP;
else
_G(gameState).room_e_obj[36].Attribut = 255;
_G(gameState).room_e_obj[35].Attribut = 255;
_G(gameState).room_e_obj[39].Attribut = 255;
_G(gameState).room_e_obj[38].Attribut = EXIT_TOP;
}
bool Room17::timer(int16 t_nr, int16 ani_nr) {
if (_G(room)->_roomTimer._objNr[ani_nr] == 2 ||
_G(room)->_roomTimer._objNr[ani_nr] == 3) {
if (_G(gameState).R17EnergyOut)
_G(uhr)->resetTimer(t_nr, 0);
else
return true;
}
return false;
}
void Room17::gedAction(int index) {
switch (index) {
case 0:
door_kommando(0);
break;
case 1:
door_kommando(1);
break;
default:
break;
}
}
int16 Room17::use_seil() {
int16 action_flag = false;
if (!_G(flags).AutoAniPlay && _G(gameState).R17Location == 1 && isCurInventory(SEIL_INV)) {
action_flag = true;
hideCur();
delInventory(_G(cur)->getInventoryCursor());
_G(flags).AutoAniPlay = true;
autoMove(5, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(10, 1, ANI_FRONT);
_G(gameState).R17Rope = true;
_G(atds)->delControlBit(139, ATS_ACTIVE_BIT);
plot_seil();
_G(gameState)._personHide[P_CHEWY] = false;
_G(flags).AutoAniPlay = false;
start_spz(CH_TALK6, 255, false, P_CHEWY);
startAadWait(119);
showCur();
}
return action_flag;
}
void Room17::plot_seil() {
if (_G(gameState).R17Rope) {
for (int16 i = 0; i < 3; i++)
_G(det)->showStaticSpr(8 + i);
}
}
void Room17::kletter_down() {
autoMove(5, P_CHEWY);
_G(det)->load_taf_seq(177, 1, nullptr);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(14, 1, ANI_FRONT);
_G(flags).ZoomMov = false;
_G(zoom_mov_fak) = 1;
_G(gameState).ScrollyStep = 2;
_G(room)->set_zoom(32);
_G(spieler_mi)->Vorschub = 8;
_G(zoom_horizont) = 399;
_G(auto_obj) = 1;
init_auto_obj(CHEWY_OBJ, &CHEWY_PHASEN[0][0], _G(mov_phasen)[CHEWY_OBJ].Lines, (const MovLine *)CHEWY_MPKT);
setPersonPos(242, 350, P_CHEWY, P_LEFT);
}
void Room17::kletter_up() {
autoMove(6, P_CHEWY);
_G(det)->load_taf_seq(141, 4, nullptr);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(11, 1, ANI_FRONT);
_G(flags).ZoomMov = true;
_G(zoom_mov_fak) = 3;
_G(gameState).ScrollyStep = 1;
_G(room)->set_zoom(25);
_G(zoom_horizont) = 0;
_G(auto_obj) = 1;
init_auto_obj(CHEWY_OBJ, &CHEWY_PHASEN[0][0], _G(mov_phasen)[CHEWY_OBJ].Lines, (const MovLine *)CHEWY_MPKT1);
setPersonPos(243, 146, P_CHEWY, P_LEFT);
}
void Room17::calc_seil() {
if (_G(gameState).R17Rope) {
if (_G(gameState).R17Location == 2) {
startAadWait(619);
} else if (!_G(flags).AutoAniPlay && !_G(cur)->usingInventoryCursor()) {
close_door();
_G(flags).AutoAniPlay = true;
_G(mov_phasen)[CHEWY_OBJ].AtsText = 0;
_G(mov_phasen)[CHEWY_OBJ].Lines = 2;
_G(mov_phasen)[CHEWY_OBJ].Repeat = 1;
_G(mov_phasen)[CHEWY_OBJ].ZoomFak = 0;
_G(auto_mov_obj)[CHEWY_OBJ].Id = AUTO_OBJ0;
_G(auto_mov_vector)[CHEWY_OBJ].Delay = _G(gameState).DelaySpeed;
_G(auto_mov_obj)[CHEWY_OBJ].Mode = true;
hideCur();
if (_G(gameState).R17Location == 1) {
kletter_down();
_G(gameState).R17Location = 3;
} else if (_G(gameState).R17Location == 3) {
kletter_up();
_G(gameState).R17Location = 1;
}
_G(menu_item) = CUR_WALK;
cursorChoice(_G(menu_item));
wait_auto_obj(CHEWY_OBJ);
showCur();
setPersonSpr(P_LEFT, P_CHEWY);
_G(gameState).ScrollyStep = 1;
_G(gameState)._personHide[P_CHEWY] = false;
_G(flags).AutoAniPlay = false;
_G(auto_obj) = 0;
xit();
}
}
}
void Room17::door_kommando(int16 mode) {
if (!_G(flags).AutoAniPlay) {
_G(flags).AutoAniPlay = true;
if (!mode) {
if (!_G(gameState).R17DoorCommand) {
_G(gameState).room_e_obj[36].Attribut = EXIT_TOP;
_G(gameState).R17DoorCommand = true;
startSetAILWait(4, 1, ANI_FRONT);
stopPerson(P_CHEWY);
_G(det)->showStaticSpr(7);
}
} else {
close_door();
}
_G(flags).AutoAniPlay = false;
_G(atds)->set_all_ats_str(144, _G(gameState).R17DoorCommand, ATS_DATA);
}
}
void Room17::close_door() {
if (_G(gameState).R17DoorCommand) {
_G(gameState).room_e_obj[36].Attribut = 255;
_G(gameState).R17DoorCommand = false;
_G(atds)->set_all_ats_str(144, _G(gameState).R17DoorCommand ? 1 : 0, ATS_DATA);
_G(det)->hideStaticSpr(7);
_G(det)->startDetail(4, 1, ANI_BACK);
}
}
int16 Room17::energy_lever() {
int16 action_flag = false;
hideCur();
autoMove(7, P_CHEWY);
if (!_G(gameState).R17LeverOk) {
if (isCurInventory(BECHER_VOLL_INV)) {
delInventory(_G(cur)->getInventoryCursor());
_G(gameState).R17LeverOk = true;
startAadWait(38);
action_flag = true;
} else if (!_G(cur)->usingInventoryCursor()) {
startAadWait(37);
action_flag = true;
}
} else if (!_G(cur)->usingInventoryCursor()) {
action_flag = true;
_G(obj)->calc_rsi_flip_flop(SIB_HEBEL_R17);
_G(gameState).R17EnergyOut ^= 1;
if (!_G(gameState).R17EnergyOut) {
_G(det)->startDetail(1, 255, ANI_FRONT);
for (int i = 0; i < 3; ++i)
_G(det)->startDetail(i + 6, 255, ANI_FRONT);
}
_G(atds)->set_all_ats_str(142, _G(gameState).R17EnergyOut ? 1 : 0, ATS_DATA);
_G(atds)->set_all_ats_str(140, _G(gameState).R17EnergyOut ? 1 : 0, ATS_DATA);
_G(det)->playSound(12, 0);
if (_G(gameState).R17EnergyOut) {
_G(det)->stopSound(0);
} else {
_G(det)->playSound(15, 0);
}
}
showCur();
return action_flag;
}
int16 Room17::get_oel() {
int16 action_flag = false;
hideCur();
if (!_G(cur)->usingInventoryCursor()) {
action_flag = true;
autoMove(4, P_CHEWY);
start_spz_wait(CH_EKEL, 3, false, P_CHEWY);
startAadWait(60);
} else if (isCurInventory(BECHER_LEER_INV)) {
action_flag = true;
close_door();
autoMove(4, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(13, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
delInventory(_G(cur)->getInventoryCursor());
_G(obj)->addInventory(BECHER_VOLL_INV, &_G(room_blk));
inventory_2_cur(BECHER_VOLL_INV);
}
showCur();
return action_flag;
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,52 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM17_H
#define CHEWY_ROOMS_ROOM17_H
namespace Chewy {
namespace Rooms {
class Room17 {
private:
static void door_kommando(int16 mode);
public:
static void entry();
static void xit();
static bool timer(int16 t_nr, int16 ani_nr);
static void gedAction(int index);
static int16 use_seil();
static void plot_seil();
static void kletter_down();
static void kletter_up();
static void calc_seil();
static void close_door();
static int16 energy_lever();
static int16 get_oel();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,400 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room18.h"
namespace Chewy {
namespace Rooms {
static const int16 BORK_AWAKE_SPR[5] = { 15, 16, 17, 24, 25 };
static const int16 BORK_FAINTED_SPR[4] = { 20, 21, 18, 19 };
static const int16 SURIMY_PHASES[4][2] = {
{ 245, 252 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 }
};
static const MovLine SURIMY_MPKT[2] = {
{ { 453, 170, 190 }, 0, 6 },
{ { 392, 170, 190 }, 0, 6 }
};
static const MovLine SURIMY_MPKT1[2] = {
{ { 392, 170, 190 }, 0, 6 },
{ { 143, 170, 190 }, 0, 6 }
};
static const MovLine SURIMY_MPKT2[2] = {
{ { 143, 170, 190 }, 0, 6 },
{ { 0, 170, 190 }, 0, 6 }
};
static const MovLine SURIMY_MPKT3[2] = {
{ { 500, 100, 190 }, 0, 12 },
{ { 392, 170, 190 }, 0, 12 }
};
static const AniBlock ABLOCK20[3] = {
{ 5, 3, ANI_FRONT, ANI_GO, 0 },
{ 6, 3, ANI_FRONT, ANI_GO, 0 },
{ 7, 3, ANI_FRONT, ANI_WAIT, 0 }
};
static const AniBlock ABLOCK21[2] = {
{ 8, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 23, 255, ANI_BACK, ANI_GO, 0 },
};
static const AniBlock ABLOCK22[2] = {
{ 13, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 14, 13, ANI_FRONT, ANI_GO, 0 },
};
static const AniBlock ABLOCK23[2] = {
{ 11, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 12, 1, ANI_FRONT, ANI_GO, 0 },
};
static const AniBlock ABLOCK24[2] = {
{ 15, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 16, 7, ANI_FRONT, ANI_GO, 0 },
};
void Room18::entry() {
_G(gameState).R18MonitorSwitch = false;
_G(atds)->set_ats_str(151, TXT_MARK_LOOK, 0, ATS_DATA);
_G(gameState).ScrollxStep = 2;
if (_G(gameState).R18CartTerminal)
_G(det)->showStaticSpr(23);
if (!_G(gameState).R18SurimyThrown) {
initBorks();
} else {
for (int16 i = 0; i < 5; i++)
_G(det)->hideStaticSpr(BORK_AWAKE_SPR[i]);
for (int16 i = 0; i < (4 - (_G(gameState).R18Crown ? 1 : 0)); i++)
_G(det)->showStaticSpr(BORK_FAINTED_SPR[i]);
}
if (_G(gameState).R16F5Exit) {
// Hide cyber crown
_G(det)->hideStaticSpr(19);
}
if (!_G(gameState).R18SurimyThrown) {
// Hide cyber crown
_G(det)->hideStaticSpr(19);
_G(atds)->setControlBit(158, ATS_ACTIVE_BIT);
} else {
// Show cyber crown
_G(det)->showStaticSpr(19);
_G(atds)->set_all_ats_str(153, 1, ATS_DATA);
_G(atds)->set_ats_str(149, TXT_MARK_LOOK, 1, ATS_DATA);
for (int16 i = 0; i < 3; i++)
_G(atds)->delControlBit(158 + i, ATS_ACTIVE_BIT);
}
if (_G(gameState).R17EnergyOut) {
_G(det)->stopDetail(0);
_G(atds)->set_ats_str(150, TXT_MARK_LOOK, 1, ATS_DATA);
} else {
_G(atds)->set_ats_str(150, TXT_MARK_LOOK, 0, ATS_DATA);
}
if (!_G(gameState).R18FirstEntry && !_G(gameState).R18Grid) {
startAadWait(39);
_G(gameState).R18FirstEntry = true;
}
if (_G(gameState).R18Grid)
_G(gameState).scrolly = 0;
}
bool Room18::timer(int16 t_nr, int16 ani_nr) {
if (!_G(gameState).R18SurimyThrown && !_G(flags).AutoAniPlay) {
_G(flags).AutoAniPlay = true;
if (t_nr == _G(timer_nr)[0]) {
_G(det)->hideStaticSpr(16);
startSetAILWait(10, 1, ANI_FRONT);
_G(det)->showStaticSpr(16);
_G(uhr)->resetTimer(_G(timer_nr)[0], 10);
} else if (t_nr == _G(timer_nr)[1]) {
hideCur();
_G(det)->hideStaticSpr(17);
startSetAILWait(9, 1, ANI_FRONT);
_G(det)->showStaticSpr(17);
if (!_G(gameState).R18SondeMoni) {
_G(gameState).R18SondeMoni = true;
startSetAILWait(2, 1, ANI_FRONT);
_G(det)->showStaticSpr(9);
startSetAILWait(4, 1, ANI_FRONT);
_G(det)->showStaticSpr(11);
waitShowScreen(50);
_G(det)->hideStaticSpr(9);
_G(det)->hideStaticSpr(11);
} else {
monitor();
}
showCur();
_G(uhr)->resetTimer(_G(timer_nr)[1], 15);
}
_G(flags).AutoAniPlay = false;
}
return false;
}
void Room18::gedAction(int index) {
if (!index && !_G(gameState).R18SurimyThrown) {
stopPerson(P_CHEWY);
autoMove(1, P_CHEWY);
start_aad(40, 0);
}
}
void Room18::initBorks() {
for (int16 i = 0; i < 5; i++)
_G(det)->showStaticSpr(BORK_AWAKE_SPR[i]);
for (int16 i = 0; i < 4; i++)
_G(det)->hideStaticSpr(BORK_FAINTED_SPR[i]);
_G(timer_nr)[0] = _G(room)->set_timer(255, 10);
_G(timer_nr)[1] = _G(room)->set_timer(255, 15);
_G(gameState).scrollx = 276;
_G(gameState).scrolly = 0;
_G(flags).NoScroll = true;
}
void Room18::monitor() {
_G(gameState).R18MonitorSwitch ^= 1;
int16 nr = 0;
if (_G(gameState).R18MonitorSwitch) {
startAniBlock(2, ABLOCK21);
nr = (_G(gameState).R17EnergyOut) ? 2 : 1;
} else {
_G(det)->stopDetail(23);
_G(atds)->set_ats_str(41, TXT_MARK_LOOK, 1, ATS_DATA);
}
_G(atds)->set_ats_str(151, TXT_MARK_LOOK, nr, ATS_DATA);
}
int16 Room18::sonden_moni() {
if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R18Grid) {
hideCur();
autoMove(8, P_CHEWY);
startSetAILWait(3, 1, ANI_FRONT);
_G(det)->showStaticSpr(10);
startAniBlock(3, ABLOCK20);
for (int16 i = 0; i < 3; i++)
_G(det)->showStaticSpr(i + 12);
waitShowScreen(40);
for (int16 i = 0; i < 5; i++)
_G(det)->hideStaticSpr(i + 10);
showCur();
return true;
} else {
return false;
}
}
int16 Room18::calcSurimy() {
if (isCurInventory(SURIMY_INV)) {
hideCur();
delInventory(_G(cur)->getInventoryCursor());
_G(gameState).R18SurimyThrown = true;
_G(det)->load_taf_seq(245, 50, nullptr);
_G(det)->load_taf_seq(116, 55, nullptr);
_G(auto_obj) = 1;
_G(mov_phasen)[SURIMY_OBJ].AtsText = 0;
_G(mov_phasen)[SURIMY_OBJ].Lines = 2;
_G(mov_phasen)[SURIMY_OBJ].Repeat = 1;
_G(mov_phasen)[SURIMY_OBJ].ZoomFak = 0;
_G(auto_mov_obj)[SURIMY_OBJ].Id = AUTO_OBJ0;
_G(auto_mov_vector)[SURIMY_OBJ].Delay = _G(gameState).DelaySpeed;
_G(auto_mov_obj)[SURIMY_OBJ].Mode = true;
if (_G(moveState)[P_CHEWY].Xypos[1] < 150) {
startDetailFrame(18, 1, ANI_FRONT, 8);
init_auto_obj(SURIMY_OBJ, &SURIMY_PHASES[0][0], _G(mov_phasen)[SURIMY_OBJ].Lines, (const MovLine *)SURIMY_MPKT3);
waitDetail(18);
} else {
autoMove(1, P_CHEWY);
stopPerson(P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startDetailFrame(17, 1, ANI_FRONT, 12);
_G(mouseLeftClick) = false;
init_auto_obj(SURIMY_OBJ, &SURIMY_PHASES[0][0], _G(mov_phasen)[SURIMY_OBJ].Lines, (const MovLine *)SURIMY_MPKT);
waitDetail(17);
}
_G(gameState)._personHide[P_CHEWY] = false;
wait_auto_obj(SURIMY_OBJ);
_G(det)->setDetailPos(21, 392, 170);
_G(det)->setDetailPos(22, 447, 154);
startDetailFrame(21, 1, ANI_FRONT, 14);
_G(det)->startDetail(22, 1, ANI_FRONT);
waitDetail(21);
_G(det)->setStaticPos(26, 392, 170, false, true);
_G(det)->showStaticSpr(26);
_G(det)->hideStaticSpr(24);
startAniBlock(2, ABLOCK22);
_G(det)->showStaticSpr(20);
for (int16 i = 0; i < 3; i++)
_G(det)->hideStaticSpr(i + 15);
startAniBlock(2, ABLOCK23);
_G(det)->showStaticSpr(18);
_G(det)->showStaticSpr(19);
_G(det)->hideStaticSpr(26);
_G(flags).NoScroll = true;
_G(mov_phasen)[SURIMY_OBJ].Repeat = 1;
init_auto_obj(SURIMY_OBJ, &SURIMY_PHASES[0][0], _G(mov_phasen)[SURIMY_OBJ].Lines, (const MovLine *)SURIMY_MPKT1);
auto_scroll(70, 0);
wait_auto_obj(SURIMY_OBJ);
_G(det)->setDetailPos(21, 143, 170);
_G(det)->setDetailPos(22, 198, 154);
startDetailFrame(21, 1, ANI_FRONT, 14);
_G(det)->startDetail(22, 1, ANI_FRONT);
waitDetail(21);
_G(det)->setStaticPos(26, 143, 170, false, true);
_G(det)->showStaticSpr(26);
_G(det)->hideStaticSpr(25);
startAniBlock(2, ABLOCK24);
_G(det)->showStaticSpr(21);
_G(det)->hideStaticSpr(26);
_G(mov_phasen)[SURIMY_OBJ].Repeat = 1;
init_auto_obj(SURIMY_OBJ, &SURIMY_PHASES[0][0], _G(mov_phasen)[SURIMY_OBJ].Lines, (const MovLine *)SURIMY_MPKT2);
auto_scroll(0, 0);
wait_auto_obj(SURIMY_OBJ);
_G(gameState).ScrollxStep = 6;
_G(flags).NoScroll = false;
auto_scroll(318, 0);
_G(gameState).ScrollxStep = 2;
_G(auto_obj) = 0;
_G(atds)->set_all_ats_str(153, 1, ATS_DATA);
_G(atds)->set_ats_str(149, TXT_MARK_LOOK, 1, ATS_DATA);
for (int16 i = 0; i < 3; i++)
_G(atds)->delControlBit(158 + i, ATS_ACTIVE_BIT);
_G(atds)->delControlBit(179, ATS_ACTIVE_BIT);
showCur();
_G(det)->del_taf_tbl(245, 50, nullptr);
return true;
} else {
return false;
}
}
int16 Room18::calcMonitorControls() {
if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R18Grid) {
hideCur();
autoMove(6, P_CHEWY);
monitor();
showCur();
return true;
} else {
return false;
}
}
short Room18::use_cart_moni() {
if (!_G(cur)->usingInventoryCursor()) {
hideCur();
autoMove(9, P_CHEWY);
setPersonSpr(P_LEFT, P_CHEWY);
start_spz_wait(CH_LGET_O, 1, false, P_CHEWY);
_G(gameState).R18CartTerminal ^= 1;
if (!_G(gameState).R18CartTerminal) {
_G(atds)->set_ats_str(147, TXT_MARK_LOOK, 0, ATS_DATA);
_G(det)->hideStaticSpr(23);
startSetAILWait(20, 1, ANI_BACK);
} else {
_G(atds)->set_ats_str(147, TXT_MARK_LOOK, 1, ATS_DATA);
startSetAILWait(20, 1, ANI_FRONT);
_G(det)->showStaticSpr(23);
if (_G(gameState).R18CartridgeInSlot) {
_G(gameState).R18CartSave = true;
_G(atds)->set_ats_str(CARTRIDGE_INV, TXT_MARK_LOOK, 1, INV_ATS_DATA);
startAadWait(120);
}
}
showCur();
return true;
} else {
return false;
}
}
int16 Room18::go_cyberspace() {
if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R18Grid) {
hideCur();
autoMove(7, P_CHEWY);
cur_2_inventory();
showCur();
switchRoom(24);
return true;
} else {
return false;
}
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,48 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM18_H
#define CHEWY_ROOMS_ROOM18_H
namespace Chewy {
namespace Rooms {
class Room18 {
private:
static void initBorks();
static void monitor();
public:
static void entry();
static bool timer(int16 t_nr, int16 ani_nr);
static void gedAction(int index);
static int16 calcSurimy();
static int16 calcMonitorControls();
static short use_cart_moni();
static int16 go_cyberspace();
static int16 sonden_moni();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,38 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/rooms/room19.h"
namespace Chewy {
namespace Rooms {
void Room19::entry() {
_G(zoom_horizont) = 250;
_G(flags).NoScroll = true;
_G(gameState).scrollx = 0;
_G(gameState).scrolly = 24;
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,36 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM19_H
#define CHEWY_ROOMS_ROOM19_H
namespace Chewy {
namespace Rooms {
class Room19 {
public:
static void entry();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,265 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/ani_dat.h"
#include "chewy/room.h"
#include "chewy/rooms/room21.h"
namespace Chewy {
namespace Rooms {
#define SPINNE1_OBJ 0
#define SPINNE2_OBJ 1
#define ENERGIE_OBJ 2
static const int16 SPINNE_PHASEN[4][2] = {
{ 58, 65 },
{ 50, 57 },
{ 42, 49 },
{ 66, 89 }
};
static const MovLine SPINNE_MPKT[3] = {
{ { 550, 275, 0 }, 0, 2 },
{ { 396, 275, 0 }, 0, 2 },
{ { 530, 275, 0 }, 1, 2 }
};
static const MovLine SPINNE_MPKT1[2] = {
{ { 104, 50, 0 }, 3, 3 },
{ { 104, 430, 0 }, 3, 3 }
};
static const MovLine SPINNE_MPKT2[2] = {
{ { 115, 140, 0 }, 2, 1 },
{ { 115, 190, 0 }, 2, 1 }
};
static const AniBlock ABLOCK19[3] = {
{ 12, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 13, 4, ANI_FRONT, ANI_WAIT, 0 },
{ 14, 1, ANI_FRONT, ANI_WAIT, 0 },
};
void Room21::entry() {
_G(gameState).ScrollxStep = 2;
_G(gameState).ScrollyStep = 2;
load_chewy_taf(CHEWY_MINI);
calc_laser();
init_spinne();
_G(timer_nr)[2] = _G(room)->set_timer(255, 1);
_G(flags).NoEndPosMovObj = true;
_G(SetUpScreenFunc) = setup_func;
}
bool Room21::timer(int16 t_nr, int16 ani_nr) {
if (t_nr == _G(timer_nr)[0]) {
restart_spinne2();
} else if (t_nr == _G(timer_nr)[2])
chewy_kolli();
return false;
}
void Room21::calc_laser() {
if (_G(gameState).R21Lever1 && !_G(gameState).R21Lever2 && _G(gameState).R21Lever3) {
_G(gameState).R21Laser1Weg = true;
_G(det)->stopDetail(3);
_G(atds)->setControlBit(134, ATS_ACTIVE_BIT);
_G(atds)->delControlBit(133, ATS_ACTIVE_BIT);
} else {
_G(gameState).R21Laser1Weg = false;
_G(det)->startDetail(3, 255, ANI_FRONT);
_G(atds)->delControlBit(134, ATS_ACTIVE_BIT);
_G(atds)->setControlBit(133, ATS_ACTIVE_BIT);
}
if (!_G(gameState).R21Lever1 && _G(gameState).R21Lever2 && !_G(gameState).R21Lever3) {
if (!_G(obj)->checkInventory(SEIL_INV) && !_G(gameState).R17Rope) {
_G(obj)->show_sib(SIB_SEIL_R21);
_G(atds)->delControlBit(129, ATS_ACTIVE_BIT);
}
_G(gameState).R21Laser2Weg = true;
_G(det)->stopDetail(4);
_G(atds)->setControlBit(135, ATS_ACTIVE_BIT);
} else {
_G(obj)->hide_sib(SIB_SEIL_R21);
_G(atds)->setControlBit(129, ATS_ACTIVE_BIT);
_G(gameState).R21Laser2Weg = false;
_G(det)->startDetail(4, 255, ANI_FRONT);
_G(atds)->delControlBit(135, ATS_ACTIVE_BIT);
}
}
void Room21::init_spinne() {
_G(det)->load_taf_seq(42, 48, nullptr);
_G(auto_obj) = 2;
_G(mov_phasen)[SPINNE1_OBJ].AtsText = 130;
_G(mov_phasen)[SPINNE1_OBJ].Lines = 3;
_G(mov_phasen)[SPINNE1_OBJ].Repeat = 255;
_G(mov_phasen)[SPINNE1_OBJ].ZoomFak = 0;
_G(auto_mov_obj)[SPINNE1_OBJ].Id = AUTO_OBJ0;
_G(auto_mov_vector)[SPINNE1_OBJ].Delay = _G(gameState).DelaySpeed;
_G(auto_mov_obj)[SPINNE1_OBJ].Mode = true;
init_auto_obj(SPINNE1_OBJ, &SPINNE_PHASEN[0][0], 3, (const MovLine *)SPINNE_MPKT);
_G(mov_phasen)[SPINNE2_OBJ].AtsText = 130;
_G(mov_phasen)[SPINNE2_OBJ].Lines = 2;
_G(mov_phasen)[SPINNE2_OBJ].Repeat = 1;
_G(mov_phasen)[SPINNE2_OBJ].ZoomFak = 0;
_G(auto_mov_obj)[SPINNE2_OBJ].Id = AUTO_OBJ1;
_G(auto_mov_vector)[SPINNE2_OBJ].Delay = _G(gameState).DelaySpeed;
_G(auto_mov_obj)[SPINNE2_OBJ].Mode = true;
init_auto_obj(SPINNE2_OBJ, &SPINNE_PHASEN[0][0], 2, (const MovLine *)SPINNE_MPKT1);
_G(timer_nr)[0] = _G(room)->set_timer(255, 21);
_G(e_streifen) = false;
}
void Room21::restart_spinne2() {
_G(mov_phasen)[SPINNE2_OBJ].Repeat = 1;
init_auto_obj(SPINNE2_OBJ, &SPINNE_PHASEN[0][0], _G(mov_phasen)[SPINNE2_OBJ].Lines, (const MovLine *)SPINNE_MPKT1);
_G(uhr)->resetTimer(_G(timer_nr)[0], 0);
_G(e_streifen) = false;
}
void Room21::setup_func() {
if (_G(auto_mov_vector)[SPINNE2_OBJ].Xypos[1] >= 190 && !_G(e_streifen)) {
_G(e_streifen) = true;
_G(auto_obj) = 3;
_G(mov_phasen)[ENERGIE_OBJ].AtsText = 0;
_G(mov_phasen)[ENERGIE_OBJ].Lines = 2;
_G(mov_phasen)[ENERGIE_OBJ].Repeat = 1;
_G(mov_phasen)[ENERGIE_OBJ].ZoomFak = 0;
_G(auto_mov_obj)[ENERGIE_OBJ].Id = AUTO_OBJ2;
_G(auto_mov_vector)[ENERGIE_OBJ].Delay = _G(gameState).DelaySpeed;
_G(auto_mov_obj)[ENERGIE_OBJ].Mode = true;
init_auto_obj(ENERGIE_OBJ, &SPINNE_PHASEN[0][0], 2, (const MovLine *)SPINNE_MPKT2);
}
}
void Room21::chewy_kolli() {
int16 kolli = false;
for (int16 i = 0; i < _G(auto_obj) && !kolli; i++) {
int16 spr_nr = _G(mov_phasen)[i].Phase[_G(auto_mov_vector)[i].Phase][0] + _G(auto_mov_vector)[i].PhNr;
int16 *xy = (int16 *)_G(room_blk)._detImage[spr_nr];
int16 *Cxy = _G(room_blk).DetKorrekt + (spr_nr << 1);
int16 xoff = xy[0];
int16 yoff = xy[1];
if (i == 2)
xoff += 10;
xoff += _G(auto_mov_vector)[i].Xzoom;
yoff += _G(auto_mov_vector)[i].Yzoom;
if ((!i && _G(moveState)[P_CHEWY].Xypos[0] < 516) ||
(i == 1 && _G(moveState)[P_CHEWY].Xypos[1] > 70) ||
(i == 2)) {
if (_G(moveState)[P_CHEWY].Xypos[0] + 12 >= _G(auto_mov_vector)[i].Xypos[0] + Cxy[0] &&
_G(moveState)[P_CHEWY].Xypos[0] + 12 <= _G(auto_mov_vector)[i].Xypos[0] + xoff + Cxy[0] &&
_G(moveState)[P_CHEWY].Xypos[1] + 12 >= _G(auto_mov_vector)[i].Xypos[1] + Cxy[1] &&
_G(moveState)[P_CHEWY].Xypos[1] + 12 <= _G(auto_mov_vector)[i].Xypos[1] + yoff + Cxy[1] &&
_G(mov_phasen)[i].Start == 1)
kolli = true;
}
}
if (kolli && !_G(flags).AutoAniPlay) {
const int16 tmp = _G(moveState)[P_CHEWY].Count;
stopPerson(P_CHEWY);
_G(flags).AutoAniPlay = true;
_G(gameState)._personHide[P_CHEWY] = true;
int16 ani_nr = (_G(moveState)[P_CHEWY].Xyvo[0] < 0) ? 10 : 11;
_G(det)->setDetailPos(ani_nr, _G(moveState)[P_CHEWY].Xypos[0], _G(moveState)[P_CHEWY].Xypos[1]);
startSetAILWait(ani_nr, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
_G(flags).AutoAniPlay = false;
_G(moveState)[P_CHEWY].Count = tmp;
get_phase(&_G(moveState)[P_CHEWY], &_G(spieler_mi)[P_CHEWY]);
_G(mov)->continue_auto_go();
}
}
void Room21::salto() {
if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R21Salto && !_G(flags).AutoAniPlay) {
_G(gameState).R21Salto = true;
_G(flags).AutoAniPlay = true;
_G(gameState)._personHide[P_CHEWY] = true;
for (int16 i = 0; i < 3; i++) {
_G(det)->setDetailPos(12 + i, _G(moveState)[P_CHEWY].Xypos[0],
_G(moveState)[P_CHEWY].Xypos[1]);
}
startAniBlock(3, ABLOCK19);
_G(gameState)._personHide[P_CHEWY] = false;
startAadWait(36);
_G(flags).AutoAniPlay = false;
}
}
void Room21::use_gitter_energy() {
_G(gameState).R21EnergyGrid = exit_flip_flop(-1, 47, -1, 131, 138, -1,
EXIT_BOTTOM, EXIT_TOP, (int16)_G(gameState).R21EnergyGrid);
_G(auto_obj) = 0;
_G(gameState).R17Location = 1;
_G(gameState)._personHide[P_CHEWY] = true;
switchRoom(17);
_G(det)->hideStaticSpr(5);
startSetAILWait(9, 1, ANI_FRONT);
_G(gameState).R17GridWeg = true;
_G(gameState)._personHide[P_CHEWY] = false;
}
int16 Room21::use_fenster() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursor() && !_G(flags).AutoAniPlay && _G(gameState).R21Laser1Weg) {
action_flag = true;
_G(flags).AutoAniPlay = true;
_G(gameState).R18Grid = true;
autoMove(13, P_CHEWY);
setPersonPos(541, 66, P_CHEWY, P_LEFT);
switchRoom(18);
if (!_G(gameState).R18FirstEntry) {
startAadWait(39);
_G(gameState).R18FirstEntry = true;
}
_G(gameState).room_e_obj[50].Attribut = EXIT_TOP;
_G(gameState).room_e_obj[41].Attribut = 255;
_G(flags).AutoAniPlay = false;
}
return action_flag;
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,48 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM21_H
#define CHEWY_ROOMS_ROOM21_H
namespace Chewy {
namespace Rooms {
class Room21 {
private:
static void init_spinne();
static void setup_func();
static void chewy_kolli();
static void restart_spinne2();
public:
static void entry();
static bool timer(int16 t_nr, int16 ani_nr);
static void calc_laser();
static void use_gitter_energy();
static int16 use_fenster();
static void salto();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,208 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/ani_dat.h"
#include "chewy/room.h"
#include "chewy/rooms/room22.h"
namespace Chewy {
namespace Rooms {
#define BORK_OBJ 0
static const int16 BORK_PHASEN[4][2] = {
{ 51, 56 },
{ 36, 41 },
{ 36, 41 },
{ 36, 41 }
};
static const MovLine BORK_MPKT[2] = {
{ { -30, 125, 170} , 1, 6 },
{ { 155, 125, 170 }, 1, 6 },
};
static const MovLine BORK_MPKT1[2] = {
{ { 155, 125, 170}, 2, 6 },
{ { -30, 125, 170}, 0, 6 }
};
static const MovLine BORK_MPKT2[2] = {
{ { -30, 125, 170 }, 1, 6 },
{ { 90, 125, 170 }, 1, 6 }
};
AniBlock ABLOCK14[2] = {
{0, 1, ANI_FRONT, ANI_WAIT, 0},
{3, 255, ANI_FRONT, ANI_GO, 0},
};
void Room22::entry() {
if (!_G(gameState).R22BorkPlatt) {
_G(det)->load_taf_seq(36, 21, nullptr);
_G(room)->set_timer(255, 15);
} else if (!_G(gameState).R22GetBork) {
_G(det)->showStaticSpr(4);
}
}
bool Room22::timer(int16 t_nr, int16 ani_nr) {
if (!ani_nr && !_G(flags).ExitMov) {
bork(t_nr);
}
return false;
}
int16 Room22::chewy_amboss() {
int16 action_flag = false;
if (!_G(gameState).R22ChewyPlatt && !_G(cur)->usingInventoryCursor() && !_G(flags).AutoAniPlay) {
action_flag = true;
_G(flags).AutoAniPlay = true;
hideCur();
autoMove(5, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(1, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
autoMove(2, P_CHEWY);
_G(flags).NoPalAfterFlc = false;
flic_cut(FCUT_006);
_G(gameState).R22ChewyPlatt = true;
_G(atds)->set_all_ats_str(79, 1, ATS_DATA);
_G(flags).AutoAniPlay = false;
showCur();
}
return action_flag;
}
void Room22::bork(int16 t_nr) {
if (!_G(flags).AutoAniPlay && !is_chewy_busy()) {
_G(flags).AutoAniPlay = true;
if (!_G(gameState).R22BorkPlatt) {
hideCur();
start_spz(CH_TALK2, 255, ANI_FRONT, P_CHEWY);
startAadWait(10);
autoMove(3, P_CHEWY);
_G(auto_obj) = 1;
_G(mov_phasen)[BORK_OBJ].AtsText = 0;
_G(mov_phasen)[BORK_OBJ].Lines = 2;
_G(mov_phasen)[BORK_OBJ].Repeat = 1;
_G(mov_phasen)[BORK_OBJ].ZoomFak = 0;
_G(auto_mov_obj)[BORK_OBJ].Id = AUTO_OBJ0;
_G(auto_mov_vector)[BORK_OBJ].Delay = _G(gameState).DelaySpeed;
_G(auto_mov_obj)[BORK_OBJ].Mode = true;
if (!_G(gameState).R22Paint) {
bork_walk1();
} else {
if (!_G(gameState).R22ChewyPlatt) {
_G(atds)->setControlBit(79, ATS_ACTIVE_BIT);
_G(gameState).R22ChewyPlatt = true;
}
bork_walk2();
}
showCur();
}
_G(uhr)->resetTimer(t_nr, 0);
_G(flags).AutoAniPlay = false;
}
}
void Room22::bork_walk1() {
init_auto_obj(BORK_OBJ, &BORK_PHASEN[0][0], _G(mov_phasen)[BORK_OBJ].Lines, (const MovLine *)BORK_MPKT);
wait_auto_obj(BORK_OBJ);
startSetAILWait(2, 1, ANI_FRONT);
_G(mov_phasen)[BORK_OBJ].Repeat = 1;
init_auto_obj(BORK_OBJ, &BORK_PHASEN[0][0], _G(mov_phasen)[BORK_OBJ].Lines, (const MovLine *)BORK_MPKT1);
wait_auto_obj(BORK_OBJ);
}
void Room22::bork_walk2() {
init_auto_obj(BORK_OBJ, &BORK_PHASEN[0][0], _G(mov_phasen)[BORK_OBJ].Lines, (const MovLine *)BORK_MPKT2);
wait_auto_obj(BORK_OBJ);
flic_cut(FCUT_008);
register_cutscene(3);
_G(det)->showStaticSpr(4);
_G(atds)->delControlBit(81, ATS_ACTIVE_BIT);
_G(gameState).R22BorkPlatt = true;
_G(atds)->setControlBit(79, ATS_ACTIVE_BIT);
}
void Room22::get_bork() {
if (!_G(gameState).R22GetBork && _G(gameState).R22BorkPlatt) {
autoMove(4, P_CHEWY);
_G(det)->hideStaticSpr(4);
_G(gameState)._personHide[P_CHEWY] = true;
startAniBlock(2, ABLOCK14);
setPersonPos(171, 120, P_CHEWY, P_LEFT);
startAadWait(11);
_G(det)->stopDetail(3);
_G(gameState)._personHide[P_CHEWY] = false;
_G(atds)->setControlBit(81, ATS_ACTIVE_BIT);
invent_2_slot(BORK_INV);
_G(gameState).R22GetBork = true;
_G(menu_item) = CUR_WALK;
cursorChoice(_G(menu_item));
}
}
int16 Room22::malen() {
int16 action_flag = false;
if (!_G(flags).AutoAniPlay && isCurInventory(17)) {
action_flag = true;
_G(flags).AutoAniPlay = true;
autoMove(8, P_CHEWY);
flic_cut(FCUT_007);
_G(atds)->set_ats_str(82, TXT_MARK_LOOK, 1, ATS_DATA);
_G(gameState).R22Paint = true;
_G(obj)->calc_rsi_flip_flop(SIB_PAINT_R22);
_G(obj)->hide_sib(SIB_PAINT_R22);
delInventory(_G(cur)->getInventoryCursor());
_G(obj)->calc_all_static_detail();
_G(flags).AutoAniPlay = false;
if (!_G(gameState).R22ChewyPlatt) {
_G(gameState).R22ChewyPlatt = true;
_G(atds)->setControlBit(79, ATS_ACTIVE_BIT);
}
}
return action_flag;
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,46 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM22_H
#define CHEWY_ROOMS_ROOM22_H
namespace Chewy {
namespace Rooms {
class Room22 {
private:
static void bork_walk1();
static void bork_walk2();
static void bork(int16 t_nr);
public:
static void entry();
static bool timer(int16 t_nr, int16 ani_nr);
static int16 chewy_amboss();
static int16 malen();
static void get_bork();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,156 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room23.h"
namespace Chewy {
namespace Rooms {
static const AniBlock ABLOCK15[4] = {
{ 0, 2, ANI_FRONT, ANI_GO, 0 },
{ 1, 255, ANI_FRONT, ANI_GO, 0 },
{ 2, 255, ANI_FRONT, ANI_GO, 0 },
{ 3, 255, ANI_FRONT, ANI_GO, 0 },
};
void Room23::entry() {
_G(gameState)._personHide[P_CHEWY] = true;
setPersonPos(135, 69, P_CHEWY, -1);
}
void Room23::cockpit() {
_G(gameState).scrollx = 0;
_G(gameState).scrolly = 0;
_G(mouseLeftClick) = false;
switchRoom(23);
if (!_G(gameState).R23Cartridge || !_G(gameState).R25GliderFlamesExtinguished)
_G(det)->hideStaticSpr(3);
else
_G(det)->showStaticSpr(3);
}
int16 Room23::start_gleiter() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursor()) {
action_flag = true;
if (!_G(gameState).R23FluxoFlex)
startAadWait(23);
else {
bool start_ok = true;
if (_G(gameState).R23GliderExit == 16) {
if (!_G(gameState).R16F5Exit) {
start_ok = false;
startAadWait(35);
} else if (!_G(gameState).R23Cartridge || !_G(gameState).R18CartSave) {
start_ok = false;
startAadWait(41);
} else if (!_G(gameState).R17EnergyOut) {
start_ok = false;
startAadWait(300);
}
}
if (start_ok) {
hideCur();
startAniBlock(4, ABLOCK15);
waitShowScreen(30);
for (int16 i = 0; i < 4; i++)
_G(det)->stopDetail(i);
if (_G(gameState).R23GliderExit == 14) {
_G(out)->setPointer(nullptr);
_G(out)->cls();
_G(flags).NoPalAfterFlc = true;
flic_cut(FCUT_011);
register_cutscene(7);
_G(out)->cls();
_G(gameState).R23GliderExit = 16;
setPersonPos(126, 110, P_CHEWY, P_RIGHT);
switchRoom(_G(gameState).R23GliderExit);
start_spz_wait(CH_WONDER1, 2, false, P_CHEWY);
start_spz(CH_TALK2, 255, ANI_FRONT, P_CHEWY);
_G(gameState).DelaySpeed = 10;
startAadWait(59);
stopPerson(P_CHEWY);
_G(mouseLeftClick) = false;
} else if (_G(gameState).R23GliderExit == 16) {
_G(out)->setPointer(nullptr);
_G(out)->cls();
flic_cut(FCUT_SPACECHASE_18);
_G(gameState).R23GliderExit = 25;
register_cutscene(9);
cur_2_inventory();
remove_inventory(5);
remove_inventory(6);
remove_inventory(4);
remove_inventory(15);
remove_inventory(16);
switchRoom(_G(gameState).R23GliderExit);
}
showCur();
}
}
}
return action_flag;
}
void Room23::use_cartridge() {
delInventory(_G(cur)->getInventoryCursor());
_G(gameState).R23Cartridge = true;
if (_G(gameState).R18CartSave) {
_G(atds)->delControlBit(171, ATS_ACTIVE_BIT);
_G(atds)->set_all_ats_str(111, 2, ATS_DATA);
startSetAILWait(4, 1, ANI_FRONT);
_G(det)->showStaticSpr(3);
} else {
_G(atds)->set_all_ats_str(111, 1, ATS_DATA);
}
_G(menu_item_vorwahl) = CUR_USE;
}
void Room23::get_cartridge() {
_G(atds)->set_all_ats_str(111, 0, ATS_DATA);
_G(atds)->setControlBit(171, ATS_ACTIVE_BIT);
_G(gameState).R23Cartridge = false;
_G(det)->hideStaticSpr(3);
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,40 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM23_H
#define CHEWY_ROOMS_ROOM23_H
namespace Chewy {
namespace Rooms {
class Room23 {
public:
static void entry();
static void cockpit();
static void get_cartridge();
static void use_cartridge();
static int16 start_gleiter();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,165 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room24.h"
#include "chewy/cursor.h"
#include "chewy/sound.h"
namespace Chewy {
namespace Rooms {
static const uint8 CRYSTAL_SPR[3][3] = {
{ 14, 20, 13 },
{ 20, 13, 14 },
{ 13, 14, 20 },
};
void Room24::entry() {
_G(flags).MainInput = false;
_G(gameState)._personHide[P_CHEWY] = true;
setPersonPos(0, 0, P_CHEWY, -1);
_G(gameState).scrollx = 0;
_G(gameState).scrolly = 0;
// TODO: There are 4 cursor frames here, but we only support
// a single custom cursor frame
_G(cur)->setCustomRoomCursor(_G(room_blk)._detImage[7]);
_G(cur)->setAnimation(7, 10, -1);
_G(menu_item) = CUR_USER;
cursorChoice(CUR_USER);
if (_G(gameState).R16F5Exit)
_G(det)->showStaticSpr(10);
else
_G(det)->hideStaticSpr(10);
calc_lever_spr();
calc_animation(255);
for (int16 i = 0; i < 3; i++) {
if (CRYSTAL_SPR[i][_G(gameState).R24Lever[i]] == 20)
_G(det)->startDetail(5 + i * 4, 255, ANI_BACK);
}
}
void Room24::xit() {
_G(gameState)._personHide[P_CHEWY] = false;
_G(menu_item) = CUR_WALK;
cursorChoice(_G(menu_item));
setPersonPos(263, 144, P_CHEWY, -1);
_G(gameState).scrollx = 88;
_G(mouseLeftClick) = false;
_G(flags).MainInput = true;
}
void Room24::use_lever(int16 txt_nr) {
if (!_G(gameState).R24Lever[txt_nr - 161] ||
_G(gameState).R24Lever[txt_nr - 161] == 2) {
_G(gameState).R24Lever[txt_nr - 161] = 1;
_G(gameState).R24LeverDir[txt_nr - 161] ^= 1;
} else {
if (_G(gameState).R24LeverDir[txt_nr - 161])
_G(gameState).R24Lever[txt_nr - 161] = 0;
else
_G(gameState).R24Lever[txt_nr - 161] = 2;
}
calc_lever_spr();
calc_animation(txt_nr - 161);
if (_G(gameState).R24Lever[0] == 1 && _G(gameState).R24Lever[1] == 0 && _G(gameState).R24Lever[2] == 2) {
_G(gameState).R16F5Exit = true;
_G(det)->playSound(1, 0);
_G(det)->stopSound(1);
_G(det)->startDetail(1, 1, ANI_FRONT);
_G(det)->showStaticSpr(10);
_G(atds)->set_ats_str(164, TXT_MARK_NAME, 1, ATS_DATA);
} else if (_G(gameState).R16F5Exit) {
_G(gameState).R16F5Exit = false;
_G(det)->hideStaticSpr(10);
_G(det)->playSound(1, 1);
_G(det)->stopSound(0);
_G(det)->startDetail(1, 1, ANI_BACK);
_G(atds)->set_ats_str(164, TXT_MARK_NAME, 0, ATS_DATA);
}
}
void Room24::calc_lever_spr() {
if (!_G(gameState).R24FirstEntry) {
_G(gameState).R24FirstEntry = true;
_G(gameState).R24Lever[0] = 2;
_G(gameState).R24LeverDir[0] = 0;
_G(gameState).R24Lever[1] = 1;
_G(gameState).R24LeverDir[1] = 0;
_G(gameState).R24Lever[2] = 0;
_G(gameState).R24LeverDir[2] = 1;
}
for (int16 i = 0; i < 3; i++) {
for (int16 j = 0; j < 3; j++)
_G(det)->hideStaticSpr(1 + j + i * 3);
_G(det)->showStaticSpr(1 + _G(gameState).R24Lever[i] + i * 3);
_G(atds)->set_ats_str(166 + i, TXT_MARK_NAME, _G(gameState).R24Lever[i], ATS_DATA);
}
}
void Room24::calc_animation(int16 crystal_nr) {
if (crystal_nr != 255) {
hideCur();
if (CRYSTAL_SPR[crystal_nr][_G(gameState).R24Lever[crystal_nr]] == 20) {
int16 ani_nr = _G(gameState).R24CrystalLast[crystal_nr] == 13 ? 7 : 8;
_G(det)->playSound(ani_nr + crystal_nr * 4, 0);
_G(det)->stopSound(0);
_G(det)->hideStaticSpr(_G(gameState).R24CrystalLast[crystal_nr] + crystal_nr * 2);
startSetAILWait(ani_nr + crystal_nr * 4, 1, ANI_BACK);
startSetAILWait(6 + crystal_nr * 4, 1, ANI_BACK);
_G(det)->startDetail(5 + crystal_nr * 4, 255, ANI_BACK);
} else if (_G(gameState).R24CrystalLast[crystal_nr] == 20) {
int16 ani_nr = CRYSTAL_SPR[crystal_nr][_G(gameState).R24Lever[crystal_nr]] == 13 ? 7 : 8;
_G(det)->stopSound(0);
_G(det)->playSound(5 + ani_nr + crystal_nr * 4, 0);
_G(det)->stopDetail(5 + crystal_nr * 4);
startSetAILWait(6 + crystal_nr * 4, 1, ANI_FRONT);
startSetAILWait(ani_nr + crystal_nr * 4, 1, ANI_FRONT);
}
showCur();
}
for (int16 i = 0; i < 6; i++)
_G(det)->hideStaticSpr(13 + i);
for (int16 i = 0; i < 3; i++) {
_G(det)->showStaticSpr(CRYSTAL_SPR[i][_G(gameState).R24Lever[i]] + i * 2);
_G(gameState).R24CrystalLast[i] = CRYSTAL_SPR[i][_G(gameState).R24Lever[i]];
}
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,42 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM24_H
#define CHEWY_ROOMS_ROOM24_H
namespace Chewy {
namespace Rooms {
class Room24 {
private:
static void calc_lever_spr();
static void calc_animation(int16 crystal_nr);
public:
static void entry();
static void xit();
static void use_lever(int16 txt_nr);
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,181 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/ani_dat.h"
#include "chewy/rooms/room23.h"
#include "chewy/rooms/room25.h"
#include "chewy/cursor.h"
#include "chewy/sound.h"
namespace Chewy {
namespace Rooms {
static const int16 SURIMY_PHASEN[4][2] = {
{ 56, 63 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 }
};
static const MovLine SURIMY_MPKT[2] = {
{ { 100, 150, 150 }, 0, 6 },
{ { -20, 150, 150 }, 0, 6 }
};
void Room25::entry() {
if (!_G(gameState).R25GliderFlamesExtinguished) {
_G(det)->playSound(0, 0);
for (int i = 0; i < 9; ++i)
_G(det)->startDetail(i, 255, ANI_FRONT);
}
if (!_G(gameState).R29WaterHose) {
_G(det)->hideStaticSpr(0);
_G(det)->hideStaticSpr(1);
_G(atds)->setControlBit(219, ATS_ACTIVE_BIT);
} else {
_G(det)->showStaticSpr(0);
_G(det)->showStaticSpr(1);
_G(atds)->delControlBit(219, ATS_ACTIVE_BIT);
}
if (!_G(gameState).R25FirstEntry) {
hideCur();
if (_G(obj)->checkInventory(TRANSLATOR_INV)) {
_G(obj)->calc_rsi_flip_flop(SIB_TRANSLATOR_23);
_G(atds)->set_all_ats_str(113, 0, ATS_DATA);
remove_inventory(TRANSLATOR_INV);
_G(cur)->setInventoryCursor(-1);
_G(menu_item) = CUR_WALK;
_G(cur)->setInventoryCursor(-1);
cursorChoice(_G(menu_item));
}
_G(gameState).R25FirstEntry = true;
_G(gameState)._personHide[P_CHEWY] = true;
flic_cut(FCUT_029);
_G(det)->playSound(0, 0);
_G(fx_blend) = BLEND_NONE;
setPersonPos(219, 141, P_CHEWY, P_RIGHT);
_G(gameState)._personHide[P_CHEWY] = false;
start_spz(CH_TALK11, 255, ANI_FRONT, P_CHEWY);
startAadWait(64);
showCur();
} else if (_G(gameState).R25GliderExit && !_G(flags).LoadGame) {
setPersonPos(127, 122, P_CHEWY, P_LEFT);
if (!_G(gameState).R25SurimyGo) {
_G(gameState).R25SurimyGo = 1;
xit_glider();
}
}
_G(gameState).R25GliderExit = false;
}
int16 Room25::extinguishGliderFlames() {
int16 action_flag = false;
hideCur();
if (!_G(gameState).R25GliderFlamesExtinguished && _G(gameState).R29WaterHose) {
if (!_G(cur)->usingInventoryCursor()) {
action_flag = true;
_G(gameState).R25GliderFlamesExtinguished = true;
autoMove(2, P_CHEWY);
flic_cut(FCUT_030);
_G(obj)->calc_rsi_flip_flop(SIB_SCHLAUCH_R25);
_G(atds)->set_all_ats_str(219, 1, ATS_DATA);
_G(atds)->set_all_ats_str(187, 1, ATS_DATA);
_G(det)->stopSound(0);
for (int i = 0; i < 9; ++i)
_G(det)->stopDetail(i);
}
} else if (_G(gameState).R25GliderFlamesExtinguished) {
if (isCurInventory(EMPTY_MILK_BOTTLE_INV)) {
action_flag = true;
autoMove(2, P_CHEWY);
start_spz_wait((_G(gameState).ChewyAni == CHEWY_ROCKER) ? 28 : 14, 1, false, P_CHEWY);
delInventory(_G(cur)->getInventoryCursor());
_G(obj)->addInventory(WATER_FILLED_BOTTLE_INV, &_G(room_blk));
inventory_2_cur(WATER_FILLED_BOTTLE_INV);
startAadWait(253);
}
}
showCur();
return action_flag;
}
int16 Room25::useGlider() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursor() && _G(gameState).R25GliderFlamesExtinguished) {
action_flag = true;
hideCur();
autoMove(3, P_CHEWY);
showCur();
_G(gameState).R23GliderExit = 25;
Room23::cockpit();
}
return action_flag;
}
void Room25::xit_glider() {
if (!_G(gameState).R25SurimyLauf) {
hideCur();
_G(gameState).R25SurimyLauf = true;
_G(det)->load_taf_seq(56, 8, nullptr);
_G(auto_obj) = 1;
_G(mov_phasen)[SURIMY_OBJ].AtsText = 0;
_G(mov_phasen)[SURIMY_OBJ].Lines = 2;
_G(mov_phasen)[SURIMY_OBJ].Repeat = 1;
_G(mov_phasen)[SURIMY_OBJ].ZoomFak = 0;
_G(auto_mov_obj)[SURIMY_OBJ].Id = AUTO_OBJ0;
_G(auto_mov_vector)[SURIMY_OBJ].Delay = _G(gameState).DelaySpeed + 2;
_G(auto_mov_obj)[SURIMY_OBJ].Mode = true;
init_auto_obj(SURIMY_OBJ, &SURIMY_PHASEN[0][0], 2, (const MovLine *)SURIMY_MPKT);
_G(fx_blend) = BLEND1;
setupScreen(DO_SETUP);
start_spz(CH_TALK12, 255, ANI_FRONT, P_CHEWY);
startAadWait(65);
_G(fx_blend) = BLEND_NONE;
wait_auto_obj(SURIMY_OBJ);
_G(auto_obj) = 0;
showCur();
}
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,41 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM25_H
#define CHEWY_ROOMS_ROOM25_H
namespace Chewy {
namespace Rooms {
class Room25 {
private:
static void xit_glider();
public:
static void entry();
static int16 extinguishGliderFlames();
static int16 useGlider();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,39 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/rooms/room26.h"
#include "chewy/sound.h"
namespace Chewy {
namespace Rooms {
void Room26::entry() {
if (_G(gameState).R25GliderFlamesExtinguished)
_G(det)->stopSound(0);
else
_G(det)->playSound(0, 0);
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,36 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM26_H
#define CHEWY_ROOMS_ROOM26_H
namespace Chewy {
namespace Rooms {
class Room26 {
public:
static void entry();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,92 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/ani_dat.h"
#include "chewy/rooms/room27.h"
namespace Chewy {
namespace Rooms {
void Room27::entry() {
if (_G(gameState)._personRoomNr[P_HOWARD] == 27) {
_G(timer_nr)[0] = _G(room)->set_timer(0, 5);
_G(det)->set_static_ani(0, -1);
_G(atds)->delControlBit(274, ATS_ACTIVE_BIT);
} else {
_G(atds)->setControlBit(274, ATS_ACTIVE_BIT);
}
_G(gameState)._personHide[P_HOWARD] = true;
_G(gameState).ScrollxStep = 2;
}
void Room27::xit(int16 eib_nr) {
_G(gameState).ScrollxStep = 1;
hideCur();
if (_G(gameState)._personRoomNr[P_HOWARD] == 27) {
if (eib_nr == 55) {
startAadWait(175);
_G(room)->set_timer_status(0, TIMER_STOP);
_G(det)->del_static_ani(0);
startSetAILWait(2, 1, ANI_FRONT);
_G(gameState)._personRoomNr[P_HOWARD] = 28;
_G(spieler_mi)[P_HOWARD].Id = HOWARD_OBJ;
} else if (_G(gameState).R27HowardGed < 3 && eib_nr != -1) {
++_G(gameState).R27HowardGed;
startAadWait(174);
}
}
showCur();
}
void Room27::get_surimy() {
_G(obj)->calc_all_static_detail();
hideCur();
autoMove(4, P_CHEWY);
if (_G(gameState)._personRoomNr[P_HOWARD] == 27) {
startAadWait(171);
}
showCur();
_G(obj)->hide_sib(SIB_SURIMY_R27);
}
void Room27::talk_howard() {
hideCur();
autoMove(4, P_CHEWY);
startAadWait(173);
showCur();
}
void Room27::howard_ged() {
if (_G(gameState).R27HowardGed < 3) {
++_G(gameState).R27HowardGed;
}
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,40 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM27_H
#define CHEWY_ROOMS_ROOM27_H
namespace Chewy {
namespace Rooms {
class Room27 {
public:
static void entry();
static void xit(int16 eib_nr);
static void get_surimy();
static void talk_howard();
static void howard_ged();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,343 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/ani_dat.h"
#include "chewy/rooms/room28.h"
#include "chewy/sound.h"
namespace Chewy {
namespace Rooms {
void Room28::entry(int16 eib_nr) {
_G(zoom_horizont) = 140;
_G(flags).ZoomMov = true;
_G(zoom_mov_fak) = 3;
_G(gameState).ScrollxStep = 2;
if (_G(gameState).R28RKuerbis)
_G(det)->showStaticSpr(6);
if (_G(gameState).R28LetterBox) {
_G(det)->showStaticSpr(8);
_G(det)->showStaticSpr(9);
} else {
_G(det)->showStaticSpr(7);
}
if (_G(gameState)._personRoomNr[P_HOWARD] == 28) {
_G(gameState).ZoomXy[P_HOWARD][0] = 40;
_G(gameState).ZoomXy[P_HOWARD][1] = 40;
_G(gameState)._personHide[P_HOWARD] = false;
hideCur();
_G(SetUpScreenFunc) = setup_func;
if (_G(gameState).R40Wettbewerb) {
_G(gameState).scrollx = 320;
_G(gameState)._personHide[P_CHEWY] = false;
haendler();
_G(gameState).R40Wettbewerb = false;
} else {
switch (eib_nr) {
case 55:
if (!_G(gameState).R28EntryHaus) {
_G(gameState).R28EntryHaus = true;
setPersonPos(232, 100, P_HOWARD, P_RIGHT);
autoMove(3, P_HOWARD);
goAutoXy(320, _G(moveState)[P_HOWARD].Xypos[1], P_HOWARD, ANI_WAIT);
startAadWait(176);
} else if (_G(gameState).R31SurFurz && !_G(gameState).R28RKuerbis) {
_G(gameState).R28RKuerbis = true;
_G(gameState).ScrollxStep = 2;
autoMove(6, P_CHEWY);
waitShowScreen(10);
startAadWait(194);
_G(gameState).room_e_obj[62].Attribut = 255;
_G(atds)->set_all_ats_str(208, 1, ATS_DATA);
_G(flags).NoScroll = true;
auto_scroll(0, 0);
flic_cut(FCUT_064);
_G(det)->showStaticSpr(6);
if (!_G(gameState).R40TeilKarte) {
_G(out)->fadeOut();
_G(out)->set_partialpalette(_G(pal), 255, 1);
startAadWait(607);
_G(fx_blend) = BLEND3;
}
_G(flags).NoScroll = false;
if (_G(gameState).R40TeilKarte) {
haendler();
} else {
waitShowScreen(60);
startAadWait(195);
}
_G(gameState).ScrollxStep = 2;
}
break;
case 70:
case 77:
if (_G(gameState).R28PostCar) {
_G(gameState).R28PostCar = false;
_G(out)->setPointer(nullptr);
_G(out)->cls();
flic_cut(FCUT_063);
_G(gameState).R28ChewyPump = false;
invent_2_slot(K_MASKE_INV);
_G(atds)->set_all_ats_str(209, 0, ATS_DATA);
_G(gameState).room_e_obj[69].Attribut = 255;
load_chewy_taf(CHEWY_NORMAL);
setPersonPos(480, 118, P_HOWARD, P_LEFT);
setPersonPos(440, 146, P_CHEWY, P_RIGHT);
_G(fx_blend) = BLEND_NONE;
_G(flags).ExitMov = false;
_G(spieler_mi)[P_HOWARD].Mode = true;
goAutoXy(420, 113, P_HOWARD, ANI_WAIT);
_G(spieler_mi)[P_HOWARD].Mode = false;
setPersonPos(440, 146, P_CHEWY, P_LEFT);
startAadWait(193);
} else {
setPersonPos(480, 100, P_HOWARD, P_LEFT);
goAutoXy(420, 113, P_HOWARD, ANI_GO);
_G(flags).ExitMov = false;
autoMove(6, P_CHEWY);
}
break;
default:
break;
}
}
showCur();
}
}
void Room28::xit(int16 eib_nr) {
_G(gameState).R28PostCar = false;
_G(gameState).ScrollxStep = 1;
hideCur();
if (_G(gameState)._personRoomNr[P_HOWARD] == 28 && eib_nr == 69) {
_G(SetUpScreenFunc) = nullptr;
if (!_G(gameState).R28ExitTown) {
startAadWait(178);
_G(gameState).R28ExitTown = true;
}
_G(flags).ExitMov = false;
autoMove(6, P_HOWARD);
_G(gameState)._personRoomNr[P_HOWARD] = 40;
}
showCur();
}
void Room28::gedAction(int index) {
if (!index)
get_pump();
}
void Room28::haendler() {
hideCur();
_G(SetUpScreenFunc) = nullptr;
_G(gameState).R28ChewyPump = true;
delInventory(K_MASKE_INV);
_G(atds)->set_all_ats_str(209, 1, ATS_DATA);
_G(gameState).room_e_obj[69].Attribut = EXIT_TOP;
load_chewy_taf(CHEWY_PUMPKIN);
setPersonPos(480, 113, P_HOWARD, P_RIGHT);
setPersonPos(490, 146, P_CHEWY, P_RIGHT);
_G(det)->set_static_ani(2, -1);
while (_G(gameState).scrollx < 300) {
SHOULD_QUIT_RETURN;
setupScreen(DO_SETUP);
}
startAadWait(196);
_G(det)->del_static_ani(2);
_G(det)->set_static_ani(3, -1);
startAadWait(197);
_G(det)->del_static_ani(3);
_G(det)->set_static_ani(4, -1);
startAadWait(198);
_G(SetUpScreenFunc) = setup_func;
autoMove(4, P_CHEWY);
hideCur();
autoMove(3, P_CHEWY);
setPersonSpr(P_RIGHT, P_CHEWY);
_G(det)->del_static_ani(4);
waitShowScreen(28);
startAadWait(199);
invent_2_slot(DOLLAR175_INV);
}
void Room28::setup_func() {
calc_person_look();
int16 x = (_G(moveState)[P_CHEWY].Xypos[0] > 350) ? 420 : 320;
goAutoXy(x, 113, P_HOWARD, ANI_GO);
}
void Room28::use_surimy() {
int16 dia_nr;
int16 ani_nr;
if (!_G(gameState).R28SurimyCar) {
hideCur();
_G(flags).NoScroll = true;
auto_scroll(0, 0);
_G(gameState).R28SurimyCar = true;
start_spz_wait(CH_LGET_U, 1, false, P_CHEWY);
flic_cut(FCUT_055);
flic_cut(FCUT_056);
ani_nr = CH_TALK3;
dia_nr = 140;
_G(atds)->set_all_ats_str(205, 1, ATS_DATA);
_G(atds)->set_all_ats_str(222, 1, ATS_DATA);
} else {
ani_nr = CH_TALK5;
dia_nr = 139;
_G(obj)->calc_rsi_flip_flop(SIB_AUTO_R28);
}
_G(obj)->calc_all_static_detail();
start_spz(ani_nr, 255, ANI_FRONT, P_CHEWY);
startAadWait(dia_nr);
_G(flags).NoScroll = false;
showCur();
}
void Room28::set_pump() {
hideCur();
if (_G(gameState)._personRoomNr[P_CHEWY] == 28) {
if (!_G(flags).AutoAniPlay) {
_G(flags).AutoAniPlay = true;
if (_G(moveState)[P_CHEWY].Xypos[0] < 380)
autoMove(5, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
int16 tmp = (_G(person_end_phase)[P_CHEWY] == P_RIGHT) ? 1 : 0;
delInventory(K_MASKE_INV);
_G(det)->setDetailPos(tmp, _G(moveState)[P_CHEWY].Xypos[0], _G(moveState)[P_CHEWY].Xypos[1]);
if (_G(gameState).R28PumpTxt1 < 3) {
start_aad(137);
++_G(gameState).R28PumpTxt1;
}
startSetAILWait(tmp, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
load_chewy_taf(CHEWY_PUMPKIN);
_G(gameState).R28ChewyPump = true;
if (_G(gameState).R39TranslatorUsed) {
_G(gameState).room_e_obj[69].Attribut = EXIT_TOP;
} else {
_G(atds)->set_all_ats_str(209, 1, ATS_DATA);
}
if (_G(gameState)._personRoomNr[P_HOWARD] == 28 && _G(gameState).R28PumpTxt < 3) {
stopPerson(P_HOWARD);
_G(SetUpScreenFunc) = nullptr;
g_engine->_sound->waitForSpeechToFinish();
startAadWait(177);
_G(SetUpScreenFunc) = setup_func;
++_G(gameState).R28PumpTxt;
}
_G(flags).AutoAniPlay = false;
}
} else {
startAtsWait(20, TXT_MARK_USE, 14, INV_USE_DEF);
}
showCur();
}
void Room28::get_pump() {
if (_G(gameState).R28ChewyPump) {
hideCur();
stopPerson(P_CHEWY);
_G(gameState).R28ChewyPump = false;
_G(gameState)._personHide[P_CHEWY] = true;
int16 tmp = (_G(person_end_phase)[P_CHEWY] == P_RIGHT) ? 1 : 0;
_G(det)->setDetailPos(tmp, _G(moveState)[P_CHEWY].Xypos[0], _G(moveState)[P_CHEWY].Xypos[1]);
startSetAILWait(tmp, 1, ANI_BACK);
invent_2_slot(K_MASKE_INV);
_G(atds)->set_all_ats_str(209, 0, ATS_DATA);
_G(gameState).room_e_obj[69].Attribut = 255;
_G(gameState)._personHide[P_CHEWY] = false;
load_chewy_taf(CHEWY_NORMAL);
if (_G(gameState).R28PumpTxt1 < 3) {
start_spz(CH_TALK3, 255, ANI_FRONT, P_CHEWY);
startAadWait(138);
}
showCur();
}
}
int16 Room28::use_breifkasten() {
int16 action_flag = false;
if (_G(gameState).R28LetterBox && !_G(cur)->usingInventoryCursor()) {
action_flag = true;
hideCur();
_G(gameState).R28LetterBox = false;
autoMove(7, P_CHEWY);
start_spz_wait(CH_LGET_O, 1, false, P_CHEWY);
_G(det)->hideStaticSpr(8);
_G(det)->hideStaticSpr(9);
_G(det)->showStaticSpr(7);
autoMove(8, P_CHEWY);
start_spz(CH_LGET_O, 1, ANI_FRONT, P_CHEWY);
startAadWait(179);
_G(atds)->set_all_ats_str(206, 0, ATS_DATA);
showCur();
invent_2_slot(MANUSKRIPT_INV);
_G(gameState).R28Manuskript = true;
}
return action_flag;
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,46 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM28_H
#define CHEWY_ROOMS_ROOM28_H
namespace Chewy {
namespace Rooms {
class Room28 {
static void haendler();
static void setup_func();
static void get_pump();
public:
static void entry(int16 eib_nr);
static void xit(int16 eib_nr);
static void gedAction(int index);
static void use_surimy();
static void set_pump();
static int16 use_breifkasten();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,185 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/rooms/room29.h"
namespace Chewy {
namespace Rooms {
static const AniBlock ABLOCK26[3] = {
{ 0, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 0, 1, ANI_BACK, ANI_WAIT, 0 },
{ 0, 1, ANI_FRONT, ANI_WAIT, 0 },
};
static const AniBlock ABLOCK27[5] = {
{ 0, 1, ANI_BACK, ANI_WAIT, 0 },
{ 0, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 0, 1, ANI_BACK, ANI_WAIT, 0 },
{ 0, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 0, 1, ANI_BACK, ANI_WAIT, 0 },
};
void Room29::entry() {
if (_G(gameState).R29Schlauch1) {
_G(det)->showStaticSpr(7);
} else if (_G(gameState).R29WaterHose) {
_G(det)->showStaticSpr(8);
_G(det)->showStaticSpr(10);
}
if (_G(gameState).R29AutoSitz) {
if (_G(gameState).ChewyAni == CHEWY_ROCKER)
_G(atds)->setControlBit(212, ATS_ACTIVE_BIT);
else
_G(det)->showStaticSpr(9);
}
_G(gameState).ScrollxStep = 2;
}
void Room29::xit() {
if (_G(obj)->checkInventory(PUMPE_INV))
delInventory(PUMPE_INV);
}
int16 Room29::use_pumpe() {
int16 action_flag = false;
if (!_G(gameState).R29Pumpe) {
hideCur();
if (isCurInventory(SCHLAUCH_INV)) {
action_flag = true;
_G(gameState).R29Pumpe = true;
_G(gameState).R29Schlauch1 = true;
autoMove(1, P_CHEWY);
start_spz_wait(CH_LGET_O, 1, false, P_CHEWY);
_G(det)->showStaticSpr(7);
_G(atds)->delControlBit(218, ATS_ACTIVE_BIT);
delInventory(SCHLAUCH_INV);
} else if (!_G(cur)->usingInventoryCursor()) {
action_flag = true;
startAadWait(62);
}
showCur();
}
return action_flag;
}
int16 Room29::getWaterHose() {
int16 action_flag = false;
if (_G(gameState).R29Schlauch1 && !_G(cur)->usingInventoryCursor()) {
action_flag = true;
hideCur();
autoMove(2, P_CHEWY);
start_spz_wait(CH_LGET_U, 1, false, P_CHEWY);
new_invent_2_cur(PUMPE_INV);
showCur();
}
return action_flag;
}
bool Room29::useWaterHose() {
bool result = false;
if (isCurInventory(PUMPE_INV)) {
result = true;
hideCur();
autoMove(2, P_CHEWY);
start_spz_wait(CH_LGET_U, 1, false, P_CHEWY);
_G(det)->hideStaticSpr(7);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(4, 1, ANI_FRONT);
_G(det)->showStaticSpr(8);
_G(det)->showStaticSpr(10);
_G(atds)->delControlBit(219, ATS_ACTIVE_BIT);
_G(atds)->set_all_ats_str(218, 1, ATS_DATA);
_G(gameState).R29Schlauch1 = false;
_G(gameState).R29WaterHose = true;
delInventory(PUMPE_INV);
setPersonPos(308, 105, P_CHEWY, P_RIGHT);
_G(gameState)._personHide[P_CHEWY] = false;
showCur();
}
return result;
}
void Room29::schlitz_sitz() {
if (!_G(gameState).R29AutoSitz) {
hideCur();
_G(gameState).R29AutoSitz = true;
_G(gameState)._personHide[P_CHEWY] = true;
_G(det)->hideStaticSpr(4);
_G(det)->showStaticSpr(11);
startAniBlock(3, ABLOCK26);
_G(det)->showStaticSpr(9);
_G(det)->hideStaticSpr(11);
_G(det)->startDetail(2, 255, ANI_FRONT);
startAadWait(63);
_G(det)->stopDetail(2);
_G(atds)->delControlBit(212, ATS_ACTIVE_BIT);
_G(gameState)._personHide[P_CHEWY] = false;
_G(mouseLeftClick) = false;
g_events->_kbInfo._scanCode = Common::KEYCODE_INVALID;
showCur();
}
}
int16 Room29::zaun_sprung() {
int16 action_flag = false;
if (_G(gameState).R29AutoSitz && !_G(cur)->usingInventoryCursor()) {
hideCur();
action_flag = true;
autoMove(3, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startDetailFrame(3, 1, ANI_FRONT, 7);
_G(det)->hideStaticSpr(9);
startAniBlock(5, ABLOCK27);
setupScreen(DO_SETUP);
showCur();
switchRoom(37);
_G(gameState)._personHide[P_CHEWY] = false;
}
return action_flag;
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,42 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM29_H
#define CHEWY_ROOMS_ROOM29_H
namespace Chewy {
namespace Rooms {
class Room29 {
public:
static void entry();
static void xit();
static int16 use_pumpe();
static int16 getWaterHose();
static bool useWaterHose();
static void schlitz_sitz();
static int16 zaun_sprung();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,219 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room31.h"
#include "chewy/sound.h"
namespace Chewy {
namespace Rooms {
static const MovLine SURIMY_MPKT[2] = {
{ { 79, 152, 150 }, 1, 6 },
{ { 273, 220, 150 }, 1, 6 }
};
static const AniBlock ABLOCK30[3] = {
{ 0, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 1, 4, ANI_FRONT, ANI_WAIT, 0 },
{ 2, 1, ANI_FRONT, ANI_WAIT, 0 },
};
void Room31::entry() {
calc_luke();
surimy_go();
}
void Room31::surimy_go() {
if (!_G(gameState).R39ScriptOk && _G(gameState).R25SurimyLauf) {
if (_G(gameState).R31SurimyGo >= 3) {
hideCur();
_G(gameState).R31SurimyGo = 0;
_G(det)->load_taf_seq(39, 8, nullptr);
_G(auto_obj) = 1;
_G(mov_phasen)[SURIMY_OBJ].AtsText = 0;
_G(mov_phasen)[SURIMY_OBJ].Lines = 2;
_G(mov_phasen)[SURIMY_OBJ].Repeat = 1;
_G(mov_phasen)[SURIMY_OBJ].ZoomFak = 0;
_G(auto_mov_obj)[SURIMY_OBJ].Id = AUTO_OBJ0;
_G(auto_mov_vector)[SURIMY_OBJ].Delay = _G(gameState).DelaySpeed + 2;
_G(auto_mov_obj)[SURIMY_OBJ].Mode = true;
init_auto_obj(SURIMY_OBJ, &SURIMY_TAF19_PHASES[0][0], 2, (const MovLine *)SURIMY_MPKT);
start_spz(CH_TALK5, 255, ANI_FRONT, P_CHEWY);
startAadWait(157);
wait_auto_obj(SURIMY_OBJ);
_G(auto_obj) = 0;
showCur();
} else {
++_G(gameState).R31SurimyGo;
}
}
}
void Room31::calc_luke() {
if (!_G(gameState).R31KlappeZu) {
for (int16 i = 0; i < 3; i++)
_G(det)->showStaticSpr(5 + i);
_G(atds)->set_all_ats_str(244, 1, ATS_DATA);
_G(atds)->delControlBit(245, ATS_ACTIVE_BIT);
_G(gameState).room_e_obj[75].Attribut = EXIT_BOTTOM;
} else {
for (int16 i = 0; i < 3; i++)
_G(det)->hideStaticSpr(5 + i);
_G(atds)->set_all_ats_str(244, 0, ATS_DATA);
_G(atds)->setControlBit(245, ATS_ACTIVE_BIT);
_G(gameState).room_e_obj[75].Attribut = 255;
}
}
int16 Room31::open_luke() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursor() && _G(gameState).R31KlappeZu) {
action_flag = true;
hideCur();
autoMove(2, P_CHEWY);
start_spz_wait(CH_LGET_U, 1, false, P_CHEWY);
_G(gameState).R31KlappeZu = false;
_G(det)->playSound(3, 0);
calc_luke();
showCur();
}
return action_flag;
}
int16 Room31::close_luke_proc1() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R31KlappeZu) {
action_flag = true;
hideCur();
autoMove(2, P_CHEWY);
start_spz_wait(CH_LGET_O, 1, false, P_CHEWY);
_G(gameState).R31KlappeZu = true;
_G(det)->playSound(3, 0);
calc_luke();
showCur();
}
return action_flag;
}
void Room31::close_luke_proc3() {
if (!_G(gameState).R31KlappeZu) {
hideCur();
autoMove(2, P_CHEWY);
start_spz_wait(13, 1, false, P_CHEWY);
_G(gameState).R31KlappeZu = true;
_G(det)->playSound(3, 0);
_G(det)->playSound(3, 1);
calc_luke();
showCur();
}
}
int16 Room31::use_topf() {
int16 dia_nr = -1;
int16 ani_nr = 0;
int16 action_flag = false;
hideCur();
if (_G(cur)->usingInventoryCursor()) {
if (_G(gameState).R31PflanzeWeg) {
if (isCurInventory(K_KERNE_INV)) {
_G(gameState).R31KoernerDa = true;
autoMove(1, P_CHEWY);
start_spz_wait(CH_LGET_O, 1, false, P_CHEWY);
delInventory(_G(cur)->getInventoryCursor());
ani_nr = CH_TALK3;
dia_nr = 150;
_G(atds)->set_all_ats_str(242, 2, ATS_DATA);
} else if (isCurInventory(WATER_FILLED_BOTTLE_INV)) {
if (_G(gameState).R31KoernerDa) {
_G(gameState).R31Wasser = true;
autoMove(1, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startAniBlock(3, ABLOCK30);
_G(gameState)._personHide[P_CHEWY] = false;
delInventory(_G(cur)->getInventoryCursor());
_G(obj)->addInventory(EMPTY_MILK_BOTTLE_INV, &_G(room_blk));
inventory_2_cur(EMPTY_MILK_BOTTLE_INV);
ani_nr = CH_TALK6;
dia_nr = 151;
_G(atds)->set_all_ats_str(242, 3, ATS_DATA);
} else {
ani_nr = CH_TALK5;
dia_nr = 152;
}
} else if (isCurInventory(SURIMY_INV)) {
if (!_G(gameState).R31SurFurz) {
if (_G(gameState).R31Wasser) {
if (!_G(gameState).R28SurimyCar) {
ani_nr = CH_TALK5;
dia_nr = 180;
} else {
close_luke_proc3();
autoMove(3, P_CHEWY);
flic_cut(FCUT_046);
register_cutscene(13);
_G(gameState).R31SurFurz = true;
ani_nr = CH_TALK6;
dia_nr = 156;
_G(atds)->set_all_ats_str(242, 4, ATS_DATA);
cur_2_inventory();
}
} else {
ani_nr = CH_TALK5;
dia_nr = 155;
}
}
} else {
ani_nr = CH_TALK5;
dia_nr = 153;
}
} else {
ani_nr = CH_TALK5;
dia_nr = 154;
}
}
if (dia_nr != -1) {
start_spz(ani_nr, 255, ANI_FRONT, P_CHEWY);
startAadWait(dia_nr);
action_flag = true;
}
showCur();
return action_flag;
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,44 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM31_H
#define CHEWY_ROOMS_ROOM31_H
namespace Chewy {
namespace Rooms {
class Room31 {
private:
static void surimy_go();
static void calc_luke();
static void close_luke_proc3();
public:
static void entry();
static int16 open_luke();
static int16 close_luke_proc1();
static int16 use_topf();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,171 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/rooms/room32.h"
namespace Chewy {
namespace Rooms {
void Room32::entry() {
if (_G(gameState).R32HowardWeg)
_G(det)->hideStaticSpr(0);
if (!_G(gameState).R32Script && _G(gameState).R32UseSchreib)
_G(det)->showStaticSpr(5);
}
int16 Room32::use_howard() {
int16 dia_nr = 0;
int16 ani_nr = 0;
int16 action_flag = false;
hideCur();
if (isCurInventory(TRICHTER_INV)) {
if (_G(gameState).R33MunterGet) {
autoMove(1, P_CHEWY);
cur_2_inventory();
remove_inventory(MUNTER_INV);
register_cutscene(11);
flic_cut(FCUT_043);
_G(atds)->setControlBit(230, ATS_ACTIVE_BIT);
start_spz(CH_TALK12, 255, ANI_FRONT, P_CHEWY);
startAadWait(75);
waitShowScreen(5);
autoMove(5, P_CHEWY);
waitShowScreen(10);
start_spz(CH_TALK12, 255, ANI_FRONT, P_CHEWY);
startAadWait(125);
waitShowScreen(10);
_G(det)->hideStaticSpr(0);
startDetailFrame(0, 1, ANI_FRONT, 9);
startSetAILWait(1, 1, ANI_BACK);
_G(det)->showStaticSpr(7);
_G(det)->showStaticSpr(6);
waitShowScreen(20);
_G(det)->hideStaticSpr(7);
startSetAILWait(1, 1, ANI_FRONT);
start_spz(CH_TALK3, 255, ANI_FRONT, P_CHEWY);
ani_nr = CH_TALK3;
dia_nr = 164;
_G(gameState).R32HowardWeg = true;
_G(gameState).R39HowardDa = true;
remove_inventory(TRICHTER_INV);
} else {
ani_nr = CH_TALK12;
dia_nr = 73;
}
} else if (isCurInventory(MUNTER_INV)) {
ani_nr = CH_TALK12;
dia_nr = 74;
}
if (dia_nr) {
start_spz(ani_nr, 255, ANI_FRONT, P_CHEWY);
startAadWait(dia_nr);
action_flag = true;
}
showCur();
return action_flag;
}
void Room32::use_schreibmaschine() {
int16 dia_nr = -1;
int16 ani_nr = -1;
hideCur();
if (_G(gameState).R32HowardWeg) {
if (_G(cur)->usingInventoryCursor()) {
switch (_G(cur)->getInventoryCursor()) {
case CYB_KRONE_INV:
if (!_G(gameState).R32UseSchreib) {
if (!_G(gameState).R32PapierOk) {
ani_nr = CH_TALK12;
dia_nr = 87;
} else {
autoMove(3, P_CHEWY);
_G(gameState).R32UseSchreib = true;
cur_2_inventory();
flic_cut(FCUT_044);
register_cutscene(12);
_G(det)->showStaticSpr(5);
_G(atds)->set_all_ats_str(203, 1, ATS_DATA);
ani_nr = CH_TALK3;
dia_nr = 88;
_G(atds)->set_ats_str(231, TXT_MARK_LOOK, 0, ATS_DATA);
}
}
break;
case PAPIER_INV:
autoMove(2, P_CHEWY);
_G(gameState).R32PapierOk = true;
start_spz_wait(CH_LGET_O, 1, false, P_CHEWY);
delInventory(_G(cur)->getInventoryCursor());
_G(atds)->set_ats_str(231, TXT_MARK_LOOK, 1, ATS_DATA);
ani_nr = CH_TALK3;
dia_nr = 86;
break;
default:
ani_nr = CH_TALK12;
dia_nr = 90;
break;
}
} else {
ani_nr = CH_TALK12;
dia_nr = 89;
}
} else {
ani_nr = CH_TALK12;
dia_nr = 92;
}
start_spz(ani_nr, 255, ANI_FRONT, P_CHEWY);
startAadWait(dia_nr);
showCur();
}
int16 Room32::get_script() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R32Script && _G(gameState).R32UseSchreib) {
action_flag = true;
_G(gameState).R32Script = true;
autoMove(4, P_CHEWY);
invent_2_slot(MANUSKRIPT_INV);
start_spz_wait(CH_LGET_U, 1, false, P_CHEWY);
_G(det)->hideStaticSpr(5);
_G(atds)->set_all_ats_str(203, 0, ATS_DATA);
start_spz(CH_TALK3, 1, ANI_FRONT, P_CHEWY);
startAadWait(91);
}
return action_flag;
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,39 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM32_H
#define CHEWY_ROOMS_ROOM32_H
namespace Chewy {
namespace Rooms {
class Room32 {
public:
static void entry();
static int16 get_script();
static void use_schreibmaschine();
static int16 use_howard();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,220 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room33.h"
namespace Chewy {
namespace Rooms {
static const MovLine SURIMY_MPKT[2] = {
{ { 65, 115, 150 }, 1, 6 },
{ { 300, 151, 150 }, 1, 6 }
};
void Room33::entry() {
if (_G(gameState).R33MunterGet)
_G(det)->hideStaticSpr(3);
surimy_go();
}
void Room33::surimy_go() {
if (!_G(gameState).R39ScriptOk && _G(gameState).R25SurimyLauf) {
if (_G(gameState).R33SurimyGo >= 4) {
hideCur();
_G(gameState).R33SurimyGo = 0;
_G(det)->load_taf_seq(39, 8, nullptr);
_G(auto_obj) = 1;
_G(mov_phasen)[SURIMY_OBJ].AtsText = 0;
_G(mov_phasen)[SURIMY_OBJ].Lines = 2;
_G(mov_phasen)[SURIMY_OBJ].Repeat = 1;
_G(mov_phasen)[SURIMY_OBJ].ZoomFak = 0;
_G(auto_mov_obj)[SURIMY_OBJ].Id = AUTO_OBJ0;
_G(auto_mov_vector)[SURIMY_OBJ].Delay = _G(gameState).DelaySpeed + 2;
_G(auto_mov_obj)[SURIMY_OBJ].Mode = true;
init_auto_obj(SURIMY_OBJ, &SURIMY_TAF19_PHASES[0][0], 2, (const MovLine *)SURIMY_MPKT);
start_spz(CH_TALK5, 255, ANI_FRONT, P_CHEWY);
startAadWait(158);
wait_auto_obj(SURIMY_OBJ);
_G(auto_obj) = 0;
showCur();
} else {
++_G(gameState).R33SurimyGo;
}
}
}
void Room33::look_schublade() {
if (!_G(gameState).R33SchubFirst) {
_G(gameState).R33SchubFirst = true;
hideCur();
autoMove(1, P_CHEWY);
_G(atds)->set_ats_str(210, TXT_MARK_NAME, 1, ATS_DATA);
_G(atds)->set_ats_str(210, TXT_MARK_USE, 1, ATS_DATA);
showCur();
}
}
int16 Room33::use_schublade() {
int16 action_flag = false;
if (_G(gameState).R33SchubFirst && !_G(cur)->usingInventoryCursor() && !_G(gameState).R33Messer) {
hideCur();
action_flag = true;
_G(gameState).R33Messer = true;
_G(atds)->set_ats_str(210, TXT_MARK_NAME, 0, ATS_DATA);
_G(atds)->set_ats_str(210, TXT_MARK_LOOK, 1, ATS_DATA);
_G(atds)->set_ats_str(210, TXT_MARK_USE, 2, ATS_DATA);
start_spz(CH_LGET_O, 1, ANI_FRONT, P_CHEWY);
invent_2_slot(KNIFE_INV);
showCur();
}
return action_flag;
}
void Room33::use_maschine() {
int16 dia_nr;
int16 ani_nr;
hideCur();
if (!_G(gameState).R33MunterOk) {
autoMove(4, P_CHEWY);
bool hocker = false;
if (_G(cur)->usingInventoryCursor()) {
bool action = true;
switch (_G(cur)->getInventoryCursor()) {
case MILCH_INV:
_G(gameState).R33Munter[3] = true;
invent_2_slot(EMPTY_MILK_BOTTLE_INV);
break;
case K_FLEISCH_INV:
_G(gameState).R33Munter[1] = true;
break;
case EGGS_INV:
_G(gameState).R33Munter[2] = true;
break;
case KAFFEE_INV:
_G(gameState).R33Munter[0] = true;
break;
default:
action = false;
break;
}
if (action) {
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(0, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
setPersonPos(128, 65, P_CHEWY, P_LEFT);
start_spz_wait(CH_LGET_O, 1, false, P_CHEWY);
hocker = true;
delInventory(_G(cur)->getInventoryCursor());
ani_nr = CH_TALK12;
if (calc_muntermacher()) {
_G(gameState).R33MunterOk = true;
dia_nr = 69;
} else {
dia_nr = 67;
}
} else {
ani_nr = CH_TALK4;
dia_nr = 68;
}
} else {
ani_nr = CH_TALK12;
dia_nr = 66;
}
start_spz(ani_nr, 255, ANI_FRONT, P_CHEWY);
startAadWait(dia_nr);
if (_G(gameState).R33MunterOk) {
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(2, 1, ANI_FRONT);
flic_cut(FCUT_031);
_G(gameState)._personHide[P_CHEWY] = false;
start_spz(CH_TALK3, 255, ANI_FRONT, P_CHEWY);
startAadWait(71);
_G(atds)->delControlBit(225, ATS_ACTIVE_BIT);
}
if (hocker) {
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(1, 1, ANI_FRONT);
setPersonPos(64, 100, P_CHEWY, P_LEFT);
}
_G(gameState)._personHide[P_CHEWY] = false;
} else {
startAadWait(70);
}
showCur();
}
bool Room33::calc_muntermacher() {
bool ret = true;
for (int16 i = 0; i < 4; i++) {
if (_G(gameState).R33Munter[i] == false)
ret = false;
}
return ret;
}
int16 Room33::get_munter() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R33MunterGet && _G(gameState).R33MunterOk) {
action_flag = true;
hideCur();
_G(gameState).R33MunterGet = true;
autoMove(4, P_CHEWY);
start_spz_wait(CH_LGET_O, 1, false, P_CHEWY);
invent_2_slot(MUNTER_INV);
_G(atds)->setControlBit(225, ATS_ACTIVE_BIT);
_G(det)->hideStaticSpr(3);
start_spz(CH_TALK3, 255, ANI_FRONT, P_CHEWY);
startAadWait(72);
showCur();
}
return action_flag;
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,44 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM33_H
#define CHEWY_ROOMS_ROOM33_H
namespace Chewy {
namespace Rooms {
class Room33 {
private:
static void surimy_go();
static bool calc_muntermacher();
public:
static void entry();
static void look_schublade();
static int16 use_schublade();
static void use_maschine();
static int16 get_munter();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,73 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room34.h"
namespace Chewy {
namespace Rooms {
void Room34::entry() {
if (_G(flags).LoadGame)
use_kuehlschrank();
}
bool Room34::use_kuehlschrank() {
bool result = false;
if (!_G(cur)->usingInventoryCursor()) {
result = true;
if (!_G(flags).LoadGame) {
hideCur();
autoMove(3, P_CHEWY);
_G(mouseLeftClick) = false;
start_spz_wait((_G(gameState).ChewyAni == CHEWY_ROCKER) ? CH_ROCK_GET2 : CH_LGET_O, 1, false, P_CHEWY);
showCur();
}
_G(gameState)._personHide[P_CHEWY] = true;
_G(flags).ChewyDontGo = true;
if (!_G(flags).LoadGame) {
switchRoom(34);
}
setPersonPos(160, 70, P_CHEWY, -1);
}
return result;
}
void Room34::xit_kuehlschrank() {
_G(gameState)._personHide[P_CHEWY] = false;
setPersonPos(54, 111, P_CHEWY, -1);
switchRoom(33);
_G(flags).ChewyDontGo = false;
_G(mouseLeftClick) = false;
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,38 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM34_H
#define CHEWY_ROOMS_ROOM34_H
namespace Chewy {
namespace Rooms {
class Room34 {
public:
static void entry();
static bool use_kuehlschrank();
static void xit_kuehlschrank();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,148 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/ani_dat.h"
#include "chewy/room.h"
#include "chewy/rooms/room35.h"
namespace Chewy {
namespace Rooms {
static const AniBlock ABLOCK28[2] = {
{ 4, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 5, 3, ANI_FRONT, ANI_WAIT, 0 },
};
void Room35::entry() {
if (_G(gameState).R35Schublade)
_G(det)->showStaticSpr(1);
}
int16 Room35::schublade() {
int16 action_flag = false;
hideCur();
if (_G(gameState).ChewyAni != CHEWY_ROCKER && !_G(cur)->usingInventoryCursor()) {
if (!_G(gameState).R35Schublade) {
action_flag = true;
autoMove(3, P_CHEWY);
start_spz_wait(CH_LGET_O, 1, false, P_CHEWY);
_G(det)->showStaticSpr(1);
_G(gameState).R35Schublade = true;
_G(atds)->set_all_ats_str(234, 1, ATS_DATA);
} else if (!_G(gameState).R35Falle) {
action_flag = true;
autoMove(3, P_CHEWY);
_G(gameState).R35Falle = true;
_G(gameState)._personHide[P_CHEWY] = true;
startAniBlock(2, ABLOCK28);
_G(gameState)._personHide[P_CHEWY] = false;
setPersonPos(33, 90, P_CHEWY, P_LEFT);
start_spz(CH_TALK5, 255, ANI_FRONT, P_CHEWY);
startAadWait(93);
_G(gameState)._personHide[P_CHEWY] = false;
_G(atds)->set_all_ats_str(234, 2, ATS_DATA);
}
}
showCur();
return action_flag;
}
int16 Room35::use_cat() {
int16 action_flag = false;
hideCur();
if (_G(gameState).ChewyAni != CHEWY_ROCKER) {
if (isCurInventory(TRANSLATOR_INV)) {
action_flag = true;
autoMove(4, P_CHEWY);
_G(gameState).R35TransCat = true;
start_spz_wait(CH_TRANS, 1, false, P_CHEWY);
flic_cut(FCUT_045);
start_spz(CH_TRANS, 1, ANI_FRONT, P_CHEWY);
startAadWait(94);
} else if (isCurInventory(PUTENKEULE_INV)) {
action_flag = true;
disable_timer();
autoMove(4, P_CHEWY);
_G(gameState).R35CatEat = true;
start_spz_wait(CH_LGET_O, 1, false, P_CHEWY);
delInventory(_G(cur)->getInventoryCursor());
_G(det)->stopDetail(0);
_G(det)->del_static_ani(0);
startSetAILWait(1, 1, ANI_FRONT);
_G(det)->startDetail(2, 1, ANI_FRONT);
startSetAILWait(3, 1, ANI_FRONT);
_G(obj)->show_sib(SIB_KNOCHEN_R35);
_G(obj)->calc_rsi_flip_flop(SIB_KNOCHEN_R35);
_G(det)->showStaticSpr(7);
_G(atds)->delControlBit(237, ATS_ACTIVE_BIT);
while (_G(det)->get_ani_status(2) && !SHOULD_QUIT) {
setupScreen(DO_SETUP);
}
_G(det)->set_static_ani(0, -1);
enable_timer();
start_spz(CH_TALK3, 255, ANI_FRONT, P_CHEWY);
startAadWait(95);
}
}
showCur();
return action_flag;
}
void Room35::talk_cat() {
hideCur();
autoMove(4, P_CHEWY);
if (_G(gameState).R35TransCat) {
int16 dia_nr;
if (!_G(gameState).R35CatEat) {
dia_nr = 7;
} else {
dia_nr = 8;
}
_G(gameState)._personHide[P_CHEWY] = true;
switchRoom(36);
showCur();
startDialogCloseupWait(dia_nr);
_G(gameState)._personHide[P_CHEWY] = false;
switchRoom(35);
} else {
start_spz(CH_TALK5, 255, ANI_FRONT, P_CHEWY);
startAadWait(96);
}
showCur();
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,39 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM35_H
#define CHEWY_ROOMS_ROOM35_H
namespace Chewy {
namespace Rooms {
class Room35 {
public:
static void entry();
static int16 schublade();
static int16 use_cat();
static void talk_cat();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,326 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/ani_dat.h"
#include "chewy/room.h"
#include "chewy/rooms/room37.h"
#include "chewy/sound.h"
namespace Chewy {
namespace Rooms {
static const AniBlock ABLOCK31[3] = {
{ 0, 1, ANI_FRONT, ANI_GO, 0 },
{ 1, 2, ANI_FRONT, ANI_GO, 0 },
{ 5, 1, ANI_BACK, ANI_WAIT, 0 },
};
void Room37::entry() {
_G(zoom_horizont) = 100;
_G(flags).ZoomMov = true;
_G(zoom_mov_fak) = 3;
_G(SetUpScreenFunc) = setup_func;
_G(obj)->show_sib(74);
_G(obj)->show_sib(75);
if (!_G(flags).LoadGame) {
_G(gameState).scrollx = 124;
setPersonPos(219, 66, P_CHEWY, P_RIGHT);
}
if (!_G(gameState).R37RoosterFoughtWithDog) {
_G(timer_nr)[1] = _G(room)->set_timer(7, 5);
_G(det)->set_static_ani(7, -1);
if (!_G(gameState).R37DogAshamed) {
_G(timer_nr)[0] = _G(room)->set_timer(3, 4);
_G(det)->set_static_ani(3, -1);
_G(det)->playSound(3, 0);
}
}
if (_G(gameState).R37TakenDenturesFromGlass) {
_G(det)->hideStaticSpr(9);
if (_G(gameState).R37RoosterFoughtWithDog) {
_G(det)->hideStaticSpr(8);
} else if (_G(gameState).R37DogAshamed) {
_G(det)->showStaticSpr(0);
_G(atds)->set_all_ats_str(250, 1, ATS_DATA);
_G(atds)->set_all_ats_str(256, 1, ATS_DATA);
_G(atds)->delControlBit(251, ATS_ACTIVE_BIT);
}
}
}
void Room37::gedAction(int index) {
if (!index) {
dog_bell();
} else if (index == 1) {
if (_G(gameState).R37RoosterFoughtWithDog && !_G(gameState).R37Mes) {
stopPerson(P_CHEWY);
_G(gameState).R37Mes = true;
start_spz(CH_TALK6, 255, ANI_FRONT, P_CHEWY);
startAadWait(142);
}
}
}
void Room37::setup_func() {
if (_G(mouseLeftClick) && !_G(gameState).R37RoosterFoughtWithDog &&
_G(menu_item) == CUR_WALK) {
if ((g_events->_mousePos.x + _G(gameState).scrollx > 380 && g_events->_mousePos.y > 120) ||
(g_events->_mousePos.x + _G(gameState).scrollx > 482)) {
// Don't allow moving into chicken coop area
// until the rooster has left
autoMove(7, P_CHEWY);
_G(mouseLeftClick) = false;
}
}
}
short Room37::useSeesaw() {
if (_G(cur)->usingInventoryCursor()) {
if (isCurInventory(H_FUTTER_INV)) {
hideCur();
autoMove(0, P_CHEWY);
_G(flags).NoScroll = true;
auto_scroll(129, 0);
start_spz(CH_TALK6, 255, ANI_FRONT, P_CHEWY);
startAadWait(159);
delInventory(_G(cur)->getInventoryCursor());
flic_cut(FCUT_047);
_G(flags).NoScroll = false;
showCur();
_G(gameState).scrollx = 269;
setPersonPos(388, 119, P_CHEWY, P_RIGHT);
switchRoom(29);
_G(mouseLeftClick) = false;
} else {
start_spz(CH_TALK5, 255, ANI_FRONT, P_CHEWY);
startAadWait(160);
}
return true;
} else {
return false;
}
}
int16 Room37::useGlass() {
if (!_G(gameState).R37TakenDenturesFromGlass) {
if (isCurInventory(FISHING_ROD_INV)) {
_G(flags).NoScroll = true;
hideCur();
autoMove(5, P_CHEWY);
_G(flags).NoScroll = true;
auto_scroll(146, 0);
start_spz(CH_TALK6, 255, ANI_FRONT, P_CHEWY);
startAadWait(147);
delInventory(_G(cur)->getInventoryCursor());
flic_cut(FCUT_048);
flic_cut(FCUT_049);
invent_2_slot(DENTURES_INV);
_G(det)->hideStaticSpr(9);
_G(atds)->set_all_ats_str(250, 1, ATS_DATA);
_G(atds)->set_all_ats_str(256, 1, ATS_DATA);
_G(atds)->delControlBit(251, ATS_ACTIVE_BIT);
_G(obj)->show_sib(SIB_HFUTTER2_R37);
_G(gameState).R37TakenDenturesFromGlass = true;
start_spz(CH_TALK3, 255, ANI_FRONT, P_CHEWY);
startAadWait(146);
showCur();
_G(flags).NoScroll = false;
_G(det)->playSound(3, 0);
} else {
autoMove(4, P_CHEWY);
}
return true;
} else {
return false;
}
}
void Room37::dog_bell() {
int16 dia_nr = -1;
int16 ani_nr = 0;
hideCur();
if (!_G(flags).AutoAniPlay) {
_G(flags).AutoAniPlay = true;
_G(det)->stopSound(0); // nr 3, sslot 0
if (!_G(gameState).R37TakenDenturesFromGlass) {
stopPerson(P_CHEWY);
_G(flags).ChAutoMov = false;
setPersonSpr(P_LEFT, P_CHEWY);
_G(flags).NoScroll = true;
auto_scroll(178, 0);
disable_timer();
_G(det)->stopDetail(3);
_G(det)->del_static_ani(3);
startSetAILWait(5, 1, ANI_FRONT);
_G(det)->hideStaticSpr(9);
startSetAILWait(6, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = true;
_G(det)->startDetail(11, 255, ANI_FRONT);
flic_cut(FCUT_050);
startSetAILWait(6, 1, ANI_BACK);
_G(det)->stopDetail(11);
setPersonPos(326, 85, P_CHEWY, P_LEFT);
_G(gameState)._personHide[P_CHEWY] = false;
_G(det)->showStaticSpr(9);
startAniBlock(3, ABLOCK31);
_G(det)->set_static_ani(3, -1);
_G(det)->playSound(3, 0);
// _G(det)->playSound(3);
enable_timer();
dia_nr = 149;
ani_nr = CH_TALK12;
} else if (!_G(gameState).R37DogAshamed) {
stopPerson(P_CHEWY);
setPersonSpr(P_LEFT, P_CHEWY);
_G(flags).NoScroll = true;
auto_scroll(178, 0);
_G(room)->set_timer_status(3, TIMER_STOP);
_G(det)->del_static_ani(3);
_G(det)->stopDetail(3);
startSetAILWait(4, 1, ANI_FRONT);
flic_cut(FCUT_051);
_G(gameState).scrollx = 104;
flic_cut(FCUT_054);
register_cutscene(10);
_G(det)->showStaticSpr(0);
_G(gameState).R37DogAshamed = true;
dia_nr = 148;
ani_nr = CH_TALK6;
}
_G(flags).AutoAniPlay = false;
if (dia_nr != -1) {
start_spz(ani_nr, 255, ANI_FRONT, P_CHEWY);
startAadWait(dia_nr);
}
}
_G(flags).NoScroll = false;
showCur();
}
void Room37::talkWithRooster() {
hideCur();
autoMove(7, P_CHEWY);
showCur();
if (!_G(gameState).R37UsedTranslatorOnRooster) {
hideCur();
startAadWait(145);
showCur();
} else {
roosterDialog();
}
}
void Room37::useRooster() {
if (isCurInventory(TRANSLATOR_INV)) {
hideCur();
autoMove(7, P_CHEWY);
_G(gameState).R37UsedTranslatorOnRooster = true;
start_spz_wait(CH_TRANS, 1, false, P_CHEWY);
flic_cut(FCUT_052);
cur_2_inventory();
_G(menu_item) = CUR_TALK;
cursorChoice(_G(menu_item));
showCur();
roosterDialog();
} else if (_G(gameState).R37UsedTranslatorOnRooster) {
if (isCurInventory(DENTURES_INV)) {
_G(gameState).R37RoosterFoughtWithDog = true;
hideCur();
autoMove(6, P_CHEWY);
g_engine->_sound->playRoomMusic(256);
_G(room)->set_timer_status(7, TIMER_STOP);
_G(det)->stopDetail(7);
_G(det)->del_static_ani(7);
_G(det)->startDetail(9, 1, ANI_FRONT);
start_spz_wait(CH_LGET_O, 1, false, P_CHEWY);
delInventory(DENTURES_INV);
_G(flags).NoScroll = true;
auto_scroll(177, 0);
while (_G(det)->get_ani_status(9)) {
setupScreen(DO_SETUP);
SHOULD_QUIT_RETURN;
}
_G(det)->startDetail(4, 1, ANI_FRONT);
_G(det)->hideStaticSpr(0);
_G(det)->startDetail(10, 10, ANI_FRONT);
autoMove(8, P_CHEWY);
flic_cut(FCUT_053);
_G(det)->stopDetail(10);
_G(gameState).scrollx = 320;
_G(flags).NoScroll = false;
_G(atds)->setControlBit(251, ATS_ACTIVE_BIT);
_G(atds)->setControlBit(250, ATS_ACTIVE_BIT);
_G(atds)->setControlBit(256, ATS_ACTIVE_BIT);
_G(det)->hideStaticSpr(8);
start_spz(CH_TALK5, 255, ANI_FRONT, P_CHEWY);
startAadWait(141);
_G(obj)->addInventory(EGGS_INV, &_G(room_blk));
inventory_2_cur(EGGS_INV);
showCur();
}
} else if (_G(cur)->usingInventoryCursor()) {
startAadWait(143);
}
}
void Room37::roosterDialog() {
_G(gameState)._personHide[P_CHEWY] = true;
int16 tmp_scrollx = _G(gameState).scrollx;
int16 tmp_scrolly = _G(gameState).scrolly;
_G(gameState).scrollx = 0;
_G(gameState).scrolly = 0;
switchRoom(38);
startDialogCloseupWait(9);
_G(gameState)._personHide[P_CHEWY] = false;
_G(flags).LoadGame = true;
_G(gameState).scrollx = tmp_scrollx;
_G(gameState).scrolly = tmp_scrolly;
switchRoom(37);
_G(flags).LoadGame = false;
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,49 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM37_H
#define CHEWY_ROOMS_ROOM37_H
#include "common/scummsys.h"
namespace Chewy {
namespace Rooms {
class Room37 {
private:
static void setup_func();
static void roosterDialog();
static void dog_bell();
public:
static void entry();
static void gedAction(int index);
static short useSeesaw();
static int16 useGlass();
static void talkWithRooster();
static void useRooster();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,358 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/ani_dat.h"
#include "chewy/room.h"
#include "chewy/rooms/room39.h"
#include "chewy/rooms/room43.h"
namespace Chewy {
namespace Rooms {
static const uint8 TV_FLIC[] = {
FCUT_039,
FCUT_040,
FCUT_035,
FCUT_032,
FCUT_037,
FCUT_034
};
static const AniBlock ABLOCK33[2] = {
{ 2, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 3, 255, ANI_FRONT, ANI_GO, 0 },
};
static const AniBlock ABLOCK29[2] = {
{ 8, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 9, 4, ANI_FRONT, ANI_WAIT, 0 },
};
void Room39::entry() {
if (!_G(gameState).R41Einbruch) {
if (_G(gameState).R39HowardDa) {
_G(det)->showStaticSpr(10);
if (!_G(gameState).R39HowardWach)
_G(det)->startDetail(1, 255, ANI_FRONT);
else
_G(det)->set_static_ani(5, -1);
_G(atds)->delControlBit(62, ATS_ACTIVE_BIT);
}
} else {
_G(atds)->setControlBit(62, ATS_ACTIVE_BIT);
}
set_tv();
}
short Room39::use_howard() {
int16 ani_nr = 0;
int16 action_flag = false;
if (!_G(gameState).R39HowardWach) {
int16 dia_nr;
if (_G(cur)->usingInventoryCursor()) {
if (isCurInventory(MANUSKRIPT_INV)) {
hideCur();
_G(gameState).R39HowardWach = true;
_G(gameState).R39ScriptOk = true;
autoMove(3, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
_G(det)->startDetail(6, 255, ANI_FRONT);
startAadWait(170);
_G(det)->stopDetail(6);
startSetAILWait(7, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
delInventory(_G(cur)->getInventoryCursor());
_G(det)->stopDetail(1);
startAniBlock(2, ABLOCK33);
start_spz(CH_TALK6, 255, ANI_FRONT, P_CHEWY);
startAadWait(167);
_G(det)->stopDetail(3);
startSetAILWait(4, 1, ANI_FRONT);
_G(det)->set_static_ani(5, -1);
_G(atds)->set_all_ats_str(62, 1, ATS_DATA);
startAadWait(169);
showCur();
_G(gameState).PersonGlobalDia[P_HOWARD] = 10012;
_G(gameState).PersonDiaRoom[P_HOWARD] = true;
calc_person_dia(P_HOWARD);
if (_G(gameState).R41HowardDiaOK) {
ok();
}
dia_nr = -1;
action_flag = true;
} else {
ani_nr = CH_TALK11;
dia_nr = 166;
}
} else {
ani_nr = CH_TALK5;
dia_nr = 165;
}
if (dia_nr != -1) {
start_spz(ani_nr, 255, ANI_FRONT, P_CHEWY);
startAadWait(dia_nr);
action_flag = true;
}
showCur();
}
return action_flag;
}
void Room39::talk_howard() {
if (_G(gameState).R39HowardWach) {
autoMove(3, P_CHEWY);
_G(gameState).PersonGlobalDia[P_HOWARD] = 10012;
_G(gameState).PersonDiaRoom[P_HOWARD] = true;
calc_person_dia(P_HOWARD);
if (_G(gameState).R41HowardDiaOK) {
ok();
}
} else {
start_spz(CH_TALK5, 255, ANI_FRONT, P_CHEWY);
startAadWait(168);
}
}
void Room39::ok() {
_G(gameState).R41Einbruch = true;
Room43::night_small();
_G(gameState)._personRoomNr[P_HOWARD] = 27;
_G(obj)->show_sib(SIB_SURIMY_R27);
_G(obj)->show_sib(SIB_ZEITUNG_R27);
_G(obj)->calc_rsi_flip_flop(SIB_SURIMY_R27);
_G(obj)->calc_rsi_flip_flop(SIB_ZEITUNG_R27);
invent_2_slot(LETTER_INV);
switchRoom(27);
startAadWait(192);
_G(menu_item) = CUR_WALK;
cursorChoice(_G(menu_item));
}
int16 Room39::use_tv() {
int16 dia_nr = -1;
int16 ani_nr = -1;
int16 action_flag = false;
hideCur();
autoMove(2, P_CHEWY);
int16 cls_flag = false;
if (isCurInventory(ZAPPER_INV)) {
_G(mouseLeftClick) = false;
_G(gameState).R39TvOn = true;
if (_G(gameState).R39TvKanal >= 5)
_G(gameState).R39TvKanal = -1;
_G(flags).NoPalAfterFlc = true;
_G(out)->setPointer(nullptr);
_G(out)->cls();
flic_cut(FCUT_042);
++_G(gameState).R39TvKanal;
_G(flags).NoPalAfterFlc = true;
if (_G(gameState).R39TvKanal == 2)
flic_cut(FCUT_036);
else if (_G(gameState).R39TvKanal == 5)
flic_cut(FCUT_033);
look_tv(false);
set_tv();
cls_flag = true;
if (!_G(gameState).R39TranslatorUsed) {
ani_nr = CH_TALK11;
dia_nr = 78;
} else if (!_G(gameState).R39TvKanal && _G(gameState).R39ClintNews < 3) {
dia_nr = -1;
ani_nr = -1;
} else {
if (80 + _G(gameState).R39TvKanal != 85)
dia_nr = -1;
else
dia_nr = 85;
ani_nr = -1;
}
action_flag = true;
} else if (isCurInventory(TRANSLATOR_INV) && _G(gameState).ChewyAni != CHEWY_ROCKER) {
action_flag = true;
if (_G(gameState).R39TvOn) {
start_spz_wait(CH_TRANS, 1, false, P_CHEWY);
_G(gameState).R39TranslatorUsed = true;
_G(flags).NoPalAfterFlc = true;
flic_cut(FCUT_041);
_G(gameState).R39TvKanal = 0;
_G(gameState).R39ClintNews = 0;
_G(out)->setPointer(nullptr);
_G(out)->cls();
_G(out)->setPalette(_G(pal));
_G(flags).NoPalAfterFlc = true;
flic_cut(TV_FLIC[0]);
_G(out)->cls();
_G(out)->setPointer(nullptr);
_G(out)->cls();
_G(out)->setPalette(_G(pal));
set_tv();
start_spz(CH_TRANS, 255, ANI_FRONT, P_CHEWY);
startAadWait(80);
ani_nr = CH_TRANS;
dia_nr = 77;
} else {
ani_nr = CH_TALK11;
dia_nr = 76;
}
set_tv();
} else if (isCurInventory(RECORDER_INV) && _G(gameState).ChewyAni != CHEWY_ROCKER) {
action_flag = true;
if (_G(gameState).R39TvOn) {
if (_G(gameState).R39TranslatorUsed) {
start_spz(CH_TALK3, 255, ANI_FRONT, P_CHEWY);
startAadWait(98);
_G(gameState)._personHide[P_CHEWY] = true;
startAniBlock(2, ABLOCK29);
_G(gameState)._personHide[P_CHEWY] = false;
ani_nr = CH_TALK5;
dia_nr = 99;
_G(atds)->set_all_ats_str(RECORDER_INV, _G(gameState).R39TvKanal + 1, INV_ATS_DATA);
_G(gameState).R39TvRecord = _G(gameState).R39TvKanal + 1;
} else {
ani_nr = CH_TALK12;
dia_nr = 97;
}
} else {
ani_nr = CH_TALK11;
dia_nr = 76;
}
}
if (cls_flag) {
_G(out)->cls();
_G(out)->setPointer(nullptr);
_G(out)->cls();
_G(out)->setPalette(_G(pal));
_G(flags).NoPalAfterFlc = false;
}
if (dia_nr != -1) {
if (ani_nr != -1)
start_spz(ani_nr, 255, ANI_FRONT, P_CHEWY);
startAadWait(dia_nr);
action_flag = true;
}
showCur();
return action_flag;
}
void Room39::look_tv(bool cls_mode) {
if (_G(gameState).R39TvOn) {
if (!_G(flags).AutoAniPlay) {
_G(flags).AutoAniPlay = true;
int16 flic_nr;
int16 dia_nr;
if (!_G(gameState).R39TvKanal && _G(gameState).R39ClintNews < 3) {
flic_nr = FCUT_038;
++_G(gameState).R39ClintNews;
dia_nr = 79;
} else {
flic_nr = TV_FLIC[_G(gameState).R39TvKanal];
if (!_G(gameState).R39TvKanal)
_G(gameState).R39ClintNews = 0;
dia_nr = 80 + _G(gameState).R39TvKanal;
}
if (cls_mode) {
_G(out)->setPointer(nullptr);
_G(out)->cls();
_G(out)->setPalette(_G(pal));
_G(flags).NoPalAfterFlc = true;
}
if (_G(gameState).R39TranslatorUsed) {
if (dia_nr != 85)
start_aad(dia_nr, -1);
}
flic_cut(flic_nr);
if (cls_mode) {
_G(out)->cls();
_G(out)->setPointer(nullptr);
_G(out)->cls();
_G(out)->setPalette(_G(pal));
_G(flags).NoPalAfterFlc = false;
if (_G(gameState).R39TranslatorUsed && dia_nr == 85)
startAadWait(dia_nr);
}
}
_G(mouseLeftClick) = false;
_G(flags).AutoAniPlay = false;
}
}
void Room39::set_tv() {
for (int16 i = 0; i < 6; i++)
_G(det)->hideStaticSpr(i + 4);
if (_G(gameState).R39TvOn) {
if (_G(gameState).R39TvKanal == 2) {
_G(det)->startDetail(0, 255, ANI_FRONT);
} else {
_G(det)->stopDetail(0);
_G(det)->showStaticSpr(_G(gameState).R39TvKanal + 4);
}
if (_G(gameState).R39TranslatorUsed) {
_G(atds)->set_ats_str(229, TXT_MARK_LOOK, 2 + _G(gameState).R39TvKanal, ATS_DATA);
} else {
_G(atds)->set_ats_str(229, TXT_MARK_LOOK, 1, ATS_DATA);
}
}
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,44 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM39_H
#define CHEWY_ROOMS_ROOM39_H
namespace Chewy {
namespace Rooms {
class Room39 {
private:
static void ok();
static void set_tv();
public:
static void entry();
static int16 use_tv();
static short use_howard();
static void talk_howard();
static void look_tv(bool cls_mode);
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,669 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/ani_dat.h"
#include "chewy/room.h"
#include "chewy/rooms/room40.h"
#include "chewy/rooms/room43.h"
#include "chewy/sound.h"
namespace Chewy {
namespace Rooms {
#define SPEED 3
#define POLICE_LEFT 8
#define POLICE_OFFEN 9
#define POLICE_WUERG 10
#define POLICE_RIGHT 11
#define POLICE_FLASCHE 16
void Room40::entry(int16 eib_nr) {
_G(gameState).R40HoUse = false;
_G(zoom_horizont) = 130;
_G(gameState).ScrollxStep = 2;
if (_G(gameState).R40Geld) {
_G(det)->del_static_ani(6);
_G(room)->set_timer_status(6, TIMER_STOP);
}
if (_G(gameState).R40HaendlerOk) {
_G(det)->del_static_ani(4);
_G(room)->set_timer_status(4, TIMER_STOP);
}
if (_G(gameState).R40PoliceAway == false) {
_G(timer_nr)[0] = _G(room)->set_timer(255, 10);
_G(atds)->delControlBit(275, ATS_ACTIVE_BIT);
} else {
_G(det)->hideStaticSpr(15);
}
_G(gameState).R40PoliceAniStatus = 255;
_G(gameState).R40PoliceStart = false;
_G(spieler_mi)[P_HOWARD].Mode = true;
if (_G(gameState)._personRoomNr[P_HOWARD] == 41)
_G(gameState)._personRoomNr[P_HOWARD] = 40;
if (_G(gameState)._personRoomNr[P_HOWARD] == 40) {
_G(gameState).ZoomXy[P_HOWARD][0] = 40;
_G(gameState).ZoomXy[P_HOWARD][1] = 40;
if (!_G(flags).LoadGame) {
switch (eib_nr) {
case 69:
setPersonPos(30, 105, P_HOWARD, P_RIGHT);
goAutoXy(158, 99, P_HOWARD, ANI_GO);
break;
case 73:
case 74:
case 87:
setPersonPos(158, 93, P_HOWARD, P_LEFT);
break;
default:
break;
}
}
}
_G(SetUpScreenFunc) = setup_func;
if (_G(gameState).R40TrainMove)
move_train(0);
}
void Room40::xit(int16 eib_nr) {
hideCur();
_G(gameState).ScrollxStep = 1;
_G(gameState).R40PoliceAb = false;
_G(gameState).R40HoUse = false;
stop_spz();
_G(SetUpScreenFunc) = nullptr;
if (_G(gameState)._personRoomNr[P_HOWARD] == 40) {
if (eib_nr == 70 || eib_nr == 77) {
_G(gameState)._personRoomNr[P_HOWARD] = 28;
} else if (eib_nr == 72) {
if ((_G(obj)->checkInventory(HOTEL_INV) && _G(obj)->checkInventory(TICKET_INV) && _G(gameState).R42LetterOk && _G(gameState).R28Manuskript)
|| _G(gameState).R40TrainOk) {
_G(gameState).R40TrainOk = true;
_G(gameState)._personRoomNr[P_HOWARD] = 45;
_G(gameState).room_e_obj[72].Exit = 45;
_G(obj)->hide_sib(SIB_MUENZE_R40);
_G(uhr)->disableTimer();
_G(out)->fadeOut();
hide_person();
setupScreen(DO_SETUP);
_G(out)->fadeIn(_G(pal));
_G(uhr)->enableTimer();
_G(mouseLeftClick) = false;
startAadWait(238);
move_train(1);
register_cutscene(15);
_G(flags).NoPalAfterFlc = true;
flic_cut(FCUT_073);
if (_G(gameState).ChewyAni != CHEWY_ROCKER)
_G(gameState).PersonGlobalDia[1] = 10023;
cur_2_inventory();
remove_inventory(57);
_G(gameState).PersonDiaRoom[P_HOWARD] = true;
show_person();
} else {
_G(gameState)._personRoomNr[P_HOWARD] = 42;
}
} else {
_G(gameState)._personRoomNr[P_HOWARD] = 41;
}
}
_G(spieler_mi)[P_HOWARD].Mode = false;
showCur();
}
bool Room40::timer(int16 t_nr, int16 ani_nr) {
if (t_nr == _G(timer_nr)[0])
_G(gameState).R40PoliceStart = true;
else
return true;
return false;
}
void Room40::move_train(int16 mode) {
_G(gameState).R40TrainMove = false;
hideCur();
autoMove(9, P_CHEWY);
_G(flags).NoScroll = true;
auto_scroll(232, 0);
if (!mode)
startAadWait(206);
int16 lx = -40;
int16 ax = -230;
_G(det)->startDetail(7, 20, ANI_FRONT);
_G(det)->showStaticSpr(11);
if (mode && _G(gameState).ChewyAni == CHEWY_PUMPKIN)
_G(det)->showStaticSpr(12);
_G(det)->playSound(7, 0);
int16 delay = 0;
while (ax < 560) {
_G(det)->setDetailPos(7, lx, 46);
// Train sprite
_G(det)->setStaticPos(11, ax, 62, false, false);
// Chewy and Howard sprite
// The original offsets were ax and 62, which for some reason
// aren't shown correctly here (perhaps bad correction coords).
// Thus, adjust the coordinates here.
if (mode && _G(gameState).ChewyAni == CHEWY_PUMPKIN)
_G(det)->setStaticPos(12, ax + 27, 161, false, true);
if (!delay) {
lx += SPEED;
ax += SPEED;
delay = _G(gameState).DelaySpeed / 2;
} else {
--delay;
}
setupScreen(DO_SETUP);
SHOULD_QUIT_RETURN;
}
_G(det)->stopDetail(7);
_G(det)->hideStaticSpr(11);
_G(det)->hideStaticSpr(12);
if (!mode) {
startAadWait(207);
auto_scroll(180, 0);
}
_G(flags).NoScroll = false;
showCur();
}
void Room40::setup_func() {
if (!_G(gameState).R40HoUse && _G(gameState)._personRoomNr[P_HOWARD] == 40) {
calc_person_look();
int16 x, y;
const int16 sp_x = _G(moveState)[P_CHEWY].Xypos[0];
if (sp_x > 170 && sp_x < 255) {
x = 248;
y = 97;
} else if (sp_x > 255 && sp_x < 350) {
x = 310;
y = 90;
} else if (sp_x > 350) {
x = 428;
y = 90;
} else if (sp_x < 170) {
x = 166;
y = 99;
} else {
x = _G(moveState)[P_HOWARD].Xypos[0];
y = _G(moveState)[P_HOWARD].Xypos[1];
}
goAutoXy(x, y, P_HOWARD, ANI_GO);
}
if (_G(gameState).R40PoliceAway == false) {
if (_G(gameState).R40PoliceStart) {
_G(gameState).R40PoliceStart = false;
_G(gameState).R40PoliceAniStatus = POLICE_LEFT;
_G(room)->set_timer_status(255, TIMER_STOP);
_G(uhr)->resetTimer(_G(timer_nr)[0], 0);
_G(det)->hideStaticSpr(15);
_G(det)->startDetail(POLICE_LEFT, 1, ANI_FRONT);
_G(atds)->setControlBit(275, ATS_ACTIVE_BIT);
}
switch (_G(gameState).R40PoliceAniStatus) {
case POLICE_LEFT:
if (_G(det)->get_ani_status(POLICE_LEFT) == false) {
_G(det)->startDetail(POLICE_OFFEN, 1, ANI_FRONT);
_G(gameState).R40PoliceAniStatus = POLICE_OFFEN;
}
break;
case POLICE_OFFEN:
if (_G(det)->get_ani_status(POLICE_OFFEN) == false) {
_G(det)->showStaticSpr(0);
_G(det)->startDetail(POLICE_FLASCHE, 1, ANI_FRONT);
_G(gameState).R40PoliceAniStatus = POLICE_FLASCHE;
}
break;
case POLICE_RIGHT:
if (_G(det)->get_ani_status(POLICE_RIGHT) == false) {
_G(det)->showStaticSpr(15);
_G(gameState).R40PoliceAniStatus = 255;
_G(room)->set_timer_status(255, TIMER_START);
_G(uhr)->resetTimer(_G(timer_nr)[0], 0);
_G(atds)->delControlBit(275, ATS_ACTIVE_BIT);
}
break;
case POLICE_FLASCHE:
if (_G(det)->get_ani_status(POLICE_FLASCHE) == false) {
_G(det)->hideStaticSpr(0);
if (_G(gameState).R40DuengerTele) {
hideCur();
_G(gameState).R40PoliceAway = true;
_G(det)->startDetail(17, 255, ANI_FRONT);
startAadWait(226);
_G(det)->stopDetail(17);
_G(gameState).R40HoUse = true;
_G(person_end_phase)[P_CHEWY] = P_RIGHT;
startSetAILWait(10, 1, ANI_FRONT);
_G(person_end_phase)[P_HOWARD] = P_RIGHT;
startAadWait(224);
_G(gameState).R40PoliceAway = true;
showCur();
_G(flags).MouseLeft = false;
_G(flags).MainInput = true;
_G(gameState).R40HoUse = false;
_G(atds)->setControlBit(276, ATS_ACTIVE_BIT);
} else {
_G(det)->startDetail(POLICE_RIGHT, 1, ANI_FRONT);
_G(gameState).R40PoliceAniStatus = POLICE_RIGHT;
}
}
break;
default:
break;
}
}
}
int16 Room40::use_mr_pumpkin() {
int16 action_ret = false;
if (_G(menu_item) != CUR_HOWARD) {
hideCur();
if (!_G(cur)->usingInventoryCursor()) {
action_ret = use_schalter(205);
} else {
switch (_G(cur)->getInventoryCursor()) {
case CENT_INV:
action_ret = true;
autoMove(5, P_CHEWY);
delInventory(_G(cur)->getInventoryCursor());
startSetAILWait(15, 1, ANI_FRONT);
start_spz(CH_PUMP_TALK, 255, ANI_FRONT, P_CHEWY);
startAadWait(200);
break;
case RECORDER_INV:
action_ret = true;
if (_G(gameState).R39TvRecord == 6) {
if (_G(gameState).R40PoliceAway == false)
use_schalter(227);
else {
hideCur();
autoMove(8, P_CHEWY);
start_spz_wait(CH_PUMP_GET1, 1, false, P_CHEWY);
delInventory(_G(cur)->getInventoryCursor());
_G(out)->fadeOut();
Room43::catch_pg();
remove_inventory(LIKOER_INV);
_G(obj)->addInventory(LIKOER2_INV, &_G(room_blk));
inventory_2_cur(LIKOER2_INV);
switchRoom(40);
startAadWait(236);
}
} else {
startAadWait(228 + _G(gameState).R39TvRecord);
}
break;
default:
break;
}
}
showCur();
}
return action_ret;
}
int16 Room40::use_schalter(int16 aad_nr) {
int16 action_flag = false;
if (_G(menu_item) != CUR_HOWARD &&_G(gameState).R40PoliceAway == false) {
action_flag = true;
hideCur();
autoMove(8, P_CHEWY);
if (_G(gameState).R40PoliceAniStatus != 255) {
start_spz(CH_PUMP_TALK, 255, ANI_FRONT, P_CHEWY);
startAadWait(204);
while (_G(gameState).R40PoliceAniStatus != 255) {
setupScreen(DO_SETUP);
SHOULD_QUIT_RETURN0;
}
}
_G(room)->set_timer_status(255, TIMER_STOP);
_G(gameState).R40PoliceStart = false;
stop_spz();
start_spz_wait(CH_PUMP_GET1, 1, false, P_CHEWY);
if (_G(gameState).R40PoliceAb) {
_G(gameState).R40PoliceAb = false;
stop_spz();
goAutoXy(308, 100, P_HOWARD, ANI_WAIT);
_G(gameState).R40HoUse = false;
}
_G(det)->hideStaticSpr(15);
startSetAILWait(12, 1, ANI_FRONT);
_G(det)->set_static_ani(14, -1);
startAadWait(aad_nr);
_G(det)->del_static_ani(14);
startSetAILWait(13, 1, ANI_FRONT);
_G(det)->showStaticSpr(15);
_G(room)->set_timer_status(255, TIMER_START);
_G(uhr)->resetTimer(_G(timer_nr)[0], 0);
showCur();
}
return action_flag;
}
void Room40::talk_police() {
if (!_G(gameState).R40PoliceAway && _G(gameState).R40PoliceAniStatus == 255) {
hideCur();
_G(gameState).R40PoliceStart = false;
_G(room)->set_timer_status(255, TIMER_STOP);
autoMove(7, P_CHEWY);
startAadWait(203);
_G(room)->set_timer_status(255, TIMER_START);
_G(uhr)->resetTimer(_G(timer_nr)[0], 0);
showCur();
}
}
void Room40::talk_handler() {
if (!_G(gameState).R40HaendlerOk) {
_G(gameState).flags38_2 = true;
hideCur();
autoMove(6, P_CHEWY);
_G(det)->del_static_ani(4);
_G(room)->set_timer_status(4, TIMER_STOP);
_G(det)->set_static_ani(3, -1);
startAadWait(202);
_G(det)->set_static_ani(4, -1);
_G(det)->del_static_ani(3);
_G(room)->set_timer_status(4, TIMER_START);
showCur();
}
}
int16 Room40::use_haendler() {
int16 action_flag = false;
if (_G(menu_item) == CUR_HOWARD && !_G(gameState).R40HaendlerOk) {
action_flag = true;
if (!_G(gameState).flags38_2) {
startAadWait(612);
} else {
hideCur();
invent_2_slot(DUENGER_INV);
_G(gameState).R40HoUse = true;
_G(gameState).R40HaendlerOk = true;
_G(gameState).R40TeilKarte = true;
_G(gameState).R40DuengerMit = true;
_G(atds)->setControlBit(283, ATS_ACTIVE_BIT);
autoMove(10, P_CHEWY);
autoMove(11, P_HOWARD);
startAadWait(208);
autoMove(6, P_HOWARD);
_G(flags).NoScroll = true;
auto_scroll(270, 0);
_G(det)->del_static_ani(4);
_G(room)->set_timer_status(4, TIMER_STOP);
_G(det)->set_static_ani(3, -1);
startAadWait(209);
_G(det)->del_static_ani(3);
_G(det)->set_static_ani(5, -1);
startAadWait(213);
if (_G(gameState).R28RKuerbis) {
_G(det)->del_static_ani(5);
_G(det)->set_static_ani(3, -1);
startAadWait(211);
_G(out)->fadeOut();
_G(out)->set_partialpalette(_G(pal), 255, 1);
startAadWait(212);
_G(out)->fadeOut();
_G(gameState).R40Wettbewerb = true;
_G(gameState)._personRoomNr[P_HOWARD] = 28;
_G(flags).NoScroll = false;
_G(out)->setPointer(nullptr);
_G(out)->cls();
switchRoom(28);
_G(SetUpScreenFunc) = setup_func;
} else {
autoMove(11, P_HOWARD);
startAadWait(210);
}
_G(menu_item) = CUR_WALK;
cursorChoice(_G(menu_item));
showCur();
_G(flags).NoScroll = false;
_G(flags).MouseLeft = false;
_G(gameState).R40HoUse = false;
}
}
return action_flag;
}
int16 Room40::use_bmeister() {
short action_flag = false;
if (_G(menu_item) == CUR_HOWARD) {
action_flag = true;
hideCur();
_G(gameState).R40HoUse = true;
autoMove(9, P_CHEWY);
autoMove(11, P_HOWARD);
startAadWait(214);
bmeister_dia(215);
startAadWait(216);
_G(gameState).R40HoUse = false;
_G(flags).NoScroll = false;
_G(menu_item) = CUR_WALK;
cursorChoice(_G(menu_item));
showCur();
} else if (isCurInventory(LIKOER2_INV)) {
action_flag = true;
if (_G(gameState).flags37_80) {
startAadWait(605);
} else {
hideCur();
_G(gameState).R40HoUse = true;
new_invent_2_cur(HOTEL_INV);
bmeister_dia(237);
_G(gameState).flags37_80 = true;
_G(flags).NoScroll = false;
showCur();
}
}
return action_flag;
}
void Room40::bmeister_dia(int16 aad_nr) {
autoMove(7, P_CHEWY);
autoMove(12, P_HOWARD);
_G(flags).NoScroll = true;
auto_scroll(206, 0);
_G(det)->del_static_ani(0);
_G(room)->set_timer_status(0, TIMER_STOP);
_G(det)->stopDetail(0);
startSetAILWait(1, 1, ANI_FRONT);
_G(det)->set_static_ani(2, -1);
if (aad_nr == 237) {
startAadWait(aad_nr);
_G(flags).NoPalAfterFlc = true;
flic_cut(FCUT_062);
_G(fx_blend) = BLEND3;
startAadWait(375);
} else {
startAadWait(aad_nr);
}
_G(flags).NoPalAfterFlc = false;
_G(room)->set_timer_status(0, TIMER_START);
_G(det)->set_static_ani(0, -1);
_G(det)->del_static_ani(2);
autoMove(11, P_HOWARD);
autoMove(9, P_CHEWY);
}
bool Room40::use_police() {
bool result = false;
if (_G(menu_item) == CUR_HOWARD) {
if (!_G(gameState).R40PoliceAway && _G(gameState).R40PoliceAniStatus == 255) {
result = true;
_G(gameState).R40PoliceAb = true;
hideCur();
_G(gameState).R40PoliceStart = false;
_G(room)->set_timer_status(255, TIMER_STOP);
_G(gameState).R40HoUse = true;
autoMove(9, P_CHEWY);
autoMove(11, P_HOWARD);
startAadWait(217);
autoMove(8, P_CHEWY);
goAutoXy(300, 120, P_HOWARD, ANI_WAIT);
_G(person_end_phase)[P_HOWARD] = P_RIGHT;
startAadWait(218);
start_spz(HO_TALK_L, 255, ANI_FRONT, P_HOWARD);
_G(menu_item) = CUR_WALK;
cursorChoice(_G(menu_item));
showCur();
_G(flags).MouseLeft = false;
}
} else {
startAadWait(225);
}
return result;
}
int16 Room40::use_tele() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursor() && _G(gameState).R40PoliceAway == false) {
action_flag = true;
hideCur();
int16 dia_nr1 = -1;
if (!_G(gameState).R40PoliceAb) {
startAadWait(219);
_G(gameState).R40HoUse = false;
} else {
autoMove(13, P_CHEWY);
_G(det)->showStaticSpr(0);
int16 dia_nr;
if (!_G(gameState).R40DuengerMit) {
dia_nr = 220;
dia_nr1 = 222;
} else {
dia_nr = 221;
dia_nr1 = 223;
}
startAadWait(dia_nr);
autoMove(11, P_HOWARD);
_G(det)->hideStaticSpr(0);
autoMove(9, P_CHEWY);
startAadWait(dia_nr1);
_G(gameState).R40HoUse = false;
int16 timer_wert = 0;
if (dia_nr1 == 223) {
if (isCurInventory(DUENGER_INV)) {
delInventory(_G(cur)->getInventoryCursor());
} else {
remove_inventory(DUENGER_INV);
}
invent_2_slot(LIKOER_INV);
autoMove(1, P_CHEWY);
_G(gameState).R40DuengerMit = false;
_G(gameState).R40DuengerTele = true;
_G(flags).MouseLeft = true;
_G(flags).MainInput = false;
timer_wert = 3;
}
_G(gameState).R40PoliceAb = false;
_G(room)->set_timer_status(255, TIMER_START);
_G(uhr)->resetTimer(_G(timer_nr)[0], timer_wert);
}
if (dia_nr1 != 223)
showCur();
}
return action_flag;
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,52 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM40_H
#define CHEWY_ROOMS_ROOM40_H
namespace Chewy {
namespace Rooms {
class Room40 {
private:
static void move_train(int16 mode);
static void setup_func();
static int16 use_schalter(int16 aad_nr);
static void bmeister_dia(int16 aad_nr);
public:
static void entry(int16 eib_nr);
static void xit(int16 eib_nr);
static bool timer(int16 t_nr, int16 ani_nr);
static int16 use_mr_pumpkin();
static void talk_police();
static void talk_handler();
static int16 use_haendler();
static int16 use_bmeister();
static bool use_police();
static int16 use_tele();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,259 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room41.h"
#include "chewy/sound.h"
namespace Chewy {
namespace Rooms {
static const AniBlock ABLOCK32[2] = {
{ 6, 255, ANI_FRONT, ANI_GO, 0 },
{ 2, 1, ANI_FRONT, ANI_WAIT, 0 },
};
void Room41::entry() {
hideCur();
if (!_G(gameState).R41LolaOk) {
_G(det)->playSound(6, 0);
if (!_G(flags).LoadGame) {
_G(room)->set_timer_status(0, TIMER_STOP);
_G(det)->del_static_ani(0);
startAniBlock(2, ABLOCK32);
_G(room)->set_timer_status(0, TIMER_START);
_G(det)->set_static_ani(0, -1);
startAadWait(127);
} else {
_G(det)->startDetail(6, 255, ANI_FRONT);
}
}
if (_G(gameState).R41Einbruch) {
_G(atds)->delControlBit(271, ATS_ACTIVE_BIT);
_G(det)->showStaticSpr(6);
_G(det)->showStaticSpr(7);
}
if (_G(gameState).ChewyAni == CHEWY_ROCKER) {
_G(atds)->setControlBit(269, ATS_ACTIVE_BIT);
}
if (!_G(flags).LoadGame)
setPersonPos(241, 113, P_HOWARD, P_RIGHT);
_G(SetUpScreenFunc) = setup_func;
showCur();
}
void Room41::xit() {
if (_G(gameState).R41TrainCount == 0) {
_G(gameState).R41TrainCount = 3;
_G(gameState).R40TrainMove = true;
}
_G(gameState).R41TrainCount--;
}
void Room41::setup_func() {
if (_G(gameState)._personRoomNr[P_HOWARD] == 41) {
calc_person_look();
if (_G(moveState)->Xypos[P_HOWARD] == 160) {
goAutoXy(258, 75, P_HOWARD, ANI_GO);
} else {
goAutoXy(246, 120, P_HOWARD, ANI_GO);
}
}
}
void Room41::talk_hoggy1() {
stop_hoggy();
autoMove(1, P_CHEWY);
if (!_G(gameState).R41FirstTalk) {
first_talk();
} else if (!_G(gameState).R41Einbruch) {
showCur();
startDialogCloseupWait(11);
} else if (_G(gameState).R41Einbruch) {
if (!_G(gameState).R41BruchInfo) {
_G(gameState).R41BruchInfo = true;
startAadWait(132);
startAadWait(128);
} else if (_G(gameState).R31SurFurz && !_G(gameState).R41KuerbisInfo) {
_G(gameState).R41KuerbisInfo = true;
startAadWait(131);
autoMove(5, P_CHEWY);
new_invent_2_cur(TICKET_INV);
} else {
startAadWait(130);
}
} else {
startAadWait(130);
}
start_hoggy();
}
void Room41::talk_hoggy2() {
stop_hoggy();
autoMove(2, P_CHEWY);
if (!_G(gameState).R41FirstTalk) {
first_talk();
} else if (_G(gameState).R41BruchInfo) {
if (_G(gameState).R31SurFurz && !_G(gameState).R41KuerbisInfo) {
_G(gameState).R41KuerbisInfo = true;
startAadWait(131);
autoMove(5, P_CHEWY);
new_invent_2_cur(TICKET_INV);
} else {
startAadWait(129);
}
} else {
startAadWait(129);
}
start_hoggy();
}
void Room41::first_talk() {
_G(gameState).R41FirstTalk = true;
startAadWait(134);
_G(atds)->set_ats_str(266, TXT_MARK_NAME, 1, ATS_DATA);
_G(atds)->set_ats_str(265, TXT_MARK_NAME, 1, ATS_DATA);
}
void Room41::start_hoggy() {
showCur();
for (int16 i = 0; i < 2; i++) {
_G(room)->set_timer_status(i, TIMER_START);
_G(det)->set_static_ani(i, -1);
_G(det)->del_static_ani(i + 3);
}
}
void Room41::stop_hoggy() {
hideCur();
for (int16 i = 0; i < 2; i++) {
_G(room)->set_timer_status(i, TIMER_STOP);
_G(det)->del_static_ani(i);
_G(det)->stopDetail(i);
_G(det)->set_static_ani(i + 3, -1);
}
}
int16 Room41::use_kasse() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursor()) {
action_flag = true;
stop_hoggy();
autoMove(1, P_CHEWY);
startAadWait(133);
start_hoggy();
}
return action_flag;
}
int16 Room41::use_lola() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R41LolaOk && _G(gameState).R41RepairInfo) {
hideCur();
action_flag = true;
_G(gameState).R41LolaOk = true;
autoMove(4, P_CHEWY);
_G(det)->stopSound(0);
flic_cut(FCUT_057);
setPersonPos(127, 112, P_CHEWY, P_LEFT);
_G(det)->stopDetail(6);
_G(atds)->delControlBit(267, ATS_ACTIVE_BIT);
_G(atds)->set_all_ats_str(267, 1, ATS_DATA);
_G(atds)->hideDialogCloseupItem(11, 0, 3);
showCur();
}
return action_flag;
}
int16 Room41::use_brief() {
int16 action_flag = false;
hideCur();
if (isCurInventory(LETTER_INV)) {
action_flag = true;
stop_hoggy();
autoMove(6, P_CHEWY);
startAadWait(126);
start_hoggy();
} else if (isCurInventory(STAMPEDLETTER_INV)) {
action_flag = true;
autoMove(6, P_CHEWY);
delInventory(_G(cur)->getInventoryCursor());
stop_hoggy();
startAadWait(186);
start_hoggy();
_G(atds)->set_all_ats_str(206, 1, ATS_DATA);
_G(gameState).R28LetterBox = true;
_G(gameState).R40TrainMove = true;
_G(gameState).R28PostCar = true;
_G(gameState).R42LetterOk = true;
}
showCur();
return action_flag;
}
void Room41::sub_dia() {
aadWait(-1);
startAadWait(161);
if (_G(gameState).R41LolaOk) {
startAadWait(163);
_G(atds)->hideDialogCloseupItem(11, 0, 2);
stopDialogCloseupDialog();
autoMove(5, P_CHEWY);
new_invent_2_cur(PAPIER_INV);
} else {
startAadWait(162);
}
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,49 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM41_H
#define CHEWY_ROOMS_ROOM41_H
namespace Chewy {
namespace Rooms {
class Room41 {
private:
static void first_talk();
static void start_hoggy();
static void stop_hoggy();
static void setup_func();
public:
static void entry();
static void xit();
static int16 use_brief();
static int16 use_lola();
static int16 use_kasse();
static void talk_hoggy1();
static void talk_hoggy2();
static void sub_dia();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,239 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/ani_dat.h"
#include "chewy/room.h"
#include "chewy/rooms/room42.h"
#include "chewy/sound.h"
namespace Chewy {
namespace Rooms {
void Room42::entry() {
if (!_G(gameState).R42StationEmployeeAway) {
_G(det)->playSound(0, 0);
_G(det)->startDetail(0, 255, ANI_FRONT);
}
if (_G(gameState)._personRoomNr[P_HOWARD] == 42) {
_G(SetUpScreenFunc) = setup_func;
if (!_G(flags).LoadGame) {
_G(det)->stopDetail(0);
_G(timer_nr)[0] = _G(room)->set_timer(8, 5);
_G(det)->set_static_ani(8, -1);
_G(gameState).R42StationEmployeeAway = true;
_G(det)->stopSound(0);
_G(SetUpScreenFunc) = setup_func;
setPersonPos(80, 43, P_HOWARD, P_LEFT);
_G(atds)->set_all_ats_str(263, 1, ATS_DATA);
_G(atds)->set_all_ats_str(264, 1, ATS_DATA);
}
if (_G(obj)->checkInventory(HOTEL_INV) && _G(obj)->checkInventory(TICKET_INV) && !_G(gameState).R42LetterOk)
startAadWait(302);
if (_G(obj)->checkInventory(HOTEL_INV) && _G(obj)->checkInventory(TICKET_INV) && _G(gameState).R42LetterOk)
startAadWait(301);
}
}
void Room42::xit() {
if (_G(gameState)._personRoomNr[P_HOWARD] == 42) {
_G(atds)->set_all_ats_str(264, 1, ATS_DATA);
stop_spz();
_G(gameState).R42HoToBeamter = false;
_G(gameState)._personRoomNr[P_HOWARD] = 40;
}
}
void Room42::setup_func() {
if (!_G(gameState).R42HoToBeamter)
calc_person_look();
}
void Room42::getPumpkin(int16 aad_nr) {
hideCur();
autoMove(1, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(7, 1, ANI_BACK);
_G(gameState)._personHide[P_CHEWY] = false;
start_spz(CH_TALK5, 255, ANI_FRONT, P_CHEWY);
startAadWait(aad_nr);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(7, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
showCur();
}
int16 Room42::useMailBag() {
int16 action_flag = false;
if (_G(menu_item) == CUR_HOWARD)
return action_flag;
hideCur();
if (!_G(gameState).R42StationEmployeeAway && !_G(cur)->usingInventoryCursor()) {
action_flag = true;
getPumpkin(136);
} else if (_G(gameState).R42HoToBeamter && !_G(cur)->usingInventoryCursor() && !_G(gameState).R42StampOk) {
action_flag = true;
autoMove(3, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(10, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
startAadWait(187);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(9, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
new_invent_2_cur(BMARKE_INV);
startAadWait(181);
_G(gameState).R42StampOk = true;
autoMove(4, P_CHEWY);
startAadWait(185);
_G(gameState).R42HoToBeamter = false;
} else if (isCurInventory(STAMPEDLETTER_INV)) {
action_flag = true;
autoMove(3, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(10, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
delInventory(_G(cur)->getInventoryCursor());
startAadWait(183);
_G(obj)->calc_rsi_flip_flop(SIB_BKASTEN_R28);
_G(atds)->set_all_ats_str(206, 1, ATS_DATA);
_G(gameState).R28LetterBox = true;
_G(gameState).R40TrainMove = true;
_G(gameState).R28PostCar = true;
_G(gameState).R42LetterOk = true;
} else if (isCurInventory(LETTER_INV)) {
action_flag = true;
startAadWait(182);
}
showCur();
return action_flag;
}
int16 Room42::useStationEmployee() {
int16 action_flag = false;
if (_G(menu_item) == CUR_HOWARD) {
action_flag = true;
_G(atds)->set_all_ats_str(264, 2, ATS_DATA);
hideCur();
autoMove(4, P_CHEWY);
startAadWait(184);
_G(gameState).R42HoToBeamter = true;
_G(menu_item) = CUR_WALK;
cursorChoice(_G(menu_item));
showCur();
start_spz(HO_TALK_L, 255, ANI_FRONT, P_HOWARD);
_G(flags).MouseLeft = false;
}
return action_flag;
}
void Room42::talkToStationEmployee() {
int16 dia_nr;
autoMove(1, P_CHEWY);
if (!_G(gameState).R42StationEmployeeAway) {
dia_nr = 10;
} else if (!_G(gameState).R42StampOk) {
dia_nr = 13;
} else {
dia_nr = 14;
}
startDialogCloseupWait(dia_nr);
}
void Room42::dialogWithStationEmployee(int16 str_end_nr) {
hideCur();
if (str_end_nr != 4) {
while (_G(atds)->aadGetStatus() != -1) {
setupScreen(DO_SETUP);
SHOULD_QUIT_RETURN;
}
_G(gameState)._personHide[P_CHEWY] = true;
_G(flags).NoDiaBox = true;
switch (str_end_nr) {
case 1:
startSetAILWait(3, 4, ANI_FRONT);
break;
case 2:
_G(det)->playSound(4, 0);
startSetAILWait(4, 13, ANI_FRONT);
break;
case 3:
startSetAILWait(5, 2, ANI_FRONT);
break;
default:
break;
}
} else {
while (_G(atds)->aadGetStatus() < 2) {
setupScreen(DO_SETUP);
SHOULD_QUIT_RETURN;
}
_G(det)->stopDetail(0);
_G(det)->stopSound(0);
startSetAILWait(1, 1, ANI_FRONT);
_G(det)->startDetail(2, 255, ANI_FRONT);
while (_G(atds)->aadGetStatus() != -1) {
setupScreen(DO_SETUP);
SHOULD_QUIT_RETURN;
}
_G(det)->stopDetail(2);
_G(det)->startDetail(0, 255, ANI_FRONT);
_G(det)->playSound(0, 0);
_G(det)->playSound(0, 0);
}
_G(gameState)._personHide[P_CHEWY] = true;
_G(det)->startDetail(6, 255, ANI_FRONT);
startAadWait(135);
_G(det)->stopDetail(6);
_G(flags).NoDiaBox = false;
_G(gameState)._personHide[P_CHEWY] = false;
showCur();
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,46 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM42_H
#define CHEWY_ROOMS_ROOM42_H
namespace Chewy {
namespace Rooms {
class Room42 {
private:
static void setup_func();
static void getPumpkin(int16 aad_nr);
public:
static void entry();
static void xit();
static void talkToStationEmployee();
static int16 useMailBag();
static int16 useStationEmployee();
static void dialogWithStationEmployee(int16 str_end_nr);
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,97 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room43.h"
#include "chewy/sound.h"
namespace Chewy {
namespace Rooms {
void Room43::night_small() {
hide_person();
_G(gameState).scrollx = 0;
_G(gameState).scrolly = 0;
switchRoom(43);
g_engine->_sound->stopMusic();
_G(det)->playSound(0, 0);
hideCur();
_G(flags).NoScroll = true;
_G(gameState).ScrollxStep = 1;
startAadWait(188);
auto_scroll(320, 0);
startAadWait(189);
auto_scroll(0, 0);
startAadWait(190);
_G(gameState).ScrollxStep = 16;
auto_scroll(192, 0);
for (int16 i = 0; i < 3; i++) {
if (i)
_G(gameState).ScrollxStep = 16 / i;
auto_scroll(128 + i * 16, 0);
auto_scroll(192, 0);
}
_G(gameState).scrollx = 194;
startAadWait(191);
flic_cut(FCUT_058);
_G(det)->stopSound(0);
_G(flags).NoScroll = false;
_G(gameState).ScrollxStep = 1;
_G(gameState).scrollx = 0;
_G(gameState).scrolly = 0;
showCur();
show_person();
}
void Room43::catch_pg() {
hide_person();
_G(gameState).scrollx = 0;
_G(gameState).scrolly = 0;
switchRoom(43);
g_engine->_sound->stopMusic();
_G(det)->playSound(0, 0);
hideCur();
_G(flags).NoScroll = true;
_G(gameState).ScrollxStep = 1;
startAadWait(234);
auto_scroll(194, 0);
startAadWait(235);
_G(gameState).R43GetPgLady = true;
flic_cut(FCUT_058);
_G(det)->stopSound(0);
register_cutscene(14);
_G(flags).NoScroll = false;
_G(gameState).ScrollxStep = 1;
_G(gameState).scrollx = 0;
_G(gameState).scrolly = 0;
showCur();
show_person();
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,37 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM43_H
#define CHEWY_ROOMS_ROOM43_H
namespace Chewy {
namespace Rooms {
class Room43 {
public:
static void night_small();
static void catch_pg();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,50 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room44.h"
namespace Chewy {
namespace Rooms {
void Room44::look_news() {
int16 tmproom = _G(gameState)._personRoomNr[P_CHEWY];
int16 tmpsx = _G(gameState).scrollx;
int16 tmpsy = _G(gameState).scrolly;
_G(gameState).scrollx = 0;
_G(gameState).scrolly = 0;
hide_person();
_G(fx_blend) = BLEND1;
_G(gameState)._personRoomNr[P_CHEWY] = 44;
_G(room)->loadRoom(&_G(room_blk), 44, &_G(gameState));
startAadWait(172);
_G(gameState).scrollx = tmpsx;
_G(gameState).scrolly = tmpsy;
switchRoom(tmproom);
show_person();
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,36 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM44_H
#define CHEWY_ROOMS_ROOM44_H
namespace Chewy {
namespace Rooms {
class Room44 {
public:
static void look_news();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,279 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room45.h"
#include "chewy/sound.h"
namespace Chewy {
namespace Rooms {
void Room45::entry(int16 eib_nr) {
_G(gameState).ScrollxStep = 2;
_G(SetUpScreenFunc) = setup_func;
_G(r45_delay) = 0;
_G(zoom_horizont) = 150;
_G(flags).ZoomMov = true;
_G(zoom_mov_fak) = 4;
_G(gameState).ZoomXy[P_HOWARD][0] = 80;
_G(gameState).ZoomXy[P_HOWARD][1] = 70;
if (_G(gameState)._personRoomNr[P_HOWARD] == 46) {
_G(spieler_mi)[P_HOWARD].Mode = true;
_G(gameState)._personRoomNr[P_HOWARD] = 45;
}
_G(spieler_mi)[P_HOWARD].Mode = true;
if (!_G(flags).LoadGame) {
int16 ch_x, ch_y;
int16 ho_x, ho_y;
if (_G(gameState).R48TaxiEntry) {
ch_x = 67;
ch_y = 146;
ho_x = 43;
ho_y = 129;
_G(gameState).R48TaxiEntry = false;
_G(mouseLeftClick) = false;
} else {
if (eib_nr == 72) {
ch_x = 259;
ch_y = 146;
ho_x = 304;
ho_y = 130;
_G(gameState).scrollx = 130;
} else {
ch_x = 68;
ch_y = 132;
ho_x = 45;
ho_y = 124;
}
}
setPersonPos(ch_x, ch_y, P_CHEWY, P_LEFT);
setPersonPos(ho_x, ho_y, P_HOWARD, P_LEFT);
}
}
void Room45::xit(int16 eib_nr) {
_G(gameState).ScrollxStep = 1;
if (_G(gameState)._personRoomNr[P_HOWARD] == 45) {
_G(spieler_mi)[P_HOWARD].Mode = false;
if (eib_nr == 87) {
_G(gameState)._personRoomNr[P_HOWARD] = 40;
}
}
if (eib_nr == 87) {
_G(flags).NoPalAfterFlc = true;
flic_cut(FCUT_073);
}
}
void Room45::setup_func() {
int16 x;
int16 y;
if (_G(menu_display) == 0) {
if (!_G(r45_delay)) {
_G(r45_delay) = _G(gameState).DelaySpeed / 2;
for (int16 i = 0; i < R45_MAX_PERSON; i++) {
if (_G(r45_pinfo)[i][0] == 1) {
y = _G(Adi)[3 + i].y;
x = _G(Adi)[3 + i].x;
if (i < 6) {
x -= _G(r45_pinfo)[i][1];
if (x < -30) {
_G(r45_pinfo)[i][0] = 0;
_G(det)->stopDetail(3 + i);
}
} else {
x += _G(r45_pinfo)[i][1];
if (x > 540) {
_G(r45_pinfo)[i][0] = 0;
_G(det)->stopDetail(3 + i);
}
}
_G(det)->setDetailPos(3 + i, x, y);
} else {
++_G(r45_pinfo)[i][2];
if (_G(r45_pinfo)[i][2] >= _G(r45_pinfo)[i][3]) {
_G(r45_pinfo)[i][2] = 0;
_G(r45_pinfo)[i][0] = 1;
y = _G(Adi)[3 + i].y;
if (i < 6) {
x = 500;
} else {
x = 0;
}
_G(det)->setDetailPos(3 + i, x, y);
_G(det)->startDetail(3 + i, 255, ANI_FRONT);
}
}
}
} else {
--_G(r45_delay);
}
if (_G(gameState)._personRoomNr[P_HOWARD] == 45 && _G(HowardMov) != 2) {
calc_person_look();
const int16 ch_x = _G(moveState)[P_CHEWY].Xypos[0];
if (ch_x < 95) {
x = 18;
} else if (ch_x > 240) {
x = 304;
} else {
x = 176;
}
y = 130;
if (_G(HowardMov) && _G(flags).ExitMov) {
x = 56;
y = 122;
}
goAutoXy(x, y, P_HOWARD, ANI_GO);
}
}
}
int16 Room45::use_taxi() {
int16 action_ret = false;
hideCur();
autoMove(1, P_CHEWY);
if (!_G(cur)->usingInventoryCursor()) {
if (_G(gameState).ChewyAni == CHEWY_PUMPKIN) {
action_ret = true;
talk_taxi(254);
} else if (!_G(gameState).R45TaxiOk) {
action_ret = true;
talk_taxi(260);
} else if (_G(gameState).R45TaxiOk) {
action_ret = true;
taxi_mov();
}
} else if (isCurInventory(RING_INV)) {
action_ret = true;
delInventory(RING_INV);
talk_taxi(256);
_G(gameState).R45TaxiOk = true;
taxi_mov();
} else if (isCurInventory(UHR_INV)) {
action_ret = true;
talk_taxi(400);
}
showCur();
return action_ret;
}
void Room45::talk_taxi(int16 aad_nr) {
_G(room)->set_timer_status(12, TIMER_STOP);
_G(det)->del_static_ani(12);
startSetAILWait(13, 1, ANI_FRONT);
_G(det)->set_static_ani(14, -1);
startAadWait(aad_nr);
_G(det)->del_static_ani(14);
startSetAILWait(13, 1, ANI_BACK);
_G(det)->set_static_ani(12, -1);
_G(room)->set_timer_status(12, TIMER_START);
}
void Room45::taxi_mov() {
_G(HowardMov) = 2;
_G(room)->set_timer_status(12, TIMER_STOP);
_G(det)->del_static_ani(12);
_G(det)->playSound(15, 1);
_G(det)->showStaticSpr(11);
autoMove(3, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
_G(gameState).R48TaxiPerson[P_CHEWY] = true;
if (_G(gameState)._personRoomNr[P_HOWARD] == 45) {
goAutoXy(93, 127, P_HOWARD, ANI_WAIT);
_G(gameState)._personHide[P_HOWARD] = true;
_G(gameState).R48TaxiPerson[P_HOWARD] = true;
_G(gameState)._personRoomNr[P_HOWARD] = 48;
}
_G(det)->hideStaticSpr(11);
_G(det)->playSound(15, 2);
_G(det)->playSound(15, 0);
startSetAILWait(15, 1, ANI_FRONT);
_G(det)->stopSound(0);
switchRoom(48);
}
int16 Room45::use_boy() {
int16 action_ret = false;
hideCur();
autoMove(2, P_CHEWY);
if (!_G(gameState).R45MagOk) {
if (isCurInventory(DOLLAR175_INV)) {
action_ret = true;
new_invent_2_cur(CUTMAG_INV);
_G(atds)->set_all_ats_str(DOLLAR175_INV, 1, INV_ATS_DATA);
startAadWait(258);
_G(room)->set_timer_status(0, TIMER_STOP);
_G(det)->del_static_ani(0);
startSetAILWait(1, 1, ANI_FRONT);
_G(room)->set_timer_status(0, TIMER_START);
_G(det)->set_static_ani(0, -1);
_G(gameState).R45MagOk = true;
}
} else {
startAadWait(259);
}
showCur();
return action_ret;
}
void Room45::talk_boy() {
int16 aad_nr;
hideCur();
if (!_G(gameState).R45MagOk) {
autoMove(2, P_CHEWY);
aad_nr = 257;
} else {
aad_nr = 259;
}
startAadWait(aad_nr);
showCur();
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,47 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM45_H
#define CHEWY_ROOMS_ROOM45_H
#include "common/scummsys.h"
namespace Chewy {
namespace Rooms {
class Room45 {
private:
static void setup_func();
static void talk_taxi(int16 aad_nr);
static void taxi_mov();
public:
static void entry(int16 eib_nr);
static void xit(int16 eib_nr);
static void talk_boy();
static int16 use_boy();
static int16 use_taxi();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,209 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room46.h"
#include "chewy/sound.h"
#include "chewy/video/video_player.h"
namespace Chewy {
namespace Rooms {
void Room46::entry(int16 eib_nr) {
if (_G(gameState)._personRoomNr[P_HOWARD] == 45) {
_G(gameState)._personRoomNr[P_HOWARD] = 46;
_G(SetUpScreenFunc) = setup_func;
if (eib_nr == 79) {
setPersonPos(140, 90, P_HOWARD, P_LEFT);
autoMove(3, P_CHEWY);
setPersonSpr(P_LEFT, P_CHEWY);
}
}
if (_G(gameState)._personRoomNr[P_HOWARD] == 46) {
_G(spieler_mi)[P_HOWARD].Mode = true;
_G(SetUpScreenFunc) = setup_func;
if (_G(gameState).flags33_8) {
_G(mouseLeftClick) = false;
hideCur();
setPersonPos(175, 73, P_HOWARD, P_LEFT);
setPersonPos(147, 109, P_CHEWY, P_LEFT);
_G(gameState).flags33_8 = false;
_G(gameState).SVal1 = 46;
waitShowScreen(10);
start_spz_wait(64, 1, false, P_CHEWY);
start_spz(65, 255, false, P_CHEWY);
startAadWait(494);
_G(gameState).SVal2 = 504;
switchRoom(92);
start_spz(65, 255, false, P_CHEWY);
startAadWait(495);
_G(gameState).room_e_obj[78].Exit = 90;
showCur();
}
}
if (_G(gameState).R47SchlossOk && !_G(gameState).R46GetLeder)
bodo();
}
void Room46::xit() {
if (_G(gameState)._personRoomNr[P_HOWARD] == 46) {
_G(spieler_mi)[P_HOWARD].Mode = false;
}
}
void Room46::setup_func() {
calc_person_look();
int16 y = 64;
const int16 ch_x = _G(moveState)[P_CHEWY].Xypos[0];
int16 x;
if (ch_x > 160) {
x = 260;
} else {
x = 120;
}
if (_G(HowardMov) && _G(flags).ExitMov) {
x = 160;
y = 200;
}
goAutoXy(x, y, P_HOWARD, ANI_GO);
}
void Room46::bodo() {
hideCur();
_G(det)->showStaticSpr(0);
_G(person_end_phase)[P_CHEWY] = P_RIGHT;
startAadWait(240);
_G(spieler_mi)[P_CHEWY].Mode = true;
goAutoXy(42, 76, P_CHEWY, ANI_WAIT);
startAadWait(250);
autoMove(1, P_CHEWY);
setPersonSpr(P_RIGHT, P_CHEWY);
startAadWait(251);
autoMove(2, P_CHEWY);
_G(spieler_mi)[P_CHEWY].Mode = false;
startSetAILWait(0, 1, ANI_FRONT);
_G(det)->startDetail(5, 255, ANI_FRONT);
startAadWait(241);
_G(det)->stopDetail(5);
_G(det)->showStaticSpr(5);
startAadWait(609);
_G(det)->hideStaticSpr(5);
startSetAILWait(2, 1, ANI_FRONT);
startSetAILWait(3, 1, ANI_FRONT);
_G(det)->startDetail(4, 255, ANI_FRONT);
startAadWait(242);
_G(det)->stopDetail(4);
_G(det)->showStaticSpr(6);
startAadWait(610);
_G(det)->hideStaticSpr(6);
startSetAILWait(6, 1, ANI_FRONT);
_G(det)->showStaticSpr(3);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(1, 1, ANI_FRONT);
flic_cut(FCUT_065);
_G(out)->setPointer(nullptr);
_G(out)->cls();
register_cutscene(16);
_G(gameState)._personHide[P_CHEWY] = false;
_G(det)->hideStaticSpr(0);
_G(det)->hideStaticSpr(3);
load_chewy_taf(CHEWY_ROCKER);
_G(gameState).R28ChewyPump = false;
setPersonPos(213, 118, P_CHEWY, P_RIGHT);
startAadWait(243);
invent_2_slot(UHR_INV);
invent_2_slot(RING_INV);
_G(gameState).R46GetLeder = true;
showCur();
}
void Room46::kloppe() {
//_G(sndPlayer)->setLoopMode(1);
for (int16 i = 0; i < 4; i++) {
g_engine->_video->playVideo(FCUT_065);
_G(out)->setPointer(nullptr);
_G(out)->cls();
start_aad(244 + i, -1);
int16 delay = _G(gameState).DelaySpeed * 50;
_G(atds)->print_aad(0, 0);
_G(disableScreen) = true;
if (g_engine->_sound->speechEnabled()) {
g_engine->_sound->waitForSpeechToFinish();
} else {
while (g_events->getSwitchCode() == Common::KEYCODE_INVALID && delay) {
--delay;
EVENTS_UPDATE;
SHOULD_QUIT_RETURN;
}
}
_G(disableScreen) = false;
}
g_engine->_video->playVideo(FCUT_066);
// TODO: Reimplement
//_G(sndPlayer)->fadeOut(0);
_G(out)->cls();
//while (_G(sndPlayer)->musicPlaying() && !SHOULD_QUIT) {
// EVENTS_UPDATE;
//}
}
int16 Room46::use_schloss() {
int16 action_ret = false;
if (!_G(cur)->usingInventoryCursor()) {
action_ret = true;
if (!_G(gameState).R46GetLeder) {
autoMove(1, P_CHEWY);
switchRoom(47);
} else {
startAadWait(252);
}
}
return action_ret;
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,42 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM46_H
#define CHEWY_ROOMS_ROOM46_H
namespace Chewy {
namespace Rooms {
class Room46 {
private:
static void setup_func();
static void bodo();
public:
static void entry(int16 eib_nr);
static void xit();
static void kloppe();
static int16 use_schloss();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,102 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/rooms/room47.h"
#include "chewy/sound.h"
namespace Chewy {
namespace Rooms {
void Room47::entry() {
hide_person();
setPersonPos(40, 170, P_CHEWY, P_RIGHT);
_G(SetUpScreenFunc) = set_detail;
_G(flags).MainInput = false;
}
void Room47::xit() {
_G(flags).MainInput = true;
show_person();
setPersonPos(114, 102, P_CHEWY, P_LEFT);
_G(spieler_mi)[P_HOWARD].Mode = true;
}
int16 Room47::use_button(int16 txt_nr) {
int16 k_nr = 0;
int16 action_ret = false;
if (!_G(cur)->usingInventoryCursor()) {
action_ret = true;
switch (txt_nr) {
case 286:
k_nr = 0;
break;
case 292:
k_nr = 1;
break;
case 293:
k_nr = 2;
break;
default:
break;
}
_G(det)->playSound(0, 0);
++_G(gameState).R47Schloss[k_nr];
if (_G(gameState).R47Schloss[k_nr] > 9)
_G(gameState).R47Schloss[k_nr] = 0;
if (_G(gameState).R47Schloss[0] == 7 &&
_G(gameState).R47Schloss[1] == 6 &&
_G(gameState).R47Schloss[2] == 2)
_G(gameState).R47SchlossOk = true;
else
_G(gameState).R47SchlossOk = false;
}
return action_ret;
}
void Room47::set_detail() {
for (int16 i = 0; i < 10; i++)
_G(det)->hideStaticSpr(i);
for (int16 i = 0; i < 3; i++) {
_G(det)->showStaticSpr(_G(gameState).R47Schloss[i]);
_G(det)->setStaticPos(_G(gameState).R47Schloss[i], 124 + i * 30, 96 - i, false, true);
_G(det)->plot_static_details(0, 0, _G(gameState).R47Schloss[i], _G(gameState).R47Schloss[i]);
}
for (int16 i = 0; i < 10; i++)
_G(det)->hideStaticSpr(i);
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,41 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM47_H
#define CHEWY_ROOMS_ROOM47_H
namespace Chewy {
namespace Rooms {
class Room47 {
private:
static void set_detail();
public:
static void entry();
static void xit();
static int16 use_button(int16 txt_nr);
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,168 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room48.h"
#include "chewy/sound.h"
namespace Chewy {
namespace Rooms {
void Room48::entry() {
_G(mouseLeftClick) = false;
_G(gameState).scrollx = 0;
_G(gameState).scrolly = 0;
showCur();
calc_pic();
_G(SetUpScreenFunc) = setup_func;
_G(timer_nr)[0] = _G(room)->set_timer(255, 20);
}
bool Room48::timer(int16 t_nr, int16 ani_nr) {
if (t_nr == _G(timer_nr)[0])
frage();
else
return true;
return false;
}
void Room48::calc_pic() {
for (int16 i = 0; i < 2; i++) {
_G(atds)->setControlBit(312 + i, ATS_ACTIVE_BIT);
_G(gameState).R48Auswahl[3 + i] = 0;
}
_G(gameState).R48Auswahl[0] = 1;
_G(gameState).R48Auswahl[1] = 1;
_G(gameState).R48Auswahl[2] = 1;
if (_G(obj)->checkInventory(VCARD_INV)) {
_G(gameState).R48Auswahl[3] = 1;
_G(atds)->delControlBit(312, ATS_ACTIVE_BIT);
_G(det)->showStaticSpr(4);
}
if (_G(obj)->checkInventory(KAPPE_INV)) {
_G(gameState).R48Auswahl[4] = 1;
_G(atds)->delControlBit(313, ATS_ACTIVE_BIT);
_G(det)->showStaticSpr(4);
}
}
void Room48::frage() {
if (!_G(flags).AutoAniPlay) {
_G(flags).AutoAniPlay = true;
hideCur();
startSetAILWait(1, 1, ANI_FRONT);
_G(det)->showStaticSpr(6);
startSetAILWait(1, 1, ANI_BACK);
_G(det)->hideStaticSpr(6);
_G(uhr)->resetTimer(_G(timer_nr)[0], 0);
showCur();
_G(flags).AutoAniPlay = false;
}
}
void Room48::setup_func() {
for (int16 i = 0; i < 5; i++)
_G(det)->hideStaticSpr(1 + i);
if (_G(flags).ShowAtsInvTxt) {
if (_G(menu_display) == 0) {
_G(menu_item) = CUR_USE;
cur_2_inventory();
cursorChoice(CUR_POINT);
const int16 idx = _G(det)->maus_vector(g_events->_mousePos.x, g_events->_mousePos.y);
if (idx != -1) {
if (_G(gameState).R48Auswahl[idx]) {
_G(det)->showStaticSpr(1 + idx);
if (_G(mouseLeftClick)) {
int16 r_nr;
switch (idx) {
case 0:
r_nr = 45;
break;
case 1:
r_nr = 49;
break;
case 2:
r_nr = 54;
break;
case 3:
r_nr = 57;
break;
case 4:
r_nr = 56;
break;
default:
r_nr = -1;
break;
}
if (r_nr != -1) {
_G(SetUpScreenFunc) = nullptr;
_G(det)->hideStaticSpr(1 + idx);
hideCur();
_G(room)->set_timer_status(255, TIMER_STOP);
_G(room)->set_timer_status(0, TIMER_STOP);
_G(det)->stopDetail(0);
_G(det)->del_static_ani(0);
startSetAILWait(2, 1, ANI_FRONT);
_G(det)->stopSound(0);
_G(menu_item) = CUR_WALK;
cursorChoice(_G(menu_item));
showCur();
_G(gameState).R48TaxiEntry = true;
_G(mouseLeftClick) = false;
setupScreen(DO_SETUP);
for (int16 i = 0; i < MAX_PERSON; i++) {
if (_G(gameState).R48TaxiPerson[i]) {
_G(gameState)._personHide[i] = false;
_G(gameState).R48TaxiPerson[i] = false;
}
}
if (_G(gameState)._personRoomNr[P_HOWARD] == 48) {
_G(gameState)._personRoomNr[P_HOWARD] = r_nr;
}
switchRoom(r_nr);
}
}
}
}
}
}
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,42 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM48_H
#define CHEWY_ROOMS_ROOM48_H
namespace Chewy {
namespace Rooms {
class Room48 {
private:
static void calc_pic();
static void setup_func();
static void frage();
public:
static void entry();
static bool timer(int16 t_nr, int16 ani_nr);
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,296 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room49.h"
#include "chewy/sound.h"
namespace Chewy {
namespace Rooms {
static const AniBlock ABLOCK34[2] = {
{ 7, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 6, 1, ANI_FRONT, ANI_WAIT, 0 },
};
void Room49::entry(int16 eib_nr) {
_G(zoom_horizont) = 110;
_G(flags).ZoomMov = true;
_G(zoom_mov_fak) = 3;
_G(gameState).ScrollxStep = 2;
_G(SetUpScreenFunc) = setup_func;
if (!_G(gameState).R49BoyWeg) {
_G(timer_nr)[0] = _G(room)->set_timer(255, 2);
} else {
_G(det)->del_static_ani(0);
_G(det)->hideStaticSpr(5);
_G(det)->del_static_ani(0);
_G(det)->del_static_ani(1);
}
_G(gameState).ZoomXy[P_HOWARD][0] = 30;
_G(gameState).ZoomXy[P_HOWARD][1] = 30;
_G(spieler_mi)[P_HOWARD].Mode = true;
if (!_G(flags).LoadGame) {
if (_G(gameState).R48TaxiEntry) {
_G(gameState).R48TaxiEntry = false;
setPersonPos(527, 76, P_HOWARD, P_LEFT);
setPersonPos(491, 98, P_CHEWY, P_LEFT);
_G(mouseLeftClick) = false;
_G(gameState).scrollx = 320;
_G(gameState).scrolly = 0;
_G(det)->startDetail(5, 1, ANI_FRONT);
} else if (eib_nr == 83) {
setPersonPos(377, 78, P_HOWARD, P_LEFT);
}
}
}
void Room49::xit(int16 eib_nr) {
_G(gameState).ScrollxStep = 1;
if (_G(gameState)._personRoomNr[P_HOWARD] == 49) {
_G(spieler_mi)[P_HOWARD].Mode = false;
if (eib_nr == 80) {
_G(gameState)._personRoomNr[P_HOWARD] = 50;
} else if (eib_nr == 81) {
_G(SetUpScreenFunc) = nullptr;
startAadWait(268);
}
}
}
bool Room49::timer(int16 t_nr, int16 ani_nr) {
if (t_nr == _G(timer_nr)[0])
calc_boy_ani();
return false;
}
void Room49::gedAction(int index) {
if (!index)
calc_boy();
}
void Room49::calc_boy_ani() {
if (!_G(gameState).R49BoyAniCount) {
_G(gameState).R49BoyAniCount = 3;
_G(gameState).R49BoyAni = true;
_G(det)->del_static_ani(0);
} else {
--_G(gameState).R49BoyAniCount;
_G(gameState).R49BoyAni = false;
_G(det)->del_static_ani(1);
}
_G(det)->set_static_ani(_G(gameState).R49BoyAni ? 1 : 0, -1);
_G(det)->startDetail(_G(gameState).R49BoyAni ? 1 : 0, 1, ANI_FRONT);
_G(uhr)->resetTimer(_G(timer_nr)[0], 0);
}
void Room49::calc_boy() {
if (!_G(gameState).R49WegFrei) {
hideCur();
_G(room)->set_timer_status(255, TIMER_STOP);
_G(uhr)->resetTimer(_G(timer_nr)[0], 0);
stopPerson(P_CHEWY);
stopPerson(P_HOWARD);
_G(person_end_phase)[P_CHEWY] = P_LEFT;
_G(det)->stopDetail(_G(gameState).R49BoyAni ? 1 : 0);
_G(det)->del_static_ani(_G(gameState).R49BoyAni ? 1 : 0);
_G(det)->set_static_ani(2, -1);
_G(SetUpScreenFunc) = nullptr;
startAadWait(262);
_G(SetUpScreenFunc) = nullptr;
autoMove(3, P_CHEWY);
goAutoXy(374, 79, P_HOWARD, ANI_WAIT);
setPersonSpr(P_LEFT, P_HOWARD);
_G(det)->del_static_ani(2);
startSetAILWait(3, 1, ANI_FRONT);
_G(det)->showStaticSpr(9);
_G(gameState)._personHide[P_HOWARD] = true;
startSetAILWait(8, 1, ANI_FRONT);
_G(gameState)._personHide[P_HOWARD] = false;
_G(det)->hideStaticSpr(9);
startSetAILWait(4, 1, ANI_GO);
_G(SetUpScreenFunc) = setup_func;
_G(det)->set_static_ani(_G(gameState).R49BoyAni ? 1 : 0, -1);
_G(room)->set_timer_status(255, TIMER_START);
showCur();
}
}
int16 Room49::use_boy() {
int16 action_ret = false;
if (isCurInventory(SPARK_INV)) {
action_ret = true;
hideCur();
autoMove(3, P_CHEWY);
delInventory(_G(cur)->getInventoryCursor());
talk_boy(265);
_G(gameState).R49WegFrei = true;
_G(gameState).room_e_obj[80].Attribut = EXIT_TOP;
showCur();
} else if (isCurInventory(CIGAR_INV)) {
action_ret = true;
use_boy_cigar();
}
return action_ret;
}
void Room49::use_boy_cigar() {
hideCur();
delInventory(_G(cur)->getInventoryCursor());
talk_boy(263);
_G(SetUpScreenFunc) = nullptr;
autoMove(5, P_CHEWY);
const int16 zoom = _G(room)->_roomInfo->_zoomFactor;
_G(room)->set_zoom(zoom);
goAutoXy(416, 79, P_HOWARD, ANI_WAIT);
setPersonSpr(P_LEFT, P_HOWARD);
_G(flags).NoScroll = true;
auto_scroll(164, 0);
flic_cut(FCUT_067);
register_cutscene(17);
_G(room)->set_timer_status(255, TIMER_STOP);
_G(uhr)->resetTimer(_G(timer_nr)[0], 0);
_G(det)->del_static_ani(_G(gameState).R49BoyAni ? 1 : 0);
_G(det)->stopDetail(_G(gameState).R49BoyAni ? 1 : 0);
_G(flags).NoScroll = false;
setPersonSpr(P_RIGHT, P_CHEWY);
startAadWait(264);
_G(room)->set_zoom(zoom);
_G(obj)->addInventory(GUM_INV, &_G(room_blk));
inventory_2_cur(GUM_INV);
_G(atds)->setControlBit(318, ATS_ACTIVE_BIT);
_G(SetUpScreenFunc) = setup_func;
_G(gameState).R49BoyWeg = true;
showCur();
}
void Room49::talk_boy() {
if (!_G(gameState).R49BoyWeg) {
autoMove(3, P_CHEWY);
talk_boy(266 + (_G(gameState).R49WegFrei ? 1 : 0));
}
}
void Room49::talk_boy(int16 aad_nr) {
if (!_G(gameState).R49BoyWeg) {
_G(room)->set_timer_status(255, TIMER_STOP);
_G(uhr)->resetTimer(_G(timer_nr)[0], 0);
_G(det)->stopDetail(_G(gameState).R49BoyAni ? 1 : 0);
_G(det)->set_static_ani(_G(gameState).R49BoyAni ? 1 : 0, -1);
_G(det)->set_static_ani(2, -1);
_G(SetUpScreenFunc) = nullptr;
stopPerson(P_HOWARD);
startAadWait(aad_nr);
_G(SetUpScreenFunc) = setup_func;
_G(det)->del_static_ani(2);
_G(det)->set_static_ani(_G(gameState).R49BoyAni ? 1 : 0, -1);
_G(room)->set_timer_status(255, TIMER_START);
}
}
void Room49::look_hotel() {
if (_G(gameState)._personRoomNr[P_HOWARD] == 49) {
_G(SetUpScreenFunc) = nullptr;
stopPerson(P_HOWARD);
startAadWait(261);
_G(SetUpScreenFunc) = setup_func;
}
}
int16 Room49::use_taxi() {
int16 action_ret = false;
if (!_G(cur)->usingInventoryCursor()) {
action_ret = true;
hideCur();
startAniBlock(2, ABLOCK34);
_G(det)->showStaticSpr(7);
autoMove(2, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
_G(gameState).R48TaxiPerson[P_CHEWY] = true;
if (_G(gameState)._personRoomNr[P_HOWARD] == 49) {
goAutoXy(507, 74, P_HOWARD, ANI_WAIT);
goAutoXy(490, 58, P_HOWARD, ANI_WAIT);
_G(gameState)._personHide[P_HOWARD] = true;
_G(gameState).R48TaxiPerson[P_HOWARD] = true;
_G(gameState)._personRoomNr[P_HOWARD] = 48;
}
_G(det)->hideStaticSpr(7);
startSetAILWait(5, 1, ANI_FRONT);
_G(det)->stopSound(0);
switchRoom(48);
}
return action_ret;
}
void Room49::setup_func() {
if (_G(gameState)._personRoomNr[P_HOWARD] == 49) {
calc_person_look();
const int16 ch_x = _G(moveState)[P_CHEWY].Xypos[0];
int16 x, y;
if (ch_x < 130) {
x = 40;
y = 97;
} else if (ch_x < 312) {
x = 221;
y = 94;
} else if (ch_x < 445) {
x = 342;
y = 93;
} else {
x = 536;
y = 90;
}
goAutoXy(x, y, P_HOWARD, ANI_GO);
}
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,51 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM49_H
#define CHEWY_ROOMS_ROOM49_H
namespace Chewy {
namespace Rooms {
class Room49 {
private:
static void talk_boy(int16 aad_nr);
static void setup_func();
static void calc_boy_ani();
static void calc_boy();
public:
static void entry(int16 eib_nr);
static void xit(int16 eib_nr);
static bool timer(int16 t_nr, int16 ani_nr);
static void gedAction(int index);
static int16 use_boy();
static void use_boy_cigar();
static void look_hotel();
static int16 use_taxi();
static void talk_boy();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,283 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room50.h"
namespace Chewy {
namespace Rooms {
static const AniBlock ABLOCK36[2] = {
{ 6, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 7, 1, ANI_FRONT, ANI_WAIT, 0 },
};
bool Room50::_wasser;
void Room50::entry(int16 eib_nr) {
_G(gameState).ScrollxStep = 2;
if (_G(gameState).flags32_10) {
hideCur();
stop_page();
_G(mouseLeftClick) = false;
setPersonPos(1, 64, P_HOWARD, P_RIGHT);
setPersonPos(92, 123, P_CHEWY, P_LEFT);
startAadWait(510);
_G(out)->setPointer(nullptr);
_G(out)->cls();
_G(flags).NoPalAfterFlc = true;
flic_cut(FCUT_108);
showCur();
switchRoom(51);
} else {
if (_G(gameState).R50Zigarre) {
stop_cigar();
} else {
_G(det)->startDetail(0, 255, ANI_FRONT);
}
if (!_G(gameState).R50KeyOK) {
_G(timer_nr)[0] = _G(room)->set_timer(1, 8);
_wasser = false;
} else {
_G(det)->showStaticSpr(4);
}
_G(SetUpScreenFunc) = setup_func;
if (_G(gameState)._personRoomNr[P_HOWARD] == 50) {
_G(spieler_mi)[P_HOWARD].Mode = true;
if (!_G(flags).LoadGame) {
if (eib_nr == 85)
setPersonPos(298, 56, P_HOWARD, P_RIGHT);
else
setPersonPos(1, 64, P_HOWARD, P_RIGHT);
}
}
}
}
void Room50::xit(int16 eib_nr) {
_G(gameState).ScrollxStep = 1;
if (_G(gameState)._personRoomNr[P_HOWARD] == 50) {
if (eib_nr == 83)
_G(gameState)._personRoomNr[P_HOWARD] = 49;
else
_G(gameState)._personRoomNr[P_HOWARD] = 51;
_G(spieler_mi)[P_HOWARD].Mode = false;
}
}
bool Room50::timer(int16 t_nr, int16 ani_nr) {
if (t_nr == _G(timer_nr)[0])
calc_wasser();
return true;
}
void Room50::gedAction(int index) {
if (!index)
calc_treppe();
}
void Room50::stop_cigar() {
_G(room)->set_timer_status(0, TIMER_STOP);
_G(det)->del_static_ani(0);
_G(atds)->set_all_ats_str(328, 1, ATS_DATA);
_G(det)->stopDetail(0);
_G(gameState).R50Zigarre = true;
}
void Room50::calc_wasser() {
if (!_wasser) {
stop_page();
_G(det)->startDetail(4, 1, ANI_FRONT);
_wasser = true;
}
}
void Room50::stop_page() {
_G(room)->set_timer_status(3, TIMER_STOP);
_G(det)->del_static_ani(3);
_G(det)->stopDetail(3);
_G(det)->stopDetail(4);
}
void Room50::go_page() {
_G(det)->set_static_ani(3, -1);
_G(room)->set_timer_status(3, TIMER_START);
}
void Room50::calc_treppe() {
if (!_G(flags).AutoAniPlay) {
_G(flags).AutoAniPlay = true;
if (!_G(gameState).R50KeyOK) {
hideCur();
stopPerson(P_CHEWY);
_G(room)->set_timer_status(1, TIMER_STOP);
_wasser = false;
_G(flags).NoScroll = true;
auto_scroll(40, 0);
stop_page();
_G(det)->set_static_ani(5, -1);
startAadWait(272);
autoMove(3, P_CHEWY);
aad_page(273, 5);
_G(flags).NoScroll = false;
}
_G(flags).AutoAniPlay = false;
}
}
int16 Room50::use_gutschein() {
int16 action_ret = false;
if (isCurInventory(HOTEL_INV)) {
action_ret = true;
if (!_G(gameState).R50KeyOK) {
hideCur();
autoMove(3, P_CHEWY);
_G(room)->set_timer_status(1, TIMER_STOP);
_wasser = false;
stop_page();
delInventory(_G(cur)->getInventoryCursor());
startAniBlock(2, ABLOCK36);
aad_page(274, 8);
} else {
startAadWait(276);
}
}
return action_ret;
}
int16 Room50::use_gum() {
int16 action_ret = false;
if (isCurInventory(GUM_INV)) {
action_ret = true;
hideCur();
_G(gameState).R50KeyOK = true;
_G(room)->set_timer_status(1, TIMER_STOP);
_wasser = false;
stop_page();
startSetAILWait(6, 1, ANI_FRONT);
_G(det)->set_static_ani(5, -1);
autoMove(3, P_CHEWY);
_G(spieler_mi)[P_CHEWY].Mode = true;
goAutoXy(75, 92, P_CHEWY, ANI_WAIT);
_G(SetUpScreenFunc) = nullptr;
goAutoXy(112, 57, P_HOWARD, ANI_WAIT);
setPersonSpr(P_LEFT, P_HOWARD);
delInventory(_G(cur)->getInventoryCursor());
hide_person();
startSetAILWait(2, 1, ANI_FRONT);
_G(det)->showStaticSpr(4);
startSetAILWait(2, 1, ANI_BACK);
show_person();
setPersonSpr(P_LEFT, P_CHEWY);
startAadWait(275);
_G(det)->del_static_ani(5);
startSetAILWait(9, 1, ANI_FRONT);
_G(det)->del_static_ani(5);
_G(det)->set_static_ani(10, -1);
startAadWait(277);
_G(SetUpScreenFunc) = setup_func;
autoMove(3, P_CHEWY);
_G(spieler_mi)[P_CHEWY].Mode = true;
_G(det)->del_static_ani(10);
go_page();
_G(obj)->addInventory(KEY_INV, &_G(room_blk));
inventory_2_cur(KEY_INV);
_G(atds)->set_all_ats_str(323, 1, ATS_DATA);
_G(atds)->set_all_ats_str(327, 1, ATS_DATA);
_G(gameState).room_e_obj[84].Attribut = EXIT_TOP;
showCur();
}
return action_ret;
}
void Room50::talk_page() {
startAadWait(276);
}
void Room50::aad_page(int16 aad_nr, int16 ani_nr) {
_G(det)->set_static_ani(ani_nr, -1);
startAadWait(aad_nr);
_G(det)->del_static_ani(ani_nr);
startSetAILWait(6, 1, ANI_BACK);
go_page();
if (!_G(gameState).R50KeyOK)
_G(room)->set_timer_status(1, TIMER_START);
showCur();
}
void Room50::setup_func() {
if (_wasser && !_G(det)->get_ani_status(4)) {
_wasser = false;
go_page();
}
if (_G(gameState)._personRoomNr[P_HOWARD] == 50) {
calc_person_look();
const int16 ch_x = _G(moveState)[P_CHEWY].Xypos[0];
int16 x, y;
if (ch_x < 72) {
x = 1;
y = 64;
} else if (ch_x < 275 && _G(moveState)[P_CHEWY].Xypos[1] > 72) {
x = 143;
y = 57;
} else {
x = 162;
y = 115;
}
if (_G(HowardMov) && _G(flags).ExitMov) {
_G(SetUpScreenFunc) = nullptr;
_G(HowardMov) = 0;
autoMove(4, P_HOWARD);
} else {
goAutoXy(x, y, P_HOWARD, ANI_GO);
}
}
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,54 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM50_H
#define CHEWY_ROOMS_ROOM50_H
namespace Chewy {
namespace Rooms {
class Room50 {
private:
static bool _wasser;
static void stop_page();
static void go_page();
static void aad_page(int16 aad_nr, int16 ani_nr);
static void setup_func();
static void calc_wasser();
static void calc_treppe();
public:
static void entry(int16 eib_nr);
static void xit(int16 eib_nr);
static bool timer(int16 t_nr, int16 ani_nr);
static void gedAction(int index);
static int16 use_gutschein();
static int16 use_gum();
static void talk_page();
static void stop_cigar();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,363 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/ani_dat.h"
#include "chewy/room.h"
#include "chewy/rooms/room51.h"
#include "chewy/sound.h"
namespace Chewy {
namespace Rooms {
static const AniBlock ABLOCK37[5] = {
{ 6, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 7, 3, ANI_FRONT, ANI_WAIT, 0 },
{ 6, 1, ANI_BACK, ANI_WAIT, 0 },
{ 5, 1, ANI_BACK, ANI_WAIT, 0 },
{ 2, 1, ANI_BACK, ANI_WAIT, 0 },
};
bool Room51::_flag;
bool Room51::_enemyFlag[2];
int16 Room51::_tmpx;
int16 Room51::_tmpy;
int Room51::_index;
void Room51::entry() {
_G(zoom_horizont) = 140;
_G(flags).ZoomMov = true;
_G(zoom_mov_fak) = 4;
if (_G(gameState).flags32_10) {
_G(atds)->enableEvents(false);
_G(gameState)._personHide[P_CHEWY] = true;
_G(gameState)._personHide[P_HOWARD] = true;
_G(mouseLeftClick) = false;
_G(gameState).scrollx = 0;
setPersonPos(34, 120, P_HOWARD, P_RIGHT);
setPersonPos(234, 69, P_CHEWY, P_LEFT);
_G(SetUpScreenFunc) = setup_func;
_G(det)->showStaticSpr(17);
_index = 0;
hideCur();
for (int i = 0; i < 2; ++i) {
_enemyFlag[i] = false;
_G(timer_nr)[i] = _G(room)->set_timer(i + 9, i * 2 + 6);
}
_G(flags).MainInput = false;
_flag = false;
} else {
_G(det)->hideStaticSpr(17);
for (int i = 0; i < 2; i++)
_G(det)->startDetail(3 + i, 1, ANI_FRONT);
if (_G(gameState)._personRoomNr[P_HOWARD] == 51) {
_G(gameState).ZoomXy[P_HOWARD][0] = 40;
_G(gameState).ZoomXy[P_HOWARD][1] = 30;
if (!_G(flags).LoadGame) {
setPersonPos(88, 93, P_HOWARD, P_RIGHT);
}
if (!_G(gameState).R51FirstEntry) {
hideCur();
_G(gameState).R51FirstEntry = true;
setPersonSpr(P_LEFT, P_CHEWY);
startAadWait(283);
showCur();
}
_G(SetUpScreenFunc) = setup_func;
_G(spieler_mi)[P_HOWARD].Mode = true;
}
}
}
void Room51::xit(int16 eib_nr) {
_G(atds)->enableEvents(true);
if (_G(gameState).flags32_10) {
_G(flags).MainInput = true;
_G(gameState)._personHide[P_CHEWY] = false;
_G(gameState)._personHide[P_HOWARD] = false;
_G(gameState)._personRoomNr[P_HOWARD] = 91;
_G(menu_item) = CUR_WALK;
cursorChoice(_G(menu_item));
showCur();
} else if (_G(gameState)._personRoomNr[P_HOWARD] == 51) {
if (eib_nr == 85) {
_G(gameState)._personRoomNr[P_HOWARD] = 50;
} else {
_G(gameState)._personRoomNr[P_HOWARD] = 52;
}
_G(spieler_mi)[P_HOWARD].Mode = false;
}
}
bool Room51::timer(int16 t_nr, int16 ani_nr) {
if (_G(gameState).flags32_10)
timer_action(t_nr, _G(room)->_roomTimer._objNr[ani_nr]);
else
return true;
return false;
}
void Room51::setup_func() {
if (_G(gameState).flags32_10) {
_tmpx = g_events->_mousePos.x;
_tmpy = g_events->_mousePos.y;
if (_tmpx > 215)
_tmpx = 215;
if (_tmpy < 81)
_tmpy = 81;
_G(det)->setStaticPos(17, _tmpx, _tmpy, false, false);
if ((_G(minfo).button == 1 || g_events->getSwitchCode() == 28) && !_flag) {
_flag = true;
_G(det)->setDetailPos(8, _tmpx - 20, _tmpy + 41);
startSetAILWait(8, 1, ANI_FRONT);
_flag = false;
++_index;
switch (_index) {
case 2:
startAadWait(512);
_index = 1000;
break;
case 1006:
startAadWait(513);
_index = 2000;
break;
case 2003:
startAadWait(615);
_index = 10000;
break;
case 10012:
startAadWait(514);
waitShowScreen(5);
_G(flags).NoPalAfterFlc = true;
_G(out)->setPointer(nullptr);
_G(out)->cls();
flic_cut(FCUT_115);
register_cutscene(28);
switchRoom(91);
break;
default:
break;
}
}
} else if (_G(gameState)._personRoomNr[P_HOWARD] == 51) {
calc_person_look();
const int16 ch_y = _G(moveState)[P_CHEWY].Xypos[1];
int16 x, y;
if (ch_y < 129) {
x = 56;
y = 106;
} else {
x = 31;
y = 118;
}
if (_G(HowardMov) && _G(flags).ExitMov) {
_G(SetUpScreenFunc) = nullptr;
_G(HowardMov) = 0;
autoMove(9, P_HOWARD);
} else {
goAutoXy(x, y, P_HOWARD, ANI_GO);
}
}
}
int16 Room51::use_door(int16 txt_nr) {
int16 action_ret = false;
if (isCurInventory(KEY_INV)) {
hideCur();
action_ret = true;
switch (txt_nr) {
case 329:
autoMove(8, P_CHEWY);
_G(SetUpScreenFunc) = nullptr;
_G(det)->showStaticSpr(0);
if (!_G(gameState).R51HotelRoom) {
autoMove(11, P_HOWARD);
setPersonSpr(P_LEFT, P_HOWARD);
_G(gameState).R51HotelRoom = true;
_G(gameState).room_e_obj[86].Attribut = EXIT_LEFT;
startAadWait(285);
_G(atds)->set_all_ats_str(329, 1, ATS_DATA);
_G(SetUpScreenFunc) = setup_func;
} else {
showCur();
switchRoom(52);
}
break;
case 330:
autoMove(9, P_CHEWY);
if (!_G(gameState).R51KillerWeg) {
_G(det)->playSound(2, 0);
_G(det)->showStaticSpr(1);
startSetAILWait(2, 1, ANI_FRONT);
_G(det)->startDetail(5, 255, ANI_FRONT);
if (!_G(gameState).R52HotDogOk) {
startAadWait(287);
autoMove(12, P_CHEWY);
_G(det)->stopDetail(5);
startAniBlock(5, ABLOCK37);
_G(det)->hideStaticSpr(1);
_G(det)->stopSound(0);
startAadWait(284);
} else {
_G(gameState).R51KillerWeg = true;
startAadWait(290);
_G(det)->stopSound(0);
_G(out)->fadeOut();
_G(out)->setPointer(nullptr);
_G(out)->cls();
_G(out)->fadeIn(_G(pal));
_G(flags).NoPalAfterFlc = true;
_G(det)->showStaticSpr(16);
flic_cut(FCUT_068);
_G(det)->hideStaticSpr(16);
_G(flags).NoPalAfterFlc = false;
_G(det)->stopDetail(5);
_G(obj)->show_sib(SIB_AUSRUEST_R52);
_G(obj)->calc_rsi_flip_flop(SIB_AUSRUEST_R52);
_G(det)->hideStaticSpr(1);
_G(fx_blend) = BLEND3;
setupScreen(DO_SETUP);
startAadWait(291);
}
} else {
startAadWait(401);
}
break;
case 331:
case 334:
autoMove((txt_nr == 331) ? 10 : 7, P_CHEWY);
_G(out)->setPointer(nullptr);
_G(out)->cls();
_G(flags).NoPalAfterFlc = true;
flic_cut(FCUT_114);
setPersonPos(115, 144, P_CHEWY, P_LEFT);
_G(fx_blend) = BLEND3;
setupScreen(NO_SETUP);
startAadWait(564);
break;
case 332:
autoMove(6, P_CHEWY);
startAadWait(286);
break;
case 333:
autoMove(4, P_CHEWY);
switch (_G(gameState).R51DoorCount) {
case 0:
_G(det)->showStaticSpr(3);
startAadWait(278);
startDetailFrame(0, 1, ANI_FRONT, 3);
start_spz(HO_BRILL_JMP, 1, ANI_FRONT, P_HOWARD);
waitDetail(0);
_G(det)->showStaticSpr(14);
startAadWait(279);
++_G(gameState).R51DoorCount;
_G(obj)->show_sib(SIB_FLASCHE_R51);
_G(obj)->calc_rsi_flip_flop(SIB_FLASCHE_R51);
_G(det)->hideStaticSpr(3);
break;
case 1:
_G(det)->showStaticSpr(3);
startAadWait(280);
startSetAILWait(1, 1, ANI_FRONT);
++_G(gameState).R51DoorCount;
_G(obj)->show_sib(SIB_KAPPE_R51);
_G(obj)->calc_rsi_flip_flop(SIB_KAPPE_R51);
_G(det)->hideStaticSpr(3);
_G(det)->showStaticSpr(15);
break;
default:
startAadWait(281);
if (_G(gameState)._personRoomNr[P_HOWARD] == 51)
startAadWait(282);
break;
}
break;
default:
break;
}
showCur();
}
return action_ret;
}
void Room51::timer_action(int16 t_nr, int16 obj_nr) {
if (obj_nr == 9 || obj_nr == 10) {
if (!_enemyFlag[obj_nr - 9]) {
_G(det)->startDetail(obj_nr, 1, ANI_FRONT);
_enemyFlag[obj_nr - 9] = true;
} else if (!_G(det)->get_ani_status(obj_nr)) {
_G(det)->startDetail(obj_nr, 1, ANI_GO);
_G(det)->startDetail(obj_nr + 2, 1, ANI_FRONT);
_G(uhr)->resetTimer(t_nr, 0);
_enemyFlag[obj_nr - 9] = false;
}
}
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,49 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM51_H
#define CHEWY_ROOMS_ROOM51_H
namespace Chewy {
namespace Rooms {
class Room51 {
private:
static bool _flag;
static bool _enemyFlag[2];
static int16 _tmpx, _tmpy;
static int _index;
static void setup_func();
static void timer_action(int16 t_nr, int16 obj_nr);
public:
static void entry();
static void xit(int16 eib_nr);
static bool timer(int16 t_nr, int16 ani_nr);
static int16 use_door(int16 txt_nr);
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,145 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room52.h"
#include "chewy/sound.h"
namespace Chewy {
namespace Rooms {
void Room52::entry() {
_G(SetUpScreenFunc) = setup_func;
_G(spieler_mi)[P_HOWARD].Mode = true;
if (_G(gameState).R52HotDogOk && !_G(gameState).R52KakerWeg) {
plot_armee(0);
_G(det)->playSound(0, 0);
} else {
_G(det)->stopSound(0);
}
if (_G(gameState).R52KakerWeg)
_G(det)->stopDetail(0);
if (!_G(flags).LoadGame) {
_G(det)->showStaticSpr(4);
_G(gameState).R52TuerAuf = true;
setPersonPos(20, 50, P_HOWARD, P_LEFT);
setPersonPos(35, 74, P_CHEWY, P_RIGHT);
autoMove(2, P_CHEWY);
_G(gameState).R52TuerAuf = false;
_G(det)->hideStaticSpr(4);
setShadowPalette(2, true);
}
}
void Room52::xit() {
if (_G(gameState)._personRoomNr[P_HOWARD] == 52) {
_G(gameState)._personRoomNr[P_HOWARD] = 51;
_G(spieler_mi)[P_HOWARD].Mode = false;
}
}
void Room52::gedAction(int index) {
if (index == 1)
kaker_platt();
}
int16 Room52::use_hot_dog() {
int16 action_ret = false;
hideCur();
if (isCurInventory(BURGER_INV)) {
action_ret = true;
autoMove(3, P_CHEWY);
start_spz_wait(CH_ROCK_GET1, 1, false, P_CHEWY);
_G(det)->showStaticSpr(0);
delInventory(_G(cur)->getInventoryCursor());
autoMove(4, P_CHEWY);
_G(gameState).R52HotDogOk = true;
plot_armee(20);
_G(det)->playSound(0, 0);
_G(atds)->set_all_ats_str(341, 1, ATS_DATA);
autoMove(2, P_CHEWY);
setPersonSpr(P_LEFT, P_CHEWY);
startAadWait(288);
} else if (isCurInventory(KILLER_INV)) {
action_ret = true;
autoMove(5, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(7, 1, ANI_FRONT);
_G(det)->playSound(7, 0);
_G(det)->startDetail(8, 255, ANI_FRONT);
for (int16 i = 0; i < 5; i++) {
waitShowScreen(20);
_G(det)->stopDetail(2 + i);
}
_G(det)->stopSound(0);
_G(det)->stopDetail(0);
_G(det)->stopDetail(8);
startSetAILWait(7, 1, ANI_BACK);
_G(det)->stopSound(0);
_G(gameState)._personHide[P_CHEWY] = false;
_G(atds)->setControlBit(341, ATS_ACTIVE_BIT);
startAadWait(303);
_G(atds)->set_all_ats_str(KILLER_INV, 1, INV_ATS_DATA);
_G(gameState).R52KakerWeg = true;
}
showCur();
return action_ret;
}
void Room52::plot_armee(int16 frame) {
for (int16 i = 0; i < 5; i++) {
waitShowScreen(frame);
_G(det)->startDetail(2 + i, 255, ANI_FRONT);
}
}
void Room52::kaker_platt() {
if (!_G(gameState).R52KakerJoke && _G(gameState).R52HotDogOk && !_G(gameState).R52KakerWeg && !_G(flags).ExitMov) {
_G(gameState).R52KakerJoke = true;
stopPerson(P_CHEWY);
hideCur();
startAadWait(289);
showCur();
}
}
void Room52::setup_func() {
if (_G(gameState)._personRoomNr[P_HOWARD] == 52) {
calc_person_look();
const int16 y = (_G(moveState)[P_CHEWY].Xypos[1] < 97) ? 44 : 87;
goAutoXy(1, y, P_HOWARD, ANI_GO);
}
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,45 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM52_H
#define CHEWY_ROOMS_ROOM52_H
namespace Chewy {
namespace Rooms {
class Room52 {
private:
static void plot_armee(int16 frame);
static void setup_func();
static void kaker_platt();
public:
static void entry();
static void xit();
static void gedAction(int index);
static int16 use_hot_dog();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,100 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/ani_dat.h"
#include "chewy/room.h"
#include "chewy/rooms/room53.h"
namespace Chewy {
namespace Rooms {
static const AniBlock ABLOCK35[7] = {
{ 2, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 7, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 8, 3, ANI_FRONT, ANI_WAIT, 0 },
{ 4, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 5, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 9, 1, ANI_FRONT, ANI_WAIT, 0 },
{ 5, 1, ANI_FRONT, ANI_WAIT, 0 },
};
void Room53::entry() {
hideCur();
_G(obj)->hide_sib(SIB_VISIT_R53);
_G(atds)->delControlBit(319, ATS_ACTIVE_BIT);
startSetAILWait(0, 1, ANI_FRONT);
_G(det)->set_static_ani(1, -1);
_G(timer_nr)[0] = _G(room)->set_timer(1, 7);
showCur();
}
void Room53::man_go() {
_G(room)->set_timer_status(1, TIMER_STOP);
_G(det)->del_static_ani(1);
startSetAILWait(5, 1, ANI_FRONT);
_G(atds)->setControlBit(319, ATS_ACTIVE_BIT);
if (!_G(gameState).R53Visit)
_G(obj)->show_sib(SIB_VISIT_R53);
}
void Room53::talk_man() {
hideCur();
autoMove(2, P_CHEWY);
_G(room)->set_timer_status(1, TIMER_STOP);
_G(det)->del_static_ani(1);
startSetAILWait(2, 1, ANI_FRONT);
_G(det)->set_static_ani(3, -1);
startAadWait(269 + (_G(gameState).R53Kostuem ? 1 : 0));
_G(det)->del_static_ani(3);
startSetAILWait(4, 1, ANI_FRONT);
man_go();
showCur();
}
int16 Room53::use_man() {
int16 action_ret = false;
if (isCurInventory(BESTELL_INV)) {
action_ret = true;
hideCur();
_G(gameState).R53Kostuem = true;
delInventory(_G(cur)->getInventoryCursor());
autoMove(2, P_CHEWY);
startAadWait(271);
_G(room)->set_timer_status(1, TIMER_STOP);
_G(det)->del_static_ani(1);
startAniBlock(7, ABLOCK35);
_G(obj)->addInventory(JMKOST_INV, &_G(room_blk));
inventory_2_cur(JMKOST_INV);
_G(atds)->setControlBit(319, ATS_ACTIVE_BIT);
showCur();
}
return action_ret;
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,41 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM53_H
#define CHEWY_ROOMS_ROOM53_H
namespace Chewy {
namespace Rooms {
class Room53 {
private:
static void man_go();
public:
static void entry();
static void talk_man();
static int16 use_man();
};
} // namespace Rooms
} // namespace Chewy
#endif

View File

@@ -0,0 +1,387 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/room.h"
#include "chewy/rooms/room54.h"
#include "chewy/sound.h"
namespace Chewy {
namespace Rooms {
void Room54::entry(int16 eib_nr) {
_G(gameState).ScrollxStep = 2;
_G(SetUpScreenFunc) = setup_func;
_G(zoom_horizont) = 106;
_G(flags).ZoomMov = true;
_G(zoom_mov_fak) = 3;
_G(gameState).ZoomXy[P_HOWARD][0] = 30;
_G(gameState).ZoomXy[P_HOWARD][1] = 66;
if (_G(gameState).R54FputzerWeg)
_G(det)->showStaticSpr(9);
_G(spieler_mi)[P_HOWARD].Mode = true;
if (!_G(flags).LoadGame) {
if (_G(gameState).R48TaxiEntry) {
_G(gameState).R48TaxiEntry = false;
if (_G(gameState)._personRoomNr[P_HOWARD] == 54) {
_G(gameState).R54HowardVorne = 0;
setPersonPos(290, 61, P_HOWARD, P_RIGHT);
}
setPersonPos(300, 80, P_CHEWY, P_LEFT);
_G(mouseLeftClick) = false;
_G(gameState).scrollx = 134;
_G(gameState).scrolly = 0;
} else if (_G(gameState).R55Location) {
aufzug_ab();
} else if (eib_nr == 90 || _G(gameState).R55ExitDia) {
if (_G(gameState)._personRoomNr[P_HOWARD] == 54) {
_G(gameState).R54HowardVorne = 0;
setPersonPos(212, 61, P_HOWARD, P_RIGHT);
}
_G(gameState).scrollx = 66;
setPersonPos(241, 85, P_CHEWY, P_LEFT);
}
if (_G(gameState).R55ExitDia) {
startAadWait(_G(gameState).R55ExitDia);
showCur();
_G(gameState).R55ExitDia = false;
}
if (_G(gameState).R55R54First) {
_G(gameState).R55R54First = false;
}
}
}
void Room54::xit(int16 eib_nr) {
_G(gameState).ScrollxStep = 1;
if (eib_nr == 89 && _G(gameState)._personRoomNr[P_HOWARD] == 54) {
_G(gameState)._personRoomNr[P_HOWARD] = 55;
_G(spieler_mi)[P_HOWARD].Mode = false;
}
}
void Room54::setup_func() {
if (_G(gameState)._personRoomNr[P_HOWARD] == 54) {
calc_person_look();
if (_G(gameState).R54HowardVorne != 255) {
const int16 ch_x = _G(moveState)[P_CHEWY].Xypos[0];
int16 x, y;
if (_G(gameState).R54HowardVorne) {
if (ch_x < 218) {
x = 150;
y = 113;
} else {
x = 287;
y = 115;
}
} else {
y = 61;
if (ch_x < 167) {
x = 122;
} else if (ch_x < 251) {
x = 212;
} else {
x = 290;
}
}
goAutoXy(x, y, P_HOWARD, ANI_GO);
}
}
}
int16 Room54::use_schalter() {
int16 action_ret = false;
if (!_G(cur)->usingInventoryCursor()) {
hideCur();
action_ret = true;
if (!_G(gameState).R54FputzerWeg) {
autoMove(1, P_CHEWY);
_G(gameState).R54HowardVorne = 255;
goAutoXy(127, 76, P_HOWARD, ANI_WAIT);
goAutoXy(14, 72, P_HOWARD, ANI_GO);
start_spz_wait(CH_ROCK_GET2, 1, false, P_CHEWY);
_G(det)->showStaticSpr(0);
autoMove(2, P_CHEWY);
_G(det)->playSound(1, 0);
_G(det)->playSound(0, 1);
_G(det)->stopSound(2);
startSetAILWait(1, 1, ANI_FRONT);
_G(det)->startDetail(3, 255, ANI_FRONT);
startAadWait(292 + _G(gameState).R54LiftCount);
_G(det)->stopDetail(3);
++_G(gameState).R54LiftCount;
int16 aad_nr;
if (_G(gameState).R54LiftCount < 3) {
startSetAILWait(2, 1, ANI_FRONT);
_G(det)->hideStaticSpr(0);
_G(det)->stopSound(0);
_G(det)->stopSound(1);
_G(det)->playSound(1, 2);
startSetAILWait(1, 1, ANI_BACK);
_G(det)->stopSound(2);
aad_nr = 295;
} else {
startSetAILWait(5, 1, ANI_FRONT);
_G(det)->showStaticSpr(9);
startSetAILWait(4, 1, ANI_FRONT);
aad_nr = 296;
_G(gameState).R54FputzerWeg = true;
_G(atds)->delControlBit(345, ATS_ACTIVE_BIT);
_G(atds)->set_all_ats_str(349, 1, ATS_DATA);
_G(atds)->set_all_ats_str(351, 1, ATS_DATA);
}
startAadWait(aad_nr);
_G(gameState).R54HowardVorne = 0;
} else {
startAadWait(297);
}
showCur();
}
return action_ret;
}
void Room54::talk_verkauf() {
hideCur();
if (!_G(gameState).R54HotDogOk) {
if (_G(gameState).R45MagOk) {
if (_G(cur)->getInventoryCursor() == DOLLAR175_INV)
delInventory(DOLLAR175_INV);
else
remove_inventory(DOLLAR175_INV);
}
_G(gameState).R54HotDogOk = true;
autoMove(3, P_CHEWY);
_G(gameState).R54HowardVorne = 1;
startAadWait(299);
_G(room)->set_timer_status(6, TIMER_STOP);
_G(det)->del_static_ani(6);
startSetAILWait(7, 1, ANI_FRONT);
_G(det)->startDetail(8, 255, ANI_FRONT);
startAadWait(310);
_G(det)->stopDetail(8);
startSetAILWait(9, 1, ANI_FRONT);
startSetAILWait(10, 1, ANI_FRONT);
_G(det)->startDetail(11, 255, ANI_FRONT);
startAadWait(311);
_G(det)->stopDetail(11);
_G(room)->set_timer_status(6, TIMER_START);
_G(det)->set_static_ani(6, -1);
autoMove(4, P_CHEWY);
start_aad(_G(gameState).R45MagOk ? 312 : 578, -1);
_G(obj)->addInventory(BURGER_INV, &_G(room_blk));
inventory_2_cur(BURGER_INV);
} else {
startAadWait(313);
}
showCur();
}
int16 Room54::use_zelle() {
int16 action_ret = false;
hideCur();
if (_G(cur)->usingInventoryCursor()) {
if (isCurInventory(JMKOST_INV)) {
action_ret = true;
if (!_G(gameState).R54Schild) {
startAadWait(318);
} else {
autoMove(5, P_CHEWY);
_G(gameState).R54HowardVorne = 1;
_G(SetUpScreenFunc) = nullptr;
auto_scroll(176, 0);
goAutoXy(239, 101, P_HOWARD, ANI_WAIT);
flic_cut(FCUT_069);
delInventory(_G(cur)->getInventoryCursor());
invent_2_slot(LEDER_INV);
load_chewy_taf(CHEWY_JMANS);
_G(zoom_horizont) = 90;
setPersonPos(283, 93, P_CHEWY, P_LEFT);
setPersonPos(238, 99, P_HOWARD, P_RIGHT);
startAadWait(315);
goAutoXy(241, 74, P_CHEWY, ANI_WAIT);
startAadWait(316);
_G(spieler_mi)[P_HOWARD].Mode = true;
switchRoom(55);
}
}
} else {
action_ret = true;
autoMove(6, P_CHEWY);
_G(gameState).R54HowardVorne = 1;
startAadWait(319);
}
showCur();
return action_ret;
}
int16 Room54::use_azug() {
int16 action_ret = false;
if (!_G(cur)->usingInventoryCursor()) {
action_ret = true;
hideCur();
if (!_G(gameState).R54LiftOk) {
if (_G(gameState).R54FputzerWeg) {
autoMove(8, P_CHEWY);
_G(gameState).R54HowardVorne = 0;
startAadWait(298);
_G(gameState)._personHide[P_CHEWY] = true;
_G(det)->showStaticSpr(12);
_G(gameState).R55Location = true;
_G(SetUpScreenFunc) = nullptr;
goAutoXy(91, 62, P_HOWARD, ANI_WAIT);
_G(det)->playSound(1, 0);
int16 ch_y = 68;
int16 ay = 0;
int16 delay = 0;
while (ch_y > -48) {
_G(det)->setStaticPos(12, 125, ch_y, false, false);
_G(det)->setStaticPos(9, 122, ay, false, false);
if (!delay) {
ch_y -= 3;
ay -= 3;
delay = _G(gameState).DelaySpeed / 2;
} else {
--delay;
}
setupScreen(DO_SETUP);
SHOULD_QUIT_RETURN0;
}
switchRoom(55);
}
} else {
startAadWait(314);
}
showCur();
}
return action_ret;
}
void Room54::aufzug_ab() {
setPersonPos(91, 62, P_HOWARD, P_RIGHT);
setPersonPos(99, 82, P_CHEWY, P_RIGHT);
_G(gameState).scrollx = 0;
_G(SetUpScreenFunc) = setup_func;
_G(det)->showStaticSpr(12);
_G(det)->playSound(1, 0);
int16 ch_y = -40;
int16 ay = -108;
int16 delay = 0;
while (ch_y < 68) {
_G(det)->setStaticPos(12, 125, ch_y, false, false);
_G(det)->setStaticPos(9, 122, ay, false, false);
if (!delay) {
ch_y += 3;
ay += 3;
delay = _G(gameState).DelaySpeed / 2;
} else {
--delay;
}
setupScreen(DO_SETUP);
SHOULD_QUIT_RETURN;
}
_G(det)->stopSound(0);
_G(det)->hideStaticSpr(12);
setPersonPos(99, 82, P_CHEWY, P_RIGHT);
_G(gameState)._personHide[P_CHEWY] = false;
_G(mouseLeftClick) = false;
stopPerson(P_CHEWY);
_G(gameState).R55Location = false;
}
short Room54::use_taxi() {
int16 action_ret = false;
if (!_G(cur)->usingInventoryCursor()) {
action_ret = true;
hideCur();
autoMove(7, P_CHEWY);
_G(gameState).R48TaxiPerson[P_CHEWY] = true;
if (_G(gameState)._personRoomNr[P_HOWARD] == 54) {
if (_G(gameState).R54HowardVorne) {
_G(gameState).R54HowardVorne = 0;
goAutoXy(290, 61, P_HOWARD, ANI_WAIT);
}
_G(gameState)._personHide[P_HOWARD] = true;
_G(gameState).R48TaxiPerson[P_HOWARD] = true;
_G(gameState)._personRoomNr[P_HOWARD] = 48;
}
_G(gameState)._personHide[P_CHEWY] = true;
switchRoom(48);
}
return action_ret;
}
} // namespace Rooms
} // namespace Chewy

View File

@@ -0,0 +1,46 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CHEWY_ROOMS_ROOM54_H
#define CHEWY_ROOMS_ROOM54_H
namespace Chewy {
namespace Rooms {
class Room54 {
private:
static void setup_func();
static void aufzug_ab();
public:
static void entry(int16 eib_nr);
static void xit(int16 eib_nr);
static int16 use_schalter();
static void talk_verkauf();
static int16 use_zelle();
static short use_taxi();
static int16 use_azug();
};
} // namespace Rooms
} // namespace Chewy
#endif

Some files were not shown because too many files have changed in this diff Show More