public function initNoMajorGlitches() {
$this->locations["[dungeon-L2-B1] Desert Palace - big chest"]->setRequirements(
function($locations, $items) {
return $items->has("PegasusBoots")||
!($locations["[dungeon-L2-B1] Desert Palace - Small key room"]->hasItem(Item::get("BigKey"))||
($locations["[dungeon-L2-B1] Desert Palace - Small key room"]->hasItem(Item::get("Key"))&&
$locations->itemInLocations(Item::get("BigKey"), ["[dungeon-L2-B1] Desert Palace - Big key room","[dungeon-L2-B1] Desert Palace - compass room",])));
}
)->setFillRules(
function($item, $locations, $items) {
return $item != Item::get("BigKey");
}
);
$this->locations["[dungeon-L2-B1] Desert Palace - Map room"]->setRequirements(
function($locations, $items) {
return true;
}
);
$this->locations["[dungeon-L2-B1] Desert Palace - Big key room"]->setRequirements(
function($locations, $items) {
return $items->has("PegasusBoots")||
!($locations["[dungeon-L2-B1] Desert Palace - Small key room"]->hasItem(Item::get("Key"))||
($locations["[dungeon-L2-B1] Desert Palace - Small key room"]->hasItem(Item::get("BigKey"))&&
$locations["[dungeon-L2-B1] Desert Palace - big chest"]->hasItem(Item::get("Key"))));
}
)->setFillRules(
function($item, $locations, $items) {
return $item != Item::get("Key")&&
!($locations["[dungeon-L2-B1] Desert Palace - big chest"]->hasItem(Item::get("Key")) &&
$item == Item::get("BigKey"));
}
);
$this->locations["[dungeon-L2-B1] Desert Palace - compass room"]->setRequirements(
function($locations, $items) {
return $items->has("PegasusBoots")||
!($locations["[dungeon-L2-B1] Desert Palace - Small key room"]->hasItem(Item::get("Key"))||
($locations["[dungeon-L2-B1] Desert Palace - Small key room"]->hasItem(Item::get("BigKey"))&&
$locations["[dungeon-L2-B1] Desert Palace - big chest"]->hasItem(Item::get("Key"))));
}
)->setFillRules(
function($item, $locations, $items) {
return $item != Item::get("Key")&&
!($locations["[dungeon-L2-B1] Desert Palace - big chest"]->hasItem(Item::get("Key")) &&
$item == Item::get("BigKey"));
}
);
$this->locations["[dungeon-L2-B1] Desert Palace - Small key room"]->setRequirements(
function($locations, $items) {
return $items->has("PegasusBoots");
}
);
$this->can_complete = function($locations, $items) {
if (config("game-mode") == "open" &&
!($items->hasSword() ||
$items->has("Hammer")||
$items->canShootArrows() ||
$items->has("FireRod") ||
$items->has("IceRod")||
$items->has("CaneOfByrna") ||
$items->has("CaneOfSomaria"))) {
return false;
}
return $this->canEnter($locations, $items)&&
$items->canLiftRocks() &&
$items->canLightTorches()&&
($items->has("PegasusBoots")||
!($locations["[dungeon-L2-B1] Desert Palace - Small key room"]->hasItem(Item::get("BigKey"))||
$locations["[dungeon-L2-B1] Desert Palace - Small key room"]->hasItem(Item::get("Key"))));
}
;
$this->locations["Heart Container - Lanmolas"]->setRequirements($this->can_complete)->setFillRules(
function($item, $locations, $items) {
return !in_array($item, [Item::get("Key"), Item::get("BigKey")]);
}
);
$this->can_enter = function($locations, $items) {
return $items->has("BookOfMudora")||
($items->has("MagicMirror") &&
$items->canLiftDarkRocks() &&
$items->canFly());
}
;
return $this;
}