From a17a9b5bd8dd31d3411919ba41f3169850df41d4 Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Tue, 22 Oct 2024 14:06:17 -0700 Subject: [PATCH] refactor LX_agNonAdv() into LM_avantGuard() --- BUILD/task_order/Avant Guard.dat | 17 ++- RELEASE/data/autoscend_task_order.txt | 109 +++++++++--------- RELEASE/scripts/autoscend/auto_familiar.ash | 44 +++++-- RELEASE/scripts/autoscend/auto_util.ash | 5 +- .../scripts/autoscend/autoscend_header.ash | 2 +- .../scripts/autoscend/paths/avant_guard.ash | 16 ++- RELEASE/scripts/autoscend/quests/level_03.ash | 4 - .../scripts/autoscend/quests/level_any.ash | 7 +- 8 files changed, 105 insertions(+), 99 deletions(-) diff --git a/BUILD/task_order/Avant Guard.dat b/BUILD/task_order/Avant Guard.dat index b1f09f731..edd299ff2 100644 --- a/BUILD/task_order/Avant Guard.dat +++ b/BUILD/task_order/Avant Guard.dat @@ -11,10 +11,7 @@ L5_findKnob L12_sonofaPrefix LX_burnDelay LX_summonMonster -# path handling which should be in it's own task order but pre-dates task order functionality (tech debt FTW). -LM_edTheUndying -LX_bugbearInvasion -LX_lowkeySummer +LM_avantGuard # make sure we don't waste turns of Ultrahydrated doing something else. L11_aridDesert L11_hasUltrahydrated # Lock in the Shen zones as soon as we can as it (potentially) unlocks a bunch of stuff. @@ -40,15 +37,15 @@ L5_findKnob # Do the War early. Access to the Orchard is useful for booze/potions and maybe we can make use of the green smoke bombs? L12_islandWar # Fix that dripping tap. -L3_tavern LX_agNonAdv +L3_tavern # Finish off the Goblin King. -L5_slayTheGoblinKing LX_agNonAdv +L5_slayTheGoblinKing # Kill the undead? Is this an oxymoron? -L7_crypt LX_agNonAdv +L7_crypt # Kill Groar because *we* are the monsters. -L8_trapperQuest LX_agNonAdv -L11_mauriceSpookyraven LX_agNonAdv -L11_defeatEd LX_agNonAdv +L8_trapperQuest +L11_mauriceSpookyraven +L11_defeatEd # Start the macguffin quest L11_blackMarket L11_forgedDocuments diff --git a/RELEASE/data/autoscend_task_order.txt b/RELEASE/data/autoscend_task_order.txt index 525f8dc67..4fdeb8687 100644 --- a/RELEASE/data/autoscend_task_order.txt +++ b/RELEASE/data/autoscend_task_order.txt @@ -106,97 +106,94 @@ Avant Guard 9 L5_findKnob Avant Guard 10 L12_sonofaPrefix Avant Guard 11 LX_burnDelay Avant Guard 12 LX_summonMonster -# path handling which should be in it's own task order but pre-dates task order functionality (tech debt FTW). -Avant Guard 13 LM_edTheUndying -Avant Guard 14 LX_bugbearInvasion -Avant Guard 15 LX_lowkeySummer +Avant Guard 13 LM_avantGuard # make sure we don't waste turns of Ultrahydrated doing something else. -Avant Guard 16 L11_aridDesert L11_hasUltrahydrated +Avant Guard 14 L11_aridDesert L11_hasUltrahydrated # Lock in the Shen zones as soon as we can as it (potentially) unlocks a bunch of stuff. -Avant Guard 17 L11_shenStartQuest +Avant Guard 15 L11_shenStartQuest # Build the Bridge when we have enough parts as we may want to spend daily resources at the peaks. -Avant Guard 18 finishBuildingSmutOrcBridge +Avant Guard 16 finishBuildingSmutOrcBridge # Call quest handlers based on current state if applicable -Avant Guard 19 auto_earlyRoutingHandling +Avant Guard 17 auto_earlyRoutingHandling # Guild access. -Avant Guard 20 LX_guildUnlock +Avant Guard 18 LX_guildUnlock # Desert access, Daily Dungeon and other early random stuff that we don't want to miss. -Avant Guard 21 LX_unlockDesert -Avant Guard 22 LX_lockPicking -Avant Guard 23 LX_fatLootToken +Avant Guard 19 LX_unlockDesert +Avant Guard 20 LX_lockPicking +Avant Guard 21 LX_fatLootToken # Get the Steel Organ if the user wants it (needs L6 quest complete) -Avant Guard 24 LX_steelOrgan +Avant Guard 22 LX_steelOrgan # open up delay zones. -Avant Guard 25 LX_spookyravenManorFirstFloor +Avant Guard 23 LX_spookyravenManorFirstFloor # open up zones where we want to force non-combats. # Open up underground zones so they are available for Breathitin. -Avant Guard 26 L5_getEncryptionKey -Avant Guard 27 L5_findKnob +Avant Guard 24 L5_getEncryptionKey +Avant Guard 25 L5_findKnob # Do the War early. Access to the Orchard is useful for booze/potions and maybe we can make use of the green smoke bombs? -Avant Guard 28 L12_islandWar +Avant Guard 26 L12_islandWar # Fix that dripping tap. -Avant Guard 29 L3_tavern LX_agNonAdv +Avant Guard 27 L3_tavern # Finish off the Goblin King. -Avant Guard 30 L5_slayTheGoblinKing LX_agNonAdv +Avant Guard 28 L5_slayTheGoblinKing # Kill the undead? Is this an oxymoron? -Avant Guard 31 L7_crypt LX_agNonAdv +Avant Guard 29 L7_crypt # Kill Groar because *we* are the monsters. -Avant Guard 32 L8_trapperQuest LX_agNonAdv -Avant Guard 33 L11_mauriceSpookyraven LX_agNonAdv -Avant Guard 34 L11_defeatEd LX_agNonAdv +Avant Guard 30 L8_trapperQuest +Avant Guard 31 L11_mauriceSpookyraven +Avant Guard 32 L11_defeatEd # Start the macguffin quest -Avant Guard 35 L11_blackMarket -Avant Guard 36 L11_forgedDocuments -Avant Guard 37 L11_mcmuffinDiary -Avant Guard 38 L11_getBeehive +Avant Guard 33 L11_blackMarket +Avant Guard 34 L11_forgedDocuments +Avant Guard 35 L11_mcmuffinDiary +Avant Guard 36 L11_getBeehive # open the hidden city up (delay zones) -Avant Guard 39 L2_mosquito -Avant Guard 40 LX_unlockHiddenTemple -Avant Guard 41 L6_dakotaFanning -Avant Guard 42 L11_unlockHiddenCity +Avant Guard 37 L2_mosquito +Avant Guard 38 LX_unlockHiddenTemple +Avant Guard 39 L6_dakotaFanning +Avant Guard 40 L11_unlockHiddenCity # Murder pygmies for the ancient amulet. -Avant Guard 43 L11_hiddenCityZones -Avant Guard 44 L11_hiddenCity +Avant Guard 41 L11_hiddenCityZones +Avant Guard 42 L11_hiddenCity # Dance with lady spookyraven so we can go murder her undead husband and take the Eye of Ed -Avant Guard 45 LX_spookyravenManorSecondFloor -Avant Guard 46 L11_mauriceSpookyraven +Avant Guard 43 LX_spookyravenManorSecondFloor +Avant Guard 44 L11_mauriceSpookyraven # Lay the smack down on those Jerk Copperhead twins -Avant Guard 47 L11_talismanOfNam +Avant Guard 45 L11_talismanOfNam # Open up the top of the beanstalk. -Avant Guard 48 L10_plantThatBean +Avant Guard 46 L10_plantThatBean # Clean up the plains -Avant Guard 49 L10_rainOnThePlains +Avant Guard 47 L10_rainOnThePlains # Get Black Angus his pizza -Avant Guard 50 L9_chasmBuild -Avant Guard 51 L9_highLandlord +Avant Guard 48 L9_chasmBuild +Avant Guard 49 L9_highLandlord # Kill Groar because *we* are the monsters. -Avant Guard 52 L8_trapperQuest +Avant Guard 50 L8_trapperQuest # Kill the undead? Is this an oxymoron? -Avant Guard 53 L7_crypt +Avant Guard 51 L7_crypt # Cleanse the taint. -Avant Guard 54 L6_friarsGetParts +Avant Guard 52 L6_friarsGetParts # Finish the other Macguffin zones so we can beat Ed to death repeatedly and waste all his Ka coins. -Avant Guard 55 L11_palindome -Avant Guard 56 L11_aridDesert -Avant Guard 57 L11_unlockPyramid -Avant Guard 58 L11_unlockEd -Avant Guard 59 L11_defeatEd +Avant Guard 53 L11_palindome +Avant Guard 54 L11_aridDesert +Avant Guard 55 L11_unlockPyramid +Avant Guard 56 L11_unlockEd +Avant Guard 57 L11_defeatEd # Finish off the Goblin King. -Avant Guard 60 L5_slayTheGoblinKing +Avant Guard 58 L5_slayTheGoblinKing # Show the Boss bat who's boss. -Avant Guard 61 L4_batCave +Avant Guard 59 L4_batCave # Fix that dripping tap. -Avant Guard 62 L3_tavern +Avant Guard 60 L3_tavern # Basic fetch quest is the first thing the council demand of you. Is this 2002 or what? -Avant Guard 63 L2_mosquito +Avant Guard 61 L2_mosquito # There's an extra task in KoE -Avant Guard 64 LX_koeInvaderHandler +Avant Guard 62 LX_koeInvaderHandler # "win" the contests, navigate the maze, unlock the door, climb the tower, commit sorceresscide. -Avant Guard 65 L13_towerAscent +Avant Guard 63 L13_towerAscent # release the hounds! -Avant Guard 66 auto_softBlockHandler +Avant Guard 64 auto_softBlockHandler # if all else fails, powerlevel like there's no tomorrow. -Avant Guard 67 LX_attemptPowerLevel +Avant Guard 65 LX_attemptPowerLevel Avatar of Jarlsberg 0 LM_jarlsberg Avatar of Jarlsberg 1 LX_freeCombatsTask diff --git a/RELEASE/scripts/autoscend/auto_familiar.ash b/RELEASE/scripts/autoscend/auto_familiar.ash index fc5a354c0..306cf5093 100644 --- a/RELEASE/scripts/autoscend/auto_familiar.ash +++ b/RELEASE/scripts/autoscend/auto_familiar.ash @@ -222,9 +222,24 @@ boolean canChangeToFamiliar(familiar target) } } - //Avant Guard specific allowance of Gelatinous Cubeling for non-adv.php zones - if(in_avantGuard() && !($familiars[Burly Bodyguard, Gelatinous Cubeling] contains target)) + // Avant Guard specific allowance of familiars for non-adv.php zones + if (in_avantGuard()) { + if ($familiar[Burly Bodyguard] == target) + { + return true; // always allowed + } + else if (get_property("auto_nonAdvLoc").to_boolean()) + { + if ($familiar[Gelatinous Cubeling] == target && in_hardcore()) + { + return true; // don't need Gel Cube in Normal + } + else if ($familiars[Cookbookbat, Mini Kiwi] contains target) + { + return true; // might be worth farming some of these drops if we can? + } + } return false; } @@ -426,15 +441,26 @@ boolean autoChooseFamiliar(location place) } // Can only use burly bodyguard, except in non-adventure.php zones. In those, we want the Gelatinous Cubeling for Daily Dungeon drops - if (in_avantGuard()) { - if (wantCubeling() && get_property("auto_nonAdvLoc").to_boolean() && in_hardcore()) - { - return handleFamiliar($familiar[Gelatinous Cubeling]); - } - else + if (in_avantGuard()) + { + if (get_property("auto_nonAdvLoc").to_boolean()) { - return handleFamiliar($familiar[Burly Bodyguard]); + if (wantCubeling()) + { + return handleFamiliar($familiar[Gelatinous Cubeling]); + } + else + { + foreach fam in $familiars[Mini Kiwi, Cookbookbat] + { + if (canChangeToFamiliar(fam)) + { + return handleFamiliar(fam); + } + } + } } + return handleFamiliar($familiar[Burly Bodyguard]); } //High priority checks that are too complicated for the datafile diff --git a/RELEASE/scripts/autoscend/auto_util.ash b/RELEASE/scripts/autoscend/auto_util.ash index 966138656..42335d915 100644 --- a/RELEASE/scripts/autoscend/auto_util.ash +++ b/RELEASE/scripts/autoscend/auto_util.ash @@ -2566,10 +2566,7 @@ int doNumberology(string goal, boolean doIt, string option) if(goal == "battlefield") { - if(in_avantGuard() && !LX_agNonAdv() && in_hardcore()) - { - handleFamiliar($familiar[Gelatinous Cubeling]); - } + set_property("auto_nonAdvLoc", true); string[int] pages; pages[0] = "runskillz.php?pwd&action=Skillz&whichskill=144&quantity=1"; pages[1] = "choice.php?whichchoice=1103&pwd=&option=1&num=" + numberology[numberwang]; diff --git a/RELEASE/scripts/autoscend/autoscend_header.ash b/RELEASE/scripts/autoscend/autoscend_header.ash index c18e6e818..b1d519443 100644 --- a/RELEASE/scripts/autoscend/autoscend_header.ash +++ b/RELEASE/scripts/autoscend/autoscend_header.ash @@ -611,7 +611,7 @@ void ag_initializeSettings(); void ag_pulls(); void ag_bgChat(); monster ag_bgToChat(); -boolean LX_agNonAdv(); +boolean LM_avantGuard(); boolean ag_is_bodyguard(); ######################################################################################################## diff --git a/RELEASE/scripts/autoscend/paths/avant_guard.ash b/RELEASE/scripts/autoscend/paths/avant_guard.ash index c339ca6d2..e6554f1bd 100644 --- a/RELEASE/scripts/autoscend/paths/avant_guard.ash +++ b/RELEASE/scripts/autoscend/paths/avant_guard.ash @@ -192,21 +192,19 @@ monster ag_bgToChat() return mon; } -boolean LX_agNonAdv() +boolean LM_avantGuard() { if (!in_avantGuard()) { - return true; - } - //no longer need to use Cubeling/don't have own - if(!wantCubeling() || !canChangeToFamiliar($familiar[Gelatinous Cubeling])) - { - return true; + return false; } - //want these to all be true in order to not come here. !wantCubeling above will skip this if we have all 3 cubeling items - if(LX_summonMonster() && L3_tavern() && L5_goblinKing() && L7_crypt() && L8_trapperGroar()) + if (LX_summonMonster() || L3_tavern() || L5_goblinKing() || L7_crypt() || L8_trapperGroar() || L11_defeatEd()) { + // functions which spend adventures in non-adv.php locations. + // Do these with high priority so we get the cubeling drops in HC and/or farm consumables with CBB/Mini Kiwi + // these require auto_nonAdvLoc to be set appropriately before adventuring. + // TODO: separate out Bonerdagon handling from L7_crypt() return true; } diff --git a/RELEASE/scripts/autoscend/quests/level_03.ash b/RELEASE/scripts/autoscend/quests/level_03.ash index 30448a561..a85226704 100644 --- a/RELEASE/scripts/autoscend/quests/level_03.ash +++ b/RELEASE/scripts/autoscend/quests/level_03.ash @@ -144,10 +144,6 @@ boolean auto_tavern() int actual = loc + 1; boolean needReset = false; set_property("auto_nonAdvLoc", true); - if(in_avantGuard() && !LX_agNonAdv()) - { - handleFamiliar($familiar[Gelatinous Cubeling]); - } if(autoAdvBypass("cellar.php?action=explore&whichspot=" + actual, $location[The Typical Tavern Cellar])) { diff --git a/RELEASE/scripts/autoscend/quests/level_any.ash b/RELEASE/scripts/autoscend/quests/level_any.ash index 76b604b6d..06b09db9d 100644 --- a/RELEASE/scripts/autoscend/quests/level_any.ash +++ b/RELEASE/scripts/autoscend/quests/level_any.ash @@ -609,11 +609,6 @@ boolean LX_dailyDungeonToken() return false; //can switch to cubeling so wait until we have all the tool drops before doing daily dungeon } - if(in_avantGuard() && !LX_agNonAdv()) - { - return false; //have not done non-adventure.php zones yet in Avant Guard - } - if(can_interact()) //if you can not use cubeling then mallbuy missing tools in casual and postronin { auto_buyUpTo(1, $item[Eleven-Foot Pole]); @@ -625,7 +620,7 @@ boolean LX_dailyDungeonToken() } //if you can not use the cubeling then pull the missing tools if possible - if (!auto_haveCCSC()) { + if (!auto_haveCCSC() && item_amount($item[Eleven-Foot Pole]) == 0) { // don't need the Eleven-foot Pole if we have the Candy Cane Sword Cane as it adds turn free NCs. pullXWhenHaveY($item[Eleven-Foot Pole], 1, 0); }