From 8bd5f104f664a20e759de024608c7a2880fda28e Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 17 Jan 2022 06:32:17 +0100 Subject: [PATCH] CHEWY: Implement room 94 --- engines/chewy/rooms/room66.cpp | 3 + engines/chewy/rooms/room66.h | 3 +- engines/chewy/rooms/room94.cpp | 121 ++++++++++++++++++++++++++++++++- engines/chewy/rooms/room94.h | 1 + engines/chewy/types.h | 3 + 5 files changed, 128 insertions(+), 3 deletions(-) diff --git a/engines/chewy/rooms/room66.cpp b/engines/chewy/rooms/room66.cpp index 73136af16ee..e0005ae2f1d 100644 --- a/engines/chewy/rooms/room66.cpp +++ b/engines/chewy/rooms/room66.cpp @@ -76,5 +76,8 @@ int Room66::proc7() { return 0; } +void Room66::proc8(int eax, int edx, int ebx, int ecx) { +} + } // namespace Rooms } // namespace Chewy diff --git a/engines/chewy/rooms/room66.h b/engines/chewy/rooms/room66.h index a55bb4c779c..13e26f91291 100644 --- a/engines/chewy/rooms/room66.h +++ b/engines/chewy/rooms/room66.h @@ -33,8 +33,9 @@ public: static void talk2(); static void talk3(); static void talk4(); - static int proc7(); static int proc2(); + static int proc7(); + static void proc8(int eax, int edx, int ebx, int ecx); }; } // namespace Rooms diff --git a/engines/chewy/rooms/room94.cpp b/engines/chewy/rooms/room94.cpp index 5dab751f284..6eac58a834c 100644 --- a/engines/chewy/rooms/room94.cpp +++ b/engines/chewy/rooms/room94.cpp @@ -22,17 +22,99 @@ #include "chewy/defines.h" #include "chewy/events.h" #include "chewy/global.h" -#include "chewy/ani_dat.h" #include "chewy/room.h" #include "chewy/rooms/room94.h" +#include "room66.h" + namespace Chewy { namespace Rooms { void Room94::entry() { + _G(spieler).flags33_80 = true; + _G(zoom_horizont) = 140; + flags.ZoomMov = true; + _G(zoom_mov_fak) = 2; + _G(spieler).ScrollxStep = 2; + SetUpScreenFunc = setup_func; + _G(spieler).ZoomXy[P_HOWARD][0] = 34; + _G(spieler).ZoomXy[P_HOWARD][1] = 48; + spieler_mi[P_HOWARD].Mode = true; + if (_G(spieler).flags35_10) { + room->set_timer_status(3, TIMER_STOP); + det->del_static_ani(3); + } + + if (flags.LoadGame) + return; + + if (_G(spieler).flags35_8) { + _G(zoom_horizont) = 140; + _G(spieler).flags35_8 = false; + _G(spieler).scrollx = 0; + set_person_pos(156, 149, P_CHEWY, P_RIGHT); + set_person_pos(153, 122, P_HOWARD, P_RIGHT); + out->setze_zeiger(nullptr); + out->cls(); + flic_cut(120, CFO_MODE); + test_intro(30); + ERROR + fx_blend = BLEND_NONE; + Room66::proc8(2, 3, 0, 539); + _G(spieler).r93_word18DB2C = _G(spieler).scrollx; + switch_room(93); + return; + } + + if (_G(spieler).flags35_40) { + set_person_pos(373, 122, P_CHEWY, P_LEFT); + set_person_pos(393, 94, P_HOWARD, P_LEFT); + _G(spieler).flags35_40 = false; + _G(spieler).scrollx = 150; + if (_G(spieler).flags37_40) { + _G(spieler).flags37_40 = true; + flags.NoScroll = true; + out->setze_zeiger(nullptr); + out->cls(); + flic_cut(121, CFO_MODE); + test_intro(32); + ERROR + + fx_blend = BLEND_NONE; + SetUpScreenFunc = nullptr; + Room66::proc8(2, 3, 0, 551); + SetUpScreenFunc = setup_func; + flags.NoScroll = false; + } + } else { + hide_cur(); + _G(spieler).scrollx = 120; + set_person_pos(255, 86, P_HOWARD, P_LEFT); + auto_move(3, P_CHEWY); + show_cur(); + } } void Room94::xit() { + _G(spieler).ScrollxStep = 1; + _G(spieler).PersonRoomNr[P_HOWARD] = 95; +} + +void Room94::setup_func() { + calc_person_look(); + int destX, destY = 122; + + if (spieler_vector[P_CHEWY].Xypos[0] >= 370) + destX = 399; + else + destX = 255; + + if (flags.ExitMov) { + destX = 255; + destY = 86; + } + + go_auto_xy(destX, destY, P_HOWARD, ANI_GO); } void Room94::gedAction(int index) { @@ -41,10 +123,45 @@ void Room94::gedAction(int index) { } void Room94::talk1() { + hide_cur(); + Room66::proc8(3, 3, 2, 552); + show_cur(); } int Room94::proc3() { - return 0; + if (is_cur_inventar(62)) + return 0; + + hide_cur(); + auto_move(2, P_CHEWY); + auto_scroll(216, 0); + del_inventar(_G(spieler).AkInvent); + out->setze_zeiger(nullptr); + out->cls(); + flags.NoPalAfterFlc = true; + flic_cut(62, CFO_MODE); + fx_blend = BLEND3; + det->start_detail(5, 255, false); + start_aad_wait(541, -1); + det->stop_detail(5); + det->show_static_spr(5); + Room66::proc8(3, 3, 2, 617); + hide_cur(); + det->hide_static_spr(5); + det->start_detail(5, 255, false); + start_aad_wait(622, -1); + det->stop_detail(5); + det->start_detail(6, 1, false); + room->set_timer_status(3, TIMER_STOP); + det->del_static_ani(3); + start_detail_wait(4, 1, ANI_VOR); + _G(spieler).flags35_10 = true; + _G(spieler).room_e_obj[138].Attribut = AUSGANG_OBEN; + atds->set_steuer_bit(522, ATS_AKTIV_BIT, ATS_DATEI); + new_invent_2_cur(114); + + show_cur(); + return 1; } } // namespace Rooms diff --git a/engines/chewy/rooms/room94.h b/engines/chewy/rooms/room94.h index de7f80eefbd..c819e54d6f6 100644 --- a/engines/chewy/rooms/room94.h +++ b/engines/chewy/rooms/room94.h @@ -30,6 +30,7 @@ public: static void entry(); static void xit(); static void gedAction(int index); + static void setup_func(); static void talk1(); static int proc3(); diff --git a/engines/chewy/types.h b/engines/chewy/types.h index 3315ba85309..dadda435dd1 100644 --- a/engines/chewy/types.h +++ b/engines/chewy/types.h @@ -499,6 +499,9 @@ struct Spieler : public SpielerFlags { uint8 FramesPerSecond = 0; bool DisplayText = false; + // ---- // + int r93_word18DB2C = 0; + // ---- // int r97_word18DB2E = 0; bool r97_bool18DB30 = false; bool r97_bool18DB32 = false;