Skip to content

Commit

Permalink
DeathLink fix + EP skip for Tutorial Gate panel
Browse files Browse the repository at this point in the history
  • Loading branch information
NewSoupVi committed Mar 8, 2023
1 parent 55717fb commit b674530
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Source/Archipelago/APRandomizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ bool APRandomizer::Connect(std::string& server, std::string& user, std::string&
if (DeathLink) {
std::list<std::string> newTags = { "DeathLink" };

ap->ConnectUpdate(NULL, newTags);
ap->ConnectUpdate(false, 7, true, newTags);
}


Expand Down
20 changes: 19 additions & 1 deletion Source/Archipelago/APWatchdog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ APWatchdog::APWatchdog(APClient* client, std::map<int, int> mapping, int lastPan
if (puzzle_rando == SIGMA_EXPERT) {
panelsThatHaveToBeSkippedForEPPurposes.insert(0x181F5);
panelsThatHaveToBeSkippedForEPPurposes.insert(0x334D8);
panelsThatHaveToBeSkippedForEPPurposes.insert(0x03629); // Tutorial Gate Open
}

lastFrameTime = std::chrono::system_clock::now();
Expand Down Expand Up @@ -603,6 +604,23 @@ int APWatchdog::CalculatePuzzleSkipCost(int puzzleId, std::string& specialMessag
return 1;
}
}
else if (puzzleId == 0x03629) {
// Tutorial Gate Open. Check for latch.
int latchAmount = 0;

latchAmount += ReadPanelData<int>(0x288E8, DOOR_OPEN) == 0;
latchAmount += ReadPanelData<int>(0x288F3, DOOR_OPEN) == 0;
latchAmount += ReadPanelData<int>(0x28942, DOOR_OPEN) == 0;

if (latchAmount) {
specialMessage = "Skipping this panel costs 1 Puzzle Skip per unopened latch.";
return latchAmount;
}
else {
specialMessage = "";
return -1;
}
}
else if (puzzleId == 0x09FDA) {
// Metapuzzle. This can only be skipped if all child puzzles are skipped too.
// TODO: This flow here is a little confusing to read, because PuzzleIsSkippable returns true, but the cost
Expand Down Expand Up @@ -1331,7 +1349,7 @@ void APWatchdog::CheckEPSkips() {
}
}

if (panel == 0x033EA || panel == 0x01BE9 || panel == 0x01CD3 || panel == 0x01D3F || panel == 0x181F5) {
if (panel == 0x033EA || panel == 0x01BE9 || panel == 0x01CD3 || panel == 0x01D3F || panel == 0x181F5 || panel == 0x03629) {
if (ReadPanelData<int>(panel, SOLVED)) {
panelsToSkip.insert(panel);
continue;
Expand Down
4 changes: 3 additions & 1 deletion Source/Archipelago/SkipSpecialCases.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ inline const std::map<int, std::vector<float>> skip_specialLine = {
};

inline const std::set<int> skip_noLine = {
0x03629, // Tutorial Gate Open

0x0C373, // Patio Floor
0x17C31, // Desert Final Room Transparent Reflection
0x28A69, // Town Lattice
Expand Down Expand Up @@ -83,7 +85,7 @@ inline const std::set<int> skip_completelyExclude = {

//Needs to stay the same!

0x03629, 0x03505, // Tutorial Gate Close
0x03505, // Tutorial Gate Close
0x09F98, // Town Laser Redirect
0x0A079, // Bunker Elevator
0x00609, 0x17E2B, 0x18488, // Swamp Bridge Controls
Expand Down
23 changes: 23 additions & 0 deletions Source/Special.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1742,6 +1742,29 @@ void Special::SkipPanel(int id, std::string text, bool kickOut) {
std::this_thread::sleep_for(std::chrono::milliseconds(200));
}
}
else if (id == 0x03629) { // Tutorial Gate Latches
if (!memory->ReadPanelData<int>(0x288E8, 0x1E4))
{
memory->OpenDoor(0x288E8);
std::this_thread::sleep_for(std::chrono::milliseconds(200));
}

if (!memory->ReadPanelData<int>(0x288F3, 0x1E4))
{
memory->OpenDoor(0x288F3);
std::this_thread::sleep_for(std::chrono::milliseconds(200));
}

if (!memory->ReadPanelData<int>(0x28942, 0x1E4))
{
memory->OpenDoor(0x28942);
std::this_thread::sleep_for(std::chrono::milliseconds(200));
}

memory->PowerGauge(0x003C4, 0x3F, 3);
memory->PowerGauge(0x003C4, 0x3C, 2);
memory->PowerGauge(0x003C4, 0x51, 1);
}

memory->UpdatePanelJunctions(id);

Expand Down

0 comments on commit b674530

Please sign in to comment.