Permalink
Browse files

STARTREK: FEATHER1

  • Loading branch information...
Drenn1 authored and sev- committed Jul 4, 2018
1 parent 51e2c85 commit 051ea8c238510db03505cd146025c1db441ace84
@@ -120,7 +120,7 @@ void StarTrekEngine::initAwayCrewPositions(int warpEntryIndex) {
memset(_awayMission.crewDirectionsAfterWalk, 0xff, 4);

switch (warpEntryIndex) {
case 0: // 0-3: Read warp positions from RDF file
case 0: // 0-3: Crew spawns in a spot and walks to a spot.
case 1:
case 2:
case 3:
@@ -155,9 +155,19 @@ void StarTrekEngine::initAwayCrewPositions(int warpEntryIndex) {
playSoundEffectIndex(0x09);
_warpHotspotsActive = false;
break;
case 5:
case 5: // Crew spawns in directly at a position.
for (int i = 0; i < (_awayMission.redshirtDead ? 3 : 4); i++) {
Common::String animFilename = getCrewmanAnimFilename(i, "stnds");
Common::Point warpPos = _room->getSpawnPosition(i);
loadActorAnimWithRoomScaling(i, animFilename, warpPos.x, warpPos.y);
}
_warpHotspotsActive = true;
break;
case 6:
error("initAwayCrewPositions(6) unimplemented");
break;
default:
warning("Invalid parameter (%d) to initAwayCrewPositions", warpEntryIndex);
break;
}
}
@@ -241,6 +241,18 @@ struct AwayMission {
bool repairedLifeSupportGenerator; // 0x59
int16 missionScore; // 0x5a
} mudd;

struct {
// 0: initial state
// 1: one rock thrown at it
// 2: two rocks thrown at it (low enough to climb up)
byte vineState; // 0x2a

bool gotRock; // 0x2b
bool gotSnake; // 0x2c
bool holeBlocked; // 0x31
int16 missionScore; // 0x36
} feather;
};
};
// Size: 0x129 bytes
@@ -137,7 +137,7 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
}
else if (name == "FEATHER1") {
_roomActionList = feather1ActionList;
_numRoomActions = sizeof(feather1ActionList) / sizeof(RoomAction);
_numRoomActions = feather1NumActions;
}
else if (name == "FEATHER2") {
_roomActionList = feather2ActionList;
@@ -180,7 +180,7 @@ uint16 Room::readRdfWord(int offset) {
}

bool Room::actionHasCode(const Action &action) {
RoomAction *roomActionPtr = _roomActionList;
const RoomAction *roomActionPtr = _roomActionList;
int n = _numRoomActions;

while (n-- > 0) {
@@ -192,7 +192,7 @@ bool Room::actionHasCode(const Action &action) {
}

bool Room::handleAction(const Action &action) {
RoomAction *roomActionPtr = _roomActionList;
const RoomAction *roomActionPtr = _roomActionList;
int n = _numRoomActions;

while (n-- > 0) {
@@ -208,7 +208,7 @@ bool Room::handleAction(const Action &action) {
}

bool Room::handleActionWithBitmask(const Action &action) {
RoomAction *roomActionPtr = _roomActionList;
const RoomAction *roomActionPtr = _roomActionList;
int n = _numRoomActions;

while (n-- > 0) {
@@ -225,10 +225,14 @@ bool Room::handleActionWithBitmask(const Action &action) {
}

Common::Point Room::getBeamInPosition(int crewmanIndex) {
int base = 0xaa + crewmanIndex * 4;
int base = RDF_BEAM_IN_POSITIONS + crewmanIndex * 4;
return Common::Point(readRdfWord(base), readRdfWord(base + 2));
}

Common::Point Room::getSpawnPosition(int crewmanIndex) {
int base = RDF_SPAWN_POSITIONS + crewmanIndex * 4;
return Common::Point(readRdfWord(base), readRdfWord(base + 2));
}

// For actions of type ACTION_FINISHED_ANIMATION or ACTION_FINISHED_WALKING, this takes
// a function pointer and returns the index corresponding to that callback.
@@ -49,6 +49,7 @@ struct RoomAction {
const int RDF_WARP_ROOM_INDICES = 0x22;
const int RDF_ROOM_ENTRY_POSITIONS = 0x2a;
const int RDF_BEAM_IN_POSITIONS = 0xaa;
const int RDF_SPAWN_POSITIONS = 0xba;

class Room {

@@ -85,14 +86,18 @@ class Room {
uint16 getDoorPolygonEndOffset() { return readRdfWord(0x1c); }

Common::Point getBeamInPosition(int crewmanIndex);
// This is analagous to above, but instead of beaming in, they just appear in a spot.
// Used sparingly, ie. in feather's serpent when appearing in cave after Quetzecoatl
// warps the crew.
Common::Point getSpawnPosition(int crewmanIndex);

public:
byte *_rdfData;

private:
StarTrekEngine *_vm;

RoomAction *_roomActionList;
const RoomAction *_roomActionList;
int _numRoomActions;

int _roomIndex; // ie. for DEMON2, this is 2
@@ -131,8 +136,8 @@ class Room {

// If "changeDirection" is true, they remain facing that direction even after their
// animation is finished. The game is inconsistent about doing this.
void spockScan(int direction, TextRef text, bool changeDirection);
void mccoyScan(int direction, TextRef text, bool changeDirection);
void spockScan(int direction, TextRef text, bool changeDirection = false);
void mccoyScan(int direction, TextRef text, bool changeDirection = false);

// Room-specific code
public:
@@ -1408,6 +1413,88 @@ class Room {

// FEATHER1
void feather1Tick1();
void feather1Tick45();
void feather1Tick85();
void feather1Tick95();
void feather1QuetzecoatlDisappeared();
void feather1GetRightVine();
void feather1GetLeftVine();
void feather1GetRocks();
void feather1ReachedRocks();
void feather1PickedUpRocks();
void feather1GetSnake();
void feather1ReachedSnake();
void feather1Timer1Expired();
void feather1Timer2Expired();
void feather1PickedUpSnake();
void feather1Timer0Expired();
void feather1UseCommunicator();
void feather1UseRockOnHole();
void feather1ReachedHole();
void feather1Timer3Expired();
void feather1PutRockInHole();
void feather1UseSnakeOnLeftVine();
void feather1UseSnakeOnSpock();
void feather1UseSnakeOnKirk();
void feather1UseSnakeOnMccoy();
void feather1UseSnakeOnRedshirt();
void feather1UseRockOnSnake();
void feather1UseSpockOnSnake();
void feather1UseMccoyOnSnake();
void feather1UseRedshirtOnSnake();
void feather1UseSpockOnHole();
void feather1UseMccoyOnHole();
void feather1UseRedshirtOnHole();
void feather1UseRockOnMoss();
void feather1UseRockOnSpock();
void feather1UseRockOnMccoy();
void feather1UseRockOnRedshirt();
void feather1UseSpockOnMoss();
void feather1UseMccoyOnMoss();
void feather1UseRedshirtOnMoss();
void feather1UseRockOnLeftVine();
void feather1ReadyToThrowRock1();
void feather1ThrewRock1();
void feather1ReadyToThrowRock2();
void feather1ThrewRock2();
void feather1UseSpockOnVine();
void feather1UseMccoyOnVine();
void feather1UseRedshirtOnVine();
void feather1UseKirkOnVine();
void feather1CrewmanClimbVine();
void feather1ReachedVineToClimbUp();
void feather1ClimbedUpVine();
void feather1ReachedVineToClimbDown();
void feather1ClimbedDownVine();
void feather1UsePhaser();
void feather1UseSTricorderOnRightVine();
void feather1UseSTricorderOnSnake();
void feather1UseSTricorderOnMoss();
void feather1UseSTricorderOnHole();
void feather1UseSTricorderAnywhere();
void feather1UseSTricorderOnRocks();
void feather1UseMTricorderOnVine();
void feather1UseMTricorderOnMoss();
void feather1UseMTricorderOnHole();
void feather1UseMTricorderOnSnake();
void feather1UseMedkit();
void feather1TalkToMccoy();
void feather1TalkToSpock();
void feather1TalkToRedshirt();
void feather1WalkToExit();
void feather1LookAnywhere();
void feather1LookAtSnake();
void feather1LookAtRightVine();
void feather1LookAtHole();
void feather1LookAtMoss();
void feather1LookAtRocks();
void feather1LookAtLight();
void feather1LookAtEyes();
void feather1LookAtKirk();
void feather1LookAtSpock();
void feather1LookAtMccoy();
void feather1LookAtRedshirt();
void feather1LookAtLeftVine();

// FEATHER2
void feather2Tick1();
@@ -1546,6 +1633,18 @@ class Room {
byte walkingToDoor;
} mudd;

struct {
// feather1
byte snakeInHole; // 0xca
bool scannedSnake; // 0xcb
bool crewEscaped[4]; // 0xcc
byte kirkEscaped; // 0xcc
byte spockEscaped; // 0xcd
byte mccoyEscaped; // 0xce
byte cf; // 0xcf
byte crewmanClimbingVine;
} feather;


} _roomVar;
};
Oops, something went wrong.

0 comments on commit 051ea8c

Please sign in to comment.