Permalink
Browse files

STARTREK: Implement synthesizer + bugfixes (LOVE)

  • Loading branch information...
Drenn1 authored and sev- committed Jun 24, 2018
1 parent 958a906 commit d8e255e9e7fcd1b91f85ea0a14596d679542fae6
@@ -54,6 +54,8 @@ struct Action : Common::Serializable {
byte b2;
byte b3;

// Only used with ACTION_CALLBACK.
// TODO: Fix serialization. Can this even be serialized?
void (Room::*roomFuncPtr)();

Action() {}
@@ -200,4 +200,13 @@ enum CanisterTypes {
CANTYPE_N2 = 3
};

// Synthesizer contents for Love's Labor Jeopardized (values for field35)
enum SynthesizerContent {
SYNTHITEM_NONE = 0,
SYNTHITEM_PBC = 1,
SYNTHITEM_VIRUS_SAMPLE = 2,
SYNTHITEM_CURE_SAMPLE = 3,
SYNTHITEM_BOTTLE = 9 // Contents of bottle determined by "synthesizerProduct" variable
};

#endif
@@ -903,19 +903,22 @@ class Room {
void love2UseSynthesizer();
void love2SynthesizerDoorClosed();
void love2SynthesizerFinished();
void love2FinishedAnimation27();
void love2ClosedSynthesizerDoorMakingRLG();
void love2ClosedSynthesizerDoorMakingCure();
void love2CureStartedSynthesizing();
void love2CureSynthesized();
void love2UsePolyberylcarbonateOnSynthesizerDoor();
void love2KirkReachedSynthesizerWithPolyberylcarbonate();
void love2SynthesizerDoorOpenedWithPolyberylcarbonate();
void love2PutPolyberylcarbonateInSynthesizer();
void love2UseDishesOnSynthesizerDoor();
void love2KirkReachedSynthesizerWithDishes();
void love2SynthesizerDoorOpenedWithDishes();
void love2PutDishesInSynthesizer();
void love2UseSampleOnSynthesizerDoor();
void love2KirkReachedSynthesizerWithSample();
void love2SynthesizerDoorOpenedWithSample();
void love2PutSampleInSynthesizer();
void love2UseVirusSampleOnSynthesizerDoor();
void love2KirkReachedSynthesizerWithVirusSample();
void love2SynthesizerDoorOpenedWithVirusSample();
void love2PutVirusSampleInSynthesizer();
void love2UseCureSampleOnSynthesizerDoor();
void love2KirkReachedSynthesizerWithCureSample();
void love2SynthesizerDoorOpenedWithCureSample();
void love2PutCureSampleInSynthesizer();
void love2UseAnythingOnSynthesizerDoor();
void love2UseAnythingOnSynthesizer();
void love2GetCanister();
@@ -1009,24 +1009,24 @@ RoomAction love2ActionList[] = {
{ Action(ACTION_FINISHED_ANIMATION, 18, 0, 0), &Room::love2SpockEnabledGasFeeds },
{ Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::love2SynthesizerDoorClosed },
{ Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::love2SynthesizerFinished },
{ Action(ACTION_FINISHED_ANIMATION, 27, 0, 0), &Room::love2FinishedAnimation27 },

// TODO: more

{ Action(ACTION_FINISHED_ANIMATION, 27, 0, 0), &Room::love2ClosedSynthesizerDoorMakingRLG },
{ Action(ACTION_FINISHED_ANIMATION, 8, 0, 0), &Room::love2ClosedSynthesizerDoorMakingCure },
{ Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::love2CureStartedSynthesizing },
{ Action(ACTION_FINISHED_ANIMATION, 10, 0, 0), &Room::love2CureSynthesized },
{ Action(ACTION_USE, OBJECT_IPBC, 9, 0), &Room::love2UsePolyberylcarbonateOnSynthesizerDoor },
{ Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::love2KirkReachedSynthesizerWithPolyberylcarbonate },
{ Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::love2SynthesizerDoorOpenedWithPolyberylcarbonate },
{ Action(ACTION_FINISHED_ANIMATION, 19, 0, 0), &Room::love2PutPolyberylcarbonateInSynthesizer },

{ Action(ACTION_USE, OBJECT_IDISHES, 9, 0), &Room::love2UseDishesOnSynthesizerDoor },
{ Action(ACTION_FINISHED_WALKING, 7, 0, 0), &Room::love2KirkReachedSynthesizerWithDishes },
{ Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::love2SynthesizerDoorOpenedWithDishes },
{ Action(ACTION_FINISHED_ANIMATION, 20, 0, 0), &Room::love2PutDishesInSynthesizer },
{ Action(ACTION_USE, OBJECT_IDISHES, 9, 0), &Room::love2UseVirusSampleOnSynthesizerDoor },
{ Action(ACTION_FINISHED_WALKING, 7, 0, 0), &Room::love2KirkReachedSynthesizerWithVirusSample },
{ Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::love2SynthesizerDoorOpenedWithVirusSample },
{ Action(ACTION_FINISHED_ANIMATION, 20, 0, 0), &Room::love2PutVirusSampleInSynthesizer },

{ Action(ACTION_USE, OBJECT_ISAMPLE, 9, 0), &Room::love2UseSampleOnSynthesizerDoor },
{ Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::love2KirkReachedSynthesizerWithSample },
{ Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::love2SynthesizerDoorOpenedWithSample },
{ Action(ACTION_FINISHED_ANIMATION, 21, 0, 0), &Room::love2PutSampleInSynthesizer },
{ Action(ACTION_USE, OBJECT_ISAMPLE, 9, 0), &Room::love2UseCureSampleOnSynthesizerDoor },
{ Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::love2KirkReachedSynthesizerWithCureSample },
{ Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::love2SynthesizerDoorOpenedWithCureSample },
{ Action(ACTION_FINISHED_ANIMATION, 21, 0, 0), &Room::love2PutCureSampleInSynthesizer },

{ Action(ACTION_USE, -1, 9, 0), &Room::love2UseAnythingOnSynthesizerDoor },
{ Action(ACTION_USE, -1, 0x20, 0), &Room::love2UseAnythingOnSynthesizer },
@@ -307,8 +307,11 @@ void Room::love1KirkGotCureSample() {
if (_vm->_awayMission.love.chamberHasCure) {
giveItem(OBJECT_ISAMPLE);
showText(TX_LOV1N035);
}
else {

// BUGFIX: after removing the cure, unset this variable.
// Otherwise, any normal dish inserted afterward automagically becomes a cure.
_vm->_awayMission.love.chamberHasCure = false;
} else {
giveItem(OBJECT_IDISHES);
showText(TX_LOV1N006);
}
@@ -420,12 +423,10 @@ void Room::love1MccoyReachedReplicator() {
if (_vm->_awayMission.love.bottleInNozzle == BOTTLETYPE_NONE) {
showText(TX_SPEAKER_MCCOY, TX_LOV1_021);
walkCrewman(OBJECT_MCCOY, 0xbf, 0x98, 0);
}
else if (!_vm->_awayMission.love.chamberHasDish) {
} else if (!_vm->_awayMission.love.chamberHasDish) {
showText(TX_SPEAKER_MCCOY, TX_LOV1_015);
walkCrewman(OBJECT_MCCOY, 0xbf, 0x98, 0);
}
else
} else
loadActorAnim2(OBJECT_MCCOY, "musehn", -1, -1, 13);
}

@@ -435,8 +436,7 @@ void Room::love1MccoyUsedReplicator() {
loadActorAnim2(OBJECT_CHAMBER, "s3r2d6", 0xb4, 0x75, 7);
playSoundEffectIndex(SND_DOOR1);
walkCrewman(OBJECT_MCCOY, 0xbf, 0x98, 0);
}
else {
} else {
showText(TX_SPEAKER_MCCOY, TX_LOV1_019);
walkCrewman(OBJECT_MCCOY, 0xbf, 0x98, 0);
}
@@ -641,8 +641,7 @@ void Room::love1CrewmanDiedFromPhaser() {
_vm->_awayMission.disableInput = false;
showText(TX_SPEAKER_FERRIS, TX_LOV1_024);
_vm->_awayMission.redshirtDead = true;
}
else {
} else {
showText(_roomVar.love1.dyingSpeaker, TX_LOV1_025);
showGameOverMenu();
}
Oops, something went wrong.

0 comments on commit d8e255e

Please sign in to comment.