M4: Boonsville event fixes, truck crash cutscene

This commit is contained in:
Paul Gilbert 2023-11-25 19:55:24 -10:00 committed by Eugene Sandulenko
parent 62798f2947
commit 4124a957a6
7 changed files with 50 additions and 24 deletions

View File

@ -107,8 +107,8 @@ bool Flags::dispatch_scheduled_boonsville_time_trigger(int32 time) {
bool result = false;
for (const BoonsvilleEvent *rec = EVENTS; rec->_time; ++rec) {
if ((int32)(*this)[kBoonsvillePriorTime] > rec->_time &&
rec->_time <= (int32)(*this)[kBoonsvilleTime]) {
if ((*this)[kBoonsvilleTime] >= rec->_time &&
(*this)[kBoonsvillePriorTime] < rec->_time) {
result = true;
term_message("Time for: %s", rec->_text);
schedule_boonsville_time();
@ -121,7 +121,32 @@ bool Flags::dispatch_scheduled_boonsville_time_trigger(int32 time) {
}
void Flags::schedule_boonsville_time() {
error("TODO: Flags::schedule_boonsville_time()");
int theTime = get_boonsville_time_and_display();
int hours = theTime / 216000;
int minutes = (theTime % 216000) / 3600;
int seconds = (theTime % 3600) / 60;
bool flag = false;
term_message("************ Schedule ************");
for (const auto& te : EVENTS) {
int teHours = te._time / 216000;
int teMinutes = (te._time % 216000) / 3600;
int teSeconds = (te._time % 3600) / 60;
if (te._time <= theTime) {
term_message("done %1d:%2d:%2d %s", teHours, teMinutes, teSeconds, te._text);
} else {
if (!flag) {
term_message("------> %1d:%2d:%2d Current time", hours, minutes, seconds);
flag = true;
}
term_message("pending %1d:%2d:%2d %s", teHours, teMinutes, teSeconds, te._text);
}
}
term_message("************************************");
}
void Flags::reset1() {

View File

@ -19,7 +19,7 @@
*
*/
#include "m4/burger/rooms/section1/room135.h"
#include "m4/burger/rooms/section1/room134_135.h"
#include "m4/burger/rooms/section1/section1.h"
#include "m4/burger/vars.h"
@ -87,7 +87,7 @@ static const seriesPlayBreak PLAY3[] = {
PLAY_BREAK_END
};
void Room135::init() {
void Room134_135::init() {
_volume = 255;
_val2 = 0;
_odieLoaded = false;
@ -159,7 +159,7 @@ void Room135::init() {
}
}
void Room135::daemon() {
void Room134_135::daemon() {
int frame;
switch (_G(kernel).trigger) {
@ -785,7 +785,7 @@ void Room135::daemon() {
}
}
void Room135::pre_parser() {
void Room134_135::pre_parser() {
if (player_said("fork in the road") && player_said_any("enter", "gear", "look", "look at"))
player_hotspot_walk_override_just_face(9);
@ -796,7 +796,7 @@ void Room135::pre_parser() {
player_hotspot_walk_override(308, 249, 10, -1);
}
void Room135::parser() {
void Room134_135::parser() {
bool lookFlag = player_said_any("look", "look at");
_G(kernel).trigger_mode = KT_DAEMON;
@ -851,7 +851,7 @@ void Room135::parser() {
_G(player).command_ready = false;
}
void Room135::conv01() {
void Room134_135::conv01() {
_G(kernel).trigger_mode = KT_PARSE;
int who = conv_whos_talking();
int node = conv_current_node();
@ -934,7 +934,7 @@ void Room135::conv01() {
}
}
void Room135::conv02() {
void Room134_135::conv02() {
_G(kernel).trigger_mode = KT_PARSE;
int who = conv_whos_talking();
@ -953,7 +953,7 @@ void Room135::conv02() {
}
}
void Room135::conv03() {
void Room134_135::conv03() {
_G(kernel).trigger_mode = KT_PARSE;
if (_G(kernel).trigger == 35) {
@ -998,7 +998,7 @@ void Room135::conv03() {
}
}
void Room135::loadOdie() {
void Room134_135::loadOdie() {
static const char *NAMES[30] = {
"135od05", "135od05s", "135od06", "135od06s", "135od04",
"135od04s", "135od08", "135od08s", "135od09", "135od09s",
@ -1016,7 +1016,7 @@ void Room135::loadOdie() {
}
}
void Room135::loadDigi() {
void Room134_135::loadDigi() {
if (_name1) {
_G(kernel).trigger_mode = KT_PARSE;
digi_play(_name1, 1, 255, 35);

View File

@ -19,8 +19,8 @@
*
*/
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM135_H
#define M4_BURGER_ROOMS_SECTION1_ROOM135_H
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM134_135_H
#define M4_BURGER_ROOMS_SECTION1_ROOM134_135_H
#include "m4/burger/rooms/room.h"
@ -28,7 +28,7 @@ namespace M4 {
namespace Burger {
namespace Rooms {
class Room135 : public Room {
class Room134_135 : public Room {
private:
int _volume = 0;
int _val2 = 0;
@ -63,8 +63,8 @@ private:
void loadDigi();
public:
Room135() : Room() {}
~Room135() override {}
Room134_135() : Room() {}
~Room134_135() override {}
void init() override;
void daemon() override;

View File

@ -38,7 +38,8 @@ Section1::Section1() : Rooms::Section() {
add(106, &_room106);
add(120, &_room120);
add(133, &_room133_136);
add(135, &_room135);
add(134, &_room134_135);
add(135, &_room134_135);
add(136, &_room133_136);
add(137, &_room137);
add(138, &_room138);
@ -199,7 +200,7 @@ void Section1::daemon() {
_series2 = series_load("110bu02", -1, _G(master_palette));
_state1 = 2;
kernel_trigger_dispatch_now(1033);
digi_play("110bu03", 1, 255, 1034);
digi_play("100b003", 1, 255, 1034);
break;
case 1033:
if (_state1 == 2) {

View File

@ -32,7 +32,7 @@
#include "m4/burger/rooms/section1/room106.h"
#include "m4/burger/rooms/section1/room120.h"
#include "m4/burger/rooms/section1/room133_136.h"
#include "m4/burger/rooms/section1/room135.h"
#include "m4/burger/rooms/section1/room134_135.h"
#include "m4/burger/rooms/section1/room137.h"
#include "m4/burger/rooms/section1/room138.h"
#include "m4/burger/rooms/section1/room139_144.h"
@ -67,7 +67,7 @@ private:
Room106 _room106;
Room120 _room120;
Room133_136 _room133_136;
Room135 _room135;
Room134_135 _room134_135;
Room137 _room137;
Room138 _room138;
Room139_144 _room139_144;

View File

@ -66,7 +66,7 @@ void Term::message(const char *fmt, ...) {
void Term::vmessage(const char *fmt, va_list va) {
if (_mode != MEMORY_MODE) {
Common::String msg = Common::String::vformat(fmt, va);
debug("%s\n", msg.c_str());
debug("%s", msg.c_str());
if (_file) {
_file->writeString(msg);

View File

@ -97,7 +97,7 @@ MODULE_OBJS = \
burger/rooms/section1/room106.o \
burger/rooms/section1/room120.o \
burger/rooms/section1/room133_136.o \
burger/rooms/section1/room135.o \
burger/rooms/section1/room134_135.o \
burger/rooms/section1/room137.o \
burger/rooms/section1/room138.o \
burger/rooms/section1/room139_144.o \