1
0
Fork 0
mirror of https://github.com/k4zmu2a/SpaceCadetPinball.git synced 2024-12-18 10:37:53 +01:00

Message code enum part 5: control codes.

This commit is contained in:
Muzychenko Andrey 2022-09-07 16:01:38 +03:00
parent dfe1665ba1
commit 22603aa126
29 changed files with 489 additions and 476 deletions

View file

@ -66,5 +66,5 @@ void TBlocker::TimerExpired(int timerId, void* caller)
{ {
auto blocker = static_cast<TBlocker*>(caller); auto blocker = static_cast<TBlocker*>(caller);
blocker->Timer = 0; blocker->Timer = 0;
control::handler(60, blocker); control::handler(MessageCode::ControlTimerExpired, blocker);
} }

View file

@ -41,7 +41,7 @@ int TBumper::Message(MessageCode code, float value)
loader::play_sound(SoundIndex3, this, "TBumper2"); loader::play_sound(SoundIndex3, this, "TBumper2");
BmpIndex = nextBmp; BmpIndex = nextBmp;
Fire(); Fire();
control::handler(11, this); control::handler(MessageCode::TBumperSetBmpIndex, this);
} }
break; break;
} }
@ -103,7 +103,7 @@ void TBumper::Collision(TBall* ball, vector2* nextPosition, vector2* direction,
if (DefaultCollision(ball, nextPosition, direction)) if (DefaultCollision(ball, nextPosition, direction))
{ {
Fire(); Fire();
control::handler(63, this); control::handler(MessageCode::ControlCollision, this);
} }
} }

View file

@ -60,5 +60,5 @@ void TComponentGroup::NotifyTimerExpired(int timerId, void* caller)
{ {
auto compGroup = static_cast<TComponentGroup*>(caller); auto compGroup = static_cast<TComponentGroup*>(caller);
compGroup->Timer = 0; compGroup->Timer = 0;
control::handler(61, compGroup); control::handler(MessageCode::ControlNotifyTimerExpired, compGroup);
} }

View file

@ -38,11 +38,11 @@ void TDrain::Collision(TBall* ball, vector2* nextPosition, vector2* direction, f
PinballTable->BallInDrainFlag = 1; PinballTable->BallInDrainFlag = 1;
Timer = timer::set(TimerTime, this, TimerCallback); Timer = timer::set(TimerTime, this, TimerCallback);
} }
control::handler(63, this); control::handler(MessageCode::ControlCollision, this);
} }
void TDrain::TimerCallback(int timerId, void* caller) void TDrain::TimerCallback(int timerId, void* caller)
{ {
auto drain = static_cast<TDrain*>(caller); auto drain = static_cast<TDrain*>(caller);
control::handler(60, drain); control::handler(MessageCode::ControlTimerExpired, drain);
} }

View file

@ -104,11 +104,11 @@ void TFlagSpinner::NextFrame()
if (!PinballTable->TiltLockFlag) if (!PinballTable->TiltLockFlag)
{ {
control::handler(63, this); control::handler(MessageCode::ControlCollision, this);
if (SoftHitSoundId) if (SoftHitSoundId)
loader::play_sound(SoftHitSoundId, this, "TFlagSpinner"); loader::play_sound(SoftHitSoundId, this, "TFlagSpinner");
if (!BmpIndex) if (!BmpIndex)
control::handler(62, this); control::handler(MessageCode::ControlSpinnerLoopReset, this);
} }
auto bmp = ListBitmap->at(BmpIndex); auto bmp = ListBitmap->at(BmpIndex);

View file

@ -70,7 +70,7 @@ int TFlipper::Message(MessageCode code, float value)
case MessageCode::GameOver: case MessageCode::GameOver:
if (code == MessageCode::TFlipperExtend) if (code == MessageCode::TFlipperExtend)
{ {
control::handler(1, this); control::handler(MessageCode::TFlipperExtend, this);
loader::play_sound(HardHitSoundId, this, "TFlipper1"); loader::play_sound(HardHitSoundId, this, "TFlipper1");
} }
else if (code == MessageCode::TFlipperRetract) else if (code == MessageCode::TFlipperRetract)

View file

@ -15,7 +15,7 @@ TGate::TGate(TPinballTable* table, int groupIndex) : TCollisionComponent(table,
SoundIndex3 = visual.SoundIndex3; SoundIndex3 = visual.SoundIndex3;
ActiveFlag = 1; ActiveFlag = 1;
render::sprite_set_bitmap(RenderSprite, ListBitmap->at(0)); render::sprite_set_bitmap(RenderSprite, ListBitmap->at(0));
control::handler(1024, this); control::handler(MessageCode::Reset, this);
} }
int TGate::Message(MessageCode code, float value) int TGate::Message(MessageCode code, float value)
@ -37,6 +37,6 @@ int TGate::Message(MessageCode code, float value)
default: break; default: break;
} }
control::handler(~code, this); control::handler(code, this);
return 0; return 0;
} }

View file

@ -88,7 +88,7 @@ void THole::Collision(TBall* ball, vector2* nextPosition, vector2* direction, fl
if (!PinballTable->TiltLockFlag) if (!PinballTable->TiltLockFlag)
{ {
loader::play_sound(HardHitSoundId, ball, "THole1"); loader::play_sound(HardHitSoundId, ball, "THole1");
control::handler(57, this); control::handler(MessageCode::ControlBallCaptured, this);
} }
} }
} }
@ -116,7 +116,7 @@ int THole::FieldEffect(TBall* ball, vector2* vecDst)
ball->Direction.X = 0.0; ball->Direction.X = 0.0;
ball->Speed = 0.0; ball->Speed = 0.0;
loader::play_sound(SoftHitSoundId, ball, "THole2"); loader::play_sound(SoftHitSoundId, ball, "THole2");
control::handler(58, this); control::handler(MessageCode::ControlBallReleased, this);
} }
} }
result = 0; result = 0;

View file

@ -89,6 +89,6 @@ void TKickback::TimerExpired(int timerId, void* caller)
bmp->YPosition - kick->PinballTable->YOffset); bmp->YPosition - kick->PinballTable->YOffset);
} }
kick->Timer = 0; kick->Timer = 0;
control::handler(60, kick); control::handler(MessageCode::ControlTimerExpired, kick);
} }
} }

View file

@ -112,7 +112,7 @@ void TKickout::Collision(TBall* ball, vector2* nextPosition, vector2* direction,
else else
{ {
loader::play_sound(SoftHitSoundId, ball, "TKickout1"); loader::play_sound(SoftHitSoundId, ball, "TKickout1");
control::handler(63, this); control::handler(MessageCode::ControlCollision, this);
} }
} }
} }

View file

@ -301,7 +301,7 @@ void TLight::TimerExpired(int timerId, void* caller)
light->Message(MessageCode::TLightResetAndTurnOff, 0.0); light->Message(MessageCode::TLightResetAndTurnOff, 0.0);
} }
if (light->Control) if (light->Control)
control::handler(60, light); control::handler(MessageCode::ControlTimerExpired, light);
} }

View file

@ -120,11 +120,11 @@ void TLightBargraph::BargraphTimerExpired(int timerId, void* caller)
if (bar->TimeIndex) if (bar->TimeIndex)
{ {
bar->Message(MessageCode::TLightGroupToggleSplitIndex, static_cast<float>(bar->TimeIndex - 1)); bar->Message(MessageCode::TLightGroupToggleSplitIndex, static_cast<float>(bar->TimeIndex - 1));
control::handler(60, bar); control::handler(MessageCode::ControlTimerExpired, bar);
} }
else else
{ {
bar->Message(MessageCode::TLightResetAndTurnOff, 0.0); bar->Message(MessageCode::TLightResetAndTurnOff, 0.0);
control::handler(47, bar); control::handler(MessageCode::TLightGroupCountdownEnded, bar);
} }
} }

View file

@ -351,7 +351,7 @@ int TLightGroup::Message(MessageCode code, float value)
} }
case MessageCode::TLightGroupToggleSplitIndex: case MessageCode::TLightGroupToggleSplitIndex:
{ {
control::handler(~code, this); control::handler(code, this);
auto index = static_cast<int>(floor(value)); auto index = static_cast<int>(floor(value));
if (index >= 0 && index < count) if (index >= 0 && index < count)
{ {
@ -460,5 +460,5 @@ void TLightGroup::NotifyTimerExpired(int timerId, void* caller)
{ {
auto group = static_cast<TLightGroup*>(caller); auto group = static_cast<TLightGroup*>(caller);
group->NotifyTimer = 0; group->NotifyTimer = 0;
control::handler(61, group); control::handler(MessageCode::ControlNotifyTimerExpired, group);
} }

View file

@ -54,7 +54,7 @@ void TLightRollover::Collision(TBall* ball, vector2* nextPosition, vector2* dire
else else
{ {
loader::play_sound(SoftHitSoundId, this, "TLightRollover"); loader::play_sound(SoftHitSoundId, this, "TLightRollover");
control::handler(63, this); control::handler(MessageCode::ControlCollision, this);
RolloverFlag = RolloverFlag == 0; RolloverFlag = RolloverFlag == 0;
if (ListBitmap) if (ListBitmap)
render::sprite_set_bitmap(RenderSprite, ListBitmap->at(0)); render::sprite_set_bitmap(RenderSprite, ListBitmap->at(0));

View file

@ -52,7 +52,7 @@ void TOneway::Collision(TBall* ball, vector2* nextPosition, vector2* direction,
{ {
if (HardHitSoundId) if (HardHitSoundId)
loader::play_sound(HardHitSoundId, ball, "TOneway1"); loader::play_sound(HardHitSoundId, ball, "TOneway1");
control::handler(63, this); control::handler(MessageCode::ControlCollision, this);
} }
} }
else if (PinballTable->TiltLockFlag) else if (PinballTable->TiltLockFlag)

View file

@ -65,10 +65,7 @@ enum class MessageCode
TLightGroupFlashWhenOn = 44, TLightGroupFlashWhenOn = 44,
TLightGroupToggleSplitIndex = 45, TLightGroupToggleSplitIndex = 45,
TLightGroupStartFlasher = 46, TLightGroupStartFlasher = 46,
TLightGroupCountdownEnded = 47,
TBlockerDisable = 51,
TBlockerEnable = 52,
TBlockerRestartTimeout = 59,
TBumperSetBmpIndex = 11, TBumperSetBmpIndex = 11,
TBumperIncBmpIndex = 12, TBumperIncBmpIndex = 12,
@ -76,14 +73,18 @@ enum class MessageCode
TComponentGroupResetNotifyTimer = 48, TComponentGroupResetNotifyTimer = 48,
TPopupTargetDisable = 49,
TPopupTargetEnable = 50,
TBlockerDisable = 51,
TBlockerEnable = 52,
TBlockerRestartTimeout = 59,
TGateDisable = 53, TGateDisable = 53,
TGateEnable = 54, TGateEnable = 54,
TKickoutRestartTimer = 55, TKickoutRestartTimer = 55,
TPopupTargetDisable = 49,
TPopupTargetEnable = 50,
TSinkUnknown7 = 7, TSinkUnknown7 = 7,
TSinkResetTimer = 56, TSinkResetTimer = 56,
@ -92,6 +93,17 @@ enum class MessageCode
TTimerResetTimer = 59, TTimerResetTimer = 59,
ControlBallCaptured = 57,
ControlBallReleased = 58,
ControlTimerExpired = 60,
ControlNotifyTimerExpired = 61,
ControlSpinnerLoopReset = 62,
ControlCollision = 63,
ControlEnableMultiplier = 64,
ControlDisableMultiplier = 65,
ControlMissionComplete = 66,
ControlMissionStarted = 67,
// Public codes 1000+, apply to all components // Public codes 1000+, apply to all components
LeftFlipperInputPressed = 1000, LeftFlipperInputPressed = 1000,
LeftFlipperInputReleased = 1001, LeftFlipperInputReleased = 1001,

View file

@ -301,7 +301,7 @@ void TPinballTable::tilt(float time)
} }
LightGroup->Message(MessageCode::TLightTurnOffTimed, 0); LightGroup->Message(MessageCode::TLightTurnOffTimed, 0);
TiltLockFlag = 1; TiltLockFlag = 1;
control::table_control_handler(1011); control::table_control_handler(MessageCode::SetTiltLock);
} }
} }
@ -589,7 +589,7 @@ int TPinballTable::Message(MessageCode code, float value)
default: break; default: break;
} }
control::table_control_handler(~code); control::table_control_handler(code);
return 0; return 0;
} }
@ -662,7 +662,7 @@ void TPinballTable::EndGame_timeout(int timerId, void* caller)
} }
if (table->Demo) if (table->Demo)
table->Demo->Message(MessageCode::GameOver, 0.0); table->Demo->Message(MessageCode::GameOver, 0.0);
control::handler(67, pb::MissTextBox); control::handler(MessageCode::ControlMissionStarted, pb::MissTextBox);
pb::InfoTextBox->Display(pb::get_rc_string(Msg::STRING125), -1.0); pb::InfoTextBox->Display(pb::get_rc_string(Msg::STRING125), -1.0);
} }

View file

@ -168,7 +168,7 @@ int TPlunger::Message(MessageCode code, float value)
break; break;
} }
control::handler(~code, this); control::handler(code, this);
return 0; return 0;
} }

View file

@ -70,7 +70,7 @@ void TPopupTarget::Collision(TBall* ball, vector2* nextPosition, vector2* direct
if (HardHitSoundId) if (HardHitSoundId)
loader::play_sound(HardHitSoundId, this, "TPopupTarget1"); loader::play_sound(HardHitSoundId, this, "TPopupTarget1");
Message(MessageCode::TPopupTargetDisable, 0.0); Message(MessageCode::TPopupTargetDisable, 0.0);
control::handler(63, this); control::handler(MessageCode::ControlCollision, this);
} }
} }

View file

@ -154,7 +154,7 @@ void TRamp::Collision(TBall* ball, vector2* nextPosition, vector2* direction, fl
if (!PinballTable->TiltLockFlag) if (!PinballTable->TiltLockFlag)
{ {
loader::play_sound(SoftHitSoundId, ball, "TRamp"); loader::play_sound(SoftHitSoundId, ball, "TRamp");
control::handler(63, this); control::handler(MessageCode::ControlCollision, this);
} }
} }
else else

View file

@ -55,7 +55,7 @@ void TRollover::Collision(TBall* ball, vector2* nextPosition, vector2* direction
else else
{ {
loader::play_sound(SoftHitSoundId, ball, "TRollover"); loader::play_sound(SoftHitSoundId, ball, "TRollover");
control::handler(63, this); control::handler(MessageCode::ControlCollision, this);
} }
RolloverFlag = RolloverFlag == 0; RolloverFlag = RolloverFlag == 0;
if (ListBitmap) if (ListBitmap)

View file

@ -65,7 +65,7 @@ void TSink::Collision(TBall* ball, vector2* nextPosition, vector2* direction, fl
{ {
ball->Disable(); ball->Disable();
loader::play_sound(SoundIndex4, ball, "TSink1"); loader::play_sound(SoundIndex4, ball, "TSink1");
control::handler(63, this); control::handler(MessageCode::ControlCollision, this);
} }
} }

View file

@ -60,7 +60,7 @@ void TSoloTarget::Collision(TBall* ball, vector2* nextPosition, vector2* directi
{ {
Message(MessageCode::TSoloTargetDisable, 0.0); Message(MessageCode::TSoloTargetDisable, 0.0);
Timer = timer::set(TimerTime, this, TimerExpired); Timer = timer::set(TimerTime, this, TimerExpired);
control::handler(63, this); control::handler(MessageCode::ControlCollision, this);
} }
} }

View file

@ -67,7 +67,7 @@ void TTextBox::TimerExpired(int timerId, void* caller)
delete message; delete message;
tb->CurrentMessage = nextMessage; tb->CurrentMessage = nextMessage;
tb->Draw(); tb->Draw();
control::handler(60, tb); control::handler(MessageCode::ControlTimerExpired, tb);
} }
} }

View file

@ -37,5 +37,5 @@ void TTimer::TimerExpired(int timerId, void* caller)
{ {
auto timer = static_cast<TTimer*>(caller); auto timer = static_cast<TTimer*>(caller);
timer->Timer = 0; timer->Timer = 0;
control::handler(60, timer); control::handler(MessageCode::ControlTimerExpired, timer);
} }

View file

@ -20,6 +20,6 @@ void TTripwire::Collision(TBall* ball, vector2* nextPosition, vector2* direction
if (!PinballTable->TiltLockFlag) if (!PinballTable->TiltLockFlag)
{ {
loader::play_sound(SoftHitSoundId, ball, "TTripwire"); loader::play_sound(SoftHitSoundId, ball, "TTripwire");
control::handler(63, this); control::handler(MessageCode::ControlCollision, this);
} }
} }

View file

@ -33,7 +33,7 @@ void TWall::Collision(TBall* ball, vector2* nextPosition, vector2* direction, fl
render::sprite_set_bitmap(RenderSprite, BmpPtr); render::sprite_set_bitmap(RenderSprite, BmpPtr);
Timer = timer::set(0.1f, this, TimerExpired); Timer = timer::set(0.1f, this, TimerExpired);
} }
control::handler(63, this); control::handler(MessageCode::ControlCollision, this);
} }
} }

View file

@ -888,7 +888,7 @@ TPinballComponent* control::make_component_link(component_tag_base& tag)
return nullptr; return nullptr;
} }
void control::handler(int code, TPinballComponent* cmp) void control::handler(MessageCode code, TPinballComponent* cmp)
{ {
component_control* control = cmp->Control; component_control* control = cmp->Control;
@ -927,7 +927,7 @@ void control::pbctrl_bdoor_controller(char key)
} }
else if (strcmp(bufferEnd - 4, "gmax") == 0) else if (strcmp(bufferEnd - 4, "gmax") == 0)
{ {
GravityWellKickoutControl(64, nullptr); GravityWellKickoutControl(MessageCode::ControlEnableMultiplier, nullptr);
} }
else if (strcmp(bufferEnd - 4, "1max") == 0) else if (strcmp(bufferEnd - 4, "1max") == 0)
{ {
@ -1133,9 +1133,9 @@ void control::AdvanceWormHoleDestination(int flag)
} }
} }
void control::FlipperRebounderControl1(int code, TPinballComponent* caller) void control::FlipperRebounderControl1(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
lite84->Message(MessageCode::TLightTurnOnTimed, 0.1f); lite84->Message(MessageCode::TLightTurnOnTimed, 0.1f);
auto score = caller->get_scoring(0); auto score = caller->get_scoring(0);
@ -1143,9 +1143,9 @@ void control::FlipperRebounderControl1(int code, TPinballComponent* caller)
} }
} }
void control::FlipperRebounderControl2(int code, TPinballComponent* caller) void control::FlipperRebounderControl2(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
lite85->Message(MessageCode::TLightTurnOnTimed, 0.1f); lite85->Message(MessageCode::TLightTurnOnTimed, 0.1f);
int score = caller->get_scoring(0); int score = caller->get_scoring(0);
@ -1153,66 +1153,66 @@ void control::FlipperRebounderControl2(int code, TPinballComponent* caller)
} }
} }
void control::RebounderControl(int code, TPinballComponent* caller) void control::RebounderControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
TableG->AddScore(caller->get_scoring(0)); TableG->AddScore(caller->get_scoring(0));
} }
} }
void control::BumperControl(int code, TPinballComponent* caller) void control::BumperControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
TableG->AddScore(caller->get_scoring(static_cast<TBumper*>(caller)->BmpIndex)); TableG->AddScore(caller->get_scoring(static_cast<TBumper*>(caller)->BmpIndex));
} }
} }
void control::LeftKickerControl(int code, TPinballComponent* caller) void control::LeftKickerControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 60) if (code == MessageCode::ControlTimerExpired)
gate1->Message(MessageCode::TGateEnable, 0.0); gate1->Message(MessageCode::TGateEnable, 0.0);
} }
void control::RightKickerControl(int code, TPinballComponent* caller) void control::RightKickerControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 60) if (code == MessageCode::ControlTimerExpired)
gate2->Message(MessageCode::TGateEnable, 0.0); gate2->Message(MessageCode::TGateEnable, 0.0);
} }
void control::LeftKickerGateControl(int code, TPinballComponent* caller) void control::LeftKickerGateControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == ~MessageCode::TGateDisable) if (code == MessageCode::TGateDisable)
{ {
lite30->Message(MessageCode::TLightFlasherStartTimedThenStayOn, 5.0); lite30->Message(MessageCode::TLightFlasherStartTimedThenStayOn, 5.0);
lite196->Message(MessageCode::TLightFlasherStartTimed, 5.0); lite196->Message(MessageCode::TLightFlasherStartTimed, 5.0);
} }
else if (code == ~MessageCode::TGateEnable) else if (code == MessageCode::TGateEnable)
{ {
lite30->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite30->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite196->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite196->Message(MessageCode::TLightResetAndTurnOff, 0.0);
} }
} }
void control::RightKickerGateControl(int code, TPinballComponent* caller) void control::RightKickerGateControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == ~MessageCode::TGateDisable) if (code == MessageCode::TGateDisable)
{ {
lite29->Message(MessageCode::TLightFlasherStartTimedThenStayOn, 5.0); lite29->Message(MessageCode::TLightFlasherStartTimedThenStayOn, 5.0);
lite195->Message(MessageCode::TLightFlasherStartTimed, 5.0); lite195->Message(MessageCode::TLightFlasherStartTimed, 5.0);
} }
else if (code == ~MessageCode::TGateEnable) else if (code == MessageCode::TGateEnable)
{ {
lite29->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite29->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite195->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite195->Message(MessageCode::TLightResetAndTurnOff, 0.0);
} }
} }
void control::DeploymentChuteToEscapeChuteOneWayControl(int code, TPinballComponent* caller) void control::DeploymentChuteToEscapeChuteOneWayControl(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
int count = skill_shot_lights->Message(MessageCode::TLightGroupGetOnCount, 0.0); int count = skill_shot_lights->Message(MessageCode::TLightGroupGetOnCount, 0.0);
if (count) if (count)
@ -1233,19 +1233,19 @@ void control::DeploymentChuteToEscapeChuteOneWayControl(int code, TPinballCompon
} }
} }
void control::DeploymentChuteToTableOneWayControl(int code, TPinballComponent* caller) void control::DeploymentChuteToTableOneWayControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
skill_shot_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0); skill_shot_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0);
} }
void control::DrainBallBlockerControl(int code, TPinballComponent* caller) void control::DrainBallBlockerControl(MessageCode code, TPinballComponent* caller)
{ {
MessageCode lightMessage; MessageCode lightMessage;
float blockerDuration; float blockerDuration;
auto block = static_cast<TBlocker*>(caller); auto block = static_cast<TBlocker*>(caller);
if (code == 52) if (code == MessageCode::TBlockerEnable)
{ {
block->MessageField = 1; block->MessageField = 1;
blockerDuration = static_cast<float>(block->InitialDuration); blockerDuration = static_cast<float>(block->InitialDuration);
@ -1254,7 +1254,7 @@ void control::DrainBallBlockerControl(int code, TPinballComponent* caller)
} }
else else
{ {
if (code != 60) if (code != MessageCode::ControlTimerExpired)
return; return;
if (block->MessageField != 1) if (block->MessageField != 1)
{ {
@ -1270,12 +1270,12 @@ void control::DrainBallBlockerControl(int code, TPinballComponent* caller)
lite1->Message(lightMessage, blockerDuration); lite1->Message(lightMessage, blockerDuration);
} }
void control::LaunchRampControl(int code, TPinballComponent* caller) void control::LaunchRampControl(MessageCode code, TPinballComponent* caller)
{ {
TSound* sound; TSound* sound;
char Buffer[64]; char Buffer[64];
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
int someFlag = 0; int someFlag = 0;
if (light_on(&control_lite54_tag)) if (light_on(&control_lite54_tag))
@ -1313,24 +1313,24 @@ void control::LaunchRampControl(int code, TPinballComponent* caller)
} }
} }
void control::LaunchRampHoleControl(int code, TPinballComponent* caller) void control::LaunchRampHoleControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 58) if (code == MessageCode::ControlBallReleased)
lite54->Message(MessageCode::TLightFlasherStartTimed, 5.0); lite54->Message(MessageCode::TLightFlasherStartTimed, 5.0);
} }
void control::SpaceWarpRolloverControl(int code, TPinballComponent* caller) void control::SpaceWarpRolloverControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
lite27->Message(MessageCode::TLightResetAndTurnOn, 0.0); lite27->Message(MessageCode::TLightResetAndTurnOn, 0.0);
lite28->Message(MessageCode::TLightResetAndTurnOn, 0.0); lite28->Message(MessageCode::TLightResetAndTurnOn, 0.0);
} }
} }
void control::ReentryLanesRolloverControl(int code, TPinballComponent* caller) void control::ReentryLanesRolloverControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (!light_on(&control_lite56_tag) && l_trek_lights->Message(MessageCode::TLightGroupGetMessage2, 0.0)) if (!light_on(&control_lite56_tag) && l_trek_lights->Message(MessageCode::TLightGroupGetMessage2, 0.0))
{ {
@ -1378,20 +1378,20 @@ void control::ReentryLanesRolloverControl(int code, TPinballComponent* caller)
} }
} }
void control::BumperGroupControl(int code, TPinballComponent* caller) void control::BumperGroupControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 61) if (code == MessageCode::ControlNotifyTimerExpired)
{ {
caller->Message(MessageCode::TComponentGroupResetNotifyTimer, 60.0); caller->Message(MessageCode::TComponentGroupResetNotifyTimer, 60.0);
caller->Message(MessageCode::TBumperDecBmpIndex, 0.0); caller->Message(MessageCode::TBumperDecBmpIndex, 0.0);
} }
} }
void control::LaunchLanesRolloverControl(int code, TPinballComponent* caller) void control::LaunchLanesRolloverControl(MessageCode code, TPinballComponent* caller)
{ {
TLight* light; TLight* light;
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (roll112 == caller) if (roll112 == caller)
{ {
@ -1430,9 +1430,9 @@ void control::LaunchLanesRolloverControl(int code, TPinballComponent* caller)
} }
} }
void control::OutLaneRolloverControl(int code, TPinballComponent* caller) void control::OutLaneRolloverControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (light_on(&control_lite17_tag) || light_on(&control_lite18_tag)) if (light_on(&control_lite17_tag) || light_on(&control_lite18_tag))
{ {
@ -1461,15 +1461,15 @@ void control::OutLaneRolloverControl(int code, TPinballComponent* caller)
} }
} }
void control::ExtraBallLightControl(int code, TPinballComponent* caller) void control::ExtraBallLightControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 19) if (code == MessageCode::TLightResetAndTurnOn)
{ {
lite17->Message(MessageCode::TLightTurnOnTimed, 55.0); lite17->Message(MessageCode::TLightTurnOnTimed, 55.0);
lite18->Message(MessageCode::TLightTurnOnTimed, 55.0); lite18->Message(MessageCode::TLightTurnOnTimed, 55.0);
extraball_light_flag = 1; extraball_light_flag = 1;
} }
else if (code == 60) else if (code == MessageCode::ControlTimerExpired)
{ {
if (extraball_light_flag) if (extraball_light_flag)
{ {
@ -1480,9 +1480,9 @@ void control::ExtraBallLightControl(int code, TPinballComponent* caller)
} }
} }
void control::ReturnLaneRolloverControl(int code, TPinballComponent* caller) void control::ReturnLaneRolloverControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (roll6 == caller) if (roll6 == caller)
{ {
@ -1509,11 +1509,11 @@ void control::ReturnLaneRolloverControl(int code, TPinballComponent* caller)
} }
} }
void control::BonusLaneRolloverControl(int code, TPinballComponent* caller) void control::BonusLaneRolloverControl(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (light_on(&control_lite16_tag)) if (light_on(&control_lite16_tag))
{ {
@ -1533,9 +1533,9 @@ void control::BonusLaneRolloverControl(int code, TPinballComponent* caller)
} }
} }
void control::FuelRollover1Control(int code, TPinballComponent* caller) void control::FuelRollover1Control(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (fuel_bargraph->Message(MessageCode::TLightGroupGetOnCount, 0.0) > 1) if (fuel_bargraph->Message(MessageCode::TLightGroupGetOnCount, 0.0) > 1)
{ {
@ -1550,9 +1550,9 @@ void control::FuelRollover1Control(int code, TPinballComponent* caller)
} }
} }
void control::FuelRollover2Control(int code, TPinballComponent* caller) void control::FuelRollover2Control(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (fuel_bargraph->Message(MessageCode::TLightGroupGetOnCount, 0.0) > 3) if (fuel_bargraph->Message(MessageCode::TLightGroupGetOnCount, 0.0) > 3)
{ {
@ -1567,9 +1567,9 @@ void control::FuelRollover2Control(int code, TPinballComponent* caller)
} }
} }
void control::FuelRollover3Control(int code, TPinballComponent* caller) void control::FuelRollover3Control(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (fuel_bargraph->Message(MessageCode::TLightGroupGetOnCount, 0.0) > 5) if (fuel_bargraph->Message(MessageCode::TLightGroupGetOnCount, 0.0) > 5)
{ {
@ -1584,9 +1584,9 @@ void control::FuelRollover3Control(int code, TPinballComponent* caller)
} }
} }
void control::FuelRollover4Control(int code, TPinballComponent* caller) void control::FuelRollover4Control(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (fuel_bargraph->Message(MessageCode::TLightGroupGetOnCount, 0.0) > 7) if (fuel_bargraph->Message(MessageCode::TLightGroupGetOnCount, 0.0) > 7)
{ {
@ -1601,9 +1601,9 @@ void control::FuelRollover4Control(int code, TPinballComponent* caller)
} }
} }
void control::FuelRollover5Control(int code, TPinballComponent* caller) void control::FuelRollover5Control(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (fuel_bargraph->Message(MessageCode::TLightGroupGetOnCount, 0.0) > 9) if (fuel_bargraph->Message(MessageCode::TLightGroupGetOnCount, 0.0) > 9)
{ {
@ -1618,9 +1618,9 @@ void control::FuelRollover5Control(int code, TPinballComponent* caller)
} }
} }
void control::FuelRollover6Control(int code, TPinballComponent* caller) void control::FuelRollover6Control(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (fuel_bargraph->Message(MessageCode::TLightGroupGetOnCount, 0.0) > 11) if (fuel_bargraph->Message(MessageCode::TLightGroupGetOnCount, 0.0) > 11)
{ {
@ -1635,18 +1635,18 @@ void control::FuelRollover6Control(int code, TPinballComponent* caller)
} }
} }
void control::HyperspaceLightGroupControl(int code, TPinballComponent* caller) void control::HyperspaceLightGroupControl(MessageCode code, TPinballComponent* caller)
{ {
switch (code) switch (code)
{ {
case 0: case MessageCode::TLightGroupNull:
caller->Message(MessageCode::TLightTurnOff, 0.0); caller->Message(MessageCode::TLightTurnOff, 0.0);
break; break;
case 41: case MessageCode::TLightGroupResetAndTurnOn:
caller->Message(MessageCode::TLightGroupResetAndTurnOn, 2.0); caller->Message(MessageCode::TLightGroupResetAndTurnOn, 2.0);
caller->Message(MessageCode::TLightGroupRestartNotifyTimer, 60.0); caller->Message(MessageCode::TLightGroupRestartNotifyTimer, 60.0);
break; break;
case 61: case MessageCode::ControlNotifyTimerExpired:
caller->Message(MessageCode::TLightGroupOffsetAnimationBackward, 0.0); caller->Message(MessageCode::TLightGroupOffsetAnimationBackward, 0.0);
if (caller->Message(MessageCode::TLightGroupGetOnCount, 0.0)) if (caller->Message(MessageCode::TLightGroupGetOnCount, 0.0))
caller->Message(MessageCode::TLightGroupRestartNotifyTimer, 60.0); caller->Message(MessageCode::TLightGroupRestartNotifyTimer, 60.0);
@ -1655,12 +1655,12 @@ void control::HyperspaceLightGroupControl(int code, TPinballComponent* caller)
} }
} }
void control::WormHoleControl(int code, TPinballComponent* caller) void control::WormHoleControl(MessageCode code, TPinballComponent* caller)
{ {
int sinkFlag2; int sinkFlag2;
TSink* sink = static_cast<TSink*>(caller); TSink* sink = static_cast<TSink*>(caller);
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
int sinkFlag = 0; int sinkFlag = 0;
if (sink1 != sink) if (sink1 != sink)
@ -1723,41 +1723,41 @@ void control::WormHoleControl(int code, TPinballComponent* caller)
} }
} }
void control::LeftFlipperControl(int code, TPinballComponent* caller) void control::LeftFlipperControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 1) if (code == MessageCode::TLightTurnOn)
{ {
bmpr_inc_lights->Message(MessageCode::TLightGroupStepBackward, 0.0); bmpr_inc_lights->Message(MessageCode::TLightGroupStepBackward, 0.0);
ramp_bmpr_inc_lights->Message(MessageCode::TLightGroupStepBackward, 0.0); ramp_bmpr_inc_lights->Message(MessageCode::TLightGroupStepBackward, 0.0);
} }
} }
void control::RightFlipperControl(int code, TPinballComponent* caller) void control::RightFlipperControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 1) if (code == MessageCode::TLightTurnOn)
{ {
bmpr_inc_lights->Message(MessageCode::TLightGroupStepForward, 0.0); bmpr_inc_lights->Message(MessageCode::TLightGroupStepForward, 0.0);
ramp_bmpr_inc_lights->Message(MessageCode::TLightGroupStepForward, 0.0); ramp_bmpr_inc_lights->Message(MessageCode::TLightGroupStepForward, 0.0);
} }
} }
void control::JackpotLightControl(int code, TPinballComponent* caller) void control::JackpotLightControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 60) if (code == MessageCode::ControlTimerExpired)
TableG->ScoreSpecial3Flag = 0; TableG->ScoreSpecial3Flag = 0;
} }
void control::BonusLightControl(int code, TPinballComponent* caller) void control::BonusLightControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 60) if (code == MessageCode::ControlTimerExpired)
TableG->ScoreSpecial2Flag = 0; TableG->ScoreSpecial2Flag = 0;
} }
void control::BoosterTargetControl(int code, TPinballComponent* caller) void control::BoosterTargetControl(MessageCode code, TPinballComponent* caller)
{ {
TSound* sound = nullptr; TSound* sound = nullptr;
if (code == 63 && !caller->MessageField) if (code == MessageCode::ControlCollision && !caller->MessageField)
{ {
caller->MessageField = 1; caller->MessageField = 1;
if (target1->MessageField if (target1->MessageField
@ -1817,18 +1817,18 @@ void control::BoosterTargetControl(int code, TPinballComponent* caller)
} }
} }
void control::MedalLightGroupControl(int code, TPinballComponent* caller) void control::MedalLightGroupControl(MessageCode code, TPinballComponent* caller)
{ {
switch (code) switch (code)
{ {
case 0: case MessageCode::TLightGroupNull:
caller->Message(MessageCode::TLightTurnOff, 0.0); caller->Message(MessageCode::TLightTurnOff, 0.0);
break; break;
case 41: case MessageCode::TLightGroupResetAndTurnOn:
caller->Message(MessageCode::TLightGroupResetAndTurnOn, 2.0); caller->Message(MessageCode::TLightGroupResetAndTurnOn, 2.0);
caller->Message(MessageCode::TLightGroupRestartNotifyTimer, 30.0); caller->Message(MessageCode::TLightGroupRestartNotifyTimer, 30.0);
break; break;
case 61: case MessageCode::ControlNotifyTimerExpired:
caller->Message(MessageCode::TLightGroupOffsetAnimationBackward, 0.0); caller->Message(MessageCode::TLightGroupOffsetAnimationBackward, 0.0);
if (caller->Message(MessageCode::TLightGroupGetOnCount, 0.0)) if (caller->Message(MessageCode::TLightGroupGetOnCount, 0.0))
caller->Message(MessageCode::TLightGroupRestartNotifyTimer, 30.0); caller->Message(MessageCode::TLightGroupRestartNotifyTimer, 30.0);
@ -1837,31 +1837,31 @@ void control::MedalLightGroupControl(int code, TPinballComponent* caller)
} }
} }
void control::MultiplierLightGroupControl(int code, TPinballComponent* caller) void control::MultiplierLightGroupControl(MessageCode code, TPinballComponent* caller)
{ {
switch (code) switch (code)
{ {
case 0: case MessageCode::TLightGroupNull:
caller->Message(MessageCode::TLightTurnOff, 0.0); caller->Message(MessageCode::TLightTurnOff, 0.0);
break; break;
case 41: case MessageCode::TLightGroupResetAndTurnOn:
caller->Message(MessageCode::TLightGroupResetAndTurnOn, 2.0); caller->Message(MessageCode::TLightGroupResetAndTurnOn, 2.0);
caller->Message(MessageCode::TLightGroupRestartNotifyTimer, 30.0); caller->Message(MessageCode::TLightGroupRestartNotifyTimer, 30.0);
break; break;
case 61: case MessageCode::ControlNotifyTimerExpired:
if (TableG->ScoreMultiplier) if (TableG->ScoreMultiplier)
TableG->ScoreMultiplier = TableG->ScoreMultiplier - 1; TableG->ScoreMultiplier = TableG->ScoreMultiplier - 1;
caller->Message(MessageCode::TLightGroupOffsetAnimationBackward, 0.0); caller->Message(MessageCode::TLightGroupOffsetAnimationBackward, 0.0);
if (caller->Message(MessageCode::TLightGroupGetOnCount, 0.0)) if (caller->Message(MessageCode::TLightGroupGetOnCount, 0.0))
caller->Message(MessageCode::TLightGroupRestartNotifyTimer, 30.0); caller->Message(MessageCode::TLightGroupRestartNotifyTimer, 30.0);
break; break;
case 64: case MessageCode::ControlEnableMultiplier:
TableG->ScoreMultiplier = 4; TableG->ScoreMultiplier = 4;
caller->Message(MessageCode::TLightResetAndTurnOn, 0.0); caller->Message(MessageCode::TLightResetAndTurnOn, 0.0);
caller->Message(MessageCode::TLightGroupRestartNotifyTimer, 30.0); caller->Message(MessageCode::TLightGroupRestartNotifyTimer, 30.0);
info_text_box->Display(pb::get_rc_string(Msg::STRING160), 2.0); info_text_box->Display(pb::get_rc_string(Msg::STRING160), 2.0);
break; break;
case 65: case MessageCode::ControlDisableMultiplier:
TableG->ScoreMultiplier = 0; TableG->ScoreMultiplier = 0;
caller->Message(MessageCode::TLightResetAndTurnOff, 0.0); caller->Message(MessageCode::TLightResetAndTurnOff, 0.0);
caller->Message(MessageCode::TLightGroupRestartNotifyTimer, -1.0); caller->Message(MessageCode::TLightGroupRestartNotifyTimer, -1.0);
@ -1871,11 +1871,11 @@ void control::MultiplierLightGroupControl(int code, TPinballComponent* caller)
} }
} }
void control::FuelSpotTargetControl(int code, TPinballComponent* caller) void control::FuelSpotTargetControl(MessageCode code, TPinballComponent* caller)
{ {
TPinballComponent* liteComp; TPinballComponent* liteComp;
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (target10 == caller) if (target10 == caller)
{ {
@ -1903,9 +1903,9 @@ void control::FuelSpotTargetControl(int code, TPinballComponent* caller)
} }
} }
void control::MissionSpotTargetControl(int code, TPinballComponent* caller) void control::MissionSpotTargetControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
TPinballComponent* lite; TPinballComponent* lite;
if (target13 == caller) if (target13 == caller)
@ -1939,11 +1939,11 @@ void control::MissionSpotTargetControl(int code, TPinballComponent* caller)
} }
} }
void control::LeftHazardSpotTargetControl(int code, TPinballComponent* caller) void control::LeftHazardSpotTargetControl(MessageCode code, TPinballComponent* caller)
{ {
TPinballComponent* lite; TPinballComponent* lite;
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (target16 == caller) if (target16 == caller)
{ {
@ -1975,11 +1975,11 @@ void control::LeftHazardSpotTargetControl(int code, TPinballComponent* caller)
} }
} }
void control::RightHazardSpotTargetControl(int code, TPinballComponent* caller) void control::RightHazardSpotTargetControl(MessageCode code, TPinballComponent* caller)
{ {
TPinballComponent* light; TPinballComponent* light;
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (target19 == caller) if (target19 == caller)
{ {
@ -2011,9 +2011,9 @@ void control::RightHazardSpotTargetControl(int code, TPinballComponent* caller)
} }
} }
void control::WormHoleDestinationControl(int code, TPinballComponent* caller) void control::WormHoleDestinationControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (!light_on(&control_lite110_tag)) if (!light_on(&control_lite110_tag))
{ {
@ -2025,11 +2025,11 @@ void control::WormHoleDestinationControl(int code, TPinballComponent* caller)
} }
} }
void control::BlackHoleKickoutControl(int code, TPinballComponent* caller) void control::BlackHoleKickoutControl(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
int addedScore = TableG->AddScore(caller->get_scoring(0)); int addedScore = TableG->AddScore(caller->get_scoring(0));
snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING181), addedScore); snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING181), addedScore);
@ -2038,26 +2038,26 @@ void control::BlackHoleKickoutControl(int code, TPinballComponent* caller)
} }
} }
void control::FlagControl(int code, TPinballComponent* caller) void control::FlagControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 62) if (code == MessageCode::ControlSpinnerLoopReset)
{ {
AdvanceWormHoleDestination(0); AdvanceWormHoleDestination(0);
} }
else if (code == 63) else if (code == MessageCode::ControlCollision)
{ {
int score = caller->get_scoring(light_on(&control_lite20_tag)); int score = caller->get_scoring(light_on(&control_lite20_tag));
TableG->AddScore(score); TableG->AddScore(score);
} }
} }
void control::GravityWellKickoutControl(int code, TPinballComponent* caller) void control::GravityWellKickoutControl(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
switch (code) switch (code)
{ {
case 63: case MessageCode::ControlCollision:
{ {
auto addedScore = TableG->AddScore(caller->get_scoring(0)); auto addedScore = TableG->AddScore(caller->get_scoring(0));
snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING182), addedScore); snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING182), addedScore);
@ -2068,7 +2068,7 @@ void control::GravityWellKickoutControl(int code, TPinballComponent* caller)
caller->Message(MessageCode::TKickoutRestartTimer, duration); caller->Message(MessageCode::TKickoutRestartTimer, duration);
break; break;
} }
case 64: case MessageCode::ControlEnableMultiplier:
{ {
auto score = reinterpret_cast<size_t>(caller); auto score = reinterpret_cast<size_t>(caller);
if (score) if (score)
@ -2084,15 +2084,15 @@ void control::GravityWellKickoutControl(int code, TPinballComponent* caller)
kickout1->ActiveFlag = 1; kickout1->ActiveFlag = 1;
break; break;
} }
case ~MessageCode::Reset: case MessageCode::Reset:
kickout1->ActiveFlag = 0; kickout1->ActiveFlag = 0;
break; break;
} }
} }
void control::SkillShotGate1Control(int code, TPinballComponent* caller) void control::SkillShotGate1Control(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
lite200->Message(MessageCode::TLightTurnOnTimed, 5.0); lite200->Message(MessageCode::TLightTurnOnTimed, 5.0);
if (light_on(&control_lite67_tag)) if (light_on(&control_lite67_tag))
@ -2108,9 +2108,9 @@ void control::SkillShotGate1Control(int code, TPinballComponent* caller)
} }
} }
void control::SkillShotGate2Control(int code, TPinballComponent* caller) void control::SkillShotGate2Control(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (light_on(&control_lite67_tag)) if (light_on(&control_lite67_tag))
{ {
@ -2120,9 +2120,9 @@ void control::SkillShotGate2Control(int code, TPinballComponent* caller)
} }
} }
void control::SkillShotGate3Control(int code, TPinballComponent* caller) void control::SkillShotGate3Control(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (light_on(&control_lite67_tag)) if (light_on(&control_lite67_tag))
{ {
@ -2132,9 +2132,9 @@ void control::SkillShotGate3Control(int code, TPinballComponent* caller)
} }
} }
void control::SkillShotGate4Control(int code, TPinballComponent* caller) void control::SkillShotGate4Control(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (light_on(&control_lite67_tag)) if (light_on(&control_lite67_tag))
{ {
@ -2144,9 +2144,9 @@ void control::SkillShotGate4Control(int code, TPinballComponent* caller)
} }
} }
void control::SkillShotGate5Control(int code, TPinballComponent* caller) void control::SkillShotGate5Control(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (light_on(&control_lite67_tag)) if (light_on(&control_lite67_tag))
{ {
@ -2156,9 +2156,9 @@ void control::SkillShotGate5Control(int code, TPinballComponent* caller)
} }
} }
void control::SkillShotGate6Control(int code, TPinballComponent* caller) void control::SkillShotGate6Control(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (light_on(&control_lite67_tag)) if (light_on(&control_lite67_tag))
{ {
@ -2168,9 +2168,9 @@ void control::SkillShotGate6Control(int code, TPinballComponent* caller)
} }
} }
void control::ShootAgainLightControl(int code, TPinballComponent* caller) void control::ShootAgainLightControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 60) if (code == MessageCode::ControlTimerExpired)
{ {
if (caller->MessageField) if (caller->MessageField)
{ {
@ -2184,15 +2184,15 @@ void control::ShootAgainLightControl(int code, TPinballComponent* caller)
} }
} }
void control::EscapeChuteSinkControl(int code, TPinballComponent* caller) void control::EscapeChuteSinkControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
caller->Message(MessageCode::TSinkResetTimer, -1.0f); caller->Message(MessageCode::TSinkResetTimer, -1.0f);
} }
} }
void control::MissionControl(int code, TPinballComponent* caller) void control::MissionControl(MessageCode code, TPinballComponent* caller)
{ {
if (!lite198) if (!lite198)
return; return;
@ -2200,7 +2200,7 @@ void control::MissionControl(int code, TPinballComponent* caller)
int lite198Msg = lite198->MessageField; int lite198Msg = lite198->MessageField;
switch (code) switch (code)
{ {
case 47: case MessageCode::TLightGroupCountdownEnded:
if (fuel_bargraph == caller && lite198Msg > 1) if (fuel_bargraph == caller && lite198Msg > 1)
{ {
l_trek_lights->Message(MessageCode::TLightGroupReset, 0.0); l_trek_lights->Message(MessageCode::TLightGroupReset, 0.0);
@ -2209,10 +2209,10 @@ void control::MissionControl(int code, TPinballComponent* caller)
r_trek_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0); r_trek_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0);
mission_text_box->Display(pb::get_rc_string(Msg::STRING210), 4.0); mission_text_box->Display(pb::get_rc_string(Msg::STRING210), 4.0);
lite198->MessageField = 1; lite198->MessageField = 1;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
} }
break; break;
case 60: case MessageCode::ControlTimerExpired:
if (fuel_bargraph == caller && lite198Msg) if (fuel_bargraph == caller && lite198Msg)
{ {
if (fuel_bargraph->Message(MessageCode::TLightGroupGetOnCount, 0.0) == 1) if (fuel_bargraph->Message(MessageCode::TLightGroupGetOnCount, 0.0) == 1)
@ -2222,10 +2222,10 @@ void control::MissionControl(int code, TPinballComponent* caller)
break; break;
} }
if (mission_text_box == caller) if (mission_text_box == caller)
code = 67; code = MessageCode::ControlMissionStarted;
break; break;
case ~MessageCode::Resume: case MessageCode::Resume:
code = 67; code = MessageCode::ControlMissionStarted;
break; break;
default: default:
break; break;
@ -2335,15 +2335,15 @@ void control::MissionControl(int code, TPinballComponent* caller)
} }
} }
void control::HyperspaceKickOutControl(int code, TPinballComponent* caller) void control::HyperspaceKickOutControl(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code != 63) if (code != MessageCode::ControlCollision)
return; return;
auto activeCount = hyper_lights->Message(MessageCode::TLightGroupGetOnCount, 0.0); auto activeCount = hyper_lights->Message(MessageCode::TLightGroupGetOnCount, 0.0);
HyperspaceLightGroupControl(41, hyper_lights); HyperspaceLightGroupControl(MessageCode::TLightGroupResetAndTurnOn, hyper_lights);
switch (activeCount) switch (activeCount)
{ {
case 0: case 0:
@ -2363,7 +2363,7 @@ void control::HyperspaceKickOutControl(int code, TPinballComponent* caller)
} }
case 2: case 2:
{ {
DrainBallBlockerControl(52, block1); DrainBallBlockerControl(MessageCode::TBlockerEnable, block1);
auto addedScore = TableG->AddScore(caller->get_scoring(2)); auto addedScore = TableG->AddScore(caller->get_scoring(2));
snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING103), addedScore); snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING103), addedScore);
info_text_box->Display(Buffer, 2.0); info_text_box->Display(Buffer, 2.0);
@ -2371,7 +2371,7 @@ void control::HyperspaceKickOutControl(int code, TPinballComponent* caller)
} }
case 3: case 3:
{ {
ExtraBallLightControl(19, nullptr); ExtraBallLightControl(MessageCode::TLightResetAndTurnOn, nullptr);
auto addedScore = TableG->AddScore(caller->get_scoring(3)); auto addedScore = TableG->AddScore(caller->get_scoring(3));
snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING109), addedScore); snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING109), addedScore);
info_text_box->Display(Buffer, 2.0); info_text_box->Display(Buffer, 2.0);
@ -2381,7 +2381,7 @@ void control::HyperspaceKickOutControl(int code, TPinballComponent* caller)
{ {
hyper_lights->Message(MessageCode::TLightTurnOff, 0.0); hyper_lights->Message(MessageCode::TLightTurnOff, 0.0);
size_t addedScore = TableG->AddScore(caller->get_scoring(4)); size_t addedScore = TableG->AddScore(caller->get_scoring(4));
GravityWellKickoutControl(64, reinterpret_cast<TPinballComponent*>(addedScore)); GravityWellKickoutControl(MessageCode::ControlEnableMultiplier, reinterpret_cast<TPinballComponent*>(addedScore));
break; break;
} }
default: default:
@ -2402,7 +2402,7 @@ void control::HyperspaceKickOutControl(int code, TPinballComponent* caller)
{ {
someFlag |= 4u; someFlag |= 4u;
lite130->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite130->Message(MessageCode::TLightResetAndTurnOff, 0.0);
MultiplierLightGroupControl(64, top_target_lights); MultiplierLightGroupControl(MessageCode::ControlEnableMultiplier, top_target_lights);
bumber_target_lights->Message(MessageCode::TLightResetAndTurnOn, 0.0); bumber_target_lights->Message(MessageCode::TLightResetAndTurnOn, 0.0);
table_set_jackpot(); table_set_jackpot();
table_set_bonus(); table_set_bonus();
@ -2410,8 +2410,8 @@ void control::HyperspaceKickOutControl(int code, TPinballComponent* caller)
table_set_bonus_hold(); table_set_bonus_hold();
lite27->Message(MessageCode::TLightResetAndTurnOn, 0.0); lite27->Message(MessageCode::TLightResetAndTurnOn, 0.0);
lite28->Message(MessageCode::TLightResetAndTurnOn, 0.0); lite28->Message(MessageCode::TLightResetAndTurnOn, 0.0);
ExtraBallLightControl(19, nullptr); ExtraBallLightControl(MessageCode::TLightResetAndTurnOn, nullptr);
DrainBallBlockerControl(52, block1); DrainBallBlockerControl(MessageCode::TBlockerEnable, block1);
if (TableG->MultiballFlag) if (TableG->MultiballFlag)
{ {
@ -2422,7 +2422,7 @@ void control::HyperspaceKickOutControl(int code, TPinballComponent* caller)
TableG->ScoreSpecial3 = 100000; TableG->ScoreSpecial3 = 100000;
if (TableG->ScoreSpecial2 < 100000) if (TableG->ScoreSpecial2 < 100000)
TableG->ScoreSpecial2 = 100000; TableG->ScoreSpecial2 = 100000;
GravityWellKickoutControl(64, nullptr); GravityWellKickoutControl(MessageCode::ControlEnableMultiplier, nullptr);
} }
TSound* sound; TSound* sound;
@ -2472,13 +2472,13 @@ void control::HyperspaceKickOutControl(int code, TPinballComponent* caller)
caller->Message(MessageCode::TKickoutRestartTimer, duration); caller->Message(MessageCode::TKickoutRestartTimer, duration);
} }
void control::PlungerControl(int code, TPinballComponent* caller) void control::PlungerControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 1015) if (code == MessageCode::PlungerFeedBall)
{ {
MissionControl(67, nullptr); MissionControl(MessageCode::ControlMissionStarted, nullptr);
} }
else if (code == 1016) else if (code == MessageCode::PlungerStartFeedTimer)
{ {
table_unlimited_balls = false; table_unlimited_balls = false;
if (!middle_circle->Message(MessageCode::TLightGroupGetOnCount, 0.0)) if (!middle_circle->Message(MessageCode::TLightGroupGetOnCount, 0.0))
@ -2495,7 +2495,7 @@ void control::PlungerControl(int code, TPinballComponent* caller)
r_trek_lights->Message(MessageCode::TLightGroupOffsetAnimationForward, 0.2f); r_trek_lights->Message(MessageCode::TLightGroupOffsetAnimationForward, 0.2f);
r_trek_lights->Message(MessageCode::TLightGroupAnimationBackward, 0.2f); r_trek_lights->Message(MessageCode::TLightGroupAnimationBackward, 0.2f);
TableG->ScoreSpecial1 = 25000; TableG->ScoreSpecial1 = 25000;
MultiplierLightGroupControl(65, top_target_lights); MultiplierLightGroupControl(MessageCode::ControlDisableMultiplier, top_target_lights);
fuel_bargraph->Message(MessageCode::TLightResetAndTurnOn, 0.0); fuel_bargraph->Message(MessageCode::TLightResetAndTurnOn, 0.0);
lite200->Message(MessageCode::TLightResetAndTurnOn, 0.0); lite200->Message(MessageCode::TLightResetAndTurnOn, 0.0);
gate1->Message(MessageCode::TGateDisable, 0.0); gate1->Message(MessageCode::TGateDisable, 0.0);
@ -2505,16 +2505,16 @@ void control::PlungerControl(int code, TPinballComponent* caller)
} }
} }
void control::MedalTargetControl(int code, TPinballComponent* caller) void control::MedalTargetControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63 && !caller->MessageField) if (code == MessageCode::ControlCollision && !caller->MessageField)
{ {
caller->MessageField = 1; caller->MessageField = 1;
if (target6->MessageField if (target6->MessageField
+ target5->MessageField + target5->MessageField
+ target4->MessageField == 3) + target4->MessageField == 3)
{ {
MedalLightGroupControl(41, bumber_target_lights); MedalLightGroupControl(MessageCode::TLightGroupResetAndTurnOn, bumber_target_lights);
int activeCount = bumber_target_lights->Message(MessageCode::TLightGroupGetOnCount, 0.0) - 1; int activeCount = bumber_target_lights->Message(MessageCode::TLightGroupGetOnCount, 0.0) - 1;
const char* text; const char* text;
switch (activeCount) switch (activeCount)
@ -2545,15 +2545,15 @@ void control::MedalTargetControl(int code, TPinballComponent* caller)
} }
} }
void control::MultiplierTargetControl(int code, TPinballComponent* caller) void control::MultiplierTargetControl(MessageCode code, TPinballComponent* caller)
{ {
if (code == 63 && !caller->MessageField) if (code == MessageCode::ControlCollision && !caller->MessageField)
{ {
caller->MessageField = 1; caller->MessageField = 1;
if (target9->MessageField + target8->MessageField + target7->MessageField == 3) if (target9->MessageField + target8->MessageField + target7->MessageField == 3)
{ {
TableG->AddScore(caller->get_scoring(1)); TableG->AddScore(caller->get_scoring(1));
MultiplierLightGroupControl(41, top_target_lights); MultiplierLightGroupControl(MessageCode::TLightGroupResetAndTurnOn, top_target_lights);
int activeCount = top_target_lights->Message(MessageCode::TLightGroupGetOnCount, 0.0); int activeCount = top_target_lights->Message(MessageCode::TLightGroupGetOnCount, 0.0);
const char* text; const char* text;
switch (activeCount) switch (activeCount)
@ -2591,11 +2591,11 @@ void control::MultiplierTargetControl(int code, TPinballComponent* caller)
} }
} }
void control::BallDrainControl(int code, TPinballComponent* caller) void control::BallDrainControl(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code == 60) if (code == MessageCode::ControlTimerExpired)
{ {
if (lite199->MessageField) if (lite199->MessageField)
{ {
@ -2612,7 +2612,7 @@ void control::BallDrainControl(int code, TPinballComponent* caller)
plunger->Message(MessageCode::PlungerStartFeedTimer, 0.0); plunger->Message(MessageCode::PlungerStartFeedTimer, 0.0);
} }
} }
else if (code == 63) else if (code == MessageCode::ControlCollision)
{ {
if (table_unlimited_balls) if (table_unlimited_balls)
{ {
@ -2742,7 +2742,7 @@ void control::BallDrainControl(int code, TPinballComponent* caller)
lite195->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite195->Message(MessageCode::TLightResetAndTurnOff, 0.0);
fuel_bargraph->Message(MessageCode::TLightResetAndTurnOff, 0.0); fuel_bargraph->Message(MessageCode::TLightResetAndTurnOff, 0.0);
fuel_bargraph->Message(MessageCode::Reset, 0.0); fuel_bargraph->Message(MessageCode::Reset, 0.0);
GravityWellKickoutControl(1024, nullptr); GravityWellKickoutControl(MessageCode::Reset, nullptr);
lite62->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite62->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite4->MessageField = 0; lite4->MessageField = 0;
lite101->MessageField = 0; lite101->MessageField = 0;
@ -2769,7 +2769,7 @@ void control::BallDrainControl(int code, TPinballComponent* caller)
lite198->MessageField = 32; lite198->MessageField = 32;
else else
lite198->MessageField = 0; lite198->MessageField = 0;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
TableG->Message(MessageCode::ClearTiltLock, 0.0); TableG->Message(MessageCode::ClearTiltLock, 0.0);
if (light_on(&control_lite58_tag)) if (light_on(&control_lite58_tag))
lite58->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite58->Message(MessageCode::TLightResetAndTurnOff, 0.0);
@ -2781,9 +2781,9 @@ void control::BallDrainControl(int code, TPinballComponent* caller)
} }
void control::table_control_handler(int code) void control::table_control_handler(MessageCode code)
{ {
if (code == 1011) if (code == MessageCode::SetTiltLock)
{ {
table_unlimited_balls = false; table_unlimited_balls = false;
lite77->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite77->Message(MessageCode::TLightFlasherStartTimed, 0.0);
@ -2791,11 +2791,11 @@ void control::table_control_handler(int code)
} }
void control::AlienMenaceController(int code, TPinballComponent* caller) void control::AlienMenaceController(MessageCode code, TPinballComponent* caller)
{ {
if (code != 11) if (code != MessageCode::TBumperSetBmpIndex)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
attack_bump->Message(MessageCode::TBumperSetBmpIndex, 0.0); attack_bump->Message(MessageCode::TBumperSetBmpIndex, 0.0);
l_trek_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0); l_trek_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0);
@ -2806,7 +2806,7 @@ void control::AlienMenaceController(int code, TPinballComponent* caller)
r_trek_lights->Message(MessageCode::TLightGroupAnimationBackward, 0.2f); r_trek_lights->Message(MessageCode::TLightGroupAnimationBackward, 0.2f);
lite307->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite307->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -2819,18 +2819,18 @@ void control::AlienMenaceController(int code, TPinballComponent* caller)
{ {
lite307->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite307->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 20; lite198->MessageField = 20;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
} }
} }
} }
void control::AlienMenacePartTwoController(int code, TPinballComponent* caller) void control::AlienMenacePartTwoController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite56->MessageField = 8; lite56->MessageField = 8;
l_trek_lights->Message(MessageCode::TLightGroupReset, 0.0); l_trek_lights->Message(MessageCode::TLightGroupReset, 0.0);
@ -2840,7 +2840,7 @@ void control::AlienMenacePartTwoController(int code, TPinballComponent* caller)
lite308->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite308->Message(MessageCode::TLightFlasherStartTimed, 0.0);
lite311->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite311->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -2857,14 +2857,14 @@ void control::AlienMenacePartTwoController(int code, TPinballComponent* caller)
lite56->MessageField = lite56->MessageField - 1; lite56->MessageField = lite56->MessageField - 1;
if (lite56->MessageField) if (lite56->MessageField)
{ {
MissionControl(67, caller); MissionControl(MessageCode::ControlMissionStarted, caller);
} }
else else
{ {
lite308->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite308->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite311->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite311->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 1; lite198->MessageField = 1;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
mission_text_box->Display(pb::get_rc_string(Msg::STRING231), 4.0); mission_text_box->Display(pb::get_rc_string(Msg::STRING231), 4.0);
int addedScore = SpecialAddScore(750000); int addedScore = SpecialAddScore(750000);
snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore); snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore);
@ -2877,16 +2877,16 @@ void control::AlienMenacePartTwoController(int code, TPinballComponent* caller)
} }
} }
void control::BlackHoleThreatController(int code, TPinballComponent* caller) void control::BlackHoleThreatController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code == 11) if (code == MessageCode::TBumperSetBmpIndex)
{ {
if (bump5 == caller) if (bump5 == caller)
MissionControl(67, caller); MissionControl(MessageCode::ControlMissionStarted, caller);
} }
else if (code == 63) else if (code == MessageCode::ControlCollision)
{ {
if (kickout3 == caller if (kickout3 == caller
&& bump5->BmpIndex) && bump5->BmpIndex)
@ -2896,7 +2896,7 @@ void control::BlackHoleThreatController(int code, TPinballComponent* caller)
if (light_on(&control_lite314_tag)) if (light_on(&control_lite314_tag))
lite314->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite314->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 1; lite198->MessageField = 1;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
mission_text_box->Display(pb::get_rc_string(Msg::STRING225), 4.0); mission_text_box->Display(pb::get_rc_string(Msg::STRING225), 4.0);
int addedScore = SpecialAddScore(1000000); int addedScore = SpecialAddScore(1000000);
snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore); snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore);
@ -2909,11 +2909,11 @@ void control::BlackHoleThreatController(int code, TPinballComponent* caller)
} }
else else
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
launch_bump->Message(MessageCode::TBumperSetBmpIndex, 0.0); launch_bump->Message(MessageCode::TBumperSetBmpIndex, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -2940,13 +2940,13 @@ void control::BlackHoleThreatController(int code, TPinballComponent* caller)
} }
} }
void control::BugHuntController(int code, TPinballComponent* caller) void control::BugHuntController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite56->MessageField = 15; lite56->MessageField = 15;
target1->MessageField = 0; target1->MessageField = 0;
@ -2977,7 +2977,7 @@ void control::BugHuntController(int code, TPinballComponent* caller)
lite313->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite313->Message(MessageCode::TLightFlasherStartTimed, 0.0);
lite319->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite319->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -3011,7 +3011,7 @@ void control::BugHuntController(int code, TPinballComponent* caller)
lite56->MessageField = lite56->MessageField - 1; lite56->MessageField = lite56->MessageField - 1;
if (lite56->MessageField) if (lite56->MessageField)
{ {
MissionControl(67, caller); MissionControl(MessageCode::ControlMissionStarted, caller);
} }
else else
{ {
@ -3021,7 +3021,7 @@ void control::BugHuntController(int code, TPinballComponent* caller)
lite313->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite313->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite319->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite319->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 1; lite198->MessageField = 1;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
mission_text_box->Display(pb::get_rc_string(Msg::STRING227), 4.0); mission_text_box->Display(pb::get_rc_string(Msg::STRING227), 4.0);
int addedScore = SpecialAddScore(750000); int addedScore = SpecialAddScore(750000);
snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore); snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore);
@ -3034,13 +3034,13 @@ void control::BugHuntController(int code, TPinballComponent* caller)
} }
} }
void control::CosmicPlagueController(int code, TPinballComponent* caller) void control::CosmicPlagueController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite56->MessageField = 75; lite56->MessageField = 75;
lite20->Message(MessageCode::TLightResetAndTurnOn, 0.0); lite20->Message(MessageCode::TLightResetAndTurnOn, 0.0);
@ -3048,7 +3048,7 @@ void control::CosmicPlagueController(int code, TPinballComponent* caller)
lite305->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite305->Message(MessageCode::TLightFlasherStartTimed, 0.0);
lite312->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite312->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -3061,31 +3061,31 @@ void control::CosmicPlagueController(int code, TPinballComponent* caller)
lite56->MessageField = lite56->MessageField - 1; lite56->MessageField = lite56->MessageField - 1;
if (lite56->MessageField) if (lite56->MessageField)
{ {
MissionControl(67, caller); MissionControl(MessageCode::ControlMissionStarted, caller);
} }
else else
{ {
lite305->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite305->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite312->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite312->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 21; lite198->MessageField = 21;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
lite20->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite20->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite19->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite19->Message(MessageCode::TLightResetAndTurnOff, 0.0);
} }
} }
} }
void control::CosmicPlaguePartTwoController(int code, TPinballComponent* caller) void control::CosmicPlaguePartTwoController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite310->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite310->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -3096,7 +3096,7 @@ void control::CosmicPlaguePartTwoController(int code, TPinballComponent* caller)
{ {
lite310->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite310->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 1; lite198->MessageField = 1;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
mission_text_box->Display(pb::get_rc_string(Msg::STRING242), 4.0); mission_text_box->Display(pb::get_rc_string(Msg::STRING242), 4.0);
int addedScore = SpecialAddScore(1750000); int addedScore = SpecialAddScore(1750000);
snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore); snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore);
@ -3108,19 +3108,19 @@ void control::CosmicPlaguePartTwoController(int code, TPinballComponent* caller)
} }
} }
void control::DoomsdayMachineController(int code, TPinballComponent* caller) void control::DoomsdayMachineController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite56->MessageField = 3; lite56->MessageField = 3;
lite301->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite301->Message(MessageCode::TLightFlasherStartTimed, 0.0);
lite320->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite320->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -3133,14 +3133,14 @@ void control::DoomsdayMachineController(int code, TPinballComponent* caller)
lite56->MessageField = lite56->MessageField - 1; lite56->MessageField = lite56->MessageField - 1;
if (lite56->MessageField) if (lite56->MessageField)
{ {
MissionControl(67, caller); MissionControl(MessageCode::ControlMissionStarted, caller);
} }
else else
{ {
lite301->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite301->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite320->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite320->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 1; lite198->MessageField = 1;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
mission_text_box->Display(pb::get_rc_string(Msg::STRING239), 4.0); mission_text_box->Display(pb::get_rc_string(Msg::STRING239), 4.0);
int addedScore = SpecialAddScore(1250000); int addedScore = SpecialAddScore(1250000);
snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore); snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore);
@ -3153,11 +3153,11 @@ void control::DoomsdayMachineController(int code, TPinballComponent* caller)
} }
} }
void control::GameoverController(int code, TPinballComponent* caller) void control::GameoverController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[128]; char Buffer[128];
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
goal_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0); goal_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0);
pb::mode_change(GameModes::GameOver); pb::mode_change(GameModes::GameOver);
@ -3167,7 +3167,7 @@ void control::GameoverController(int code, TPinballComponent* caller)
midi::play_track(MidiTracks::Track1, false); midi::play_track(MidiTracks::Track1, false);
return; return;
} }
if (code != 67) if (code != MessageCode::ControlMissionStarted)
return; return;
int missionMsg = mission_text_box->MessageField; int missionMsg = mission_text_box->MessageField;
@ -3251,18 +3251,18 @@ void control::GameoverController(int code, TPinballComponent* caller)
mission_text_box->Display(pb::get_rc_string(Msg::STRING272), 10.0); mission_text_box->Display(pb::get_rc_string(Msg::STRING272), 10.0);
} }
void control::LaunchTrainingController(int code, TPinballComponent* caller) void control::LaunchTrainingController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite317->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite317->Message(MessageCode::TLightFlasherStartTimed, 0.0);
lite56->MessageField = 3; lite56->MessageField = 3;
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -3275,13 +3275,13 @@ void control::LaunchTrainingController(int code, TPinballComponent* caller)
lite56->MessageField = lite56->MessageField - 1; lite56->MessageField = lite56->MessageField - 1;
if (lite56->MessageField) if (lite56->MessageField)
{ {
MissionControl(67, caller); MissionControl(MessageCode::ControlMissionStarted, caller);
} }
else else
{ {
lite317->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite317->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 1; lite198->MessageField = 1;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
mission_text_box->Display(pb::get_rc_string(Msg::STRING212), 4.0); mission_text_box->Display(pb::get_rc_string(Msg::STRING212), 4.0);
int addedScore = SpecialAddScore(500000); int addedScore = SpecialAddScore(500000);
snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore); snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore);
@ -3294,20 +3294,20 @@ void control::LaunchTrainingController(int code, TPinballComponent* caller)
} }
} }
void control::MaelstromController(int code, TPinballComponent* caller) void control::MaelstromController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite56->MessageField = 3; lite56->MessageField = 3;
lite303->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite303->Message(MessageCode::TLightFlasherStartTimed, 0.0);
lite309->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite309->Message(MessageCode::TLightFlasherStartTimed, 0.0);
lite315->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite315->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -3328,7 +3328,7 @@ void control::MaelstromController(int code, TPinballComponent* caller)
lite56->MessageField = lite56->MessageField - 1; lite56->MessageField = lite56->MessageField - 1;
if (lite56->MessageField) if (lite56->MessageField)
{ {
MissionControl(67, caller); MissionControl(MessageCode::ControlMissionStarted, caller);
} }
else else
{ {
@ -3336,23 +3336,23 @@ void control::MaelstromController(int code, TPinballComponent* caller)
lite309->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite309->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite315->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite315->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 25; lite198->MessageField = 25;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
} }
} }
} }
void control::MaelstromPartEightController(int code, TPinballComponent* caller) void control::MaelstromPartEightController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite130->Message(MessageCode::TLightResetAndTurnOn, 0.0); lite130->Message(MessageCode::TLightResetAndTurnOn, 0.0);
lite304->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite304->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -3364,7 +3364,7 @@ void control::MaelstromPartEightController(int code, TPinballComponent* caller)
lite304->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite304->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite130->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite130->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 1; lite198->MessageField = 1;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
int addedScore = SpecialAddScore(5000000); int addedScore = SpecialAddScore(5000000);
snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore); snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore);
info_text_box->Display(pb::get_rc_string(Msg::STRING149), 4.0); info_text_box->Display(pb::get_rc_string(Msg::STRING149), 4.0);
@ -3376,15 +3376,15 @@ void control::MaelstromPartEightController(int code, TPinballComponent* caller)
} }
} }
void control::MaelstromPartFiveController(int code, TPinballComponent* caller) void control::MaelstromPartFiveController(MessageCode code, TPinballComponent* caller)
{ {
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite317->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite317->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -3395,20 +3395,20 @@ void control::MaelstromPartFiveController(int code, TPinballComponent* caller)
{ {
lite317->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite317->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 29; lite198->MessageField = 29;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
} }
} }
void control::MaelstromPartFourController(int code, TPinballComponent* caller) void control::MaelstromPartFourController(MessageCode code, TPinballComponent* caller)
{ {
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite56->MessageField = 0; lite56->MessageField = 0;
lite318->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite318->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -3419,22 +3419,22 @@ void control::MaelstromPartFourController(int code, TPinballComponent* caller)
{ {
lite318->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite318->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 28; lite198->MessageField = 28;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
} }
} }
void control::MaelstromPartSevenController(int code, TPinballComponent* caller) void control::MaelstromPartSevenController(MessageCode code, TPinballComponent* caller)
{ {
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
AdvanceWormHoleDestination(1); AdvanceWormHoleDestination(1);
sink1->Message(MessageCode::TSinkUnknown7, 0.0); sink1->Message(MessageCode::TSinkUnknown7, 0.0);
sink2->Message(MessageCode::TSinkUnknown7, 0.0); sink2->Message(MessageCode::TSinkUnknown7, 0.0);
sink3->Message(MessageCode::TSinkUnknown7, 0.0); sink3->Message(MessageCode::TSinkUnknown7, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -3446,22 +3446,22 @@ void control::MaelstromPartSevenController(int code, TPinballComponent* caller)
|| sink3 == caller) || sink3 == caller)
{ {
lite198->MessageField = 31; lite198->MessageField = 31;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
} }
} }
void control::MaelstromPartSixController(int code, TPinballComponent* caller) void control::MaelstromPartSixController(MessageCode code, TPinballComponent* caller)
{ {
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite20->Message(MessageCode::TLightResetAndTurnOn, 0.0); lite20->Message(MessageCode::TLightResetAndTurnOn, 0.0);
lite19->Message(MessageCode::TLightResetAndTurnOn, 0.0); lite19->Message(MessageCode::TLightResetAndTurnOn, 0.0);
lite305->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite305->Message(MessageCode::TLightFlasherStartTimed, 0.0);
lite312->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite312->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -3473,19 +3473,19 @@ void control::MaelstromPartSixController(int code, TPinballComponent* caller)
lite305->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite305->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite312->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite312->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 30; lite198->MessageField = 30;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
lite20->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite20->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite19->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite19->Message(MessageCode::TLightResetAndTurnOff, 0.0);
} }
} }
void control::MaelstromPartThreeController(int code, TPinballComponent* caller) void control::MaelstromPartThreeController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite56->MessageField = 5; lite56->MessageField = 5;
lite301->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite301->Message(MessageCode::TLightFlasherStartTimed, 0.0);
@ -3495,7 +3495,7 @@ void control::MaelstromPartThreeController(int code, TPinballComponent* caller)
lite320->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite320->Message(MessageCode::TLightFlasherStartTimed, 0.0);
lite321->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite321->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -3518,7 +3518,7 @@ void control::MaelstromPartThreeController(int code, TPinballComponent* caller)
lite56->MessageField = lite56->MessageField - 1; lite56->MessageField = lite56->MessageField - 1;
if (lite56->MessageField) if (lite56->MessageField)
{ {
MissionControl(67, caller); MissionControl(MessageCode::ControlMissionStarted, caller);
} }
else else
{ {
@ -3529,18 +3529,18 @@ void control::MaelstromPartThreeController(int code, TPinballComponent* caller)
lite320->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite320->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite321->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite321->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 27; lite198->MessageField = 27;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
} }
} }
} }
void control::MaelstromPartTwoController(int code, TPinballComponent* caller) void control::MaelstromPartTwoController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite56->MessageField = 3; lite56->MessageField = 3;
lite306->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite306->Message(MessageCode::TLightFlasherStartTimed, 0.0);
@ -3549,7 +3549,7 @@ void control::MaelstromPartTwoController(int code, TPinballComponent* caller)
lite313->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite313->Message(MessageCode::TLightFlasherStartTimed, 0.0);
lite319->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite319->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -3574,7 +3574,7 @@ void control::MaelstromPartTwoController(int code, TPinballComponent* caller)
lite56->MessageField = lite56->MessageField - 1; lite56->MessageField = lite56->MessageField - 1;
if (lite56->MessageField) if (lite56->MessageField)
{ {
MissionControl(67, caller); MissionControl(MessageCode::ControlMissionStarted, caller);
} }
else else
{ {
@ -3584,24 +3584,24 @@ void control::MaelstromPartTwoController(int code, TPinballComponent* caller)
lite313->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite313->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite319->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite319->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 26; lite198->MessageField = 26;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
} }
} }
} }
void control::PracticeMissionController(int code, TPinballComponent* caller) void control::PracticeMissionController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite308->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite308->Message(MessageCode::TLightFlasherStartTimed, 0.0);
lite311->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite311->Message(MessageCode::TLightFlasherStartTimed, 0.0);
lite56->MessageField = 8; lite56->MessageField = 8;
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -3618,14 +3618,14 @@ void control::PracticeMissionController(int code, TPinballComponent* caller)
lite56->MessageField = lite56->MessageField - 1; lite56->MessageField = lite56->MessageField - 1;
if (lite56->MessageField) if (lite56->MessageField)
{ {
MissionControl(67, caller); MissionControl(MessageCode::ControlMissionStarted, caller);
} }
else else
{ {
lite308->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite308->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite311->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite311->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 1; lite198->MessageField = 1;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
mission_text_box->Display(pb::get_rc_string(Msg::STRING209), 4.0); mission_text_box->Display(pb::get_rc_string(Msg::STRING209), 4.0);
int addedScore = SpecialAddScore(500000); int addedScore = SpecialAddScore(500000);
snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore); snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore);
@ -3638,13 +3638,13 @@ void control::PracticeMissionController(int code, TPinballComponent* caller)
} }
} }
void control::ReconnaissanceController(int code, TPinballComponent* caller) void control::ReconnaissanceController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite56->MessageField = 15; lite56->MessageField = 15;
lite301->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite301->Message(MessageCode::TLightFlasherStartTimed, 0.0);
@ -3654,7 +3654,7 @@ void control::ReconnaissanceController(int code, TPinballComponent* caller)
lite320->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite320->Message(MessageCode::TLightFlasherStartTimed, 0.0);
lite321->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite321->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -3677,7 +3677,7 @@ void control::ReconnaissanceController(int code, TPinballComponent* caller)
lite56->MessageField = lite56->MessageField - 1; lite56->MessageField = lite56->MessageField - 1;
if (lite56->MessageField) if (lite56->MessageField)
{ {
MissionControl(67, nullptr); MissionControl(MessageCode::ControlMissionStarted, nullptr);
} }
else else
{ {
@ -3688,7 +3688,7 @@ void control::ReconnaissanceController(int code, TPinballComponent* caller)
lite320->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite320->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite321->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite321->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 1; lite198->MessageField = 1;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
mission_text_box->Display(pb::get_rc_string(Msg::STRING237), 4.0); mission_text_box->Display(pb::get_rc_string(Msg::STRING237), 4.0);
int addedScore = SpecialAddScore(1250000); int addedScore = SpecialAddScore(1250000);
snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore); snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore);
@ -3701,13 +3701,13 @@ void control::ReconnaissanceController(int code, TPinballComponent* caller)
} }
} }
void control::ReentryTrainingController(int code, TPinballComponent* caller) void control::ReentryTrainingController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite56->MessageField = 3; lite56->MessageField = 3;
l_trek_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0); l_trek_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0);
@ -3718,7 +3718,7 @@ void control::ReentryTrainingController(int code, TPinballComponent* caller)
r_trek_lights->Message(MessageCode::TLightGroupAnimationBackward, 0.2f); r_trek_lights->Message(MessageCode::TLightGroupAnimationBackward, 0.2f);
lite307->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite307->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -3733,13 +3733,13 @@ void control::ReentryTrainingController(int code, TPinballComponent* caller)
lite56->MessageField = lite56->MessageField - 1; lite56->MessageField = lite56->MessageField - 1;
if (lite56->MessageField) if (lite56->MessageField)
{ {
MissionControl(67, caller); MissionControl(MessageCode::ControlMissionStarted, caller);
} }
else else
{ {
lite307->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite307->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 1; lite198->MessageField = 1;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
mission_text_box->Display(pb::get_rc_string(Msg::STRING214), 4.0); mission_text_box->Display(pb::get_rc_string(Msg::STRING214), 4.0);
int addedScore = SpecialAddScore(500000); int addedScore = SpecialAddScore(500000);
snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore); snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore);
@ -3752,19 +3752,19 @@ void control::ReentryTrainingController(int code, TPinballComponent* caller)
} }
} }
void control::RescueMissionController(int code, TPinballComponent* caller) void control::RescueMissionController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
switch (code) switch (code)
{ {
case 63: case MessageCode::ControlCollision:
{ {
if (target1 == caller if (target1 == caller
|| target2 == caller || target2 == caller
|| target3 == caller) || target3 == caller)
{ {
MissionControl(67, caller); MissionControl(MessageCode::ControlMissionStarted, caller);
return; return;
} }
if (kickout2 != caller || !light_on(&control_lite20_tag)) if (kickout2 != caller || !light_on(&control_lite20_tag))
@ -3772,7 +3772,7 @@ void control::RescueMissionController(int code, TPinballComponent* caller)
lite56->MessageField = lite56->MessageField - 1; lite56->MessageField = lite56->MessageField - 1;
if (lite56->MessageField) if (lite56->MessageField)
{ {
MissionControl(67, caller); MissionControl(MessageCode::ControlMissionStarted, caller);
return; return;
} }
if (light_on(&control_lite303_tag)) if (light_on(&control_lite303_tag))
@ -3780,7 +3780,7 @@ void control::RescueMissionController(int code, TPinballComponent* caller)
if (light_on(&control_lite304_tag)) if (light_on(&control_lite304_tag))
lite304->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite304->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 1; lite198->MessageField = 1;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
mission_text_box->Display(pb::get_rc_string(Msg::STRING230), 4.0); mission_text_box->Display(pb::get_rc_string(Msg::STRING230), 4.0);
int addedScore = SpecialAddScore(750000); int addedScore = SpecialAddScore(750000);
snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore); snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore);
@ -3791,12 +3791,12 @@ void control::RescueMissionController(int code, TPinballComponent* caller)
} }
break; break;
} }
case 66: case MessageCode::ControlMissionComplete:
lite20->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite20->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite19->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite19->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite56->MessageField = 1; lite56->MessageField = 1;
break; break;
case 67: case MessageCode::ControlMissionStarted:
if (light_on(&control_lite20_tag)) if (light_on(&control_lite20_tag))
{ {
mission_text_box->Display(pb::get_rc_string(Msg::STRING229), -1.0); mission_text_box->Display(pb::get_rc_string(Msg::STRING229), -1.0);
@ -3823,18 +3823,18 @@ void control::RescueMissionController(int code, TPinballComponent* caller)
} }
} }
void control::SatelliteController(int code, TPinballComponent* caller) void control::SatelliteController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite56->MessageField = 3; lite56->MessageField = 3;
lite308->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite308->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -3847,13 +3847,13 @@ void control::SatelliteController(int code, TPinballComponent* caller)
lite56->MessageField = lite56->MessageField - 1; lite56->MessageField = lite56->MessageField - 1;
if (lite56->MessageField) if (lite56->MessageField)
{ {
MissionControl(67, caller); MissionControl(MessageCode::ControlMissionStarted, caller);
} }
else else
{ {
lite308->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite308->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 1; lite198->MessageField = 1;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
mission_text_box->Display(pb::get_rc_string(Msg::STRING234), 4.0); mission_text_box->Display(pb::get_rc_string(Msg::STRING234), 4.0);
int addedScore = SpecialAddScore(1250000); int addedScore = SpecialAddScore(1250000);
snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore); snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore);
@ -3866,13 +3866,13 @@ void control::SatelliteController(int code, TPinballComponent* caller)
} }
} }
void control::ScienceMissionController(int code, TPinballComponent* caller) void control::ScienceMissionController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite56->MessageField = 9; lite56->MessageField = 9;
target1->MessageField = 0; target1->MessageField = 0;
@ -3897,7 +3897,7 @@ void control::ScienceMissionController(int code, TPinballComponent* caller)
lite309->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite309->Message(MessageCode::TLightFlasherStartTimed, 0.0);
lite315->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite315->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -3918,7 +3918,7 @@ void control::ScienceMissionController(int code, TPinballComponent* caller)
lite56->MessageField = lite56->MessageField - 1; lite56->MessageField = lite56->MessageField - 1;
if (lite56->MessageField) if (lite56->MessageField)
{ {
MissionControl(67, caller); MissionControl(MessageCode::ControlMissionStarted, caller);
} }
else else
{ {
@ -3926,7 +3926,7 @@ void control::ScienceMissionController(int code, TPinballComponent* caller)
lite309->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite309->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite315->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite315->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 1; lite198->MessageField = 1;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
mission_text_box->Display(pb::get_rc_string(Msg::STRING216), 4.0); mission_text_box->Display(pb::get_rc_string(Msg::STRING216), 4.0);
int addedScore = SpecialAddScore(750000); int addedScore = SpecialAddScore(750000);
snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore); snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore);
@ -3939,20 +3939,20 @@ void control::ScienceMissionController(int code, TPinballComponent* caller)
} }
} }
void control::SecretMissionGreenController(int code, TPinballComponent* caller) void control::SecretMissionGreenController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite6->Message(MessageCode::TLightResetAndTurnOn, 0.0); lite6->Message(MessageCode::TLightResetAndTurnOn, 0.0);
lite2->Message(MessageCode::TLightSetOnStateBmpIndex, 1.0); lite2->Message(MessageCode::TLightSetOnStateBmpIndex, 1.0);
lite2->Message(MessageCode::TLightResetAndTurnOn, 0.0); lite2->Message(MessageCode::TLightResetAndTurnOn, 0.0);
lite2->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite2->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -3963,7 +3963,7 @@ void control::SecretMissionGreenController(int code, TPinballComponent* caller)
if (sink2 == caller) if (sink2 == caller)
{ {
lite198->MessageField = 1; lite198->MessageField = 1;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
mission_text_box->Display(pb::get_rc_string(Msg::STRING246), 4.0); mission_text_box->Display(pb::get_rc_string(Msg::STRING246), 4.0);
int addedScore = SpecialAddScore(1500000); int addedScore = SpecialAddScore(1500000);
snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore); snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore);
@ -3975,18 +3975,18 @@ void control::SecretMissionGreenController(int code, TPinballComponent* caller)
} }
} }
void control::SecretMissionRedController(int code, TPinballComponent* caller) void control::SecretMissionRedController(MessageCode code, TPinballComponent* caller)
{ {
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite5->Message(MessageCode::TLightResetAndTurnOn, 0.0); lite5->Message(MessageCode::TLightResetAndTurnOn, 0.0);
lite4->Message(MessageCode::TLightSetOnStateBmpIndex, 2.0); lite4->Message(MessageCode::TLightSetOnStateBmpIndex, 2.0);
lite4->Message(MessageCode::TLightResetAndTurnOn, 0.0); lite4->Message(MessageCode::TLightResetAndTurnOn, 0.0);
lite4->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite4->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -3996,15 +3996,15 @@ void control::SecretMissionRedController(int code, TPinballComponent* caller)
if (sink1 == caller) if (sink1 == caller)
{ {
lite198->MessageField = 23; lite198->MessageField = 23;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
} }
} }
void control::SecretMissionYellowController(int code, TPinballComponent* caller) void control::SecretMissionYellowController(MessageCode code, TPinballComponent* caller)
{ {
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
worm_hole_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0); worm_hole_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0);
bsink_arrow_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0); bsink_arrow_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0);
@ -4015,7 +4015,7 @@ void control::SecretMissionYellowController(int code, TPinballComponent* caller)
lite3->Message(MessageCode::TLightResetAndTurnOn, 0.0); lite3->Message(MessageCode::TLightResetAndTurnOn, 0.0);
lite3->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite3->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -4025,23 +4025,23 @@ void control::SecretMissionYellowController(int code, TPinballComponent* caller)
if (sink3 == caller) if (sink3 == caller)
{ {
lite198->MessageField = 22; lite198->MessageField = 22;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
} }
} }
void control::SelectMissionController(int code, TPinballComponent* caller) void control::SelectMissionController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
switch (code) switch (code)
{ {
case 45: case MessageCode::TLightGroupToggleSplitIndex:
case 47: case MessageCode::TLightGroupCountdownEnded:
if (fuel_bargraph != caller) if (fuel_bargraph != caller)
return; return;
MissionControl(67, caller); MissionControl(MessageCode::ControlMissionStarted, caller);
return; return;
case 63: case MessageCode::ControlCollision:
{ {
int missionLevel = 0; int missionLevel = 0;
if (target13 == caller) if (target13 == caller)
@ -4067,7 +4067,7 @@ void control::SelectMissionController(int code, TPinballComponent* caller)
lite319->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite319->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = lite56->MessageField; lite198->MessageField = lite56->MessageField;
auto scoreId = lite56->MessageField - 2; auto scoreId = lite56->MessageField - 2;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
int addedScore = SpecialAddScore(mission_select_scores[scoreId]); int addedScore = SpecialAddScore(mission_select_scores[scoreId]);
snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING178), addedScore); snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING178), addedScore);
mission_text_box->Display(Buffer, 4.0); mission_text_box->Display(Buffer, 4.0);
@ -4181,10 +4181,10 @@ void control::SelectMissionController(int code, TPinballComponent* caller)
lite56->MessageField = missionId; lite56->MessageField = missionId;
lite56->Message(MessageCode::TLightFlasherStartTimedThenStayOn, 2.0); lite56->Message(MessageCode::TLightFlasherStartTimedThenStayOn, 2.0);
lite198->Message(MessageCode::TLightFlasherStart, 0.0); lite198->Message(MessageCode::TLightFlasherStart, 0.0);
MissionControl(67, caller); MissionControl(MessageCode::ControlMissionStarted, caller);
return; return;
} }
case 66: case MessageCode::ControlMissionComplete:
midi::play_track(MidiTracks::Track1, false); midi::play_track(MidiTracks::Track1, false);
lite198->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite198->Message(MessageCode::TLightResetAndTurnOff, 0.0);
outer_circle->Message(MessageCode::TLightGroupReset, 0.0); outer_circle->Message(MessageCode::TLightGroupReset, 0.0);
@ -4199,7 +4199,7 @@ void control::SelectMissionController(int code, TPinballComponent* caller)
worm_hole_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0); worm_hole_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0);
bsink_arrow_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0); bsink_arrow_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0);
break; break;
case 67: case MessageCode::ControlMissionStarted:
break; break;
default: default:
return; return;
@ -4246,11 +4246,11 @@ void control::SelectMissionController(int code, TPinballComponent* caller)
} }
} }
void control::SpaceRadiationController(int code, TPinballComponent* caller) void control::SpaceRadiationController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (target16 == caller if (target16 == caller
|| target17 == caller || target17 == caller
@ -4261,7 +4261,7 @@ void control::SpaceRadiationController(int code, TPinballComponent* caller)
lite104->MessageField = 15; lite104->MessageField = 15;
bsink_arrow_lights->Message(MessageCode::TLightFlasherStartTimed, 0.0); bsink_arrow_lights->Message(MessageCode::TLightFlasherStartTimed, 0.0);
lite313->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite313->Message(MessageCode::TLightResetAndTurnOff, 0.0);
MissionControl(67, caller); MissionControl(MessageCode::ControlMissionStarted, caller);
AdvanceWormHoleDestination(1); AdvanceWormHoleDestination(1);
} }
} }
@ -4271,7 +4271,7 @@ void control::SpaceRadiationController(int code, TPinballComponent* caller)
&& lite104->MessageField == 15) && lite104->MessageField == 15)
{ {
lite198->MessageField = 1; lite198->MessageField = 1;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
mission_text_box->Display(pb::get_rc_string(Msg::STRING222), 4.0); mission_text_box->Display(pb::get_rc_string(Msg::STRING222), 4.0);
int addedScore = SpecialAddScore(1000000); int addedScore = SpecialAddScore(1000000);
snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore); snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore);
@ -4284,13 +4284,13 @@ void control::SpaceRadiationController(int code, TPinballComponent* caller)
} }
else else
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lchute_tgt_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0); lchute_tgt_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite104->MessageField = 0; lite104->MessageField = 0;
lite313->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite313->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code == 67) else if (code == MessageCode::ControlMissionStarted)
{ {
const char* text; const char* text;
if (lite104->MessageField == 15) if (lite104->MessageField == 15)
@ -4302,11 +4302,11 @@ void control::SpaceRadiationController(int code, TPinballComponent* caller)
} }
} }
void control::StrayCometController(int code, TPinballComponent* caller) void control::StrayCometController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code == 63) if (code == MessageCode::ControlCollision)
{ {
if (target19 == caller if (target19 == caller
|| target20 == caller || target20 == caller
@ -4317,14 +4317,14 @@ void control::StrayCometController(int code, TPinballComponent* caller)
lite306->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite306->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite304->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite304->Message(MessageCode::TLightFlasherStartTimed, 0.0);
lite107->MessageField = 15; lite107->MessageField = 15;
MissionControl(67, caller); MissionControl(MessageCode::ControlMissionStarted, caller);
} }
} }
else if (kickout2 == caller && lite107->MessageField == 15) else if (kickout2 == caller && lite107->MessageField == 15)
{ {
lite304->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite304->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 1; lite198->MessageField = 1;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
mission_text_box->Display(pb::get_rc_string(Msg::STRING220), 4.0); mission_text_box->Display(pb::get_rc_string(Msg::STRING220), 4.0);
int addedScore = SpecialAddScore(1000000); int addedScore = SpecialAddScore(1000000);
snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore); snprintf(Buffer, sizeof Buffer, pb::get_rc_string(Msg::STRING179), addedScore);
@ -4337,13 +4337,13 @@ void control::StrayCometController(int code, TPinballComponent* caller)
} }
else else
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
bpr_solotgt_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0); bpr_solotgt_lights->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite107->MessageField = 0; lite107->MessageField = 0;
lite306->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite306->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code == 67) else if (code == MessageCode::ControlMissionStarted)
{ {
const char* text; const char* text;
if (lite107->MessageField == 15) if (lite107->MessageField == 15)
@ -4355,19 +4355,19 @@ void control::StrayCometController(int code, TPinballComponent* caller)
} }
} }
void control::TimeWarpController(int code, TPinballComponent* caller) void control::TimeWarpController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite56->MessageField = 25; lite56->MessageField = 25;
lite300->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite300->Message(MessageCode::TLightFlasherStartTimed, 0.0);
lite322->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite322->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -4383,32 +4383,32 @@ void control::TimeWarpController(int code, TPinballComponent* caller)
lite56->MessageField = lite56->MessageField - 1; lite56->MessageField = lite56->MessageField - 1;
if (lite56->MessageField) if (lite56->MessageField)
{ {
MissionControl(67, caller); MissionControl(MessageCode::ControlMissionStarted, caller);
} }
else else
{ {
lite300->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite300->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite322->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite322->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 24; lite198->MessageField = 24;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
} }
} }
} }
void control::TimeWarpPartTwoController(int code, TPinballComponent* caller) void control::TimeWarpPartTwoController(MessageCode code, TPinballComponent* caller)
{ {
char Buffer[64]; char Buffer[64];
if (code != 63) if (code != MessageCode::ControlCollision)
{ {
if (code == 66) if (code == MessageCode::ControlMissionComplete)
{ {
lite55->Message(MessageCode::TLightFlasherStartTimed, -1.0); lite55->Message(MessageCode::TLightFlasherStartTimed, -1.0);
lite26->Message(MessageCode::TLightFlasherStartTimed, -1.0); lite26->Message(MessageCode::TLightFlasherStartTimed, -1.0);
lite304->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite304->Message(MessageCode::TLightFlasherStartTimed, 0.0);
lite317->Message(MessageCode::TLightFlasherStartTimed, 0.0); lite317->Message(MessageCode::TLightFlasherStartTimed, 0.0);
} }
else if (code != 67) else if (code != MessageCode::ControlMissionStarted)
{ {
return; return;
} }
@ -4449,33 +4449,33 @@ void control::TimeWarpPartTwoController(int code, TPinballComponent* caller)
lite304->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite304->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite317->Message(MessageCode::TLightResetAndTurnOff, 0.0); lite317->Message(MessageCode::TLightResetAndTurnOff, 0.0);
lite198->MessageField = 1; lite198->MessageField = 1;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
// SpecialAddScore sets the score dirty flag. So next tick it will be redrawn. // SpecialAddScore sets the score dirty flag. So next tick it will be redrawn.
} }
void control::UnselectMissionController(int code, TPinballComponent* caller) void control::UnselectMissionController(MessageCode code, TPinballComponent* caller)
{ {
lite198->MessageField = 1; lite198->MessageField = 1;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
} }
void control::WaitingDeploymentController(int code, TPinballComponent* caller) void control::WaitingDeploymentController(MessageCode code, TPinballComponent* caller)
{ {
switch (code) switch (code)
{ {
case 63: case MessageCode::ControlCollision:
if (oneway4 == caller || oneway10 == caller) if (oneway4 == caller || oneway10 == caller)
{ {
lite198->MessageField = 1; lite198->MessageField = 1;
MissionControl(66, nullptr); MissionControl(MessageCode::ControlMissionComplete, nullptr);
} }
break; break;
case 66: case MessageCode::ControlMissionComplete:
mission_text_box->Clear(); mission_text_box->Clear();
waiting_deployment_flag = 0; waiting_deployment_flag = 0;
midi::play_track(MidiTracks::Track1, false); midi::play_track(MidiTracks::Track1, false);
break; break;
case 67: case MessageCode::ControlMissionStarted:
mission_text_box->Display(pb::get_rc_string(Msg::STRING151), -1.0); mission_text_box->Display(pb::get_rc_string(Msg::STRING151), -1.0);
break; break;
default: default:

View file

@ -1,5 +1,6 @@
#pragma once #pragma once
enum class MessageCode;
class TSink; class TSink;
class TLight; class TLight;
class TSound; class TSound;
@ -48,7 +49,7 @@ struct component_tag : component_tag_base
struct component_control struct component_control
{ {
void (* ControlFunc)(int, TPinballComponent*); void (* ControlFunc)(MessageCode, TPinballComponent*);
unsigned int ScoreCount; unsigned int ScoreCount;
const int* Scores; const int* Scores;
}; };
@ -76,7 +77,7 @@ public:
static void make_links(TPinballTable* table); static void make_links(TPinballTable* table);
static void ClearLinks(); static void ClearLinks();
static TPinballComponent* make_component_link(component_tag_base& tag); static TPinballComponent* make_component_link(component_tag_base& tag);
static void handler(int code, TPinballComponent* cmp); static void handler(MessageCode code, TPinballComponent* cmp);
static void pbctrl_bdoor_controller(char key); static void pbctrl_bdoor_controller(char key);
static void table_add_extra_ball(float count); static void table_add_extra_ball(float count);
static void table_set_bonus_hold(); static void table_set_bonus_hold();
@ -92,100 +93,100 @@ public:
static int AddRankProgress(int rank); static int AddRankProgress(int rank);
static void AdvanceWormHoleDestination(int flag); static void AdvanceWormHoleDestination(int flag);
static void FlipperRebounderControl1(int code, TPinballComponent* caller); static void FlipperRebounderControl1(MessageCode code, TPinballComponent* caller);
static void FlipperRebounderControl2(int code, TPinballComponent* caller); static void FlipperRebounderControl2(MessageCode code, TPinballComponent* caller);
static void RebounderControl(int code, TPinballComponent* caller); static void RebounderControl(MessageCode code, TPinballComponent* caller);
static void BumperControl(int code, TPinballComponent* caller); static void BumperControl(MessageCode code, TPinballComponent* caller);
static void LeftKickerControl(int code, TPinballComponent* caller); static void LeftKickerControl(MessageCode code, TPinballComponent* caller);
static void RightKickerControl(int code, TPinballComponent* caller); static void RightKickerControl(MessageCode code, TPinballComponent* caller);
static void LeftKickerGateControl(int code, TPinballComponent* caller); static void LeftKickerGateControl(MessageCode code, TPinballComponent* caller);
static void RightKickerGateControl(int code, TPinballComponent* caller); static void RightKickerGateControl(MessageCode code, TPinballComponent* caller);
static void DeploymentChuteToEscapeChuteOneWayControl(int code, TPinballComponent* caller); static void DeploymentChuteToEscapeChuteOneWayControl(MessageCode code, TPinballComponent* caller);
static void DeploymentChuteToTableOneWayControl(int code, TPinballComponent* caller); static void DeploymentChuteToTableOneWayControl(MessageCode code, TPinballComponent* caller);
static void DrainBallBlockerControl(int code, TPinballComponent* caller); static void DrainBallBlockerControl(MessageCode code, TPinballComponent* caller);
static void LaunchRampControl(int code, TPinballComponent* caller); static void LaunchRampControl(MessageCode code, TPinballComponent* caller);
static void LaunchRampHoleControl(int code, TPinballComponent* caller); static void LaunchRampHoleControl(MessageCode code, TPinballComponent* caller);
static void SpaceWarpRolloverControl(int code, TPinballComponent* caller); static void SpaceWarpRolloverControl(MessageCode code, TPinballComponent* caller);
static void ReentryLanesRolloverControl(int code, TPinballComponent* caller); static void ReentryLanesRolloverControl(MessageCode code, TPinballComponent* caller);
static void BumperGroupControl(int code, TPinballComponent* caller); static void BumperGroupControl(MessageCode code, TPinballComponent* caller);
static void LaunchLanesRolloverControl(int code, TPinballComponent* caller); static void LaunchLanesRolloverControl(MessageCode code, TPinballComponent* caller);
static void OutLaneRolloverControl(int code, TPinballComponent* caller); static void OutLaneRolloverControl(MessageCode code, TPinballComponent* caller);
static void ExtraBallLightControl(int code, TPinballComponent* caller); static void ExtraBallLightControl(MessageCode code, TPinballComponent* caller);
static void ReturnLaneRolloverControl(int code, TPinballComponent* caller); static void ReturnLaneRolloverControl(MessageCode code, TPinballComponent* caller);
static void BonusLaneRolloverControl(int code, TPinballComponent* caller); static void BonusLaneRolloverControl(MessageCode code, TPinballComponent* caller);
static void FuelRollover1Control(int code, TPinballComponent* caller); static void FuelRollover1Control(MessageCode code, TPinballComponent* caller);
static void FuelRollover2Control(int code, TPinballComponent* caller); static void FuelRollover2Control(MessageCode code, TPinballComponent* caller);
static void FuelRollover3Control(int code, TPinballComponent* caller); static void FuelRollover3Control(MessageCode code, TPinballComponent* caller);
static void FuelRollover4Control(int code, TPinballComponent* caller); static void FuelRollover4Control(MessageCode code, TPinballComponent* caller);
static void FuelRollover5Control(int code, TPinballComponent* caller); static void FuelRollover5Control(MessageCode code, TPinballComponent* caller);
static void FuelRollover6Control(int code, TPinballComponent* caller); static void FuelRollover6Control(MessageCode code, TPinballComponent* caller);
static void HyperspaceLightGroupControl(int code, TPinballComponent* caller); static void HyperspaceLightGroupControl(MessageCode code, TPinballComponent* caller);
static void WormHoleControl(int code, TPinballComponent* caller); static void WormHoleControl(MessageCode code, TPinballComponent* caller);
static void LeftFlipperControl(int code, TPinballComponent* caller); static void LeftFlipperControl(MessageCode code, TPinballComponent* caller);
static void RightFlipperControl(int code, TPinballComponent* caller); static void RightFlipperControl(MessageCode code, TPinballComponent* caller);
static void JackpotLightControl(int code, TPinballComponent* caller); static void JackpotLightControl(MessageCode code, TPinballComponent* caller);
static void BonusLightControl(int code, TPinballComponent* caller); static void BonusLightControl(MessageCode code, TPinballComponent* caller);
static void BoosterTargetControl(int code, TPinballComponent* caller); static void BoosterTargetControl(MessageCode code, TPinballComponent* caller);
static void MedalLightGroupControl(int code, TPinballComponent* caller); static void MedalLightGroupControl(MessageCode code, TPinballComponent* caller);
static void MultiplierLightGroupControl(int code, TPinballComponent* caller); static void MultiplierLightGroupControl(MessageCode code, TPinballComponent* caller);
static void FuelSpotTargetControl(int code, TPinballComponent* caller); static void FuelSpotTargetControl(MessageCode code, TPinballComponent* caller);
static void MissionSpotTargetControl(int code, TPinballComponent* caller); static void MissionSpotTargetControl(MessageCode code, TPinballComponent* caller);
static void LeftHazardSpotTargetControl(int code, TPinballComponent* caller); static void LeftHazardSpotTargetControl(MessageCode code, TPinballComponent* caller);
static void RightHazardSpotTargetControl(int code, TPinballComponent* caller); static void RightHazardSpotTargetControl(MessageCode code, TPinballComponent* caller);
static void WormHoleDestinationControl(int code, TPinballComponent* caller); static void WormHoleDestinationControl(MessageCode code, TPinballComponent* caller);
static void BlackHoleKickoutControl(int code, TPinballComponent* caller); static void BlackHoleKickoutControl(MessageCode code, TPinballComponent* caller);
static void FlagControl(int code, TPinballComponent* caller); static void FlagControl(MessageCode code, TPinballComponent* caller);
static void GravityWellKickoutControl(int code, TPinballComponent* caller); static void GravityWellKickoutControl(MessageCode code, TPinballComponent* caller);
static void SkillShotGate1Control(int code, TPinballComponent* caller); static void SkillShotGate1Control(MessageCode code, TPinballComponent* caller);
static void SkillShotGate2Control(int code, TPinballComponent* caller); static void SkillShotGate2Control(MessageCode code, TPinballComponent* caller);
static void SkillShotGate3Control(int code, TPinballComponent* caller); static void SkillShotGate3Control(MessageCode code, TPinballComponent* caller);
static void SkillShotGate4Control(int code, TPinballComponent* caller); static void SkillShotGate4Control(MessageCode code, TPinballComponent* caller);
static void SkillShotGate5Control(int code, TPinballComponent* caller); static void SkillShotGate5Control(MessageCode code, TPinballComponent* caller);
static void SkillShotGate6Control(int code, TPinballComponent* caller); static void SkillShotGate6Control(MessageCode code, TPinballComponent* caller);
static void ShootAgainLightControl(int code, TPinballComponent* caller); static void ShootAgainLightControl(MessageCode code, TPinballComponent* caller);
static void EscapeChuteSinkControl(int code, TPinballComponent* caller); static void EscapeChuteSinkControl(MessageCode code, TPinballComponent* caller);
static void MissionControl(int code, TPinballComponent* caller); static void MissionControl(MessageCode code, TPinballComponent* caller);
static void HyperspaceKickOutControl(int code, TPinballComponent* caller); static void HyperspaceKickOutControl(MessageCode code, TPinballComponent* caller);
static void PlungerControl(int code, TPinballComponent* caller); static void PlungerControl(MessageCode code, TPinballComponent* caller);
static void MedalTargetControl(int code, TPinballComponent* caller); static void MedalTargetControl(MessageCode code, TPinballComponent* caller);
static void MultiplierTargetControl(int code, TPinballComponent* caller); static void MultiplierTargetControl(MessageCode code, TPinballComponent* caller);
static void BallDrainControl(int code, TPinballComponent* caller); static void BallDrainControl(MessageCode code, TPinballComponent* caller);
static void table_control_handler(int code); static void table_control_handler(MessageCode code);
static void AlienMenaceController(int code, TPinballComponent* caller); static void AlienMenaceController(MessageCode code, TPinballComponent* caller);
static void AlienMenacePartTwoController(int code, TPinballComponent* caller); static void AlienMenacePartTwoController(MessageCode code, TPinballComponent* caller);
static void BlackHoleThreatController(int code, TPinballComponent* caller); static void BlackHoleThreatController(MessageCode code, TPinballComponent* caller);
static void BugHuntController(int code, TPinballComponent* caller); static void BugHuntController(MessageCode code, TPinballComponent* caller);
static void CosmicPlagueController(int code, TPinballComponent* caller); static void CosmicPlagueController(MessageCode code, TPinballComponent* caller);
static void CosmicPlaguePartTwoController(int code, TPinballComponent* caller); static void CosmicPlaguePartTwoController(MessageCode code, TPinballComponent* caller);
static void DoomsdayMachineController(int code, TPinballComponent* caller); static void DoomsdayMachineController(MessageCode code, TPinballComponent* caller);
static void GameoverController(int code, TPinballComponent* caller); static void GameoverController(MessageCode code, TPinballComponent* caller);
static void LaunchTrainingController(int code, TPinballComponent* caller); static void LaunchTrainingController(MessageCode code, TPinballComponent* caller);
static void MaelstromController(int code, TPinballComponent* caller); static void MaelstromController(MessageCode code, TPinballComponent* caller);
static void MaelstromPartEightController(int code, TPinballComponent* caller); static void MaelstromPartEightController(MessageCode code, TPinballComponent* caller);
static void MaelstromPartFiveController(int code, TPinballComponent* caller); static void MaelstromPartFiveController(MessageCode code, TPinballComponent* caller);
static void MaelstromPartFourController(int code, TPinballComponent* caller); static void MaelstromPartFourController(MessageCode code, TPinballComponent* caller);
static void MaelstromPartSevenController(int code, TPinballComponent* caller); static void MaelstromPartSevenController(MessageCode code, TPinballComponent* caller);
static void MaelstromPartSixController(int code, TPinballComponent* caller); static void MaelstromPartSixController(MessageCode code, TPinballComponent* caller);
static void MaelstromPartThreeController(int code, TPinballComponent* caller); static void MaelstromPartThreeController(MessageCode code, TPinballComponent* caller);
static void MaelstromPartTwoController(int code, TPinballComponent* caller); static void MaelstromPartTwoController(MessageCode code, TPinballComponent* caller);
static void PracticeMissionController(int code, TPinballComponent* caller); static void PracticeMissionController(MessageCode code, TPinballComponent* caller);
static void ReconnaissanceController(int code, TPinballComponent* caller); static void ReconnaissanceController(MessageCode code, TPinballComponent* caller);
static void ReentryTrainingController(int code, TPinballComponent* caller); static void ReentryTrainingController(MessageCode code, TPinballComponent* caller);
static void RescueMissionController(int code, TPinballComponent* caller); static void RescueMissionController(MessageCode code, TPinballComponent* caller);
static void SatelliteController(int code, TPinballComponent* caller); static void SatelliteController(MessageCode code, TPinballComponent* caller);
static void ScienceMissionController(int code, TPinballComponent* caller); static void ScienceMissionController(MessageCode code, TPinballComponent* caller);
static void SecretMissionGreenController(int code, TPinballComponent* caller); static void SecretMissionGreenController(MessageCode code, TPinballComponent* caller);
static void SecretMissionRedController(int code, TPinballComponent* caller); static void SecretMissionRedController(MessageCode code, TPinballComponent* caller);
static void SecretMissionYellowController(int code, TPinballComponent* caller); static void SecretMissionYellowController(MessageCode code, TPinballComponent* caller);
static void SelectMissionController(int code, TPinballComponent* caller); static void SelectMissionController(MessageCode code, TPinballComponent* caller);
static void SpaceRadiationController(int code, TPinballComponent* caller); static void SpaceRadiationController(MessageCode code, TPinballComponent* caller);
static void StrayCometController(int code, TPinballComponent* caller); static void StrayCometController(MessageCode code, TPinballComponent* caller);
static void TimeWarpController(int code, TPinballComponent* caller); static void TimeWarpController(MessageCode code, TPinballComponent* caller);
static void TimeWarpPartTwoController(int code, TPinballComponent* caller); static void TimeWarpPartTwoController(MessageCode code, TPinballComponent* caller);
static void UnselectMissionController(int code, TPinballComponent* caller); static void UnselectMissionController(MessageCode code, TPinballComponent* caller);
static void WaitingDeploymentController(int code, TPinballComponent* caller); static void WaitingDeploymentController(MessageCode code, TPinballComponent* caller);
private: private:
static int extraball_light_flag; static int extraball_light_flag;
}; };