Permalink
Browse files

STARTREK: TUG3 (mission 2 finished)

  • Loading branch information...
Drenn1 authored and sev- committed Jun 14, 2018
1 parent 3d27a9a commit 6e322ebfc5279ee16076b07b82a1dc2c44122b26
@@ -99,10 +99,13 @@ struct AwayMission {
struct {
int16 missionScore; // 0x29
int16 field2b; // 0x2b
int16 field2d; // 0x2d;
int16 field2d; // 0x2d
bool engineerConscious; // 0x30
byte field35; // 0x35
bool gotWires; // 0x37
byte orbitalDecayCounter; // 0x3b
bool bridgeElasiDrewPhasers; // 0x3d
bool talkedToCereth; // 0x3e
bool gotJunkPile; // 0x3f
bool gotTransmogrifier; // 0x43
bool transporterRepaired; // 0x44
@@ -111,16 +114,27 @@ struct AwayMission {
bool bridgeForceFieldDown; // 0x47
bool savedPrisoners; // 0x48
bool haveBomb; // 0x49
bool field4a; // 0x4a
bool brigElasiPhasersOnKill; // 0x4a
byte field4b; // 0x4b
byte guard1Status; // 0x4c
byte guard2Status; // 0x4d
byte field4e; // 0x4e
bool crewmanKilled[4]; // 0x4f
byte crewmanKilled[4]; // 0x4f
byte bridgeElasi1Status; // 0x53
byte bridgeElasi2Status; // 0x54
byte bridgeElasi3Status; // 0x55
byte bridgeElasi4Status; // 0x56
bool brigForceFieldDown; // 0x58
byte field59; // 0x59
byte field5b; // 0x5b
bool elasiSurrendered; // 0x5c
byte kirkPhaserDrawn; // 0x5d

// 1: Decided to shoot them
// 2: Talked, and they surrendered immediately
// 3: They deorbited the ship (and perhps surrendered after)
byte bridgeWinMethod; // 0x5e

bool talkedToBrigCrewman; // 0x5f
} tug;
};
@@ -29,6 +29,7 @@ MODULE_OBJS = \
rooms/tug0.o \
rooms/tug1.o \
rooms/tug2.o \
rooms/tug3.o \



@@ -77,6 +77,10 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
_roomActionList = tug2ActionList;
_numRoomActions = sizeof(tug2ActionList) / sizeof(RoomAction);
}
else if (name == "TUG3") {
_roomActionList = tug3ActionList;
_numRoomActions = sizeof(tug3ActionList) / sizeof(RoomAction);
}
else {
warning("Room \"%s\" unimplemented", name.c_str());
_numRoomActions = 0;
@@ -672,6 +672,44 @@ class Room {
void tug2UseMTricorderOnOpenBrig();
void tug2UsePhaserAnywhere();

// TUG3
void tug3Tick1();
void tug3Tick40();
void tug3LookAnywhere();
void tug3ElasiSurrendered();
void tug3UsePhaserAnywhere();
void tug3ElasiDrawPhasers();
void tug3UseStunPhaserOnElasi1();
void tug3UseStunPhaserOnElasi2();
void tug3UseStunPhaserOnElasi3();
void tug3UseStunPhaserOnElasi4();
void tug3UseKillPhaserOnElasi1();
void tug3UseKillPhaserOnElasi2();
void tug3UseKillPhaserOnElasi3();
void tug3UseKillPhaserOnElasi4();
void tug3ElasiStunnedOrKilled();
void tug3TalkToElasi1();
void tug3Elasi1DrewPhaser();
void tug3Elasi1ShotConsole();
void tug3Elasi1DrewPhaser2();
void tug3Elasi1ShotConsoleAndSurrenders();
void tug3LookAtMccoy();
void tug3LookAtSpock();
void tug3LookAtRedshirt();
void tug3LookAtElasi1();
void tug3LookAtElasi2();
void tug3LookAtElasi3();
void tug3LookAtElasi4();
void tug3TalkToMccoy();
void tug3TalkToSpock();
void tug3TalkToRedshirt();
void tug3UseCommunicator();
void tug3Timer0Expired();
void tug3AllCrewmenDead();
void tug3Timer1Expired();
void tug3EndMission();
void tug3SecurityTeamBeamedIn();

private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
union {
@@ -732,7 +770,7 @@ class Room {
byte shootingObject; // 0x1ec1
byte shootingTarget;
bool elasiPhaserOnKill;
byte _1ec4; // 0x1ec4
byte shootKirkOverride; // 0x1ec4
} tug2;

} _roomVar;
@@ -650,7 +650,6 @@ RoomAction tug1ActionList[] = {
{ Action(ACTION_USE, OBJECT_IMEDKIT, 0x20, 0), &Room::tug1UseMedkitOnBridgeDoor },
{ Action(ACTION_USE, OBJECT_IMEDKIT, 0x21, 0), &Room::tug1UseMedkitOnBridgeDoor },
{ Action(ACTION_USE, OBJECT_IMEDKIT, 0x22, 0), &Room::tug1UseMedkitOnBridgeDoor },

};


@@ -745,6 +744,44 @@ RoomAction tug2ActionList[] = {
{ Action(ACTION_USE, OBJECT_IPHASERK, -1, 0), &Room::tug2UsePhaserAnywhere },
};


RoomAction tug3ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::tug3Tick1 },
{ Action(ACTION_TICK, 40, 0, 0), &Room::tug3Tick40 },
{ Action(ACTION_LOOK, -1, 0, 0), &Room::tug3LookAnywhere },
{ Action(ACTION_USE, OBJECT_IPHASERS, -1, 0), &Room::tug3UsePhaserAnywhere },
{ Action(ACTION_USE, OBJECT_IPHASERK, -1, 0), &Room::tug3UsePhaserAnywhere },
{ Action(ACTION_USE, OBJECT_IPHASERS, 8, 0), &Room::tug3UseStunPhaserOnElasi1 },
{ Action(ACTION_USE, OBJECT_IPHASERS, 9, 0), &Room::tug3UseStunPhaserOnElasi2 },
{ Action(ACTION_USE, OBJECT_IPHASERS, 10, 0), &Room::tug3UseStunPhaserOnElasi3 },
{ Action(ACTION_USE, OBJECT_IPHASERS, 11, 0), &Room::tug3UseStunPhaserOnElasi4 },
{ Action(ACTION_USE, OBJECT_IPHASERK, 8, 0), &Room::tug3UseKillPhaserOnElasi1 },
{ Action(ACTION_USE, OBJECT_IPHASERK, 9, 0), &Room::tug3UseKillPhaserOnElasi2 },
{ Action(ACTION_USE, OBJECT_IPHASERK, 10, 0), &Room::tug3UseKillPhaserOnElasi3 },
{ Action(ACTION_USE, OBJECT_IPHASERK, 11, 0), &Room::tug3UseKillPhaserOnElasi4 },
{ Action(ACTION_FINISHED_ANIMATION, 12, 0, 0), &Room::tug3ElasiStunnedOrKilled },
{ Action(ACTION_TALK, 8, 0, 0), &Room::tug3TalkToElasi1 },
{ Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::tug3Elasi1DrewPhaser },
{ Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::tug3Elasi1ShotConsole },
{ Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::tug3Elasi1DrewPhaser2 },
{ Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::tug3Elasi1ShotConsoleAndSurrenders },
{ Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::tug3LookAtMccoy },
{ Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::tug3LookAtSpock },
{ Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::tug3LookAtRedshirt },
{ Action(ACTION_LOOK, 8, 0, 0), &Room::tug3LookAtElasi1 },
{ Action(ACTION_LOOK, 9, 0, 0), &Room::tug3LookAtElasi2 },
{ Action(ACTION_LOOK, 10, 0, 0), &Room::tug3LookAtElasi3 },
{ Action(ACTION_LOOK, 11, 0, 0), &Room::tug3LookAtElasi4 },
{ Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::tug3TalkToMccoy },
{ Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::tug3TalkToSpock },
{ Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::tug3TalkToRedshirt },
{ Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::tug3UseCommunicator },
{ Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::tug3Timer0Expired },
{ Action(ACTION_FINISHED_ANIMATION, 13, 0, 0), &Room::tug3AllCrewmenDead },
{ Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::tug3Timer1Expired },
{ Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::tug3SecurityTeamBeamedIn },
};

}

#endif
@@ -142,14 +142,19 @@ void Room::tug0SpockFinishedUsingWire() {

showText(TX_SPEAKER_KIRK, TX_TUG0_010);
showText(TX_SPEAKER_MCCOY, TX_TUG0_022);
showText(TX_SPEAKER_KIRK, TX_TUG0_002);
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L009);
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L008);

if (_vm->_awayMission.tug.haveBomb) {
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L010);
showText(TX_SPEAKER_MCCOY, TX_TUG0_021);
showText(TX_SPEAKER_SPOCK, TX_TUG0_041);

// BUGFIX: check if the redshirt is dead.
if (!_vm->_awayMission.redshirtDead) {
showText(TX_SPEAKER_KIRK, TX_TUG0_002);

showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L009);
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L008);

if (_vm->_awayMission.tug.haveBomb) {
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L010);
showText(TX_SPEAKER_MCCOY, TX_TUG0_021);
showText(TX_SPEAKER_SPOCK, TX_TUG0_041);
}
}
}

@@ -481,7 +481,7 @@ void Room::tug2UseKillPhaserOnGuard1() {
else {
loadActorAnim2(OBJECT_KIRK, "kdrawe", -1, -1, 24);
_vm->_awayMission.tug.kirkPhaserDrawn = true;
_vm->_awayMission.tug.field4a = true;
_vm->_awayMission.tug.brigElasiPhasersOnKill = true;
}
}
}
@@ -509,7 +509,7 @@ void Room::tug2UseKillPhaserOnGuard2() {
else {
loadActorAnim2(OBJECT_KIRK, "kdrawe", -1, -1, 25);
_vm->_awayMission.tug.kirkPhaserDrawn = true;
_vm->_awayMission.tug.field4a = true;
_vm->_awayMission.tug.brigElasiPhasersOnKill = true;
}
}
}
@@ -624,7 +624,7 @@ void Room::tug2Timer0Expired() {
return;

_roomVar.tug2.elasiPhaserOnKill = 0;
if (_vm->_awayMission.tug.field4a)
if (_vm->_awayMission.tug.brigElasiPhasersOnKill)
_roomVar.tug2.elasiPhaserOnKill = 1;

switch (_vm->_awayMission.tug.field4b) {
@@ -659,14 +659,14 @@ void Room::tug2Timer0Expired() {
case 2:
// Guard shoots spock (or kirk)
_vm->_awayMission.tug.field4b++;
_roomVar.tug2._1ec4 = 0;
if (_vm->_awayMission.tug.field4a)
_roomVar.tug2._1ec4 = 1;
_roomVar.tug2.shootKirkOverride = false;
if (_vm->_awayMission.tug.brigElasiPhasersOnKill)
_roomVar.tug2.shootKirkOverride = true;
tug2DetermineElasiShooter();
if (_roomVar.tug2._1ec4 == 0)
_roomVar.tug2.shootingTarget = OBJECT_SPOCK;
else
if (_roomVar.tug2.shootKirkOverride)
_roomVar.tug2.shootingTarget = OBJECT_KIRK;
else
_roomVar.tug2.shootingTarget = OBJECT_SPOCK;
_vm->_awayMission.timers[0] = 60;
tug2GuardShootsCrewman();
break;
@@ -683,16 +683,16 @@ void Room::tug2Timer0Expired() {

case 4:
_vm->_awayMission.tug.field4b++;
if (_roomVar.tug2._1ec4 == 0) {
if (_roomVar.tug2.shootKirkOverride) {
tug2DetermineElasiShooter();
_roomVar.tug2.shootingTarget = OBJECT_KIRK;
_vm->_awayMission.timers[2] = 40; // TODO
_roomVar.tug2.shootingTarget = OBJECT_SPOCK;
_vm->_awayMission.timers[2] = 40;
tug2GuardShootsCrewman();
}
else if (_roomVar.tug2._1ec4 == 1) {
else if (_roomVar.tug2.shootKirkOverride) {
tug2DetermineElasiShooter();
_roomVar.tug2.shootingTarget = OBJECT_SPOCK;
_vm->_awayMission.timers[2] = 40;
_roomVar.tug2.shootingTarget = OBJECT_KIRK;
_vm->_awayMission.timers[2] = 40; // TODO
tug2GuardShootsCrewman();
}
break;
Oops, something went wrong.

0 comments on commit 6e322eb

Please sign in to comment.