Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make GT accessible in HMG with 7 crystals and no pearl #1063

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 22 additions & 12 deletions app/Region/Standard/GanonsTower.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,25 +394,35 @@ public function initalize()
$this->prize_location->setRequirements($this->can_complete);

$this->can_enter = function ($locations, $items) {
return $items->has('RescueZelda')
&& ($this->world->config('itemPlacement') !== 'basic'
|| (($this->world->config('mode.weapons') === 'swordless' || $items->hasSword(2)) && $items->hasHealth(12) && ($items->hasBottle(2) || $items->hasArmor())))
&& ((($items->has('MoonPearl') || ($this->world->config('canOWYBA', false) && $items->hasABottle()))
&& (((($items->has('Crystal1')
+ $items->has('Crystal2')
+ $items->has('Crystal3')
+ $items->has('Crystal4')
+ $items->has('Crystal5')
+ $items->has('Crystal6')
+ $items->has('Crystal7')) >= $this->world->config('crystals.tower', 7))
$playerCrystalCount = (
$items->has('Crystal1')
+ $items->has('Crystal2')
+ $items->has('Crystal3')
+ $items->has('Crystal4')
+ $items->has('Crystal5')
+ $items->has('Crystal6')
+ $items->has('Crystal7')
);

return $items->has('RescueZelda')
&& ($this->world->config('itemPlacement') !== 'basic'
|| (($this->world->config('mode.weapons') === 'swordless' || $items->hasSword(2)) && $items->hasHealth(12) && ($items->hasBottle(2) || $items->hasArmor())))
&& (
(($items->has('MoonPearl') || ($this->world->config('canOWYBA', false) && $items->hasABottle()))
&& ((($playerCrystalCount >= $this->world->config('crystals.tower', 7))
&& $this->world->getRegion('East Dark World Death Mountain')->canEnter($locations, $items))
|| ((($this->world->config('canBootsClip', false) && $items->has('PegasusBoots'))
|| ($this->world->config('canSuperSpeed', false) && $items->has('PegasusBoots')
&& $items->has('Hookshot')))
&& $this->world->getRegion('West Dark World Death Mountain')->canEnter($locations, $items))))

|| ($this->world->config('canOneFrameClipOW', false)
&& ($this->world->config('canDungeonRevive', false) || $items->has('MoonPearl')
|| ($this->world->config('canOWYBA', false) && $items->hasABottle()))));
|| ($this->world->config('canOWYBA', false) && $items->hasABottle())))
|| (($playerCrystalCount >= $this->world->config('crystals.tower', 7)) &&
$this->world->getRegion('East Dark World Death Mountain')->canEnter($locations, $items) &&
($this->world->config('canDungeonRevive', false)))
);
};

return $this;
Expand Down
318 changes: 318 additions & 0 deletions tests/HybridMajorGlitches/GanonsTowerTest.php

Large diffs are not rendered by default.

303 changes: 303 additions & 0 deletions tests/HybridMajorGlitches/IcePalaceTest.php

Large diffs are not rendered by default.

209 changes: 209 additions & 0 deletions tests/HybridMajorGlitches/PalaceOfDarknessTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
<?php

namespace HybridMajorGlitches;

use ALttP\Item;
use ALttP\World;
use TestCase;

/**
* @group HybridMajorGlitches
*/
class PalaceOfDarknessTest extends TestCase {
public function setUp(): void {
parent::setUp();
$this->world = World::factory('standard', ['difficulty' => 'test_rules', 'logic' => 'HybridMajorGlitches']);
$this->addCollected(['RescueZelda']);
$this->collected->setChecksForWorld($this->world->id);
}

public function tearDown(): void {
parent::tearDown();
unset($this->world);
}

/**
* @param bool $access
* @param array $items
* @param array $except
*
* @dataProvider entryPool
*/
public function testEntry(bool $access, array $items, array $except = []) {
if (count($except)) {
$this->collected = $this->allItemsExcept($except);
}

$this->addCollected($items);

$this->assertEquals($access, $this->world->getRegion('Palace of Darkness')
->canEnter($this->world->getLocations(), $this->collected));
}

public function entryPool() {
return [
[false, []],
[false, ['MoonPearl']],
[true, ['PegasusBoots']],
[true, ['MoonPearl', 'PegasusBoots']],
[true, ['MoonPearl', 'ProgressiveGlove', 'ProgressiveGlove']],
[true, ['MoonPearl', 'TitansMitt']],
];
}

/**
* @param string $location
* @param bool $access
* @param string $item
* @param array $items
* @param array $except
*
* @dataProvider fillPool
*/
public function testFillLocation(string $location, bool $access, string $item, array $items = [], array $except = []) {
if (count($except)) {
$this->collected = $this->allItemsExcept($except);
}

$this->addCollected($items);

$this->assertEquals($access, $this->world->getLocation($location)
->fill(Item::get($item, $this->world), $this->collected));
}

public function fillPool() {
return [
["Palace of Darkness - Big Key Chest", true, 'BigKeyD1', [], ['BigKeyD1']],
["Palace of Darkness - The Arena - Ledge", true, 'BigKeyD1', [], ['BigKeyD1']],
["Palace of Darkness - The Arena - Bridge", true, 'BigKeyD1', [], ['BigKeyD1']],
["Palace of Darkness - Big Chest", false, 'BigKeyD1', [], ['BigKeyD1']],
["Palace of Darkness - Compass Chest", true, 'BigKeyD1', [], ['BigKeyD1']],
["Palace of Darkness - Harmless Hellway", true, 'BigKeyD1', [], ['BigKeyD1']],
["Palace of Darkness - Stalfos Basement", true, 'BigKeyD1', [], ['BigKeyD1']],
["Palace of Darkness - Dark Basement - Left", true, 'BigKeyD1', [], ['BigKeyD1']],
["Palace of Darkness - Dark Basement - Right", true, 'BigKeyD1', [], ['BigKeyD1']],
["Palace of Darkness - Map Chest", true, 'BigKeyD1', [], ['BigKeyD1']],
["Palace of Darkness - Dark Maze - Top", true, 'BigKeyD1', [], ['BigKeyD1']],
["Palace of Darkness - Dark Maze - Bottom", true, 'BigKeyD1', [], ['BigKeyD1']],
["Palace of Darkness - Shooter Room", true, 'BigKeyD1', [], ['BigKeyD1']],
["Palace of Darkness - Boss", false, 'BigKeyD1', [], ['BigKeyD1']],
];
}


/**
* @param string $location
* @param bool $access
* @param array $items
* @param array $except
*
* @dataProvider accessPool
*/
public function testLocation(string $location, bool $access, array $items, array $except = []) {
if (count($except)) {
$this->collected = $this->allItemsExcept($except);
}

$this->addCollected($items);

$this->assertEquals($access, $this->world->getLocation($location)
->canAccess($this->collected));
}

public function accessPool() {
return [
["Palace of Darkness - Big Key Chest", false, []],
["Palace of Darkness - Big Key Chest", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'PegasusBoots']],
["Palace of Darkness - Big Key Chest", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'MoonPearl', 'PegasusBoots']],
["Palace of Darkness - Big Key Chest", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'MoonPearl', 'ProgressiveGlove', 'ProgressiveGlove']],
["Palace of Darkness - Big Key Chest", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'MoonPearl', 'TitansMitt']],

["Palace of Darkness - The Arena - Ledge", false, []],
["Palace of Darkness - The Arena - Ledge", false, [], ['AnyBow']],
["Palace of Darkness - The Arena - Ledge", true, ['BowAndArrows', 'PegasusBoots']],
["Palace of Darkness - The Arena - Ledge", true, ['BowAndArrows', 'MoonPearl', 'PegasusBoots']],
["Palace of Darkness - The Arena - Ledge", true, ['BowAndArrows', 'MoonPearl', 'ProgressiveGlove', 'ProgressiveGlove']],
["Palace of Darkness - The Arena - Ledge", true, ['BowAndArrows', 'MoonPearl', 'TitansMitt']],

["Palace of Darkness - The Arena - Bridge", false, []],
["Palace of Darkness - The Arena - Bridge", true, ['KeyD1', 'PegasusBoots']],
["Palace of Darkness - The Arena - Bridge", true, ['KeyD1', 'MoonPearl', 'PegasusBoots']],
["Palace of Darkness - The Arena - Bridge", true, ['KeyD1', 'MoonPearl', 'ProgressiveGlove', 'ProgressiveGlove']],
["Palace of Darkness - The Arena - Bridge", true, ['KeyD1', 'MoonPearl', 'TitansMitt']],
["Palace of Darkness - The Arena - Bridge", true, ['BowAndArrows', 'Hammer', 'MoonPearl', 'PegasusBoots']],

["Palace of Darkness - Big Chest", false, []],
["Palace of Darkness - Big Chest", false, [], ['Lamp']],
["Palace of Darkness - Big Chest", false, [], ['BigKeyD1']],
["Palace of Darkness - Big Chest", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'BigKeyD1', 'Lamp', 'PegasusBoots']],
["Palace of Darkness - Big Chest", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'BigKeyD1', 'MoonPearl', 'Lamp', 'ProgressiveGlove', 'ProgressiveGlove']],
["Palace of Darkness - Big Chest", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'BigKeyD1', 'MoonPearl', 'Lamp', 'TitansMitt']],

["Palace of Darkness - Compass Chest", false, []],
["Palace of Darkness - Compass Chest", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'PegasusBoots']],
["Palace of Darkness - Compass Chest", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'MoonPearl', 'PegasusBoots']],
["Palace of Darkness - Compass Chest", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'MoonPearl', 'ProgressiveGlove', 'ProgressiveGlove']],
["Palace of Darkness - Compass Chest", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'MoonPearl', 'TitansMitt']],

["Palace of Darkness - Harmless Hellway", false, []],
["Palace of Darkness - Harmless Hellway", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'PegasusBoots']],
["Palace of Darkness - Harmless Hellway", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'MoonPearl', 'PegasusBoots']],
["Palace of Darkness - Harmless Hellway", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'MoonPearl', 'ProgressiveGlove', 'ProgressiveGlove']],
["Palace of Darkness - Harmless Hellway", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'MoonPearl', 'TitansMitt']],

["Palace of Darkness - Stalfos Basement", false, []],
["Palace of Darkness - Stalfos Basement", true, ['KeyD1', 'PegasusBoots']],
["Palace of Darkness - Stalfos Basement", true, ['KeyD1', 'MoonPearl', 'PegasusBoots']],
["Palace of Darkness - Stalfos Basement", true, ['KeyD1', 'MoonPearl', 'ProgressiveGlove', 'ProgressiveGlove']],
["Palace of Darkness - Stalfos Basement", true, ['KeyD1', 'MoonPearl', 'TitansMitt']],
["Palace of Darkness - Stalfos Basement", true, ['BowAndArrows', 'Hammer', 'MoonPearl', 'PegasusBoots']],

["Palace of Darkness - Dark Basement - Left", false, []],
["Palace of Darkness - Dark Basement - Left", false, [], ['Lamp']],
["Palace of Darkness - Dark Basement - Left", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'Lamp', 'PegasusBoots']],
["Palace of Darkness - Dark Basement - Left", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'Lamp', 'MoonPearl', 'PegasusBoots']],
["Palace of Darkness - Dark Basement - Left", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'Lamp', 'MoonPearl', 'ProgressiveGlove', 'ProgressiveGlove']],
["Palace of Darkness - Dark Basement - Left", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'Lamp', 'MoonPearl', 'TitansMitt']],

["Palace of Darkness - Dark Basement - Right", false, []],
["Palace of Darkness - Dark Basement - Right", false, [], ['Lamp']],
["Palace of Darkness - Dark Basement - Right", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'Lamp', 'PegasusBoots']],
["Palace of Darkness - Dark Basement - Right", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'Lamp', 'MoonPearl', 'PegasusBoots']],
["Palace of Darkness - Dark Basement - Right", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'Lamp', 'MoonPearl', 'ProgressiveGlove', 'ProgressiveGlove']],
["Palace of Darkness - Dark Basement - Right", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'Lamp', 'MoonPearl', 'TitansMitt']],

["Palace of Darkness - Map Chest", false, []],
["Palace of Darkness - Map Chest", false, [], ['AnyBow']],
["Palace of Darkness - Map Chest", true, ['BowAndArrows', 'PegasusBoots']],
["Palace of Darkness - Map Chest", true, ['BowAndArrows', 'MoonPearl', 'PegasusBoots']],
["Palace of Darkness - Map Chest", true, ['BowAndArrows', 'MoonPearl', 'ProgressiveGlove', 'ProgressiveGlove']],
["Palace of Darkness - Map Chest", true, ['BowAndArrows', 'MoonPearl', 'TitansMitt']],

["Palace of Darkness - Dark Maze - Top", false, []],
["Palace of Darkness - Dark Maze - Top", false, [], ['Lamp']],
["Palace of Darkness - Dark Maze - Top", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'Lamp', 'PegasusBoots']],
["Palace of Darkness - Dark Maze - Top", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'MoonPearl', 'Lamp', 'PegasusBoots']],
["Palace of Darkness - Dark Maze - Top", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'MoonPearl', 'Lamp', 'ProgressiveGlove', 'ProgressiveGlove']],
["Palace of Darkness - Dark Maze - Top", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'MoonPearl', 'Lamp', 'TitansMitt']],

["Palace of Darkness - Dark Maze - Bottom", false, []],
["Palace of Darkness - Dark Maze - Bottom", false, [], ['Lamp']],
["Palace of Darkness - Dark Maze - Bottom", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'Lamp', 'PegasusBoots']],
["Palace of Darkness - Dark Maze - Bottom", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'MoonPearl', 'Lamp', 'PegasusBoots']],
["Palace of Darkness - Dark Maze - Bottom", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'MoonPearl', 'Lamp', 'ProgressiveGlove', 'ProgressiveGlove']],
["Palace of Darkness - Dark Maze - Bottom", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'MoonPearl', 'Lamp', 'TitansMitt']],

["Palace of Darkness - Shooter Room", false, []],
["Palace of Darkness - Shooter Room", true, ['PegasusBoots']],
["Palace of Darkness - Shooter Room", true, ['MoonPearl', 'ProgressiveGlove', 'ProgressiveGlove']],
["Palace of Darkness - Shooter Room", true, ['MoonPearl', 'TitansMitt']],

["Palace of Darkness - Boss", false, []],
["Palace of Darkness - Boss", false, [], ['Lamp']],
["Palace of Darkness - Boss", false, [], ['Hammer']],
["Palace of Darkness - Boss", false, [], ['AnyBow']],
["Palace of Darkness - Boss", false, [], ['BigKeyD1']],
["Palace of Darkness - Boss", true, ['KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'KeyD1', 'BigKeyD1', 'Lamp', 'Hammer', 'BowAndArrows', 'PegasusBoots']],
];
}
}
Loading