From 3aeeacebe2adece9755c3dd38d9638bd6ef8c833 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sat, 14 Dec 2024 13:45:08 +0100 Subject: [PATCH 1/3] polish --- .../misthalinmystery/MisthalinMystery.java | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/questhelper/helpers/quests/misthalinmystery/MisthalinMystery.java b/src/main/java/com/questhelper/helpers/quests/misthalinmystery/MisthalinMystery.java index c9ebc40d46..c16b1bd0cb 100644 --- a/src/main/java/com/questhelper/helpers/quests/misthalinmystery/MisthalinMystery.java +++ b/src/main/java/com/questhelper/helpers/quests/misthalinmystery/MisthalinMystery.java @@ -66,8 +66,8 @@ public class MisthalinMystery extends BasicQuestHelper takeKnife, tryToOpenPinkKnobDoor, takeNote1, readNotes1, useKnifeOnPainting, searchPainting, goThroughRubyDoor, takeTinderbox, lightCandle1, lightCandle2, lightCandle3, lightCandle4, lightBarrel, leaveExplosionRoom, climbWall, observeThroughTree, takeNote2, readNotes2, playPiano, playD, playE, playA, playDAgain, restartPiano, searchThePiano, returnOverBrokenWall, openEmeraldDoor, enterBandosGodswordRoomStep, takeNote3, readNotes3, useKnifeOnFireplace, searchFireplace, clickSapphire, clickDiamond, - clickZenyte, clickEmerald, clickOnyx, clickRuby, restartGems, searchFireplaceForSapphireKey, goThroughSapphireDoor, reflectKnives, continueThroughSapphireDoor, pickUpKillersKnife, - fightAbigale, leaveSapphireRoom, talkToMandy; + clickZenyte, clickEmerald, clickOnyx, clickRuby, restartGems, searchFireplaceForSapphireKey, goThroughSapphireDoor, reflectKnives, continueThroughSapphireDoor, watchTheKillersReveal, + pickUpKillersKnife, fightAbigale, leaveSapphireRoom, talkToMandy; //Zones private Zone island, outside1, outside2, outside3, bossRoom; @@ -199,6 +199,7 @@ public Map loadSteps() steps.put(111, goDoBoss); ConditionalStep watchRevealCutscene = new ConditionalStep(this, takeTheBoat); + watchRevealCutscene.addStep(inBossRoom, watchTheKillersReveal); watchRevealCutscene.addStep(onIsland, continueThroughSapphireDoor); steps.put(115, watchRevealCutscene); @@ -274,8 +275,7 @@ public void setupSteps() { // TODO: Should this implement PuzzleWrapper? talkToAbigale = new NpcStep(this, NpcID.ABIGALE, new WorldPoint(3237, 3155, 0), "Talk to Abigale in the south east corner of Lumbridge Swamp."); - talkToAbigale.addDialogStep("What has happened here?"); - talkToAbigale.addDialogStep("What do you want me to do?"); + talkToAbigale.addDialogStep("Yes."); takeTheBoat = new ObjectStep(this, ObjectID.ROWBOAT_30108, new WorldPoint(3240, 3140, 0), "Board the rowboat south of Abigale."); takeTheBucket = new ObjectStep(this, ObjectID.BUCKET_30147, new WorldPoint(1619, 4816, 0), "Pick up the bucket near the fountain.", bucket); searchTheBarrel = new ObjectStep(this, NullObjectID.NULL_29649, new WorldPoint(1615, 4829, 0), "Search the barrel of rainwater north of the fountain to trigger a cutscene.", bucket); @@ -285,14 +285,14 @@ public void setupSteps() openManorDoor = new ObjectStep(this, ObjectID.LARGE_DOOR_30110, new WorldPoint(1636, 4824, 0), "Enter the manor.", true); ((ObjectStep) openManorDoor).addAlternateObjects(ObjectID.LARGE_DOOR_30111); takeKnife = new ObjectStep(this, ObjectID.TABLE_30145, new WorldPoint(1639, 4831, 0), "Take the knife from the table.", knife); - tryToOpenPinkKnobDoor = new ObjectStep(this, ObjectID.DOOR_30112, new WorldPoint(1635, 4838, 0), "Try to open the pink-handled door."); + tryToOpenPinkKnobDoor = new ObjectStep(this, ObjectID.DOOR_30112, new WorldPoint(1635, 4838, 0), "Try to open the door with the pink handle."); takeNote1 = new ObjectStep(this, NullObjectID.NULL_2266, new WorldPoint(1635, 4839, 0), "Pick up the note that appeared."); readNotes1 = new DetailedQuestStep(this, "Read the notes.", notes1.highlighted()); useKnifeOnPainting = new ObjectStep(this, NullObjectID.NULL_29650, new WorldPoint(1632, 4833, 0), "Use a knife on the marked painting.", knife); useKnifeOnPainting.addIcon(ItemID.KNIFE); searchPainting = new ObjectStep(this, NullObjectID.NULL_29650, new WorldPoint(1632, 4833, 0), "Search the painting for a ruby key."); - goThroughRubyDoor = new ObjectStep(this, ObjectID.DOOR_30116, new WorldPoint(1640, 4828, 0), "Go through the door with a ruby handle.", rubyKey); - takeTinderbox = new ObjectStep(this, ObjectID.SHELVES_30146, new WorldPoint(1646, 4826, 0), "Search shelves for a tinderbox."); + goThroughRubyDoor = new ObjectStep(this, ObjectID.DOOR_30116, new WorldPoint(1640, 4828, 0), "Go through the door with the ruby handle.", rubyKey); + takeTinderbox = new ObjectStep(this, ObjectID.SHELVES_30146, new WorldPoint(1646, 4826, 0), "Search the shelves for a tinderbox."); lightCandle1 = new ObjectStep(this, NullObjectID.NULL_29655, new WorldPoint(1641, 4826, 0), "Light the unlit candles in the room.", tinderbox.highlighted()); lightCandle1.addIcon(ItemID.TINDERBOX); @@ -306,6 +306,8 @@ public void setupSteps() lightBarrel.addIcon(ItemID.TINDERBOX); leaveExplosionRoom = new ObjectStep(this, ObjectID.DOOR_30116, new WorldPoint(1640, 4828, 0), "Leave the room to trigger the explosion."); + lightCandle1.addSubSteps(lightCandle2, lightCandle3, lightCandle4); + climbWall = new ObjectStep(this, NullObjectID.NULL_29657, new WorldPoint(1648, 4829, 0), "Climb over the damaged wall."); observeThroughTree = new ObjectStep(this, ObjectID.DEAD_TREE_30150, new WorldPoint(1630, 4849, 0), "Observe Lacey through the trees."); @@ -323,10 +325,10 @@ public void setupSteps() returnOverBrokenWall = new ObjectStep(this, NullObjectID.NULL_29657, new WorldPoint(1648, 4829, 0), "Climb back over the damaged wall into the manor.", emeraldKey); - openEmeraldDoor = new ObjectStep(this, ObjectID.DOOR_30117, new WorldPoint(1633, 4837, 0), "Go through the door with a green handle.", emeraldKey); + openEmeraldDoor = new ObjectStep(this, ObjectID.DOOR_30117, new WorldPoint(1633, 4837, 0), "Go through the door with the green handle.", emeraldKey); enterBandosGodswordRoomStep = new ObjectStep(this, ObjectID.DOOR_30118, new WorldPoint(1629, 4842, 0), - "Try to enter the room with a Bandos Godsword in it."); + "Try to enter the room containing the Bandos godsword."); takeNote3 = new ObjectStep(this, NullObjectID.NULL_29648, new WorldPoint(1630, 4842, 0), "Pick up the note that appeared by the door."); readNotes3 = new DetailedQuestStep(this, "Read the notes.", notes3.highlighted()); @@ -351,6 +353,9 @@ public void setupSteps() continueThroughSapphireDoor = new ObjectStep(this, ObjectID.DOOR_30119, new WorldPoint(1628, 4829, 0), "Go through the sapphire door to continue."); + goThroughSapphireDoor.addSubSteps(continueThroughSapphireDoor); + + watchTheKillersReveal = new DetailedQuestStep(this, "Watch the killer's reveal cutscene."); pickUpKillersKnife = new DetailedQuestStep(this, "Pick up the killer's knife.", killersKnifeEquipped); @@ -380,9 +385,9 @@ public List getExperienceRewards() public List getItemRewards() { return Arrays.asList( - new ItemReward("Uncut Ruby", ItemID.UNCUT_RUBY, 1), - new ItemReward("Uncut Emerald", ItemID.UNCUT_EMERALD, 1), - new ItemReward("Uncut Sapphire", ItemID.UNCUT_SAPPHIRE, 1)); + new ItemReward("Uncut Ruby", ItemID.UNCUT_RUBY, 1), + new ItemReward("Uncut Emerald", ItemID.UNCUT_EMERALD, 1), + new ItemReward("Uncut Sapphire", ItemID.UNCUT_SAPPHIRE, 1)); } @Override @@ -397,7 +402,7 @@ public List getPanels() allSteps.add(new PanelDetails("Solve the third puzzle", Arrays.asList(observeThroughTree, takeNote2, readNotes2, playPiano, playD, playE, playA, playDAgain, searchThePiano))); allSteps.add(new PanelDetails("Witness another murder", Arrays.asList(returnOverBrokenWall, openEmeraldDoor, enterBandosGodswordRoomStep))); allSteps.add(new PanelDetails("Solve the fourth puzzle", Arrays.asList(takeNote3, readNotes3, useKnifeOnFireplace, searchFireplace, clickSapphire, clickDiamond, clickZenyte, clickEmerald, clickOnyx, clickRuby, searchFireplaceForSapphireKey))); - allSteps.add(new PanelDetails("Confront the killer", Arrays.asList(goThroughSapphireDoor, reflectKnives, pickUpKillersKnife, fightAbigale, leaveSapphireRoom, talkToMandy))); + allSteps.add(new PanelDetails("Confront the killer", Arrays.asList(goThroughSapphireDoor, reflectKnives, watchTheKillersReveal, pickUpKillersKnife, fightAbigale, leaveSapphireRoom, talkToMandy))); return allSteps; } } From 3d2389062230ff68b45e8198d4aff81d47c946d4 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sat, 14 Dec 2024 13:45:16 +0100 Subject: [PATCH 2/3] modernize --- .../misthalinmystery/MisthalinMystery.java | 61 ++++++++++--------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/questhelper/helpers/quests/misthalinmystery/MisthalinMystery.java b/src/main/java/com/questhelper/helpers/quests/misthalinmystery/MisthalinMystery.java index c16b1bd0cb..7a5f135adb 100644 --- a/src/main/java/com/questhelper/helpers/quests/misthalinmystery/MisthalinMystery.java +++ b/src/main/java/com/questhelper/helpers/quests/misthalinmystery/MisthalinMystery.java @@ -78,49 +78,50 @@ public Map loadSteps() initializeRequirements(); setupConditions(); setupSteps(); - Map steps = new HashMap<>(); + + var steps = new HashMap(); steps.put(0, talkToAbigale); steps.put(5, talkToAbigale); - ConditionalStep investigatingTheBarrel = new ConditionalStep(this, takeTheBoat); + var investigatingTheBarrel = new ConditionalStep(this, takeTheBoat); investigatingTheBarrel.addStep(new Conditions(onIsland, bucket), searchTheBarrel); investigatingTheBarrel.addStep(onIsland, takeTheBucket); steps.put(10, investigatingTheBarrel); steps.put(15, investigatingTheBarrel); - ConditionalStep emptyTheBarrel = new ConditionalStep(this, takeTheBoat); + var emptyTheBarrel = new ConditionalStep(this, takeTheBoat); emptyTheBarrel.addStep(new Conditions(onIsland, bucket), useBucketOnBarrel); emptyTheBarrel.addStep(onIsland, takeTheBucket); steps.put(20, emptyTheBarrel); - ConditionalStep enterTheHouse = new ConditionalStep(this, takeTheBoat); + var enterTheHouse = new ConditionalStep(this, takeTheBoat); enterTheHouse.addStep(new Conditions(onIsland, manorKey), openManorDoor); enterTheHouse.addStep(onIsland, searchTheBarrelForKey); steps.put(25, enterTheHouse); - ConditionalStep pinkDoor = new ConditionalStep(this, takeTheBoat); + var pinkDoor = new ConditionalStep(this, takeTheBoat); pinkDoor.addStep(knife, tryToOpenPinkKnobDoor); pinkDoor.addStep(onIsland, takeKnife); steps.put(30, pinkDoor); - ConditionalStep pickUpAndReadNotes1 = new ConditionalStep(this, takeTheBoat); + var pickUpAndReadNotes1 = new ConditionalStep(this, takeTheBoat); pickUpAndReadNotes1.addStep(new Conditions(onIsland, notes1), readNotes1); pickUpAndReadNotes1.addStep(onIsland, takeNote1); steps.put(35, pickUpAndReadNotes1); - ConditionalStep cutPainting = new ConditionalStep(this, takeTheBoat); + var cutPainting = new ConditionalStep(this, takeTheBoat); cutPainting.addStep(new Conditions(onIsland, knife), useKnifeOnPainting); cutPainting.addStep(onIsland, takeKnife); steps.put(40, cutPainting); - ConditionalStep enterRubyRoom = new ConditionalStep(this, takeTheBoat); + var enterRubyRoom = new ConditionalStep(this, takeTheBoat); enterRubyRoom.addStep(new Conditions(onIsland, rubyKey), goThroughRubyDoor); enterRubyRoom.addStep(onIsland, searchPainting); steps.put(45, enterRubyRoom); - ConditionalStep lightCandles = new ConditionalStep(this, takeTheBoat); + var lightCandles = new ConditionalStep(this, takeTheBoat); lightCandles.addStep(new Conditions(onIsland, tinderbox, litCandle1, litCandle2, litCandle3), lightCandle4); lightCandles.addStep(new Conditions(onIsland, tinderbox, litCandle1, litCandle2), lightCandle3); lightCandles.addStep(new Conditions(onIsland, tinderbox, litCandle1), lightCandle2); @@ -128,24 +129,24 @@ public Map loadSteps() lightCandles.addStep(onIsland, takeTinderbox); steps.put(50, lightCandles); - ConditionalStep lightFuseOnBarrel = new ConditionalStep(this, takeTheBoat); + var lightFuseOnBarrel = new ConditionalStep(this, takeTheBoat); lightFuseOnBarrel.addStep(new Conditions(onIsland, tinderbox), lightBarrel); lightFuseOnBarrel.addStep(onIsland, takeTinderbox); steps.put(55, lightFuseOnBarrel); steps.put(60, leaveExplosionRoom); - ConditionalStep goToLacey = new ConditionalStep(this, takeTheBoat); + var goToLacey = new ConditionalStep(this, takeTheBoat); goToLacey.addStep(inOutsideArea, observeThroughTree); goToLacey.addStep(onIsland, climbWall); steps.put(65, goToLacey); - ConditionalStep pickUpAndReadNotes2 = new ConditionalStep(this, takeTheBoat); + var pickUpAndReadNotes2 = new ConditionalStep(this, takeTheBoat); pickUpAndReadNotes2.addStep(notes2, readNotes2); pickUpAndReadNotes2.addStep(inOutsideArea, takeNote2); pickUpAndReadNotes2.addStep(onIsland, climbWall); steps.put(70, pickUpAndReadNotes2); - ConditionalStep playMusic = new ConditionalStep(this, takeTheBoat); + var playMusic = new ConditionalStep(this, takeTheBoat); playMusic.addStep(playedA, playDAgain); playMusic.addStep(playedE, playA); playMusic.addStep(playedD, playE); @@ -155,28 +156,28 @@ public Map loadSteps() playMusic.addStep(onIsland, climbWall); steps.put(75, playMusic); - ConditionalStep openingTheEmeraldDoor = new ConditionalStep(this, takeTheBoat); + var openingTheEmeraldDoor = new ConditionalStep(this, takeTheBoat); openingTheEmeraldDoor.addStep(new Conditions(inOutsideArea, emeraldKey), returnOverBrokenWall); openingTheEmeraldDoor.addStep(inOutsideArea, searchThePiano); openingTheEmeraldDoor.addStep(new Conditions(onIsland, emeraldKey), openEmeraldDoor); openingTheEmeraldDoor.addStep(onIsland, climbWall); steps.put(80, openingTheEmeraldDoor); - ConditionalStep enterBandosGodswordRoom = new ConditionalStep(this, takeTheBoat); + var enterBandosGodswordRoom = new ConditionalStep(this, takeTheBoat); enterBandosGodswordRoom.addStep(onIsland, enterBandosGodswordRoomStep); steps.put(85, enterBandosGodswordRoom); - ConditionalStep startPuzzle3 = new ConditionalStep(this, takeTheBoat); + var startPuzzle3 = new ConditionalStep(this, takeTheBoat); startPuzzle3.addStep(new Conditions(onIsland, notes3), readNotes3); startPuzzle3.addStep(onIsland, takeNote3); steps.put(90, startPuzzle3); - ConditionalStep openFireplace = new ConditionalStep(this, takeTheBoat); + var openFireplace = new ConditionalStep(this, takeTheBoat); openFireplace.addStep(new Conditions(onIsland, knife), useKnifeOnFireplace); openFireplace.addStep(onIsland, takeKnife); steps.put(95, openFireplace); - ConditionalStep solveFireplacePuzzle = new ConditionalStep(this, takeTheBoat); + var solveFireplacePuzzle = new ConditionalStep(this, takeTheBoat); solveFireplacePuzzle.addStep(selectedOnyx, clickRuby); solveFireplacePuzzle.addStep(selectedEmerald, clickOnyx); solveFireplacePuzzle.addStep(selectedZenyte, clickEmerald); @@ -187,33 +188,33 @@ public Map loadSteps() solveFireplacePuzzle.addStep(onIsland, searchFireplace); steps.put(100, solveFireplacePuzzle); - ConditionalStep openSapphireDoor = new ConditionalStep(this, takeTheBoat); + var openSapphireDoor = new ConditionalStep(this, takeTheBoat); openSapphireDoor.addStep(new Conditions(onIsland, sapphireKey), goThroughSapphireDoor); openSapphireDoor.addStep(onIsland, searchFireplaceForSapphireKey); steps.put(105, openSapphireDoor); - ConditionalStep goDoBoss = new ConditionalStep(this, takeTheBoat); + var goDoBoss = new ConditionalStep(this, takeTheBoat); goDoBoss.addStep(inBossRoom, reflectKnives); goDoBoss.addStep(onIsland, goThroughSapphireDoor); steps.put(110, goDoBoss); steps.put(111, goDoBoss); - ConditionalStep watchRevealCutscene = new ConditionalStep(this, takeTheBoat); + var watchRevealCutscene = new ConditionalStep(this, takeTheBoat); watchRevealCutscene.addStep(inBossRoom, watchTheKillersReveal); watchRevealCutscene.addStep(onIsland, continueThroughSapphireDoor); steps.put(115, watchRevealCutscene); - ConditionalStep goFightAbigale = new ConditionalStep(this, takeTheBoat); + var goFightAbigale = new ConditionalStep(this, takeTheBoat); goFightAbigale.addStep(new Conditions(inBossRoom, killersKnife), fightAbigale); goFightAbigale.addStep(inBossRoom, pickUpKillersKnife); goFightAbigale.addStep(onIsland, continueThroughSapphireDoor); steps.put(120, goFightAbigale); - ConditionalStep attemptToLeaveSapphireRoom = new ConditionalStep(this, takeTheBoat); + var attemptToLeaveSapphireRoom = new ConditionalStep(this, takeTheBoat); attemptToLeaveSapphireRoom.addStep(onIsland, leaveSapphireRoom); steps.put(125, attemptToLeaveSapphireRoom); - ConditionalStep finishTheQuest = new ConditionalStep(this, takeTheBoat); + var finishTheQuest = new ConditionalStep(this, takeTheBoat); finishTheQuest.addStep(onIsland, talkToMandy); steps.put(130, finishTheQuest); @@ -378,22 +379,25 @@ public QuestPointReward getQuestPointReward() @Override public List getExperienceRewards() { - return Collections.singletonList(new ExperienceReward(Skill.CRAFTING, 600)); + return List.of( + new ExperienceReward(Skill.CRAFTING, 600) + ); } @Override public List getItemRewards() { - return Arrays.asList( + return List.of( new ItemReward("Uncut Ruby", ItemID.UNCUT_RUBY, 1), new ItemReward("Uncut Emerald", ItemID.UNCUT_EMERALD, 1), - new ItemReward("Uncut Sapphire", ItemID.UNCUT_SAPPHIRE, 1)); + new ItemReward("Uncut Sapphire", ItemID.UNCUT_SAPPHIRE, 1) + ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); + var allSteps = new ArrayList(); allSteps.add(new PanelDetails("Talk to Abigale", Collections.singletonList(talkToAbigale))); allSteps.add(new PanelDetails("Enter the manor", Arrays.asList(takeTheBoat, takeTheBucket, searchTheBarrel, useBucketOnBarrel, searchTheBarrelForKey, openManorDoor))); @@ -403,6 +407,7 @@ public List getPanels() allSteps.add(new PanelDetails("Witness another murder", Arrays.asList(returnOverBrokenWall, openEmeraldDoor, enterBandosGodswordRoomStep))); allSteps.add(new PanelDetails("Solve the fourth puzzle", Arrays.asList(takeNote3, readNotes3, useKnifeOnFireplace, searchFireplace, clickSapphire, clickDiamond, clickZenyte, clickEmerald, clickOnyx, clickRuby, searchFireplaceForSapphireKey))); allSteps.add(new PanelDetails("Confront the killer", Arrays.asList(goThroughSapphireDoor, reflectKnives, watchTheKillersReveal, pickUpKillersKnife, fightAbigale, leaveSapphireRoom, talkToMandy))); + return allSteps; } } From a2ecf1ea274ab7f9f75a840c693bbbdcc74de063 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sat, 14 Dec 2024 13:46:57 +0100 Subject: [PATCH 3/3] reformat: move definitions to their own lines & make their types proper --- .../misthalinmystery/MisthalinMystery.java | 133 ++++++++++++++---- 1 file changed, 106 insertions(+), 27 deletions(-) diff --git a/src/main/java/com/questhelper/helpers/quests/misthalinmystery/MisthalinMystery.java b/src/main/java/com/questhelper/helpers/quests/misthalinmystery/MisthalinMystery.java index 7a5f135adb..3a5576d46d 100644 --- a/src/main/java/com/questhelper/helpers/quests/misthalinmystery/MisthalinMystery.java +++ b/src/main/java/com/questhelper/helpers/quests/misthalinmystery/MisthalinMystery.java @@ -28,7 +28,6 @@ import com.questhelper.panel.PanelDetails; import com.questhelper.questhelpers.BasicQuestHelper; import com.questhelper.requirements.item.ItemRequirement; -import com.questhelper.requirements.Requirement; import com.questhelper.requirements.var.VarbitRequirement; import com.questhelper.requirements.zone.ZoneRequirement; import com.questhelper.requirements.conditional.Conditions; @@ -52,25 +51,105 @@ import net.runelite.api.*; import net.runelite.api.coords.WorldPoint; +import static com.questhelper.requirements.util.LogicHelper.and; public class MisthalinMystery extends BasicQuestHelper { - //Requirements - ItemRequirement bucket, manorKey, knife, notes1, rubyKey, tinderbox, notes2, emeraldKey, notes3, sapphireKey, killersKnife, killersKnifeEquipped; - - Requirement onIsland, litCandle1, litCandle2, litCandle3, inOutsideArea, inPianoWidget, playedD, playedE, - playedA, playedAnyKey, inGemWidget, selectedSaphire, selectedDiamond, selectedZenyte, selectedEmerald, selectedOnyx, - selectAnyGem, inBossRoom; - - QuestStep talkToAbigale, takeTheBoat, takeTheBucket, searchTheBarrel, useBucketOnBarrel, searchTheBarrelForKey, openManorDoor, - takeKnife, tryToOpenPinkKnobDoor, takeNote1, readNotes1, useKnifeOnPainting, searchPainting, goThroughRubyDoor, takeTinderbox, lightCandle1, lightCandle2, - lightCandle3, lightCandle4, lightBarrel, leaveExplosionRoom, climbWall, observeThroughTree, takeNote2, readNotes2, playPiano, playD, playE, playA, playDAgain, restartPiano, - searchThePiano, returnOverBrokenWall, openEmeraldDoor, enterBandosGodswordRoomStep, takeNote3, readNotes3, useKnifeOnFireplace, searchFireplace, clickSapphire, clickDiamond, - clickZenyte, clickEmerald, clickOnyx, clickRuby, restartGems, searchFireplaceForSapphireKey, goThroughSapphireDoor, reflectKnives, continueThroughSapphireDoor, watchTheKillersReveal, - pickUpKillersKnife, fightAbigale, leaveSapphireRoom, talkToMandy; - - //Zones - private Zone island, outside1, outside2, outside3, bossRoom; + // Requirements + ItemRequirement bucket; + ItemRequirement manorKey; + ItemRequirement knife; + ItemRequirement notes1; + ItemRequirement rubyKey; + ItemRequirement tinderbox; + ItemRequirement notes2; + ItemRequirement emeraldKey; + ItemRequirement notes3; + ItemRequirement sapphireKey; + ItemRequirement killersKnife; + ItemRequirement killersKnifeEquipped; + ZoneRequirement onIsland; + ZoneRequirement inOutsideArea; + ZoneRequirement inBossRoom; + VarbitRequirement litCandle1; + VarbitRequirement litCandle2; + VarbitRequirement litCandle3; + WidgetTextRequirement inPianoWidget; + Conditions playedD; + Conditions playedE; + Conditions playedA; + VarbitRequirement playedAnyKey; + WidgetTextRequirement inGemWidget; + Conditions selectedSaphire; + Conditions selectedDiamond; + Conditions selectedZenyte; + Conditions selectedEmerald; + Conditions selectedOnyx; + VarbitRequirement selectAnyGem; + + // Steps + NpcStep talkToAbigale; + ObjectStep takeTheBoat; + ObjectStep takeTheBucket; + ObjectStep searchTheBarrel; + ObjectStep useBucketOnBarrel; + ObjectStep searchTheBarrelForKey; + ObjectStep openManorDoor; + ObjectStep takeKnife; + ObjectStep tryToOpenPinkKnobDoor; + ObjectStep takeNote1; + DetailedQuestStep readNotes1; + ObjectStep useKnifeOnPainting; + ObjectStep searchPainting; + ObjectStep goThroughRubyDoor; + ObjectStep takeTinderbox; + ObjectStep lightCandle1; + ObjectStep lightCandle2; + ObjectStep lightCandle3; + ObjectStep lightCandle4; + ObjectStep lightBarrel; + ObjectStep leaveExplosionRoom; + ObjectStep climbWall; + ObjectStep observeThroughTree; + ObjectStep takeNote2; + DetailedQuestStep readNotes2; + ObjectStep playPiano; + WidgetStep playD; + WidgetStep playE; + WidgetStep playA; + WidgetStep playDAgain; + DetailedQuestStep restartPiano; + ObjectStep searchThePiano; + ObjectStep returnOverBrokenWall; + ObjectStep openEmeraldDoor; + ObjectStep enterBandosGodswordRoomStep; + ObjectStep takeNote3; + DetailedQuestStep readNotes3; + ObjectStep useKnifeOnFireplace; + ObjectStep searchFireplace; + WidgetStep clickSapphire; + WidgetStep clickDiamond; + WidgetStep clickZenyte; + WidgetStep clickEmerald; + WidgetStep clickOnyx; + WidgetStep clickRuby; + DetailedQuestStep restartGems; + ObjectStep searchFireplaceForSapphireKey; + ObjectStep goThroughSapphireDoor; + DetailedQuestStep reflectKnives; + ObjectStep continueThroughSapphireDoor; + DetailedQuestStep watchTheKillersReveal; + DetailedQuestStep pickUpKillersKnife; + NpcStep fightAbigale; + ObjectStep leaveSapphireRoom; + NpcStep talkToMandy; + + // Zones + Zone island; + Zone outside1; + Zone outside2; + Zone outside3; + Zone bossRoom; @Override public Map loadSteps() @@ -235,24 +314,24 @@ public void setupConditions() { onIsland = new ZoneRequirement(island); inOutsideArea = new ZoneRequirement(outside1, outside2, outside3); + inBossRoom = new ZoneRequirement(bossRoom); litCandle1 = new VarbitRequirement(4042, 1); litCandle2 = new VarbitRequirement(4041, 1); litCandle3 = new VarbitRequirement(4039, 1); - playedD = new Conditions(new VarbitRequirement(4044, 1), new VarbitRequirement(4049, 1)); - playedE = new Conditions(new VarbitRequirement(4045, 1), new VarbitRequirement(4049, 2)); - playedA = new Conditions(new VarbitRequirement(4046, 1), new VarbitRequirement(4049, 3)); + playedD = and(new VarbitRequirement(4044, 1), new VarbitRequirement(4049, 1)); + playedE = and(new VarbitRequirement(4045, 1), new VarbitRequirement(4049, 2)); + playedA = and(new VarbitRequirement(4046, 1), new VarbitRequirement(4049, 3)); playedAnyKey = new VarbitRequirement(4049, 1, Operation.GREATER_EQUAL); inPianoWidget = new WidgetTextRequirement(554, 20, "C"); inGemWidget = new WidgetTextRequirement(555, 1, 1, "Gemstone switch panel"); - selectedSaphire = new Conditions(new VarbitRequirement(4051, 1), new VarbitRequirement(4050, 1)); - selectedDiamond = new Conditions(new VarbitRequirement(4052, 1), new VarbitRequirement(4050, 2)); - selectedZenyte = new Conditions(new VarbitRequirement(4053, 1), new VarbitRequirement(4050, 3)); - selectedEmerald = new Conditions(new VarbitRequirement(4054, 1), new VarbitRequirement(4050, 4)); - selectedOnyx = new Conditions(new VarbitRequirement(4055, 1), new VarbitRequirement(4050, 5)); + selectedSaphire = and(new VarbitRequirement(4051, 1), new VarbitRequirement(4050, 1)); + selectedDiamond = and(new VarbitRequirement(4052, 1), new VarbitRequirement(4050, 2)); + selectedZenyte = and(new VarbitRequirement(4053, 1), new VarbitRequirement(4050, 3)); + selectedEmerald = and(new VarbitRequirement(4054, 1), new VarbitRequirement(4050, 4)); + selectedOnyx = and(new VarbitRequirement(4055, 1), new VarbitRequirement(4050, 5)); selectAnyGem = new VarbitRequirement(4050, 1, Operation.GREATER_EQUAL); - inBossRoom = new ZoneRequirement(bossRoom); } @Override @@ -284,7 +363,7 @@ public void setupSteps() searchTheBarrelForKey = new ObjectStep(this, NullObjectID.NULL_29649, new WorldPoint(1615, 4829, 0), "Search the barrel of rainwater for the manor key."); useBucketOnBarrel.addIcon(ItemID.BUCKET); openManorDoor = new ObjectStep(this, ObjectID.LARGE_DOOR_30110, new WorldPoint(1636, 4824, 0), "Enter the manor.", true); - ((ObjectStep) openManorDoor).addAlternateObjects(ObjectID.LARGE_DOOR_30111); + openManorDoor.addAlternateObjects(ObjectID.LARGE_DOOR_30111); takeKnife = new ObjectStep(this, ObjectID.TABLE_30145, new WorldPoint(1639, 4831, 0), "Take the knife from the table.", knife); tryToOpenPinkKnobDoor = new ObjectStep(this, ObjectID.DOOR_30112, new WorldPoint(1635, 4838, 0), "Try to open the door with the pink handle."); takeNote1 = new ObjectStep(this, NullObjectID.NULL_2266, new WorldPoint(1635, 4839, 0), "Pick up the note that appeared.");