diff options
author | Matthew Stewart | 2018-07-24 21:33:37 -0400 |
---|---|---|
committer | Eugene Sandulenko | 2018-08-09 08:37:30 +0200 |
commit | b8c244da875f676dcc401ecff1e165baeb2d4ab7 (patch) | |
tree | 882bd452ae766739a4118fd7ad29c55ac15e69ba | |
parent | fe98dbb69d1f8222eeb391111f59670658b0daad (diff) | |
download | scummvm-rg350-b8c244da875f676dcc401ecff1e165baeb2d4ab7.tar.gz scummvm-rg350-b8c244da875f676dcc401ecff1e165baeb2d4ab7.tar.bz2 scummvm-rg350-b8c244da875f676dcc401ecff1e165baeb2d4ab7.zip |
STARTREK: Clean up room-specific vars in mission 1
-rw-r--r-- | engines/startrek/room.h | 31 | ||||
-rw-r--r-- | engines/startrek/rooms/demon0.cpp | 12 | ||||
-rw-r--r-- | engines/startrek/rooms/demon1.cpp | 102 | ||||
-rw-r--r-- | engines/startrek/rooms/demon3.cpp | 86 | ||||
-rw-r--r-- | engines/startrek/rooms/demon4.cpp | 40 | ||||
-rw-r--r-- | engines/startrek/rooms/demon5.cpp | 60 | ||||
-rw-r--r-- | engines/startrek/rooms/demon6.cpp | 20 |
7 files changed, 177 insertions, 174 deletions
diff --git a/engines/startrek/room.h b/engines/startrek/room.h index 484613ad88..5fd9826b6a 100644 --- a/engines/startrek/room.h +++ b/engines/startrek/room.h @@ -2140,13 +2140,20 @@ private: // Room-specific variables. This is memset'ed to 0 when the room is initialized. union { struct { + // demon0 + byte bottomDoorCounter; // 0xca + byte topDoorCounter; // 0xcb + bool movingToTopDoor; // 0xcc + bool movingToBottomDoor; // 0xcd + + // demon1 + bool klingonShot[3]; // 0xca int numKlingonsKilled; byte attackIndex; bool kirkShooting; char d6[10]; - } demon1; - struct { + // demon3 bool shootingBoulder; // 0xca bool boulder1Shot; // 0xcb byte boulderBeingShot; // 0xcc @@ -2158,18 +2165,16 @@ private: bool kirkPhaserOut; // 0xd3 char boulderAnim[10]; // 0xd4 int16 usedPhaserOnDoor; // 0xd6 - } demon3; - struct { + // demon4 bool triedToShootNauian; // 0xca bool nauianEmerged; // 0xcb bool disabledSecurity; // 0xcc bool cd; // 0xcd byte crewReadyToBeamOut; // 0xce int16 crewmanUsingPanel; // 0xcf - } demon4; - struct { + // demon5 bool scannedRoberts; // 0xca bool scannedChub; // 0xcb bool scannedGrisnash; // 0xcc @@ -2180,17 +2185,16 @@ private: bool talkedToChub; // 0xd1 bool talkedToGrisnash; // 0xd2 bool talkedToStephen; // 0xd3 - byte doorCounter; // 0xd4 - bool movingToDoor; // 0xd5 - } demon5; - struct { + // demon6 bool insultedStephenRecently; // 0xca bool stephenInRoom; // 0xcb bool caseOpened; // 0xcd - byte doorCounter; // 0xce - bool movingToDoor; // 0xcf - } demon6; + + // common + bool movingToDoor; + byte doorCounter; + } demon; struct { byte shootingObject; // 0x1ec1 @@ -2199,7 +2203,6 @@ private: byte shootKirkOverride; // 0x1ec4 } tug2; - struct { // love0 bool heardSummaryOfVirus; // 0xda diff --git a/engines/startrek/rooms/demon0.cpp b/engines/startrek/rooms/demon0.cpp index e16e88427c..189509a3cf 100644 --- a/engines/startrek/rooms/demon0.cpp +++ b/engines/startrek/rooms/demon0.cpp @@ -65,40 +65,40 @@ void Room::demon0TouchedWarp0() { void Room::demon0WalkToBottomDoor() { _vm->_awayMission.disableInput = 1; - _rdfData[0xcd] = 1; // FIXME + _roomVar.demon.movingToBottomDoor = true; _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E; walkCrewman(OBJECT_KIRK, 243, 158, 1); } void Room::demon0TouchedHotspot1() { - if (_rdfData[0xcd] != 1) // FIXME: not portable to mac/amiga? + if (!_roomVar.demon.movingToBottomDoor) return; loadActorAnim2(9, "s0r0d1", 254, 153, 1); playSoundEffectIndex(0x05); } void Room::demon0ReachedBottomDoor() { - if (++_rdfData[0xca] != 2) // FIXME + if (++_roomVar.demon.bottomDoorCounter != 2) return; loadRoomIndex(5, 0); } void Room::demon0WalkToTopDoor() { _vm->_awayMission.disableInput = 1; - _rdfData[0xcc] = 1; // FIXME + _roomVar.demon.movingToTopDoor = true; _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E; walkCrewman(OBJECT_KIRK, 157, 134, 2); } void Room::demon0TouchedHotspot0() { - if (_rdfData[0xcc] != 1) // FIXME: not portable to mac/amiga? + if (!_roomVar.demon.movingToTopDoor) return; loadActorAnim2(10, "s0r0d2", 158, 130, 2); playSoundEffectIndex(0x05); } void Room::demon0ReachedTopDoor() { - if (++_rdfData[0xcb] != 2) // FIXME + if (++_roomVar.demon.topDoorCounter != 2) return; loadRoomIndex(6, 3); } diff --git a/engines/startrek/rooms/demon1.cpp b/engines/startrek/rooms/demon1.cpp index a30b5cc9ea..c1519b79a2 100644 --- a/engines/startrek/rooms/demon1.cpp +++ b/engines/startrek/rooms/demon1.cpp @@ -54,15 +54,15 @@ void Room::demon1Tick1() { loadActorAnim(9, "klg2d2", 0xaa, 0x7c, 0); loadActorAnim(10, "klg3d2", 0, 0, 0); - _rdfData[0xca] = 1; // FIXME - _rdfData[0xcb] = 1; - _rdfData[0xcc] = 1; - _roomVar.demon1.numKlingonsKilled = 3; + _roomVar.demon.klingonShot[0] = true; + _roomVar.demon.klingonShot[1] = true; + _roomVar.demon.klingonShot[2] = true; + _roomVar.demon.numKlingonsKilled = 3; } } void Room::demon1WalkToCave() { - if (_roomVar.demon1.numKlingonsKilled != 3) + if (_roomVar.demon.numKlingonsKilled != 3) return; walkCrewman(OBJECT_KIRK, 0xa3, 0x56, 2); } @@ -103,42 +103,42 @@ void Room::demon1Timer1Expired() { int shooter; Common::String anim; - if (_rdfData[0xca] != 1) { + if (!_roomVar.demon.klingonShot[0]) { anim = "klg1f"; shooter = 8; - switch (_roomVar.demon1.attackIndex) { + switch (_roomVar.demon.attackIndex) { case 0: - strcpy(_roomVar.demon1.d6, "klg1fr"); + strcpy(_roomVar.demon.d6, "klg1fr"); break; case 1: - strcpy(_roomVar.demon1.d6, "klg1fm"); + strcpy(_roomVar.demon.d6, "klg1fm"); break; case 2: - strcpy(_roomVar.demon1.d6, "klg1fs"); + strcpy(_roomVar.demon.d6, "klg1fs"); break; case 3: - strcpy(_roomVar.demon1.d6, "klg1fk"); + strcpy(_roomVar.demon.d6, "klg1fk"); break; default: // TODO return; } - } else if (_rdfData[0xcb] != 1) { + } else if (!_roomVar.demon.klingonShot[1]) { anim = "klg2f"; shooter = 9; - switch (_roomVar.demon1.attackIndex) { + switch (_roomVar.demon.attackIndex) { case 0: - strcpy(_roomVar.demon1.d6, "klg2fr"); + strcpy(_roomVar.demon.d6, "klg2fr"); break; case 1: - strcpy(_roomVar.demon1.d6, "klg2fm"); + strcpy(_roomVar.demon.d6, "klg2fm"); break; case 2: - strcpy(_roomVar.demon1.d6, "klg2fs"); + strcpy(_roomVar.demon.d6, "klg2fs"); break; case 3: - strcpy(_roomVar.demon1.d6, "klg2fk"); + strcpy(_roomVar.demon.d6, "klg2fk"); break; default: // TODO @@ -147,18 +147,18 @@ void Room::demon1Timer1Expired() { } else { anim = "klg3f"; shooter = 10; - switch (_roomVar.demon1.attackIndex) { + switch (_roomVar.demon.attackIndex) { case 0: - strcpy(_roomVar.demon1.d6, "klg3fr"); + strcpy(_roomVar.demon.d6, "klg3fr"); break; case 1: - strcpy(_roomVar.demon1.d6, "klg3fm"); + strcpy(_roomVar.demon.d6, "klg3fm"); break; case 2: - strcpy(_roomVar.demon1.d6, "klg3fs"); + strcpy(_roomVar.demon.d6, "klg3fs"); break; case 3: - strcpy(_roomVar.demon1.d6, "klg3fk"); + strcpy(_roomVar.demon.d6, "klg3fk"); break; default: // TODO @@ -170,21 +170,21 @@ void Room::demon1Timer1Expired() { } void Room::demon1KlingonFinishedAimingWeapon() { - loadActorAnim(11, _roomVar.demon1.d6, 0, 0, 0); + loadActorAnim(11, _roomVar.demon.d6, 0, 0, 0); playSoundEffectIndex(0x06); - _roomVar.demon1.attackIndex++; + _roomVar.demon.attackIndex++; int crewman; - if (_roomVar.demon1.attackIndex == 1) { + if (_roomVar.demon.attackIndex == 1) { loadActorAnim2(OBJECT_REDSHIRT, "rstunn", -1, -1, 0); crewman = OBJECT_REDSHIRT; - } else if (_roomVar.demon1.attackIndex == 2) { + } else if (_roomVar.demon.attackIndex == 2) { loadActorAnim2(OBJECT_SPOCK, "sstunn", -1, -1, 0); crewman = OBJECT_SPOCK; - } else if (_roomVar.demon1.attackIndex == 3) { + } else if (_roomVar.demon.attackIndex == 3) { loadActorAnim2(OBJECT_MCCOY, "mstune", -1, -1, 0); crewman = OBJECT_MCCOY; - } else if (_roomVar.demon1.attackIndex == 4) { + } else if (_roomVar.demon.attackIndex == 4) { loadActorAnim2(OBJECT_KIRK, "kstunn", -1, -1, 1); crewman = OBJECT_KIRK; } @@ -202,27 +202,27 @@ void Room::demon1KirkShot() { } void Room::demon1UsePhaserOnAnything() { - if (_roomVar.demon1.numKlingonsKilled == 3) + if (_roomVar.demon.numKlingonsKilled == 3) showText(TX_SPEAKER_MCCOY, TX_DEM1_011); } void Room::demon1UsePhaserOnKlingon1() { - if (_rdfData[0xca] != 0) + if (_roomVar.demon.klingonShot[0]) return; _vm->_awayMission.disableInput = 1; - _rdfData[0xca] = 1; + _roomVar.demon.klingonShot[0] = true; - if (_roomVar.demon1.kirkShooting) { + if (_roomVar.demon.kirkShooting) { demon1ShootKlingon1(); } else { loadActorAnim2(OBJECT_KIRK, "kfiren", -1, -1, 3); - _roomVar.demon1.kirkShooting = true; + _roomVar.demon.kirkShooting = true; } } void Room::demon1ShootKlingon1() { - _roomVar.demon1.numKlingonsKilled++; - if (_roomVar.demon1.numKlingonsKilled == 3) { + _roomVar.demon.numKlingonsKilled++; + if (_roomVar.demon.numKlingonsKilled == 3) { _vm->_awayMission.timers[1] = 0; _vm->_awayMission.timers[5] = 180; _vm->_awayMission.timers[6] = 1; @@ -246,7 +246,7 @@ void Room::demon1KlingonDropsHand() { showText(TX_SPEAKER_EVERTS, TX_DEM1_025); - if (_roomVar.demon1.numKlingonsKilled == 3) + if (_roomVar.demon.numKlingonsKilled == 3) return; showText(TX_SPEAKER_KLINGON, TX_DEM1_F23); @@ -255,22 +255,22 @@ void Room::demon1KlingonDropsHand() { } void Room::demon1UsePhaserOnKlingon2() { - if (_rdfData[0xcb] != 0) + if (_roomVar.demon.klingonShot[1]) return; _vm->_awayMission.disableInput = 1; - _rdfData[0xcb] = 1; + _roomVar.demon.klingonShot[1] = true; - if (_roomVar.demon1.kirkShooting) { + if (_roomVar.demon.kirkShooting) { demon1ShootKlingon2(); } else { loadActorAnim2(OBJECT_KIRK, "kfiren", -1, -1, 4); - _roomVar.demon1.kirkShooting = true; + _roomVar.demon.kirkShooting = true; } } void Room::demon1ShootKlingon2() { - _roomVar.demon1.numKlingonsKilled++; - if (_roomVar.demon1.numKlingonsKilled == 3) { + _roomVar.demon.numKlingonsKilled++; + if (_roomVar.demon.numKlingonsKilled == 3) { _vm->_awayMission.timers[1] = 0; _vm->_awayMission.timers[5] = 180; _vm->_awayMission.timers[6] = 1; @@ -284,22 +284,22 @@ void Room::demon1ShootKlingon2() { } void Room::demon1UsePhaserOnKlingon3() { - if (_rdfData[0xcc] != 0) + if (_roomVar.demon.klingonShot[2]) return; _vm->_awayMission.disableInput = 1; - _rdfData[0xcc] = 1; + _roomVar.demon.klingonShot[2] = true; - if (_roomVar.demon1.kirkShooting) { + if (_roomVar.demon.kirkShooting) { demon1ShootKlingon3(); } else { loadActorAnim2(OBJECT_KIRK, "kfiren", -1, -1, 5); - _roomVar.demon1.kirkShooting = true; + _roomVar.demon.kirkShooting = true; } } void Room::demon1ShootKlingon3() { - _roomVar.demon1.numKlingonsKilled++; - if (_roomVar.demon1.numKlingonsKilled == 3) { + _roomVar.demon.numKlingonsKilled++; + if (_roomVar.demon.numKlingonsKilled == 3) { _vm->_awayMission.timers[1] = 0; _vm->_awayMission.timers[5] = 180; _vm->_awayMission.timers[6] = 1; @@ -377,7 +377,7 @@ void Room::demon1UseSTricorderOnKlingon1() { playSoundEffectIndex(0x04); - if (_roomVar.demon1.numKlingonsKilled == 3 && !_vm->_awayMission.demon.tookKlingonHand && _rdfData[0xcf] != 1) { + if (_roomVar.demon.numKlingonsKilled == 3 && !_vm->_awayMission.demon.tookKlingonHand && _rdfData[0xcf] != 1) { showText(TX_SPEAKER_SPOCK, TX_DEM1_018); _rdfData[0xcf] = 1; } else { @@ -413,7 +413,7 @@ void Room::demon1UseMTricorderOnCrewman() { } void Room::demon1GetHand() { - if (_roomVar.demon1.numKlingonsKilled != 3) + if (_roomVar.demon.numKlingonsKilled != 3) return; walkCrewman(OBJECT_KIRK, 0x104, 0x8e, 1); } @@ -511,7 +511,7 @@ void Room::demon1LookAtRedshirt() { void Room::demon1TalkToKirk() { if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_KIRK)) demon1TalkToUnconsciousCrewman(); - else if (_roomVar.demon1.numKlingonsKilled == 3) + else if (_roomVar.demon.numKlingonsKilled == 3) showText(TX_SPEAKER_KIRK, TX_DEM1_001); } diff --git a/engines/startrek/rooms/demon3.cpp b/engines/startrek/rooms/demon3.cpp index 8584465070..f862838483 100644 --- a/engines/startrek/rooms/demon3.cpp +++ b/engines/startrek/rooms/demon3.cpp @@ -28,10 +28,10 @@ void Room::demon3Tick1() { playVoc("DEM3LOOP"); loadActorAnim(8, "light", 0xab, 0x03, 0); - _roomVar.demon3.boulder1Shot = true; + _roomVar.demon.boulder1Shot = true; if (!_vm->_awayMission.demon.boulder1Gone) { loadActorAnim(9, "bldr1", 0x26, 0, 0); - _roomVar.demon3.boulder1Shot = false; + _roomVar.demon.boulder1Shot = false; } if (!_vm->_awayMission.demon.boulder2Gone) { loadActorAnim(10, "bldr2", 0x22, 0, 0); @@ -65,7 +65,7 @@ void Room::demon3Tick1() { // Boulder falling over void Room::demon3Timer0Expired() { - _roomVar.demon3.boulder1Shot = true; + _roomVar.demon.boulder1Shot = true; loadActorAnim2(9, "drbldr", 0x26, 0, 0); _vm->_awayMission.timers[1] = 13; _vm->_awayMission.demon.boulder1Gone = true; @@ -77,7 +77,7 @@ void Room::demon3Timer0Expired() { // Redshirt pushing Kirk away void Room::demon3Timer1Expired() { - _roomVar.demon3.kirkPhaserOut = false; + _roomVar.demon.kirkPhaserOut = false; loadActorAnim2(OBJECT_REDSHIRT, "redkil", 0x46, 0xa0, 0); loadActorAnim2(OBJECT_KIRK, "redkil", 0x46, 0xa0, 1); } @@ -100,7 +100,7 @@ void Room::demon3FinishedAnimation1() { loadActorAnim2(OBJECT_REDSHIRT, "deadre", 0x46, 0xa0, 0); loadActorStandAnim(OBJECT_SPOCK); walkCrewman(OBJECT_MCCOY, 0x9c, 0xb2, 5); - _roomVar.demon3.inFiringPosition = false; + _roomVar.demon.inFiringPosition = false; _vm->_awayMission.redshirtDead = true; } @@ -119,50 +119,50 @@ void Room::demon3FinishedWalking5() { void Room::demon3McCoyInFiringPosition() { loadActorAnim2(OBJECT_MCCOY, "mwaitn", 0xd6, 0xb8, 0); - _roomVar.demon3.mccoyInPosition = true; + _roomVar.demon.mccoyInPosition = true; demon3CrewmanInFiringPosition(); } void Room::demon3SpockInFiringPosition() { loadActorAnim2(OBJECT_SPOCK, "swaitn", 0xae, 0xb4, 0); - _roomVar.demon3.spockInPosition = true; + _roomVar.demon.spockInPosition = true; demon3CrewmanInFiringPosition(); } void Room::demon3RedShirtInFiringPosition() { loadActorAnim2(OBJECT_REDSHIRT, "rwaitn", 0x46, 0xa0, 0); - _roomVar.demon3.redshirtInPosition = true; + _roomVar.demon.redshirtInPosition = true; demon3CrewmanInFiringPosition(); } void Room::demon3KirkInFiringPosition() { loadActorAnim2(OBJECT_KIRK, "kwaitn", 0x79, 0xa0, 0); - _roomVar.demon3.kirkInPosition = true; + _roomVar.demon.kirkInPosition = true; demon3CrewmanInFiringPosition(); } void Room::demon3CrewmanInFiringPosition() { - if (_roomVar.demon3.kirkInPosition && _roomVar.demon3.spockInPosition && _roomVar.demon3.mccoyInPosition && (_vm->_awayMission.redshirtDead || _roomVar.demon3.redshirtInPosition)) + if (_roomVar.demon.kirkInPosition && _roomVar.demon.spockInPosition && _roomVar.demon.mccoyInPosition && (_vm->_awayMission.redshirtDead || _roomVar.demon.redshirtInPosition)) demon3PullOutPhaserAndFireAtBoulder(); } void Room::demon3PullOutPhaserAndFireAtBoulder() { - if (_roomVar.demon3.kirkPhaserOut) + if (_roomVar.demon.kirkPhaserOut) demon3FireAtBoulder(); else { loadActorAnim2(OBJECT_KIRK, "kfiren", -1, -1, 4); - _roomVar.demon3.kirkPhaserOut = true; + _roomVar.demon.kirkPhaserOut = true; } } void Room::demon3FireAtBoulder() { - _roomVar.demon3.kirkInPosition = false; - _roomVar.demon3.spockInPosition = false; - _roomVar.demon3.mccoyInPosition = false; - _roomVar.demon3.redshirtInPosition = false; - _roomVar.demon3.shootingBoulder = false; + _roomVar.demon.kirkInPosition = false; + _roomVar.demon.spockInPosition = false; + _roomVar.demon.mccoyInPosition = false; + _roomVar.demon.redshirtInPosition = false; + _roomVar.demon.shootingBoulder = false; - switch (_roomVar.demon3.boulderBeingShot) { + switch (_roomVar.demon.boulderBeingShot) { case 1: // FIXME: animation overlaps on Kirk, probably due to sprite sorting inaccuracy loadActorAnim2(9, "sbldr1", 0x22, 0, 0); break; @@ -188,9 +188,9 @@ void Room::demon3FireAtBoulder() { } } - loadActorAnim(17, _roomVar.demon3.boulderAnim, 0, 0, 0); + loadActorAnim(17, _roomVar.demon.boulderAnim, 0, 0, 0); playSoundEffectIndex(0x06); - if (!_roomVar.demon3.boulder1Shot) + if (!_roomVar.demon.boulder1Shot) _vm->_awayMission.timers[0] = 1; _vm->_awayMission.disableInput = false; } @@ -206,34 +206,34 @@ void Room::demon3UseStunPhaserOnBoulder() { } void Room::demon3UsePhaserOnBoulder1() { - if (_roomVar.demon3.shootingBoulder || _vm->_awayMission.demon.boulder1Gone) + if (_roomVar.demon.shootingBoulder || _vm->_awayMission.demon.boulder1Gone) return; _vm->_awayMission.demon.boulder1Gone = true; _vm->_awayMission.demon.numBouldersGone++; - _roomVar.demon3.boulderBeingShot = 1; - _roomVar.demon3.boulder1Shot = true; - strcpy(_roomVar.demon3.boulderAnim, "s0r3s2"); + _roomVar.demon.boulderBeingShot = 1; + _roomVar.demon.boulder1Shot = true; + strcpy(_roomVar.demon.boulderAnim, "s0r3s2"); demon3BoulderCommon(); } void Room::demon3UsePhaserOnBoulder2() { - if (_roomVar.demon3.shootingBoulder || _vm->_awayMission.demon.boulder2Gone) + if (_roomVar.demon.shootingBoulder || _vm->_awayMission.demon.boulder2Gone) return; _vm->_awayMission.demon.boulder2Gone = true; _vm->_awayMission.demon.numBouldersGone++; - _roomVar.demon3.boulderBeingShot = 2; - strcpy(_roomVar.demon3.boulderAnim, "s0r3s3"); + _roomVar.demon.boulderBeingShot = 2; + strcpy(_roomVar.demon.boulderAnim, "s0r3s3"); demon3BoulderCommon(); } void Room::demon3UsePhaserOnBoulder3() { if (_vm->_awayMission.demon.boulder1Gone) { - if (_roomVar.demon3.shootingBoulder || _vm->_awayMission.demon.boulder3Gone) + if (_roomVar.demon.shootingBoulder || _vm->_awayMission.demon.boulder3Gone) return; _vm->_awayMission.demon.boulder3Gone = true; _vm->_awayMission.demon.numBouldersGone++; - _roomVar.demon3.boulderBeingShot = 3; - strcpy(_roomVar.demon3.boulderAnim, "s0r3s1"); + _roomVar.demon.boulderBeingShot = 3; + strcpy(_roomVar.demon.boulderAnim, "s0r3s1"); demon3BoulderCommon(); } else { showText(TX_SPEAKER_SPOCK, TX_DEM3_006); @@ -242,12 +242,12 @@ void Room::demon3UsePhaserOnBoulder3() { void Room::demon3UsePhaserOnBoulder4() { if (_vm->_awayMission.demon.boulder2Gone) { - if (_roomVar.demon3.shootingBoulder || _vm->_awayMission.demon.boulder4Gone) + if (_roomVar.demon.shootingBoulder || _vm->_awayMission.demon.boulder4Gone) return; _vm->_awayMission.demon.boulder4Gone = true; _vm->_awayMission.demon.numBouldersGone++; - _roomVar.demon3.boulderBeingShot = 4; - strcpy(_roomVar.demon3.boulderAnim, "s0r3s4"); + _roomVar.demon.boulderBeingShot = 4; + strcpy(_roomVar.demon.boulderAnim, "s0r3s4"); _vm->_awayMission.demon.foundMiner = true; demon3BoulderCommon(); } else { @@ -261,11 +261,11 @@ void Room::demon3BoulderCommon() { _vm->_awayMission.disableInput = true; Common::Point pos = getActorPos(OBJECT_KIRK); if (!(pos.x == 0x79 && pos.y == 0xa0)) { - _roomVar.demon3.inFiringPosition = false; - _roomVar.demon3.kirkPhaserOut = false; + _roomVar.demon.inFiringPosition = false; + _roomVar.demon.kirkPhaserOut = false; } - if (_roomVar.demon3.inFiringPosition) { + if (_roomVar.demon.inFiringPosition) { demon3PullOutPhaserAndFireAtBoulder(); } else { showText(TX_SPEAKER_KIRK, TX_DEM3_001); @@ -276,8 +276,8 @@ void Room::demon3BoulderCommon() { if (!_vm->_awayMission.redshirtDead) walkCrewman(OBJECT_REDSHIRT, 0x46, 0xa0, 4); - _roomVar.demon3.shootingBoulder = true; - _roomVar.demon3.inFiringPosition = true; + _roomVar.demon.shootingBoulder = true; + _roomVar.demon.inFiringPosition = true; } } @@ -385,11 +385,11 @@ void Room::demon3UseMTricorderOnDoor() { } void Room::demon3UsePhaserOnDoor() { - _roomVar.demon3.usedPhaserOnDoor++; + _roomVar.demon.usedPhaserOnDoor++; - if (_roomVar.demon3.usedPhaserOnDoor == 1) + if (_roomVar.demon.usedPhaserOnDoor == 1) showText(TX_DEM3N009); - else if (_roomVar.demon3.usedPhaserOnDoor == 2) + else if (_roomVar.demon.usedPhaserOnDoor == 2) showText(TX_SPEAKER_SPOCK, TX_DEM3_011); } @@ -431,8 +431,8 @@ void Room::demon3UseMedkitOnMiner() { showText(TX_SPEAKER_MCCOY, TX_DEM3_015); } else { walkCrewman(OBJECT_MCCOY, 0xe6, 0x7b, 6); - _roomVar.demon3.inFiringPosition = false; - _roomVar.demon3.kirkPhaserOut = false; + _roomVar.demon.inFiringPosition = false; + _roomVar.demon.kirkPhaserOut = false; } } diff --git a/engines/startrek/rooms/demon4.cpp b/engines/startrek/rooms/demon4.cpp index d70c5fb1be..7a8d95f911 100644 --- a/engines/startrek/rooms/demon4.cpp +++ b/engines/startrek/rooms/demon4.cpp @@ -36,7 +36,7 @@ void Room::demon4Tick1() { if (_vm->_awayMission.demon.solvedSunPuzzle) { loadActorAnim(10, "bxrise2", 0x122, 0x91, 0); loadActorAnim(8, "stpout2", 0x107, 0x92, 0); - _roomVar.demon4.nauianEmerged = true; + _roomVar.demon.nauianEmerged = true; if ((_vm->_awayMission.demon.itemsTakenFromCase & 0x10) && !_vm->_awayMission.demon.gaveSkullToNauian) _vm->_awayMission.timers[6] = 20; @@ -51,14 +51,14 @@ void Room::demon4Tick1() { // Alien emerged void Room::demon4FinishedAnimation1() { loadActorAnim(8, "stpout", 0x107, 0x92, 5); - _roomVar.demon4.nauianEmerged = true; + _roomVar.demon.nauianEmerged = true; if (_vm->_awayMission.demon.itemsTakenFromCase & 0x10) _vm->_awayMission.timers[6] = 45; } void Room::demon4FinishedAnimation2() { - if (!_roomVar.demon4.cd) { - _roomVar.demon4.cd = true; + if (!_roomVar.demon.cd) { + _roomVar.demon.cd = true; showText(TX_DEM4N011); } @@ -100,12 +100,12 @@ void Room::demon4Timer1Expired() { if (!_vm->_awayMission.redshirtDead) walkCrewman(OBJECT_REDSHIRT, 0xc1, 0x91, 4); else - _roomVar.demon4.crewReadyToBeamOut++; + _roomVar.demon.crewReadyToBeamOut++; } void Room::demon4CrewmanReachedBeamoutPosition() { - _roomVar.demon4.crewReadyToBeamOut++; - if (_roomVar.demon4.crewReadyToBeamOut != 4) + _roomVar.demon.crewReadyToBeamOut++; + if (_roomVar.demon.crewReadyToBeamOut != 4) return; if (!_vm->_awayMission.demon.insultedStephen) @@ -137,9 +137,9 @@ void Room::demon4Timer6Expired() { } void Room::demon4UsePhaserOnNauian() { - if (!_roomVar.demon4.triedToShootNauian) { // Lenient the first time + if (!_roomVar.demon.triedToShootNauian) { // Lenient the first time showText(TX_SPEAKER_NAUIAN, TX_DEM4_033); - _roomVar.demon4.triedToShootNauian = true; + _roomVar.demon.triedToShootNauian = true; } else { // Murdery the second time showText(TX_SPEAKER_NAUIAN, TX_DEM4_032); loadActorAnim2(10, "bxfire", 0, 0, 2); @@ -266,7 +266,7 @@ void Room::demon4TalkToNauian() { showText(TX_SPEAKER_NAUIAN, TX_DEM4_040); - if (_roomVar.demon4.disabledSecurity) { // Impossible condition? + if (_roomVar.demon.disabledSecurity) { // Impossible condition? showText(TX_SPEAKER_NAUIAN, TX_DEM4_037); // BUGFIX: Originally all of these used no audio, despite the files existing @@ -331,30 +331,30 @@ void Room::demon4LookAtPanel() { } void Room::demon4UseKirkOnPanel() { - _roomVar.demon4.crewmanUsingPanel = OBJECT_KIRK; + _roomVar.demon.crewmanUsingPanel = OBJECT_KIRK; demon4UseCrewmanOnPanel(); } void Room::demon4UseSpockOnPanel() { - _roomVar.demon4.crewmanUsingPanel = OBJECT_SPOCK; + _roomVar.demon.crewmanUsingPanel = OBJECT_SPOCK; demon4UseCrewmanOnPanel(); } void Room::demon4UseMccoyOnPanel() { - _roomVar.demon4.crewmanUsingPanel = OBJECT_MCCOY; + _roomVar.demon.crewmanUsingPanel = OBJECT_MCCOY; demon4UseCrewmanOnPanel(); } void Room::demon4UseRedshirtOnPanel() { - _roomVar.demon4.crewmanUsingPanel = OBJECT_REDSHIRT; + _roomVar.demon.crewmanUsingPanel = OBJECT_REDSHIRT; demon4UseCrewmanOnPanel(); } void Room::demon4UseCrewmanOnPanel() { if (_vm->_awayMission.demon.solvedSunPuzzle) return; - walkCrewman(_roomVar.demon4.crewmanUsingPanel, 0xda, 0x83, 3); - _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.demon4.crewmanUsingPanel] = DIR_N; + walkCrewman(_roomVar.demon.crewmanUsingPanel, 0xda, 0x83, 3); + _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.demon.crewmanUsingPanel] = DIR_N; _vm->_awayMission.disableInput = true; } @@ -367,7 +367,7 @@ void Room::demon4CrewmanReachedPanel() { } else showText(TX_DEM4N013); - walkCrewman(_roomVar.demon4.crewmanUsingPanel, 0xae, 0x93, 0); + walkCrewman(_roomVar.demon.crewmanUsingPanel, 0xae, 0x93, 0); _vm->_awayMission.disableInput = false; } @@ -539,21 +539,21 @@ void Room::demon4TalkToKirk() { } void Room::demon4TalkToMccoy() { - if (_roomVar.demon4.nauianEmerged) + if (_roomVar.demon.nauianEmerged) showText(TX_SPEAKER_MCCOY, TX_DEM4_019); else showText(TX_SPEAKER_MCCOY, TX_DEM4_015); } void Room::demon4TalkToSpock() { - if (_roomVar.demon4.nauianEmerged) + if (_roomVar.demon.nauianEmerged) showText(TX_SPEAKER_SPOCK, TX_DEM4_022); else showText(TX_SPEAKER_SPOCK, TX_DEM4_024); } void Room::demon4TalkToRedshirt() { - if (_roomVar.demon4.nauianEmerged) + if (_roomVar.demon.nauianEmerged) showText(TX_SPEAKER_EVERTS, TX_DEM4_047); else showText(TX_SPEAKER_EVERTS, TX_DEM4_046); diff --git a/engines/startrek/rooms/demon5.cpp b/engines/startrek/rooms/demon5.cpp index 7227dd0cc1..8af51febc5 100644 --- a/engines/startrek/rooms/demon5.cpp +++ b/engines/startrek/rooms/demon5.cpp @@ -37,12 +37,12 @@ void Room::demon5Tick1() { void Room::demon5WalkToDoor() { _vm->_awayMission.disableInput = true; - _roomVar.demon5.movingToDoor = true; + _roomVar.demon.movingToDoor = true; walkCrewman(OBJECT_KIRK, 0xa0, 0x94, 1); } void Room::demon5TouchedDoorOpenTrigger() { - if (!_roomVar.demon5.movingToDoor) + if (!_roomVar.demon.movingToDoor) return; loadActorAnim(12, "s0r6d1", 0xa0, 0x92, 1); playSoundEffectIndex(0x05); @@ -51,8 +51,8 @@ void Room::demon5TouchedDoorOpenTrigger() { void Room::demon5DoorOpenedOrReachedDoor() { // This is invoked when the door opens and when Kirk reaches the door. // Must wait for both to occur. - _roomVar.demon5.doorCounter++; - if (_roomVar.demon5.doorCounter == 2) + _roomVar.demon.doorCounter++; + if (_roomVar.demon.doorCounter == 2) loadRoomIndex(0, 1); } @@ -153,9 +153,9 @@ void Room::demon5LookAtChub() { void Room::demon5TalkToRoberts() { if (_vm->_awayMission.demon.curedChub) { showText(TX_SPEAKER_ROBERTS, TX_DEM5_030); - if (!_roomVar.demon5.talkedToRoberts) { - _roomVar.demon5.talkedToRoberts = true; - _roomVar.demon5.numTalkedTo++; + if (!_roomVar.demon.talkedToRoberts) { + _roomVar.demon.talkedToRoberts = true; + _roomVar.demon.numTalkedTo++; demon5CheckCompletedStudy(); } } else { @@ -171,9 +171,9 @@ void Room::demon5TalkToChub() { showText(TX_SPEAKER_KIRK, TX_DEM5_005); showText(TX_SPEAKER_CHUB, TX_DEM5L031); - if (!_roomVar.demon5.talkedToChub) { - _roomVar.demon5.talkedToChub = true; - _roomVar.demon5.numTalkedTo++; + if (!_roomVar.demon.talkedToChub) { + _roomVar.demon.talkedToChub = true; + _roomVar.demon.numTalkedTo++; demon5CheckCompletedStudy(); } } else { @@ -188,9 +188,9 @@ void Room::demon5TalkToGrisnash() { showText(TX_SPEAKER_GRISNASH, TX_DEM5_029); showText(TX_SPEAKER_SPOCK, TX_DEM5_025); - if (!_roomVar.demon5.talkedToGrisnash) { - _roomVar.demon5.talkedToGrisnash = true; - _roomVar.demon5.numTalkedTo++; + if (!_roomVar.demon.talkedToGrisnash) { + _roomVar.demon.talkedToGrisnash = true; + _roomVar.demon.numTalkedTo++; demon5CheckCompletedStudy(); } } else { @@ -206,9 +206,9 @@ void Room::demon5TalkToStephen() { showText(TX_SPEAKER_ROBERTS, TX_DEM5_031); showText(TX_SPEAKER_STEPHEN, TX_DEM5_042); - if (!_roomVar.demon5.talkedToStephen) { - _roomVar.demon5.talkedToStephen = true; - _roomVar.demon5.numTalkedTo++; + if (!_roomVar.demon.talkedToStephen) { + _roomVar.demon.talkedToStephen = true; + _roomVar.demon.numTalkedTo++; demon5CheckCompletedStudy(); } } else if (!_vm->_awayMission.demon.knowAboutHypoDytoxin) { @@ -256,14 +256,14 @@ void Room::demon5TalkToMccoy() { } void Room::demon5UseMTricorderOnRoberts() { - if (_roomVar.demon5.scannedRoberts) + if (_roomVar.demon.scannedRoberts) return; loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0); playSoundEffectIndex(0x04); showText(TX_SPEAKER_MCCOY, TX_DEM5_015); - _roomVar.demon5.scannedRoberts = true; - _roomVar.demon5.numScanned++; + _roomVar.demon.scannedRoberts = true; + _roomVar.demon.numScanned++; demon5CheckCompletedStudy(); } @@ -272,11 +272,11 @@ void Room::demon5UseMTricorderOnChub() { playSoundEffectIndex(0x04); if (_vm->_awayMission.demon.curedChub) { - if (_roomVar.demon5.scannedChub) + if (_roomVar.demon.scannedChub) return; showText(TX_SPEAKER_MCCOY, TX_DEM5_016); - _roomVar.demon5.scannedChub = true; - _roomVar.demon5.numScanned++; + _roomVar.demon.scannedChub = true; + _roomVar.demon.numScanned++; demon5CheckCompletedStudy(); } else { if (_vm->_awayMission.demon.field3e) @@ -292,33 +292,33 @@ void Room::demon5UseMTricorderOnChub() { void Room::demon5UseMTricorderOnGrisnash() { - if (_roomVar.demon5.scannedGrisnash) + if (_roomVar.demon.scannedGrisnash) return; loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0); playSoundEffectIndex(0x04); showText(TX_SPEAKER_MCCOY, TX_DEM5_013); - _roomVar.demon5.scannedGrisnash = true; - _roomVar.demon5.numScanned++; + _roomVar.demon.scannedGrisnash = true; + _roomVar.demon.numScanned++; demon5CheckCompletedStudy(); } void Room::demon5UseMTricorderOnStephen() { - if (_roomVar.demon5.scannedStephen) + if (_roomVar.demon.scannedStephen) return; loadActorAnim2(OBJECT_MCCOY, "mscanw", -1, -1, 0); playSoundEffectIndex(0x04); showText(TX_SPEAKER_MCCOY, TX_DEM5_014); - _roomVar.demon5.scannedStephen = true; - _roomVar.demon5.numScanned++; + _roomVar.demon.scannedStephen = true; + _roomVar.demon.numScanned++; demon5CheckCompletedStudy(); } void Room::demon5CheckCompletedStudy() { - if (_roomVar.demon5.numScanned == 4 && _roomVar.demon5.numTalkedTo == 4) { + if (_roomVar.demon.numScanned == 4 && _roomVar.demon.numTalkedTo == 4) { showText(TX_SPEAKER_MCCOY, TX_DEM5_011); - _roomVar.demon5.numTalkedTo = 5; + _roomVar.demon.numTalkedTo = 5; } } diff --git a/engines/startrek/rooms/demon6.cpp b/engines/startrek/rooms/demon6.cpp index a4cd58e5aa..19c6d07bbb 100644 --- a/engines/startrek/rooms/demon6.cpp +++ b/engines/startrek/rooms/demon6.cpp @@ -28,7 +28,7 @@ void Room::demon6Tick1() { playVoc("DEM6LOOP"); if (_vm->_awayMission.demon.gotBerries || (!_vm->_awayMission.demon.field3e && _vm->_awayMission.demon.field37)) { loadActorAnim(8, "oldman", 0x5f, 0xb1, 0); - _roomVar.demon6.stephenInRoom = true; + _roomVar.demon.stephenInRoom = true; } loadActorAnim(10, "s0r6d2", 0xa0, 0x92, 0); loadActorAnim(9, "scrnan", 0, 0xc7, 0); @@ -54,20 +54,20 @@ void Room::demon6SpockReachedComputer() { void Room::demon6WalkToDoor() { _vm->_awayMission.disableInput = true; - _roomVar.demon6.movingToDoor = true; + _roomVar.demon.movingToDoor = true; walkCrewman(OBJECT_KIRK, 0xa0, 0x94, 4); } void Room::demon6TouchedDoorOpenTrigger() { - if (!_roomVar.demon6.movingToDoor) + if (!_roomVar.demon.movingToDoor) return; loadActorAnim(10, "s0r6d1", 0xa0, 0x92, 2); playSoundEffectIndex(5); } void Room::demon6DoorOpenedOrReachedDoor() { - _roomVar.demon6.doorCounter++; - if (_roomVar.demon6.doorCounter == 2) + _roomVar.demon.doorCounter++; + if (_roomVar.demon.doorCounter == 2) loadRoomIndex(0, 2); } @@ -233,8 +233,8 @@ void Room::demon6UseAnythingOnWorkspace() { } void Room::demon6UseCrewmanOnCase() { - if (_roomVar.demon6.stephenInRoom) { - if (_roomVar.demon6.insultedStephenRecently) + if (_roomVar.demon.stephenInRoom) { + if (_roomVar.demon.insultedStephenRecently) return; showText(TX_SPEAKER_STEPHEN, TX_DEM6_044); int choices1[] = {TX_SPEAKER_KIRK, TX_DEM6_001, TX_DEM6_006, TX_DEM6_003, TX_BLANK}; @@ -243,7 +243,7 @@ void Room::demon6UseCrewmanOnCase() { if (choice == 0) { insult: showText(TX_SPEAKER_STEPHEN, TX_DEM6_030); - _roomVar.demon6.insultedStephenRecently = true; + _roomVar.demon.insultedStephenRecently = true; _vm->_awayMission.demon.insultedStephen = true; } else if (choice == 1) { showText(TX_SPEAKER_STEPHEN, TX_DEM6_034); @@ -271,7 +271,7 @@ explain: break; case 5: showText(TX_SPEAKER_STEPHEN, TX_DEM6_041); - _roomVar.demon6.caseOpened = true; + _roomVar.demon.caseOpened = true; return; default: goto error; @@ -414,7 +414,7 @@ void Room::demon6UseSTricoderOnSynthesizer() { } void Room::demon6GetCase() { - if (!_roomVar.demon6.caseOpened) + if (!_roomVar.demon.caseOpened) showText(TX_DEM6N022); else walkCrewman(OBJECT_KIRK, 0xff, 0xba, 5); |