From 4f4869d4fe17311ca293366345a3c2fd6d5e678d Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Sun, 7 Jun 2020 22:52:33 -0700 Subject: [PATCH 01/52] bump version to 1.5.0 (#423) --- RELEASE/scripts/autoscend/autoscend_migration.ash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE/scripts/autoscend/autoscend_migration.ash b/RELEASE/scripts/autoscend/autoscend_migration.ash index d6d715b92..6058b5d33 100644 --- a/RELEASE/scripts/autoscend/autoscend_migration.ash +++ b/RELEASE/scripts/autoscend/autoscend_migration.ash @@ -1,6 +1,6 @@ script "autoscend_migration.ash" -static string __autoscend_version = "1.4.0"; +static string __autoscend_version = "1.5.0"; static int __autoscend_confirm_timeoutMS = 10000; static string __remove_sl_ascend_confirmation = "Looks like you have the old sl_ascend project installed as well. Would you like to remove it? (it is no longer maintained). Will default to false in 10 seconds."; static string __migrate_sl_ascend_properties_confirmation = "Looks like you may be migrating from sl_ascend. Starting with a fresh run using autoscend is adviable but we can try to migrate all the sl_ascend properties (results may vary). Will default to true in 10 seconds."; From c292d04146788aa8569f910bd2dc36a329b2c53f Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Mon, 8 Jun 2020 12:23:05 -0700 Subject: [PATCH 02/52] ensure we only switch to a familiar when calculating meat drop. (#426) (#427) Also fix the double check to actually fix these issues if they occur again somehow. --- RELEASE/scripts/autoscend/auto_pre_adv.ash | 3 ++- RELEASE/scripts/autoscend/quests/level_12.ash | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/RELEASE/scripts/autoscend/auto_pre_adv.ash b/RELEASE/scripts/autoscend/auto_pre_adv.ash index 879395265..3621f481d 100644 --- a/RELEASE/scripts/autoscend/auto_pre_adv.ash +++ b/RELEASE/scripts/autoscend/auto_pre_adv.ash @@ -257,7 +257,8 @@ boolean auto_pre_adventure() { // re-equip a familiar if it's a 100% run just in case something unequipped it // looking at you auto_maximizedConsumeStuff()... - handleFamiliar(get_property("auto_100familiar").to_familiar()); + // and L12_themtharHills()... + use_familiar(get_property("auto_100familiar").to_familiar()); auto_log_debug("Re-equipped your " + get_property("auto_100familiar") + " as something had unequipped it. This is bad and should be investigated."); } diff --git a/RELEASE/scripts/autoscend/quests/level_12.ash b/RELEASE/scripts/autoscend/quests/level_12.ash index 042905897..904a009b0 100644 --- a/RELEASE/scripts/autoscend/quests/level_12.ash +++ b/RELEASE/scripts/autoscend/quests/level_12.ash @@ -1636,7 +1636,10 @@ boolean L12_themtharHills() meat_need = meat_need - 100; } - use_familiar(to_familiar(get_property("auto_familiarChoice"))); + if(canChangeFamiliar()) { + // if we're in a 100% run, this property returns "none" which will unequip our familiar and ruin a 100% run. + use_familiar(to_familiar(get_property("auto_familiarChoice"))); + } float meatDropHave = meat_drop_modifier(); if (isActuallyEd() && have_skill($skill[Curse of Fortune]) && item_amount($item[Ka Coin]) > 0) From ea0b718a50b8ef5f50e5774062c0990ad6f6773d Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Wed, 10 Jun 2020 21:30:40 -0700 Subject: [PATCH 03/52] Testing a hypothesis that mafia encounters a race condition. (#429) --- RELEASE/scripts/autoscend/iotms/mr2019.ash | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RELEASE/scripts/autoscend/iotms/mr2019.ash b/RELEASE/scripts/autoscend/iotms/mr2019.ash index 38bdb7c4a..f079c974f 100644 --- a/RELEASE/scripts/autoscend/iotms/mr2019.ash +++ b/RELEASE/scripts/autoscend/iotms/mr2019.ash @@ -350,18 +350,21 @@ int auto_saberChargesAvailable() string auto_combatSaberBanish() { set_property("_auto_saberChoice", 1); + wait(3); return "skill " + $skill[Use the Force]; } string auto_combatSaberCopy() { set_property("_auto_saberChoice", 2); + wait(3); return "skill " + $skill[Use the Force]; } string auto_combatSaberYR() { set_property("_auto_saberChoice", 3); + wait(3); return "skill " + $skill[Use the Force]; } From d8a72c3d7736af25895d8dea9913e3a56e225e14 Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Thu, 11 Jun 2020 14:22:46 -0700 Subject: [PATCH 04/52] Race condition hypothesis proven false (#430) Try just not using the choiceAdventureScript and rely on mafia to handle the post-combat choice if we set the choiceAdventure property appropriately. --- RELEASE/scripts/autoscend.ash | 1 + RELEASE/scripts/autoscend/auto_choice_adv.ash | 3 --- RELEASE/scripts/autoscend/iotms/mr2019.ash | 9 +++------ 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/RELEASE/scripts/autoscend.ash b/RELEASE/scripts/autoscend.ash index 7f98bc76c..0dbc1c6bb 100644 --- a/RELEASE/scripts/autoscend.ash +++ b/RELEASE/scripts/autoscend.ash @@ -3088,6 +3088,7 @@ boolean doTasks() //These settings should never persist into another turn, ever. set_property("auto_doCombatCopy", "no"); set_property("auto_disableFamiliarChanging", false); + set_property("choiceAdventure1387", -1); // using the force non-combat print_header(); diff --git a/RELEASE/scripts/autoscend/auto_choice_adv.ash b/RELEASE/scripts/autoscend/auto_choice_adv.ash index e379144ac..97e6d76b6 100644 --- a/RELEASE/scripts/autoscend/auto_choice_adv.ash +++ b/RELEASE/scripts/autoscend/auto_choice_adv.ash @@ -453,9 +453,6 @@ boolean auto_run_choice(int choice, string page) case 1342: // Torpor (Dark Gyffte) bat_reallyPickSkills(20); break; - case 1387: // Using the Force (Fourth of May Cosplay Saber) - run_choice(get_property("_auto_saberChoice").to_int()); - break; default: break; } diff --git a/RELEASE/scripts/autoscend/iotms/mr2019.ash b/RELEASE/scripts/autoscend/iotms/mr2019.ash index f079c974f..55de97511 100644 --- a/RELEASE/scripts/autoscend/iotms/mr2019.ash +++ b/RELEASE/scripts/autoscend/iotms/mr2019.ash @@ -349,22 +349,19 @@ int auto_saberChargesAvailable() string auto_combatSaberBanish() { - set_property("_auto_saberChoice", 1); - wait(3); + set_property("choiceAdventure1387", 1); return "skill " + $skill[Use the Force]; } string auto_combatSaberCopy() { - set_property("_auto_saberChoice", 2); - wait(3); + set_property("choiceAdventure1387", 2); return "skill " + $skill[Use the Force]; } string auto_combatSaberYR() { - set_property("_auto_saberChoice", 3); - wait(3); + set_property("choiceAdventure1387", 3); return "skill " + $skill[Use the Force]; } From c62eaf26b26bafb8c5ea0e97ca75d987ca36cf65 Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Sat, 13 Jun 2020 23:32:35 -0600 Subject: [PATCH 05/52] desert unlocking, get compass, and a few other things (#428) desert unlocking, get compass, and a few other things: *desert unlocking made into its own function instead of piggy backing over bitchin meatcar function. *boolean isDesertAvailable() created and used *boolean inKnollSign() created and used *boolean inCanadiaSign() created and used *boolean inGnomeSign() created and used *boolean allowSoftblockShen() created and used *general refactoring of old code in regards to dowsing rod & compass in the desert. *moved ornate dowsing rod NC handling to auto_choice_adv.ash *moved doVacation NC handling to auto_choice_adv.ash *verify you have enough meat and adventures left before vacationing in doVacation() *if we are doing the desert right now, ignore the requirement to be at least day 2 to do the dowsing rod *pull a grimstone mask to make a dowsing rod if possible and we cannot use a golem familiar. 9+ adv saved on a single pull is worth a pull *fixed desert failing to grab a compass in hardcore. *added check for property _auto_doneToday. which lets us inform doTasks() that it should stop early. **if we only have under 7 adv left. and want to get dowsing rod, then we will finish the day early. saving those adv for tomorrow when we will ge the rod. **there are probably some other places it should be used instead of an abort. *instead of using while(check1 && check2 && check3 && check4 && check5 && check6 && doTasks()) to call the main loop which is doTasks(). We now use while(doTasks()) and those checks are instead done immediately at the start of doTasks(). each in its own if (making it far clearer to see where one check begins and another ends. as some checks involved multiple conditions grouped together in a ()). And also with comments explaining what each check does. *removed wearing a hardcoded outfit in aftercore. *First try to do other things before aborting for lack of meat to buy forged identification papers. ** return false first, abort if isAboutToPowerlevel() *refactor L11_unlockPyramid() *if we fail to identify what mask the enemy is wearing in disguise delimit then abort instead of just spamming saucegeyser. --- RELEASE/scripts/autoscend.ash | 110 ++++--- RELEASE/scripts/autoscend/auto_choice_adv.ash | 24 ++ RELEASE/scripts/autoscend/auto_combat.ash | 5 + .../scripts/autoscend/auto_deprecation.ash | 5 + RELEASE/scripts/autoscend/auto_util.ash | 56 +++- RELEASE/scripts/autoscend/auto_zone.ash | 4 +- .../scripts/autoscend/autoscend_header.ash | 11 +- RELEASE/scripts/autoscend/iotms/mr2014.ash | 84 ++++-- RELEASE/scripts/autoscend/iotms/mr2019.ash | 15 +- .../paths/actually_ed_the_undying.ash | 3 +- .../autoscend/paths/avatar_of_boris.ash | 1 - .../autoscend/paths/avatar_of_sneaky_pete.ash | 1 - .../scripts/autoscend/paths/dark_gyffte.ash | 1 - .../autoscend/paths/disguises_delimit.ash | 1 - RELEASE/scripts/autoscend/paths/g_lover.ash | 1 - .../paths/kingdom_of_exploathing.ash | 1 - .../autoscend/paths/license_to_adventure.ash | 2 +- .../autoscend/paths/live_ascend_repeat.ash | 8 - .../autoscend/paths/nuclear_autumn.ash | 1 - .../autoscend/paths/pocket_familiars.ash | 1 - RELEASE/scripts/autoscend/quests/level_11.ash | 269 +++++++----------- .../scripts/autoscend/quests/level_any.ash | 79 +++-- 22 files changed, 368 insertions(+), 315 deletions(-) diff --git a/RELEASE/scripts/autoscend.ash b/RELEASE/scripts/autoscend.ash index 0dbc1c6bb..b5ed0a28e 100644 --- a/RELEASE/scripts/autoscend.ash +++ b/RELEASE/scripts/autoscend.ash @@ -177,12 +177,11 @@ void initializeSettings() set_property("auto_powerLevelLastAttempted", "0"); set_property("auto_pulls", ""); - // Day on which the Shen quest was started. Required to predict which zones to avoid until Shen tells us to go there. + // Day on which the Shen quest was started. Required to predict which zones to avoid until Shen tells us to go there. set_property("auto_shenStarted", ""); // Last level during which we ran out of stuff to do without pre-completing some Shen quests. set_property("auto_shenSkipLastLevel", 0); - set_property("auto_skipDesert", 0); set_property("auto_snapshot", ""); set_property("auto_sniffs", ""); set_property("auto_waitingArrowAlcove", "50"); @@ -229,7 +228,6 @@ void initializeSettings() bond_initializeSettings(); fallout_initializeSettings(); pete_initializeSettings(); - groundhog_initializeSettings(); digimon_initializeSettings(); majora_initializeSettings(); glover_initializeSettings(); @@ -851,29 +849,37 @@ int handlePulls(int day) return pulls_remaining(); } -boolean doVacation() +boolean LX_doVacation() { if(in_koe()) { - return false; + return false; //cannot vacation in kingdom of exploathing path } - if(in_zelda()) + + int meat_needed = 500; + int adv_needed = 3; + int adv_budget = my_adventures() - auto_advToReserve(); + if(my_path() == "Way of the Surprising Fist") { - zelda_equipTool($stat[moxie]); - equipMaximizedGear(); + meat_needed = 5; + adv_needed = 5; } - if(my_primestat() == $stat[Muscle]) + if(adv_needed > adv_budget) { - set_property("choiceAdventure793", "1"); + auto_log_info("I want to vacation but I do not have enough adventures left", "red"); + return false; } - else if(my_primestat() == $stat[Mysticality]) + if(meat_needed > my_meat()) { - set_property("choiceAdventure793", "2"); + auto_log_info("I want to vacation but I do not have enough meat", "red"); + return false; } - else + if(in_zelda()) //avoid error for not having plumber gear equipped. { - set_property("choiceAdventure793", "3"); + zelda_equipTool($stat[moxie]); + equipMaximizedGear(); } + return autoAdv(1, $location[The Shore\, Inc. Travel Agency]); } @@ -3079,9 +3085,36 @@ void print_header() boolean doTasks() { + //this is the main loop for autoscend. returning true will restart from the begining. returning false will quit the loop and go on to do bedtime + + if(!auto_unreservedAdvRemaining()) + { + auto_log_warning("No more unreserved adventures left", "red"); + return false; //we are out of adventures + } + if(get_property("_auto_doneToday").to_boolean()) + { + auto_log_warning("According to property _auto_doneToday I am done for today", "red"); + return false; + } + if(my_familiar() == $familiar[Stooper]) + { + auto_log_info("Avoiding stooper stupor...", "blue"); + use_familiar($familiar[none]); + } + if(my_inebriety() > inebriety_limit()) + { + auto_log_warning("I am overdrunk", "red"); + return false; + } + if(inAftercore()) + { + auto_log_warning("I am in aftercore", "red"); + return false; + } if(inCasual()) { - auto_log_warning("I think I'm in a casual ascension and should not run. To override: set _casualAscension = -1", "red"); + auto_log_warning("I think I'm in a casual ascension and should not run. To override: set _casualAscension = -1", "red"); return false; } @@ -3329,10 +3362,10 @@ boolean doTasks() if(LX_guildUnlock()) return true; if(knoll_available() && get_property("auto_spoonconfirmed").to_int() == my_ascensions()) { - if(LX_bitchinMeatcar()) return true; + if(LX_bitchinMeatcar()) return true; //buy the meatcar before switching signs with the rune spoon } if(LX_findHelpfulLowKey()) return true; - if(LX_bitchinMeatcar()) return true; + if(LX_unlockDesert()) return true; if(L5_getEncryptionKey()) return true; if(LX_unlockPirateRealm()) return true; if(handleRainDoh()) return true; @@ -3404,7 +3437,7 @@ boolean doTasks() if(L11_nostrilOfTheSerpent()) return true; if(L11_unlockHiddenCity()) return true; if(L11_hiddenCityZones()) return true; - if(ornateDowsingRod()) return true; + if(LX_ornateDowsingRod(false)) return true; if(L11_aridDesert()) return true; if(L11_hiddenCity()) return true; if(L11_talismanOfNam()) return true; @@ -3437,16 +3470,15 @@ boolean doTasks() if (LX_lowkeySummer()) return true; //release the softblock on quests that are waiting for shen quest - if(my_level() > get_property("auto_shenSkipLastLevel").to_int() && get_property("questL11Shen") != "finished") + if(allowSoftblockShen()) { - auto_log_warning("I was trying to avoid zones that Shen might need, but I've run out of stuff to do.", "red"); + auto_log_warning("I was trying to avoid zones that Shen might need, but I've run out of stuff to do. Releasing softblock.", "red"); set_property("auto_shenSkipLastLevel", my_level()); return true; } if(LX_getDigitalKey()) return true; if(LX_getStarKey()) return true; - if(L13_towerNSContests()) return true; if(L13_towerNSHedge()) return true; if(L13_sorceressDoor()) return true; @@ -3596,7 +3628,7 @@ void auto_begin() } // the main loop of autoscend is doTasks() which is actually called as part of the while. - while(auto_unreservedAdvRemaining() && (my_inebriety() <= inebriety_limit()) && !(my_inebriety() == inebriety_limit() && my_familiar() == $familiar[Stooper]) && !inAftercore() && doTasks()) + while(doTasks()) { if((my_fullness() >= fullness_limit()) && (my_inebriety() >= inebriety_limit()) && (my_spleen_use() == spleen_limit()) && (my_adventures() < 4) && (my_rain() >= 50) && (get_counters("Fortune Cookie", 0, 4) == "Fortune Cookie")) { @@ -3606,40 +3638,6 @@ void auto_begin() consumeStuff(); } - if(inAftercore()) - { - equipBaseline(); - handleFamiliar("item"); - if(item_amount($item[Boris\'s Helm]) > 0) - { - equip($item[Boris\'s Helm]); - } - if(item_amount($item[camp scout backpack]) > 0) - { - equip($item[camp scout backpack]); - } - if(item_amount($item[operation patriot shield]) > 0) - { - equip($item[operation patriot shield]); - } - if((equipped_item($slot[familiar]) != $item[snow suit]) && (item_amount($item[snow suit]) > 0)) - { - equip($item[snow suit]); - } - if((item_amount($item[mr. cheeng\'s spectacles]) > 0) && !have_equipped($item[Mr. Cheeng\'s Spectacles])) - { - equip($slot[acc2], $item[mr. cheeng\'s spectacles]); - } - if((item_amount($item[mr. screege\'s spectacles]) > 0) && !have_equipped($item[Mr. Screege\'s Spectacles])) - { - equip($slot[acc3], $item[mr. screege\'s spectacles]); - } - if((item_amount($item[numberwang]) > 0) && can_equip($item[numberwang])) - { - equip($slot[acc1], $item[numberwang]); - } - } - if(doBedtime()) { auto_log_info("Done for today (" + my_daycount() + "), beep boop"); diff --git a/RELEASE/scripts/autoscend/auto_choice_adv.ash b/RELEASE/scripts/autoscend/auto_choice_adv.ash index 97e6d76b6..e85d81752 100644 --- a/RELEASE/scripts/autoscend/auto_choice_adv.ash +++ b/RELEASE/scripts/autoscend/auto_choice_adv.ash @@ -278,12 +278,36 @@ boolean auto_run_choice(int choice, string page) run_choice(2); // skip } break; + case 793: // The Shore, Inc. Travel Agency. doing a vacation + if(my_primestat() == $stat[Muscle]) + { + run_choice(1); + } + else if(my_primestat() == $stat[Mysticality]) + { + run_choice(2); + } + else //if no prime stat we still want moxie + { + run_choice(3); + } + break; case 794: // Once More Unto the Junk (The Old Landfill) case 795: // The Bathroom of Ten Men (The Old Landfill) case 796: // The Den of Iquity (The Old Landfill) case 797: // Let's Workshop This a Little (The Old Landfill) oldLandfillChoiceHandler(choice); break; + case 829: // we all wear masks. (grimstone mask) + run_choice(1); //choose step mother. we want [Ornate Dowsing Rod] + break; + case 822: //The Prince's Ball (In the Restroom) + case 823: //The Prince's Ball (On the Dance Floor) + case 824: //The Prince's Ball (The Kitchen) + case 825: //The Prince's Ball (On the Balcony) + case 826: //The Prince's Ball (The Lounge) + run_choice(1); //pickup odd silver coin + break; case 875: // Welcome To Our ool Table (The Haunted Billiards Room). if(poolSkillPracticeGains() == 1 || currentPoolSkill() > 15) { diff --git a/RELEASE/scripts/autoscend/auto_combat.ash b/RELEASE/scripts/autoscend/auto_combat.ash index 07b7549fb..64c05715a 100644 --- a/RELEASE/scripts/autoscend/auto_combat.ash +++ b/RELEASE/scripts/autoscend/auto_combat.ash @@ -323,6 +323,11 @@ string auto_combatHandler(int round, monster enemy, string text) auto_log_info("Found mask: " + majora, "green"); } } + else + { + abort("Failed to identify the mask worn by the monster [" + enemy + "]. Finish this combat manually then run me again"); + } + if((majora == 7) && canUse($skill[Swap Mask])) { return useSkill($skill[Swap Mask]); diff --git a/RELEASE/scripts/autoscend/auto_deprecation.ash b/RELEASE/scripts/autoscend/auto_deprecation.ash index d6edef987..9f5ce1de2 100644 --- a/RELEASE/scripts/autoscend/auto_deprecation.ash +++ b/RELEASE/scripts/autoscend/auto_deprecation.ash @@ -502,5 +502,10 @@ boolean settingFixer() remove_property("auto_hpAutoRecoveryTarget"); } + if (property_exists("auto_skipDesert")) + { + remove_property("auto_skipDesert"); + } + return true; } diff --git a/RELEASE/scripts/autoscend/auto_util.ash b/RELEASE/scripts/autoscend/auto_util.ash index 164158256..855b8f9d7 100644 --- a/RELEASE/scripts/autoscend/auto_util.ash +++ b/RELEASE/scripts/autoscend/auto_util.ash @@ -2276,6 +2276,47 @@ boolean isUnclePAvailable() return !page_text.contains_text("You don't know where a desert beach is"); } +boolean isDesertAvailable() +{ + //Is this workaround still needed or is mafia correctly recognizing desert is available in koe? + if(in_koe()) + { + auto_log_info("The desert exploded so no need to build a meatcar..."); + set_property("lastDesertUnlock", my_ascensions()); + } + + return get_property("lastDesertUnlock").to_int() == my_ascensions(); +} + +boolean inKnollSign() +{ + return $strings[Mongoose, Vole, Wallaby] contains my_sign(); +} + +boolean inCanadiaSign() +{ + return $strings[Marmot, Opossum, Platypus] contains my_sign(); +} + +boolean inGnomeSign() +{ + return $strings[Blender, Packrat, Wombat] contains my_sign(); +} + +boolean allowSoftblockShen() +{ + //Some quests have a softblock on doing them because shen might need them. When we run out of things to do this softblock is released. + //Return true means the softblock is active. Return false means the softblock is released. + if(get_property("questL11Shen") == "finished") + { + return false; //shen quest is over. softblock not needed + } + + //We tell users to disable the shen softblock by setting auto_shenSkipLastLevel to 999. + //This is why we want to return < my_level() and not != my_level() + return get_property("auto_shenSkipLastLevel").to_int() < my_level(); +} + boolean instakillable(monster mon) { if(mon.boss) @@ -3606,7 +3647,7 @@ boolean auto_change_mcd(int mcd, boolean immediately) if (in_koe()) return false; int best = 10; - if($strings[Mongoose, Vole, Wallaby] contains my_sign()) + if(knoll_available()) { if(item_amount($item[Detuned Radio]) == 0) { @@ -3617,18 +3658,15 @@ boolean auto_change_mcd(int mcd, boolean immediately) return false; } } - if($strings[Blender, Packrat, Wombat] contains my_sign()) + if(inGnomeSign() && !gnomads_available()) { - if(get_property("lastDesertUnlock").to_int() < my_ascensions()) - { - return false; - } + return false; } - if($strings[Marmot, Opossum, Platypus] contains my_sign()) + if(canadia_available()) { best = 11; } - if(my_sign() == "Bad Moon") + if(in_bad_moon()) { best = 11; } @@ -7030,4 +7068,4 @@ int poolSkillPracticeGains() if(have_effect($effect[chalky hand]) > 0) count += 1; if(equipped_amount($item[[2268]Staff of Fats]) > 0) count += 2; //note that $item[[7964]Staff of Fats] does not help here. return count; -} \ No newline at end of file +} diff --git a/RELEASE/scripts/autoscend/auto_zone.ash b/RELEASE/scripts/autoscend/auto_zone.ash index a240ba522..61e65a845 100644 --- a/RELEASE/scripts/autoscend/auto_zone.ash +++ b/RELEASE/scripts/autoscend/auto_zone.ash @@ -834,7 +834,7 @@ generic_t zone_available(location loc) break; case $location[South of The Border]: case $location[The Shore\, Inc. Travel Agency]: - if(get_property("lastDesertUnlock").to_int() == my_ascensions()) + if(isDesertAvailable()) { retval._boolean = true; } @@ -1378,7 +1378,7 @@ generic_t zone_available(location loc) break; case $location[Thugnderdome]: - if(get_property("lastDesertUnlock").to_int() == my_ascensions()) + if(isDesertAvailable()) { retval._boolean = gnomads_available(); } diff --git a/RELEASE/scripts/autoscend/autoscend_header.ash b/RELEASE/scripts/autoscend/autoscend_header.ash index 4e6eb2163..ad2769e24 100644 --- a/RELEASE/scripts/autoscend/autoscend_header.ash +++ b/RELEASE/scripts/autoscend/autoscend_header.ash @@ -28,7 +28,7 @@ boolean LX_phatLootToken(); boolean LX_islandAccess(); boolean fancyOilPainting(); boolean LX_fcle(); -boolean ornateDowsingRod(); +boolean LX_ornateDowsingRod(boolean doing_desert_now); //Defined in autoscend/iotms/auto_mr2014.ash boolean LX_nastyBooty(); boolean LX_guildUnlock(); boolean LX_pirateOutfit(); @@ -115,6 +115,7 @@ boolean L11_hiddenTavernUnlock(); boolean L11_hiddenTavernUnlock(boolean force); boolean L11_blackMarket(); boolean L11_forgedDocuments(); +boolean L11_getUVCompass(); //Defined in autoscend/auto_quest_level_11.ash boolean L11_aridDesert(); boolean L11_mcmuffinDiary(); boolean L11_unlockHiddenCity(); @@ -586,7 +587,7 @@ boolean dna_startAcquire(); //Defined in autoscend/iotms/auto_mr2014.ash boolean auto_reagnimatedGetPart(); //Defined in autoscend/iotms/auto_mr2012.ash boolean doBedtime(); //Defined in autoscend.ash boolean doHRSkills(); //Defined in autoscend/auto_heavyrains.ash -boolean doVacation(); //Defined in autoscend.ash +boolean LX_doVacation(); //Defined in autoscend.ash int doHottub(); //Defined in autoscend/auto_clan.ash int hotTubSoaksRemaining(); //Defined in autoscend/auto_clan.ash boolean isHotTubAvailable(); //Defined in autoscend/auto_clan.ash @@ -879,6 +880,11 @@ boolean isOverdueArrow(); //Defined in autoscend/auto_util.ash boolean isOverdueDigitize(); //Defined in autoscend/auto_util.ash boolean isProtonGhost(monster mon); //Defined in autoscend/auto_util.ash boolean isUnclePAvailable(); //Defined in autoscend/auto_util.ash +boolean isDesertAvailable(); //Defined in autoscend/auto_util.ash +boolean inKnollSign(); //Defined in autoscend/auto_util.ash +boolean inCanadiaSign(); //Defined in autoscend/auto_util.ash +boolean inGnomeSign(); //Defined in autoscend/auto_util.ash +boolean allowSoftblockShen(); //Defined in autoscend/auto_util.ash boolean is_avatar_potion(item it); //Defined in autoscend/auto_util.ash int auto_mall_price(item it); //Defined in autoscend/auto_util.ash item[int] itemList(); //Defined in autoscend/auto_list.ash @@ -1147,7 +1153,6 @@ boolean glover_usable(string it); //Defined in autoscend/auto_glover.ash boolean LM_glover(); //Defined in autoscend/auto_glover.ash boolean groundhogSafeguard(); //Defined in autoscend/auto_groundhog.ash -void groundhog_initializeSettings(); //Defined in autoscend/auto_groundhog.ash boolean canGroundhog(location loc); //Defined in autoscend/auto_groundhog.ash boolean groundhogAbort(location loc); //Defined in autoscend/auto_groundhog.ash boolean LM_groundhog(); //Defined in autoscend/auto_groundhog.ash diff --git a/RELEASE/scripts/autoscend/iotms/mr2014.ash b/RELEASE/scripts/autoscend/iotms/mr2014.ash index 62544a19f..f38fbbad2 100644 --- a/RELEASE/scripts/autoscend/iotms/mr2014.ash +++ b/RELEASE/scripts/autoscend/iotms/mr2014.ash @@ -365,21 +365,20 @@ boolean xiblaxian_makeStuff() return false; } -boolean ornateDowsingRod() +boolean LX_ornateDowsingRod(boolean doing_desert_now) { if(!get_property("auto_grimstoneOrnateDowsingRod").to_boolean()) { return false; } - if(!is_unrestricted($item[Grimstone Mask])) + if(!is_unrestricted($item[Grimstone Mask]) || !is_unrestricted($item[Ornate Dowsing Rod])) { - set_property("auto_grimstoneOrnateDowsingRod", false); + set_property("auto_grimstoneOrnateDowsingRod", false); //mask or rod are not valid return false; } - if(possessEquipment($item[UV-resistant compass])) + if(auto_my_path() == "Way of the Surprising Fist" || $class[Avatar of Boris] == my_class()) { - auto_log_warning("You have a UV-resistant compass for some raisin, I assume you don't want an Ornate Dowsing Rod.", "red"); - set_property("auto_grimstoneOrnateDowsingRod", false); + set_property("auto_grimstoneOrnateDowsingRod", false); //cannot equip offhand item in those paths return false; } if(possessEquipment($item[Ornate Dowsing Rod])) @@ -388,58 +387,89 @@ boolean ornateDowsingRod() set_property("auto_grimstoneOrnateDowsingRod", false); return false; } - if(my_adventures() <= 6) + if(in_hardcore()) //will we be able to pull at any point in the run. not just right now (we might be out of pulls today) { - return false; + if(!canChangeToFamiliar($familiar[Grimstone Golem])) //no golem, or not allowed in path + { + set_property("auto_grimstoneOrnateDowsingRod", false); + return false; + } } - if(item_amount($item[Grimstone Mask]) == 0) + + //because it requires continuous adventures in the same day, then we want to do pre do this before we even get to the desert. + //but we do not want to do it too early either. so we wait until we are at least day 2 and level 7 to get the dowsing rod. + //unless we are doing desert now. in which case we ignore this limitation and do it now + if(!doing_desert_now && (my_level() < 8 || my_daycount() < 2)) { return false; } - if(my_daycount() < 2) + if(get_counters("", 0, 6) != "") + { + return false; //do not waste a semirare + } + + if(item_amount($item[Grimstone Mask]) == 0 && !canChangeToFamiliar($familiar[Grimstone Golem]) && canPull($item[Grimstone Mask])) + { + pullXWhenHaveY($item[Grimstone Mask], 1, 0); //pull the mask if you do not have it and cannot use the golem + } + if(item_amount($item[Grimstone Mask]) == 0) { return false; } - if(get_counters("", 0, 6) != "") + + if(my_adventures() <= 6) { + auto_log_info("I need at least 6 adv to get [Ornate Dowsing Rod] and I only have " + my_adventures(), "blue"); + if(doing_desert_now) + { + if(fullness_left() + inebriety_left() > 0) + { + abort("I am trying to do desert now so I cannot delay getting [Ornate Dowsing Rod]. I still have stomch and and liver left. Eat and drink until at least 6 adv and then run me again"); + } + if(isAboutToPowerlevel()) + { + auto_log_info("I have nothing else to do except the desert. So I am ending the day early", "blue"); + set_property("_auto_doneToday", true); + return true; //want to restart the loop so it can properly exit it and do bedtime. + } + } return false; } - #Need to make sure we get our grimstone mask auto_log_info("Acquiring a Dowsing Rod!", "blue"); - set_property("choiceAdventure829", "1"); use(1, $item[grimstone mask]); - set_property("choiceAdventure822", "1"); - set_property("choiceAdventure823", "1"); - set_property("choiceAdventure824", "1"); - set_property("choiceAdventure825", "1"); - set_property("choiceAdventure826", "1"); while(item_amount($item[odd silver coin]) < 1) { - autoAdv(1, $location[The Prince\'s Balcony]); + autoAdv($location[The Prince\'s Balcony]); } while(item_amount($item[odd silver coin]) < 2) { - autoAdv(1, $location[The Prince\'s Dance Floor]); + autoAdv($location[The Prince\'s Dance Floor]); } while(item_amount($item[odd silver coin]) < 3) { - autoAdv(1, $location[The Prince\'s Lounge]); + autoAdv($location[The Prince\'s Lounge]); } while(item_amount($item[odd silver coin]) < 4) { - autoAdv(1, $location[The Prince\'s Kitchen]); + autoAdv($location[The Prince\'s Kitchen]); } while(item_amount($item[odd silver coin]) < 5) { - autoAdv(1, $location[The Prince\'s Restroom]); + autoAdv($location[The Prince\'s Restroom]); } - cli_execute("make ornate dowsing rod"); - set_property("auto_grimstoneOrnateDowsingRod", false); - set_property("choiceAdventure805", "1"); - return true; + set_property("auto_grimstoneOrnateDowsingRod", false); //craft success = we done. fail = we ask user to make it + if(create(1, $item[Ornate Dowsing Rod])) + { + return true; + } + if(item_amount($item[Ornate Dowsing Rod]) == 0) + { + abort("Failed to craft [Ornate Dowsing Rod]. craft it manually and run me again"); + } + return false; } boolean fancyOilPainting() diff --git a/RELEASE/scripts/autoscend/iotms/mr2019.ash b/RELEASE/scripts/autoscend/iotms/mr2019.ash index 55de97511..3912301ea 100644 --- a/RELEASE/scripts/autoscend/iotms/mr2019.ash +++ b/RELEASE/scripts/autoscend/iotms/mr2019.ash @@ -35,8 +35,7 @@ boolean auto_sausageGrind(int numSaus) boolean auto_sausageGrind(int numSaus, boolean failIfCantMakeAll) { // Some paths are pretty meat-intensive early. Just in case... - boolean canDesert = (get_property("lastDesertUnlock").to_int() == my_ascensions()); - if(my_turncount() < 90 || !canDesert) + if(my_turncount() < 90 || !isDesertAvailable()) { return false; } @@ -475,10 +474,6 @@ boolean auto_spoonReadyToTuneMoon() return false; } - boolean isKnoll = $strings[mongoose, wallaby, vole] contains currsign; - boolean isCanadia = $strings[platypus, opossum, marmot] contains currsign; - boolean isGnomad = $strings[wombat, blender, packrat] contains currsign; - boolean toKnoll = $strings[mongoose, wallaby, vole] contains spoonsign; boolean toCanadia = $strings[platypus, opossum, marmot] contains spoonsign; boolean toGnomad = $strings[wombat, blender, packrat] contains spoonsign; @@ -494,9 +489,9 @@ boolean auto_spoonReadyToTuneMoon() return false; } - if(isKnoll && !toKnoll) + if(inKnollSign() && !toKnoll) { - if(get_property("lastDesertUnlock").to_int() < my_ascensions()) + if(!isDesertAvailable()) { // we want to get the meatcar via the knoll store return false; @@ -511,13 +506,13 @@ boolean auto_spoonReadyToTuneMoon() } } - if(isCanadia && !toCanadia && item_amount($item[logging hatchet]) == 0) + if(inCanadiaSign() && !toCanadia && item_amount($item[logging hatchet]) == 0) { // want to make sure we've grabbed the logging hatchet before switching away from canadia return false; } - if(isGnomad && !toGnomad && auto_is_valid($skill[Torso Awaregness]) && !auto_have_skill($skill[Torso Awaregness])) + if(inGnomeSign() && !toGnomad && auto_is_valid($skill[Torso Awaregness]) && !auto_have_skill($skill[Torso Awaregness])) { // we want to know about our torso before swapping away from gnomad signs return false; diff --git a/RELEASE/scripts/autoscend/paths/actually_ed_the_undying.ash b/RELEASE/scripts/autoscend/paths/actually_ed_the_undying.ash index 65326f526..b5c81f0ad 100644 --- a/RELEASE/scripts/autoscend/paths/actually_ed_the_undying.ash +++ b/RELEASE/scripts/autoscend/paths/actually_ed_the_undying.ash @@ -28,7 +28,6 @@ void ed_initializeSettings() set_property("auto_getBeehive", false); set_property("auto_getStarKey", false); set_property("auto_grimstoneFancyOilPainting", false); - set_property("auto_grimstoneOrnateDowsingRod", false); set_property("auto_holeinthesky", false); set_property("auto_lashes", ""); set_property("auto_needLegs", false); @@ -1478,7 +1477,7 @@ boolean LM_edTheUndying() if (!have_skill($skill[Even More Elemental Wards])) { // if we don't have the last Elemental Resistance Upgrade, we still need Ka // Thus we shouldn't block quests that Shen might request as almost all of them are Ka zones. - if(my_level() > get_property("auto_shenSkipLastLevel").to_int() && get_property("questL11Shen") != "finished") { + if(allowSoftblockShen()) { auto_log_warning("I was trying to avoid zones that Shen might need, but I still need Ka for upgrades.", "red"); set_property("auto_shenSkipLastLevel", my_level()); return true; diff --git a/RELEASE/scripts/autoscend/paths/avatar_of_boris.ash b/RELEASE/scripts/autoscend/paths/avatar_of_boris.ash index c88227705..8d57581b7 100644 --- a/RELEASE/scripts/autoscend/paths/avatar_of_boris.ash +++ b/RELEASE/scripts/autoscend/paths/avatar_of_boris.ash @@ -45,7 +45,6 @@ void boris_initializeSettings() auto_log_info("Initializing Avatar of Boris settings", "blue"); set_property("auto_borisSkills", -1); set_property("auto_cubeItems", false); - set_property("auto_grimstoneOrnateDowsingRod", false); set_property("auto_useCubeling", false); set_property("auto_wandOfNagamar", false); diff --git a/RELEASE/scripts/autoscend/paths/avatar_of_sneaky_pete.ash b/RELEASE/scripts/autoscend/paths/avatar_of_sneaky_pete.ash index 24727aa89..b3459dc40 100644 --- a/RELEASE/scripts/autoscend/paths/avatar_of_sneaky_pete.ash +++ b/RELEASE/scripts/autoscend/paths/avatar_of_sneaky_pete.ash @@ -6,7 +6,6 @@ void pete_initializeSettings() { set_property("auto_peteSkills", -1); set_property("auto_cubeItems", false); - set_property("auto_grimstoneOrnateDowsingRod", false); set_property("auto_useCubeling", false); set_property("auto_wandOfNagamar", false); } diff --git a/RELEASE/scripts/autoscend/paths/dark_gyffte.ash b/RELEASE/scripts/autoscend/paths/dark_gyffte.ash index 9e57c01a2..e9e40eb39 100644 --- a/RELEASE/scripts/autoscend/paths/dark_gyffte.ash +++ b/RELEASE/scripts/autoscend/paths/dark_gyffte.ash @@ -14,7 +14,6 @@ void bat_initializeSettings() set_property("auto_cubeItems", false); set_property("auto_getSteelOrgan", false); set_property("auto_grimstoneFancyOilPainting", false); - set_property("auto_grimstoneOrnateDowsingRod", false); set_property("auto_paranoia", 10); set_property("auto_useCubeling", false); set_property("auto_wandOfNagamar", false); diff --git a/RELEASE/scripts/autoscend/paths/disguises_delimit.ash b/RELEASE/scripts/autoscend/paths/disguises_delimit.ash index db55ea254..b5c655d13 100644 --- a/RELEASE/scripts/autoscend/paths/disguises_delimit.ash +++ b/RELEASE/scripts/autoscend/paths/disguises_delimit.ash @@ -7,7 +7,6 @@ void majora_initializeSettings() { set_property("auto_getBeehive", true); set_property("auto_getBoningKnife", true); - set_property("auto_grimstoneOrnateDowsingRod", false); } } diff --git a/RELEASE/scripts/autoscend/paths/g_lover.ash b/RELEASE/scripts/autoscend/paths/g_lover.ash index 75fb95d41..f22515b14 100644 --- a/RELEASE/scripts/autoscend/paths/g_lover.ash +++ b/RELEASE/scripts/autoscend/paths/g_lover.ash @@ -22,7 +22,6 @@ void glover_initializeSettings() set_property("auto_getBeehive", true); set_property("auto_getBoningKnife", true); set_property("auto_dakotaFanning", true); - set_property("auto_grimstoneOrnateDowsingRod", false); set_property("auto_ignoreFlyer", true); set_property("gnasirProgress", get_property("gnasirProgress").to_int() | 16); diff --git a/RELEASE/scripts/autoscend/paths/kingdom_of_exploathing.ash b/RELEASE/scripts/autoscend/paths/kingdom_of_exploathing.ash index dcdc3120d..03f889304 100644 --- a/RELEASE/scripts/autoscend/paths/kingdom_of_exploathing.ash +++ b/RELEASE/scripts/autoscend/paths/kingdom_of_exploathing.ash @@ -11,7 +11,6 @@ boolean koe_initializeSettings() { set_property("auto_bruteForcePalindome", in_hardcore()); set_property("auto_holeinthesky", false); - set_property("auto_grimstoneOrnateDowsingRod", "false"); set_property("auto_paranoia", 3); set_property("auto_skipL12Farm", "true"); return true; diff --git a/RELEASE/scripts/autoscend/paths/license_to_adventure.ash b/RELEASE/scripts/autoscend/paths/license_to_adventure.ash index b310b956c..2d1302df9 100644 --- a/RELEASE/scripts/autoscend/paths/license_to_adventure.ash +++ b/RELEASE/scripts/autoscend/paths/license_to_adventure.ash @@ -486,7 +486,7 @@ boolean LM_bond() } } - if(get_property("lastDesertUnlock").to_int() < my_ascensions()) + if(!isDesertAvailable()) { if(my_meat() > 5000) { diff --git a/RELEASE/scripts/autoscend/paths/live_ascend_repeat.ash b/RELEASE/scripts/autoscend/paths/live_ascend_repeat.ash index c93a3c044..c0961a1fa 100644 --- a/RELEASE/scripts/autoscend/paths/live_ascend_repeat.ash +++ b/RELEASE/scripts/autoscend/paths/live_ascend_repeat.ash @@ -1,13 +1,5 @@ script "live_ascend_repeat.ash" -void groundhog_initializeSettings() -{ - if(auto_my_path() == "Live. Ascend. Repeat.") - { - set_property("auto_grimstoneOrnateDowsingRod", false); - } -} - boolean groundhogSafeguard() { if(auto_my_path() == "Live. Ascend. Repeat.") diff --git a/RELEASE/scripts/autoscend/paths/nuclear_autumn.ash b/RELEASE/scripts/autoscend/paths/nuclear_autumn.ash index 8064fadc7..dd836b9ca 100644 --- a/RELEASE/scripts/autoscend/paths/nuclear_autumn.ash +++ b/RELEASE/scripts/autoscend/paths/nuclear_autumn.ash @@ -6,7 +6,6 @@ void fallout_initializeSettings() { set_property("auto_cubeItems", false); set_property("auto_getBeehive", true); - set_property("auto_grimstoneOrnateDowsingRod", true); if(item_amount($item[Deck of Every Card]) > 0) { diff --git a/RELEASE/scripts/autoscend/paths/pocket_familiars.ash b/RELEASE/scripts/autoscend/paths/pocket_familiars.ash index 8427e6091..64e8f1d94 100644 --- a/RELEASE/scripts/autoscend/paths/pocket_familiars.ash +++ b/RELEASE/scripts/autoscend/paths/pocket_familiars.ash @@ -13,7 +13,6 @@ void digimon_initializeSettings() set_property("auto_getBeehive", false); set_property("auto_getBoningKnife", false); set_property("auto_cubeItems", false); - set_property("auto_grimstoneOrnateDowsingRod", false); set_property("auto_hippyInstead", true); set_property("auto_ignoreFlyer", true); set_property("auto_useCubeling", false); diff --git a/RELEASE/scripts/autoscend/quests/level_11.ash b/RELEASE/scripts/autoscend/quests/level_11.ash index d6c46bcb0..9b1a4b91c 100644 --- a/RELEASE/scripts/autoscend/quests/level_11.ash +++ b/RELEASE/scripts/autoscend/quests/level_11.ash @@ -60,7 +60,7 @@ boolean[location] shenSnakeLocations(int day, int n_items_returned) boolean[location] shenZonesToAvoidBecauseMaybeSnake() { - if (get_property("auto_shenSkipLastLevel").to_int() >= my_level()) + if (!allowSoftblockShen()) { boolean[location] empty; return empty; @@ -501,7 +501,10 @@ boolean L11_forgedDocuments() } if (my_meat() < npc_price($item[Forged Identification Documents])) { - abort("Could not buy Forged Identification Documents, can not steal identities!"); + if(isAboutToPowerlevel()) + { + abort("Could not afford to buy Forged Identification Documents, can not steal identities!"); + } return false; } @@ -545,12 +548,15 @@ boolean L11_mcmuffinDiary() } if (my_adventures() < 4 || my_meat() < 500 || item_amount($item[Forged Identification Documents]) == 0) { - abort("Could not vacation at the shore to find your fathers diary!"); + if(isAboutToPowerlevel()) + { + abort("Could not vacation at the shore to find your fathers diary!"); + } return false; } auto_log_info("Getting the McMuffin Diary", "blue"); - doVacation(); + LX_doVacation(); foreach diary in $items[Your Father\'s Macguffin Diary, Copy of a Jerk Adventurer\'s Father\'s Diary] { if(item_amount(diary) > 0) @@ -562,31 +568,68 @@ boolean L11_mcmuffinDiary() return false; } -boolean L11_aridDesert() +boolean L11_getUVCompass() { - if (internalQuestStatus("questL11Desert") < 0 || internalQuestStatus("questL11Desert") > 0) + //acquire a [UV-resistant compass] if needed + if(possessEquipment($item[Ornate Dowsing Rod]) && is_unrestricted($item[Ornate Dowsing Rod])) { - return false; + return false; //already have a dowsing rod. we do not need a compass. + } + if(possessEquipment($item[UV-resistant compass])) + { + return false; //already have compass + } + if(in_koe()) + { + return false; //impossible to get compass in this path. [The Shore, Inc] is unavailable + } + if(auto_my_path() == "Way of the Surprising Fist" || $class[Avatar of Boris] == my_class()) + { + return false; //cannot equip offhand item in these paths } - // Mafia probably handles this correctly (and probably has done so for a while). (failing again as of r19010) - if(auto_my_path() == "Pocket Familiars") + if(item_amount($item[Shore Inc. Ship Trip Scrip]) == 0) { - string temp = visit_url("place.php?whichplace=desertbeach", false); + return LX_doVacation(); } - // TODO: Mafia currently (r20019) does not properly track desert exploration progress in plumber - // Not sure if this fix can do exact progress, but when I visited that page it corrected my explortion to 100 and quest progress to done so it will prevent adv loss at least - if(in_zelda() && get_property("desertExploration").to_int() < 100) + if(create(1, $item[UV-Resistant Compass])) + { + return true; + } + else { - string discard = visit_url("place.php?whichplace=desertbeach"); + cli_execute("refresh inv"); + if(possessEquipment($item[UV-resistant compass])) + { + return true; + } + else abort("I have the Scrip for it but am failing to buy [UV-resistant compass] for some reason. buy it manually and run me again"); } - if(get_property("desertExploration").to_int() >= 100) + return false; +} + +boolean L11_aridDesert() +{ + if(internalQuestStatus("questL11Desert") != 0) { return false; } + // Fix broken desert tracking. pocket familiars failing as of r19010. plumber as of r20019 + if(in_zelda() || auto_my_path() == "Pocket Familiars") + { + visit_url("place.php?whichplace=desertbeach", false); + } + if(get_property("desertExploration").to_int() >= 100) + { + return false; //done exploring + } + + if(LX_ornateDowsingRod(true)) return true; //spend adv trying to get [Ornate Dowsing Rod]. doing_desert_now = true. + if(L11_getUVCompass()) return true; //spend adv trying to get [UV-resistant compass] + item desertBuff = $item[none]; int progress = 1; if(possessEquipment($item[UV-resistant compass])) @@ -594,80 +637,18 @@ boolean L11_aridDesert() desertBuff = $item[UV-resistant compass]; progress = 2; } - if(possessEquipment($item[Ornate Dowsing Rod]) && is_unrestricted($item[Hibernating Grimstone Golem])) + if(possessEquipment($item[Ornate Dowsing Rod]) && is_unrestricted($item[Ornate Dowsing Rod])) { desertBuff = $item[Ornate Dowsing Rod]; progress = 3; } - if((get_property("bondDesert").to_boolean()) && ($location[The Arid\, Extra-Dry Desert].turns_spent > 0)) - { - progress += 2; - } - - boolean failDesert = true; - if(possessEquipment(desertBuff)) - { - failDesert = false; - } - if($classes[Avatar of Boris, Avatar of Sneaky Pete] contains my_class()) - { - failDesert = false; - } - if(auto_my_path() == "Way of the Surprising Fist") - { - failDesert = false; - } if(get_property("bondDesert").to_boolean()) { - failDesert = false; - } - if(in_koe()) - { - failDesert = false; + progress += 2; } - - if(failDesert) + if(get_property("peteMotorbikeHeadlight") == "Blacklight Bulb") //TODO verify spelling on this string { - if((my_level() >= 12) && !in_hardcore()) - { - auto_log_warning("Do you actually have a UV-resistant compass? Try 'refresh inv' in the CLI! If possible, pull a Grimstone mask and rerun, we may have missed that somehow.", "green"); - if(is_unrestricted($item[Hibernating Grimstone Golem]) && have_familiar($familiar[Grimstone Golem])) - { - abort("I can't do the Oasis without an Ornate Dowsing Rod. You can manually get a UV-resistant compass and I'll use that if you really hate me that much."); - } - else - { - cli_execute("refresh inv"); - if(possessEquipment($item[UV-resistant compass])) - { - desertBuff = $item[UV-resistant compass]; - progress = 2; - } - else if((my_adventures() > 3) && (my_meat() > 1200)) - { - doVacation(); - if(item_amount($item[Shore Inc. Ship Trip Scrip]) > 0) - { - cli_execute("make UV-Resistant Compass"); - } - if(!possessEquipment($item[UV-Resistant Compass])) - { - abort("Could not acquire a UV-Resistant Compass. Failing."); - } - return true; - } - else - { - abort("Can not handle the desert in our current situation."); - } - } - } - else - { - auto_log_warning("Skipping desert, don't have a rod or a compass."); - set_property("auto_skipDesert", my_turncount()); - } - return false; + progress += 2; } if((have_effect($effect[Ultrahydrated]) > 0) || (get_property("desertExploration").to_int() == 0)) @@ -677,7 +658,7 @@ boolean L11_aridDesert() { autoEquip($item[Thor\'s Pliers]); } - if(auto_have_familiar($familiar[Artistic Goth Kid])) + if(canChangeToFamiliar($familiar[Artistic Goth Kid])) { handleFamiliar($familiar[Artistic Goth Kid]); } @@ -2205,103 +2186,67 @@ boolean L11_palindome() boolean L11_unlockPyramid() { - if (internalQuestStatus("questL11Desert") < 1 || get_property("desertExploration").to_int() < 100 || internalQuestStatus("questL11Pyramid") > 0) + if (internalQuestStatus("questL11Desert") < 1 || get_property("desertExploration").to_int() < 100 || internalQuestStatus("questL11Pyramid") > -1) { return false; } if (isActuallyEd()) + { + return false; //ed starts with pyramid unlocked and cannot adventure there + } + //get staff of ed if possible. we are only checking the non equipment version of it. + //the equipment version is actually ed the undying path exclusive + if(creatable_amount($item[[2325]Staff Of Ed]) > 0) + { + create(1, $item[[2325]Staff Of Ed]); + } + if(item_amount($item[[2325]Staff Of Ed]) == 0) { return false; } - - if((item_amount($item[[2325]Staff Of Ed]) > 0) || ((item_amount($item[[2180]Ancient Amulet]) > 0) && (item_amount($item[[2268]Staff Of Fats]) > 0) && (item_amount($item[[2286]Eye Of Ed]) > 0))) + + auto_log_info("Reveal the pyramid", "blue"); + if (in_koe()) { - auto_log_info("Reveal the pyramid", "blue"); - if(item_amount($item[[2325]Staff Of Ed]) == 0) - { - if((item_amount($item[[2180]Ancient Amulet]) > 0) && (item_amount($item[[2286]Eye Of Ed]) > 0)) - { - autoCraft("combine", 1, $item[[2180]Ancient Amulet], $item[[2286]Eye Of Ed]); - } - if((item_amount($item[Headpiece of the Staff of Ed]) > 0) && (item_amount($item[[2268]Staff Of Fats]) > 0)) - { - autoCraft("combine", 1, $item[headpiece of the staff of ed], $item[[2268]Staff Of Fats]); - } - } - if(item_amount($item[[2325]Staff Of Ed]) == 0) - { - abort("Failed making Staff of Ed (2325) via CLI. Please do it manually and rerun."); - } + visit_url("place.php?whichplace=exploathing_beach&action=expl_pyramidpre"); + cli_execute("refresh quests"); + } + else + { + visit_url("place.php?whichplace=desertbeach&action=db_pyramid1"); + } - if (in_koe()) - { - visit_url("place.php?whichplace=exploathing_beach&action=expl_pyramidpre"); - cli_execute("refresh quests"); - } - else + //check results of above URL visit + if (internalQuestStatus("questL11Pyramid") > -1) + { + return true; //unlock successful + } + else //unlock failed + { + cli_execute("refresh quests"); //maybe it worked and mafia did not notice? + if(internalQuestStatus("questL11Pyramid") > -1) { - visit_url("place.php?whichplace=desertbeach&action=db_pyramid1"); + return true; //actually unlock did not fail. } - - if (internalQuestStatus("questL11Pyramid") < 0) + + int initial = get_property("desertExploration").to_int(); + string page = visit_url("place.php?whichplace=desertbeach"); + matcher desert_matcher = create_matcher("title=\"[(](\\d+)% explored[)]\"", page); + if(desert_matcher.find()) { - auto_log_info("No burning Ed's model now!", "blue"); - if((auto_my_path() == "One Crazy Random Summer") && (get_property("desertExploration").to_int() == 100)) + int found = to_int(desert_matcher.group(1)); + if(found != initial) { - auto_log_warning("We might have had an issue due to OCRS and the Desert, please finish the desert (and only the desert) manually and run again.", "red"); - string page = visit_url("place.php?whichplace=desertbeach"); - matcher desert_matcher = create_matcher("title=\"[(](\\d+)% explored[)]\"", page); - if(desert_matcher.find()) - { - int found = to_int(desert_matcher.group(1)); - if(found < 100) - { - set_property("desertExploration", found); - } - } - - if(get_property("desertExploration").to_int() == 100) - { - abort("Tried to open the Pyramid but could not - exploration at 100?. Something went wrong :("); - } - else - { - auto_log_info("Incorrectly had exploration value of 100 however, this was correctable. Trying to resume.", "blue"); - return false; - } - } - if(my_turncount() == get_property("auto_skipDesert").to_int()) - { - auto_log_warning("Did not have an Arid Desert Item and the Pyramid is next. Must backtrack and recover", "red"); - if((my_adventures() >= 3) && (my_meat() >= 500)) - { - doVacation(); - if(item_amount($item[Shore Inc. Ship Trip Scrip]) > 0) - { - cli_execute("make UV-Resistant Compass"); - } - if(item_amount($item[UV-Resistant Compass]) == 0) - { - abort("Could not acquire a UV-Resistant Compass. Failing."); - } - } - else - { - abort("Could not backtrack to handle getting a UV-Resistant Compass"); - } + auto_log_info("Incorrectly had exploration value of " + initial + " when it should be at " + found + ". This was corrected. Trying to resume.", "blue"); + set_property("desertExploration", found); return true; } - abort("Tried to open the Pyramid but could not. Something went wrong :("); + abort("Tried to open the Pyramid but could not. property desertExploration determined to be correct"); } - - buffMaintain($effect[Snow Shoes], 0, 1, 1); - autoAdv(1, $location[The Upper Chamber]); - return true; - } - else - { - return false; + abort("Tried to open the Pyramid but could not. could not verify the actual exploration amount of the desert"); } + + return false; } boolean L11_unlockEd() diff --git a/RELEASE/scripts/autoscend/quests/level_any.ash b/RELEASE/scripts/autoscend/quests/level_any.ash index 4acdc46ff..0bb9796dc 100644 --- a/RELEASE/scripts/autoscend/quests/level_any.ash +++ b/RELEASE/scripts/autoscend/quests/level_any.ash @@ -2,20 +2,14 @@ boolean LX_bitchinMeatcar() { - if((item_amount($item[Bitchin\' Meatcar]) > 0) || (auto_my_path() == "Nuclear Autumn")) + if(isDesertAvailable()) { return false; } - if(get_property("lastDesertUnlock").to_int() == my_ascensions()) + if(item_amount($item[Bitchin\' Meatcar]) > 0) { return false; } - if(in_koe()) - { - auto_log_info("The desert exploded, so no need to build a meatcar..."); - set_property("lastDesertUnlock", my_ascensions()); - return false; - } //calculate meat costs of building your meatcar. //if player manually partially assembled it then it will work, just think it costs slightly more meat than it actually does @@ -50,23 +44,6 @@ boolean LX_bitchinMeatcar() return false; } - //if rich then just buy the desert pass - if((my_meat() >= (npc_price($item[Desert Bus Pass]) + 1000)) && isGeneralStoreAvailable()) - { - auto_log_info("We're rich, let's take the bus instead of building a car.", "blue"); - buyUpTo(1, $item[Desert Bus Pass]); - if(item_amount($item[Desert Bus Pass]) > 0) - { - return true; - } - } - - //plumbers should wait until they are rich enough to buy the desert pass - if(in_zelda()) - { - return false; - } - if(item_amount($item[Gnollish Toolbox]) > 0) { use(1, $item[Gnollish Toolbox]); @@ -97,6 +74,54 @@ boolean LX_bitchinMeatcar() return false; } +boolean LX_unlockDesert() +{ + if(isDesertAvailable()) + { + return false; + } + + if(auto_my_path() == "Nuclear Autumn") + { + if(isAboutToPowerlevel()) + { + auto_log_info("We ran out of things to do. Trying to prematurely unlock Desert", "blue"); + } + else + { + auto_log_info("In Nuclear Autumn you get a free desert pass at level 11. skipping unlocking it for now", "blue"); + return false; + } + } + + //knollsign lets you buy the meatcar for less meat than a desert pass without spending any adv. + if(inKnollSign()) + { + return LX_bitchinMeatcar(); + } + + //if wealthy enough just buy the desert pass outright instead of spending adventures. + if(my_meat() >= (npc_price($item[Desert Bus Pass]) + 1000) && isGeneralStoreAvailable()) + { + auto_log_info("We're rich, let's take the bus instead of building a car.", "blue"); + buyUpTo(1, $item[Desert Bus Pass]); + if(item_amount($item[Desert Bus Pass]) > 0) + { + return true; + } + } + + //plumbers should wait until they are rich enough to buy the desert pass. As they have few uses for meat. + if(in_zelda() && !isAboutToPowerlevel()) + { + auto_log_info("Plumbers have few uses for meat. Delaying desert unlock until we can buy a pass.", "blue"); + return false; + } + + //spend adv to unlock the desert + return LX_bitchinMeatcar(); +} + boolean LX_desertAlternate() { if(auto_my_path() == "Nuclear Autumn") @@ -173,7 +198,7 @@ boolean LX_islandAccess() return false; } - if(!canDesert || !isGeneralStoreAvailable()) + if(!isDesertAvailable() || !isGeneralStoreAvailable()) { return LX_desertAlternate(); } @@ -195,7 +220,7 @@ boolean LX_islandAccess() } while((item_amount($item[Shore Inc. Ship Trip Scrip]) < 3) && (my_meat() >= 500) && (item_amount($item[Dinghy Plans]) == 0)) { - doVacation(); + LX_doVacation(); } if(item_amount($item[Shore Inc. Ship Trip Scrip]) < 3) { From 53b98f60c74c38495beb62424a2b69fb987e0bdb Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Mon, 15 Jun 2020 19:44:19 -0600 Subject: [PATCH 06/52] abortCombat(string msg) created an used (#434) * abortCombat(string msg) created an used using abort() in combat does not work. instead we need the combat filter function to return the string "abort" --- RELEASE/scripts/autoscend/auto_combat.ash | 44 +++++++++++++---------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/RELEASE/scripts/autoscend/auto_combat.ash b/RELEASE/scripts/autoscend/auto_combat.ash index 64c05715a..6ea842dbd 100644 --- a/RELEASE/scripts/autoscend/auto_combat.ash +++ b/RELEASE/scripts/autoscend/auto_combat.ash @@ -19,6 +19,15 @@ boolean containsCombat(item it); */ // private prototypes + +string abortCombat(string msg) +{ + //abort() does not work in combat. instead we need the combat filter to return "abort" string. + //to use this function: return abortCombat("message goes here"); + print(msg, "red"); + return "abort"; +} + boolean haveUsed(skill sk) { return get_property("auto_combatHandler").contains_text("(sk" + sk.to_int().to_string() + ")"); @@ -287,7 +296,7 @@ string auto_combatHandler(int round, monster enemy, string text) if(get_property("auto_diag_round").to_int() > 60) { - abort("Somehow got to 60 rounds.... aborting"); + return abortCombat("Somehow got to 60 rounds.... aborting"); } if(my_path() == "One Crazy Random Summer") @@ -325,7 +334,7 @@ string auto_combatHandler(int round, monster enemy, string text) } else { - abort("Failed to identify the mask worn by the monster [" + enemy + "]. Finish this combat manually then run me again"); + return abortCombat("Failed to identify the mask worn by the monster [" + enemy + "]. Finish this combat manually then run me again"); } if((majora == 7) && canUse($skill[Swap Mask])) @@ -338,7 +347,7 @@ string auto_combatHandler(int round, monster enemy, string text) { return "attack with weapon"; } - abort("May not be able to survive combat. Is swapping protest mask still not allowing us to do anything?"); + return abortCombat("May not be able to survive combat. Is swapping protest mask still not allowing us to do anything?"); } if(my_mask() == "protest mask" && canUse($skill[Swap Mask])) { @@ -474,7 +483,7 @@ string auto_combatHandler(int round, monster enemy, string text) { return "item " + $item[super deluxe mushroom]; } - abort("Oh no, I don't have any super deluxe mushrooms to deal with this shadow plumber :("); + return abortCombat("Oh no, I don't have any super deluxe mushrooms to deal with this shadow plumber :("); } if(auto_have_skill($skill[Ambidextrous Funkslinging])) { @@ -503,7 +512,7 @@ string auto_combatHandler(int round, monster enemy, string text) { return "item " + $item[Rain-Doh Indigo Cup]; } - abort("Uh oh, I ran out of gauze garters and filthy poultices"); + return abortCombat("Uh oh, I ran out of gauze garters and filthy poultices"); } if(enemy == $monster[Wall Of Meat]) @@ -873,7 +882,7 @@ string auto_combatHandler(int round, monster enemy, string text) { return useSkill($skill[Turtleini], false); } - abort("I am not sure how to finish this battle"); + return abortCombat("I am not sure how to finish this battle"); } // Unique Heavy Rains Enemy that Reflects Spells. @@ -971,7 +980,7 @@ string auto_combatHandler(int round, monster enemy, string text) { if((get_property("_badlyRomanticArrows").to_int() == 1) && (round <= 1) && (get_property("romanticTarget") != enemy)) { - abort("Have animator out but can not arrow"); + return abortCombat("Have animator out but can not arrow"); } if(enemy == $monster[modern zmobie]) { @@ -1223,7 +1232,7 @@ string auto_combatHandler(int round, monster enemy, string text) if(contains_text(combatState, "yellowray")) { - abort("Ugh, where is my damn yellowray!!!"); + return abortCombat("Ugh, where is my damn yellowray!!!"); } if(item_amount($item[Green Smoke Bomb]) > 0) @@ -1251,7 +1260,7 @@ string auto_combatHandler(int round, monster enemy, string text) if(banishAction != "") { auto_log_info("Looking at banishAction: " + banishAction, "green"); - #abort("Banisher considered here. Weee"); + #return abortCombat("Banisher considered here. Weee"); #wait(10); #banishAction = ""; } @@ -1887,13 +1896,13 @@ string auto_combatHandler(int round, monster enemy, string text) return useSkill($skill[Saucestorm], false); } //TODO check if our physical attack can deal elemental damage. - else abort("Not sure how to handle a physically resistent enemy wearing a welding mask."); + else return abortCombat("Not sure how to handle a physically resistent enemy wearing a welding mask."); } if(canSurvive(1.5) && round < 10) { return "attack with weapon"; } - abort("Not sure how to handle welding mask."); + return abortCombat("Not sure how to handle welding mask."); } if(majora == 25) //tiki mask { @@ -2364,7 +2373,7 @@ string auto_combatHandler(int round, monster enemy, string text) } if(my_location() != $location[The Slime Tube]) { - abort("Could not handle monster, sorry"); + return abortCombat("Could not handle monster, sorry"); } } if((monster_level_adjustment() > 150) && (my_mp() >= 45) && canUse($skill[Shell Up]) && (my_class() == $class[Turtle Tamer])) @@ -2436,7 +2445,7 @@ string auto_combatHandler(int round, monster enemy, string text) } else { - abort("Some sort of problem occurred, it is past round 25 but we are still in non-gremlin combat..."); + return abortCombat("Some sort of problem occurred, it is past round 25 but we are still in non-gremlin combat..."); } if(attackMinor == "attack with weapon") @@ -2669,7 +2678,7 @@ string auto_edCombatHandler(int round, monster enemy, string text) int damageReceived = 0; if (!isActuallyEd()) { - abort("Not in Actually Ed the Undying, this combat filter will result in massive suckage."); + return abortCombat("Not in Actually Ed the Undying, this combat filter will result in massive suckage."); } if (round == 0) @@ -2719,7 +2728,7 @@ string auto_edCombatHandler(int round, monster enemy, string text) if(get_property("auto_diag_round").to_int() > 60) { - abort("Somehow got to 60 rounds.... aborting"); + return abortCombat("Somehow got to 60 rounds.... aborting"); } phylum type = monster_phylum(enemy); @@ -3425,15 +3434,14 @@ string auto_saberTrickMeteorShowerCombatHandler(int round, monster enemy, string return auto_combatSaberYR(); } } - abort("Unable to perform saber trick (meteor shower)"); - return ""; + return abortCombat("Unable to perform saber trick (meteor shower)"); } monster ocrs_helper(string page) { if(my_path() != "One Crazy Random Summer") { - abort("Should not be in ocrs_helper if not on the path!"); + auto_log_critical("Should not be in ocrs_helper if not on the path!"); } string combatState = get_property("auto_combatHandler"); From 018c9adfd412488115825c23188d0e77d882fdb0 Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Mon, 15 Jun 2020 23:47:49 -0600 Subject: [PATCH 07/52] Unreachable code warning (#435) *Fixes mafia warning about unreachable code in combat script. The code in question was actually unreachable for a while. my recent fix to aborting in combat made mafia able to recognize it and start reporting it *moved the abort if turns>25 check to the start of the function instead of the end. *Part of the code was redundant and was removed: **using love stenchbug, it was already being done a few lines prior **attacking with weapon / return attackMinor if we couldn't find anything else to do. several instances of each --- RELEASE/scripts/autoscend/auto_combat.ash | 206 ++++++++++------------ 1 file changed, 97 insertions(+), 109 deletions(-) diff --git a/RELEASE/scripts/autoscend/auto_combat.ash b/RELEASE/scripts/autoscend/auto_combat.ash index 6ea842dbd..8b9b1a018 100644 --- a/RELEASE/scripts/autoscend/auto_combat.ash +++ b/RELEASE/scripts/autoscend/auto_combat.ash @@ -259,6 +259,11 @@ boolean enemyCanBlocksSkills() string auto_combatHandler(int round, monster enemy, string text) { + if(round > 25) + { + return abortCombat("Some sort of problem occurred, it is past round 25 but we are still in non-gremlin combat..."); + } + #Yes, round 0, really. boolean blocked = contains_text(text, "(STUN RESISTED)"); int damageReceived = 0; @@ -2311,141 +2316,72 @@ string auto_combatHandler(int round, monster enemy, string text) break; } - if(round <= 25) + if(((my_hp() * 10)/3) < my_maxhp()) { - if(((my_hp() * 10)/3) < my_maxhp()) - { - if(canUse($skill[Thunderstrike]) && (monster_level_adjustment() <= 150)) - { - return useSkill($skill[Thunderstrike]); - } - - if(!contains_text(combatState, "stunner") && (stunner != "") && (monster_level_adjustment() <= 100) && (my_mp() >= costStunner) && stunnable(enemy)) - { - set_property("auto_combatHandler", combatState + "(stunner)"); - return stunner; - } - - if(canUse($skill[Unleash The Greash]) && (monster_element(enemy) != $element[sleaze]) && (have_effect($effect[Takin\' It Greasy]) > 100)) - { - return useSkill($skill[Unleash The Greash]); - } - if(canUse($skill[Thousand-Yard Stare]) && (monster_element(enemy) != $element[spooky]) && (have_effect($effect[Intimidating Mien]) > 100)) - { - return useSkill($skill[Thousand-Yard Stare]); - } - if($monsters[Aquagoblin, Lord Soggyraven] contains enemy) - { - return attackMajor; - } - if((my_class() == $class[Turtle Tamer]) && canUse($skill[Spirit Snap])) - { - if((have_effect($effect[Blessing of the Storm Tortoise]) > 0) || (have_effect($effect[Grand Blessing of the Storm Tortoise]) > 0) || (have_effect($effect[Glorious Blessing of the Storm Tortoise]) > 0) || (have_effect($effect[Glorious Blessing of the War Snapper]) > 0) || (have_effect($effect[Glorious Blessing of She-Who-Was]) > 0)) - { - return useSkill($skill[Spirit Snap]); - } - } - if(canUse($skill[Northern Explosion]) && (my_class() == $class[Seal Clubber]) && (monster_element(enemy) != $element[cold])) - { - return useSkill($skill[Northern Explosion]); - } - if((!contains_text(combatState, "last attempt")) && (my_mp() >= costMajor)) - { - if(canSurvive(1.4)) - { - set_property("auto_combatHandler", combatState + "(last attempt)"); - auto_log_warning("Uh oh, I'm having trouble in combat.", "red"); - } - return attackMajor; - } - if(canSurvive(2.5)) - { - auto_log_warning("Hmmm, I don't really know what to do in this combat but it looks like I'll live.", "red"); - if(my_mp() >= costMajor) - { - return attackMajor; - } - else if(my_mp() >= costMinor) - { - return attackMinor; - } - return "attack with weapon"; - } - if(my_location() != $location[The Slime Tube]) - { - return abortCombat("Could not handle monster, sorry"); - } - } - if((monster_level_adjustment() > 150) && (my_mp() >= 45) && canUse($skill[Shell Up]) && (my_class() == $class[Turtle Tamer])) + if(canUse($skill[Thunderstrike]) && (monster_level_adjustment() <= 150)) { - return useSkill($skill[Shell Up]); + return useSkill($skill[Thunderstrike]); } - if(attackMinor == "attack with weapon") + if(!contains_text(combatState, "stunner") && (stunner != "") && (monster_level_adjustment() <= 100) && (my_mp() >= costStunner) && stunnable(enemy)) { - if(canUse($skill[Summon Love Stinkbug])) - { - return useSkill($skill[Summon Love Stinkbug]); - } - if(canUse($skill[Mighty Axing], false) && (equipped_item($slot[Weapon]) != $item[none])) - { - return useSkill($skill[Mighty Axing], false); - } + set_property("auto_combatHandler", combatState + "(stunner)"); + return stunner; } - if((enemy.physical_resistance >= 100) && (monster_element(enemy) != $element[cold]) && canUse($skill[Throat Refrigerant], false)) + if(canUse($skill[Unleash The Greash]) && (monster_element(enemy) != $element[sleaze]) && (have_effect($effect[Takin\' It Greasy]) > 100)) { - return useSkill($skill[Throat Refrigerant], false); + return useSkill($skill[Unleash The Greash]); } - - if((enemy.physical_resistance >= 100) && (monster_element(enemy) != $element[hot]) && canUse($skill[Boiling Tear Ducts], false)) + if(canUse($skill[Thousand-Yard Stare]) && (monster_element(enemy) != $element[spooky]) && (have_effect($effect[Intimidating Mien]) > 100)) { - return useSkill($skill[Boiling Tear Ducts], false); + return useSkill($skill[Thousand-Yard Stare]); } - - if((enemy.physical_resistance >= 100) && (monster_element(enemy) != $element[sleaze]) && canUse($skill[Projectile Salivary Glands])) - { - return useSkill($skill[Projectile Salivary Glands]); - } - - if((enemy.physical_resistance >= 100) && (monster_element(enemy) != $element[spooky]) && canUse($skill[Translucent Skin], false)) + if($monsters[Aquagoblin, Lord Soggyraven] contains enemy) { - return useSkill($skill[Translucent Skin], false); + return attackMajor; } - - if((enemy.physical_resistance >= 100) && (monster_element(enemy) != $element[stench]) && canUse($skill[Skunk Glands], false)) + if((my_class() == $class[Turtle Tamer]) && canUse($skill[Spirit Snap])) { - return useSkill($skill[Skunk Glands], false); + if((have_effect($effect[Blessing of the Storm Tortoise]) > 0) || (have_effect($effect[Grand Blessing of the Storm Tortoise]) > 0) || (have_effect($effect[Glorious Blessing of the Storm Tortoise]) > 0) || (have_effect($effect[Glorious Blessing of the War Snapper]) > 0) || (have_effect($effect[Glorious Blessing of She-Who-Was]) > 0)) + { + return useSkill($skill[Spirit Snap]); + } } - - if((my_location() == $location[The X-32-F Combat Training Snowman]) && contains_text(text, "Cattle Prod") && (my_mp() >= costMajor)) + if(canUse($skill[Northern Explosion]) && (my_class() == $class[Seal Clubber]) && (monster_element(enemy) != $element[cold])) { - return attackMajor; + return useSkill($skill[Northern Explosion]); } - - if((monster_level_adjustment() > 150) && (my_mp() >= costMajor) && (attackMajor != "attack with weapon")) + if((!contains_text(combatState, "last attempt")) && (my_mp() >= costMajor)) { + if(canSurvive(1.4)) + { + set_property("auto_combatHandler", combatState + "(last attempt)"); + auto_log_warning("Uh oh, I'm having trouble in combat.", "red"); + } return attackMajor; } - if(canUse($skill[Lunge Smack], false) && (attackMinor != "attack with weapon") && (weapon_type(equipped_item($slot[weapon])) == $stat[Muscle])) + if(canSurvive(2.5)) { - return attackMinor; - } - if((my_mp() >= costMinor) && (attackMinor != "attack with weapon")) - { - return attackMinor; + auto_log_warning("Hmmm, I don't really know what to do in this combat but it looks like I'll live.", "red"); + if(my_mp() >= costMajor) + { + return attackMajor; + } + else if(my_mp() >= costMinor) + { + return attackMinor; + } + return "attack with weapon"; } - - if((round > 20) && canUse($skill[Saucestorm], false)) + if(my_location() != $location[The Slime Tube]) { - return useSkill($skill[Saucestorm], false); + return abortCombat("Could not handle monster, sorry"); } - - return "attack with weapon"; } - else + if((monster_level_adjustment() > 150) && (my_mp() >= 45) && canUse($skill[Shell Up]) && (my_class() == $class[Turtle Tamer])) { - return abortCombat("Some sort of problem occurred, it is past round 25 but we are still in non-gremlin combat..."); + return useSkill($skill[Shell Up]); } if(attackMinor == "attack with weapon") @@ -2454,6 +2390,58 @@ string auto_combatHandler(int round, monster enemy, string text) { return useSkill($skill[Summon Love Stinkbug]); } + if(canUse($skill[Mighty Axing], false) && (equipped_item($slot[Weapon]) != $item[none])) + { + return useSkill($skill[Mighty Axing], false); + } + } + + if((enemy.physical_resistance >= 100) && (monster_element(enemy) != $element[cold]) && canUse($skill[Throat Refrigerant], false)) + { + return useSkill($skill[Throat Refrigerant], false); + } + + if((enemy.physical_resistance >= 100) && (monster_element(enemy) != $element[hot]) && canUse($skill[Boiling Tear Ducts], false)) + { + return useSkill($skill[Boiling Tear Ducts], false); + } + + if((enemy.physical_resistance >= 100) && (monster_element(enemy) != $element[sleaze]) && canUse($skill[Projectile Salivary Glands])) + { + return useSkill($skill[Projectile Salivary Glands]); + } + + if((enemy.physical_resistance >= 100) && (monster_element(enemy) != $element[spooky]) && canUse($skill[Translucent Skin], false)) + { + return useSkill($skill[Translucent Skin], false); + } + + if((enemy.physical_resistance >= 100) && (monster_element(enemy) != $element[stench]) && canUse($skill[Skunk Glands], false)) + { + return useSkill($skill[Skunk Glands], false); + } + + if((my_location() == $location[The X-32-F Combat Training Snowman]) && contains_text(text, "Cattle Prod") && (my_mp() >= costMajor)) + { + return attackMajor; + } + + if((monster_level_adjustment() > 150) && (my_mp() >= costMajor) && (attackMajor != "attack with weapon")) + { + return attackMajor; + } + if(canUse($skill[Lunge Smack], false) && (attackMinor != "attack with weapon") && (weapon_type(equipped_item($slot[weapon])) == $stat[Muscle])) + { + return attackMinor; + } + if((my_mp() >= costMinor) && (attackMinor != "attack with weapon")) + { + return attackMinor; + } + + if((round > 20) && canUse($skill[Saucestorm], false)) + { + return useSkill($skill[Saucestorm], false); } return attackMinor; From 29d496ceab750616780ca1d27ed540128990d463 Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Wed, 17 Jun 2020 16:16:59 -0700 Subject: [PATCH 08/52] update gremlins code to use new monster names (#436) * update gremlins code to use new monster names bump mafia version. * update mafia version to force saber fix --- RELEASE/scripts/autoscend.ash | 2 +- RELEASE/scripts/autoscend/auto_combat.ash | 63 ++--------------------- 2 files changed, 6 insertions(+), 59 deletions(-) diff --git a/RELEASE/scripts/autoscend.ash b/RELEASE/scripts/autoscend.ash index b5ed0a28e..9b1989cfb 100644 --- a/RELEASE/scripts/autoscend.ash +++ b/RELEASE/scripts/autoscend.ash @@ -1,5 +1,5 @@ script "autoscend.ash"; -since r20127; // Leaflet use is now tracked via "leafletCompleted" setting +since r20188; // If automating an adventure leaves you in a choice, automate the choice /*** autoscend_header.ash must be first import All non-accessory scripts must be imported here diff --git a/RELEASE/scripts/autoscend/auto_combat.ash b/RELEASE/scripts/autoscend/auto_combat.ash index 8b9b1a018..14ffb5dee 100644 --- a/RELEASE/scripts/autoscend/auto_combat.ash +++ b/RELEASE/scripts/autoscend/auto_combat.ash @@ -2476,7 +2476,8 @@ string findBanisher(int round, monster enemy, string text) string auto_JunkyardCombatHandler(int round, monster enemy, string text) { - if(!($monsters[A.M.C. gremlin, batwinged gremlin, erudite gremlin, spider gremlin, vegetable gremlin] contains enemy)) + if(!($monsters[A.M.C. gremlin, batwinged gremlin, batwinged gremlin (tool), erudite gremlin, erudite gremlin (tool), + spider gremlin, spider gremlin (tool), vegetable gremlin, vegetable gremlin (tool)] contains enemy)) { if (isActuallyEd()) { @@ -2488,69 +2489,15 @@ string auto_JunkyardCombatHandler(int round, monster enemy, string text) auto_log_info("auto_JunkyardCombatHandler: " + round, "brown"); if(round == 0) { - set_property("auto_gremlinMoly", true); + set_property("auto_gremlinMoly", false); set_property("auto_combatHandler", ""); } string combatState = get_property("auto_combatHandler"); string edCombatState = get_property("auto_edCombatHandler"); - if (isActuallyEd()) - { - if(contains_text(edCombatState, "gremlinNeedBanish")) - { - set_property("auto_gremlinMoly", false); - } - } - - if(enemy == $monster[A.M.C. gremlin]) - { - set_property("auto_gremlinMoly", false); - } - - if(my_location() == $location[Next To That Barrel With Something Burning In It]) - { - if(enemy == $monster[vegetable gremlin]) - { - set_property("auto_gremlinMoly", false); - } - else if(contains_text(text, "It does a bombing run over your head")) - { - set_property("auto_gremlinMoly", false); - } - } - else if(my_location() == $location[Out By That Rusted-Out Car]) - { - if(enemy == $monster[erudite gremlin]) - { - set_property("auto_gremlinMoly", false); - } - else if(contains_text(text, "It picks a beet off of itself and beats you with it")) - { - set_property("auto_gremlinMoly", false); - } - } - else if(my_location() == $location[Over Where The Old Tires Are]) - { - if(enemy == $monster[spider gremlin]) - { - set_property("auto_gremlinMoly", false); - } - else if(contains_text(text, "He uses the random junk around him")) - { - set_property("auto_gremlinMoly", false); - } - } - else if(my_location() == $location[Near an Abandoned Refrigerator]) - { - if(enemy == $monster[batwinged gremlin]) - { - set_property("auto_gremlinMoly", false); - } - else if(contains_text(text, "It bites you in the fibula with its mandibles")) - { - set_property("auto_gremlinMoly", false); - } + if ($monsters[batwinged gremlin (tool), erudite gremlin (tool), spider gremlin (tool), vegetable gremlin (tool)] contains enemy) { + set_property("auto_gremlinMoly", true); } if (!contains_text(edCombatState, "gremlinNeedBanish") && !get_property("auto_gremlinMoly").to_boolean() && isActuallyEd()) From e4e4b81f0253685137203ecb8711907a12c79d1d Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Wed, 17 Jun 2020 17:32:29 -0600 Subject: [PATCH 09/52] piratequest fix Frat Boy Ensemble outfit (#438) * choice adventure 188 make sure you have the means to complete it before run_choice(3) instead of assuming that if you are there and 1 and 2 do not work then you must do 3. * fix not wearing outfits in pirate quest --- RELEASE/scripts/autoscend/auto_choice_adv.ash | 4 ++-- RELEASE/scripts/autoscend/quests/optional.ash | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/RELEASE/scripts/autoscend/auto_choice_adv.ash b/RELEASE/scripts/autoscend/auto_choice_adv.ash index e85d81752..7f758ec20 100644 --- a/RELEASE/scripts/autoscend/auto_choice_adv.ash +++ b/RELEASE/scripts/autoscend/auto_choice_adv.ash @@ -114,9 +114,9 @@ boolean auto_run_choice(int choice, string page) run_choice(1); } else if (equipped_amount($item[mullet wig]) == 1 && item_amount($item[briefcase]) > 0) { run_choice(2); - } else { + } else if (equipped_amount($item[frilly skirt]) == 1 && item_amount($item[hot wing]) > 2) { run_choice(3); - } + } else abort("I tried to infiltrate the orcish frat house without being equipped for the job"); break; case 189: // O Cap'm, My Cap'm (The Poop Deck) run_choice(2); // skip diff --git a/RELEASE/scripts/autoscend/quests/optional.ash b/RELEASE/scripts/autoscend/quests/optional.ash index 13a62b004..513791d1c 100644 --- a/RELEASE/scripts/autoscend/quests/optional.ash +++ b/RELEASE/scripts/autoscend/quests/optional.ash @@ -550,7 +550,7 @@ boolean LX_joinPirateCrew() { auto_log_info("Attempting to infiltrate the frat house", "blue"); boolean infiltrationReady = false; if (possessOutfit("Frat Boy Ensemble", true)) { - outfit("Frat Boy Ensemble"); + autoOutfit("Frat Boy Ensemble"); infiltrationReady = true; } else if (possessEquipment($item[mullet wig]) && item_amount($item[briefcase]) > 0) { autoForceEquip($item[mullet wig]); @@ -588,7 +588,7 @@ boolean LX_joinPirateCrew() { // this is held together with duct tape and hopes and dreams. // it can and will fail but it will have to do for now. auto_log_info("Beer Pong time.", "blue"); - outfit("Swashbuckling Getup"); + autoOutfit("Swashbuckling Getup"); backupSetting("choiceAdventure187", "0"); tryBeerPong(); return true; From ba1b56dcb0f3ac24598f97756a8ab0e4b761a3bd Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Thu, 11 Jun 2020 01:50:13 -0600 Subject: [PATCH 10/52] familiars revamped (#420) *handling for intentionally trying to set familiar to $familiar[none] **fixes wall of bones tower killing without electric bone knife failing to set familiar to none when it was trying to. **fixes fantasy realm error in pokefam when trying to set familiar to none *removed familiar consideration of astral energy drinks. it no longer exists *handleFamiliar now consistently returns false if it cannot set a familiar as a target. before it was inconsistent *hr_handleFamiliar deleted. it was only wearing life preserver on familiar, but doing it in the wrong place such that you only wore it if you used the same familiar 2 turns in a row. relevant logic was added to preAdvUpdateFamiliar instead *instead of autoscend calling handleFamiliar("item"); basicFamiliarOverrides(); it will now just call the latter, which will do both *refactored the logic on basicFamiliarOverrides() then renamed it to autoChooseFamiliar() to be clearer on what it does *autoChooseFamiliar will now be called during pre adventure to select a familiar, but only if we did not call handleFamiliar(familiar) this loop *autoChooseFamiliar() changed to autoChooseFamiliar(location place). since it is called during pre adventure we know where we are adventuring and can take this into account when choosing familiar. *The following functions now track if they have been called this loop. handleFamiliar(familiar), providePlusNonCombat, providePlusCombat *auto_have_familiar now respects blacklist *modifications to familiar datafile for item familiars. **removed mini list for zombie master. It was just forcing two specific undead familiars intially. but is not needed since we already do a validity check when handling the item list which would catch any invalid non undead familiars (and if not then I will fix that seperately that it does recognize them as invalid). **added size 4 spleen consumable dropping familiars to familiar dat file. **add the prop_boolean property to data file conditionals. prop conditional is only designed for comparing a property to integers. which means prop:name=true would fail **split drop.dat from item.dat to seperate familiars that drop items directly from familiars who give a bonus to a monster dropping stuff. For example if we really need a monster to drop an item to proceed, then we would not want it to choose a familiar that drops items directly but provides zero monster drop bonus. **extensively reworked logic on both of the above. **minor rework on logic in restore.dat *Removed Suggest option from handlefamiliar as it was a leftover of pre NS13 *consolidated various redundant fallback and overrides on familiar choice that were sprinkled in too many disparate places. *added lots of comments and documentation on what is being done *spunoff familiar lookupFamiliarDatafile(string type) from boolean handleFamiliar(string type) to allow looking up a datafile without changing the property auto_familiarChoice --- BUILD/familiars/drop.dat | 90 +++++ BUILD/familiars/item.dat | 74 ++-- BUILD/familiars/regen.dat | 14 +- RELEASE/data/autoscend_familiars.txt | 254 +++++++----- RELEASE/scripts/autoscend.ash | 8 +- RELEASE/scripts/autoscend/auto_adventure.ash | 70 ++-- RELEASE/scripts/autoscend/auto_familiar.ash | 361 ++++++++++-------- RELEASE/scripts/autoscend/auto_util.ash | 23 +- .../scripts/autoscend/autoscend_header.ash | 4 +- RELEASE/scripts/autoscend/iotms/mr2018.ash | 3 +- .../scripts/autoscend/paths/heavy_rains.ash | 10 - 11 files changed, 554 insertions(+), 357 deletions(-) create mode 100644 BUILD/familiars/drop.dat diff --git a/BUILD/familiars/drop.dat b/BUILD/familiars/drop.dat new file mode 100644 index 000000000..c70b4ecb0 --- /dev/null +++ b/BUILD/familiars/drop.dat @@ -0,0 +1,90 @@ +# "drop" type is used when we want to grab a familiar that drops items themselves rather than boosting the odds of the enemy dropping items. +# +# First we grab up to small amount of various specific drops. +# +# 5 turkey booze drops a day. each is size 1 and density of either 5, 5.5, or 6 +Fist Turkey prop:_turkeyBooze<5 +# every 10 yellow pixels make a size 2 density 5 food or drink. unlimited drops per day. prioritize having enough to craft 2. +# drops 1 per combat with chance of 2nd if wearing familiar specific equip +Puck Man item:Yellow Pixel<20 +Ms. Puck Man item:Yellow Pixel<20 +# 1st wax drop per run only takes 5 combats, afterwards 30. makes a single size 2 density 4.25 food or drink +Optimistic Candle prop:optimisticCandleProgress>=25 +# 1st robin egg per run only takes 5 combats, afterwards 30. potion that gives all res +3 +Rockin' Robin prop:rockinRobinProgress>=25 +# 1st burning newspaper per run only takes 5 combats, afterwards 30. can be used for +5 adv on dayroll back equip +Garbage Fire prop:garbageFireProgress>=25 +# Hot ashes can make a potion that gives +15 ML for 15 adv. keep 1 of them in stock +Galloping Grill prop:_hotAshesDrops<5;item:hot ashes<1 +# +# get substats from fist turkey in The Source path +Fist Turkey prop:_turkeyMuscle<5;mainstat:Muscle;path:The Source +Fist Turkey prop:_turkeyMyst<5;mainstat:Mysticality;path:The Source +Fist Turkey prop:_turkeyMoxie<5;mainstat:Moxie;path:The Source +# +# Cat Burgler can charge up heists. 30 combats give it 2 charges. +Cat Burglar prop:_catBurglarCharge<30 +# +# Drops many items. make sure we got 1 in stock of the banisher, as well as size 1 density 5 food/drink +# Because it drops so many different items the odds of getting what we want are reduced. so lowered its priority +Elf Operative item:tryptophan dart<1 +Elf Operative item:elf army field rations<1 +Elf Operative item:martiny<1 +# drops size 1 density 4.5 food and drink. odds of drop are relatively low so it down here +Garbage Fire item:extra-toasted half sandwich<1 +Garbage Fire item:mulled hobo wine<1 +# +# Drops BACON every battle. 100 bacon makes size 15 density 4.83 food. 150 bacon can get you a fat loot token +Intergnat item:BACON<150 +# +# Below this lines drops are not needed more of for the run and are just grabbing for profit. +# Most are useful in limited amounts which we already grab via boolean autoChooseFamiliar(location place) +# +# density 1.875 size 4 spleen consumables. boolean autoChooseFamiliar(location place) will already grab the amount needed for spleen +# Here they are only used to grab extras. +Grim Brother prop:_grimFairyTaleDrops<5;!prop_boolean:_auto_thisLoopPlusNoncombat +Pair of Stomping Boots prop:_bootStomps<7 +Baby Sandworm prop:_aguaDrops<5 +Bloovian Groose prop:_grooseDrops<5 +Golden Monkey prop:_powderedGoldDrops<5 +Unconscious Collective prop:_dreamJarDrops<5 +# psychoanalytic jar 1 per day. +Angry Jung Man prop:_jungDrops<1 +# grimstone mask 1 per day +Grimstone Golem prop:_grimstoneMaskDrops<1 +# tales of spelunking 1 per day +Adventurous Spelunker prop:_spelunkingTalesDrops<1 +# can drop 5 devilish folio a day +Blavious Kloop prop:_kloopDrops<5 +# can drop 5 absinthe a day +Green Pixie prop:_absintheDrops<5 +# Drops robin's egg every 30 combats. +3 all res potion +Rockin' Robin item:robin\'s egg<1 +# Hot ashes can make a potion that gives +15 ML for 15 adv. drop limit 5/day +Galloping Grill prop:_hotAshesDrops<5 +# +# Below this line are familiars with no properties. meaning if you have it then it will be kept selected permanently. +# Most of those also appear higher up in the file with properties. Meaning we use them until a select amount is grabbed first. +# +# Drops many items. among them: banish, restore, stun, damage, size 1 density 5 food/drink, -combat equip, all res +2 equip, +3XP equip, +15% meat equip +Elf Operative +# Drops more burning newspapers. one per 30 combats. also drops size 1 density 4.5 food and drink +Garbage Fire +# Drops x and o with no limit. 1 each per nine combats. makes density 4.5 food. density 4 booze. can skip building a bridge. +XO Skeleton +# Drops BACON every combat +Intergnat +# Generates adventures after combat +Reagnimated Gnome +# Every 30 combats drops wax which makes a single size 2 density 4.25 food or drink +Optimistic Candle +# Drops robin's egg every 30 combats. +3 all res potion +Rockin' Robin +# cheap IOTM derivative that drops many different things. many are junk, but it does have size 3 density 3.83 food which is better than nothing. +Lil' Barrel Mimic +# Once the hot ashes all dropped. remaining drops are not that useful. +Galloping Grill +# Can use to track phyllum, every 11 encounters from tracked phyllum results in a drop. Needs more code before it goes higher on the list +Red-Nosed Snapper +# 2% and 4% chance respectively to drop time's arrow and arrowgram. +Obtuse Angel \ No newline at end of file diff --git a/BUILD/familiars/item.dat b/BUILD/familiars/item.dat index 6f871b6de..b5f379409 100644 --- a/BUILD/familiars/item.dat +++ b/BUILD/familiars/item.dat @@ -1,66 +1,38 @@ -# Undead familiars only when a zombie -XO Skeleton path:Zombie Master;prop:_xoHugsUsed<11 -Reagnimated Gnome path:Zombie Master -# Do we wanna grab cubeling drops? Usually yes. -Gelatinous Cubeling prop:auto_useCubeling=true;prop:auto_cubeItems=true -# Cheerleader isn't subject to weight restrictions in KOLHS, so let's just use it before almost anything to be safee +# "Item" is used when we want a familiar that boosts the chance of a monster dropping an item +# We expect that familiars that drop items directly a limited amount of times per day will be used first elsewhere. So do not account for those. +# +# exempt from 10 lbs restriction in KOHLS path Steam-Powered Cheerleader path:KOLHS -# Wanna get that jar -Angry Jung Man prop:_jungDrops<1;day:1 -# Wanna get that mask -Grimstone Golem prop:_grimstoneMaskDrops<1;day:1 -# That's some nice booze -Fist Turkey prop:_turkeyBooze<5 -# Might as well grab an egg -Rockin' Robin prop:rockinRobinProgress>=25 -# And some wax -Optimistic Candle prop:optimisticCandleProgress>=25 -# And some garbage -Garbage Fire prop:garbageFireProgress>=25 -# And devilish folios -Blavious Kloop prop:_kloopDrops<3 -# And some absinthe -Green Pixie prop:_absintheDrops<3 -# And a tales of spelunking -Adventurous Spelunker prop:_spelunkingTalesDrops<1 -# And some substats, if in The Source -Fist Turkey prop:_turkeyMuscle<5;mainstat:Muscle;path:The Source -Fist Turkey prop:_turkeyMyst<5;mainstat:Mysticality;path:The Source -Fist Turkey prop:_turkeyMoxie<5;mainstat:Moxie;path:The Source -# And some BACON -Intergnat item:BACON<350 -# And some heist charges -Cat Burglar prop:_catBurglarCharge<30 -# And some hugpockets -XO Skeleton prop:_xoHugsUsed<5 -# And some pastes -Pair of Stomping Boots prop:_bootStomps<7 -# And some more hugpockets -XO Skeleton prop:_xoHugsUsed<11 -# And some adventures -Reagnimated Gnome # Fairies with a multiplier +# 1.4x multiplier fairy Steam-Powered Cheerleader prop:_cheerleaderSteam>150 -#Mutant Fire Ant grimdark:0 +# 1.3x multiplier fairy Steam-Powered Cheerleader prop:_cheerleaderSteam>100 -# Jumpsuited Hound Dog DELIBERATELY not included because it provides usually unwanted +combat +# Jumpsuited Hound Dog is a 1.25x multiplier fairy that provides +combat. only use it if we did not provide noncombat this loop. +Jumpsuited Hound Dog !prop_boolean:_auto_thisLoopPlusNoncombat +# 1.2x multiplier fairy Steam-Powered Cheerleader prop:_cheerleaderSteam>50 -#Mutant Fire Ant grimdark:1 +# 1.1x multiplier fairy Steam-Powered Cheerleader prop:_cheerleaderSteam>0 +# fairy that generates extra adventures +Reagnimated Gnome +# Fairywhelp that drops x and o without limit. 1 each per 9 combats. 3 o for food. 3 x for drink, 23 x to skip half bridge. +XO Skeleton +# Fairy that drops bacon with no limit. 1 per combat +Intergnat # Fairyballs Elf Operative Optimistic Candle Rockin' Robin -# More BACON, why not -Intergnat # Fairywhelps Pocket Professor -XO Skeleton Garbage Fire Dandy Lion # Fairychauns +Fist Turkey Cat Burglar Angry Jung Man +Grimstone Golem Adventurous Spelunker Blavious Kloop Hippo Ballerina @@ -78,20 +50,24 @@ Gelatinous Cubeling Steam-Powered Cheerleader Obtuse Angel Green Pixie -#Mutant Fire Ant grimdark:2 -# Let's bowl 300! -Bowlet # Elemental fairies Sleazy Gravy Fairy Stinky Gravy Fairy Flaming Gravy Fairy Frozen Gravy Fairy Spooky Gravy Fairy +# Physical damage fairy +Bowlet # Barely special fairies Mechanical Songbird Grouper Groupie Peppermint Rhino +# Fairy that if fed equipment will regen MP and give extra drops. Since we do not make use of this functionality it is just a fairy. +Slimeling # Turtles are cute Syncopated Turtle # The original Baby Gravy Fairy +# Mutant Fire Ant multiplier is 1.3-(0.15*grimace darkness). Too marginal because of opportunity cost compared to leveling another familiar. +# If we level it today when it gives a good bonus, tomorrow it might drop to bad bonus and we have to start leveling another fairy. +Mutant Fire Ant \ No newline at end of file diff --git a/BUILD/familiars/regen.dat b/BUILD/familiars/regen.dat index f30a9106f..95eadea6b 100644 --- a/BUILD/familiars/regen.dat +++ b/BUILD/familiars/regen.dat @@ -4,14 +4,14 @@ # But starfish restore roughly 0.25*weight PER TURN # and average combat length looks to be ~6 rounds in autoscend, so that's 1.5*weight on average # Not even bothering with cocoabos -# Ash is nice +# starfish. drops 5 ash/day which makes +15 ML potion for 15 adv Galloping Grill prop:_hotAshesDrops<5 -# Tokens are nice +# starfish that drops 5 tokens a day that can be exchanged for a spleen consumable that gives adv Rogue Program prop:_tokenDrops<5 -# Hugpockets are good, Xs and Os are good, even if whelps aren't as good as starfish -XO Skeleton prop:_xoHugsUsed<11 -# Free stuff! -Lil' Barrel Mimic +# whelp. Drops x and o with no limit. 1 each per nine combats. makes density 4.5 food. density 4 booze. can skip building a bridge. +XO Skeleton +# Drops assorted stuff, mostly junk. has some awesome food. requires familiar equip brass bung spigot to regen HP/MP +Lil' Barrel Mimic item:brass bung spigot>0 # It's a starfish with reduced activation rate, except it ALWAYS attacks on turn one, so that's probably more hits per battle on average in short battles? oh, and it's a sombrero too Galloping Grill # A super starfish (50% activation instead of 33%) @@ -52,4 +52,4 @@ Pet Cheezling class:Sauceror Pottery Barn Owl # Regular old whelps Pet Cheezling -Ghuol Whelp +Ghuol Whelp \ No newline at end of file diff --git a/RELEASE/data/autoscend_familiars.txt b/RELEASE/data/autoscend_familiars.txt index acba290e5..c4bb93c6d 100644 --- a/RELEASE/data/autoscend_familiars.txt +++ b/RELEASE/data/autoscend_familiars.txt @@ -17,6 +17,96 @@ boss 2 Mu boss 3 Warbear Drone boss 4 Mosquito +# "drop" type is used when we want to grab a familiar that drops items themselves rather than boosting the odds of the enemy dropping items. +# +# First we grab up to small amount of various specific drops. +# +# 5 turkey booze drops a day. each is size 1 and density of either 5, 5.5, or 6 +drop 0 Fist Turkey prop:_turkeyBooze<5 +# every 10 yellow pixels make a size 2 density 5 food or drink. unlimited drops per day. prioritize having enough to craft 2. +# drops 1 per combat with chance of 2nd if wearing familiar specific equip +drop 1 Puck Man item:Yellow Pixel<20 +drop 2 Ms. Puck Man item:Yellow Pixel<20 +# 1st wax drop per run only takes 5 combats, afterwards 30. makes a single size 2 density 4.25 food or drink +drop 3 Optimistic Candle prop:optimisticCandleProgress>=25 +# 1st robin egg per run only takes 5 combats, afterwards 30. potion that gives all res +3 +drop 4 Rockin' Robin prop:rockinRobinProgress>=25 +# 1st burning newspaper per run only takes 5 combats, afterwards 30. can be used for +5 adv on dayroll back equip +drop 5 Garbage Fire prop:garbageFireProgress>=25 +# Hot ashes can make a potion that gives +15 ML for 15 adv. keep 1 of them in stock +drop 6 Galloping Grill prop:_hotAshesDrops<5;item:hot ashes<1 +# +# get substats from fist turkey in The Source path +drop 7 Fist Turkey prop:_turkeyMuscle<5;mainstat:Muscle;path:The Source +drop 8 Fist Turkey prop:_turkeyMyst<5;mainstat:Mysticality;path:The Source +drop 9 Fist Turkey prop:_turkeyMoxie<5;mainstat:Moxie;path:The Source +# +# Cat Burgler can charge up heists. 30 combats give it 2 charges. +drop 10 Cat Burglar prop:_catBurglarCharge<30 +# +# Drops many items. make sure we got 1 in stock of the banisher, as well as size 1 density 5 food/drink +# Because it drops so many different items the odds of getting what we want are reduced. so lowered its priority +drop 11 Elf Operative item:tryptophan dart<1 +drop 12 Elf Operative item:elf army field rations<1 +drop 13 Elf Operative item:martiny<1 +# drops size 1 density 4.5 food and drink. odds of drop are relatively low so it down here +drop 14 Garbage Fire item:extra-toasted half sandwich<1 +drop 15 Garbage Fire item:mulled hobo wine<1 +# +# Drops BACON every battle. 100 bacon makes size 15 density 4.83 food. 150 bacon can get you a fat loot token +drop 16 Intergnat item:BACON<150 +# +# Below this lines drops are not needed more of for the run and are just grabbing for profit. +# Most are useful in limited amounts which we already grab via boolean autoChooseFamiliar(location place) +# +# density 1.875 size 4 spleen consumables. boolean autoChooseFamiliar(location place) will already grab the amount needed for spleen +# Here they are only used to grab extras. +drop 17 Grim Brother prop:_grimFairyTaleDrops<5;!prop_boolean:_auto_thisLoopPlusNoncombat +drop 18 Pair of Stomping Boots prop:_bootStomps<7 +drop 19 Baby Sandworm prop:_aguaDrops<5 +drop 20 Bloovian Groose prop:_grooseDrops<5 +drop 21 Golden Monkey prop:_powderedGoldDrops<5 +drop 22 Unconscious Collective prop:_dreamJarDrops<5 +# psychoanalytic jar 1 per day. +drop 23 Angry Jung Man prop:_jungDrops<1 +# grimstone mask 1 per day +drop 24 Grimstone Golem prop:_grimstoneMaskDrops<1 +# tales of spelunking 1 per day +drop 25 Adventurous Spelunker prop:_spelunkingTalesDrops<1 +# can drop 5 devilish folio a day +drop 26 Blavious Kloop prop:_kloopDrops<5 +# can drop 5 absinthe a day +drop 27 Green Pixie prop:_absintheDrops<5 +# Drops robin's egg every 30 combats. +3 all res potion +drop 28 Rockin' Robin item:robin's egg<1 +# Hot ashes can make a potion that gives +15 ML for 15 adv. drop limit 5/day +drop 29 Galloping Grill prop:_hotAshesDrops<5 +# +# Below this line are familiars with no properties. meaning if you have it then it will be kept selected permanently. +# Most of those also appear higher up in the file with properties. Meaning we use them until a select amount is grabbed first. +# +# Drops many items. among them: banish, restore, stun, damage, size 1 density 5 food/drink, -combat equip, all res +2 equip, +3XP equip, +15% meat equip +drop 30 Elf Operative +# Drops more burning newspapers. one per 30 combats. also drops size 1 density 4.5 food and drink +drop 31 Garbage Fire +# Drops x and o with no limit. 1 each per nine combats. makes density 4.5 food. density 4 booze. can skip building a bridge. +drop 32 XO Skeleton +# Drops BACON every combat +drop 33 Intergnat +# Generates adventures after combat +drop 34 Reagnimated Gnome +# Every 30 combats drops wax which makes a single size 2 density 4.25 food or drink +drop 35 Optimistic Candle +# Drops robin's egg every 30 combats. +3 all res potion +drop 36 Rockin' Robin +# cheap IOTM derivative that drops many different things. many are junk, but it does have size 3 density 3.83 food which is better than nothing. +drop 37 Lil' Barrel Mimic +# Once the hot ashes all dropped. remaining drops are not that useful. +drop 38 Galloping Grill +# Can use to track phyllum, every 11 encounters from tracked phyllum results in a drop. Needs more code before it goes higher on the list +drop 39 Red-Nosed Snapper +# 2% and 4% chance respectively to drop time's arrow and arrowgram. + # We want to delevel, but don't want to deal damage gremlins 0 Nosy Nose gremlins 1 Plastic Pirate Skull @@ -30,103 +120,78 @@ init 2 Oily Woim # That and it's booze isn't terribly relevant nowadays, so it's been demoted init 3 Happy Medium -# Undead familiars only when a zombie -item 0 XO Skeleton path:Zombie Master;prop:_xoHugsUsed<11 -item 1 Reagnimated Gnome path:Zombie Master -# Do we wanna grab cubeling drops? Usually yes. -item 2 Gelatinous Cubeling prop:auto_useCubeling=true;prop:auto_cubeItems=true -# Cheerleader isn't subject to weight restrictions in KOLHS, so let's just use it before almost anything to be safee -item 3 Steam-Powered Cheerleader path:KOLHS -# Wanna get that jar -item 4 Angry Jung Man prop:_jungDrops<1;day:1 -# Wanna get that mask -item 5 Grimstone Golem prop:_grimstoneMaskDrops<1;day:1 -# That's some nice booze -item 6 Fist Turkey prop:_turkeyBooze<5 -# Might as well grab an egg -item 7 Rockin' Robin prop:rockinRobinProgress>=25 -# And some wax -item 8 Optimistic Candle prop:optimisticCandleProgress>=25 -# And some garbage -item 9 Garbage Fire prop:garbageFireProgress>=25 -# And devilish folios -item 10 Blavious Kloop prop:_kloopDrops<3 -# And some absinthe -item 11 Green Pixie prop:_absintheDrops<3 -# And a tales of spelunking -item 12 Adventurous Spelunker prop:_spelunkingTalesDrops<1 -# And some substats, if in The Source -item 13 Fist Turkey prop:_turkeyMuscle<5;mainstat:Muscle;path:The Source -item 14 Fist Turkey prop:_turkeyMyst<5;mainstat:Mysticality;path:The Source -item 15 Fist Turkey prop:_turkeyMoxie<5;mainstat:Moxie;path:The Source -# And some BACON -item 16 Intergnat item:BACON<350 -# And some heist charges -item 17 Cat Burglar prop:_catBurglarCharge<30 -# And some hugpockets -item 18 XO Skeleton prop:_xoHugsUsed<5 -# And some pastes -item 19 Pair of Stomping Boots prop:_bootStomps<7 -# And some more hugpockets -item 20 XO Skeleton prop:_xoHugsUsed<11 -# And some adventures -item 21 Reagnimated Gnome +# "Item" is used when we want a familiar that boosts the chance of a monster dropping an item +# We expect that familiars that drop items directly a limited amount of times per day will be used first elsewhere. So do not account for those. +# +# exempt from 10 lbs restriction in KOHLS path +item 0 Steam-Powered Cheerleader path:KOLHS # Fairies with a multiplier -item 22 Steam-Powered Cheerleader prop:_cheerleaderSteam>150 -#Mutant Fire Ant grimdark:0 -item 23 Steam-Powered Cheerleader prop:_cheerleaderSteam>100 -# Jumpsuited Hound Dog DELIBERATELY not included because it provides usually unwanted +combat -item 24 Steam-Powered Cheerleader prop:_cheerleaderSteam>50 -#Mutant Fire Ant grimdark:1 -item 25 Steam-Powered Cheerleader prop:_cheerleaderSteam>0 +# 1.4x multiplier fairy +item 1 Steam-Powered Cheerleader prop:_cheerleaderSteam>150 +# 1.3x multiplier fairy +item 2 Steam-Powered Cheerleader prop:_cheerleaderSteam>100 +# Jumpsuited Hound Dog is a 1.25x multiplier fairy that provides +combat. only use it if we did not provide noncombat this loop. +item 3 Jumpsuited Hound Dog !prop_boolean:_auto_thisLoopPlusNoncombat +# 1.2x multiplier fairy +item 4 Steam-Powered Cheerleader prop:_cheerleaderSteam>50 +# 1.1x multiplier fairy +item 5 Steam-Powered Cheerleader prop:_cheerleaderSteam>0 +# fairy that generates extra adventures +item 6 Reagnimated Gnome +# Fairywhelp that drops x and o without limit. 1 each per 9 combats. 3 o for food. 3 x for drink, 23 x to skip half bridge. +item 7 XO Skeleton +# Fairy that drops bacon with no limit. 1 per combat +item 8 Intergnat # Fairyballs -item 26 Elf Operative -item 27 Optimistic Candle -item 28 Rockin' Robin -# More BACON, why not -item 29 Intergnat +item 9 Elf Operative +item 10 Optimistic Candle +item 11 Rockin' Robin # Fairywhelps -item 30 Pocket Professor -item 31 XO Skeleton -item 32 Garbage Fire -item 33 Dandy Lion +item 12 Pocket Professor +item 13 Garbage Fire +item 14 Dandy Lion # Fairychauns -item 34 Cat Burglar -item 35 Angry Jung Man -item 36 Adventurous Spelunker -item 37 Blavious Kloop -item 38 Hippo Ballerina -item 39 Dancing Frog -item 40 Coffee Pixie -item 41 Attention-Deficit Demon -item 42 Jitterbug -item 43 Casagnova Gnome -item 44 Psychedelic Bear -item 45 Piano Cat +item 15 Fist Turkey +item 16 Cat Burglar +item 17 Angry Jung Man +item 18 Grimstone Golem +item 19 Adventurous Spelunker +item 20 Blavious Kloop +item 21 Hippo Ballerina +item 22 Dancing Frog +item 23 Coffee Pixie +item 24 Attention-Deficit Demon +item 25 Jitterbug +item 26 Casagnova Gnome +item 27 Psychedelic Bear +item 28 Piano Cat # Slightly special fairies -item 46 Red-Nosed Snapper -item 47 Pair of Stomping Boots -item 48 Gelatinous Cubeling -item 49 Steam-Powered Cheerleader -item 50 Obtuse Angel -item 51 Green Pixie -#Mutant Fire Ant grimdark:2 -# Let's bowl 300! -item 52 Bowlet +item 29 Red-Nosed Snapper +item 30 Pair of Stomping Boots +item 31 Gelatinous Cubeling +item 32 Steam-Powered Cheerleader +item 33 Obtuse Angel +item 34 Green Pixie # Elemental fairies -item 53 Sleazy Gravy Fairy -item 54 Stinky Gravy Fairy -item 55 Flaming Gravy Fairy -item 56 Frozen Gravy Fairy -item 57 Spooky Gravy Fairy +item 35 Sleazy Gravy Fairy +item 36 Stinky Gravy Fairy +item 37 Flaming Gravy Fairy +item 38 Frozen Gravy Fairy +item 39 Spooky Gravy Fairy +# Physical damage fairy +item 40 Bowlet # Barely special fairies -item 58 Mechanical Songbird -item 59 Grouper Groupie -item 60 Peppermint Rhino +item 41 Mechanical Songbird +item 42 Grouper Groupie +item 43 Peppermint Rhino +# Fairy that if fed equipment will regen MP and give extra drops. Since we do not make use of this functionality it is just a fairy. +item 44 Slimeling # Turtles are cute -item 61 Syncopated Turtle +item 45 Syncopated Turtle # The original -item 62 Baby Gravy Fairy +item 46 Baby Gravy Fairy +# Mutant Fire Ant multiplier is 1.3-(0.15*grimace darkness). Too marginal because of opportunity cost compared to leveling another familiar. +# If we level it today when it gives a good bonus, tomorrow it might drop to bad bonus and we have to start leveling another fairy. # Wanna get that jar meat 0 Angry Jung Man prop:_jungDrops<1;day:1 @@ -193,14 +258,14 @@ meat 39 Leprechaun # But starfish restore roughly 0.25*weight PER TURN # and average combat length looks to be ~6 rounds in autoscend, so that's 1.5*weight on average # Not even bothering with cocoabos -# Ash is nice +# starfish. drops 5 ash/day which makes +15 ML potion for 15 adv regen 0 Galloping Grill prop:_hotAshesDrops<5 -# Tokens are nice +# starfish that drops 5 tokens a day that can be exchanged for a spleen consumable that gives adv regen 1 Rogue Program prop:_tokenDrops<5 -# Hugpockets are good, Xs and Os are good, even if whelps aren't as good as starfish -regen 2 XO Skeleton prop:_xoHugsUsed<11 -# Free stuff! -regen 3 Lil' Barrel Mimic +# whelp. Drops x and o with no limit. 1 each per nine combats. makes density 4.5 food. density 4 booze. can skip building a bridge. +regen 2 XO Skeleton +# Drops assorted stuff, mostly junk. has some awesome food. requires familiar equip brass bung spigot to regen HP/MP +regen 3 Lil' Barrel Mimic item:brass bung spigot>0 # It's a starfish with reduced activation rate, except it ALWAYS attacks on turn one, so that's probably more hits per battle on average in short battles? oh, and it's a sombrero too regen 4 Galloping Grill # A super starfish (50% activation instead of 33%) @@ -241,7 +306,6 @@ regen 26 Pet Cheezling class:Sauceror regen 27 Pottery Barn Owl # Regular old whelps regen 28 Pet Cheezling -regen 29 Ghuol Whelp # Sombrero is desirable with a decent amount of ML stat 0 Galloping Grill ML:>=120 diff --git a/RELEASE/scripts/autoscend.ash b/RELEASE/scripts/autoscend.ash index 9b1989cfb..88238f615 100644 --- a/RELEASE/scripts/autoscend.ash +++ b/RELEASE/scripts/autoscend.ash @@ -3118,9 +3118,9 @@ boolean doTasks() return false; } - //These settings should never persist into another turn, ever. - set_property("auto_doCombatCopy", "no"); - set_property("auto_disableFamiliarChanging", false); + //These settings should never persist into another turn, ever. They only track something for a single instance of the main loop. + //We use boolean instead of adventure count because of free combats. + resetThisLoop(); set_property("choiceAdventure1387", -1); // using the force non-combat print_header(); @@ -3188,8 +3188,6 @@ boolean doTasks() resetFlavour(); basicAdjustML(); - handleFamiliar("item"); - basicFamiliarOverrides(); councilMaintenance(); # This function buys missing skills in general, not just for Picky. diff --git a/RELEASE/scripts/autoscend/auto_adventure.ash b/RELEASE/scripts/autoscend/auto_adventure.ash index 6f20329fa..0cb2fb892 100644 --- a/RELEASE/scripts/autoscend/auto_adventure.ash +++ b/RELEASE/scripts/autoscend/auto_adventure.ash @@ -304,24 +304,22 @@ void preAdvUpdateFamiliar(location place) { return; } - - familiar famChoice = to_familiar(get_property("auto_familiarChoice")); - if(auto_my_path() == "Pocket Familiars") + if(!pathAllowsFamiliar()) { - famChoice = $familiar[none]; + return; //will just error in those paths } - - if((famChoice != $familiar[none]) && canChangeFamiliar() && (internalQuestStatus("questL13Final") < 13)) + + //familiar required to adventure in that zone, override everything else. + if(place == $location[The Deep Machine Tunnels]) { - if((famChoice != my_familiar()) && !inAftercore()) - { -# auto_log_error("FAMILIAR DIRECTIVE ERROR: Selected " + famChoice + " but have " + my_familiar(), "red"); - use_familiar(famChoice); - } + handleFamiliar($familiar[Machine Elf]); } - - if(auto_have_familiar($familiar[cat burglar])) + + //if familiar not set yet, first check stealing familiar + if(get_property("auto_familiarChoice") == "" && canChangeToFamiliar($familiar[cat burglar]) && catBurglarHeistsLeft() > 0) { + //Stealing with familiar. TODO add XO Skelton here too + item[monster] heistDesires = catBurglarHeistDesires(); boolean wannaHeist = false; foreach mon, it in heistDesires @@ -335,21 +333,49 @@ void preAdvUpdateFamiliar(location place) } } } - if(wannaHeist && (famChoice != $familiar[none]) && canChangeToFamiliar($familiar[Cat Burglar])) + if(wannaHeist) { - use_familiar($familiar[cat burglar]); + handleFamiliar($familiar[cat burglar]); } } - - if((place == $location[The Deep Machine Tunnels]) && (my_familiar() != $familiar[Machine Elf])) + + //if familiar not set choose a familiar using general logic + if(get_property("auto_familiarChoice") == "" && !get_property("_auto_thisLoopHandleFamiliar").to_boolean()) + { + //if we already called handleFamiliar it means we have a specific familiar we need for the location we are adventuring in + //if we don't then it means we should run the selector before to choose the best general familiar + autoChooseFamiliar(place); + } + + //if we explicitly speficied that we want to not use a familiar this adventure. + if(get_property("auto_familiarChoice") == "REALLY_NONE") { - if(!auto_have_familiar($familiar[Machine Elf])) + if(my_familiar() != $familiar[none]) { - auto_log_critical("Massive failure, we don't use snowglobes."); - abort("Massive failure, we don't use snowglobes."); + use_familiar($familiar[none]); } - auto_log_error("Somehow we are going to the DMT without a Machine Elf...", "red"); - use_familiar($familiar[Machine Elf]); + return; + } + + familiar famChoice = to_familiar(get_property("auto_familiarChoice")); + if(famChoice == $familiar[none]) + { + if(get_property("auto_familiarChoice") == "") + { + abort("void preAdvUpdateFamiliar failed because property auto_familiarChoice is empty for some reason"); + } + abort("void preAdvUpdateFamiliar failed to convert auto_familiarChoice of [" + get_property("auto_familiarChoice") + "] into a $familiar"); + } + + if(famChoice != my_familiar() && canChangeToFamiliar(famChoice)) + { + use_familiar(famChoice); + } + + //familiar equipment overrides + if((my_path() == "Heavy Rains")) + { + autoEquip($slot[familiar], $item[miniature life preserver]); } if(my_familiar() == $familiar[Trick-Or-Treating Tot]) diff --git a/RELEASE/scripts/autoscend/auto_familiar.ash b/RELEASE/scripts/autoscend/auto_familiar.ash index f0db19f85..f1bef094e 100644 --- a/RELEASE/scripts/autoscend/auto_familiar.ash +++ b/RELEASE/scripts/autoscend/auto_familiar.ash @@ -41,24 +41,30 @@ boolean pathAllowsFamiliar() boolean auto_have_familiar(familiar fam) { - if(auto_my_path() == "License to Adventure") + if(!pathAllowsFamiliar()) { return false; } - if($classes[ - Avatar Of Boris, - Avatar Of Jarlsberg, - Avatar Of Sneaky Pete, - Ed, - Vampyre, - ] contains my_class()) + if(!auto_is_valid(fam)) { return false; } - if(!auto_is_valid(fam)) + + //handle blacklisting of familiars by users + int[familiar] blacklist; + if(get_property("auto_blacklistFamiliar") != "") + { + string[int] noFams = split_string(get_property("auto_blacklistFamiliar"), ";"); + foreach index, fam in noFams + { + blacklist[to_familiar(trim(fam))] = 1; + } + } + if(blacklist contains fam) { return false; } + return have_familiar(fam); } @@ -92,7 +98,7 @@ boolean canChangeToFamiliar(familiar target) { return false; } - + // if you don't have a familiar, you can't change to it. if(!auto_have_familiar(target)) { @@ -110,81 +116,101 @@ boolean canChangeToFamiliar(familiar target) return false; } + //handle a target of none. after we verified we are not breaking a 100% run to do so. + if(target == $familiar[none]) + { + //on paths that do not allow familiars at all, trying to switch to $familiar[none] causes an exception. + return pathAllowsFamiliar(); + } + // if you reached this point, then auto_100familiar must not be set to anything, you are allowed to change familiar. return true; } -boolean handleFamiliar(string type) +familiar lookupFamiliarDatafile(string type) { - //Can this take zoneInfo into account? - - // Put all familiars in reverse priority order here. - int[familiar] blacklist; - - int ascensionThreshold = get_property("auto_ascensionThreshold").to_int(); - if(ascensionThreshold == 0) - { - ascensionThreshold = 100; - } - - if(get_property("auto_blacklistFamiliar") != "") - { - string[int] noFams = split_string(get_property("auto_blacklistFamiliar"), ";"); - foreach index, fam in noFams - { - blacklist[to_familiar(trim(fam))] = 1; - } - } - - boolean suggest = type.ends_with("Suggest"); - if(suggest) - { - type = type.substring(0, type.length() - length("Suggest")); - if(familiar_weight(my_familiar()) < 20) - { - return false; - } - } - + //This function looks through /data/autoscend_familiars.txt for the matching "type" in order and selects the first match whose conditions are met. Said conditions typically include path exclusions and a check to see if that familiar dropped something today. + //we do not want a fallback here. if no matching familiar is found then do nothing here, a familiar will be automatically set in pre adventure + + auto_log_debug("lookupFamiliarDatafile is checking for type [" + type + "]"); string [string,int,string] familiars_text; if(!file_to_map("autoscend_familiars.txt", familiars_text)) - auto_log_critical("Could not load autoscend_familiars.txt. This is bad!", "red"); + { + abort("Could not load /data/autoscend_familiars.txt"); + } foreach i,name,conds in familiars_text[type] { familiar thisFamiliar = name.to_familiar(); - if(thisFamiliar == $familiar[none] && name != "none") + if(thisFamiliar == $familiar[none]) { - auto_log_error('"' + name + '" does not convert to a familiar properly!', "red"); - auto_log_error(type + "; " + i + "; " + conds, "red"); + if(name != "none") + { + auto_log_error("lookupFamiliarDatafile failed to convert string [" + name + "] to familiar", "red"); + auto_log_error(type + "; " + i + "; " + conds, "red"); + } continue; } - if(!auto_check_conditions(conds)) - continue; - if(!auto_have_familiar(thisFamiliar)) + if(!auto_check_conditions(conds)) //checks for the conditions specified in the data file continue; - if(blacklist contains thisFamiliar) + if(!canChangeToFamiliar(thisFamiliar)) //check various things that could prevent us from changing to it continue; - return handleFamiliar(thisFamiliar); + return thisFamiliar; + } + + //no suitable familiars found in datafile + return $familiar[none]; +} + +boolean handleFamiliar(string type) +{ + //This function calls familiar lookupFamiliarDatafile(string type) and if a result is found will send it over to handleFamiliar(familiar fam) so it can be set as our target familiar to be used during pre adventure. + //we do not want a fallback here. if no matching familiar is found then do nothing here, a familiar will be automatically set in pre adventure + + if(get_property("auto_disableFamiliarChanging").to_boolean()) + { + return false; //familiar changing temporarily disabled. + } + if(!pathAllowsFamiliar()) + { + return false; + } + + familiar target = lookupFamiliarDatafile(type); + + if(target != $familiar[none]) + { + return handleFamiliar(target); } return false; } boolean handleFamiliar(familiar fam) { - if(!canChangeFamiliar()) + //This function takes a specific named familiar and sets it as our target familiar. To be changed during pre_adventure. + + if(get_property("auto_disableFamiliarChanging").to_boolean()) { - return true; + return false; //familiar changing temporarily disabled. + } + if(!pathAllowsFamiliar()) + { + return false; + } + if(is100FamRun() && get_property("auto_100familiar").to_familiar() != fam) + { + return false; //do not break a 100% familiar run } - if(fam == $familiar[none]) { + set_property("auto_familiarChoice", "REALLY_NONE"); //special handling for switching to familiar none. return true; } - if(!is_unrestricted(fam)) + if(get_property("auto_familiarChoice").to_familiar() == fam) //this should go after $familiar[none] check { - return false; + return true; //desired target is already set as the familiar I will be switching to. } - + + //[Ms. Puck Man] and [Puck Man] are interchangeable. so interchange them if needed. if((fam == $familiar[Ms. Puck Man]) && !auto_have_familiar($familiar[Ms. Puck Man]) && auto_have_familiar($familiar[Puck Man])) { fam = $familiar[Puck Man]; @@ -193,156 +219,167 @@ boolean handleFamiliar(familiar fam) { fam = $familiar[Ms. Puck Man]; } - - familiar toEquip = $familiar[none]; - if(auto_have_familiar(fam)) + + //bjorning has priority + if(my_bjorned_familiar() == fam) { - toEquip = fam; + return false; } - else - { - boolean[familiar] poss = $familiars[Mosquito, Leprechaun, Baby Gravy Fairy, Slimeling, Golden Monkey, Hobo Monkey, Crimbo Shrub, Galloping Grill, Fist Turkey, Rockin\' Robin, Piano Cat, Angry Jung Man, Grimstone Golem, Adventurous Spelunker, Rockin\' Robin]; - int spleen_hold = 4; - if(item_amount($item[Astral Energy Drink]) > 0) - { - spleen_hold = spleen_hold + 8; - } - if(in_hardcore() && ((my_spleen_use() + spleen_hold) <= spleen_limit())) - { - foreach fam in $familiars[Golden Monkey, Grim Brother, Unconscious Collective] - { - if((fam.drops_today < 1) && auto_have_familiar(fam)) - { - toEquip = fam; - } - } - } - else if(in_hardcore() && (item_amount($item[Yellow Pixel]) < 30) && auto_have_familiar($familiar[Ms. Puck Man])) - { - toEquip = $familiar[Ms. Puck Man]; - } - else if(in_hardcore() && (item_amount($item[Yellow Pixel]) < 30) && auto_have_familiar($familiar[Puck Man])) - { - toEquip = $familiar[Puck Man]; - } + set_property("auto_familiarChoice", fam); + set_property("_auto_thisLoopHandleFamiliar", true); + return true; +} - foreach thing in poss - { - if((auto_have_familiar(thing)) && (my_bjorned_familiar() != thing)) - { - toEquip = thing; - } - } +boolean autoChooseFamiliar(location place) +{ + //if no familiar target was set this loop. then automatically determine which familiar to use + + if(get_property("auto_disableFamiliarChanging").to_boolean()) + { + return false; } - - if((toEquip != $familiar[none]) && (my_bjorned_familiar() != toEquip)) + if(!pathAllowsFamiliar()) { - #use_familiar(toEquip); - set_property("auto_familiarChoice", toEquip); + return false; //will just error in those paths } - if(inAftercore() && (toEquip != $familiar[none]) && (toEquip != my_familiar()) && (my_bjorned_familiar() != toEquip)) + familiar familiar_target_100 = get_property("auto_100familiar").to_familiar(); + if(familiar_target_100 != $familiar[none]) { - use_familiar(toEquip); + return handleFamiliar(familiar_target_100); //do not break 100 familiar runs } -# set_property("auto_familiarChoice", my_familiar()); - - if(hr_handleFamiliar(toEquip)) + set_property("auto_familiarChoice", $familiar[none]); //reset familiar choice + + //familiar required to adventure in that zone. + if(place == $location[The Deep Machine Tunnels]) { - return true; + return handleFamiliar($familiar[Machine Elf]); } - return false; -} - -boolean basicFamiliarOverrides() -{ - if(($familiars[Adventurous Spelunker, Rockin\' Robin] contains my_familiar()) && auto_have_familiar($familiar[Grimstone Golem]) && (in_hardcore() || !possessEquipment($item[Buddy Bjorn]))) + + //High priority checks that are too complicated for the datafile + familiar famChoice = $familiar[none]; + + //Gelatinous Cubeling drops items that save turns in the daily dungeon + if(famChoice == $familiar[none] && + canChangeToFamiliar($familiar[Gelatinous Cubeling]) && + get_property("auto_useCubeling").to_boolean() && + get_property("auto_cubeItems").to_boolean()) { - if(!possessEquipment($item[Ornate Dowsing Rod]) && (item_amount($item[Odd Silver Coin]) < 5) && (item_amount($item[Grimstone Mask]) == 0) && considerGrimstoneGolem(false)) - { - handleFamiliar($familiar[Grimstone Golem]); - } + famChoice = $familiar[Gelatinous Cubeling]; } - - int spleen_hold = 8 * item_amount($item[Astral Energy Drink]); - foreach it in $items[Agua De Vida, Grim Fairy Tale, Groose Grease, Powdered Gold, Unconscious Collective Dream Jar] + + //grab spleen consumables early if you do not have enough such items to fill up your spleen. Extras will be handled by "drop" datafile + //Should take around 10 combats to grab enough on day 1 and on subsequent days you should already have them from previous days. + if(famChoice == $familiar[none]) { - if (auto_is_valid(it)) + int available_spleen_items_size = 0; + foreach it in $items[Agua De Vida, Grim Fairy Tale, Groose Grease, Powdered Gold, Unconscious Collective Dream Jar] { - spleen_hold += 4 * item_amount(it); + if (auto_is_valid(it)) + { + available_spleen_items_size += 4 * item_amount(it); + } } - } - if((spleen_left() >= (4 + spleen_hold)) && haveSpleenFamiliar()) - { - int spleenHave = 0; - foreach fam in $familiars[Baby Sandworm, Bloovian Groose, Golden Monkey, Grim Brother, Unconscious Collective] + foreach it in $items[beastly paste, bug paste, cosmic paste, oily paste, demonic paste, gooey paste, elemental paste, Crimbo paste, fishy paste, goblin paste, hippy paste, hobo paste, indescribably horrible paste, greasy paste, Mer-kin paste, orc paste, penguin paste, pirate paste, chlorophyll paste, slimy paste, ectoplasmic paste, strange paste] { - if(auto_have_familiar(fam)) + //count pastes from fairy-worn boots. excepting excessively expensive pastes. + if (auto_is_valid(it) && auto_mall_price(it) < 10000 + auto_mall_price($item[gooey paste])) { - spleenHave++; + available_spleen_items_size += 4 * item_amount(it); } } - - if(spleenHave > 0) + + if(spleen_left() >= (4 + available_spleen_items_size) && haveSpleenFamiliar()) { - int need = (spleen_left() + 3)/4; - int bound = (need + spleenHave - 1) / spleenHave; - foreach fam in $familiars[Baby Sandworm, Bloovian Groose, Golden Monkey, Grim Brother, Unconscious Collective] + int spleenFamiliarsAvailable = 0; + foreach fam in $familiars[Baby Sandworm, Rogue Program, Pair of Stomping Boots, Bloovian Groose, Unconscious Collective, Grim Brother, Golden Monkey] + { + if(canChangeToFamiliar(fam)) + { + spleenFamiliarsAvailable++; + } + } + + int spleen_drops_need = (spleen_left() + 3)/4; + int bound = (spleen_drops_need + spleenFamiliarsAvailable - 1) / spleenFamiliarsAvailable; + + if(spleenFamiliarsAvailable > 0) foreach fam in $familiars[Baby Sandworm, Rogue Program, Pair of Stomping Boots, Bloovian Groose, Unconscious Collective, Grim Brother, Golden Monkey] { - if((fam.drops_today < bound) && auto_have_familiar(fam)) + if(get_property("_auto_thisLoopPlusNoncombat").to_boolean() && fam == $familiar[Grim Brother]) + { + continue; //skip +combat familiars if we want -combat + } + if((fam.drops_today < bound) && canChangeToFamiliar(fam)) { - handleFamiliar(fam); + famChoice = fam; break; } } } } - else if((item_amount($item[Yellow Pixel]) < 20) && (auto_have_familiar($familiar[Ms. Puck Man]) || auto_have_familiar($familiar[Puck Man]))) + + //[grimstone mask] for an [ornate dowsing rod] for the desert. if still needed + if(famChoice == $familiar[none] && + canChangeToFamiliar($familiar[Grimstone Golem]) && + !possessEquipment($item[Ornate Dowsing Rod]) && + item_amount($item[Odd Silver Coin]) < 5 && + item_amount($item[Grimstone Mask]) == 0 && + $familiar[Grimstone Golem].drops_today < 1 && + considerGrimstoneGolem(false)) { - handleFamiliar($familiar[Ms. Puck Man]); + famChoice = $familiar[Grimstone Golem]; } - - foreach fam in $familiars[Golden Monkey, Grim Brother, Unconscious Collective] + + //[Angry Jung Man] drops [psychoanalytic jar]. we want 1 to save adventures on getting [digital key] + if(famChoice == $familiar[none] && + canChangeToFamiliar($familiar[Angry Jung Man]) && + !possessEquipment($item[Powerful Glove]) && //powerful glove is a better way to get digital key + $familiar[Angry Jung Man].drops_today < 1) { - if((my_familiar() == fam) && (fam.drops_today >= 1)) - { - handleFamiliar("item"); - } + famChoice = $familiar[Angry Jung Man]; } - if((my_familiar() == $familiar[Puck Man]) && (item_amount($item[Yellow Pixel]) > 20)) + + //if critically low on MP and meat. use restore familiar to avoid going bankrupt + boolean poor = my_meat() < 1000; + if(internalQuestStatus("questL11MacGuffin") < 2) { - handleFamiliar("item"); + poor = my_meat() < 7000; } - if((my_familiar() == $familiar[Ms. Puck Man]) && (item_amount($item[Yellow Pixel]) > 20)) + if(famChoice == $familiar[none] && my_maxmp() > 50 && my_mp()*5 < my_maxmp() && poor) { - handleFamiliar("item"); + famChoice = lookupFamiliarDatafile("regen"); } - - if(in_hardcore() && (my_mp() < 50) && ((my_maxmp() - my_mp()) > 20)) + + //select the best familiar that drops items directly. Will prioritize useful items and awesome+ food and drink and then other drops. + if(famChoice == $familiar[none]) { - handleFamiliar("regen"); + famChoice = lookupFamiliarDatafile("drop"); + } + + //select the best familiar that improves the odds of the enemy dropping an item + if(famChoice == $familiar[none]) + { + famChoice = lookupFamiliarDatafile("item"); + } + + //fallback choices + if(famChoice == $familiar[none]) + { + famChoice = lookupFamiliarDatafile("meat"); + } + if(famChoice == $familiar[none] && canChangeToFamiliar($familiar[Mosquito])) + { + famChoice = $familiar[Mosquito]; } - return false; + return handleFamiliar(famChoice); } boolean haveSpleenFamiliar() { - boolean [familiar] spleenies = $familiars[Baby Sandworm, Rogue Program, Pair of Stomping Boots, Bloovian Groose, Unconscious Collective, Grim Brother, Golden Monkey]; - - int[familiar] blacklist; - if(get_property("auto_blacklistFamiliar") != "") - { - string[int] noFams = split_string(get_property("auto_blacklistFamiliar"), ";"); - foreach index, fam in noFams - { - blacklist[to_familiar(trim(fam))] = 1; - } - } - - foreach fam in spleenies + foreach fam in $familiars[Baby Sandworm, Rogue Program, Pair of Stomping Boots, Bloovian Groose, Unconscious Collective, Grim Brother, Golden Monkey] { - if(have_familiar(fam) && !(blacklist contains fam)) + if(auto_have_familiar(fam)) { return true; } diff --git a/RELEASE/scripts/autoscend/auto_util.ash b/RELEASE/scripts/autoscend/auto_util.ash index 855b8f9d7..46411cf1c 100644 --- a/RELEASE/scripts/autoscend/auto_util.ash +++ b/RELEASE/scripts/autoscend/auto_util.ash @@ -130,10 +130,6 @@ boolean fightScienceTentacle(); boolean evokeEldritchHorror(string option); boolean evokeEldritchHorror(); boolean auto_change_mcd(int mcd); -boolean providePlusCombat(int amt); -boolean providePlusNonCombat(int amt); -boolean providePlusCombat(int amt, boolean doEquips); -boolean providePlusNonCombat(int amt, boolean doEquips); boolean basicAdjustML(); boolean auto_is_valid(item it); boolean auto_is_valid(familiar fam); @@ -2716,6 +2712,7 @@ boolean providePlusNonCombat(int amt) boolean providePlusCombat(int amt, boolean doEquips) { + set_property("_auto_thisLoopPlusCombat", true); //track if this was called this loop. can't check adv because of free fights. if(amt == 0) { return true; @@ -2797,6 +2794,7 @@ boolean providePlusCombat(int amt, boolean doEquips) boolean providePlusNonCombat(int amt, boolean doEquips) { + set_property("_auto_thisLoopPlusNoncombat", true); //track if this was called this loop. can't check adv because of free fights. if(amt == 0) { return true; @@ -6069,6 +6067,10 @@ boolean auto_check_conditions(string conds) if(!($strings[=,==] contains m2.group(2))) return compare_numbers(prop.to_int(), m2.group(3).to_int(), m2.group(2)); return prop == m2.group(3); + // data: + // gets propname and converts to a boolean + case "prop_boolean": + return get_property(condition_data).to_boolean(); // data: // like prop, but with > and < and >= and <= and uses internalQuestStatus // the value to compare to should always be an integer @@ -7069,3 +7071,16 @@ int poolSkillPracticeGains() if(equipped_amount($item[[2268]Staff of Fats]) > 0) count += 2; //note that $item[[7964]Staff of Fats] does not help here. return count; } + +void resetThisLoop() +{ + //These settings should never persist into another turn, ever. They only track something for a single instance of the main loop. + //We use boolean instead of adventure count because of free combats. + + set_property("auto_doCombatCopy", "no"); + set_property("_auto_thisLoopPlusCombat", false); //have we called providePlusCombat this loop + set_property("_auto_thisLoopPlusNoncombat", false); //have we called providePlusNonCombat this loop + set_property("_auto_thisLoopHandleFamiliar", false); //have we called handleFamiliar this loop + set_property("auto_disableFamiliarChanging", false); //disable autoscend making changes to familiar + set_property("auto_familiarChoice", ""); //which familiar do we want to switch to during pre_adventure +} \ No newline at end of file diff --git a/RELEASE/scripts/autoscend/autoscend_header.ash b/RELEASE/scripts/autoscend/autoscend_header.ash index ad2769e24..dac3896a9 100644 --- a/RELEASE/scripts/autoscend/autoscend_header.ash +++ b/RELEASE/scripts/autoscend/autoscend_header.ash @@ -247,9 +247,10 @@ boolean pathAllowsFamiliar(); //Defined in autoscend/auto_familiar.ash boolean auto_have_familiar(familiar fam); //Defined in autoscend/auto_familiar.ash boolean canChangeFamiliar(); //Defined in autoscend/auto_familiar.ash boolean canChangeToFamiliar(familiar target); //Defined in autoscend/auto_familiar.ash +familiar lookupFamiliarDatafile(string type); //Defined in autoscend/auto_familiar.ash boolean handleFamiliar(string type); //Defined in autoscend/auto_familiar.ash boolean handleFamiliar(familiar fam); //Defined in autoscend/auto_familiar.ash -boolean basicFamiliarOverrides(); //Defined in autoscend/auto_familiar.ash +boolean autoChooseFamiliar(location place); //Defined in autoscend/auto_familiar.ash boolean haveSpleenFamiliar(); //Defined in autoscend/auto_familiar.ash @@ -399,6 +400,7 @@ location[int] ListInsertInorder(location[int] list, location what);//Defined in int ListFind(location[int] list, location what); //Defined in autoscend/auto_list.ash int ListFind(location[int] list, location what, int idx); //Defined in autoscend/auto_list.ash location ListOutput(location[int] list); //Defined in autoscend/auto_list.ash +void resetThisLoop(); //Defined in autoscend/auto_util.ash int [item] auto_get_campground(); //Defined in autoscend/auto_util.ash boolean basicAdjustML(); //Defined in autoscend/auto_util.ash boolean beatenUpResolution(); //Defined in autoscend.ash diff --git a/RELEASE/scripts/autoscend/iotms/mr2018.ash b/RELEASE/scripts/autoscend/iotms/mr2018.ash index 1438b58e9..9abb9f1be 100644 --- a/RELEASE/scripts/autoscend/iotms/mr2018.ash +++ b/RELEASE/scripts/autoscend/iotms/mr2018.ash @@ -285,8 +285,7 @@ boolean fantasyRealmToken() { return false; } - set_property("auto_familiarChoice", "none"); - use_familiar($familiar[none]); + handleFamiliar($familiar[none]); if(possessEquipment($item[FantasyRealm G. E. M.])) { diff --git a/RELEASE/scripts/autoscend/paths/heavy_rains.ash b/RELEASE/scripts/autoscend/paths/heavy_rains.ash index cdaa8edcb..20570b302 100644 --- a/RELEASE/scripts/autoscend/paths/heavy_rains.ash +++ b/RELEASE/scripts/autoscend/paths/heavy_rains.ash @@ -24,16 +24,6 @@ void hr_initializeSettings() } } -boolean hr_handleFamiliar(familiar fam) -{ - if((my_path() == "Heavy Rains") && (equipped_item($slot[familiar]) != $item[miniature life preserver]) && (my_familiar() != $familiar[none])) - { - autoEquip($slot[familiar], $item[miniature life preserver]); - return true; - } - return false; -} - boolean routineRainManHandler() { if(!have_skill($skill[Rain Man]) || (auto_my_path() != "Heavy Rains")) From 09144addd55b0b0c7360ec0ccff4dc65a37ca795 Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Sat, 13 Jun 2020 01:02:20 -0700 Subject: [PATCH 11/52] remove use of "REALLY_NONE". (#431) - remove use of "REALLY_NONE". - Just set disableFamiliarChanging to true and use the mafia function to switch to no familiar. - Fix for FantasyRealm not allowing familiars. --- RELEASE/scripts/autoscend/auto_adventure.ash | 12 +----------- RELEASE/scripts/autoscend/auto_familiar.ash | 19 +++++++++++-------- RELEASE/scripts/autoscend/iotms/mr2018.ash | 1 - RELEASE/scripts/autoscend/quests/level_13.ash | 5 ++++- 4 files changed, 16 insertions(+), 21 deletions(-) diff --git a/RELEASE/scripts/autoscend/auto_adventure.ash b/RELEASE/scripts/autoscend/auto_adventure.ash index 0cb2fb892..fdfdb0b7c 100644 --- a/RELEASE/scripts/autoscend/auto_adventure.ash +++ b/RELEASE/scripts/autoscend/auto_adventure.ash @@ -347,16 +347,6 @@ void preAdvUpdateFamiliar(location place) autoChooseFamiliar(place); } - //if we explicitly speficied that we want to not use a familiar this adventure. - if(get_property("auto_familiarChoice") == "REALLY_NONE") - { - if(my_familiar() != $familiar[none]) - { - use_familiar($familiar[none]); - } - return; - } - familiar famChoice = to_familiar(get_property("auto_familiarChoice")); if(famChoice == $familiar[none]) { @@ -373,7 +363,7 @@ void preAdvUpdateFamiliar(location place) } //familiar equipment overrides - if((my_path() == "Heavy Rains")) + if(my_path() == "Heavy Rains") { autoEquip($slot[familiar], $item[miniature life preserver]); } diff --git a/RELEASE/scripts/autoscend/auto_familiar.ash b/RELEASE/scripts/autoscend/auto_familiar.ash index f1bef094e..5d9370b85 100644 --- a/RELEASE/scripts/autoscend/auto_familiar.ash +++ b/RELEASE/scripts/autoscend/auto_familiar.ash @@ -116,13 +116,12 @@ boolean canChangeToFamiliar(familiar target) return false; } - //handle a target of none. after we verified we are not breaking a 100% run to do so. - if(target == $familiar[none]) - { - //on paths that do not allow familiars at all, trying to switch to $familiar[none] causes an exception. - return pathAllowsFamiliar(); + // Don't allow switching to a target of none. + if(target == $familiar[none]) + { + return false; } - + // if you reached this point, then auto_100familiar must not be set to anything, you are allowed to change familiar. return true; } @@ -202,8 +201,7 @@ boolean handleFamiliar(familiar fam) } if(fam == $familiar[none]) { - set_property("auto_familiarChoice", "REALLY_NONE"); //special handling for switching to familiar none. - return true; + return false; } if(get_property("auto_familiarChoice").to_familiar() == fam) //this should go after $familiar[none] check { @@ -255,6 +253,11 @@ boolean autoChooseFamiliar(location place) { return handleFamiliar($familiar[Machine Elf]); } + + // Can't take familiars with you to FantasyRealm + if (place == $location[The Bandit Crossroads]) { + return use_familiar($familiar[none]); + } //High priority checks that are too complicated for the datafile familiar famChoice = $familiar[none]; diff --git a/RELEASE/scripts/autoscend/iotms/mr2018.ash b/RELEASE/scripts/autoscend/iotms/mr2018.ash index 9abb9f1be..684a6f73f 100644 --- a/RELEASE/scripts/autoscend/iotms/mr2018.ash +++ b/RELEASE/scripts/autoscend/iotms/mr2018.ash @@ -285,7 +285,6 @@ boolean fantasyRealmToken() { return false; } - handleFamiliar($familiar[none]); if(possessEquipment($item[FantasyRealm G. E. M.])) { diff --git a/RELEASE/scripts/autoscend/quests/level_13.ash b/RELEASE/scripts/autoscend/quests/level_13.ash index 43f542341..f8110db80 100644 --- a/RELEASE/scripts/autoscend/quests/level_13.ash +++ b/RELEASE/scripts/autoscend/quests/level_13.ash @@ -991,7 +991,10 @@ boolean L13_towerNSTower() uneffect($effect[Jalapeño Saucesphere]); uneffect($effect[Mayeaugh]); uneffect($effect[Spiky Shell]); - handleFamiliar($familiar[none]); + if (canChangeFamiliar()) { + set_property("auto_disableFamiliarChanging", true); + use_familiar($familiar[none]); + } buffMaintain($effect[Tomato Power], 0, 1, 1); buffMaintain($effect[Seeing Colors], 0, 1, 1); buffMaintain($effect[Glittering Eyelashes], 0, 1, 1); From cdafe268714a7b8a10a277a744e8331a634b7230 Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Sat, 13 Jun 2020 15:20:20 -0600 Subject: [PATCH 12/52] hounddog change instead of allowing hounddog whenever we did NOT providePlusNonCombat it will only onl allow it when we DID providePlusCombat friars quest does not need hardcoding of +item familiar as it does not use that. let autoscend choose best familiar removed some hardcoded switching to item familiar AFTER adventuring was done in a zone (in the assumption that whatever the next zone is, it needs it too). add noncombat and combat familiar lists *refactored ProvidePlusCombat/NonCombat to: **Do not quit with return false if we cannot remove an unwanted effect **Check if we are done after every item **Reduce redundant code for checking if we are done via subfunction **account for our equipment providing bonus/malus even if we do not change it **not assume our muffler for sneaky pete. **use dat file for combat and noncombat familiars. this means we now actually use disgeist for noncombat (hound dog was already used before for combat) *buffmaintain will now verify that we got the right muffler before using muffled *added support for unmuffled *added unmuffled to providePlusCombat improved code for familiar handling in provide plus combat/non from previous commit --- BUILD/familiars/combat.dat | 3 + BUILD/familiars/item.dat | 5 +- BUILD/familiars/noncombat.dat | 3 + RELEASE/data/autoscend_familiars.txt | 15 +- RELEASE/scripts/autoscend/auto_util.ash | 193 ++++++++++--------- RELEASE/scripts/autoscend/quests/level_6.ash | 1 - RELEASE/scripts/autoscend/quests/level_7.ash | 9 +- 7 files changed, 120 insertions(+), 109 deletions(-) create mode 100644 BUILD/familiars/combat.dat create mode 100644 BUILD/familiars/noncombat.dat diff --git a/BUILD/familiars/combat.dat b/BUILD/familiars/combat.dat new file mode 100644 index 000000000..ff3bcb680 --- /dev/null +++ b/BUILD/familiars/combat.dat @@ -0,0 +1,3 @@ +# This is a list of familiars who increase the frequency of combat encounters +# 1.25x fairy. increases combat frequency by floor(weight/6) to a maximum of +5% +Jumpsuited Hound Dog \ No newline at end of file diff --git a/BUILD/familiars/item.dat b/BUILD/familiars/item.dat index b5f379409..f77a4a948 100644 --- a/BUILD/familiars/item.dat +++ b/BUILD/familiars/item.dat @@ -8,8 +8,9 @@ Steam-Powered Cheerleader path:KOLHS Steam-Powered Cheerleader prop:_cheerleaderSteam>150 # 1.3x multiplier fairy Steam-Powered Cheerleader prop:_cheerleaderSteam>100 -# Jumpsuited Hound Dog is a 1.25x multiplier fairy that provides +combat. only use it if we did not provide noncombat this loop. -Jumpsuited Hound Dog !prop_boolean:_auto_thisLoopPlusNoncombat +# Jumpsuited Hound Dog is a 1.25x multiplier fairy that provides +combat. +# most places do not want +combat so only use it when we explicitly do providePlusCombat +Jumpsuited Hound Dog prop_boolean:_auto_thisLoopPlusCombat # 1.2x multiplier fairy Steam-Powered Cheerleader prop:_cheerleaderSteam>50 # 1.1x multiplier fairy diff --git a/BUILD/familiars/noncombat.dat b/BUILD/familiars/noncombat.dat new file mode 100644 index 000000000..e1df18851 --- /dev/null +++ b/BUILD/familiars/noncombat.dat @@ -0,0 +1,3 @@ +# This is a list of familiars who decrease the frequency of combat encounters +# reduces combat by -floor(weight/7.5) to a maximum of -10%. +Disgeist \ No newline at end of file diff --git a/RELEASE/data/autoscend_familiars.txt b/RELEASE/data/autoscend_familiars.txt index c4bb93c6d..1dc4bd09a 100644 --- a/RELEASE/data/autoscend_familiars.txt +++ b/RELEASE/data/autoscend_familiars.txt @@ -17,6 +17,9 @@ boss 2 Mu boss 3 Warbear Drone boss 4 Mosquito +# This is a list of familiars who increase the frequency of combat encounters +# 1.25x fairy. increases combat frequency by floor(weight/6) to a maximum of +5% + # "drop" type is used when we want to grab a familiar that drops items themselves rather than boosting the odds of the enemy dropping items. # # First we grab up to small amount of various specific drops. @@ -27,7 +30,7 @@ drop 0 Fist Turkey prop:_turkeyBooze<5 # drops 1 per combat with chance of 2nd if wearing familiar specific equip drop 1 Puck Man item:Yellow Pixel<20 drop 2 Ms. Puck Man item:Yellow Pixel<20 -# 1st wax drop per run only takes 5 combats, afterwards 30. makes a single size 2 density 4.25 food or drink +# 1st wax drop per run only takes 5 combats, afterwards 30. makes a single size 2 density 4.25 food or drink drop 3 Optimistic Candle prop:optimisticCandleProgress>=25 # 1st robin egg per run only takes 5 combats, afterwards 30. potion that gives all res +3 drop 4 Rockin' Robin prop:rockinRobinProgress>=25 @@ -95,7 +98,7 @@ drop 32 XO Skeleton drop 33 Intergnat # Generates adventures after combat drop 34 Reagnimated Gnome -# Every 30 combats drops wax which makes a single size 2 density 4.25 food or drink +# Every 30 combats drops wax which makes a single size 2 density 4.25 food or drink drop 35 Optimistic Candle # Drops robin's egg every 30 combats. +3 all res potion drop 36 Rockin' Robin @@ -130,8 +133,9 @@ item 0 Steam-Powered Cheerleader path:KOLHS item 1 Steam-Powered Cheerleader prop:_cheerleaderSteam>150 # 1.3x multiplier fairy item 2 Steam-Powered Cheerleader prop:_cheerleaderSteam>100 -# Jumpsuited Hound Dog is a 1.25x multiplier fairy that provides +combat. only use it if we did not provide noncombat this loop. -item 3 Jumpsuited Hound Dog !prop_boolean:_auto_thisLoopPlusNoncombat +# Jumpsuited Hound Dog is a 1.25x multiplier fairy that provides +combat. +# most places do not want +combat so only use it when we explicitly do providePlusCombat +item 3 Jumpsuited Hound Dog prop_boolean:_auto_thisLoopPlusCombat # 1.2x multiplier fairy item 4 Steam-Powered Cheerleader prop:_cheerleaderSteam>50 # 1.1x multiplier fairy @@ -252,6 +256,9 @@ meat 38 Cornbeefadon # The original meat 39 Leprechaun +# This is a list of familiars who decrease the frequency of combat encounters +# reduces combat by -floor(weight/7.5) to a maximum of -10%. + # Typical starfish are better than whelps # Whelps on average restore .375*(weight+5) # Superwhelps up this to 0.75*(weight+5) diff --git a/RELEASE/scripts/autoscend/auto_util.ash b/RELEASE/scripts/autoscend/auto_util.ash index 46411cf1c..5a4cc5948 100644 --- a/RELEASE/scripts/autoscend/auto_util.ash +++ b/RELEASE/scripts/autoscend/auto_util.ash @@ -2712,71 +2712,67 @@ boolean providePlusNonCombat(int amt) boolean providePlusCombat(int amt, boolean doEquips) { - set_property("_auto_thisLoopPlusCombat", true); //track if this was called this loop. can't check adv because of free fights. if(amt == 0) { return true; } + set_property("_auto_thisLoopPlusCombat", true); //track if this was called this loop. my_session_adv() won't work due to free fights + + boolean are_we_done() + { + simMaximize(); + int equipDiff = to_int(simValue("Combat Rate") - numeric_modifier("Combat Rate")); + if(numeric_modifier("Combat Rate").to_int() + equipDiff >= amt) + { + return true; + } + return false; + } + if(have_effect($effect[Become Superficially Interested]) > 0) { - string temp = visit_url("charsheet.php?pwd=&action=newyouinterest"); + visit_url("charsheet.php?pwd=&action=newyouinterest"); + if(are_we_done()) return true; } - + // foreach eff in $effects[Driving Stealthily, The Sonata of Sneakiness, Patent Invisibility, Shelter of Shed] foreach eff in $effects[Driving Stealthily, The Sonata of Sneakiness] { - if(!uneffect(eff)) - { - return false; - } + uneffect(eff); + if(are_we_done()) return true; } - - if(auto_have_familiar($familiar[Jumpsuited Hound Dog]) && my_familiar() == $familiar[Jumpsuited Hound Dog]) + + familiar target_fam = lookupFamiliarDatafile("combat"); + if(target_fam != $familiar[none]) //do we have a valid -combat familiar { - // prevent swapping back and forth between hound dog and not hound dog when just - // on the cusp of the right amount of +combat when we have the hound dog out - handleFamiliar($familiar[Jumpsuited Hound Dog]); + handleFamiliar(target_fam); //avoid flip flop + if(my_familiar() != target_fam) + { + use_familiar(target_fam); + } + if(are_we_done()) return true; } - - if(numeric_modifier("Combat Rate").to_int() >= amt) + + if(doEquips) { - return true; + addToMaximize("200combat " + to_string(amt) + "max"); + if(are_we_done()) return true; } - - shrugAT($effect[Carlweather\'s Cantata Of Confrontation]); + + shrugAT($effect[Carlweather\'s Cantata Of Confrontation]); //remove an AT buff so we have room for Cantata Of Confrontation foreach eff in $effects[Musk of the Moose, Carlweather\'s Cantata of Confrontation, Blinking Belly, Song of Battle, Frown, Angry, Screaming! \ SCREAMING! \ AAAAAAAH!] { buffMaintain(eff, 0, 1, 1); - if(numeric_modifier("Combat Rate").to_int() >= amt) - { - return true; - } + if(are_we_done()) return true; } - foreach eff in $effects[Taunt of Horus, Hippy Stench, High Colognic, Celestial Saltiness, Everything Must Go!, Patent Aggression, Lion in Ambush] + foreach eff in $effects[Taunt of Horus, Hippy Stench, Unmuffled, High Colognic, Celestial Saltiness, Everything Must Go!, Patent Aggression, Lion in Ambush] { buffMaintain(eff, 0, 1, 1); - if(numeric_modifier("Combat Rate").to_int() >= amt) - { - return true; - } - } - - int equipDiff = 0; - - if(doEquips) - { - addToMaximize("200combat " + to_string(amt) + "max"); - simMaximize(); - equipDiff = to_int(simValue("Combat Rate") - numeric_modifier("Combat Rate")); - if(auto_have_familiar($familiar[Jumpsuited Hound Dog])) - { - handleFamiliar($familiar[Jumpsuited Hound Dog]); - } + if(are_we_done()) return true; } - if((numeric_modifier("Combat Rate").to_int() + equipDiff < amt) - && (get_property("_horsery") == "dark horse")) + if(get_property("_horsery") == "dark horse") { getHorse("return"); } @@ -2784,58 +2780,74 @@ boolean providePlusCombat(int amt, boolean doEquips) { horseMaintain(); } + if(are_we_done()) return true; - if(numeric_modifier("Combat Rate").to_int() + equipDiff < amt) - { - asdonBuff($effect[Driving Obnoxiously]); - } - return true; + asdonBuff($effect[Driving Obnoxiously]); + if(are_we_done()) return true; + + return false; } boolean providePlusNonCombat(int amt, boolean doEquips) { - set_property("_auto_thisLoopPlusNoncombat", true); //track if this was called this loop. can't check adv because of free fights. if(amt == 0) { return true; } amt = -1 * amt; + set_property("_auto_thisLoopPlusNoncombat", true); //track if this was called this loop. my_session_adv() won't work due to free fights + + boolean are_we_done() + { + simMaximize(); + int equipDiff = to_int(simValue("Combat Rate") - numeric_modifier("Combat Rate")); + if(numeric_modifier("Combat Rate").to_int() + equipDiff <= amt) + { + return true; + } + return false; + } if(have_effect($effect[Become Intensely Interested]) > 0) { - string temp = visit_url("charsheet.php?pwd=&action=newyouinterest"); + visit_url("charsheet.php?pwd=&action=newyouinterest"); + if(are_we_done()) return true; } foreach eff in $effects[Carlweather\'s Cantata Of Confrontation, Driving Obnoxiously] { - if(!uneffect(eff)) - { - return false; - } - if(numeric_modifier("Combat Rate").to_int() <= amt) + uneffect(eff); + if(are_we_done()) return true; + } + + familiar target_fam = lookupFamiliarDatafile("noncombat"); + if(target_fam != $familiar[none]) //do we have a valid -combat familiar + { + handleFamiliar(target_fam); //avoid flip flop + if(my_familiar() != target_fam) { - return true; + use_familiar(target_fam); } + if(are_we_done()) return true; + } + + if(doEquips) + { + addToMaximize("-200combat " + to_string(-1 * amt) + "max"); + if(are_we_done()) return true; } foreach eff in $effects[Patent Invisibility] { buffMaintain(eff, 0, 1, 1); - if(numeric_modifier("Combat Rate").to_int() <= amt) - { - return true; - } + if(are_we_done()) return true; } - shrugAT($effect[The Sonata of Sneakiness]); - //Assumes that Rev Engine was taken with Extra-Quiet Muffler. + shrugAT($effect[The Sonata of Sneakiness]); //remove an AT buff so we have room for sonata of sneakiness foreach eff in $effects[Shelter Of Shed, Brooding, Muffled, Smooth Movements, The Sonata of Sneakiness, Song of Solitude, Inked Well, Bent Knees, Extended Toes, Ink Cloud, Patent Invisibility, Cloak of Shadows] { buffMaintain(eff, 0, 1, 1); - if(numeric_modifier("Combat Rate").to_int() <= amt) - { - return true; - } + if(are_we_done()) return true; } // We can get these during normal game, may as well use them! @@ -2849,46 +2861,28 @@ boolean providePlusNonCombat(int amt, boolean doEquips) { use(1, $item[deodorant]); } - if (numeric_modifier("Combat Rate").to_int() <= amt) - { - return true; - } - } - - int equipDiff = 0; - - if(doEquips) - { - addToMaximize("-200combat " + to_string(-1 * amt) + "max"); - simMaximize(); - equipDiff = to_int(simValue("Combat Rate") - numeric_modifier("Combat Rate")); - } - - if((numeric_modifier("Combat Rate").to_int() + equipDiff > amt)) - { - getHorse("noncombat"); + if(are_we_done()) return true; } - if((numeric_modifier("Combat Rate").to_int() + equipDiff > amt)) - { - auto_powerfulGloveNoncombat(); - } + getHorse("noncombat"); + if(are_we_done()) return true; + + auto_powerfulGloveNoncombat(); + if(are_we_done()) return true; //blooper ink costs 15 coins without which it will error when trying to buy it, so that is the bare minimum we need to check for //However we don't want to waste our early coins on it as they are precious. So require at least 400 coins before buying it. - if((numeric_modifier("Combat Rate").to_int() + equipDiff > amt) && - my_class() == $class[Plumber] && 0 == have_effect($effect[Blooper Inked]) && item_amount($item[coin]) > 400) + if(in_zelda() && 0 == have_effect($effect[Blooper Inked]) && item_amount($item[coin]) > 400) { retrieve_item(1, $item[blooper ink]); buffMaintain($effect[Blooper Inked], 0, 1, 1); + if(are_we_done()) return true; } - - if(numeric_modifier("Combat Rate").to_int() + equipDiff > amt) - { - asdonBuff($effect[Driving Stealthily]); - } - return true; + asdonBuff($effect[Driving Stealthily]); + if(are_we_done()) return true; + + return false; } float provideInitiative(int amt, boolean doEquips, boolean speculative) @@ -5288,7 +5282,11 @@ boolean buffMaintain(effect buff, int mp_min, int casts, int turns, boolean spec case $effect[Ministrations in the Dark]: useItem = $item[EMD Holo-Record]; break; case $effect[The Moxie Of LOV]: useItem = $item[LOV Elixir #9]; break; case $effect[The Moxious Madrigal]: useSkill = $skill[The Moxious Madrigal]; break; - case $effect[Muffled]: useSkill = $skill[Rev Engine]; break; + case $effect[Muffled]: + if(get_property("peteMotorbikeMuffler") == "Extra-Quiet Muffler") + { + useSkill = $skill[Rev Engine]; + } break; case $effect[Musk of the Moose]: useSkill = $skill[Musk of the Moose]; break; case $effect[Musky]: useItem = $item[Lynyrd Musk]; break; case $effect[Mutated]: useItem = $item[Gremlin Mutagen]; break; @@ -5504,6 +5502,11 @@ boolean buffMaintain(effect buff, int mp_min, int casts, int turns, boolean spec case $effect[Truly Gritty]: useItem = $item[True Grit]; break; case $effect[Twen Tea]: useItem = $item[cuppa Twen tea]; break; case $effect[Twinkly Weapon]: useItem = $item[Twinkly Nuggets]; break; + case $effect[Unmuffled]: + if(get_property("peteMotorbikeMuffler") == "Extra-Loud Muffler") + { + useSkill = $skill[Rev Engine]; + } break; case $effect[Unrunnable Face]: useItem = $item[Runproof Mascara]; break; case $effect[Unusual Perspective]: useItem = $item[Unusual Oil]; break; case $effect[Ur-Kel\'s Aria of Annoyance]: useSkill = $skill[Ur-Kel\'s Aria of Annoyance]; break; diff --git a/RELEASE/scripts/autoscend/quests/level_6.ash b/RELEASE/scripts/autoscend/quests/level_6.ash index 3e086809e..dff02564c 100644 --- a/RELEASE/scripts/autoscend/quests/level_6.ash +++ b/RELEASE/scripts/autoscend/quests/level_6.ash @@ -26,7 +26,6 @@ boolean L6_friarsGetParts() } } - handleFamiliar("item"); if(equipped_item($slot[Shirt]) == $item[Tunac]) { autoEquip($slot[Shirt], $item[none]); diff --git a/RELEASE/scripts/autoscend/quests/level_7.ash b/RELEASE/scripts/autoscend/quests/level_7.ash index ac52fad29..57426ddd6 100644 --- a/RELEASE/scripts/autoscend/quests/level_7.ash +++ b/RELEASE/scripts/autoscend/quests/level_7.ash @@ -65,9 +65,7 @@ boolean L7_crypt() } auto_log_info("The Alcove! (" + initiative_modifier() + ")", "blue"); - autoAdv(1, $location[The Defiled Alcove]); - handleFamiliar("item"); - return true; + return autoAdv(1, $location[The Defiled Alcove]); } // In KoE, skeleton astronauts are random encounters that drop Evil Eyes. @@ -131,10 +129,7 @@ boolean L7_crypt() } auto_log_info("The Niche!", "blue"); - autoAdv(1, $location[The Defiled Niche]); - - handleFamiliar("item"); - return true; + return autoAdv(1, $location[The Defiled Niche]); } if(get_property("cyrptCrannyEvilness").to_int() > 0) From 8ea510e3217e9a962768f41ebfd22560cfa6da7a Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Sat, 13 Jun 2020 22:15:57 -0700 Subject: [PATCH 13/52] fix combat and noncombat dat files so the familiars.txt generates properly --- BUILD/familiars/combat.dat | 2 +- BUILD/familiars/noncombat.dat | 2 +- RELEASE/data/autoscend_familiars.txt | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/BUILD/familiars/combat.dat b/BUILD/familiars/combat.dat index ff3bcb680..9074254cf 100644 --- a/BUILD/familiars/combat.dat +++ b/BUILD/familiars/combat.dat @@ -1,3 +1,3 @@ # This is a list of familiars who increase the frequency of combat encounters # 1.25x fairy. increases combat frequency by floor(weight/6) to a maximum of +5% -Jumpsuited Hound Dog \ No newline at end of file +Jumpsuited Hound Dog diff --git a/BUILD/familiars/noncombat.dat b/BUILD/familiars/noncombat.dat index e1df18851..51f61d49a 100644 --- a/BUILD/familiars/noncombat.dat +++ b/BUILD/familiars/noncombat.dat @@ -1,3 +1,3 @@ # This is a list of familiars who decrease the frequency of combat encounters # reduces combat by -floor(weight/7.5) to a maximum of -10%. -Disgeist \ No newline at end of file +Disgeist diff --git a/RELEASE/data/autoscend_familiars.txt b/RELEASE/data/autoscend_familiars.txt index 1dc4bd09a..ebccc9be7 100644 --- a/RELEASE/data/autoscend_familiars.txt +++ b/RELEASE/data/autoscend_familiars.txt @@ -19,6 +19,7 @@ boss 4 Mosquito # This is a list of familiars who increase the frequency of combat encounters # 1.25x fairy. increases combat frequency by floor(weight/6) to a maximum of +5% +combat 0 Jumpsuited Hound Dog # "drop" type is used when we want to grab a familiar that drops items themselves rather than boosting the odds of the enemy dropping items. # @@ -30,7 +31,7 @@ drop 0 Fist Turkey prop:_turkeyBooze<5 # drops 1 per combat with chance of 2nd if wearing familiar specific equip drop 1 Puck Man item:Yellow Pixel<20 drop 2 Ms. Puck Man item:Yellow Pixel<20 -# 1st wax drop per run only takes 5 combats, afterwards 30. makes a single size 2 density 4.25 food or drink +# 1st wax drop per run only takes 5 combats, afterwards 30. makes a single size 2 density 4.25 food or drink drop 3 Optimistic Candle prop:optimisticCandleProgress>=25 # 1st robin egg per run only takes 5 combats, afterwards 30. potion that gives all res +3 drop 4 Rockin' Robin prop:rockinRobinProgress>=25 @@ -98,7 +99,7 @@ drop 32 XO Skeleton drop 33 Intergnat # Generates adventures after combat drop 34 Reagnimated Gnome -# Every 30 combats drops wax which makes a single size 2 density 4.25 food or drink +# Every 30 combats drops wax which makes a single size 2 density 4.25 food or drink drop 35 Optimistic Candle # Drops robin's egg every 30 combats. +3 all res potion drop 36 Rockin' Robin @@ -258,6 +259,7 @@ meat 39 Leprechaun # This is a list of familiars who decrease the frequency of combat encounters # reduces combat by -floor(weight/7.5) to a maximum of -10%. +noncombat 0 Disgeist # Typical starfish are better than whelps # Whelps on average restore .375*(weight+5) From bcc40b8a72d15508a70337fe0476823e8443a400 Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Sat, 13 Jun 2020 23:53:54 -0600 Subject: [PATCH 14/52] do not spam maximizer simulations when doing providePlusCombat/non instead do it once at the start if we change the maximizer string then do it a second time do not overwrite an already chosen familiar with providepluscombat/noncombat missing some "initSuggest" leftovers fix comment fix familiar being set to none castle in the sky top floor. do not hardcode init familiar, so that we could use a NC familiar (disgeist) if needed. --- RELEASE/scripts/autoscend.ash | 4 +- RELEASE/scripts/autoscend/auto_adventure.ash | 19 +++++-- RELEASE/scripts/autoscend/auto_familiar.ash | 12 ----- RELEASE/scripts/autoscend/auto_util.ash | 50 ++++++++++++------- RELEASE/scripts/autoscend/quests/level_10.ash | 1 - RELEASE/scripts/autoscend/quests/level_11.ash | 6 +-- RELEASE/scripts/autoscend/quests/level_9.ash | 2 +- 7 files changed, 52 insertions(+), 42 deletions(-) diff --git a/RELEASE/scripts/autoscend.ash b/RELEASE/scripts/autoscend.ash index 88238f615..6472e1968 100644 --- a/RELEASE/scripts/autoscend.ash +++ b/RELEASE/scripts/autoscend.ash @@ -149,7 +149,7 @@ void initializeSettings() set_property("auto_doCombatCopy", "no"); set_property("auto_drunken", ""); set_property("auto_eaten", ""); - set_property("auto_familiarChoice", $familiar[none]); + set_property("auto_familiarChoice", ""); set_property("auto_forceTavern", false); set_property("auto_funTracker", ""); set_property("auto_getBoningKnife", false); @@ -2507,7 +2507,7 @@ boolean Lsc_flyerSeals() } } - handleFamiliar("initSuggest"); + handleFamiliar("init"); boolean clubbedSeal = false; if(doElement) { diff --git a/RELEASE/scripts/autoscend/auto_adventure.ash b/RELEASE/scripts/autoscend/auto_adventure.ash index fdfdb0b7c..1f473113b 100644 --- a/RELEASE/scripts/autoscend/auto_adventure.ash +++ b/RELEASE/scripts/autoscend/auto_adventure.ash @@ -308,15 +308,26 @@ void preAdvUpdateFamiliar(location place) { return; //will just error in those paths } + if(is100FamRun()) + { + handleFamiliar(get_property("auto_100familiar").to_familiar()); //do not break 100 familiar runs + } - //familiar required to adventure in that zone, override everything else. + //familiar requirement to adventure in a zone, override everything else. if(place == $location[The Deep Machine Tunnels]) { handleFamiliar($familiar[Machine Elf]); } + // Can't take familiars with you to FantasyRealm + if (place == $location[The Bandit Crossroads]) + { + if(my_familiar() == $familiar[none]) return; //avoid mafia error from trying to change none into none. + use_familiar($familiar[none]); + return; //no familiar means no equipment, we are done. + } //if familiar not set yet, first check stealing familiar - if(get_property("auto_familiarChoice") == "" && canChangeToFamiliar($familiar[cat burglar]) && catBurglarHeistsLeft() > 0) + if(!get_property("_auto_thisLoopHandleFamiliar").to_boolean() && canChangeToFamiliar($familiar[cat burglar]) && catBurglarHeistsLeft() > 0) { //Stealing with familiar. TODO add XO Skelton here too @@ -340,10 +351,8 @@ void preAdvUpdateFamiliar(location place) } //if familiar not set choose a familiar using general logic - if(get_property("auto_familiarChoice") == "" && !get_property("_auto_thisLoopHandleFamiliar").to_boolean()) + if(!get_property("_auto_thisLoopHandleFamiliar").to_boolean()) //check that we didn't already set familiar target this loop { - //if we already called handleFamiliar it means we have a specific familiar we need for the location we are adventuring in - //if we don't then it means we should run the selector before to choose the best general familiar autoChooseFamiliar(place); } diff --git a/RELEASE/scripts/autoscend/auto_familiar.ash b/RELEASE/scripts/autoscend/auto_familiar.ash index 5d9370b85..73b7263bd 100644 --- a/RELEASE/scripts/autoscend/auto_familiar.ash +++ b/RELEASE/scripts/autoscend/auto_familiar.ash @@ -246,18 +246,6 @@ boolean autoChooseFamiliar(location place) { return handleFamiliar(familiar_target_100); //do not break 100 familiar runs } - set_property("auto_familiarChoice", $familiar[none]); //reset familiar choice - - //familiar required to adventure in that zone. - if(place == $location[The Deep Machine Tunnels]) - { - return handleFamiliar($familiar[Machine Elf]); - } - - // Can't take familiars with you to FantasyRealm - if (place == $location[The Bandit Crossroads]) { - return use_familiar($familiar[none]); - } //High priority checks that are too complicated for the datafile familiar famChoice = $familiar[none]; diff --git a/RELEASE/scripts/autoscend/auto_util.ash b/RELEASE/scripts/autoscend/auto_util.ash index 5a4cc5948..b0c4adf3f 100644 --- a/RELEASE/scripts/autoscend/auto_util.ash +++ b/RELEASE/scripts/autoscend/auto_util.ash @@ -2716,12 +2716,13 @@ boolean providePlusCombat(int amt, boolean doEquips) { return true; } - set_property("_auto_thisLoopPlusCombat", true); //track if this was called this loop. my_session_adv() won't work due to free fights + set_property("_auto_thisLoopPlusCombat", true); //track if this was called this loop. my_turncount() won't work due to free fights + //we do not need to repeatedly simulate equipment. do it once now and a second time if we change the maximizer string. + simMaximize(); + int equipDiff = to_int(simValue("Combat Rate") - numeric_modifier("Combat Rate")); boolean are_we_done() { - simMaximize(); - int equipDiff = to_int(simValue("Combat Rate") - numeric_modifier("Combat Rate")); if(numeric_modifier("Combat Rate").to_int() + equipDiff >= amt) { return true; @@ -2742,20 +2743,26 @@ boolean providePlusCombat(int amt, boolean doEquips) if(are_we_done()) return true; } - familiar target_fam = lookupFamiliarDatafile("combat"); - if(target_fam != $familiar[none]) //do we have a valid -combat familiar + if(!get_property("_auto_thisLoopHandleFamiliar").to_boolean()) //do not overwrite an already chosen familiar. { - handleFamiliar(target_fam); //avoid flip flop - if(my_familiar() != target_fam) + familiar target_fam = lookupFamiliarDatafile("combat"); + if(target_fam != $familiar[none]) //do we have a valid -combat familiar { - use_familiar(target_fam); + handleFamiliar(target_fam); //avoid flip flop + if(my_familiar() != target_fam) + { + use_familiar(target_fam); + } + if(are_we_done()) return true; } - if(are_we_done()) return true; } if(doEquips) { addToMaximize("200combat " + to_string(amt) + "max"); + //update our equipDiff value since we changed maximizer string + simMaximize(); + equipDiff = to_int(simValue("Combat Rate") - numeric_modifier("Combat Rate")); if(are_we_done()) return true; } @@ -2795,12 +2802,13 @@ boolean providePlusNonCombat(int amt, boolean doEquips) return true; } amt = -1 * amt; - set_property("_auto_thisLoopPlusNoncombat", true); //track if this was called this loop. my_session_adv() won't work due to free fights + set_property("_auto_thisLoopPlusNoncombat", true); //track if this was called this loop. my_turncount() won't work due to free fights + //we do not need to repeatedly simulate equipment. do it once now and a second time if we change the maximizer string. + simMaximize(); + int equipDiff = to_int(simValue("Combat Rate") - numeric_modifier("Combat Rate")); boolean are_we_done() { - simMaximize(); - int equipDiff = to_int(simValue("Combat Rate") - numeric_modifier("Combat Rate")); if(numeric_modifier("Combat Rate").to_int() + equipDiff <= amt) { return true; @@ -2820,20 +2828,26 @@ boolean providePlusNonCombat(int amt, boolean doEquips) if(are_we_done()) return true; } - familiar target_fam = lookupFamiliarDatafile("noncombat"); - if(target_fam != $familiar[none]) //do we have a valid -combat familiar + if(!get_property("_auto_thisLoopHandleFamiliar").to_boolean()) //do not overwrite an already chosen familiar. { - handleFamiliar(target_fam); //avoid flip flop - if(my_familiar() != target_fam) + familiar target_fam = lookupFamiliarDatafile("noncombat"); + if(target_fam != $familiar[none]) //do we have a valid -combat familiar { - use_familiar(target_fam); + handleFamiliar(target_fam); //avoid flip flop + if(my_familiar() != target_fam) + { + use_familiar(target_fam); + } + if(are_we_done()) return true; } - if(are_we_done()) return true; } if(doEquips) { addToMaximize("-200combat " + to_string(-1 * amt) + "max"); + //update our equipDiff value since we changed maximizer string + simMaximize(); + equipDiff = to_int(simValue("Combat Rate") - numeric_modifier("Combat Rate")); if(are_we_done()) return true; } diff --git a/RELEASE/scripts/autoscend/quests/level_10.ash b/RELEASE/scripts/autoscend/quests/level_10.ash index f247a3be5..9911d946b 100644 --- a/RELEASE/scripts/autoscend/quests/level_10.ash +++ b/RELEASE/scripts/autoscend/quests/level_10.ash @@ -325,7 +325,6 @@ boolean L10_topFloor() set_property("choiceAdventure679", 1); } - handleFamiliar("initSuggest"); if(!auto_forceNextNoncombat()) { providePlusNonCombat(25); diff --git a/RELEASE/scripts/autoscend/quests/level_11.ash b/RELEASE/scripts/autoscend/quests/level_11.ash index 9b1a4b91c..20d11c680 100644 --- a/RELEASE/scripts/autoscend/quests/level_11.ash +++ b/RELEASE/scripts/autoscend/quests/level_11.ash @@ -721,7 +721,7 @@ boolean L11_aridDesert() { autoEquip(desertBuff); } - handleFamiliar("initSuggest"); + handleFamiliar("init"); set_property("choiceAdventure805", 1); int need = 100 - get_property("desertExploration").to_int(); auto_log_info("Need for desert: " + need, "blue"); @@ -1366,7 +1366,7 @@ boolean L11_hiddenCity() if (item_amount($item[stone triangle]) == 4) { auto_log_info("Fighting the out-of-work spirit", "blue"); acquireHP(); - handleFamiliar("initSuggest"); + handleFamiliar("init"); return autoAdv($location[A Massive Ziggurat]); } @@ -1496,7 +1496,7 @@ boolean L11_mauriceSpookyraven() providePlusNonCombat(25, true); } - handleFamiliar("initSuggest"); + handleFamiliar("init"); return autoAdv($location[The Haunted Ballroom]); } diff --git a/RELEASE/scripts/autoscend/quests/level_9.ash b/RELEASE/scripts/autoscend/quests/level_9.ash index 00c486c76..f6907671d 100644 --- a/RELEASE/scripts/autoscend/quests/level_9.ash +++ b/RELEASE/scripts/autoscend/quests/level_9.ash @@ -781,7 +781,7 @@ boolean L9_oilPeak() } buffMaintain($effect[Fishy Whiskers], 0, 1, 1); - handleFamiliar("initSuggest"); + handleFamiliar("init"); auto_MaxMLToCap(auto_convertDesiredML(100), true); From 67082127016c7e0519c475834f66487569673f4a Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Tue, 16 Jun 2020 14:59:09 -0700 Subject: [PATCH 15/52] add choosing of familiars by zone and add using stat familiars (#437) - Use +item familiars in zones when they're needed rather than just blindly using +item familiars. - Add +stats familiars to the fallback choices when nothing else applies because levelling is somewhat useful in-run I've heard. - add +meat familiars to the fallback choices for zones where the monsters have high meat drop. - remove almost all other calls to handleFamiliar(). Some are left as they're specific familiar overrides or specific to the task - remove the use of Stooper and Jumpsuited Hound Dog for +/-combat. They unnecessarily soak up familiar experience and farming drops/stats will be more beneficial across the whole run when +item/+meat/+init is not required. - only farm the Cubeling drops if it's not going to be used as your +item familiar anyway (as in, you have something better when we check the item data file) - Fixed provideResistances to use resistance familiars. - fix missing new lines in more dat files so they generate correctly. - tweak providePlusNonCombat and providePlusCombat to return true if we get to the end of the function and Combat Rate is on the side of zero we want it to be. --- BUILD/familiars/combat.dat | 3 - BUILD/familiars/drop.dat | 4 +- BUILD/familiars/item.dat | 5 +- BUILD/familiars/noncombat.dat | 3 - BUILD/familiars/regen.dat | 2 +- RELEASE/data/autoscend_familiars.txt | 102 +++++++------- RELEASE/scripts/autoscend.ash | 8 -- RELEASE/scripts/autoscend/auto_familiar.ash | 124 +++++++++++++++--- RELEASE/scripts/autoscend/auto_util.ash | 51 +++---- RELEASE/scripts/autoscend/quests/level_10.ash | 30 ----- RELEASE/scripts/autoscend/quests/level_11.ash | 12 -- RELEASE/scripts/autoscend/quests/level_12.ash | 23 ---- RELEASE/scripts/autoscend/quests/level_13.ash | 14 -- RELEASE/scripts/autoscend/quests/level_7.ash | 2 - RELEASE/scripts/autoscend/quests/level_8.ash | 3 - RELEASE/scripts/autoscend/quests/level_9.ash | 4 - RELEASE/scripts/autoscend/quests/optional.ash | 9 -- 17 files changed, 176 insertions(+), 223 deletions(-) delete mode 100644 BUILD/familiars/combat.dat delete mode 100644 BUILD/familiars/noncombat.dat diff --git a/BUILD/familiars/combat.dat b/BUILD/familiars/combat.dat deleted file mode 100644 index 9074254cf..000000000 --- a/BUILD/familiars/combat.dat +++ /dev/null @@ -1,3 +0,0 @@ -# This is a list of familiars who increase the frequency of combat encounters -# 1.25x fairy. increases combat frequency by floor(weight/6) to a maximum of +5% -Jumpsuited Hound Dog diff --git a/BUILD/familiars/drop.dat b/BUILD/familiars/drop.dat index c70b4ecb0..f9ac468f6 100644 --- a/BUILD/familiars/drop.dat +++ b/BUILD/familiars/drop.dat @@ -42,7 +42,7 @@ Intergnat item:BACON<150 # # density 1.875 size 4 spleen consumables. boolean autoChooseFamiliar(location place) will already grab the amount needed for spleen # Here they are only used to grab extras. -Grim Brother prop:_grimFairyTaleDrops<5;!prop_boolean:_auto_thisLoopPlusNoncombat +Grim Brother prop:_grimFairyTaleDrops<5 Pair of Stomping Boots prop:_bootStomps<7 Baby Sandworm prop:_aguaDrops<5 Bloovian Groose prop:_grooseDrops<5 @@ -87,4 +87,4 @@ Galloping Grill # Can use to track phyllum, every 11 encounters from tracked phyllum results in a drop. Needs more code before it goes higher on the list Red-Nosed Snapper # 2% and 4% chance respectively to drop time's arrow and arrowgram. -Obtuse Angel \ No newline at end of file +Obtuse Angel diff --git a/BUILD/familiars/item.dat b/BUILD/familiars/item.dat index f77a4a948..0310a635e 100644 --- a/BUILD/familiars/item.dat +++ b/BUILD/familiars/item.dat @@ -9,8 +9,7 @@ Steam-Powered Cheerleader prop:_cheerleaderSteam>150 # 1.3x multiplier fairy Steam-Powered Cheerleader prop:_cheerleaderSteam>100 # Jumpsuited Hound Dog is a 1.25x multiplier fairy that provides +combat. -# most places do not want +combat so only use it when we explicitly do providePlusCombat -Jumpsuited Hound Dog prop_boolean:_auto_thisLoopPlusCombat +# Jumpsuited Hound Dog DELIBERATELY not included because it provides usually unwanted +combat # 1.2x multiplier fairy Steam-Powered Cheerleader prop:_cheerleaderSteam>50 # 1.1x multiplier fairy @@ -71,4 +70,4 @@ Syncopated Turtle Baby Gravy Fairy # Mutant Fire Ant multiplier is 1.3-(0.15*grimace darkness). Too marginal because of opportunity cost compared to leveling another familiar. # If we level it today when it gives a good bonus, tomorrow it might drop to bad bonus and we have to start leveling another fairy. -Mutant Fire Ant \ No newline at end of file +Mutant Fire Ant diff --git a/BUILD/familiars/noncombat.dat b/BUILD/familiars/noncombat.dat deleted file mode 100644 index 51f61d49a..000000000 --- a/BUILD/familiars/noncombat.dat +++ /dev/null @@ -1,3 +0,0 @@ -# This is a list of familiars who decrease the frequency of combat encounters -# reduces combat by -floor(weight/7.5) to a maximum of -10%. -Disgeist diff --git a/BUILD/familiars/regen.dat b/BUILD/familiars/regen.dat index 95eadea6b..86dbe3798 100644 --- a/BUILD/familiars/regen.dat +++ b/BUILD/familiars/regen.dat @@ -52,4 +52,4 @@ Pet Cheezling class:Sauceror Pottery Barn Owl # Regular old whelps Pet Cheezling -Ghuol Whelp \ No newline at end of file +Ghuol Whelp diff --git a/RELEASE/data/autoscend_familiars.txt b/RELEASE/data/autoscend_familiars.txt index ebccc9be7..2056d3ee0 100644 --- a/RELEASE/data/autoscend_familiars.txt +++ b/RELEASE/data/autoscend_familiars.txt @@ -17,10 +17,6 @@ boss 2 Mu boss 3 Warbear Drone boss 4 Mosquito -# This is a list of familiars who increase the frequency of combat encounters -# 1.25x fairy. increases combat frequency by floor(weight/6) to a maximum of +5% -combat 0 Jumpsuited Hound Dog - # "drop" type is used when we want to grab a familiar that drops items themselves rather than boosting the odds of the enemy dropping items. # # First we grab up to small amount of various specific drops. @@ -65,7 +61,7 @@ drop 16 Intergnat item:BACON<150 # # density 1.875 size 4 spleen consumables. boolean autoChooseFamiliar(location place) will already grab the amount needed for spleen # Here they are only used to grab extras. -drop 17 Grim Brother prop:_grimFairyTaleDrops<5;!prop_boolean:_auto_thisLoopPlusNoncombat +drop 17 Grim Brother prop:_grimFairyTaleDrops<5 drop 18 Pair of Stomping Boots prop:_bootStomps<7 drop 19 Baby Sandworm prop:_aguaDrops<5 drop 20 Bloovian Groose prop:_grooseDrops<5 @@ -110,6 +106,7 @@ drop 38 Galloping Grill # Can use to track phyllum, every 11 encounters from tracked phyllum results in a drop. Needs more code before it goes higher on the list drop 39 Red-Nosed Snapper # 2% and 4% chance respectively to drop time's arrow and arrowgram. +drop 40 Obtuse Angel # We want to delevel, but don't want to deal damage gremlins 0 Nosy Nose @@ -135,68 +132,68 @@ item 1 Steam-Powered Cheerleader prop:_cheerleaderSteam>150 # 1.3x multiplier fairy item 2 Steam-Powered Cheerleader prop:_cheerleaderSteam>100 # Jumpsuited Hound Dog is a 1.25x multiplier fairy that provides +combat. -# most places do not want +combat so only use it when we explicitly do providePlusCombat -item 3 Jumpsuited Hound Dog prop_boolean:_auto_thisLoopPlusCombat +# Jumpsuited Hound Dog DELIBERATELY not included because it provides usually unwanted +combat # 1.2x multiplier fairy -item 4 Steam-Powered Cheerleader prop:_cheerleaderSteam>50 +item 3 Steam-Powered Cheerleader prop:_cheerleaderSteam>50 # 1.1x multiplier fairy -item 5 Steam-Powered Cheerleader prop:_cheerleaderSteam>0 +item 4 Steam-Powered Cheerleader prop:_cheerleaderSteam>0 # fairy that generates extra adventures -item 6 Reagnimated Gnome +item 5 Reagnimated Gnome # Fairywhelp that drops x and o without limit. 1 each per 9 combats. 3 o for food. 3 x for drink, 23 x to skip half bridge. -item 7 XO Skeleton +item 6 XO Skeleton # Fairy that drops bacon with no limit. 1 per combat -item 8 Intergnat +item 7 Intergnat # Fairyballs -item 9 Elf Operative -item 10 Optimistic Candle -item 11 Rockin' Robin +item 8 Elf Operative +item 9 Optimistic Candle +item 10 Rockin' Robin # Fairywhelps -item 12 Pocket Professor -item 13 Garbage Fire -item 14 Dandy Lion +item 11 Pocket Professor +item 12 Garbage Fire +item 13 Dandy Lion # Fairychauns -item 15 Fist Turkey -item 16 Cat Burglar -item 17 Angry Jung Man -item 18 Grimstone Golem -item 19 Adventurous Spelunker -item 20 Blavious Kloop -item 21 Hippo Ballerina -item 22 Dancing Frog -item 23 Coffee Pixie -item 24 Attention-Deficit Demon -item 25 Jitterbug -item 26 Casagnova Gnome -item 27 Psychedelic Bear -item 28 Piano Cat +item 14 Fist Turkey +item 15 Cat Burglar +item 16 Angry Jung Man +item 17 Grimstone Golem +item 18 Adventurous Spelunker +item 19 Blavious Kloop +item 20 Hippo Ballerina +item 21 Dancing Frog +item 22 Coffee Pixie +item 23 Attention-Deficit Demon +item 24 Jitterbug +item 25 Casagnova Gnome +item 26 Psychedelic Bear +item 27 Piano Cat # Slightly special fairies -item 29 Red-Nosed Snapper -item 30 Pair of Stomping Boots -item 31 Gelatinous Cubeling -item 32 Steam-Powered Cheerleader -item 33 Obtuse Angel -item 34 Green Pixie +item 28 Red-Nosed Snapper +item 29 Pair of Stomping Boots +item 30 Gelatinous Cubeling +item 31 Steam-Powered Cheerleader +item 32 Obtuse Angel +item 33 Green Pixie # Elemental fairies -item 35 Sleazy Gravy Fairy -item 36 Stinky Gravy Fairy -item 37 Flaming Gravy Fairy -item 38 Frozen Gravy Fairy -item 39 Spooky Gravy Fairy +item 34 Sleazy Gravy Fairy +item 35 Stinky Gravy Fairy +item 36 Flaming Gravy Fairy +item 37 Frozen Gravy Fairy +item 38 Spooky Gravy Fairy # Physical damage fairy -item 40 Bowlet +item 39 Bowlet # Barely special fairies -item 41 Mechanical Songbird -item 42 Grouper Groupie -item 43 Peppermint Rhino +item 40 Mechanical Songbird +item 41 Grouper Groupie +item 42 Peppermint Rhino # Fairy that if fed equipment will regen MP and give extra drops. Since we do not make use of this functionality it is just a fairy. -item 44 Slimeling +item 43 Slimeling # Turtles are cute -item 45 Syncopated Turtle +item 44 Syncopated Turtle # The original -item 46 Baby Gravy Fairy +item 45 Baby Gravy Fairy # Mutant Fire Ant multiplier is 1.3-(0.15*grimace darkness). Too marginal because of opportunity cost compared to leveling another familiar. # If we level it today when it gives a good bonus, tomorrow it might drop to bad bonus and we have to start leveling another fairy. +item 46 Mutant Fire Ant # Wanna get that jar meat 0 Angry Jung Man prop:_jungDrops<1;day:1 @@ -257,10 +254,6 @@ meat 38 Cornbeefadon # The original meat 39 Leprechaun -# This is a list of familiars who decrease the frequency of combat encounters -# reduces combat by -floor(weight/7.5) to a maximum of -10%. -noncombat 0 Disgeist - # Typical starfish are better than whelps # Whelps on average restore .375*(weight+5) # Superwhelps up this to 0.75*(weight+5) @@ -315,6 +308,7 @@ regen 26 Pet Cheezling class:Sauceror regen 27 Pottery Barn Owl # Regular old whelps regen 28 Pet Cheezling +regen 29 Ghuol Whelp # Sombrero is desirable with a decent amount of ML stat 0 Galloping Grill ML:>=120 diff --git a/RELEASE/scripts/autoscend.ash b/RELEASE/scripts/autoscend.ash index 6472e1968..11c76805f 100644 --- a/RELEASE/scripts/autoscend.ash +++ b/RELEASE/scripts/autoscend.ash @@ -1188,7 +1188,6 @@ void initializeDay(int day) makeStartingSmiths(); - handleFamiliar("item"); equipBaseline(); handleBjornify($familiar[none]); @@ -2406,7 +2405,6 @@ boolean LX_freeCombats(boolean powerlevel) { handleBjornify($familiar[Grinning Turtle]); } - handleFamiliar($familiar[Machine Elf]); adv_done = autoAdv(1, $location[The Deep Machine Tunnels]); if(bjorn == $familiar[Machine Elf]) { @@ -2507,7 +2505,6 @@ boolean Lsc_flyerSeals() } } - handleFamiliar("init"); boolean clubbedSeal = false; if(doElement) { @@ -2544,7 +2541,6 @@ boolean Lsc_flyerSeals() use(1, $item[ingot of seal-iron]); } } - handleFamiliar("item"); return clubbedSeal; } return false; @@ -3292,10 +3288,6 @@ boolean doTasks() { set_property("auto_cubeItems", false); } - if(get_property("auto_cubeItems").to_boolean() && (my_familiar() != $familiar[Gelatinous Cubeling]) && auto_have_familiar($familiar[Gelatinous Cubeling])) - { - handleFamiliar($familiar[Gelatinous Cubeling]); - } } if((my_daycount() == 1) && ($familiar[Fist Turkey].drops_today < 5) && auto_have_familiar($familiar[Fist Turkey])) diff --git a/RELEASE/scripts/autoscend/auto_familiar.ash b/RELEASE/scripts/autoscend/auto_familiar.ash index 73b7263bd..6bf970957 100644 --- a/RELEASE/scripts/autoscend/auto_familiar.ash +++ b/RELEASE/scripts/autoscend/auto_familiar.ash @@ -249,12 +249,106 @@ boolean autoChooseFamiliar(location place) //High priority checks that are too complicated for the datafile familiar famChoice = $familiar[none]; + + // Blackbird/Crow cut turns in the Black Forest but we only need to equip them + // if we don't have them in inventory. + if ($location[The Black Forest] == place) { + if (auto_my_path() != "Bees Hate You") { + if (item_amount($item[Reassembled Blackbird]) == 0 && canChangeToFamiliar($familiar[Reassembled Blackbird])) { + famChoice = $familiar[Reassembled Blackbird]; + } + } else { + if (item_amount($item[Reconstituted Crow]) == 0 && canChangeToFamiliar($familiar[Reconstituted Crow])) { + famChoice = $familiar[Reconstituted Crow]; + } + } + } + + // Gremlins have special familiar handling. + if ($locations[Next to that Barrel with Something Burning in it, Out By that Rusted-Out Car, Over Where the Old Tires Are, Near an Abandoned Refrigerator] contains place) { + famChoice = lookupFamiliarDatafile("gremlins"); + } + + // places where item drop is required to help save adventures. + if ($locations[The Typical Tavern Cellar, The Beanbat Chamber, Cobb's Knob Harem, The Defiled Nook, The Goatlet, Itznotyerzitz Mine, + Twin Peak, The Penultimate Fantasy Airship, The Hidden Temple, The Hidden Hospital, The Hidden Bowling Alley, The Haunted Wine Cellar, + The Haunted Laundry Room, The Copperhead Club, A Mob of Zeppelin Protesters, The Red Zeppelin, Whitey's Grove, The Oasis, The Middle Chamber, + Frat House, Hippy Camp, The Battlefield (Frat Uniform), The Battlefield (Hippy Uniform), The Hatching Chamber, + The Feeding Chamber, The Royal Guard Chamber, The Hole in the Sky, 8-Bit Realm, The Degrassi Knoll Garage, The Old Landfill, + The Laugh Floor, Infernal Rackets Backstage] contains place) { + famChoice = lookupFamiliarDatafile("item"); + } + + // only need +item in the pirates cove if we're faming the outfit (may be farming insults here or getting the key in LKS otherwise) + if ($location[The Obligatory Pirate's Cove] == place && !possessOutfit("Swashbuckling Getup")) { + famChoice = lookupFamiliarDatafile("item"); + } + + // Only need +item in the F'c'le if we're getting the fledges (could still be getting the key in LKS) + if ($location[The F'c'le] == place && internalQuestStatus("questM12Pirate") < 6) { + famChoice = lookupFamiliarDatafile("item"); + } + + // The World's Biggest Jerk can send us here so only use +item if we're farming sonars. + if ($location[The Batrat and Ratbat Burrow] == place && internalQuestStatus("questL04Bat") < 3) { + famChoice = lookupFamiliarDatafile("item"); + } + + // only need +item on the extreme slope if we're faming the outfit. + if ($location[The eXtreme Slope] == place && !possessOutfit("eXtreme Cold-Weather Gear")) { + famChoice = lookupFamiliarDatafile("item"); + } + + // only use +item in A-Boo Peak when adventuring (so we don't accidentally override resistance familiars when doing The Horror). + if ($location[A-Boo Peak] == place && get_property("auto_aboopending").to_int() == 0) { + famChoice = lookupFamiliarDatafile("item"); + } + + // only need +item at Oil Peak if we need Bubblin' Crude (TODO: it might be useful in HC for food?). + if ($location[Oil Peak] == place && + ((get_property("twinPeakProgress").to_int() & 4) == 0 && + item_amount($item[Jar Of Oil]) < 1 && item_amount($item[Bubblin\' Crude]) < 12)) { + famChoice = lookupFamiliarDatafile("item"); + } + + // The World's Biggest Jerk can also send us here so only use +item if we're farming bridge parts. + if ($location[The Smut Orc Logging Camp] == place && internalQuestStatus("questL09Topping") < 1) { + famChoice = lookupFamiliarDatafile("item"); + } + + // Killing jar saves adventures unlocking the Pyramid. + if ($location[The Haunted Library] == place && item_amount($item[killing jar]) < 1) { + famChoice = lookupFamiliarDatafile("item"); + } + + // +item helps if we still need the book of matches + if ($location[The Hidden Park] == place && get_property("hiddenTavernUnlock").to_int() != my_ascensions()) { + famChoice = lookupFamiliarDatafile("item"); + } + + // only need +item in the war camps if we are farming the outfit. + if ($locations[Wartime Frat House, Wartime Hippy Camp] contains place) { + if (!possessOutfit("Frat Warrior Fatigues") || !possessOutfit("War Hippy Fatigues")) { + famChoice = lookupFamiliarDatafile("item"); + } + } + + // places where meat drop is required to help save adventures. + if ($location[The Themthar Hills] == place) { + famChoice = lookupFamiliarDatafile("meat"); + } + // places where initiative is required to help save adventures. + if ($location[The Defiled Alcove] == place) { + famChoice = lookupFamiliarDatafile("init"); + } + //Gelatinous Cubeling drops items that save turns in the daily dungeon if(famChoice == $familiar[none] && canChangeToFamiliar($familiar[Gelatinous Cubeling]) && get_property("auto_useCubeling").to_boolean() && - get_property("auto_cubeItems").to_boolean()) + get_property("auto_cubeItems").to_boolean() + && lookupFamiliarDatafile("item") != $familiar[Gelatinous Cubeling]) // don't farm the drops if this is the best +item familiar we have. We will get them regardless. { famChoice = $familiar[Gelatinous Cubeling]; } @@ -296,10 +390,7 @@ boolean autoChooseFamiliar(location place) if(spleenFamiliarsAvailable > 0) foreach fam in $familiars[Baby Sandworm, Rogue Program, Pair of Stomping Boots, Bloovian Groose, Unconscious Collective, Grim Brother, Golden Monkey] { - if(get_property("_auto_thisLoopPlusNoncombat").to_boolean() && fam == $familiar[Grim Brother]) - { - continue; //skip +combat familiars if we want -combat - } + if((fam.drops_today < bound) && canChangeToFamiliar(fam)) { famChoice = fam; @@ -330,6 +421,11 @@ boolean autoChooseFamiliar(location place) famChoice = $familiar[Angry Jung Man]; } + // places where meat drop is desirable due to high meat drop monsters. + if ($locations[The Boss Bat's Lair, Mist-Shrouded Peak, The Icy Peak, The Filthworm Queen's Chamber] contains place) { + famChoice = lookupFamiliarDatafile("meat"); + } + //if critically low on MP and meat. use restore familiar to avoid going bankrupt boolean poor = my_meat() < 1000; if(internalQuestStatus("questL11MacGuffin") < 2) @@ -347,20 +443,14 @@ boolean autoChooseFamiliar(location place) famChoice = lookupFamiliarDatafile("drop"); } - //select the best familiar that improves the odds of the enemy dropping an item - if(famChoice == $familiar[none]) - { - famChoice = lookupFamiliarDatafile("item"); + // Stats from combats makes runs go faster apparently. + if (famChoice == $familiar[none] && (my_level() < 13 || get_property("auto_disregardInstantKarma").to_boolean())) { + famChoice = lookupFamiliarDatafile("stat"); } - //fallback choices - if(famChoice == $familiar[none]) - { - famChoice = lookupFamiliarDatafile("meat"); - } - if(famChoice == $familiar[none] && canChangeToFamiliar($familiar[Mosquito])) - { - famChoice = $familiar[Mosquito]; + // fallback to regen if nothing else. At worst the player will have something like a Ghuol Whelp or Starfish. + if (famChoice == $familiar[none]) { + famChoice = lookupFamiliarDatafile("regen"); } return handleFamiliar(famChoice); diff --git a/RELEASE/scripts/autoscend/auto_util.ash b/RELEASE/scripts/autoscend/auto_util.ash index b0c4adf3f..0de4205b1 100644 --- a/RELEASE/scripts/autoscend/auto_util.ash +++ b/RELEASE/scripts/autoscend/auto_util.ash @@ -2716,7 +2716,6 @@ boolean providePlusCombat(int amt, boolean doEquips) { return true; } - set_property("_auto_thisLoopPlusCombat", true); //track if this was called this loop. my_turncount() won't work due to free fights //we do not need to repeatedly simulate equipment. do it once now and a second time if we change the maximizer string. simMaximize(); @@ -2743,20 +2742,6 @@ boolean providePlusCombat(int amt, boolean doEquips) if(are_we_done()) return true; } - if(!get_property("_auto_thisLoopHandleFamiliar").to_boolean()) //do not overwrite an already chosen familiar. - { - familiar target_fam = lookupFamiliarDatafile("combat"); - if(target_fam != $familiar[none]) //do we have a valid -combat familiar - { - handleFamiliar(target_fam); //avoid flip flop - if(my_familiar() != target_fam) - { - use_familiar(target_fam); - } - if(are_we_done()) return true; - } - } - if(doEquips) { addToMaximize("200combat " + to_string(amt) + "max"); @@ -2792,6 +2777,10 @@ boolean providePlusCombat(int amt, boolean doEquips) asdonBuff($effect[Driving Obnoxiously]); if(are_we_done()) return true; + // only return false if we don't have a positive combat rate. + if (numeric_modifier("Combat Rate").to_int() + equipDiff > 0) { + return true; + } return false; } @@ -2802,7 +2791,6 @@ boolean providePlusNonCombat(int amt, boolean doEquips) return true; } amt = -1 * amt; - set_property("_auto_thisLoopPlusNoncombat", true); //track if this was called this loop. my_turncount() won't work due to free fights //we do not need to repeatedly simulate equipment. do it once now and a second time if we change the maximizer string. simMaximize(); @@ -2828,20 +2816,6 @@ boolean providePlusNonCombat(int amt, boolean doEquips) if(are_we_done()) return true; } - if(!get_property("_auto_thisLoopHandleFamiliar").to_boolean()) //do not overwrite an already chosen familiar. - { - familiar target_fam = lookupFamiliarDatafile("noncombat"); - if(target_fam != $familiar[none]) //do we have a valid -combat familiar - { - handleFamiliar(target_fam); //avoid flip flop - if(my_familiar() != target_fam) - { - use_familiar(target_fam); - } - if(are_we_done()) return true; - } - } - if(doEquips) { addToMaximize("-200combat " + to_string(-1 * amt) + "max"); @@ -2896,6 +2870,10 @@ boolean providePlusNonCombat(int amt, boolean doEquips) asdonBuff($effect[Driving Stealthily]); if(are_we_done()) return true; + // only return false if we don't have a negative combat rate. + if (numeric_modifier("Combat Rate").to_int() + equipDiff < 0) { + return true; + } return false; } @@ -3148,6 +3126,12 @@ int [element] provideResistances(int [element] amt, boolean doEquips, boolean sp if(!pass(ele)) return false; } + if (canChangeFamiliar() && $familiars[Trick-or-Treating Tot, Mu, Exotic Parrot] contains my_familiar()) { + // if we pass while having a resist familiar equipped, make sure we keep it equipped + // otherwise we may end up flip-flopping from the resist familiar and something else + // which could cost us adventures if switching familiars affects our resistances enough + handleFamiliar(my_familiar()); + } return true; } @@ -3241,7 +3225,6 @@ int [element] provideResistances(int [element] amt, boolean doEquips, boolean sp if(resfam != $familiar[none]) { // need to use now so maximizer will see it - familiar currentFamiliar = my_familiar(); use_familiar(resfam); if(resfam == $familiar[Trick-or-Treating Tot]) { @@ -3253,10 +3236,10 @@ int [element] provideResistances(int [element] amt, boolean doEquips, boolean sp { delta[ele] = simValue(ele + " Resistance") - numeric_modifier(ele + " Resistance"); } - use_familiar(currentFamiliar); } - if(pass()) + if(pass()) { return result(); + } } if(doEquips) @@ -7095,8 +7078,6 @@ void resetThisLoop() //We use boolean instead of adventure count because of free combats. set_property("auto_doCombatCopy", "no"); - set_property("_auto_thisLoopPlusCombat", false); //have we called providePlusCombat this loop - set_property("_auto_thisLoopPlusNoncombat", false); //have we called providePlusNonCombat this loop set_property("_auto_thisLoopHandleFamiliar", false); //have we called handleFamiliar this loop set_property("auto_disableFamiliarChanging", false); //disable autoscend making changes to familiar set_property("auto_familiarChoice", ""); //which familiar do we want to switch to during pre_adventure diff --git a/RELEASE/scripts/autoscend/quests/level_10.ash b/RELEASE/scripts/autoscend/quests/level_10.ash index 9911d946b..dad14a3b5 100644 --- a/RELEASE/scripts/autoscend/quests/level_10.ash +++ b/RELEASE/scripts/autoscend/quests/level_10.ash @@ -81,7 +81,6 @@ boolean L10_airship() } autoAdv($location[The Penultimate Fantasy Airship]); - handleFamiliar("item"); return true; } @@ -130,14 +129,6 @@ boolean L10_basement() set_property("choiceAdventure669", "1"); // The Fast and the Furry-ous: Open Ground floor (with Umbrella) or Neckbeard Choice } - if(auto_have_familiar($familiar[Ms. Puck Man])) - { - handleFamiliar($familiar[Ms. Puck Man]); - } - else if(auto_have_familiar($familiar[Puck Man])) - { - handleFamiliar($familiar[Puck Man]); - } if(!auto_forceNextNoncombat()) { providePlusNonCombat(25); @@ -153,7 +144,6 @@ boolean L10_basement() autoAdv(1, $location[The Castle in the Clouds in the Sky (Basement)]); resetMaximize(); - handleFamiliar("item"); if(contains_text(get_property("lastEncounter"), "The Fast and the Furry-ous")) { @@ -235,15 +225,6 @@ boolean L10_ground() set_property("choiceAdventure1026", 2); // Home on the Free Range: Get Electric Boning Knife then Skip } - if(auto_have_familiar($familiar[Ms. Puck Man])) - { - handleFamiliar($familiar[Ms. Puck Man]); - } - else if(auto_have_familiar($familiar[Puck Man])) - { - handleFamiliar($familiar[Puck Man]); - } - auto_sourceTerminalEducate($skill[Extract], $skill[Portscan]); providePlusNonCombat(25); @@ -256,7 +237,6 @@ boolean L10_ground() } autoAdv(1, $location[The Castle in the Clouds in the Sky (Ground Floor)]); - handleFamiliar("item"); return true; } @@ -331,7 +311,6 @@ boolean L10_topFloor() } autoEquip($item[mohawk wig]); autoAdv(1, $location[The Castle in the Clouds in the Sky (Top Floor)]); - handleFamiliar("item"); if (internalQuestStatus("questL10Garbage") > 9) { @@ -380,20 +359,11 @@ boolean L10_holeInTheSkyUnlock() set_property("choiceAdventure678", 3); set_property("choiceAdventure676", 4); - if(auto_have_familiar($familiar[Ms. Puck Man])) - { - handleFamiliar($familiar[Ms. Puck Man]); - } - else if(auto_have_familiar($familiar[Puck Man])) - { - handleFamiliar($familiar[Puck Man]); - } if(!auto_forceNextNoncombat()) { providePlusNonCombat(25); } autoAdv(1, $location[The Castle in the Clouds in the Sky (Top Floor)]); - handleFamiliar("item"); return true; } diff --git a/RELEASE/scripts/autoscend/quests/level_11.ash b/RELEASE/scripts/autoscend/quests/level_11.ash index 20d11c680..0b87377c9 100644 --- a/RELEASE/scripts/autoscend/quests/level_11.ash +++ b/RELEASE/scripts/autoscend/quests/level_11.ash @@ -439,11 +439,6 @@ boolean L11_blackMarket() autoEquip($slot[acc3], $item[Blackberry Galoshes]); - if((my_ascensions() == 0) || (item_amount($item[Reassembled Blackbird]) == 0)) - { - handleFamiliar($familiar[Reassembled Blackbird]); - } - //If we want the Beehive, and don\'t have enough adventures, this is dangerous. if (get_property("auto_getBeehive").to_boolean() && my_adventures() < 3) { return false; @@ -721,7 +716,6 @@ boolean L11_aridDesert() { autoEquip(desertBuff); } - handleFamiliar("init"); set_property("choiceAdventure805", 1); int need = 100 - get_property("desertExploration").to_int(); auto_log_info("Need for desert: " + need, "blue"); @@ -904,7 +898,6 @@ boolean L11_aridDesert() } autoAdv(1, $location[The Arid\, Extra-Dry Desert]); - handleFamiliar("item"); if(contains_text(get_property("lastEncounter"), "A Sietch in Time")) { @@ -1366,7 +1359,6 @@ boolean L11_hiddenCity() if (item_amount($item[stone triangle]) == 4) { auto_log_info("Fighting the out-of-work spirit", "blue"); acquireHP(); - handleFamiliar("init"); return autoAdv($location[A Massive Ziggurat]); } @@ -1496,8 +1488,6 @@ boolean L11_mauriceSpookyraven() providePlusNonCombat(25, true); } - handleFamiliar("init"); - return autoAdv($location[The Haunted Ballroom]); } if(item_amount($item[recipe: mortar-dissolving solution]) == 0) @@ -2018,7 +2008,6 @@ boolean L11_palindome() { if(item_amount($item[Wet Stunt Nut Stew]) == 0) { - handleFamiliar("item"); equipBaseline(); if((item_amount($item[Bird Rib]) == 0) || (item_amount($item[Lion Oil]) == 0)) { @@ -2339,7 +2328,6 @@ boolean L11_unlockEd() { auto_sourceTerminalEnhance("items"); } - handleFamiliar("item"); } if(get_property("controlRoomUnlock").to_boolean()) diff --git a/RELEASE/scripts/autoscend/quests/level_12.ash b/RELEASE/scripts/autoscend/quests/level_12.ash index 904a009b0..ced684dbb 100644 --- a/RELEASE/scripts/autoscend/quests/level_12.ash +++ b/RELEASE/scripts/autoscend/quests/level_12.ash @@ -781,7 +781,6 @@ boolean L12_filthworms() } if(item_amount($item[Heart of the Filthworm Queen]) > 0) { - handleFamiliar("meat"); return false; } @@ -862,9 +861,6 @@ boolean L12_filthworms() } buffMaintain($effect[Frosty], 0, 1, 1); - handleFamiliar("item"); - handleServant("item"); - addToMaximize("200item"); //craft IOTM derivative that gives high item bonus @@ -999,7 +995,6 @@ boolean L12_gremlins() { bat_formMist(); } - handleFamiliar("gremlins"); songboomSetting("dr"); if(item_amount($item[molybdenum hammer]) == 0) { @@ -1024,7 +1019,6 @@ boolean L12_gremlins() autoAdv(1, $location[near an abandoned refrigerator], "auto_JunkyardCombatHandler"); return true; } - handleFamiliar("item"); warOutfit(true); visit_url("bigisland.php?action=junkman&pwd"); return true; @@ -1072,7 +1066,6 @@ boolean L12_sonofaBeach() auto_sourceTerminalEducate($skill[Extract], $skill[Digitize]); if(chateaumantegna_usePainting()) { - handleFamiliar("item"); return true; } } @@ -1140,7 +1133,6 @@ boolean L12_sonofaBeach() autoAdv(1, $location[Sonofa Beach]); set_property("auto_doCombatCopy", "no"); - handleFamiliar("item"); if (isActuallyEd() && my_hp() == 0) { @@ -1186,7 +1178,6 @@ boolean L12_sonofaPrefix() auto_sourceTerminalEducate($skill[Extract], $skill[Digitize]); if(chateaumantegna_usePainting()) { - handleFamiliar("stat"); return true; } } @@ -1311,7 +1302,6 @@ boolean L12_sonofaPrefix() autoAdv(1, $location[Sonofa Beach]); set_property("auto_combatDirective", ""); set_property("auto_doCombatCopy", "no"); - handleFamiliar("item"); if (isActuallyEd() && my_hp() == 0) { @@ -1400,7 +1390,6 @@ boolean L12_lastDitchFlyer() } else { - handleFamiliar("item"); if(LX_getStarKey()) { return true; @@ -1604,12 +1593,6 @@ boolean L12_themtharHills() } asdonBuff($effect[Driving Observantly]); - if (isActuallyEd()) { - handleServant("meat"); - } else { - handleFamiliar("meat"); - } - if(available_amount($item[Li\'l Pirate Costume]) > 0 && canChangeToFamiliar($familiar[Trick-or-Treating Tot]) && (auto_my_path() != "Heavy Rains")) { use_familiar($familiar[Trick-or-Treating Tot]); @@ -1674,7 +1657,6 @@ boolean L12_themtharHills() if(failNuns) { - handleFamiliar("item"); set_property("auto_skipNuns", "true"); return false; } @@ -1739,7 +1721,6 @@ boolean L12_themtharHills() diffMeat = diffMeat * 1.2; average = average * 1.2; } - handleFamiliar("item"); return true; } @@ -1903,7 +1884,6 @@ boolean L12_clearBattlefield() { if (internalQuestStatus("questL12HippyFrat") < 2 && get_property("hippiesDefeated").to_int() < 333 && get_property("fratboysDefeated").to_int() < 333 && possessOutfit("Frat Warrior Fatigues", true)) { - handleFamiliar("item"); if(haveWarOutfit()) { warOutfit(false); @@ -1978,7 +1958,6 @@ boolean L12_clearBattlefield() use(1, $item[Stuffing Fluffer]); return true; } - handleFamiliar("item"); warOutfit(false); return warAdventure(); } @@ -1986,7 +1965,6 @@ boolean L12_clearBattlefield() if (get_property("hippiesDefeated").to_int() < 192 && get_property("fratboysDefeated").to_int() < 192 && internalQuestStatus("questL12War") == 1) { auto_log_info("Getting to the nunnery/junkyard", "blue"); - handleFamiliar("item"); warOutfit(false); return warAdventure(); } @@ -1994,7 +1972,6 @@ boolean L12_clearBattlefield() if ((get_property("sidequestNunsCompleted") != "none" || get_property("auto_skipNuns").to_boolean()) && (get_property("hippiesDefeated").to_int() < 1000 && get_property("fratboysDefeated").to_int() < 1000) && internalQuestStatus("questL12War") == 1) { auto_log_info("Doing the wars.", "blue"); - handleFamiliar("item"); warOutfit(false); return warAdventure(); } diff --git a/RELEASE/scripts/autoscend/quests/level_13.ash b/RELEASE/scripts/autoscend/quests/level_13.ash index f8110db80..4be37372a 100644 --- a/RELEASE/scripts/autoscend/quests/level_13.ash +++ b/RELEASE/scripts/autoscend/quests/level_13.ash @@ -199,11 +199,6 @@ boolean LX_getStarKey() set_property("choiceAdventure1221", 2 + (my_ascensions() % 2)); } } - else - { - handleFamiliar("item"); - } - return autoAdv(1, $location[The Hole In The Sky]); } @@ -488,7 +483,6 @@ boolean L13_towerNSContests() } } - handleFamiliar("item"); equipBaseline(); if(contains_text(visit_url("place.php?whichplace=nstower"), "ns_01_crowd1")) @@ -933,10 +927,6 @@ boolean L13_towerNSTower() set_property("auto_getBeehive", true); auto_log_warning("I probably failed the Wall of Skin, I assume that I tried without a beehive. Well, I'm going back to get it.", "red"); } - else - { - handleFamiliar("item"); - } } else { @@ -1030,10 +1020,6 @@ boolean L13_towerNSTower() acquireHP(); set_property("auto_getBoningKnife", true); } - else - { - handleFamiliar("item"); - } } else if((item_amount($item[Electric Boning Knife]) > 0) || (auto_my_path() == "Pocket Familiars")) { diff --git a/RELEASE/scripts/autoscend/quests/level_7.ash b/RELEASE/scripts/autoscend/quests/level_7.ash index 57426ddd6..fa82fd165 100644 --- a/RELEASE/scripts/autoscend/quests/level_7.ash +++ b/RELEASE/scripts/autoscend/quests/level_7.ash @@ -46,7 +46,6 @@ boolean L7_crypt() if((get_property("cyrptAlcoveEvilness").to_int() > 0) && ((get_property("cyrptAlcoveEvilness").to_int() <= get_property("auto_waitingArrowAlcove").to_int()) || (get_property("cyrptAlcoveEvilness").to_int() <= 25)) && edAlcove && canGroundhog($location[The Defiled Alcove])) { - handleFamiliar("init"); if((get_property("_badlyRomanticArrows").to_int() == 0) && auto_have_familiar($familiar[Reanimated Reanimator]) && (my_daycount() == 1)) { @@ -82,7 +81,6 @@ boolean L7_crypt() { auto_log_info("The Nook!", "blue"); buffMaintain($effect[Joyful Resolve], 0, 1, 1); - handleFamiliar("item"); autoEquip($item[Gravy Boat]); bat_formBats(); diff --git a/RELEASE/scripts/autoscend/quests/level_8.ash b/RELEASE/scripts/autoscend/quests/level_8.ash index 8ed246c7d..097db43c5 100644 --- a/RELEASE/scripts/autoscend/quests/level_8.ash +++ b/RELEASE/scripts/autoscend/quests/level_8.ash @@ -268,7 +268,6 @@ boolean L8_getGoatCheese() } auto_log_info("Yay for goat cheese!", "blue"); - handleFamiliar("item"); if(get_property("_sourceTerminalDuplicateUses").to_int() == 0) { auto_sourceTerminalEducate($skill[Extract], $skill[Duplicate]); @@ -351,7 +350,6 @@ boolean L8_getMineOres() if (!possessOutfit("Mining Gear")) { auto_log_info("Getting Mining Gear.", "blue"); providePlusNonCombat(25); - handleFamiliar("item"); return autoAdv($location[Itznotyerzitz Mine]); } else if (possessOutfit("Mining Gear", true)) { equipMaximizedGear(); @@ -406,7 +404,6 @@ boolean L8_trapperExtreme() auto_log_info("Penguin Tony Hawk time. Extreme!! SSX Tricky!!", "blue"); providePlusNonCombat(25); - handleFamiliar("item"); return autoAdv($location[The eXtreme Slope]); } diff --git a/RELEASE/scripts/autoscend/quests/level_9.ash b/RELEASE/scripts/autoscend/quests/level_9.ash index f6907671d..78d2ca605 100644 --- a/RELEASE/scripts/autoscend/quests/level_9.ash +++ b/RELEASE/scripts/autoscend/quests/level_9.ash @@ -565,14 +565,12 @@ boolean L9_aBooPeak() { use(1, $item[Scroll of Drastic Healing]); } - handleFamiliar("item"); handleBjornify(priorBjorn); return true; } auto_log_info("Nevermind, that peak is too scary!", "green"); equipBaseline(); - handleFamiliar("item"); handleBjornify(priorBjorn); } else @@ -781,7 +779,6 @@ boolean L9_oilPeak() } buffMaintain($effect[Fishy Whiskers], 0, 1, 1); - handleFamiliar("init"); auto_MaxMLToCap(auto_convertDesiredML(100), true); @@ -842,7 +839,6 @@ boolean L9_oilPeak() uneffect($effect[Driving Wastefully]); } } - handleFamiliar("item"); return true; } diff --git a/RELEASE/scripts/autoscend/quests/optional.ash b/RELEASE/scripts/autoscend/quests/optional.ash index 513791d1c..6e2682bdd 100644 --- a/RELEASE/scripts/autoscend/quests/optional.ash +++ b/RELEASE/scripts/autoscend/quests/optional.ash @@ -145,14 +145,6 @@ boolean LX_steelOrgan() # Should we check for -NC stuff and deal with it? # We need a Combat Modifier controller } - if(item_amount($item[Imp Air]) >= 5) - { - handleFamiliar($familiar[Jumpsuited Hound Dog]); - } - else - { - handleFamiliar("item"); - } autoAdv(1, $location[The Laugh Floor]); } else if(((item_amount($item[Azazel\'s Unicorn]) == 0) || (item_amount($item[Bus Pass]) < 5)) && (item_amount($item[Azazel\'s Tutu]) == 0)) @@ -236,7 +228,6 @@ boolean LX_steelOrgan() { uneffect($effect[The Sonata of Sneakiness]); } - handleFamiliar("item"); autoAdv(1, $location[Infernal Rackets Backstage]); } else if((item_amount($item[Azazel\'s Lollipop]) == 0) && (item_amount($item[Azazel\'s Tutu]) == 0)) From 4dbe4a11c95d6d2d7616a53c82e8a047356e83d1 Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Fri, 19 Jun 2020 02:31:00 -0600 Subject: [PATCH 16/52] we should to visit the contest booth to find out what the contests are (#440) we should to visit the contest booth to find out what the contests are if we do not have a telescope otherwise it wastes turns by not properly optimizing. --- RELEASE/scripts/autoscend/quests/level_13.ash | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RELEASE/scripts/autoscend/quests/level_13.ash b/RELEASE/scripts/autoscend/quests/level_13.ash index 4be37372a..3ecd9bd2a 100644 --- a/RELEASE/scripts/autoscend/quests/level_13.ash +++ b/RELEASE/scripts/autoscend/quests/level_13.ash @@ -220,6 +220,12 @@ boolean L13_towerNSContests() visit_url("choice.php?pwd=&whichchoice=1022&option=1", true); return true; } + + //if you do not have a telescope you need to actually visit the contest booth once to find out what element and offstat is needed + if(get_property("nsChallenge1") == "none" || get_property("nsChallenge2") == "none") + { + visit_url("place.php?whichplace=nstower&action=ns_01_contestbooth"); + } boolean crowd1Insufficient() { From 68fe7a2b62d8717249cb9572f70934cd93b9025c Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Fri, 19 Jun 2020 02:37:48 -0600 Subject: [PATCH 17/52] disguise delimit identify [your shadow] mask (#441) --- RELEASE/scripts/autoscend/auto_combat.ash | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/RELEASE/scripts/autoscend/auto_combat.ash b/RELEASE/scripts/autoscend/auto_combat.ash index 14ffb5dee..ce07c1251 100644 --- a/RELEASE/scripts/autoscend/auto_combat.ash +++ b/RELEASE/scripts/autoscend/auto_combat.ash @@ -337,6 +337,11 @@ string auto_combatHandler(int round, monster enemy, string text) auto_log_info("Found mask: " + majora, "green"); } } + else if(enemy == $monster[Your Shadow]) //matcher fails on your shadow and it always wears mask 1. + { + majora = 1; + auto_log_info("Found mask: 1", "green"); + } else { return abortCombat("Failed to identify the mask worn by the monster [" + enemy + "]. Finish this combat manually then run me again"); From c2db0476cea46e962294df2aa7e19c2eed6b6089 Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Fri, 19 Jun 2020 22:40:14 -0600 Subject: [PATCH 18/52] fix infinite loop when trying to do vacation without enough adventures (#442) --- RELEASE/scripts/autoscend/quests/level_any.ash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASE/scripts/autoscend/quests/level_any.ash b/RELEASE/scripts/autoscend/quests/level_any.ash index 0bb9796dc..d51ae599d 100644 --- a/RELEASE/scripts/autoscend/quests/level_any.ash +++ b/RELEASE/scripts/autoscend/quests/level_any.ash @@ -218,9 +218,9 @@ boolean LX_islandAccess() { abort("Dude, we got Dinghy Plans... we should not be here...."); } - while((item_amount($item[Shore Inc. Ship Trip Scrip]) < 3) && (my_meat() >= 500) && (item_amount($item[Dinghy Plans]) == 0)) + while(item_amount($item[Shore Inc. Ship Trip Scrip]) < 3 && item_amount($item[Dinghy Plans]) == 0) { - LX_doVacation(); + if(!LX_doVacation()) break; //tries to vacation and if fails it will break the loop } if(item_amount($item[Shore Inc. Ship Trip Scrip]) < 3) { From a5d9b10d8d5886c3c9a10ada2a9919f41db74f5a Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Fri, 19 Jun 2020 23:25:32 -0600 Subject: [PATCH 19/52] *auto_is_valid will identify grimstone mask as invalid if you are playing as any non-core class. (#439) *auto_is_valid will identify grimstone mask as invalid if you are playing as any non-core class. as vampyre shows a generic message that says only core classes are allowed to use. (unlike the tested older paths who showed path specific messages explaining why they cannot use it). **This does need spading to see if an exception exists. but for now assume only core 6 are allowed to prevent infinite loop in all other avatar paths. *UV compass and ornate dowsing rod check for auto_can_equip instead of checking is_unrestricted. This allows them to also catch paths in which you are forbidden to equip offhand items by the path rules (boris and way of surprising fist). And will be more robust going forward. --- RELEASE/scripts/autoscend/auto_util.ash | 11 ++++++----- RELEASE/scripts/autoscend/iotms/mr2014.ash | 7 +------ RELEASE/scripts/autoscend/iotms/mr2019.ash | 5 +---- RELEASE/scripts/autoscend/quests/level_11.ash | 10 +++++----- 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/RELEASE/scripts/autoscend/auto_util.ash b/RELEASE/scripts/autoscend/auto_util.ash index 0de4205b1..84cc61926 100644 --- a/RELEASE/scripts/autoscend/auto_util.ash +++ b/RELEASE/scripts/autoscend/auto_util.ash @@ -131,11 +131,6 @@ boolean evokeEldritchHorror(string option); boolean evokeEldritchHorror(); boolean auto_change_mcd(int mcd); boolean basicAdjustML(); -boolean auto_is_valid(item it); -boolean auto_is_valid(familiar fam); -boolean auto_is_valid(skill sk); -boolean auto_can_equip(item it); -boolean auto_can_equip(item it, slot s); boolean auto_badassBelt(); int auto_convertDesiredML(int DML); boolean auto_setMCDToCap(); @@ -5801,6 +5796,12 @@ boolean auto_is_valid(item it) else if(!expectGhostReport() && !haveGhostReport()) return false; } + if(it == $item[Grimstone Mask]) + { + if(!isGuildClass()) //it seems like all non core classes are disallowed. need to spade this to verify if any class is exempt + return false; + } + return bees_hate_usable(it.to_string()) && is_unrestricted(it); } diff --git a/RELEASE/scripts/autoscend/iotms/mr2014.ash b/RELEASE/scripts/autoscend/iotms/mr2014.ash index f38fbbad2..8af01550b 100644 --- a/RELEASE/scripts/autoscend/iotms/mr2014.ash +++ b/RELEASE/scripts/autoscend/iotms/mr2014.ash @@ -371,16 +371,11 @@ boolean LX_ornateDowsingRod(boolean doing_desert_now) { return false; } - if(!is_unrestricted($item[Grimstone Mask]) || !is_unrestricted($item[Ornate Dowsing Rod])) + if(!auto_is_valid($item[Grimstone Mask]) || !auto_can_equip($item[Ornate Dowsing Rod])) { set_property("auto_grimstoneOrnateDowsingRod", false); //mask or rod are not valid return false; } - if(auto_my_path() == "Way of the Surprising Fist" || $class[Avatar of Boris] == my_class()) - { - set_property("auto_grimstoneOrnateDowsingRod", false); //cannot equip offhand item in those paths - return false; - } if(possessEquipment($item[Ornate Dowsing Rod])) { auto_log_info("Hey, we have the dowsing rod already, yippie!", "blue"); diff --git a/RELEASE/scripts/autoscend/iotms/mr2019.ash b/RELEASE/scripts/autoscend/iotms/mr2019.ash index 3912301ea..651608850 100644 --- a/RELEASE/scripts/autoscend/iotms/mr2019.ash +++ b/RELEASE/scripts/autoscend/iotms/mr2019.ash @@ -195,10 +195,7 @@ boolean auto_sausageGoblin(location loc, string option) { return false; } - - // can't equip kramko sausage grinder during certain paths, return false in those paths - - if (auto_my_path() == "Way of the Surprising Fist" || in_boris()) + if(!auto_can_equip($item[Kramco Sausage-o-Matic™])) { return false; } diff --git a/RELEASE/scripts/autoscend/quests/level_11.ash b/RELEASE/scripts/autoscend/quests/level_11.ash index 0b87377c9..7753fd5b0 100644 --- a/RELEASE/scripts/autoscend/quests/level_11.ash +++ b/RELEASE/scripts/autoscend/quests/level_11.ash @@ -566,10 +566,14 @@ boolean L11_mcmuffinDiary() boolean L11_getUVCompass() { //acquire a [UV-resistant compass] if needed - if(possessEquipment($item[Ornate Dowsing Rod]) && is_unrestricted($item[Ornate Dowsing Rod])) + if(possessEquipment($item[Ornate Dowsing Rod]) && auto_can_equip($item[Ornate Dowsing Rod])) { return false; //already have a dowsing rod. we do not need a compass. } + if(!auto_can_equip($item[UV-resistant compass])) + { + return false; + } if(possessEquipment($item[UV-resistant compass])) { return false; //already have compass @@ -578,10 +582,6 @@ boolean L11_getUVCompass() { return false; //impossible to get compass in this path. [The Shore, Inc] is unavailable } - if(auto_my_path() == "Way of the Surprising Fist" || $class[Avatar of Boris] == my_class()) - { - return false; //cannot equip offhand item in these paths - } if(item_amount($item[Shore Inc. Ship Trip Scrip]) == 0) { From 79f8139fe36c2ed6994fd90885ef07e3400ba2ca Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Sat, 20 Jun 2020 02:07:37 -0600 Subject: [PATCH 20/52] fix error introduced by #438 (#444) --- RELEASE/scripts/autoscend/quests/optional.ash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE/scripts/autoscend/quests/optional.ash b/RELEASE/scripts/autoscend/quests/optional.ash index 6e2682bdd..6a38794fb 100644 --- a/RELEASE/scripts/autoscend/quests/optional.ash +++ b/RELEASE/scripts/autoscend/quests/optional.ash @@ -579,7 +579,7 @@ boolean LX_joinPirateCrew() { // this is held together with duct tape and hopes and dreams. // it can and will fail but it will have to do for now. auto_log_info("Beer Pong time.", "blue"); - autoOutfit("Swashbuckling Getup"); + outfit("Swashbuckling Getup"); //do not use autoOutfit since we use visit_url in tryBeerPong which skips maximizer backupSetting("choiceAdventure187", "0"); tryBeerPong(); return true; From 243f8b91818fd6ad933607dee3423f51c7c46aa6 Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Sun, 21 Jun 2020 23:12:19 -0600 Subject: [PATCH 21/52] disguises delimit don't waste adventures if the naughty sorceress 3rd form is wearing one of the masks that prevent her from advancing the quest to step 12 and thus unlocking bear verb orgy. (#446) *disguises delimit don't waste adventures if the naughty sorceress 3rd form is wearing one of the masks that prevent her from advancing the quest to step 12. making bear verb orgy impossible in that specific ascension **Since we have not fully spaded which masks do this. this is handled by looking at the quest state. If mafia thinks we are at quest state 12 it means mafia thinks we unlocked bear verb orgy by losing to NS 3rd form. At that point we refresh quests, that causes mafia to recognize we are on step 11 not 12 according to the quest log. which indicates that in this particular disguises delimit ascension the NS 3rd form is wearing a mask that is preventing bear verb orgy. at which point we abort and tell the user to fix it manually by getting a wand (in such a run the only way to get a wand is via clovering the castle basement. the fact we did not do it mean we have no clover. so the fix is to get a clover from the barrel full of barrels, use it to get a wand, then run autoscend again... or just kill the NS yourself) Fixes #419 --- RELEASE/scripts/autoscend.ash | 2 +- RELEASE/scripts/autoscend/quests/level_13.ash | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/RELEASE/scripts/autoscend.ash b/RELEASE/scripts/autoscend.ash index 11c76805f..05352bede 100644 --- a/RELEASE/scripts/autoscend.ash +++ b/RELEASE/scripts/autoscend.ash @@ -2367,7 +2367,7 @@ boolean LX_freeCombats(boolean powerlevel) auto_freeCombatsRemaining(true); //print remaining free combats. auto_log_warning("Too few adventures to safely automate free combats", "red"); auto_log_warning("If we lose your last adv on a free combat the remaining free combats are wasted", "red"); - auto_log_warning("This should only happen if you lost a free fight. If you did not then please report this", "red"); + auto_log_warning("This error should only occur if you lost a free fight. If you did not then please report this", "red"); abort("Please perform the remaining free combats manually then run me again"); } diff --git a/RELEASE/scripts/autoscend/quests/level_13.ash b/RELEASE/scripts/autoscend/quests/level_13.ash index 3ecd9bd2a..480c27765 100644 --- a/RELEASE/scripts/autoscend/quests/level_13.ash +++ b/RELEASE/scripts/autoscend/quests/level_13.ash @@ -1238,7 +1238,6 @@ boolean L13_towerNSNagamar() { return false; } - if(item_amount($item[Wand of Nagamar]) > 0) { set_property("auto_wandOfNagamar", false); @@ -1257,6 +1256,14 @@ boolean L13_towerNSNagamar() auto_log_warning("Buying [Wand of Nagamar] using rare Meat Isotopes failed even thought we had 30 isotopes... trying alternatives", "red"); } } + if(auto_my_path() == "Disguises Delimit" && internalQuestStatus("questL13Final") == 12) + { + cli_execute("refresh quests"); + if(internalQuestStatus("questL13Final") != 12) + { + abort("In this specific ascension [naughty sorceress \(3\)] is wearing a mask that makes kol base game fail to advance the quest to step 12. Which means that bear verb orgy is impossible for this specific run. Manually grab a [Ten-Leaf Clover] from [Barrel Full of Barrels] then use it to get a [Wand of Nagamar] manually and run me again"); + } + } if(creatable_amount($item[Wand Of Nagamar]) == 0 && (creatable_amount($item[WA]) > 0 || item_amount($item[WA]) > 0)) { From 422ada77d4e49b8e2aec886c259642568f441c0e Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Mon, 22 Jun 2020 14:50:55 -0600 Subject: [PATCH 22/52] switch helix fossil to LASS fixed version (#450) --- RELEASE/dependencies.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE/dependencies.txt b/RELEASE/dependencies.txt index ee800da2c..942cc46d9 100644 --- a/RELEASE/dependencies.txt +++ b/RELEASE/dependencies.txt @@ -1,5 +1,5 @@ https://github.com/Ezandora/Detective-Solver/branches/Release/ -https://github.com/Ezandora/Helix-Fossil/branches/Release/ +https://github.com/Loathing-Associates-Scripting-Society/Helix-Fossil/branches/Release/ https://github.com/Ezandora/Far-Future/branches/Release/ https://github.com/Ezandora/Voting-Booth/trunk/Release/ https://github.com/Ezandora/Comb-Beach/trunk/Release/ From 5c22bf8c5a791247e987df96079dc404bbf02c24 Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Wed, 24 Jun 2020 12:25:34 -0700 Subject: [PATCH 23/52] don't do this unless in G Lover. Also this is probably bad regardless but let's just let G Lover be bad and every other path can ignore these terrible choices. (#454) --- RELEASE/scripts/autoscend/paths/g_lover.ash | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RELEASE/scripts/autoscend/paths/g_lover.ash b/RELEASE/scripts/autoscend/paths/g_lover.ash index f22515b14..551071734 100644 --- a/RELEASE/scripts/autoscend/paths/g_lover.ash +++ b/RELEASE/scripts/autoscend/paths/g_lover.ash @@ -3,6 +3,10 @@ script "g_lover.ash" void glover_initializeDay(int day) { + if (auto_my_path() != "G-Lover") { + return false; + } + if((item_amount($item[Mumming Trunk]) > 0) && !get_property("_mummifyDone").to_boolean()) { mummifyFamiliar($familiar[Disgeist], "myst"); From d96f3e99ab938c8189d3d0c42ba09e3664fea2cb Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Wed, 24 Jun 2020 12:35:33 -0700 Subject: [PATCH 24/52] oops (#455) --- RELEASE/scripts/autoscend/paths/g_lover.ash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE/scripts/autoscend/paths/g_lover.ash b/RELEASE/scripts/autoscend/paths/g_lover.ash index 551071734..7da8bd6f9 100644 --- a/RELEASE/scripts/autoscend/paths/g_lover.ash +++ b/RELEASE/scripts/autoscend/paths/g_lover.ash @@ -4,7 +4,7 @@ script "g_lover.ash" void glover_initializeDay(int day) { if (auto_my_path() != "G-Lover") { - return false; + return; } if((item_amount($item[Mumming Trunk]) > 0) && !get_property("_mummifyDone").to_boolean()) From 31460b235dcaa8915b5a570825cb1e1cef21204d Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Thu, 25 Jun 2020 14:47:02 -0700 Subject: [PATCH 25/52] stop G-Lover trying to open the hidden temple via spooky forest. (#456) --- RELEASE/scripts/autoscend/quests/level_11.ash | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RELEASE/scripts/autoscend/quests/level_11.ash b/RELEASE/scripts/autoscend/quests/level_11.ash index 7753fd5b0..5b8bc8d55 100644 --- a/RELEASE/scripts/autoscend/quests/level_11.ash +++ b/RELEASE/scripts/autoscend/quests/level_11.ash @@ -95,6 +95,12 @@ boolean shenShouldDelayZone(location loc) boolean LX_unlockHiddenTemple() { // replaces L2_treeCoin(), L2_spookyMap(), L2_spookyFertilizer() & L2_spookySapling() + + if (auto_my_path() == "G-Lover") { + // Spooky Temple map ain't nuthin' but a 'G' Thang. + return false; + } + if (hidden_temple_unlocked()) { return false; } From 4200d73a9f2655b53b8154fadb07276b2f54b221 Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Fri, 26 Jun 2020 22:26:25 -0600 Subject: [PATCH 26/52] removed abortCombat as mafia r20210 handles it via abort() (#452) removed abortCombat as mafia r20210 should be able to handle abort() command in combat filter function this commit effectively reverts #434 now that mafia is handling aborts in combat --- RELEASE/scripts/autoscend.ash | 2 +- RELEASE/scripts/autoscend/auto_combat.ash | 41 ++++++++++------------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/RELEASE/scripts/autoscend.ash b/RELEASE/scripts/autoscend.ash index 05352bede..55fd654fd 100644 --- a/RELEASE/scripts/autoscend.ash +++ b/RELEASE/scripts/autoscend.ash @@ -1,5 +1,5 @@ script "autoscend.ash"; -since r20188; // If automating an adventure leaves you in a choice, automate the choice +since r20210; // abort now works in combat filter function /*** autoscend_header.ash must be first import All non-accessory scripts must be imported here diff --git a/RELEASE/scripts/autoscend/auto_combat.ash b/RELEASE/scripts/autoscend/auto_combat.ash index ce07c1251..2618b5c94 100644 --- a/RELEASE/scripts/autoscend/auto_combat.ash +++ b/RELEASE/scripts/autoscend/auto_combat.ash @@ -20,14 +20,6 @@ boolean containsCombat(item it); // private prototypes -string abortCombat(string msg) -{ - //abort() does not work in combat. instead we need the combat filter to return "abort" string. - //to use this function: return abortCombat("message goes here"); - print(msg, "red"); - return "abort"; -} - boolean haveUsed(skill sk) { return get_property("auto_combatHandler").contains_text("(sk" + sk.to_int().to_string() + ")"); @@ -261,7 +253,7 @@ string auto_combatHandler(int round, monster enemy, string text) { if(round > 25) { - return abortCombat("Some sort of problem occurred, it is past round 25 but we are still in non-gremlin combat..."); + abort("Some sort of problem occurred, it is past round 25 but we are still in non-gremlin combat..."); } #Yes, round 0, really. @@ -301,7 +293,7 @@ string auto_combatHandler(int round, monster enemy, string text) if(get_property("auto_diag_round").to_int() > 60) { - return abortCombat("Somehow got to 60 rounds.... aborting"); + abort("Somehow got to 60 rounds.... aborting"); } if(my_path() == "One Crazy Random Summer") @@ -344,7 +336,7 @@ string auto_combatHandler(int round, monster enemy, string text) } else { - return abortCombat("Failed to identify the mask worn by the monster [" + enemy + "]. Finish this combat manually then run me again"); + abort("Failed to identify the mask worn by the monster [" + enemy + "]. Finish this combat manually then run me again"); } if((majora == 7) && canUse($skill[Swap Mask])) @@ -357,7 +349,7 @@ string auto_combatHandler(int round, monster enemy, string text) { return "attack with weapon"; } - return abortCombat("May not be able to survive combat. Is swapping protest mask still not allowing us to do anything?"); + abort("May not be able to survive combat. Is swapping protest mask still not allowing us to do anything?"); } if(my_mask() == "protest mask" && canUse($skill[Swap Mask])) { @@ -493,7 +485,7 @@ string auto_combatHandler(int round, monster enemy, string text) { return "item " + $item[super deluxe mushroom]; } - return abortCombat("Oh no, I don't have any super deluxe mushrooms to deal with this shadow plumber :("); + abort("Oh no, I don't have any super deluxe mushrooms to deal with this shadow plumber :("); } if(auto_have_skill($skill[Ambidextrous Funkslinging])) { @@ -522,7 +514,7 @@ string auto_combatHandler(int round, monster enemy, string text) { return "item " + $item[Rain-Doh Indigo Cup]; } - return abortCombat("Uh oh, I ran out of gauze garters and filthy poultices"); + abort("Uh oh, I ran out of gauze garters and filthy poultices"); } if(enemy == $monster[Wall Of Meat]) @@ -892,7 +884,7 @@ string auto_combatHandler(int round, monster enemy, string text) { return useSkill($skill[Turtleini], false); } - return abortCombat("I am not sure how to finish this battle"); + abort("I am not sure how to finish this battle"); } // Unique Heavy Rains Enemy that Reflects Spells. @@ -990,7 +982,7 @@ string auto_combatHandler(int round, monster enemy, string text) { if((get_property("_badlyRomanticArrows").to_int() == 1) && (round <= 1) && (get_property("romanticTarget") != enemy)) { - return abortCombat("Have animator out but can not arrow"); + abort("Have animator out but can not arrow"); } if(enemy == $monster[modern zmobie]) { @@ -1242,7 +1234,7 @@ string auto_combatHandler(int round, monster enemy, string text) if(contains_text(combatState, "yellowray")) { - return abortCombat("Ugh, where is my damn yellowray!!!"); + abort("Ugh, where is my damn yellowray!!!"); } if(item_amount($item[Green Smoke Bomb]) > 0) @@ -1270,7 +1262,7 @@ string auto_combatHandler(int round, monster enemy, string text) if(banishAction != "") { auto_log_info("Looking at banishAction: " + banishAction, "green"); - #return abortCombat("Banisher considered here. Weee"); + #abort("Banisher considered here. Weee"); #wait(10); #banishAction = ""; } @@ -1906,13 +1898,13 @@ string auto_combatHandler(int round, monster enemy, string text) return useSkill($skill[Saucestorm], false); } //TODO check if our physical attack can deal elemental damage. - else return abortCombat("Not sure how to handle a physically resistent enemy wearing a welding mask."); + else abort("Not sure how to handle a physically resistent enemy wearing a welding mask."); } if(canSurvive(1.5) && round < 10) { return "attack with weapon"; } - return abortCombat("Not sure how to handle welding mask."); + abort("Not sure how to handle welding mask."); } if(majora == 25) //tiki mask { @@ -2381,7 +2373,7 @@ string auto_combatHandler(int round, monster enemy, string text) } if(my_location() != $location[The Slime Tube]) { - return abortCombat("Could not handle monster, sorry"); + abort("Could not handle monster, sorry"); } } if((monster_level_adjustment() > 150) && (my_mp() >= 45) && canUse($skill[Shell Up]) && (my_class() == $class[Turtle Tamer])) @@ -2618,7 +2610,7 @@ string auto_edCombatHandler(int round, monster enemy, string text) int damageReceived = 0; if (!isActuallyEd()) { - return abortCombat("Not in Actually Ed the Undying, this combat filter will result in massive suckage."); + abort("Not in Actually Ed the Undying, this combat filter will result in massive suckage."); } if (round == 0) @@ -2668,7 +2660,7 @@ string auto_edCombatHandler(int round, monster enemy, string text) if(get_property("auto_diag_round").to_int() > 60) { - return abortCombat("Somehow got to 60 rounds.... aborting"); + abort("Somehow got to 60 rounds.... aborting"); } phylum type = monster_phylum(enemy); @@ -3374,7 +3366,8 @@ string auto_saberTrickMeteorShowerCombatHandler(int round, monster enemy, string return auto_combatSaberYR(); } } - return abortCombat("Unable to perform saber trick (meteor shower)"); + abort("Unable to perform saber trick (meteor shower)"); + return "abort"; //must have a return } monster ocrs_helper(string page) From 4de30e08ff0d94c122b48a3772d49051a26a7a98 Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Mon, 29 Jun 2020 15:57:16 -0700 Subject: [PATCH 27/52] Couple of community requests (#458) - only use campfire smoke if we don't get the buff - add Prevent Scurvy and Sobriety to MP burning summons. --- RELEASE/scripts/autoscend/auto_post_adv.ash | 2 +- RELEASE/scripts/autoscend/iotms/mr2019.ash | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/RELEASE/scripts/autoscend/auto_post_adv.ash b/RELEASE/scripts/autoscend/auto_post_adv.ash index e3b9cd9d0..e87d7ae06 100644 --- a/RELEASE/scripts/autoscend/auto_post_adv.ash +++ b/RELEASE/scripts/autoscend/auto_post_adv.ash @@ -443,7 +443,7 @@ boolean auto_post_adventure() # This is the list of castables that all MP sequences will use. - boolean [skill] toCast = $skills[Acquire Rhinestones, Advanced Cocktailcrafting, Advanced Saucecrafting, Communism!, Grab a Cold One, Lunch Break, Pastamastery, Perfect Freeze, Request Sandwich, Spaghetti Breakfast, Summon Alice\'s Army Cards, Summon Carrot, Summon Confiscated Things, Summon Crimbo Candy, Summon Geeky Gifts, Summon Hilarious Objects, Summon Holiday Fun!, Summon Kokomo Resort Pass, Summon Tasteful Items]; + boolean [skill] toCast = $skills[Prevent Scurvy and Sobriety, Acquire Rhinestones, Advanced Cocktailcrafting, Advanced Saucecrafting, Communism!, Grab a Cold One, Lunch Break, Pastamastery, Perfect Freeze, Request Sandwich, Spaghetti Breakfast, Summon Alice\'s Army Cards, Summon Carrot, Summon Confiscated Things, Summon Crimbo Candy, Summon Geeky Gifts, Summon Hilarious Objects, Summon Holiday Fun!, Summon Kokomo Resort Pass, Summon Tasteful Items]; if(my_maxmp() < 50) { diff --git a/RELEASE/scripts/autoscend/iotms/mr2019.ash b/RELEASE/scripts/autoscend/iotms/mr2019.ash index 651608850..444528d0f 100644 --- a/RELEASE/scripts/autoscend/iotms/mr2019.ash +++ b/RELEASE/scripts/autoscend/iotms/mr2019.ash @@ -706,7 +706,13 @@ boolean auto_campawayGrabBuffs() return false; } - if(!get_property("_auto_contributedCampaway").to_boolean() && item_amount($item[campfire smoke]) + creatable_amount($item[campfire smoke]) > 0) + int lim = 4 - get_property("_campAwaySmileBuffs").to_int() - get_property("_campAwayCloudBuffs").to_int(); + for (int i=0; i < lim; i++) + { + visit_url("place.php?whichplace=campaway&action=campaway_sky"); + } + + if(get_property("_campAwayCloudBuffs").to_int() == 0 && item_amount($item[campfire smoke]) + creatable_amount($item[campfire smoke]) > 0) { if(item_amount($item[campfire smoke]) == 0) { @@ -715,14 +721,9 @@ boolean auto_campawayGrabBuffs() string message = "why is my computer on fire?"; string temp = visit_url("inv_use.php?pwd=&which=3&whichitem=" + $item[campfire smoke].to_int()); temp = visit_url("choice.php?pwd=&whichchoice=1394&option=1&message=" + message); - set_property("_auto_contributedCampaway", true); - } - - int lim = 4 - get_property("_campAwaySmileBuffs").to_int() - get_property("_campAwayCloudBuffs").to_int(); - for (int i=0; i < lim; i++) - { visit_url("place.php?whichplace=campaway&action=campaway_sky"); } + return true; } From 0d2c37a23917e28d18cd4ac2f74f3f1fee867c92 Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Tue, 30 Jun 2020 14:45:16 -0700 Subject: [PATCH 28/52] only try casting blood skills if you actually have some (#461) --- RELEASE/scripts/autoscend/auto_restore.ash | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RELEASE/scripts/autoscend/auto_restore.ash b/RELEASE/scripts/autoscend/auto_restore.ash index 181fa07d1..c0131917f 100644 --- a/RELEASE/scripts/autoscend/auto_restore.ash +++ b/RELEASE/scripts/autoscend/auto_restore.ash @@ -1117,6 +1117,9 @@ boolean __restore(string resource_type, int goal, int meat_reserve, boolean useF boolean use_opportunity_blood_skills(int hp_restored_per_use, int final_hp) { + if (!auto_have_skill($skill[Blood Bond]) && !auto_have_skill($skill[Blood Bond])) { + return false; + } int restored = my_hp() + hp_restored_per_use; int waste = min(my_hp()-1, restored-my_maxhp()); if(waste <= 0) return true; From 9fbac80ee48bfa6e85cf0a6f4384616893cd28f5 Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Wed, 1 Jul 2020 12:12:49 -0700 Subject: [PATCH 29/52] add Mosquito as the absolute default failover for regen familiars (#462) also remove duplicate XO Skeleton entry. --- BUILD/familiars/regen.dat | 3 ++- RELEASE/data/autoscend_familiars.txt | 29 ++++++++++++++-------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/BUILD/familiars/regen.dat b/BUILD/familiars/regen.dat index 86dbe3798..9343401dc 100644 --- a/BUILD/familiars/regen.dat +++ b/BUILD/familiars/regen.dat @@ -29,7 +29,6 @@ Underworld Bonsai Star Starfish # Fairysuperwhelps Garbage Fire -XO Skeleton Choctopus # Superwhelps Plastic Pirate Skull @@ -53,3 +52,5 @@ Pottery Barn Owl # Regular old whelps Pet Cheezling Ghuol Whelp +# The absolute default that everyone should have after their first run +Mosquito diff --git a/RELEASE/data/autoscend_familiars.txt b/RELEASE/data/autoscend_familiars.txt index 2056d3ee0..0e75bef55 100644 --- a/RELEASE/data/autoscend_familiars.txt +++ b/RELEASE/data/autoscend_familiars.txt @@ -285,30 +285,31 @@ regen 13 Underworld Bonsai regen 14 Star Starfish # Fairysuperwhelps regen 15 Garbage Fire -regen 16 XO Skeleton -regen 17 Choctopus +regen 16 Choctopus # Superwhelps -regen 18 Plastic Pirate Skull -regen 19 Trick-or-Treating Tot +regen 17 Plastic Pirate Skull +regen 18 Trick-or-Treating Tot # Fairywhelps -regen 20 Dandy Lion +regen 19 Dandy Lion # Special whelps -regen 21 Ms. Puck Man -regen 22 Puck Man -regen 23 Squamous Gibberer -regen 24 He-Boulder -regen 25 Cotton Candy Carnie +regen 20 Ms. Puck Man +regen 21 Puck Man +regen 22 Squamous Gibberer +regen 23 He-Boulder +regen 24 Cotton Candy Carnie # Slightly better whelp for saucerors -regen 26 Pet Cheezling class:Sauceror +regen 25 Pet Cheezling class:Sauceror # Whelps with a multiplier, why not I guess #Mutant Gila Monster grimdark:0 #Mutant Gila Monster grimdark:1 # Marginally special whelps #Mutant Gila Monster grimdark:2 -regen 27 Pottery Barn Owl +regen 26 Pottery Barn Owl # Regular old whelps -regen 28 Pet Cheezling -regen 29 Ghuol Whelp +regen 27 Pet Cheezling +regen 28 Ghuol Whelp +# The absolute default that everyone should have after their first run +regen 29 Mosquito # Sombrero is desirable with a decent amount of ML stat 0 Galloping Grill ML:>=120 From 379b2fcc4884c5ea06b16dd9f49c4c0b2ec0e53c Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Thu, 2 Jul 2020 22:08:40 -0600 Subject: [PATCH 30/52] add workaround for mafia not recognizing the bosses from the crowd of adventurers as bosses (#464) --- RELEASE/scripts/autoscend/auto_util.ash | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RELEASE/scripts/autoscend/auto_util.ash b/RELEASE/scripts/autoscend/auto_util.ash index 84cc61926..8c00b371e 100644 --- a/RELEASE/scripts/autoscend/auto_util.ash +++ b/RELEASE/scripts/autoscend/auto_util.ash @@ -2318,6 +2318,9 @@ boolean instakillable(monster mon) static boolean[monster] not_instakillable = $monsters[ // Cyrpt bosses conjoined zmombie, gargantulihc, giant skeelton, huge ghuol, + + // crowd of adventurers bosses at the tower tests + Tasmanian Dervish, Mr. Loathing, The Mastermind, Seannery the Conman, The Lavalier, Leonard, Arthur Frankenstein, Mrs. Freeze, Odorous Humongous, // time-spinner Ancient Skeleton with Skin still on it, Apathetic Tyrannosaurus, Assembly Elemental, Cro-Magnon Gnoll, Krakrox the Barbarian, Wooly Duck, From d54c7a67130ba4b7094dadfb45498cfd4b3183d7 Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Thu, 2 Jul 2020 23:39:08 -0700 Subject: [PATCH 31/52] add meat_per_use values for restoration skills so they are better compared against NPC purchased items (#465) - fix Disco Nap being considered too low when you have Adventurer of Leisure - fix value for Lasagna Bandages being lower than the out of combat average - add a function to check if the Myst class guild store is available so we can know if magical mystery juice is available as an MP restore. --- RELEASE/data/autoscend_restoration.txt | 3 +- RELEASE/scripts/autoscend/auto_restore.ash | 46 +++++++++++++++---- RELEASE/scripts/autoscend/auto_util.ash | 10 ++++ .../scripts/autoscend/autoscend_header.ash | 1 + 4 files changed, 51 insertions(+), 9 deletions(-) diff --git a/RELEASE/data/autoscend_restoration.txt b/RELEASE/data/autoscend_restoration.txt index d62d59dfb..6fc91d78f 100644 --- a/RELEASE/data/autoscend_restoration.txt +++ b/RELEASE/data/autoscend_restoration.txt @@ -43,7 +43,7 @@ 42 Shake it Off skill ALL 0 0 0 All Negative none 43 Gelatinous Reconstruction skill 13 0 0 0 Beaten Up none 44 Disco Nap skill 20 0 0 0 none none -46 Lasagna Bandages skill 15 0 0 0 none none +46 Lasagna Bandages skill 20 0 0 0 none none 47 big rock dwelling 4 5 0 0 none none 48 Newbiesport™ tent dwelling 9 10 0 0 none none 49 Giant Pilgrim Hat dwelling 14 15 0 0 none Pyramid Power @@ -104,6 +104,7 @@ 107 A Relaxing Hot Tub clan ALL 0 5 2 All Negative none 108 Psychokinetic Energy Blob item 0 25 0 0 none none 109 Cloaca-Cola item 0 12 0 0 none none +## Actually Ed the Undying restores 110 Holy Spring Water item 0 50 0 0 none Spiritually Awake 111 Spirit Beer item 0 90 0 0 none Spiritually Aware 112 Sacramental Wine item 0 180 0 0 none Spiritually Awash diff --git a/RELEASE/scripts/autoscend/auto_restore.ash b/RELEASE/scripts/autoscend/auto_restore.ash index c0131917f..972488d50 100644 --- a/RELEASE/scripts/autoscend/auto_restore.ash +++ b/RELEASE/scripts/autoscend/auto_restore.ash @@ -393,6 +393,10 @@ __RestorationOptimization __calculate_objective_values(int hp_goal, int mp_goal, restored_amount += numeric_modifier("Bonus Resting HP"); } + if (metadata.name == "Disco Nap" && auto_have_skill($skill[Adventurer of Leisure])) { + restored_amount = 40; + } + if (isActuallyEd() && !($items[linen bandages, silk bandages, cotton bandages] contains metadata.name.to_item())) { restored_amount = 0; } @@ -436,16 +440,42 @@ __RestorationOptimization __calculate_objective_values(int hp_goal, int mp_goal, return max(get_value("hp", "uses_needed_for_goal"), get_value("mp", "uses_needed_for_goal")); } - float meat_per_use(){ - if(metadata.type != "item"){ + float meat_per_use() { + if (metadata.type == "item") { + item i = to_item(metadata.name); + int price = npc_price(i); + if (can_interact()){ + price = min(price, auto_mall_price(i)); + } + return price; + } else if (metadata.type == "skill") { + float meat_per_mp = 9.0; // default to Doc Galaktik's Invigorating Tonic at 90 meat/10 MP + if (dispensary_available() || black_market_available()) { + meat_per_mp = 8.0; // Knob Goblin seltzer or Black cherry soda at 80 meat/10 MP + } + if (get_property("questM24Doc") == "finished") { + meat_per_mp = 6.0; // Doc Galaktik's Invigorating Tonic reduced to 60 meat/10 MP + } + if (auto_have_skill($skill[Five Finger Discount])) { + meat_per_mp = meat_per_mp * 0.95; // this isn't quite right for discounted Doc Galaktik but I don't care. + } + if (isMystGuildStoreAvailable()) { + int mmj_cost = auto_have_skill($skill[Five Finger Discount]) ? 100 : 95; + int mmj_mp_restored = my_level() * 1.5 + 5; + float mmj_meat_per_mp = mmj_cost / mmj_mp_restored; + meat_per_mp = min(meat_per_mp, mmj_meat_per_mp); + // at level 6 and above, MMJ is better than all but discounted doc galaktik + // and at level 8 and above it's better than everything + } + if (my_class() == $class[Sauceror]) { + // your MP cup runneth over + meat_per_mp = 0.1; + } + skill s = to_skill(metadata.name); + return (mp_cost(s) * meat_per_mp); + } else { return 0.0; } - item i = to_item(metadata.name); - int price = npc_price(i); - if(can_interact()){ - price = min(price, auto_mall_price(i)); - } - return price; } float tokens_per_use(){ diff --git a/RELEASE/scripts/autoscend/auto_util.ash b/RELEASE/scripts/autoscend/auto_util.ash index 8c00b371e..b4f77a532 100644 --- a/RELEASE/scripts/autoscend/auto_util.ash +++ b/RELEASE/scripts/autoscend/auto_util.ash @@ -2236,6 +2236,16 @@ boolean isMusGuildStoreAvailable() return false; } +boolean isMystGuildStoreAvailable() { + if ($classes[Pastamancer, Sauceror] contains my_class() && guild_store_available()) { + return true; + } + if (my_class() == $class[Accordion Thief] && my_level() >= 9 && guild_store_available()) { + return true; + } + return false; +} + boolean isArmoryAvailable() { if(auto_my_path() == "Nuclear Autumn") diff --git a/RELEASE/scripts/autoscend/autoscend_header.ash b/RELEASE/scripts/autoscend/autoscend_header.ash index dac3896a9..c12d20d7d 100644 --- a/RELEASE/scripts/autoscend/autoscend_header.ash +++ b/RELEASE/scripts/autoscend/autoscend_header.ash @@ -873,6 +873,7 @@ boolean isFreeMonster(monster mon); //Defined in autoscend/auto_util.ash boolean isGalaktikAvailable(); //Defined in autoscend/auto_util.ash boolean isGeneralStoreAvailable(); //Defined in autoscend/auto_util.ash boolean isMusGuildStoreAvailable(); //Defined in autoscend/auto_util.ash +boolean isMystGuildStoreAvailable(); //Defined in autoscend/auto_util.ash boolean isArmoryAvailable(); //Defined in autoscend/auto_util.ash boolean isGhost(monster mon); //Defined in autoscend/auto_util.ash boolean isGuildClass(); //Defined in autoscend/auto_util.ash From f5060e582a057b60c770ad272a08575ded0685c8 Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Fri, 3 Jul 2020 22:25:07 -0600 Subject: [PATCH 32/52] Bean issue #459 (#460) rare infinite loop when trying to fix tracking error on magic bean planting --- RELEASE/scripts/autoscend/quests/level_10.ash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RELEASE/scripts/autoscend/quests/level_10.ash b/RELEASE/scripts/autoscend/quests/level_10.ash index dad14a3b5..7f343b729 100644 --- a/RELEASE/scripts/autoscend/quests/level_10.ash +++ b/RELEASE/scripts/autoscend/quests/level_10.ash @@ -2,7 +2,7 @@ script "level_10.ash" boolean L10_plantThatBean() { - if (internalQuestStatus("questL10Garbage") < 0 || internalQuestStatus("questL10Garbage") > 0) + if(internalQuestStatus("questL10Garbage") != 0) { return false; } @@ -11,8 +11,8 @@ boolean L10_plantThatBean() string page = visit_url("place.php?whichplace=plains"); if(contains_text(page, "place.php?whichplace=beanstalk")) { - auto_log_warning("I have no bean but I see a stalk here. Okies. I'm ok with that", "blue"); - visit_url("place.php?whichplace=beanstalk"); + auto_log_warning("I see the beanstalk has already been planted. fixing questL10Garbage to step1", "blue"); + set_property("questL10Garbage", "step1"); return true; } if(item_amount($item[Enchanted Bean]) > 0) From ee55efc51cc5d37455c3816ee0fd972b11aeccd7 Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Fri, 3 Jul 2020 21:29:19 -0700 Subject: [PATCH 33/52] Don't waste clovers if we have enough A-boo Clues to complete the peak (#467) --- RELEASE/scripts/autoscend/quests/level_9.ash | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/RELEASE/scripts/autoscend/quests/level_9.ash b/RELEASE/scripts/autoscend/quests/level_9.ash index 78d2ca605..c9c2c32df 100644 --- a/RELEASE/scripts/autoscend/quests/level_9.ash +++ b/RELEASE/scripts/autoscend/quests/level_9.ash @@ -321,8 +321,7 @@ boolean L9_aBooPeak() removeFromMaximize("-equip " + $item[Broken Champagne Bottle]); } - autoAdv(1, $location[A-Boo Peak]); - return true; + return autoAdv(1, $location[A-Boo Peak]); } boolean booCloversOk = false; @@ -341,6 +340,12 @@ boolean L9_aBooPeak() } } + if (get_property("auto_abooclover").to_boolean() && clueAmt >= get_property("booPeakProgress").to_int()/30) { + // if you get lucky/have enough item drop to get 3 clues while getting to 90% haunted, don't waste a clover getting more. + auto_log_info("We have enough A-boo clues to clear the peak, lets not waste a clover"); + set_property("auto_abooclover", false); + } + auto_log_info("A-Boo Peak: " + get_property("booPeakProgress"), "blue"); boolean clueCheck = ((clueAmt > 0) || (get_property("auto_aboopending").to_int() != 0)); if (get_property("auto_abooclover").to_boolean() && get_property("booPeakProgress").to_int() >= 30 && booCloversOk) From a140e990aac9fbcba492fb49459901002d172b8d Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Fri, 3 Jul 2020 21:42:44 -0700 Subject: [PATCH 34/52] add the Melodramedary to stat and regen familiars (#469) - move the non-IotM stat familiars below the IotM ones and put the Miniature Sword & Martini Guy below other item dropping Volleyballs as the drinks he gives are literally crappy. - Also add the Piranha Plant, Antique Nutcracker and Smiling Rat to the stat familiars. --- BUILD/familiars/regen.dat | 1 + BUILD/familiars/stat.dat | 15 ++++-- RELEASE/data/autoscend_familiars.txt | 80 +++++++++++++++------------- 3 files changed, 54 insertions(+), 42 deletions(-) diff --git a/BUILD/familiars/regen.dat b/BUILD/familiars/regen.dat index 9343401dc..3935f84fc 100644 --- a/BUILD/familiars/regen.dat +++ b/BUILD/familiars/regen.dat @@ -31,6 +31,7 @@ Star Starfish Garbage Fire Choctopus # Superwhelps +Melodramedary Plastic Pirate Skull Trick-or-Treating Tot # Fairywhelps diff --git a/BUILD/familiars/stat.dat b/BUILD/familiars/stat.dat index 58e1e2a28..e4e572676 100644 --- a/BUILD/familiars/stat.dat +++ b/BUILD/familiars/stat.dat @@ -13,9 +13,6 @@ Rockin' Robin prop:rockinRobinProgress>=25 Optimistic Candle prop:optimisticCandleProgress>=25 # Can be tuned to give pure mainstat, so it's better than other volleyballs Crimbo Shrub -# Free car fuel, or meat, or food/booze if we're really desperate -Party Mouse -Lil' Barrel Mimic # Volleyballs with a multiplier #Baby Mutant Rattlesnake grimdark:0 #Baby Mutant Rattlesnake grimdark:1 @@ -35,15 +32,23 @@ Hunchbacked Minion Nervous Tick Cymbal-Playing Monkey Cheshire Bat +# VolleyWhelps +Melodramedary # Might as well build up weight for free runs, even though I'm pretty sure we don't use them... Frumious Bandersnatch -# Fancy -Miniature Sword & Martini Guy # Slightly special volleyballs Reanimated Reanimator God Lobster +Party Mouse +Lil' Barrel Mimic +Piranha Plant +Antique Nutcracker +# Fancy +Miniature Sword & Martini Guy #Baby Mutant Rattlesnake grimdark:2 # Turtles are cute Grinning Turtle +# His winning smile +Smiling Rat # The original Blood-Faced Volleyball diff --git a/RELEASE/data/autoscend_familiars.txt b/RELEASE/data/autoscend_familiars.txt index 0e75bef55..f47d514e0 100644 --- a/RELEASE/data/autoscend_familiars.txt +++ b/RELEASE/data/autoscend_familiars.txt @@ -287,29 +287,30 @@ regen 14 Star Starfish regen 15 Garbage Fire regen 16 Choctopus # Superwhelps -regen 17 Plastic Pirate Skull -regen 18 Trick-or-Treating Tot +regen 17 Melodramedary +regen 18 Plastic Pirate Skull +regen 19 Trick-or-Treating Tot # Fairywhelps -regen 19 Dandy Lion +regen 20 Dandy Lion # Special whelps -regen 20 Ms. Puck Man -regen 21 Puck Man -regen 22 Squamous Gibberer -regen 23 He-Boulder -regen 24 Cotton Candy Carnie +regen 21 Ms. Puck Man +regen 22 Puck Man +regen 23 Squamous Gibberer +regen 24 He-Boulder +regen 25 Cotton Candy Carnie # Slightly better whelp for saucerors -regen 25 Pet Cheezling class:Sauceror +regen 26 Pet Cheezling class:Sauceror # Whelps with a multiplier, why not I guess #Mutant Gila Monster grimdark:0 #Mutant Gila Monster grimdark:1 # Marginally special whelps #Mutant Gila Monster grimdark:2 -regen 26 Pottery Barn Owl +regen 27 Pottery Barn Owl # Regular old whelps -regen 27 Pet Cheezling -regen 28 Ghuol Whelp +regen 28 Pet Cheezling +regen 29 Ghuol Whelp # The absolute default that everyone should have after their first run -regen 29 Mosquito +regen 30 Mosquito # Sombrero is desirable with a decent amount of ML stat 0 Galloping Grill ML:>=120 @@ -326,40 +327,45 @@ stat 7 Rockin' Robin prop:rockinRobinProgress>=25 stat 8 Optimistic Candle prop:optimisticCandleProgress>=25 # Can be tuned to give pure mainstat, so it's better than other volleyballs stat 9 Crimbo Shrub -# Free car fuel, or meat, or food/booze if we're really desperate -stat 10 Party Mouse -stat 11 Lil' Barrel Mimic # Volleyballs with a multiplier #Baby Mutant Rattlesnake grimdark:0 #Baby Mutant Rattlesnake grimdark:1 # Fairyballs -stat 12 Elf Operative -stat 13 Optimistic Candle -stat 14 Rockin' Robin +stat 10 Elf Operative +stat 11 Optimistic Candle +stat 12 Rockin' Robin # Volleychauns -stat 15 Golden Monkey -stat 16 Bloovian Groose -stat 17 Unconscious Collective -stat 18 Grim Brother -stat 19 Dramatic Hedgehog -stat 20 Chauvinist Pig -stat 21 Uniclops -stat 22 Hunchbacked Minion -stat 23 Nervous Tick -stat 24 Cymbal-Playing Monkey -stat 25 Cheshire Bat +stat 13 Golden Monkey +stat 14 Bloovian Groose +stat 15 Unconscious Collective +stat 16 Grim Brother +stat 17 Dramatic Hedgehog +stat 18 Chauvinist Pig +stat 19 Uniclops +stat 20 Hunchbacked Minion +stat 21 Nervous Tick +stat 22 Cymbal-Playing Monkey +stat 23 Cheshire Bat +# VolleyWhelps +stat 24 Melodramedary # Might as well build up weight for free runs, even though I'm pretty sure we don't use them... -stat 26 Frumious Bandersnatch -# Fancy -stat 27 Miniature Sword & Martini Guy +stat 25 Frumious Bandersnatch # Slightly special volleyballs -stat 28 Reanimated Reanimator -stat 29 God Lobster +stat 26 Reanimated Reanimator +stat 27 God Lobster +stat 28 Party Mouse +stat 29 Lil' Barrel Mimic +stat 30 Piranha Plant +stat 31 Antique Nutcracker +# Fancy +stat 32 Miniature Sword & Martini Guy #Baby Mutant Rattlesnake grimdark:2 # Turtles are cute -stat 30 Grinning Turtle +stat 33 Grinning Turtle +# His winning smile +stat 34 Smiling Rat # The original -stat 31 Blood-Faced Volleyball +stat 35 Blood-Faced Volleyball yellowray 0 Crimbo Shrub # Nanorhino and He-Boulder would require a bit of extra doing to make work From 00fc2e4274c6d69d19e3d7705edd2fd00e35ba23 Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Fri, 3 Jul 2020 22:43:14 -0600 Subject: [PATCH 35/52] cosmetics wraith not recognized as boss workaround (#468) workaround for cosmetics wraith not being recognized as a boss. which can crash autoscend if we waste an instakill on it, such as stomp boots. --- RELEASE/scripts/autoscend/auto_util.ash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE/scripts/autoscend/auto_util.ash b/RELEASE/scripts/autoscend/auto_util.ash index b4f77a532..2c125dd4a 100644 --- a/RELEASE/scripts/autoscend/auto_util.ash +++ b/RELEASE/scripts/autoscend/auto_util.ash @@ -2351,7 +2351,7 @@ boolean instakillable(monster mon) Sssshhsssblllrrggghsssssggggrrgglsssshhssslblgl, Eldritch Tentacle, // Other Monsters that Mafia returns as instakillable (or not a boss), that really aren't - Drunken Rat King + cosmetics wraith, Drunken Rat King ]; if(not_instakillable contains mon) From bd2ad14ee1fcedc27f509c1913d712cf698d0097 Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Fri, 3 Jul 2020 22:19:35 -0700 Subject: [PATCH 36/52] roll out automated mining for trapper ore to all (no longer public beta) (#466) - fix issue where the minelayout property could be empty causing an array out of bounds error in mafia - move non-combat handling for itznotyerzitzmine and the extreme slope to functions in level8.ash - deprecate the auto_mineForOres property. --- BUILD/settings/any.dat | 1 - RELEASE/data/autoscend_settings.txt | 7 +- RELEASE/scripts/autoscend/auto_choice_adv.ash | 82 +-------- .../scripts/autoscend/auto_deprecation.ash | 5 + .../scripts/autoscend/autoscend_header.ash | 12 +- RELEASE/scripts/autoscend/quests/level_8.ash | 170 ++++++++++++------ 6 files changed, 135 insertions(+), 142 deletions(-) diff --git a/BUILD/settings/any.dat b/BUILD/settings/any.dat index d9d55ab7d..63e0aa7f5 100644 --- a/BUILD/settings/any.dat +++ b/BUILD/settings/any.dat @@ -45,7 +45,6 @@ auto_spoonsign string What sign to change to with the hewn moon-rune spoon after auto_MLSafetyLimit integer If set this will be the (approximate) cap for +ML. WARNING: Certain conditions may require the script to exceed this by a small margin. For best results set this 10 below the maximum ML you can handle. auto_disregardInstantKarma boolean When true, the script will not scale back ML after reaching Level 13, if you also set auto_MLSafetyLimit to 999 the script will passively power level. WARNING: You are unlikely to get Instant Karma (This is useful if your run preceeds The Sea, The Basement, or Dungeons) auto_secondPlaceOrBust boolean When true, abort before each tower test if we can't get to second place. -auto_mineForOres boolean BETA: If true, will attempt to acquire the Mining Gear and then mine in Itznotyerzitzmine for Ore during level 8 quest auto_helpMeMafiaIsSuperBrokenAaah boolean Pretty much just for werebear. If for some reason you find that mafia completely fails to detect item drops occasionally, leading to wasting a ton of adventures continuing to look for an item you already found, try this out. auto_logLevel string One of: critical, error, warning, info, debug, trace. Sets the level of log output for autoscend gcli and session log output. Critical showing the least detail (only critical messages) and trace showing the most detail (print everything). Defaults to info. auto_restoreUseBloodBond boolean Whether to use extra hp to cast blood bond. Blood bond has a recurring HP drain, set to false if you are worried about getting killed or wasting resources healing. Defaults to false. diff --git a/RELEASE/data/autoscend_settings.txt b/RELEASE/data/autoscend_settings.txt index 265a3d48d..0c077756e 100644 --- a/RELEASE/data/autoscend_settings.txt +++ b/RELEASE/data/autoscend_settings.txt @@ -53,10 +53,9 @@ any 43 auto_spoonsign string What sign to change to with the hewn moon-rune spoo any 44 auto_MLSafetyLimit integer If set this will be the (approximate) cap for +ML. WARNING: Certain conditions may require the script to exceed this by a small margin. For best results set this 10 below the maximum ML you can handle. any 45 auto_disregardInstantKarma boolean When true, the script will not scale back ML after reaching Level 13, if you also set auto_MLSafetyLimit to 999 the script will passively power level. WARNING: You are unlikely to get Instant Karma (This is useful if your run preceeds The Sea, The Basement, or Dungeons) any 46 auto_secondPlaceOrBust boolean When true, abort before each tower test if we can't get to second place. -any 47 auto_mineForOres boolean BETA: If true, will attempt to acquire the Mining Gear and then mine in Itznotyerzitzmine for Ore during level 8 quest -any 48 auto_helpMeMafiaIsSuperBrokenAaah boolean Pretty much just for werebear. If for some reason you find that mafia completely fails to detect item drops occasionally, leading to wasting a ton of adventures continuing to look for an item you already found, try this out. -any 49 auto_logLevel string One of: critical, error, warning, info, debug, trace. Sets the level of log output for autoscend gcli and session log output. Critical showing the least detail (only critical messages) and trace showing the most detail (print everything). Defaults to info. -any 50 auto_restoreUseBloodBond boolean Whether to use extra hp to cast blood bond. Blood bond has a recurring HP drain, set to false if you are worried about getting killed or wasting resources healing. Defaults to false. +any 47 auto_helpMeMafiaIsSuperBrokenAaah boolean Pretty much just for werebear. If for some reason you find that mafia completely fails to detect item drops occasionally, leading to wasting a ton of adventures continuing to look for an item you already found, try this out. +any 48 auto_logLevel string One of: critical, error, warning, info, debug, trace. Sets the level of log output for autoscend gcli and session log output. Critical showing the least detail (only critical messages) and trace showing the most detail (print everything). Defaults to info. +any 49 auto_restoreUseBloodBond boolean Whether to use extra hp to cast blood bond. Blood bond has a recurring HP drain, set to false if you are worried about getting killed or wasting resources healing. Defaults to false. post 0 auto_getBeehive boolean Go for the beehive? post 1 auto_getStarKey boolean Get Richard's Star Key? diff --git a/RELEASE/scripts/autoscend/auto_choice_adv.ash b/RELEASE/scripts/autoscend/auto_choice_adv.ash index 7f758ec20..4473e5cc0 100644 --- a/RELEASE/scripts/autoscend/auto_choice_adv.ash +++ b/RELEASE/scripts/autoscend/auto_choice_adv.ash @@ -7,70 +7,14 @@ boolean auto_run_choice(int choice, string page) switch (choice) { case 15: // Yeti Nother Hippy (The eXtreme Slope) - if (possessEquipment($item[eXtreme mittens])) { - if (possessEquipment($item[eXtreme scarf])) { - run_choice(3); // get 200 Meat. - } else { - run_choice(2); // get eXtreme scarf - } - } else { - run_choice(1); // get eXtreme mittens - } - break; case 16: // Saint Beernard (The eXtreme Slope) - if (possessEquipment($item[snowboarder pants])) { - if (possessEquipment($item[eXtreme scarf])) { - run_choice(3); // get 200 Meat. - } else { - run_choice(2); // get eXtreme scarf - } - } else { - run_choice(1); // get snowboarder pants - } - break; case 17: // Generic Teen Comedy Snowboarding Adventure (The eXtreme Slope) - if (possessEquipment($item[eXtreme mittens])) { - if (possessEquipment($item[snowboarder pants])) { - run_choice(3); // get 200 Meat. - } else { - run_choice(2); // get snowboarder pants - } - } else { - run_choice(1); // get eXtreme mittens - } + theeXtremeSlopeChoiceHandler(choice); break; case 18: // A Flat Miner (Itznotyerzitz Mine) - if (possessEquipment($item[miner\'s pants])) { - if (possessEquipment($item[7-Foot Dwarven mattock])) { - run_choice(3); // get 100 Meat. - } else { - run_choice(2); // get 7-Foot Dwarven mattock - } - } else { - run_choice(1); // get miner's pants - } - break; case 19: // 100% Legal (Itznotyerzitz Mine) - if (possessEquipment($item[miner\'s helmet])) { - if (possessEquipment($item[miner\'s pants])) { - run_choice(3); // get 100 Meat. - } else { - run_choice(2); // get miner's pants - } - } else { - run_choice(1); // get miner's helmet - } - break; case 20: // See You Next Fall (Itznotyerzitz Mine) - if (possessEquipment($item[miner\'s helmet])) { - if (possessEquipment($item[7-Foot Dwarven mattock])) { - run_choice(3); // get 100 Meat. - } else { - run_choice(2); // get 7-Foot Dwarven mattock - } - } else { - run_choice(1); // get miner's helmet - } + itznotyerzitzMineChoiceHandler(choice); break; case 22: // The Arrrbitrator (The Obligatory Pirate's Cove) case 23: // Barrie Me at Sea (The Obligatory Pirate's Cove) @@ -187,22 +131,10 @@ boolean auto_run_choice(int choice, string page) } break; case 556: // More Locker Than Morlock (Itznotyerzitz Mine) - if (!possessOutfit("Mining Gear")) { - run_choice(1); // get an outfit piece - } else { - run_choice(2); // skip - } + itznotyerzitzMineChoiceHandler(choice); break; case 575: // Duffel on the Double (The eXtreme Slope) - if (!possessOutfit("eXtreme Cold-Weather Gear")) { - run_choice(1); // get an outfit piece - } else { - if (isActuallyEd()) { // add other paths which don't want to waste spleen (if any) here. - run_choice(3); // skip - } else { - run_choice(4); // Lucky Pill. (Clover for 1 spleen, worth?) - } - } + theeXtremeSlopeChoiceHandler(choice); break; case 780: // Action Elevator (The Hidden Apartment Building) if (auto_my_path() == "Pocket Familiars" && get_property("relocatePygmyLawyer").to_int() != my_ascensions()) { @@ -460,15 +392,15 @@ boolean auto_run_choice(int choice, string page) search = "I'd like some experience."; } - int choice = 0; + int glchoice = 0; foreach idx, str in available_choice_options() { if(contains_text(str,search)) { - choice = idx; + glchoice = idx; } } - run_choice(choice); + run_choice(glchoice); break; case 1340: // Is There A Doctor In The House? (Lil' Doctor Bag™) auto_log_info("Accepting doctor quest, it's our job!"); diff --git a/RELEASE/scripts/autoscend/auto_deprecation.ash b/RELEASE/scripts/autoscend/auto_deprecation.ash index 9f5ce1de2..4b8621d33 100644 --- a/RELEASE/scripts/autoscend/auto_deprecation.ash +++ b/RELEASE/scripts/autoscend/auto_deprecation.ash @@ -506,6 +506,11 @@ boolean settingFixer() { remove_property("auto_skipDesert"); } + + if (property_exists("auto_mineForOres")) { + auto_log_debug("Automated Ore mining in hardcore is now for everyone!", "red"); + remove_property("auto_mineForOres"); + } return true; } diff --git a/RELEASE/scripts/autoscend/autoscend_header.ash b/RELEASE/scripts/autoscend/autoscend_header.ash index c12d20d7d..2c6f3a96a 100644 --- a/RELEASE/scripts/autoscend/autoscend_header.ash +++ b/RELEASE/scripts/autoscend/autoscend_header.ash @@ -22,7 +22,6 @@ boolean LM_edTheUndying(); //Defined in autoscend/auto_edTheUndying.ash boolean LX_desertAlternate(); boolean LX_hippyBoatman(); -void oldLandfillChoiceHandler(int choice); boolean LX_lockPicking(); boolean LX_phatLootToken(); boolean LX_islandAccess(); @@ -32,11 +31,8 @@ boolean LX_ornateDowsingRod(boolean doing_desert_now); //Defined in autoscend/io boolean LX_nastyBooty(); boolean LX_guildUnlock(); boolean LX_pirateOutfit(); -void piratesCoveChoiceHandler(int choice); boolean LX_joinPirateCrew(); -void barrrneysBarrrChoiceHandler(int choice, string page); boolean LX_fledglingPirateIsYou(); -void fcleChoiceHandler(int choice); boolean LX_unlockBelowdecks(); boolean LX_pirateQuest(); boolean LX_acquireLegendaryEpicWeapon(); @@ -1273,3 +1269,11 @@ location[int] zones_available(); //Defined in autoscend/auto_zone.ash monster[int] mobs_available(); //Defined in autoscend/auto_zone.ash item[int] drops_available(); //Defined in autoscend/auto_zone.ash item[int] hugpocket_available(); //Defined in autoscend/auto_zone.ash + +// functions for handling choice adventures. Only ever called from auto_choice_adv.ash +void oldLandfillChoiceHandler(int choice); +void piratesCoveChoiceHandler(int choice); +void barrrneysBarrrChoiceHandler(int choice, string page); +void fcleChoiceHandler(int choice); +void itznotyerzitzMineChoiceHandler(int choice); +void theeXtremeSlopeChoiceHandler(int choice); diff --git a/RELEASE/scripts/autoscend/quests/level_8.ash b/RELEASE/scripts/autoscend/quests/level_8.ash index 097db43c5..9dc16d0a5 100644 --- a/RELEASE/scripts/autoscend/quests/level_8.ash +++ b/RELEASE/scripts/autoscend/quests/level_8.ash @@ -31,25 +31,26 @@ int getCellToMine(item oreGoal) { } item[int] parseMineLayout() { - - string[int] splitted = split_string(get_property("mineLayout1").substring(1), "#"); - + item[int] minedCells; - foreach iter, str in splitted { - if (str.contains_text("asbestos ore")) { - minedCells[str.substring(0,2).to_int()] = $item[asbestos ore]; - } else if (str.contains_text("chrome ore")) { - minedCells[str.substring(0,2).to_int()] = $item[chrome ore]; - } else if (str.contains_text("linoleum ore")) { - minedCells[str.substring(0,2).to_int()] = $item[linoleum ore]; - } else if (str.contains_text("loadstone")) { - minedCells[str.substring(0,2).to_int()] = $item[loadstone]; - } else if (str.contains_text("lump of diamond")) { - minedCells[str.substring(0,2).to_int()] = $item[lump of diamond]; - } else if (str.contains_text("meat stack")) { - minedCells[str.substring(0,2).to_int()] = $item[meat stack]; - } else if (str.contains_text("stone of eXtreme power")) { - minedCells[str.substring(0,2).to_int()] = $item[stone of eXtreme power]; + string mineLayout = get_property("mineLayout1"); + if (mineLayout != "") { + foreach iter, str in split_string(mineLayout.substring(1), "#") { + if (str.contains_text("asbestos ore")) { + minedCells[str.substring(0,2).to_int()] = $item[asbestos ore]; + } else if (str.contains_text("chrome ore")) { + minedCells[str.substring(0,2).to_int()] = $item[chrome ore]; + } else if (str.contains_text("linoleum ore")) { + minedCells[str.substring(0,2).to_int()] = $item[linoleum ore]; + } else if (str.contains_text("loadstone")) { + minedCells[str.substring(0,2).to_int()] = $item[loadstone]; + } else if (str.contains_text("lump of diamond")) { + minedCells[str.substring(0,2).to_int()] = $item[lump of diamond]; + } else if (str.contains_text("meat stack")) { + minedCells[str.substring(0,2).to_int()] = $item[meat stack]; + } else if (str.contains_text("stone of eXtreme power")) { + minedCells[str.substring(0,2).to_int()] = $item[stone of eXtreme power]; + } } } return minedCells; @@ -163,7 +164,7 @@ int getCellToMine(item oreGoal) { while (count(potentialCells) == 0 && rowLimit < 5) { foreach oreCell in oreSeen { int[4] orthogonals = getOrthogonals(oreCell); - foreach orthoPos, orthoCell in orthogonals { + foreach _, orthoCell in orthogonals { if (canMine(orthoCell, rowLimit) && sparklingCells contains orthoCell) { potentialCells[potentialCount] = orthoCell; potentialCount++; @@ -184,7 +185,7 @@ int getCellToMine(item oreGoal) { } // now add all twinkling cells adjacent to the loadstone in the top 4 rows to the potential cells int[4] orthogonals = getOrthogonals(loadstoneCell); - foreach orthoPos, orthoCell in orthogonals { + foreach _, orthoCell in orthogonals { if (canMine(orthoCell, 4) && sparklingCells contains orthoCell) { potentialCells[potentialCount] = orthoCell; potentialCount++; @@ -203,43 +204,6 @@ int getCellToMine(item oreGoal) { return potentialCells[random(numPotentials)]; } -void auto_testMining(item oreGoal) { - // use this to test in aftercore. Will mine 3 ores of whatever type you pass e.g. - // ash import auto_testMining($item[linoleum ore]); - // I'd recommend equipping some HP regen stuff in slots not needed by the Mining Gear - // Shark Jumper & 1-3 Heart of the Volcano works well - if (!possessOutfit("Mining Gear")) - { - return; - } - outfit("Mining Gear"); - int startingAmount = item_amount(oreGoal); - remove_property("auto_minedCells"); - - matcher openCheck = create_matcher("Open Cavern \\(\\d,6\\)", visit_url("mining.php?mine=1")); - if (openCheck.find()) { - auto_log_info("Resetting mine (doesn't cost an adventure)"); - visit_url("mining.php?mine=1&reset=1&pwd"); - } - - int advCount = 0; - while (item_amount(oreGoal) < startingAmount + 3) { - int cell = getCellToMine(oreGoal); - if (cell != 0) { - set_property("auto_minedCells", get_property("auto_minedCells") + cell.to_string() + ","); - visit_url("mining.php?mine=1&which=" + cell.to_string() + "&pwd"); - advCount++; - if (my_hp() == 0) { - acquireHP(1); - } - } else { - auto_log_info("Something went wrong."); - break; - } - } - auto_log_info("Found 3 " + oreGoal.to_string() + " in " + advCount.to_string() + " adventures."); -} - boolean L8_trapperAdvance() { if (internalQuestStatus("questL08Trapper") < 0 || internalQuestStatus("questL08Trapper") > 1) @@ -346,7 +310,7 @@ boolean L8_getMineOres() cloverUsageFinish(); return true; } - } else if (get_property("auto_mineForOres").to_boolean()) { + } else { if (!possessOutfit("Mining Gear")) { auto_log_info("Getting Mining Gear.", "blue"); providePlusNonCombat(25); @@ -367,6 +331,49 @@ boolean L8_getMineOres() return false; } +void itznotyerzitzMineChoiceHandler(int choice) { + auto_log_info("itznotyerzitzMineChoiceHandler Running choice " + choice, "blue"); + if (choice == 18) { // A Flat Miner + if (possessEquipment($item[miner\'s pants])) { + if (possessEquipment($item[7-Foot Dwarven mattock])) { + run_choice(3); // get 100 Meat. + } else { + run_choice(2); // get 7-Foot Dwarven mattock + } + } else { + run_choice(1); // get miner's pants + } + } else if (choice == 19) { // 100% Legal + if (possessEquipment($item[miner\'s helmet])) { + if (possessEquipment($item[miner\'s pants])) { + run_choice(3); // get 100 Meat. + } else { + run_choice(2); // get miner's pants + } + } else { + run_choice(1); // get miner's helmet + } + } else if (choice == 20) { // See You Next Fall + if (possessEquipment($item[miner\'s helmet])) { + if (possessEquipment($item[7-Foot Dwarven mattock])) { + run_choice(3); // get 100 Meat. + } else { + run_choice(2); // get 7-Foot Dwarven mattock + } + } else { + run_choice(1); // get miner's helmet + } + } else if (choice == 556) { // More Locker Than Morlock + if (!possessOutfit("Mining Gear")) { + run_choice(1); // get an outfit piece + } else { + run_choice(2); // skip + } + } else { + abort("unhandled choice in itznotyerzitzMineChoiceHandler"); + } +} + boolean L8_trapperGround() { if (internalQuestStatus("questL08Trapper") < 0 || internalQuestStatus("questL08Trapper") > 1) @@ -407,6 +414,53 @@ boolean L8_trapperExtreme() return autoAdv($location[The eXtreme Slope]); } +void theeXtremeSlopeChoiceHandler(int choice) { + auto_log_info("theeXtremeSlopeChoiceHandler Running choice " + choice, "blue"); + if (choice == 15) { // Yeti Nother Hippy + if (possessEquipment($item[eXtreme mittens])) { + if (possessEquipment($item[eXtreme scarf])) { + run_choice(3); // get 200 Meat. + } else { + run_choice(2); // get eXtreme scarf + } + } else { + run_choice(1); // get eXtreme mittens + } + } else if (choice == 16) { // Saint Beernard + if (possessEquipment($item[snowboarder pants])) { + if (possessEquipment($item[eXtreme scarf])) { + run_choice(3); // get 200 Meat. + } else { + run_choice(2); // get eXtreme scarf + } + } else { + run_choice(1); // get snowboarder pants + } + } else if (choice == 17) { // Generic Teen Comedy Snowboarding Adventure + if (possessEquipment($item[eXtreme mittens])) { + if (possessEquipment($item[snowboarder pants])) { + run_choice(3); // get 200 Meat. + } else { + run_choice(2); // get snowboarder pants + } + } else { + run_choice(1); // get eXtreme mittens + } + } else if (choice == 575) { // Duffel on the Double + if (!possessOutfit("eXtreme Cold-Weather Gear")) { + run_choice(1); // get an outfit piece + } else { + if (isActuallyEd()) { // add other paths which don't want to waste spleen (if any) here. + run_choice(3); // skip + } else { + run_choice(4); // Lucky Pill. (Clover for 1 spleen, worth?) + } + } + } else { + abort("unhandled choice in theeXtremeSlopeChoiceHandler"); + } +} + boolean L8_trapperNinjaLair() { if (internalQuestStatus("questL08Trapper") != 2) From 4c4871ea85c57d0b7c34cb2858a55c50d2cd260d Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Sat, 4 Jul 2020 20:56:36 -0600 Subject: [PATCH 37/52] get clovers on dependence day from green rocket (#471) --- RELEASE/scripts/autoscend.ash | 1 + .../scripts/autoscend/autoscend_header.ash | 3 ++- .../scripts/autoscend/quests/level_any.ash | 26 +++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/RELEASE/scripts/autoscend.ash b/RELEASE/scripts/autoscend.ash index 55fd654fd..4fadcba47 100644 --- a/RELEASE/scripts/autoscend.ash +++ b/RELEASE/scripts/autoscend.ash @@ -2609,6 +2609,7 @@ boolean LX_hardcoreFoodFarm() boolean LX_craftAcquireItems() { + dependenceDayClovers(); if((item_amount($item[Ten-Leaf Clover]) > 0) && glover_usable($item[Ten-Leaf Clover])) { use(item_amount($item[Ten-Leaf Clover]), $item[Ten-Leaf Clover]); diff --git a/RELEASE/scripts/autoscend/autoscend_header.ash b/RELEASE/scripts/autoscend/autoscend_header.ash index 2c6f3a96a..da1b2ccbf 100644 --- a/RELEASE/scripts/autoscend/autoscend_header.ash +++ b/RELEASE/scripts/autoscend/autoscend_header.ash @@ -41,7 +41,8 @@ boolean LX_melvignShirt(); boolean LX_attemptPowerLevel(); boolean LX_attemptFlyering(); boolean LX_bitchinMeatcar(); -boolean LX_meatMaid(); +boolean LX_meatMaid(); //Defined in autoscend/quests/level_any.ash +boolean dependenceDayClovers(); //Defined in autoscend/quests/level_any.ash boolean LX_craftAcquireItems(); boolean LX_freeCombats(); boolean LX_freeCombats(boolean powerlevel); diff --git a/RELEASE/scripts/autoscend/quests/level_any.ash b/RELEASE/scripts/autoscend/quests/level_any.ash index d51ae599d..7169d133b 100644 --- a/RELEASE/scripts/autoscend/quests/level_any.ash +++ b/RELEASE/scripts/autoscend/quests/level_any.ash @@ -515,3 +515,29 @@ boolean LX_meatMaid() } return false; } + +boolean dependenceDayClovers() +{ + if(get_property("_fireworkUsed").to_boolean()) + { + return false; //only 1 firework per day allowed + } + if(holiday() != "Dependence Day") + { + return false; //it is not dependence day today + } + + auto_log_info("Today is Dependence Day and I want to use a [green rocket] for some clovers", "green"); + if(item_amount($item[green rocket]) == 0 && my_meat() < npc_price($item[green rocket])) + { + auto_log_info("I can't afford a [green rocket]. I will try again later"); + return false; + } + + buyUpTo(1, $item[green rocket]); + if(item_amount($item[green rocket]) > 0) + { + return use(1, $item[green rocket]); + } + return false; +} \ No newline at end of file From b967647c02eecae7a64dab1973cb7913d4908c66 Mon Sep 17 00:00:00 2001 From: Patrick Hulin Date: Sun, 5 Jul 2020 23:38:45 -0400 Subject: [PATCH 38/52] Ensure skill restores and item restores are being compared correctly. (#474) * Fully integrate new meat cost for restore skills. --- RELEASE/scripts/autoscend/auto_restore.ash | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/RELEASE/scripts/autoscend/auto_restore.ash b/RELEASE/scripts/autoscend/auto_restore.ash index 972488d50..0f49a3759 100644 --- a/RELEASE/scripts/autoscend/auto_restore.ash +++ b/RELEASE/scripts/autoscend/auto_restore.ash @@ -600,17 +600,19 @@ __RestorationOptimization __calculate_objective_values(int hp_goal, int mp_goal, } float total_meat_used(){ - if(metadata.type != "item"){ + if(metadata.type != "item" && metadata.type != "skill"){ return -1.0; } - item i = to_item(metadata.name); - float needed = max(0.0, total_uses_needed() - item_amount(i)); - int price = npc_price(i); - if(can_interact()){ - price = min(price, auto_mall_price(i)); + float needed; + if(metadata.type == "item") { + item i = to_item(metadata.name); + needed = max(0.0, total_uses_needed() - item_amount(i)); + } else if (metadata.type == "skill"){ + needed = total_uses_needed(); } - if(price == 0){ + float price = get_value("meat_per_use"); + if(price < 0.001){ return -1.0; } return price * needed; From 6618a6cd0fb7f3a126cf79cb35ef1979480e25cb Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Sun, 5 Jul 2020 22:04:30 -0600 Subject: [PATCH 39/52] only equip ring of boring doors when its needed (5th and 10th turn) (#473) --- RELEASE/scripts/autoscend/quests/level_any.ash | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/RELEASE/scripts/autoscend/quests/level_any.ash b/RELEASE/scripts/autoscend/quests/level_any.ash index 7169d133b..134bc367f 100644 --- a/RELEASE/scripts/autoscend/quests/level_any.ash +++ b/RELEASE/scripts/autoscend/quests/level_any.ash @@ -384,7 +384,10 @@ boolean LX_phatLootToken() auto_log_info("Phat Loot Token Get!", "blue"); set_property("choiceAdventure691", "2"); - autoEquip($slot[acc3], $item[Ring Of Detect Boring Doors]); + if(get_property("_lastDailyDungeonRoom").to_int() == 4 || get_property("_lastDailyDungeonRoom").to_int() == 9) + { + autoEquip($slot[acc3], $item[Ring Of Detect Boring Doors]); + } backupSetting("choiceAdventure692", 4); if(item_amount($item[Platinum Yendorian Express Card]) > 0) @@ -425,7 +428,7 @@ boolean LX_phatLootToken() { backupSetting("choiceAdventure693", 1); } - if(equipped_amount($item[Ring of Detect Boring Doors]) > 0) + if(possessEquipment($item[Ring of Detect Boring Doors])) { backupSetting("choiceAdventure690", 2); backupSetting("choiceAdventure691", 2); @@ -438,10 +441,6 @@ boolean LX_phatLootToken() autoAdv(1, $location[The Daily Dungeon]); - if(possessEquipment($item[Ring Of Detect Boring Doors])) - { - cli_execute("unequip acc3"); - } restoreSetting("choiceAdventure690"); restoreSetting("choiceAdventure691"); restoreSetting("choiceAdventure692"); From 4ae20a1cf6ca8e045c35478578e0b2216e99c170 Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Tue, 7 Jul 2020 00:02:22 -0700 Subject: [PATCH 40/52] fix MCD flip flopping when not set to max (#476) --- RELEASE/scripts/autoscend/auto_util.ash | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RELEASE/scripts/autoscend/auto_util.ash b/RELEASE/scripts/autoscend/auto_util.ash index 2c125dd4a..7ecb6c4dd 100644 --- a/RELEASE/scripts/autoscend/auto_util.ash +++ b/RELEASE/scripts/autoscend/auto_util.ash @@ -3677,12 +3677,14 @@ boolean auto_change_mcd(int mcd, boolean immediately) } mcd = min(mcd, best); int next = max(0, mcd); + + set_property("auto_mcd_target", next); // if we return without setting this, we will flip-flop the mcd every adventure... + if(next == current_mcd()) { return true; } - set_property("auto_mcd_target", next); if(immediately) { return change_mcd(next); From c38a25e9e135f775d32a464c26b27d0897bf87d6 Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Tue, 7 Jul 2020 00:21:22 -0700 Subject: [PATCH 41/52] fix lynyrd protestors amount calculating less than it should when wearing lynyrd equipment. (#478) --- RELEASE/scripts/autoscend/quests/level_11.ash | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/RELEASE/scripts/autoscend/quests/level_11.ash b/RELEASE/scripts/autoscend/quests/level_11.ash index 5b8bc8d55..887441f89 100644 --- a/RELEASE/scripts/autoscend/quests/level_11.ash +++ b/RELEASE/scripts/autoscend/quests/level_11.ash @@ -1744,8 +1744,7 @@ boolean L11_redZeppelin() float lynyrd_protestors = have_effect($effect[Musky]) > 0 ? 6 : 3; foreach it in $items[lynyrdskin cap, lynyrdskin tunic, lynyrdskin breeches] { - if((item_amount(it) > 0) && can_equip(it)) - { + if (possessEquipment(it) && can_equip(it)) { lynyrd_protestors += 5; } } From 7cf85b57523d219ff058c08d5a61df9dac91f068 Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Tue, 7 Jul 2020 01:22:39 -0600 Subject: [PATCH 42/52] Pull all in post ronin (#475) *in casual and postronin pull all items from hangk as you can *move auto_casual.ash to /paths/casual.ash --- RELEASE/scripts/autoscend.ash | 3 ++- RELEASE/scripts/autoscend/autoscend_header.ash | 7 ++++--- .../{auto_casual.ash => paths/casual.ash} | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+), 4 deletions(-) rename RELEASE/scripts/autoscend/{auto_casual.ash => paths/casual.ash} (52%) diff --git a/RELEASE/scripts/autoscend.ash b/RELEASE/scripts/autoscend.ash index 4fadcba47..b6036f91b 100644 --- a/RELEASE/scripts/autoscend.ash +++ b/RELEASE/scripts/autoscend.ash @@ -14,7 +14,6 @@ import import import -import import import import @@ -45,6 +44,7 @@ import import import import +import import import import @@ -3226,6 +3226,7 @@ boolean doTasks() if(LM_majora()) return true; if(LM_batpath()) return true; if(doHRSkills()) return true; + if(LM_canInteract()) return true; if(auto_my_path() != "Community Service") { diff --git a/RELEASE/scripts/autoscend/autoscend_header.ash b/RELEASE/scripts/autoscend/autoscend_header.ash index da1b2ccbf..7f9051eec 100644 --- a/RELEASE/scripts/autoscend/autoscend_header.ash +++ b/RELEASE/scripts/autoscend/autoscend_header.ash @@ -526,9 +526,10 @@ boolean containsCombat(item it); //Defined in autoscend/auto_combat.ash boolean containsCombat(skill sk); //Defined in autoscend/auto_combat.ash boolean containsCombat(string action); //Defined in autoscend/auto_combat.ash -boolean inCasual(); //Defined in autoscend/auto_casual.ash -boolean inAftercore(); //Defined in autoscend/auto_casual.ash -boolean inPostRonin(); //Defined in autoscend/auto_casual.ash +boolean inCasual(); //Defined in autoscend/paths/casual.ash +boolean inAftercore(); //Defined in autoscend/paths/casual.ash +boolean inPostRonin(); //Defined in autoscend/paths/casual.ash +boolean LM_canInteract(); //Defined in autoscend/paths/casual.ash string cs_combatKing(int round, string opp, string text); //Defined in autoscend/auto_community_service.ash string cs_combatLTB(int round, string opp, string text); //Defined in autoscend/auto_community_service.ash diff --git a/RELEASE/scripts/autoscend/auto_casual.ash b/RELEASE/scripts/autoscend/paths/casual.ash similarity index 52% rename from RELEASE/scripts/autoscend/auto_casual.ash rename to RELEASE/scripts/autoscend/paths/casual.ash index 76d413fdd..aed770fbe 100644 --- a/RELEASE/scripts/autoscend/auto_casual.ash +++ b/RELEASE/scripts/autoscend/paths/casual.ash @@ -21,5 +21,23 @@ boolean inPostRonin() { return true; } + return false; +} + +boolean LM_canInteract() +{ + //this function is called early once every loop of doTasks() in autoscend.ash to do things when we have unlimited mall access + //which indicates postronin or casual or aftercore. currently won't get called in aftercore + + if(!can_interact()) + { + return false; + } + + if(get_property("lastEmptiedStorage").to_int() != my_ascensions()) + { + cli_execute("pull all"); + } + return false; } \ No newline at end of file From d6ff36c208b63c662980c50fc3db811345c56dcf Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Sun, 21 Jun 2020 15:38:42 -0600 Subject: [PATCH 43/52] *issue #400 running half the -combat zone adventures without -combat gear equipped *limit the amount of maximizer combinations check to 100k, which will only be encountered in casual and postronin --- RELEASE/scripts/autoscend.ash | 1 + RELEASE/scripts/autoscend/auto_util.ash | 75 ++++++++++++++----------- 2 files changed, 43 insertions(+), 33 deletions(-) diff --git a/RELEASE/scripts/autoscend.ash b/RELEASE/scripts/autoscend.ash index b6036f91b..b71ac5915 100644 --- a/RELEASE/scripts/autoscend.ash +++ b/RELEASE/scripts/autoscend.ash @@ -3560,6 +3560,7 @@ void auto_begin() backupSetting("removeMalignantEffects", false); backupSetting("autoAntidote", 0); backupSetting("dontStopForCounters", true); + backupSetting("maximizerCombinationLimit", "100000"); backupSetting("kingLiberatedScript", "scripts/autoscend/auto_king.ash"); backupSetting("afterAdventureScript", "scripts/autoscend/auto_post_adv.ash"); diff --git a/RELEASE/scripts/autoscend/auto_util.ash b/RELEASE/scripts/autoscend/auto_util.ash index 7ecb6c4dd..4003d4472 100644 --- a/RELEASE/scripts/autoscend/auto_util.ash +++ b/RELEASE/scripts/autoscend/auto_util.ash @@ -2724,10 +2724,21 @@ boolean providePlusCombat(int amt, boolean doEquips) { return true; } + boolean forbid_extra = true; + if(amt >= 25) + { + forbid_extra = false; //do we want to stop when there are FREE methods to raise it further + } - //we do not need to repeatedly simulate equipment. do it once now and a second time if we change the maximizer string. - simMaximize(); + //equipment handling + if(doEquips) + { + //to prevent flipflop resulting in failing 50% of the turns we always do this first. see issue #400 + addToMaximize("200combat " + to_string(amt) + "max"); + } + simMaximize(); //we do not want to repeatedly simulate equipment. simulate it once only. int equipDiff = to_int(simValue("Combat Rate") - numeric_modifier("Combat Rate")); + boolean are_we_done() { if(numeric_modifier("Combat Rate").to_int() + equipDiff >= amt) @@ -2737,28 +2748,23 @@ boolean providePlusCombat(int amt, boolean doEquips) return false; } + if(forbid_extra && are_we_done()) return true; //did equipment reach goal. + + //you can toggle this effect between -combat and +combat for free without limit if(have_effect($effect[Become Superficially Interested]) > 0) { visit_url("charsheet.php?pwd=&action=newyouinterest"); - if(are_we_done()) return true; + if(forbid_extra && are_we_done()) return true; } -// foreach eff in $effects[Driving Stealthily, The Sonata of Sneakiness, Patent Invisibility, Shelter of Shed] + //free to uneffect foreach eff in $effects[Driving Stealthily, The Sonata of Sneakiness] { uneffect(eff); - if(are_we_done()) return true; - } - - if(doEquips) - { - addToMaximize("200combat " + to_string(amt) + "max"); - //update our equipDiff value since we changed maximizer string - simMaximize(); - equipDiff = to_int(simValue("Combat Rate") - numeric_modifier("Combat Rate")); - if(are_we_done()) return true; + if(forbid_extra && are_we_done()) return true; } + //now we have reached effects that actually have a cost shrugAT($effect[Carlweather\'s Cantata Of Confrontation]); //remove an AT buff so we have room for Cantata Of Confrontation foreach eff in $effects[Musk of the Moose, Carlweather\'s Cantata of Confrontation, Blinking Belly, Song of Battle, Frown, Angry, Screaming! \ SCREAMING! \ AAAAAAAH!] { @@ -2785,6 +2791,8 @@ boolean providePlusCombat(int amt, boolean doEquips) asdonBuff($effect[Driving Obnoxiously]); if(are_we_done()) return true; + //Patent Invisibility & Shelter of Shed are not free to uneffect. but should be handled somehow. + // only return false if we don't have a positive combat rate. if (numeric_modifier("Combat Rate").to_int() + equipDiff > 0) { return true; @@ -2798,11 +2806,22 @@ boolean providePlusNonCombat(int amt, boolean doEquips) { return true; } + boolean forbid_extra = true; + if(amt >= 25) + { + forbid_extra = false; //do we want to stop when there are FREE methods to raise it further + } amt = -1 * amt; - //we do not need to repeatedly simulate equipment. do it once now and a second time if we change the maximizer string. - simMaximize(); + //equipment handling + if(doEquips) + { + //to prevent flipflop resulting in failing 50% of the turns we always do this first. see issue #400 + addToMaximize("-200combat " + to_string(-1 * amt) + "max"); + } + simMaximize(); //we do not want to repeatedly simulate equipment. simulate it once only. int equipDiff = to_int(simValue("Combat Rate") - numeric_modifier("Combat Rate")); + boolean are_we_done() { if(numeric_modifier("Combat Rate").to_int() + equipDiff <= amt) @@ -2811,34 +2830,24 @@ boolean providePlusNonCombat(int amt, boolean doEquips) } return false; } + + if(forbid_extra && are_we_done()) return true; //did equipment reach goal. + //you can toggle this effect between -combat and +combat for free without limit if(have_effect($effect[Become Intensely Interested]) > 0) { visit_url("charsheet.php?pwd=&action=newyouinterest"); - if(are_we_done()) return true; + if(forbid_extra && are_we_done()) return true; } + //free to uneffect foreach eff in $effects[Carlweather\'s Cantata Of Confrontation, Driving Obnoxiously] { uneffect(eff); - if(are_we_done()) return true; - } - - if(doEquips) - { - addToMaximize("-200combat " + to_string(-1 * amt) + "max"); - //update our equipDiff value since we changed maximizer string - simMaximize(); - equipDiff = to_int(simValue("Combat Rate") - numeric_modifier("Combat Rate")); - if(are_we_done()) return true; - } - - foreach eff in $effects[Patent Invisibility] - { - buffMaintain(eff, 0, 1, 1); - if(are_we_done()) return true; + if(forbid_extra && are_we_done()) return true; } + //now we have reached effects that actually have a cost shrugAT($effect[The Sonata of Sneakiness]); //remove an AT buff so we have room for sonata of sneakiness foreach eff in $effects[Shelter Of Shed, Brooding, Muffled, Smooth Movements, The Sonata of Sneakiness, Song of Solitude, Inked Well, Bent Knees, Extended Toes, Ink Cloud, Patent Invisibility, Cloak of Shadows] { From 576c8985d217540f9149981b985d2628259d4be3 Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Tue, 7 Jul 2020 02:30:51 -0700 Subject: [PATCH 44/52] rewrite providePlusCombat and providePlusNonCombat (#477) * rewrite providePlusCombat and providePlusNonCombat so they use the same pattern as the other providers --- RELEASE/scripts/autoscend/auto_util.ash | 400 ++++++++++++------ .../scripts/autoscend/autoscend_header.ash | 2 + 2 files changed, 265 insertions(+), 137 deletions(-) diff --git a/RELEASE/scripts/autoscend/auto_util.ash b/RELEASE/scripts/autoscend/auto_util.ash index 4003d4472..3ffbe9225 100644 --- a/RELEASE/scripts/autoscend/auto_util.ash +++ b/RELEASE/scripts/autoscend/auto_util.ash @@ -2709,189 +2709,304 @@ boolean acquireCombatMods(int amt, boolean doEquips) } -boolean providePlusCombat(int amt) -{ - return providePlusCombat(amt, true); -} -boolean providePlusNonCombat(int amt) -{ - return providePlusNonCombat(amt, true); -} +float providePlusCombat(int amt, boolean doEquips, boolean speculative) { + auto_log_info((speculative ? "Checking if we can" : "Trying to") + " provide " + amt + " positive combat rate, " + (doEquips ? "with" : "without") + " equipment", "blue"); -boolean providePlusCombat(int amt, boolean doEquips) -{ - if(amt == 0) - { - return true; - } - boolean forbid_extra = true; - if(amt >= 25) - { - forbid_extra = false; //do we want to stop when there are FREE methods to raise it further + float alreadyHave = numeric_modifier("Combat Rate"); + float need = amt - alreadyHave; + + if (need > 0) { + auto_log_debug("We currently have " + alreadyHave + ", so we need an extra " + need); + } else { + auto_log_debug("We already have enough!"); } - - //equipment handling - if(doEquips) - { - //to prevent flipflop resulting in failing 50% of the turns we always do this first. see issue #400 - addToMaximize("200combat " + to_string(amt) + "max"); + + float delta = 0; + + float result() { + return numeric_modifier("Combat Rate") + delta; } - simMaximize(); //we do not want to repeatedly simulate equipment. simulate it once only. - int equipDiff = to_int(simValue("Combat Rate") - numeric_modifier("Combat Rate")); - boolean are_we_done() - { - if(numeric_modifier("Combat Rate").to_int() + equipDiff >= amt) - { - return true; + if (doEquips) { + string max = "200combat " + amt + "max"; + if (speculative) { + simMaximizeWith(max); + } else { + addToMaximize(max); + simMaximize(); } - return false; + delta = simValue("Combat Rate") - numeric_modifier("Combat Rate"); + auto_log_debug("With gear we can get to " + result()); } + + boolean pass() { + return result() >= amt; + } + + if(pass()) { + return result(); + } + + // first lets do stuff that is "free" (as in has no MP cost, item use or can be freely removed/toggled) - if(forbid_extra && are_we_done()) return true; //did equipment reach goal. - - //you can toggle this effect between -combat and +combat for free without limit - if(have_effect($effect[Become Superficially Interested]) > 0) - { + if (have_effect($effect[Become Superficially Interested]) > 0) { visit_url("charsheet.php?pwd=&action=newyouinterest"); - if(forbid_extra && are_we_done()) return true; + if(pass()) { + return result(); + } } - - //free to uneffect - foreach eff in $effects[Driving Stealthily, The Sonata of Sneakiness] - { + + foreach eff in $effects[Driving Stealthily, The Sonata of Sneakiness] { uneffect(eff); - if(forbid_extra && are_we_done()) return true; + if(pass()) { + return result(); + } } - - //now we have reached effects that actually have a cost - shrugAT($effect[Carlweather\'s Cantata Of Confrontation]); //remove an AT buff so we have room for Cantata Of Confrontation - foreach eff in $effects[Musk of the Moose, Carlweather\'s Cantata of Confrontation, Blinking Belly, Song of Battle, Frown, Angry, Screaming! \ SCREAMING! \ AAAAAAAH!] - { - buffMaintain(eff, 0, 1, 1); - if(are_we_done()) return true; + + if (get_property("_horsery") == "dark horse") { + horseNone(); + } else { + horseMaintain(); + } + if(pass()) { + return result(); } - foreach eff in $effects[Taunt of Horus, Hippy Stench, Unmuffled, High Colognic, Celestial Saltiness, Everything Must Go!, Patent Aggression, Lion in Ambush] - { - buffMaintain(eff, 0, 1, 1); - if(are_we_done()) return true; + void handleEffect(effect eff) { + if (speculative) { + delta += numeric_modifier(eff, "Combat Rate"); + } + auto_log_debug("We " + (speculative ? "can gain" : "just gained") + " " + eff.to_string() + ", now we have " + result()); } - if(get_property("_horsery") == "dark horse") - { - getHorse("return"); + boolean tryEffects(boolean [effect] effects) { + foreach eff in effects { + if (buffMaintain(eff, 0, 1, 1, speculative)) { + handleEffect(eff); + } + if (pass()) { + return true; + } + } + return false; } - else - { - horseMaintain(); + + // Now handle buffs that cost MP, items or other resources + + shrugAT($effect[Carlweather\'s Cantata Of Confrontation]); + if (tryEffects($effects[ + Musk of the Moose, + Carlweather's Cantata of Confrontation, + Blinking Belly, + Song of Battle, + Frown, + Angry, + Screaming! \ SCREAMING! \ AAAAAAAH!, + Coffeesphere, + Unmuffled + ])) { + return result(); } - if(are_we_done()) return true; - asdonBuff($effect[Driving Obnoxiously]); - if(are_we_done()) return true; - - //Patent Invisibility & Shelter of Shed are not free to uneffect. but should be handled somehow. - - // only return false if we don't have a positive combat rate. - if (numeric_modifier("Combat Rate").to_int() + equipDiff > 0) { - return true; + if (tryEffects($effects[ + Taunt of Horus, + Patent Aggression, + Lion in Ambush, + Everything Must Go!, + Hippy Stench, + High Colognic, + Celestial Saltiness, + Simply Irresistible + ])) { + return result(); } - return false; + + if(canAsdonBuff($effect[Driving Obnoxiously])) { + if (!speculative) { + asdonBuff($effect[Driving Obnoxiously]); + } + handleEffect($effect[Driving Obnoxiously]); + } + if(pass()) { + return result(); + } + + return result(); } -boolean providePlusNonCombat(int amt, boolean doEquips) +boolean providePlusCombat(int amt, boolean doEquips) { - if(amt == 0) - { - return true; - } - boolean forbid_extra = true; - if(amt >= 25) - { - forbid_extra = false; //do we want to stop when there are FREE methods to raise it further + return providePlusCombat(amt, doEquips, false) >= amt; +} + +boolean providePlusCombat(int amt) +{ + return providePlusCombat(amt, true); +} + +float providePlusNonCombat(int amt, boolean doEquips, boolean speculative) { + auto_log_info((speculative ? "Checking if we can" : "Trying to") + " provide " + amt + " positive combat rate, " + (doEquips ? "with" : "without") + " equipment", "blue"); + + float alreadyHave = numeric_modifier("Combat Rate"); + float need = amt - alreadyHave; + + if (need > 0) { + auto_log_debug("We currently have " + alreadyHave + ", so we need an extra " + need); + } else { + auto_log_debug("We already have enough!"); } - amt = -1 * amt; - //equipment handling - if(doEquips) - { - //to prevent flipflop resulting in failing 50% of the turns we always do this first. see issue #400 - addToMaximize("-200combat " + to_string(-1 * amt) + "max"); + float delta = 0; + + float result() { + return numeric_modifier("Combat Rate") + delta; } - simMaximize(); //we do not want to repeatedly simulate equipment. simulate it once only. - int equipDiff = to_int(simValue("Combat Rate") - numeric_modifier("Combat Rate")); - boolean are_we_done() - { - if(numeric_modifier("Combat Rate").to_int() + equipDiff <= amt) - { - return true; + if (doEquips) { + string max = "-200combat " + amt + "max"; + if (speculative) { + simMaximizeWith(max); + } else { + addToMaximize(max); + simMaximize(); } - return false; + delta = simValue("Combat Rate") - numeric_modifier("Combat Rate"); + auto_log_debug("With gear we can get to " + result()); } - - if(forbid_extra && are_we_done()) return true; //did equipment reach goal. - //you can toggle this effect between -combat and +combat for free without limit - if(have_effect($effect[Become Intensely Interested]) > 0) - { + boolean pass() { + return result() >= amt; + } + + if(pass()) { + return result(); + } + + + // first lets do stuff that is "free" (as in has no MP cost, item use or can be freely removed/toggled) + + if (have_effect($effect[Become Intensely Interested]) > 0) { visit_url("charsheet.php?pwd=&action=newyouinterest"); - if(forbid_extra && are_we_done()) return true; + if(pass()) { + return result(); + } } - //free to uneffect - foreach eff in $effects[Carlweather\'s Cantata Of Confrontation, Driving Obnoxiously] - { + foreach eff in $effects[Carlweather\'s Cantata Of Confrontation, Driving Obnoxiously] { uneffect(eff); - if(forbid_extra && are_we_done()) return true; + if(pass()) { + return result(); + } } - //now we have reached effects that actually have a cost - shrugAT($effect[The Sonata of Sneakiness]); //remove an AT buff so we have room for sonata of sneakiness - foreach eff in $effects[Shelter Of Shed, Brooding, Muffled, Smooth Movements, The Sonata of Sneakiness, Song of Solitude, Inked Well, Bent Knees, Extended Toes, Ink Cloud, Patent Invisibility, Cloak of Shadows] - { - buffMaintain(eff, 0, 1, 1); - if(are_we_done()) return true; + horseDark(); + if(pass()) { + return result(); } - // We can get these during normal game, may as well use them! - if(0 == have_effect($effect[Fresh Scent])) - { - if(item_amount($item[chunk of rock salt]) > 0) - { - use(1, $item[chunk of rock salt]); + void handleEffect(effect eff) { + if (speculative) { + delta += numeric_modifier(eff, "Combat Rate"); } - else if(item_amount($item[deodorant]) > 0) - { - use(1, $item[deodorant]); + auto_log_debug("We " + (speculative ? "can gain" : "just gained") + " " + eff.to_string() + ", now we have " + result()); + } + + boolean tryEffects(boolean [effect] effects) { + foreach eff in effects { + if (buffMaintain(eff, 0, 1, 1, speculative)) { + handleEffect(eff); + } + if (pass()) { + return true; + } } - if(are_we_done()) return true; + return false; } - getHorse("noncombat"); - if(are_we_done()) return true; - - auto_powerfulGloveNoncombat(); - if(are_we_done()) return true; + // Now handle buffs that cost MP, items or other resources + + shrugAT($effect[The Sonata of Sneakiness]); + if (tryEffects($effects[ + Shelter Of Shed, + Brooding, + Muffled, + Smooth Movements, + The Sonata of Sneakiness, + Song of Solitude, + Inked Well, + Bent Knees, + Extended Toes, + Ink Cloud, + Cloak of Shadows, + Chocolatesphere + ])) { + return result(); + } + + if (auto_birdModifier("Combat Rate") > 0) { + if (tryEffects($effects[Blessing of the Bird])) { + return result(); + } + } + + if (auto_favoriteBirdModifier("Combat Rate") > 0) { + if (tryEffects($effects[Blessing of Your Favorite Bird])) { + return result(); + } + } + + if (tryEffects($effects[ + Ashen, + Predjudicetidigitation, + Patent Invisibility, + Ministrations in the Dark, + Fresh Scent, + Become Superficially interested, + Gummed Shoes, + Simply Invisible, + Inky Camouflage, + Celestial Camouflage + ])) { + return result(); + } + + if(canAsdonBuff($effect[Driving Stealthily])) { + if (!speculative) { + asdonBuff($effect[Driving Stealthily]); + } + handleEffect($effect[Driving Stealthily]); + } + if(pass()) { + return result(); + } //blooper ink costs 15 coins without which it will error when trying to buy it, so that is the bare minimum we need to check for //However we don't want to waste our early coins on it as they are precious. So require at least 400 coins before buying it. - if(in_zelda() && 0 == have_effect($effect[Blooper Inked]) && item_amount($item[coin]) > 400) - { - retrieve_item(1, $item[blooper ink]); - buffMaintain($effect[Blooper Inked], 0, 1, 1); - if(are_we_done()) return true; + if (in_zelda() && 0 == have_effect($effect[Blooper Inked]) && item_amount($item[coin]) > 400) { + if (!speculative) { + retrieve_item(1, $item[blooper ink]); + } + if (tryEffects($effects[Blooper Inked])) { + return result(); + } } - asdonBuff($effect[Driving Stealthily]); - if(are_we_done()) return true; - - // only return false if we don't have a negative combat rate. - if (numeric_modifier("Combat Rate").to_int() + equipDiff < 0) { - return true; + // Glove charges are a limited per-day resource, lets do this last so we don't waste possible uses of Replace Enemy + if (tryEffects($effects[Triple-Sized])) { + return result(); } - return false; + + return result(); +} + +boolean providePlusNonCombat(int amt, boolean doEquips) +{ + return providePlusNonCombat(amt, doEquips, false) >= amt; +} + +boolean providePlusNonCombat(int amt) +{ + return providePlusNonCombat(amt, true); } float provideInitiative(int amt, boolean doEquips, boolean speculative) @@ -2926,7 +3041,7 @@ float provideInitiative(int amt, boolean doEquips, boolean speculative) } else { - addToMaximize("500initiative " + amt + "max"); + addToMaximize(max); simMaximize(); } delta = simValue("Initiative") - numeric_modifier("Initiative"); @@ -5027,6 +5142,7 @@ boolean buffMaintain(effect buff, int mp_min, int casts, int turns, boolean spec case $effect[Antibiotic Saucesphere]: useSkill = $skill[Antibiotic Saucesphere]; break; case $effect[Arched Eyebrow of the Archmage]:useSkill = $skill[Arched Eyebrow of the Archmage];break; case $effect[Armor-Plated]: useItem = $item[Bent Scrap Metal]; break; + case $effect[Ashen]: useItem = $item[pile of ashes]; break; case $effect[Ashen Burps]: useItem = $item[ash soda]; break; case $effect[Astral Shell]: if(acquireTotem()) @@ -5107,12 +5223,15 @@ boolean buffMaintain(effect buff, int mp_min, int casts, int turns, boolean spec case $effect[Celestial Camouflage]: useItem = $item[Celestial Squid Ink]; break; case $effect[Celestial Saltiness]: useItem = $item[Celestial Au Jus]; break; case $effect[Celestial Sheen]: useItem = $item[Celestial Olive Oil]; break; + case $effect[Celestial Vision]: useItem = $item[Celestial Carrot Juice]; break; case $effect[Cinnamon Challenger]: useItem = $item[Pulled Red Taffy]; break; case $effect[Cletus\'s Canticle of Celerity]: useSkill = $skill[Cletus\'s Canticle of Celerity];break; case $effect[Cloak of Shadows]: useSkill = $skill[Blood Cloak]; break; case $effect[Clyde\'s Blessing]: useItem = $item[The Legendary Beat]; break; case $effect[Chalky Hand]: useItem = $item[Handful of Hand Chalk]; break; + case $effect[Chocolatesphere]: useSkill = $skill[Chocolatesphere]; break; case $effect[Cranberry Cordiality]: useItem = $item[Cranberry Cordial]; break; + case $effect[Coffeesphere]: useSkill = $skill[Coffeesphere]; break; case $effect[Cold Hard Skin]: useItem = $item[Frost-Rimed Seal Hide]; break; case $effect[Contemptible Emanations]: useItem = $item[Cologne of Contempt]; break; case $effect[The Cupcake of Wrath]: useItem = $item[Green-Frosted Astral Cupcake]; break; @@ -5191,6 +5310,7 @@ boolean buffMaintain(effect buff, int mp_min, int casts, int turns, boolean spec case $effect[Football Eyes]: useItem = $item[Black Facepaint]; break; case $effect[Fortunate Resolve]: useItem = $item[Resolution: Be Luckier]; break; case $effect[Frenzied, Bloody]: useSkill = $skill[Blood Frenzy]; break; + case $effect[Fresh Scent]: useItem = $item[deodorant]; break; case $effect[Frigidalmatian]: useSkill = $skill[Frigidalmatian]; break; case $effect[Frog in Your Throat]: useItem = $item[Frogade]; break; case $effect[From Nantucket]: useItem = $item[Ye Olde Bawdy Limerick]; break; @@ -5214,6 +5334,7 @@ boolean buffMaintain(effect buff, int mp_min, int casts, int turns, boolean spec case $effect[Graham Crackling]: useItem = $item[Heather Graham Cracker]; break; case $effect[Greasy Peasy]: useItem = $item[Robot Grease]; break; case $effect[Greedy Resolve]: useItem = $item[Resolution: Be Wealthier]; break; + case $effect[Gristlesphere]: useSkill = $skill[Gristlesphere]; break; case $effect[Gummed Shoes]: useItem = $item[Shoe Gum]; break; case $effect[Gummi-Grin]: useItem = $item[Gummi Turtle]; break; case $effect[Hairy Palms]: useItem = $item[Orcish Hand Lotion]; break; @@ -5246,6 +5367,7 @@ boolean buffMaintain(effect buff, int mp_min, int casts, int turns, boolean spec case $effect[Industrial Strength Starch]: useItem = $item[Industrial Strength Starch]; break; case $effect[Ink Cloud]: useSkill = $skill[Ink Gland]; break; case $effect[Inked Well]: useSkill = $skill[Squid Glands]; break; + case $effect[Inky Camouflage]: useItem = $item[Vial of Squid Ink]; break; case $effect[Inscrutable Gaze]: useSkill = $skill[Inscrutable Gaze]; break; case $effect[Insulated Trousers]: useItem = $item[Cold Powder]; break; case $effect[Intimidating Mien]: useSkill = $skill[Intimidating Mien]; break; @@ -5321,6 +5443,7 @@ boolean buffMaintain(effect buff, int mp_min, int casts, int turns, boolean spec case $effect[Of Course It Looks Great]: useSkill = $skill[Check Hair]; break; case $effect[Oiled Skin]: useItem = $item[Skin Oil]; break; case $effect[Oiled-Up]: useItem = $item[Pec Oil]; break; + case $effect[Oilsphere]: useSkill = $skill[Oilsphere]; break; case $effect[OMG WTF]: useItem = $item[Confiscated Cell Phone]; break; case $effect[One Very Clear Eye]: useItem = $item[Cyclops Eyedrops]; break; case $effect[Orange Crusher]: useItem = $item[Pulled Orange Taffy]; break; @@ -5364,6 +5487,7 @@ boolean buffMaintain(effect buff, int mp_min, int casts, int turns, boolean spec case $effect[Power of Heka]: useSkill = $skill[Power of Heka]; break; case $effect[The Power Of LOV]: useItem = $item[LOV Elixir #3]; break; case $effect[Prideful Strut]: useSkill = $skill[Walk: Prideful Strut]; break; + case $effect[Predjudicetidigitation]: useItem = $item[worst candy];break; case $effect[Protection from Bad Stuff]: useItem = $item[scroll of Protection from Bad Stuff];break; case $effect[Provocative Perkiness]: useItem = $item[Libation of Liveliness]; break; case $effect[Puddingskin]: useItem = $item[scroll of Puddingskin]; break; @@ -5431,7 +5555,9 @@ boolean buffMaintain(effect buff, int mp_min, int casts, int turns, boolean spec case $effect[Shelter of Shed]: useSkill = $skill[Shelter of Shed]; break; case $effect[Shrieking Weasel]: useItem = $item[Shrieking Weasel Holo-Record]; break; case $effect[Simmering]: useSkill = $skill[Simmer]; break; + case $effect[Simply Invisible]: useItem = $item[Invisibility Potion]; break; case $effect[Simply Irresistible]: useItem = $item[Irresistibility Potion]; break; + case $effect[Simply Irritable]: useItem = $item[Irritability potion]; break; case $effect[Singer\'s Faithful Ocelot]: useSkill = $skill[Singer\'s Faithful Ocelot]; break; case $effect[Sinuses For Miles]: useItem = $item[Mick\'s IcyVapoHotness Inhaler];break; case $effect[Sleaze-Resistant Trousers]: useItem = $item[Sleaze Powder]; break; diff --git a/RELEASE/scripts/autoscend/autoscend_header.ash b/RELEASE/scripts/autoscend/autoscend_header.ash index 7f9051eec..31776f2cb 100644 --- a/RELEASE/scripts/autoscend/autoscend_header.ash +++ b/RELEASE/scripts/autoscend/autoscend_header.ash @@ -931,8 +931,10 @@ void picky_pulls(); //Defined in autoscend/auto_picky.ash void picky_startAscension(); //Defined in autoscend/auto_picky.ash skill preferredLibram(); //Defined in autoscend/auto_util.ash location provideAdvPHPZone(); //Defined in autoscend/auto_util.ash +float providePlusCombat(int amt, boolean doEquips, boolean speculative); //Defined in autoscend/auto_util.ash boolean providePlusCombat(int amt); //Defined in autoscend/auto_util.ash boolean providePlusCombat(int amt, boolean doEquips); //Defined in autoscend/auto_util.ash +float providePlusNonCombat(int amt, boolean doEquips, boolean speculative); //Defined in autoscend/auto_util.ash boolean providePlusNonCombat(int amt); //Defined in autoscend/auto_util.ash boolean providePlusNonCombat(int amt, boolean doEquips); //Defined in autoscend/auto_util.ash boolean acquireCombatMods(int amt); //Defined in autoscend/auto_util.ash From 7a9d882d0f0ef0f52cf1e2053217e73b2345708b Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Tue, 7 Jul 2020 15:51:25 -0700 Subject: [PATCH 45/52] Don't farm ores if we have a mountain man trapped in the chateau painting (#479) --- RELEASE/scripts/autoscend/quests/level_8.ash | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/RELEASE/scripts/autoscend/quests/level_8.ash b/RELEASE/scripts/autoscend/quests/level_8.ash index 9dc16d0a5..1464d203b 100644 --- a/RELEASE/scripts/autoscend/quests/level_8.ash +++ b/RELEASE/scripts/autoscend/quests/level_8.ash @@ -254,6 +254,11 @@ boolean L8_getMineOres() return false; } + if (get_property("chateauMonster").to_monster() == $monster[Mountain Man]) { + // apparently this is a thing some people do. Lets add the most basic of support. + return false; + } + if((my_rain() > 50) && (have_effect($effect[Ultrahydrated]) == 0) && (auto_my_path() == "Heavy Rains") && have_skill($skill[Rain Man])) { auto_log_info("Trying to summon a mountain man", "blue"); From 3541f63f9e081bb9ca379b17290b92a03e756ad2 Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Tue, 7 Jul 2020 21:30:23 -0700 Subject: [PATCH 46/52] tweak the desirability for pulled consumables a little lower (#480) also exclude the unidentified drink as the adventure gain range is wild (6-20 from size 3!) --- RELEASE/scripts/autoscend/auto_cooking.ash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASE/scripts/autoscend/auto_cooking.ash b/RELEASE/scripts/autoscend/auto_cooking.ash index 334da409c..0be0fa11e 100644 --- a/RELEASE/scripts/autoscend/auto_cooking.ash +++ b/RELEASE/scripts/autoscend/auto_cooking.ash @@ -844,7 +844,7 @@ boolean loadConsumables(string _type, ConsumeAction[int] actions) int[item] large_owned; int[item] craftables; - boolean[item] blacklist = $items[Cursed Punch]; + boolean[item] blacklist = $items[Cursed Punch, Unidentified Drink]; boolean[item] craftable_blacklist; // If we have 2 sticks of firewood, the current knapsack-solver @@ -963,7 +963,7 @@ boolean loadConsumables(string _type, ConsumeAction[int] actions) { // Is this a good estimate of how many adventures a pull is worth? I don't know! // This could be a property, I don't know. - actions[n].desirability -= 6.0; + actions[n].desirability -= 5.0; } if (type == SL_ORGAN_STOMACH && auto_is_valid($item[special seasoning])) { From 0dcf66650f43ee4f353c3c8c45959bb9a70e5949 Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Tue, 7 Jul 2020 22:39:39 -0700 Subject: [PATCH 47/52] Change license to CC BY-NC-SA 4.0 and add info on readme. (#457) --- LICENSE | 458 +++++++++++++++++++++++++++++++++++++++++++++++++++--- README.md | 4 + 2 files changed, 441 insertions(+), 21 deletions(-) diff --git a/LICENSE b/LICENSE index 8aa26455d..cbe5ad167 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,437 @@ -MIT License - -Copyright (c) [year] [fullname] - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +Attribution-NonCommercial-ShareAlike 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International +Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution-NonCommercial-ShareAlike 4.0 International Public License +("Public License"). To the extent this Public License may be +interpreted as a contract, You are granted the Licensed Rights in +consideration of Your acceptance of these terms and conditions, and the +Licensor grants You such rights in consideration of benefits the +Licensor receives from making the Licensed Material available under +these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. BY-NC-SA Compatible License means a license listed at + creativecommons.org/compatiblelicenses, approved by Creative + Commons as essentially the equivalent of this Public License. + + d. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + e. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + f. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + g. License Elements means the license attributes listed in the name + of a Creative Commons Public License. The License Elements of this + Public License are Attribution, NonCommercial, and ShareAlike. + + h. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + i. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + j. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + k. NonCommercial means not primarily intended for or directed towards + commercial advantage or monetary compensation. For purposes of + this Public License, the exchange of the Licensed Material for + other material subject to Copyright and Similar Rights by digital + file-sharing or similar means is NonCommercial provided there is + no payment of monetary compensation in connection with the + exchange. + + l. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + m. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + n. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part, for NonCommercial purposes only; and + + b. produce, reproduce, and Share Adapted Material for + NonCommercial purposes only. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. Additional offer from the Licensor -- Adapted Material. + Every recipient of Adapted Material from You + automatically receives an offer from the Licensor to + exercise the Licensed Rights in the Adapted Material + under the conditions of the Adapter's License You apply. + + c. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties, including when + the Licensed Material is used other than for NonCommercial + purposes. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + b. ShareAlike. + + In addition to the conditions in Section 3(a), if You Share + Adapted Material You produce, the following conditions also apply. + + 1. The Adapter's License You apply must be a Creative Commons + license with the same License Elements, this version or + later, or a BY-NC-SA Compatible License. + + 2. You must include the text of, or the URI or hyperlink to, the + Adapter's License You apply. You may satisfy this condition + in any reasonable manner based on the medium, means, and + context in which You Share Adapted Material. + + 3. You may not offer or impose any additional or different terms + or conditions on, or apply any Effective Technological + Measures to, Adapted Material that restrict exercise of the + rights granted under the Adapter's License You apply. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database for NonCommercial purposes + only; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material, + including for purposes of Section 3(b); and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. diff --git a/README.md b/README.md index 3e0674d1b..676703be1 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,10 @@ Seriously, we need and want the help. Want to learn how to code? Or maybe you kn autoscend is a script that will play through an entire ascension for you in the Kingdom of Loathing. It is built up from sl\_ascend and cc\_ascend before it. +## License +[![License: CC BY-NC-SA 4.0](https://licensebuttons.net/l/by-nc-sa/4.0/80x15.png)](https://creativecommons.org/licenses/by-nc-sa/4.0/) +This work is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-nc-sa/4.0/). + ## Installation Run this command in the graphical CLI: From c9af3e92a29530da9ea12d51e3c90eb2ac620910 Mon Sep 17 00:00:00 2001 From: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> Date: Tue, 7 Jul 2020 23:56:50 -0700 Subject: [PATCH 48/52] Better routing for LKS and some other related fixes (#453) - change calls to auto_have_familiar($familiar[Mosquito]) to pathAllowsFamiliar() as the former returns false in 100% familiar runs and was being used to check if familiars are allowed in the current run (which screwed 100% runs out of some buffs and other things for no reason) - add NC handling for the Overgrown Lot - add drop tracking for junksprites similar to unstable fulminate ingredient drop tracking - add printing a "footer" at the end of our pre-adventure handling since a lot can change between the header being printed and actually adventuring - fix combat modifiers and item drops for many zones. - add function to start the Shen Copperhead quest so we can lock in the zones he will send us to as early as possible. - remove unnecessary calls to providePlusCombat and providePlusNonCombat from quest handling - use zone_delay() to check delay where relevant. - rename LegendaryEpicWeapon to EpicWeapon because it was wrong when I originally wrote it. - add Serialbus and CH Imp to the sniffable monsters to help get Steel Organ faster - if we've got the peg key and don't have the pirate outfit just pull the parts we don't have. - fix junk junk quest to not waste adventures as moxie classes - add functions to handle completing the meatsmith and doc galaktik quests - remove hardcoded meat drop familiars in L12 and L13 quests. - double up on talking to guild class quest giver for starting nemesis quest because for some reason this is what KoL wants us to do. - change dancing with lady spookyraven to handle retrying if we hit Lights Out the first time - don't bother with trying to get the priceless diamond in the Copperhead club if we have > 10k meat --- BUILD/monsters/sniff.dat | 2 + RELEASE/data/autoscend_monsters.txt | 2 + RELEASE/scripts/autoscend.ash | 58 +- RELEASE/scripts/autoscend/auto_choice_adv.ash | 12 + RELEASE/scripts/autoscend/auto_combat.ash | 5 + RELEASE/scripts/autoscend/auto_equipment.ash | 2 +- RELEASE/scripts/autoscend/auto_familiar.ash | 2 +- RELEASE/scripts/autoscend/auto_post_adv.ash | 15 +- RELEASE/scripts/autoscend/auto_pre_adv.ash | 52 +- RELEASE/scripts/autoscend/auto_restore.ash | 4 +- RELEASE/scripts/autoscend/auto_util.ash | 38 +- RELEASE/scripts/autoscend/auto_zone.ash | 602 +++++++----------- .../scripts/autoscend/autoscend_header.ash | 24 +- .../autoscend/paths/low_key_summer.ash | 254 ++++++-- RELEASE/scripts/autoscend/quests/level_10.ash | 26 +- RELEASE/scripts/autoscend/quests/level_11.ash | 105 ++- RELEASE/scripts/autoscend/quests/level_12.ash | 30 +- RELEASE/scripts/autoscend/quests/level_13.ash | 18 +- RELEASE/scripts/autoscend/quests/level_2.ash | 1 - RELEASE/scripts/autoscend/quests/level_5.ash | 5 + RELEASE/scripts/autoscend/quests/level_6.ash | 5 - RELEASE/scripts/autoscend/quests/level_7.ash | 2 - RELEASE/scripts/autoscend/quests/level_8.ash | 2 - RELEASE/scripts/autoscend/quests/level_9.ash | 7 - .../scripts/autoscend/quests/level_any.ash | 42 +- RELEASE/scripts/autoscend/quests/optional.ash | 215 +++++-- 26 files changed, 830 insertions(+), 700 deletions(-) diff --git a/BUILD/monsters/sniff.dat b/BUILD/monsters/sniff.dat index fd19b5dd8..fa0e8411f 100644 --- a/BUILD/monsters/sniff.dat +++ b/BUILD/monsters/sniff.dat @@ -22,3 +22,5 @@ Possessed Wine Rack Blue Oyster cultist Dirty Old Lihc prop:cyrptNicheEvilness>28 Possibility Giant prop:chaosButterflyThrown=false;item:chaos butterfly<1 +Serialbus item:bus pass<5 +CH Imp item:imp air<5 diff --git a/RELEASE/data/autoscend_monsters.txt b/RELEASE/data/autoscend_monsters.txt index 3fa79f946..357e1136f 100644 --- a/RELEASE/data/autoscend_monsters.txt +++ b/RELEASE/data/autoscend_monsters.txt @@ -115,6 +115,8 @@ sniff 20 Possessed Wine Rack sniff 21 Blue Oyster cultist sniff 22 Dirty Old Lihc prop:cyrptNicheEvilness>28 sniff 23 Possibility Giant prop:chaosButterflyThrown=false;item:chaos butterfly<1 +sniff 24 Serialbus item:bus pass<5 +sniff 25 CH Imp item:imp air<5 # Gotta get that wig yellowray 0 Burly Sidekick item:Mohawk Wig<1 diff --git a/RELEASE/scripts/autoscend.ash b/RELEASE/scripts/autoscend.ash index b71ac5915..0203535a8 100644 --- a/RELEASE/scripts/autoscend.ash +++ b/RELEASE/scripts/autoscend.ash @@ -196,6 +196,7 @@ void initializeSettings() set_property("auto_skipL12Farm", "false"); set_property("auto_L12FarmStage", "0"); set_property("choiceAdventure1003", 0); + set_property("auto_junkspritesencountered", 0); remove_property("auto_minedCells"); beehiveConsider(); @@ -204,7 +205,7 @@ void initializeSettings() { auto_sourceTerminalRequest("enquiry monsters.enq"); } - else if(contains_text(get_property("sourceTerminalEnquiryKnown"), "familiar.enq") && auto_have_familiar($familiar[Mosquito])) + else if(contains_text(get_property("sourceTerminalEnquiryKnown"), "familiar.enq") && pathAllowsFamiliar()) { auto_sourceTerminalRequest("enquiry familiar.enq"); } @@ -2638,7 +2639,7 @@ boolean LX_craftAcquireItems() } else { - if((have_effect($effect[Adventurer\'s Best Friendship]) > 30) && auto_have_familiar($familiar[Mosquito])) + if((have_effect($effect[Adventurer\'s Best Friendship]) > 30) && pathAllowsFamiliar()) { set_property("choiceAdventure1106", 3); } @@ -3080,6 +3081,24 @@ void print_header() } } +void resetState() { + //These settings should never persist into another turn, ever. They only track something for a single instance of the main loop. + //We use boolean instead of adventure count because of free combats. + + set_property("auto_doCombatCopy", "no"); + set_property("_auto_thisLoopHandleFamiliar", false); //have we called handleFamiliar this loop + set_property("auto_disableFamiliarChanging", false); //disable autoscend making changes to familiar + set_property("auto_familiarChoice", ""); //which familiar do we want to switch to during pre_adventure + set_property("choiceAdventure1387", -1); // using the force non-combat + set_property("_auto_tunedElement", ""); // Flavour of Magic elemental alignment + + horseDefault(); // horsery tracking + + bat_formNone(); // Vampyre form tracking + + resetMaximize(); +} + boolean doTasks() { //this is the main loop for autoscend. returning true will restart from the begining. returning false will quit the loop and go on to do bedtime @@ -3097,7 +3116,8 @@ boolean doTasks() if(my_familiar() == $familiar[Stooper]) { auto_log_info("Avoiding stooper stupor...", "blue"); - use_familiar($familiar[none]); + familiar fam = (is100FamRun() ? get_property("auto_100familiar").to_familiar() : $familiar[none]); + use_familiar(fam); } if(my_inebriety() > inebriety_limit()) { @@ -3115,11 +3135,6 @@ boolean doTasks() return false; } - //These settings should never persist into another turn, ever. They only track something for a single instance of the main loop. - //We use boolean instead of adventure count because of free combats. - resetThisLoop(); - set_property("choiceAdventure1387", -1); // using the force non-combat - print_header(); auto_interruptCheck(); @@ -3179,10 +3194,8 @@ boolean doTasks() auto_log_warning("This feature is super experimental. Please report any issues.", "red"); } - bat_formNone(); - horseDefault(); - resetMaximize(); - resetFlavour(); + // actually doing stuff should start from here onwards. + resetState(); basicAdjustML(); @@ -3334,15 +3347,10 @@ boolean doTasks() if(LX_artistQuest()) return true; if(L9_leafletQuest()) return true; if(L5_findKnob()) return true; - if(LM_edTheUndying()) return true; if(L12_sonofaPrefix()) return true; if(LX_burnDelay()) return true; - - if(snojoFightAvailable() && (my_daycount() == 2) && (get_property("snojoMoxieWins").to_int() == 10)) - { - return autoAdv(1, $location[The X-32-F Combat Training Snowman]); - } - + if (LM_edTheUndying()) return true; + if (LX_lowkeySummer()) return true; if(resolveSixthDMT()) return true; if(LX_dinseylandfillFunbucks()) return true; if(L12_flyerFinish()) return true; @@ -3356,7 +3364,6 @@ boolean doTasks() { if(LX_bitchinMeatcar()) return true; //buy the meatcar before switching signs with the rune spoon } - if(LX_findHelpfulLowKey()) return true; if(LX_unlockDesert()) return true; if(L5_getEncryptionKey()) return true; if(LX_unlockPirateRealm()) return true; @@ -3401,12 +3408,6 @@ boolean doTasks() if(L7_crypt()) return true; if(fancyOilPainting()) return true; - - if((my_level() > 6) && (my_daycount() != 2)) - { - if(LX_freeCombats()) return true; - } - if(L8_trapperGround()) return true; if(L8_trapperNinjaLair()) return true; if(L8_trapperGroar()) return true; @@ -3459,7 +3460,6 @@ boolean doTasks() if (L12_clearBattlefield()) return true; if(LX_koeInvaderHandler()) return true; - if (LX_lowkeySummer()) return true; //release the softblock on quests that are waiting for shen quest if(allowSoftblockShen()) @@ -3578,7 +3578,6 @@ void auto_begin() backupSetting("autoAbortThreshold", -0.05); backupSetting("currentMood", "apathetic"); - backupSetting("battleAction", "custom combat script"); backupSetting("choiceAdventure1107", 1); @@ -3610,7 +3609,8 @@ void auto_begin() if(my_familiar() == $familiar[Stooper]) { auto_log_info("Avoiding stooper stupor...", "blue"); - use_familiar($familiar[none]); + familiar fam = (is100FamRun() ? get_property("auto_100familiar").to_familiar() : $familiar[none]); + use_familiar(fam); } dailyEvents(); diff --git a/RELEASE/scripts/autoscend/auto_choice_adv.ash b/RELEASE/scripts/autoscend/auto_choice_adv.ash index 4473e5cc0..ff8ccbeec 100644 --- a/RELEASE/scripts/autoscend/auto_choice_adv.ash +++ b/RELEASE/scripts/autoscend/auto_choice_adv.ash @@ -374,6 +374,18 @@ boolean auto_run_choice(int choice, string page) run_choice(5); } break; + case 1062: // Lots of Options (The Overgrown Lot) + string[int] options = available_choice_options(); + if (options contains 1) { + run_choice(1); // get flowers for the doc + } else { + if (options contains 5) { + run_choice(5); // get booze from map to a hidden booze cache + } else { + run_choice(3); // get booze + } + } + break; case 1082: // The "Rescue" (post-Cake Lord in Madness Bakery) run_choice(1); break; diff --git a/RELEASE/scripts/autoscend/auto_combat.ash b/RELEASE/scripts/autoscend/auto_combat.ash index 2618b5c94..e41b473cc 100644 --- a/RELEASE/scripts/autoscend/auto_combat.ash +++ b/RELEASE/scripts/autoscend/auto_combat.ash @@ -274,6 +274,11 @@ string auto_combatHandler(int round, monster enemy, string text) case $monster[cabinet of Dr. Limpieza]: set_property("auto_cabinetsencountered", get_property("auto_cabinetsencountered").to_int() + 1); break; + case $monster[junksprite bender]: + case $monster[junksprite melter]: + case $monster[junksprite sharpener]: + set_property("auto_junkspritesencountered", get_property("auto_junkspritesencountered").to_int() + 1); + break; } set_property("auto_combatHandler", ""); diff --git a/RELEASE/scripts/autoscend/auto_equipment.ash b/RELEASE/scripts/autoscend/auto_equipment.ash index 7853dbe5a..dfc5531d5 100644 --- a/RELEASE/scripts/autoscend/auto_equipment.ash +++ b/RELEASE/scripts/autoscend/auto_equipment.ash @@ -182,7 +182,7 @@ string defaultMaximizeStatement() } } - if(auto_have_familiar($familiar[mosquito])) + if(pathAllowsFamiliar()) { res += ",2familiar weight"; if(my_familiar().familiar_weight() < 20) diff --git a/RELEASE/scripts/autoscend/auto_familiar.ash b/RELEASE/scripts/autoscend/auto_familiar.ash index 6bf970957..406ac20ca 100644 --- a/RELEASE/scripts/autoscend/auto_familiar.ash +++ b/RELEASE/scripts/autoscend/auto_familiar.ash @@ -317,7 +317,7 @@ boolean autoChooseFamiliar(location place) } // Killing jar saves adventures unlocking the Pyramid. - if ($location[The Haunted Library] == place && item_amount($item[killing jar]) < 1) { + if ($location[The Haunted Library] == place && item_amount($item[killing jar]) < 1 && (get_property("gnasirProgress").to_int() & 4) == 0 && get_property("desertExploration") < 100) { famChoice = lookupFamiliarDatafile("item"); } diff --git a/RELEASE/scripts/autoscend/auto_post_adv.ash b/RELEASE/scripts/autoscend/auto_post_adv.ash index e87d7ae06..905a1d98e 100644 --- a/RELEASE/scripts/autoscend/auto_post_adv.ash +++ b/RELEASE/scripts/autoscend/auto_post_adv.ash @@ -89,6 +89,11 @@ boolean auto_post_adventure() } } + if (my_location() == $location[The Old Landfill] && item_amount($item[funky junk key]) > 0) { + // got a key drop, reset the tracking property. + set_property("auto_junkspritesencountered", 0); + } + if(get_property("auto_disableAdventureHandling").to_boolean()) { auto_log_info("Postadventure skipped by standard adventure handler.", "green"); @@ -451,7 +456,7 @@ boolean auto_post_adventure() buffMaintain($effect[Power Ballad of the Arrowsmith], 7, 1, 5); buffMaintain(whatStatSmile(), 15, 1, 10); // Only maintain skills in path with familiars - if(auto_have_familiar($familiar[Mosquito])) + if(pathAllowsFamiliar()) { buffMaintain($effect[Leash of Linguini], 20, 1, 10); if(regen > 10.0) @@ -512,7 +517,7 @@ boolean auto_post_adventure() buffMaintain($effect[Power Ballad of the Arrowsmith], 7, 1, 5); buffMaintain(whatStatSmile(), 20, 1, 10); // Only Maintain skills in path with familiars - if(auto_have_familiar($familiar[Mosquito])) + if(pathAllowsFamiliar()) { buffMaintain($effect[Leash of Linguini], 30, 1, 10); if(regen > 10.0) @@ -579,7 +584,7 @@ boolean auto_post_adventure() buffMaintain(whatStatSmile(), 40, 1, 10); } // Only maintain in path with familiars - if(auto_have_familiar($familiar[Mosquito])) + if(pathAllowsFamiliar()) { buffMaintain($effect[Leash of Linguini], 35, 1, 10); if(regen > 4.0) @@ -689,7 +694,7 @@ boolean auto_post_adventure() } // Only maintain in path with familiars - if(auto_have_familiar($familiar[Mosquito])) + if(pathAllowsFamiliar()) { buffMaintain($effect[Empathy], 50, 1, 10); buffMaintain($effect[Leash of Linguini], 35, 1, 10); @@ -779,7 +784,7 @@ boolean auto_post_adventure() } // Only maintain in path with familiars - if(auto_have_familiar($familiar[Mosquito])) + if(pathAllowsFamiliar()) { buffMaintain($effect[Jingle Jangle Jingle], 120, 1, 2); } diff --git a/RELEASE/scripts/autoscend/auto_pre_adv.ash b/RELEASE/scripts/autoscend/auto_pre_adv.ash index 3621f481d..a9b74c8f8 100644 --- a/RELEASE/scripts/autoscend/auto_pre_adv.ash +++ b/RELEASE/scripts/autoscend/auto_pre_adv.ash @@ -1,6 +1,17 @@ script "auto_pre_adv.ash"; import +void print_footer() { + auto_log_info("HP: " + my_hp() + "/" + my_maxhp() + ", MP: " + my_mp() + "/" + my_maxmp() + " Meat: " + my_meat(), "blue"); + if (my_class() == $class[Sauceror]) { + auto_log_info("Soulsauce: " + my_soulsauce(), "blue"); + } + auto_log_info("Familiar: " + my_familiar().to_string() + " @ " + familiar_weight(my_familiar()) + " + " + weight_adjustment() + "lbs.", "blue"); + auto_log_info("ML: " + monster_level_adjustment() + " Encounter: " + combat_rate_modifier() + " Init: " + initiative_modifier(), "blue"); + auto_log_info("Exp Bonus: " + experience_bonus() + " Meat Drop: " + meat_drop_modifier() + " Item Drop: " + item_drop_modifier(), "blue"); + auto_log_info("Resists: " + numeric_modifier("Hot Resistance") + "/" + numeric_modifier("Cold Resistance") + "/" + numeric_modifier("Stench Resistance") + "/" + numeric_modifier("Spooky Resistance") + "/" + numeric_modifier("Sleaze Resistance"), "blue"); +} + boolean auto_pre_adventure() { auto_log_debug("Running auto_pre_adv.ash"); @@ -48,11 +59,6 @@ boolean auto_pre_adventure() use(1, $item[Bittycar Meatcar]); } - if((have_effect($effect[Coated in Slime]) > 0) && (place != $location[The Slime Tube])) - { - visit_url("clan_slimetube.php?action=chamois&pwd"); - } - if((place == $location[The Broodling Grounds]) && (my_class() == $class[Seal Clubber])) { uneffect($effect[Spiky Shell]); @@ -125,33 +131,10 @@ boolean auto_pre_adventure() } } - if(!inAftercore()) - { - if(($locations[Barrrney\'s Barrr, The Black Forest, The F\'c\'le, Monorail Work Site] contains place)) - { - acquireCombatMods(zone_combatMod(place)._int, true); - } - if(place == $location[Sonofa Beach] && !auto_voteMonster()) - { - acquireCombatMods(zone_combatMod(place)._int, true); - } - - if($locations[Whitey\'s Grove] contains place) - { - acquireCombatMods(zone_combatMod(place)._int, true); - } - - if($locations[A Maze of Sewer Tunnels, The Castle in the Clouds in the Sky (Basement), The Castle in the Clouds in the Sky (Ground Floor), The Castle in the Clouds in the Sky (Top Floor), The Dark Elbow of the Woods, The Dark Heart of the Woods, The Dark Neck of the Woods, The Defiled Alcove, The Defiled Cranny, The Extreme Slope, The Haunted Ballroom, The Haunted Bathroom, The Haunted Billiards Room, The Haunted Gallery, The Hidden Hospital, The Hidden Park, The Ice Hotel, Inside the Palindome, The Obligatory Pirate\'s Cove, The Penultimate Fantasy Airship, The Poop Deck, The Spooky Forest, Super Villain\'s Lair, Twin Peak, The Upper Chamber, Wartime Hippy Camp, Wartime Hippy Camp (Frat Disguise)] contains place) - { - acquireCombatMods(zone_combatMod(place)._int, true); - } - } - else - { - if((get_property("questL11Spare") == "finished") && (place == $location[The Hidden Bowling Alley]) && (item_amount($item[Bowling Ball]) > 0)) - { - put_closet(item_amount($item[Bowling Ball]), $item[Bowling Ball]); - } + // this calls the appropriate provider for +combat or -combat depending on the zone we are about to adventure in.. + generic_t combatModifier = zone_combatMod(place); + if (combatModifier._boolean) { + acquireCombatMods(combatModifier._int, true); } if(monster_level_adjustment() > 120) @@ -328,7 +311,7 @@ boolean auto_pre_adventure() generic_t itemNeed = zone_needItem(place); if(itemNeed._boolean) { - addToMaximize("50item " + ceil(itemNeed._float) + "max"); + addToMaximize("50item " + (ceil(itemNeed._float) + 100.0) + "max"); // maximizer treats item drop as 100 higher than it actually is for some reason. simMaximize(); float itemDrop = simValue("Item Drop"); if(itemDrop < itemNeed._float) @@ -472,7 +455,7 @@ boolean auto_pre_adventure() januaryToteAcquire($item[Wad Of Used Tape]); } -// EQUIP MAXIMIZED GEAR + // EQUIP MAXIMIZED GEAR equipMaximizedGear(); cli_execute("checkpoint clear"); @@ -532,6 +515,7 @@ boolean auto_pre_adventure() change_mcd(mcd_target); } + print_footer(); return true; } diff --git a/RELEASE/scripts/autoscend/auto_restore.ash b/RELEASE/scripts/autoscend/auto_restore.ash index 0f49a3759..50da5ac30 100644 --- a/RELEASE/scripts/autoscend/auto_restore.ash +++ b/RELEASE/scripts/autoscend/auto_restore.ash @@ -460,7 +460,7 @@ __RestorationOptimization __calculate_objective_values(int hp_goal, int mp_goal, meat_per_mp = meat_per_mp * 0.95; // this isn't quite right for discounted Doc Galaktik but I don't care. } if (isMystGuildStoreAvailable()) { - int mmj_cost = auto_have_skill($skill[Five Finger Discount]) ? 100 : 95; + int mmj_cost = auto_have_skill($skill[Five Finger Discount]) ? 95 : 100; int mmj_mp_restored = my_level() * 1.5 + 5; float mmj_meat_per_mp = mmj_cost / mmj_mp_restored; meat_per_mp = min(meat_per_mp, mmj_meat_per_mp); @@ -556,7 +556,7 @@ __RestorationOptimization __calculate_objective_values(int hp_goal, int mp_goal, // TODO: doesnt account properly for multiuse situations where we could have more blood skill casts and less waste than this formula suggests float blood_skill_opportunity_casts(float goal){ boolean bloodBondAvailable = auto_have_skill($skill[Blood Bond]) && - auto_have_familiar($familiar[Mosquito]) && //checks if player can use familiars in this run + pathAllowsFamiliar() && //checks if player can use familiars in this run my_maxhp() > hp_cost($skill[Blood Bond]) && goal > ((9-hp_regen())*10) && // blood bond drains hp after combat, make sure we dont accidentally kill the player get_property("auto_restoreUseBloodBond").to_boolean(); diff --git a/RELEASE/scripts/autoscend/auto_util.ash b/RELEASE/scripts/autoscend/auto_util.ash index 3ffbe9225..b25cd22ae 100644 --- a/RELEASE/scripts/autoscend/auto_util.ash +++ b/RELEASE/scripts/autoscend/auto_util.ash @@ -620,6 +620,15 @@ boolean startMeatsmithSubQuest() return false; } +boolean finishMeatsmithSubQuest() { + if (internalQuestStatus("questM23Meatsmith") == 1) { + visit_url("shop.php?whichshop=meatsmith"); + run_choice(2); + return true; + } + return false; +} + boolean startGalaktikSubQuest() { if(auto_my_path() == "Nuclear Autumn") @@ -641,6 +650,20 @@ boolean startGalaktikSubQuest() return false; } +boolean finishGalaktikSubQuest() { + if (item_amount($item[fraudwort]) >= 3 && item_amount($item[shysterweed]) >= 3 && item_amount($item[swindleblossom]) >= 3) { + string temp = visit_url("shop.php?whichshop=doc"); + if (temp.contains_text("What did you need, again?")) { + visit_url("shop.php?whichshop=doc&action=talk"); + } + run_choice(2); + if (internalQuestStatus("questM24Doc") > 1) { + return true; + } + } + return false; +} + boolean startHippyBoatmanSubQuest() { if(my_basestat(my_primestat()) >= 25 && get_property("questM19Hippy") == "unstarted") @@ -6447,11 +6470,6 @@ element currentFlavour() return $element[none]; } -void resetFlavour() -{ - set_property("_auto_tunedElement", ""); -} - boolean setFlavour(element ele) { if(!auto_have_skill($skill[Flavour of Magic])) @@ -7223,13 +7241,3 @@ int poolSkillPracticeGains() return count; } -void resetThisLoop() -{ - //These settings should never persist into another turn, ever. They only track something for a single instance of the main loop. - //We use boolean instead of adventure count because of free combats. - - set_property("auto_doCombatCopy", "no"); - set_property("_auto_thisLoopHandleFamiliar", false); //have we called handleFamiliar this loop - set_property("auto_disableFamiliarChanging", false); //disable autoscend making changes to familiar - set_property("auto_familiarChoice", ""); //which familiar do we want to switch to during pre_adventure -} \ No newline at end of file diff --git a/RELEASE/scripts/autoscend/auto_zone.ash b/RELEASE/scripts/autoscend/auto_zone.ash index 61e65a845..36b5c4906 100644 --- a/RELEASE/scripts/autoscend/auto_zone.ash +++ b/RELEASE/scripts/autoscend/auto_zone.ash @@ -3,149 +3,6 @@ script "auto_zone.ash" //All functions should fail if the king is liberated? //Zone functions come here. -generic_t zone_needItem(location loc); -generic_t zone_difficulty(location loc); -generic_t zone_combatMod(location loc); -generic_t zone_delay(location loc); -generic_t zone_available(location loc); -boolean zone_unlock(location loc); -location[int] zone_list(); -int[location] zone_delayable(); -boolean zone_isAvailable(location loc); -boolean zone_isAvailable(location loc, boolean unlockIfPossible); -location[int] zones_available(); -monster[int] mobs_available(); -item[int] drops_available(); -item[int] hugpocket_available(); -boolean is_ghost_in_zone(location loc); - -boolean LX_unlockThinknerdWarehouse(boolean spend_resources) -{ - //unlocks [The Thinknerd Warehouse], returns true if successful or adv is spent - //much easier to do if you already have torso awaregness - - if(internalQuestStatus("questM22Shirt") > -1) - { - return false; - } - - auto_log_debug("Trying to unlock [The Thinknerd Warehouse] with spend_resources set to " + spend_resources); - - //unlocking is a multi step process. We want to try things in reverse to conserve resources and in case some steps were already complete. - - boolean useLetter() - { - if(item_amount($item[Letter for Melvign the Gnome]) > 0) - { - if(use(1, $item[Letter for Melvign the Gnome])) - { - auto_log_debug("Successfully unlocked the [The Thinknerd Warehouse]"); - return true; - } - else - { - abort("Somehow failed to use [Letter for Melvign the Gnome]... aborting to prevent infinite loops"); - } - } - return false; - } - - item target_shirt = $item[none]; - boolean hasShirt = false; - - //one time initial scan of inventory - foreach it in get_inventory() - { - if(to_slot(it) == $slot[shirt]) - { - target_shirt = it; - hasShirt = true; - break; - } - } - - boolean useShirtThenLetter() - { - if(!hasShirt) - { - return false; - } - string temp = visit_url("inv_equip.php?pwd&which=2&action=equip&whichitem=" + target_shirt.to_int()); - if(useLetter()) return true; - auto_log_error("For some reason LX_unlockThinknerdWarehouse failed when trying to use the shirt [" + target_shirt + "] to get [Letter for Melvign the Gnome] to start the quest", "red"); - return false; - } - void getShirtWhenHaveNone(item it) - { - if(hasShirt) return; - if(canPull(it)) - { - if(pullXWhenHaveY(it, 1, 0)) - { - target_shirt = it; - hasShirt = true; - } - } - else if(creatable_amount(it) > 0 && (spend_resources || knoll_available())) - { - if(create(1, it)) - { - target_shirt = it; - hasShirt = true; - } - } - } - - //if you already had a shirt or a letter, then just unlock the quest now - if(useLetter()) return true; - if(useShirtThenLetter()) return true; - - //Try to acquire a shirt. - - //IOTM that does not require a pull - januaryToteAcquire($item[Letter For Melvign The Gnome]); //no stats and no pull required - if(useLetter()) return true; - - //TODO, make the following IOTM foldables actually work - //getShirtWhenHaveNone($item[flaming pink shirt]) //foldable IOTM that requires torso awaregness. - //getShirtWhenHaveNone($item[origami pasties]) //foldable IOTM that requires torso awaregness. - //getShirtWhenHaveNone($item[sugar shirt]) //libram summons sugar sheet, multiuse 1 with torso awaregness to get sugar shirt - - //Shirts to pull - getShirtWhenHaveNone($item[Sneaky Pete\'s leather jacket]); //useful IOTM shirt with no state requirements to wear - getShirtWhenHaveNone($item[Sneaky Pete\'s leather jacket (collar popped)]); - getShirtWhenHaveNone($item[Professor What T-Shirt]); //you likely have it, no requirements to wear, very cheap in mall - - //Shirts to smith. Will likely cost 1 adv unless in knoll sign. - getShirtWhenHaveNone($item[white snakeskin duster]); //7 mus req - getShirtWhenHaveNone($item[clownskin harness]); //15 mus req - getShirtWhenHaveNone($item[demonskin jacket]); //25 mus req - getShirtWhenHaveNone($item[gnauga hide vest]); //25 mus req - getShirtWhenHaveNone($item[tuxedo shirt]); //35 mus req - getShirtWhenHaveNone($item[yak anorak]); //42 mus req - getShirtWhenHaveNone($item[hipposkin poncho]); //45 mus req - getShirtWhenHaveNone($item[lynyrdskin tunic]); //70 mus req - getShirtWhenHaveNone($item[bat-ass leather jacket]); //77 mus req - - //wish for a shirt - if(spend_resources && wishesAvailable() > 0 && shouldUseWishes() && item_amount($item[blessed rustproof +2 gray dragon scale mail]) == 0) - { - makeGenieWish("for a blessed rustproof +2 gray dragon scale mail"); - target_shirt = $item[blessed rustproof +2 gray dragon scale mail]; - hasShirt = true; - } - - //TODO adventure somewhere to acquire shirt - //if(spend_resources && hasTorso()) - - //did we succeeded in getting a shirt? use it and then the letter. - if(useShirtThenLetter()) return true; - - //sadness, we couldn't unlock this zone. - auto_log_debug("Failed to unlock [The Thinknerd Warehouse]"); - return false; -} - boolean zone_unlock(location loc){ boolean unlocked = false; @@ -220,18 +77,51 @@ record generic_t generic_t zone_needItem(location loc) { + // attempting to list these in descending order in relation to the quest they relate to + // (so L13 quest stuff first then L12 then L11 and so on). generic_t retval; float value = 0.0; switch(loc) { + case $location[8-Bit Realm]: + value = 50.0; + break; + case $location[The Hole in the Sky]: + if (item_amount($item[Star]) < 8 || item_amount($item[Line]) < 7) { + value = 30.0; + } + break; + case $location[Frat House]: + case $location[Hippy Camp]: + value = 5.0; + break; + case $location[Wartime Frat House]: + if (!possessOutfit("Frat Warrior Fatigues")) { + value = 5.0; + } + case $location[Wartime Hippy Camp]: + if (!possessOutfit("War Hippy Fatigues")) { + value = 5.0; + } + case $location[The Battlefield (Frat Uniform)]: + case $location[The Battlefield (Hippy Uniform)]: + value = 5.0; + break; + case $location[The Hatching Chamber]: + case $location[The Feeding Chamber]: + case $location[The Royal Guard Chamber]: + value = 10.0; + break; case $location[The Oasis]: value = 30.0; break; case $location[The Middle Chamber]: value = 20.0; break; - case $location[The Deep Machine Tunnels]: - value = 30.0; #Just a guess. + case $location[The Haunted Library]: + if (item_amount($item[killing jar]) < 1 && (get_property("gnasirProgress").to_int() & 4) == 0 && get_property("desertExploration") < 100) { + value = 10.0; + } break; case $location[The Haunted Laundry Room]: value = 5.0 * (1.0 + get_property("auto_cabinetsencountered").to_float()); @@ -240,62 +130,30 @@ generic_t zone_needItem(location loc) value = 5.0 * (1.0 + get_property("auto_wineracksencountered").to_float()); break; case $location[The Hidden Park]: - case $location[The Hidden Apartment Building]: - case $location[The Hidden Office Building]: - if((get_property("hiddenTavernUnlock").to_int() < my_ascensions()) && !contains_text(get_property("banishedMonsters"), $monster[Pygmy Janitor])) - { + if (get_property("hiddenTavernUnlock").to_int() < my_ascensions()) { value = 20.0; } break; case $location[The Hidden Bowling Alley]: - // Should actually check if we have used 4/5 already. - if(item_amount($item[Bowling Ball]) == 0) - { + if (item_amount($item[Bowling Ball]) == 0 && get_property("hiddenBowlingAlleyProgress") < 5) { value = 40.0; } - //Once we have completed the Bowling Alley, we do not care about this anymore. - if((get_property("hiddenTavernUnlock").to_int() < my_ascensions()) && !contains_text(get_property("banishedMonsters"), $monster[Pygmy Janitor])) - { - value = 20.0; - } break; case $location[The Hidden Temple]: //Only if we need stone wool manually for some reason. //Or via the semi-rare! (100/50/20 for SR, 25 Sheep) - break; - case $location[8-Bit Realm]: - value = 60.0; - break; - case $location[The Black Forest]: - //Is it possible we want blackberries? - break; - case $location[The Beanbat Chamber]: - if(item_amount($item[Enchanted Bean]) == 0) - { - value = 50.0; - } - if(internalQuestStatus("questL04Bat") < 3) - { - value = 10.0; - } - break; - case $location[The Batrat And Ratbat Burrow]: - if(internalQuestStatus("questL04Bat") < 3) - { - value = 15.0; + if (have_effect($effect[Stone-Faced]) == 0) { + value = 20.0; } break; - case $location[The Bat Hole Entrance]: - case $location[Guano Junction]: - if(internalQuestStatus("questL04Bat") < 3) - { - value = 10.0; + case $location[The Black Forest]: + if (!possessEquipment($item[blackberry galoshes])) { + value = 20.0; } break; case $location[Inside the Palindome]: - if((item_amount($item[Stunt Nuts]) == 0) && (item_amount($item[Wet Stew]) == 0)) - { - value = 32.0; + if (item_amount($item[Stunt Nuts]) == 0 && item_amount($item[Wet Stunt Nut Stew]) == 0) { + value = 30.0; } break; case $location[Whitey\'s Grove]: @@ -304,57 +162,28 @@ generic_t zone_needItem(location loc) value = 25.0; } break; - case $location[Cobb\'s Knob Barracks]: - if(!have_outfit("Knob Goblin Elite Guard Uniform")) - { - value = 10.0; - } - break; - case $location[Cobb\'s Knob Harem]: - if(item_amount($item[Knob Goblin Perfume]) == 0) - { - value = 25.0; - } - if(!have_outfit("Knob Goblin Harem Girl Disguise")) - { - value = 20.0; - } - break; - case $location[The Laugh Floor]: - if(item_amount($item[Imp Air]) < 5) - { - value = 15.0; - } + case $location[The Copperhead Club]: + case $location[A Mob of Zeppelin Protesters]: + value = 15.0; break; - case $location[Infernal Rackets Backstage]: - if(item_amount($item[Bus Pass]) < 5) - { - value = 15.0; - } + case $location[The Red Zeppelin]: + value = 30.0; break; - case $location[The Defiled Nook]: - // Handle for a gravy boat? - if(get_property("cyrptNookEvilness").to_int() > 26) + case $location[The Penultimate Fantasy Airship]: + if(!possessEquipment($item[Amulet Of Extreme Plot Significance]) && !possessEquipment($item[Titanium Assault Umbrella])) { - value = 20.0; + value = 10.0; } - break; - case $location[Barrrney\'s Barrr]: - if(item_amount($item[Cocktail Napkin]) == 0) + if(!possessEquipment($item[Mohawk Wig])) { value = 10.0; } break; - case $location[The F\'c\'le]: - if((item_amount($item[Ball Polish]) == 0) || (item_amount($item[Mizzenmast Mop]) == 0) ||(item_amount($item[Rigging Shampoo]) == 0)) - { - value = 30.0; - } + case $location[The Castle in the Clouds in the Sky (Basement)]: + value = 40.0; break; - case $location[The Hatching Chamber]: - case $location[The Feeding Chamber]: - case $location[The Royal Guard Chamber]: - value = 10.0; + case $location[The Castle in the Clouds in the Sky (Ground Floor)]: + value = 20.0; break; case $location[The Smut Orc Logging Camp]: if(item_amount($item[Ten-Leaf Clover]) == 0) @@ -363,38 +192,27 @@ generic_t zone_needItem(location loc) } break; case $location[A-Boo Peak]: + if(get_property("auto_aboopending").to_int() == 0) { - int progress = get_property("booPeakProgress").to_int(); - progress -= (30 * item_amount($item[A-Boo Clue])); - if(get_property("auto_aboopending").to_int() != 0) - { - progress -= 30; - } - if(progress > 4) - { - value = 15.0; - } + value = 15.0; } break; case $location[Twin Peak]: value = 15.0; break; case $location[Oil Peak]: - // Should probably also check for Twin Peak completion here. - if((item_amount($item[Bubblin\' Crude]) < 12) && (item_amount($item[Jar Of Oil]) == 0)) - { - if(monster_level_adjustment() > 100) - { + if ((get_property("twinPeakProgress").to_int() & 4) == 0 && item_amount($item[Bubblin\' Crude]) < 12 && item_amount($item[Jar Of Oil]) < 1) { + if (monster_level_adjustment() > 100) { value = 10.0; - } - else if(monster_level_adjustment() > 50) - { + } else if(monster_level_adjustment() > 50) { value = 30.0; + } else if (monster_level_adjustment() > 20) { + value = 10.0; } } break; case $location[Itznotyerzitz Mine]: - if(item_amount($item[Ten-Leaf Clover]) == 0) + if (!possessOutfit("Mining Gear") && item_amount($item[Ten-Leaf Clover]) == 0) { value = 10.0; } @@ -402,35 +220,87 @@ generic_t zone_needItem(location loc) case $location[The Goatlet]: value = 40.0; break; - case $location[The Extreme Slope]: - if(!have_outfit("extreme cold-weather gear")) + if(!possessOutfit("eXtreme Cold-Weather Gear")) { value = 10.0; } - - case $location[The Penultimate Fantasy Airship]: - if(!possessEquipment($item[Amulet Of Extreme Plot Significance]) && !possessEquipment($item[Titanium Assault Umbrella])) + case $location[The Defiled Nook]: + // Handle for a gravy boat? + if(get_property("cyrptNookEvilness").to_int() > 26) + { + value = 20.0; + } + break; + case $location[Cobb\'s Knob Barracks]: + if(!have_outfit("Knob Goblin Elite Guard Uniform")) { value = 10.0; } - if(!possessEquipment($item[Mohawk Wig])) + break; + case $location[Cobb\'s Knob Harem]: + if(item_amount($item[Knob Goblin Perfume]) == 0) + { + value = 25.0; + } + if (!possessOutfit("Knob Goblin Harem Girl Disguise")) { + value = 20.0; + } + break; + case $location[The Beanbat Chamber]: + if(item_amount($item[Enchanted Bean]) == 0) + { + value = 50.0; + } + if(internalQuestStatus("questL04Bat") < 3) { value = 10.0; } break; - case $location[The Castle in the Clouds in the Sky (Basement)]: - //Should we care about Heavy D? + case $location[The Batrat And Ratbat Burrow]: + if(internalQuestStatus("questL04Bat") < 3) + { + value = 15.0; + } break; - case $location[The Castle in the Clouds in the Sky (Top Floor)]: - //Should we care about Thin Black Candles? + case $location[The Bat Hole Entrance]: + case $location[Guano Junction]: + if(internalQuestStatus("questL04Bat") < 3) + { + value = 10.0; + } break; - case $location[The Hole in the Sky]: - if((item_amount($item[Star]) < 8) || (item_amount($item[Line]) < 7)) + case $location[The Laugh Floor]: + if(item_amount($item[Imp Air]) < 5) { - value = 30.0; + value = 15.0; + } + break; + case $location[Infernal Rackets Backstage]: + if(item_amount($item[Bus Pass]) < 5) + { + value = 15.0; + } + break; + case $location[Barrrney\'s Barrr]: + if(item_amount($item[Cocktail Napkin]) == 0) + { + value = 10.0; + } + break; + case $location[The F\'c\'le]: + if (item_amount($item[Ball Polish]) == 0 || item_amount($item[Mizzenmast Mop]) == 0 || item_amount($item[Rigging Shampoo]) == 0) { + if (!possessEquipment($item[pirate fledges])) { + value = 30.0; + } } break; + case $location[The Old Landfill]: + value = 5.0 * (1.0 + get_property("auto_junkspritesencountered").to_float()); + break; + case $location[The Deep Machine Tunnels]: + value = 30.0; #Just a guess. + break; case $location[Barf Mountain]: retval._float = 15.0; break; @@ -485,19 +355,34 @@ generic_t zone_needItem(location loc) generic_t zone_combatMod(location loc) { + // attempting to list these in descending order in relation to the quest they relate to + // (so L13 quest stuff first then L12 then L11 and so on). generic_t retval; generic_t delay = zone_delay(loc); int value = 0; switch(loc) { + case $location[Frat House]: + case $location[Hippy Camp]: + if (my_level() >= 9) { + value = -85; + } + break; + case $location[Wartime Frat House]: + case $location[Wartime Hippy Camp]: + value = -80; + break; + case $location[Sonofa Beach]: + value = 90; + break; case $location[The Upper Chamber]: value = -85; break; - case $location[Super Villain\'s Lair]: - if(!get_property("_villainLairColorChoiceUsed").to_boolean() || !get_property("_villainLairDoorChoiceUsed").to_boolean() || !get_property("_villainLairSymbologyChoiceUsed").to_boolean()) - { - value = -70; - } + case $location[The Haunted Billiards Room]: + value = -85; + break; + case $location[The Haunted Library]: + value = 25; break; case $location[The Haunted Gallery]: if((delay._int == 0) || (!contains_text(get_property("relayCounters"), "Garden Banished"))) @@ -517,52 +402,24 @@ generic_t zone_combatMod(location loc) value = -90; } break; - case $location[The Typical Tavern Cellar]: - //We could cut it off early if the Rat Faucet is the last one - //And marginally if we know the 3rd/6th square are forced events. - value = -75; - break; - case $location[Through the Spacegate]: - case $location[The Cheerless Spire (Level 5)]: - value = 5; - break; - case $location[The Cheerless Spire (Level 4)]: - case $location[The Cheerless Spire (Level 3)]: - case $location[The Cheerless Spire (Level 2)]: - case $location[The Cheerless Spire (Level 1)]: + case $location[The Hidden Park]: value = -85; break; - case $location[The Spooky Forest]: - if(delay._int == 0) - { - value = -85; - } - break; case $location[The Hidden Temple]: - if(auto_my_path() == "G-Lover") - { + if (have_effect($effect[Stone-Faced]) == 0) { value = -90; } break; - case $location[The Copperhead Club]: case $location[A Mob Of Zeppelin Protesters]: - case $location[The Red Zeppelin]: value = -70; break; - case $location[The Black Forest]: - if(internalQuestStatus("questL13Final") < 5) - { + if (internalQuestStatus("questL13Final") < 6) { value = 5; - } - else if(internalQuestStatus("questL13Final") == 5) - { + } else if (internalQuestStatus("questL13Final") == 6) { value = -95; } break; - case $location[Monorail Work Site]: - value = 25; - break; case $location[Inside the Palindome]: if(((item_amount($item[Photograph Of A Red Nugget]) == 0) || (item_amount($item[Photograph Of An Ostrich Egg]) == 0) || (item_amount($item[Photograph Of God]) == 0)) && internalQuestStatus("questL11Palindome") <= 2) { @@ -579,109 +436,122 @@ generic_t zone_combatMod(location loc) value = 15; } break; - case $location[The Dark Neck of the Woods]: - value = -85; - break; - case $location[The Dark Heart of the Woods]: - value = -85; - break; - case $location[The Dark Elbow of the Woods]: - value = -85; - break; - case $location[The Defiled Cranny]: - value = -85; - break; - case $location[The Defiled Alcove]: - value = -85; - break; - case $location[Barrrney\'s Barrr]: - if(internalQuestStatus("questM12Pirate") >= 0) + case $location[The Penultimate Fantasy Airship]: + if(delay._int == 0) { - value = 20; + value = -80; } - break; - case $location[The F\'c\'le]: - if((item_amount($item[Ball Polish]) == 0) || (item_amount($item[Mizzenmast Mop]) == 0) ||(item_amount($item[Rigging Shampoo]) == 0)) + else { - value = 20; + //Let us not worry about throttling the Airship + #value = 20; } break; - case $location[The Poop Deck]: - value = -80; - break; - case $location[Wartime Hippy Camp (Frat Disguise)]: - value = -80; + case $location[The Castle in the Clouds in the Sky (Basement)]: + case $location[The Castle in the Clouds in the Sky (Ground Floor)]: + case $location[The Castle in the Clouds in the Sky (Top Floor)]: + value = -95; break; - case $location[Wartime Hippy Camp]: - value = -80; + case $location[Twin Peak]: + value = -85; break; case $location[The Extreme Slope]: value = -95; break; + case $location[Itznotyerzitz Mine]: + if (!possessOutfit("Mining Gear") && item_amount($item[Ten-Leaf Clover]) == 0) { + value = -90; + } + break; case $location[Lair of the Ninja Snowmen]: value = 80; break; - case $location[Sonofa Beach]: - value = 90; - break; - case $location[Twin Peak]: - value = -80; - break; - case $location[A Maze of Sewer Tunnels]: - // I guess there is not a preference for this? + case $location[The Dark Neck of the Woods]: + case $location[The Dark Heart of the Woods]: + case $location[The Dark Elbow of the Woods]: value = -95; break; - case $location[The Ice Hotel]: + case $location[The Defiled Cranny]: + case $location[The Defiled Alcove]: value = -85; break; - case $location[The Obligatory Pirate\'s Cove]: - if(internalQuestStatus("questM12Pirate") < 2) - { - value = -60; - } - else if(numPirateInsults() < 6) + case $location[The Outskirts of Cobb's Knob]: + value = 20; + break; + case $location[The Typical Tavern Cellar]: + //We could cut it off early if the Rat Faucet is the last one + //And marginally if we know the 3rd/6th square are forced events. + value = -75; + break; + case $location[The Spooky Forest]: + if(delay._int == 0) { - value = 40; + value = -85; } - else if(numPirateInsults() <= 7) - { - value = -10; + break; + case $location[The Laugh Floor]: + if (item_amount($item[Azazel's lollipop]) < 1) { + value = 15.0; } - else - { - value = -60; + break; + case $location[Infernal Rackets Backstage]: + if (item_amount($item[Azazel's unicorn]) < 1) { + value = -70; } - break; - case $location[The Penultimate Fantasy Airship]: - if(delay._int == 0) - { + case $location[Barrrney\'s Barrr]: + if (numPirateInsults() >= 6) { value = -80; + } else { + value = 20; } - else + break; + case $location[The F\'c\'le]: + if(!possessEquipment($item[pirate fledges])) { - //Let us not worry about throttling the Airship - #value = 20; + value = 20; } break; - case $location[The Castle in the Clouds in the Sky (Basement)]: - value = -95; + case $location[The Poop Deck]: + value = -80; break; - case $location[The Castle in the Clouds in the Sky (Ground Floor)]: - if(internalQuestStatus("questL13Final") == 8) - { - value = -95; + case $location[The Obligatory Pirate\'s Cove]: + if(!possessOutfit("Swashbuckling Getup")) { + value = -60; + } else if (numPirateInsults() < 8) { + value = 40; } break; - case $location[The Castle in the Clouds in the Sky (Top Floor)]: - value = -95; + case $location[The Knob Shaft]: + value = 15; break; - case $location[The Hidden Park]: - if(item_amount($item[Bowling Ball]) < 3) + case $location[South of The Border]: + value = 50; + break; + case $location[The Icy Peak]: + value = 15; + break; + case $location[Pandamonium Slums]: + value = 5; + break; + case $location[The Haunted Pantry]: + value = 20; + break; + case $location[Cobb's Knob Treasury]: + value = 15; + break; + case $location[Super Villain\'s Lair]: + if(!get_property("_villainLairColorChoiceUsed").to_boolean() || !get_property("_villainLairDoorChoiceUsed").to_boolean() || !get_property("_villainLairSymbologyChoiceUsed").to_boolean()) { - value = -85; + value = -70; } break; + case $location[Through the Spacegate]: + value = 5; + break; + case $location[The Ice Hotel]: + value = -85; + break; default: retval._error = true; break; diff --git a/RELEASE/scripts/autoscend/autoscend_header.ash b/RELEASE/scripts/autoscend/autoscend_header.ash index 31776f2cb..9658fffbb 100644 --- a/RELEASE/scripts/autoscend/autoscend_header.ash +++ b/RELEASE/scripts/autoscend/autoscend_header.ash @@ -35,12 +35,13 @@ boolean LX_joinPirateCrew(); boolean LX_fledglingPirateIsYou(); boolean LX_unlockBelowdecks(); boolean LX_pirateQuest(); -boolean LX_acquireLegendaryEpicWeapon(); +boolean LX_acquireEpicWeapon(); boolean LX_hardcoreFoodFarm(); boolean LX_melvignShirt(); boolean LX_attemptPowerLevel(); boolean LX_attemptFlyering(); boolean LX_bitchinMeatcar(); +boolean LX_unlockDesert(); boolean LX_meatMaid(); //Defined in autoscend/quests/level_any.ash boolean dependenceDayClovers(); //Defined in autoscend/quests/level_any.ash boolean LX_craftAcquireItems(); @@ -71,19 +72,25 @@ boolean L2_mosquito(); boolean L3_tavern(); boolean L4_batCave(); + boolean L5_haremOutfit(); boolean L5_findKnob(); boolean L5_goblinKing(); boolean L5_getEncryptionKey(); +boolean L5_slayTheGoblinKing(); + boolean L6_dakotaFanning(); boolean L6_friarsGetParts(); -boolean L8_trapperStart(); + boolean L7_crypt(); + +boolean L8_trapperStart(); boolean L8_trapperGround(); boolean L8_trapperNinjaLair(); boolean L8_trapperExtreme(); boolean L8_trapperGroar(); boolean L8_trapperQuest(); + boolean L9_chasmBuild(); boolean L9_highLandlord(); boolean L9_aBooPeak(); @@ -104,7 +111,14 @@ boolean[location] shenZonesToAvoidBecauseMaybeSnake(); //Defined in autoscen boolean shenShouldDelayZone(location loc); //Defined in autoscend/auto_quest_level_11.ash boolean LX_unlockHiddenTemple(); +boolean LX_unlockManorSecondFloor(); +boolean LX_unlockHauntedLibrary(); +boolean LX_unlockHauntedBilliardsRoom(); boolean LX_spookyravenManorFirstFloor(); +boolean LX_danceWithLadySpookyraven(); +boolean LX_getLadySpookyravensFinestGown(); +boolean LX_getLadySpookyravensDancingShoes(); +boolean LX_getLadySpookyravensPowderPuff(); boolean LX_spookyravenManorSecondFloor(); boolean L11_palindome(); boolean L11_hiddenCity(); @@ -118,6 +132,7 @@ boolean L11_mcmuffinDiary(); boolean L11_unlockHiddenCity(); boolean L11_hiddenCityZones(); boolean L11_talismanOfNam(); +boolean L11_shenStartQuest(); boolean L11_shenCopperhead(); boolean L11_ronCopperhead(); boolean L11_redZeppelin(); @@ -172,6 +187,7 @@ boolean L12_sonofaFinish(); //Defined in autoscend/auto_quest_level_12.a boolean L12_gremlins(); //Defined in autoscend/auto_quest_level_12.ash boolean L12_orchardFinalize(); //Defined in autoscend/auto_quest_level_12.ash boolean L12_finalizeWar(); //Defined in autoscend/auto_quest_level_12.ash +boolean L12_clearBattlefield(); //Defined in autoscend/auto_quest_level_13.ash boolean LX_getDigitalKey(); @@ -397,7 +413,6 @@ location[int] ListInsertInorder(location[int] list, location what);//Defined in int ListFind(location[int] list, location what); //Defined in autoscend/auto_list.ash int ListFind(location[int] list, location what, int idx); //Defined in autoscend/auto_list.ash location ListOutput(location[int] list); //Defined in autoscend/auto_list.ash -void resetThisLoop(); //Defined in autoscend/auto_util.ash int [item] auto_get_campground(); //Defined in autoscend/auto_util.ash boolean basicAdjustML(); //Defined in autoscend/auto_util.ash boolean beatenUpResolution(); //Defined in autoscend.ash @@ -987,6 +1002,8 @@ boolean startArmorySubQuest(); //Defined in autoscend/auto_util.ash boolean startGalaktikSubQuest(); //Defined in autoscend/auto_util.ash boolean startMeatsmithSubQuest(); //Defined in autoscend/auto_util.ash boolean startHippyBoatmanSubQuest(); //Defined in autoscend/auto_util.ash +boolean finishMeatsmithSubQuest(); //Defined in autoscend/auto_util.ash +boolean finishGalaktikSubQuest(); //Defined in autoscend/auto_util.ash string statCard(); //Defined in autoscend/auto_util.ash int stomach_left(); //Defined in autoscend/auto_util.ash boolean theSource_buySkills(); //Defined in autoscend/auto_theSource.ash @@ -1223,7 +1240,6 @@ boolean L13_sorceressDoorLowKey(); // Defined in autoscend/paths/low_key_summer. boolean LX_lowkeySummer(); // Defined in autoscend/paths/low_key_summer.ash element currentFlavour(); // Defined in autoscend/auto_util.ash -void resetFlavour(); // Defined in autoscend/auto_util.ash boolean setFlavour(element ele); // Defined in autoscend/auto_util.ash boolean executeFlavour(); // Defined in autoscend/auto_util.ash boolean autoFlavour(location place); // Defined in autoscend/auto_util.ash diff --git a/RELEASE/scripts/autoscend/paths/low_key_summer.ash b/RELEASE/scripts/autoscend/paths/low_key_summer.ash index 77c7c1ae2..1bb3a8270 100644 --- a/RELEASE/scripts/autoscend/paths/low_key_summer.ash +++ b/RELEASE/scripts/autoscend/paths/low_key_summer.ash @@ -1,29 +1,30 @@ script "low_key_summer.ash" +// These are listed in the order they will be iterated (item id ascending) to make debugging easier. location[item] lowKeys; lowKeys[$item[Clown car key]] = $location[The \"Fun\" House]; -lowKeys[$item[Peg key]] = $location[The Obligatory Pirate\'s Cove]; -lowKeys[$item[Ice Key]] = $location[The Icy Peak]; -lowKeys[$item[Demonic key]] = $location[Pandamonium Slums]; -lowKeys[$item[Rabbit\'s foot key]] = $location[The Dire Warren]; +lowKeys[$item[Batting cage key]] = $location[The Bat Hole Entrance]; +lowKeys[$item[aquí]] = $location[South of the Border]; +lowKeys[$item[Knob labinet key]] = $location[Cobb\'s Knob Laboratory]; lowKeys[$item[Weremoose key]] = $location[Cobb\'s Knob Menagerie, Level 2]; -lowKeys[$item[Deep-fried key]] = $location[Madness Bakery]; +lowKeys[$item[Peg key]] = $location[The Obligatory Pirate\'s Cove]; lowkeys[$item[Kekekey]] = $location[The Valley of Rof L\'m Fao]; -lowKeys[$item[Treasure chest key]] = $location[Belowdecks]; -lowKeys[$item[Music Box Key]] = $location[The Haunted Nursery]; -lowKeys[$item[Actual skeleton key]] = $location[The Skeleton Store]; -lowKeys[$item[Batting cage key]] = $location[The Bat Hole Entrance]; +lowKeys[$item[Rabbit\'s foot key]] = $location[The Dire Warren]; +lowKeys[$item[knob shaft skate key]] = $location[The Knob Shaft]; +lowKeys[$item[Ice Key]] = $location[The Icy Peak]; lowKeys[$item[Anchovy can key]] = $location[The Haunted Pantry]; -lowKeys[$item[F\'c\'le sh\'c\'le k\'y]] = $location[The F\'c\'le]; lowKeys[$item[cactus key]] = $location[The Arid\, Extra-Dry Desert]; +lowKeys[$item[F\'c\'le sh\'c\'le k\'y]] = $location[The F\'c\'le]; +lowKeys[$item[Treasure chest key]] = $location[Belowdecks]; +lowKeys[$item[Demonic key]] = $location[Pandamonium Slums]; lowKeys[$item[Key sausage]] = $location[Cobb\'s Knob Kitchens]; -lowKeys[$item[knob shaft skate key]] = $location[The Knob Shaft]; -lowKeys[$item[Black rose key]] = $location[The Haunted Conservatory]; +lowKeys[$item[Knob treasury key]] = $location[Cobb\'s Knob Treasury]; lowKeys[$item[scrap metal key]] = $location[The Old Landfill]; +lowKeys[$item[Black rose key]] = $location[The Haunted Conservatory]; +lowKeys[$item[Actual skeleton key]] = $location[The Skeleton Store]; +lowKeys[$item[Music Box Key]] = $location[The Haunted Nursery]; +lowKeys[$item[Deep-fried key]] = $location[Madness Bakery]; lowKeys[$item[Discarded bike lock key]] = $location[The Overgrown Lot]; -lowKeys[$item[aquí]] = $location[South of the Border]; -lowKeys[$item[Knob labinet key]] = $location[Cobb\'s Knob Laboratory]; -lowKeys[$item[Knob treasury key]] = $location[Cobb\'s Knob Treasury]; boolean in_lowkeysummer() { @@ -170,7 +171,7 @@ boolean lowkey_keyAdv(item key) boolean lowkey_zoneUnlocks() { - if(startHippyBoatmanSubQuest()) + if (startHippyBoatmanSubQuest()) { // opens The Old Landfill for scrap metal key (+20% to all Moxie Gains) return true; @@ -182,13 +183,13 @@ boolean lowkey_zoneUnlocks() return true; } - if (startGalaktikSubQuest()) + if (startGalaktikSubQuest() || finishGalaktikSubQuest()) { - // opens The Overgrown Lot for discarded bike lock key (+10 MP, 4-5 MP regen) + // opens The Overgrown Lot for discarded bike lock key (+10 MP, 4-5 MP regen) return true; } - if (startMeatsmithSubQuest()) { + if (startMeatsmithSubQuest() || finishMeatsmithSubQuest()) { // opens The Skeleton Store for actual skeleton key (100 DA, 10 DR) return true; } @@ -235,20 +236,17 @@ boolean LX_findHelpfulLowKey() if (lowkey_keyAdv($item[Treasure chest key])) { return true; } // +meat. Knob treasury key needs Cobb's Knob Access. Kekekey needs The Valley of Rof L'm Fao access. - if (lowkey_keyAdv($item[Knob treasury key])) { return true; } if (lowkey_keyAdv($item[Kekekey])) { return true; } + if (my_primestat() != $stat[Mysticality] || possessEquipment($item[Demonic key])) { + // all these locations unlock at the same time but for a myst class we should only get + // the -combat key from Cobb's Knob (above) to speed up the friars before we have the +20% myst xp key + if (lowkey_keyAdv($item[Knob treasury key])) { return true; } - // Knob key to unlock shaft for +adv. needs Cobb's Knob Access - if (item_amount($item[Cobb\'s Knob lab key]) < 1 && lowkey_keyAdv($item[Knob labinet key])) { return true; } - - // +adv. Knob shaft skate key needs Cobb's Knob lab key for access to Knob Shaft - if (lowkey_keyAdv($item[Knob shaft skate key])) { return true; } + // +adv. Knob shaft skate key needs Cobb's Knob lab key for access to Knob Shaft + if (lowkey_keyAdv($item[Knob shaft skate key])) { return true; } - if (internalQuestStatus("questM20Necklace") < 1) { - // hot res for the Haunted Kitchen. aquí needs Desert Beach Access - if (lowkey_keyAdv($item[aquí])) { return true; } - // stench res for the Haunted Kitchen - if (lowkey_keyAdv($item[batting cage key])) { return true; } + // Knob labinet key to unlock Menagerie. needs Cobb's Knob lab key for access to the lab + if (item_amount($item[Cobb\'s Knob Menagerie key]) < 1 && lowkey_keyAdv($item[Knob labinet key])) { return true; } } if (internalQuestStatus("questL09Topping") > 0 && internalQuestStatus("questL09Topping") < 3) { @@ -303,8 +301,6 @@ boolean L13_sorceressDoorLowKey() return false; } - // TODO: Handle the standard keys - location loc = lowkey_nextAvailableKeyLocation(); if (loc == $location[none]) @@ -333,16 +329,198 @@ boolean L13_sorceressDoorLowKey() } boolean LX_lowkeySummer() { - if (!in_lowkeysummer()) { - return false; + + if (!in_lowkeysummer()) { return false; } + + // Guild access + if (LX_guildUnlock()) { return true; } + + // Find keys that help us save adventures in quests. + if (LX_findHelpfulLowKey()) { return true; } + + // Cobb's Knob unlocks a lot of zones which contain generally useful keys for all classes (-combat, +meat, +adv). + // Also the +20% to all Muscle Gains key unlocks here. + if (L5_getEncryptionKey() || L5_findKnob()) { return true; } + + if (my_primestat() == $stat[Mysticality] && possessEquipment($item[Key sausage])) { + // Myst classes want access to Pandamonium Slums to find the demonic key (+20% to all Mysticality Gains). + // Get the -combat key first. + if (L6_friarsGetParts()) { return true; } } - // Stuff we need to do in this path to unlock key zones. - if (LX_pirateQuest()) { - return true; + // Island access for all classes. also farm the +20% to all Moxie Gains key + // (adventuring will be handled by LX_findHelpfulLowKey() for moxie classes but this'll complete the quest) + if (LX_hippyBoatman()) { return true; } + + // Desert access, Daily Dungeon and other early random stuff. + if (LX_loggingHatchet() || LX_unlockDesert() || LX_lockPicking() || LX_phatLootToken()) { return true; } + + // Get the Steel Organ if the user wants it (probably good in this path since turnbloat). + if (LX_steelOrgan()) { return true; } + + // Get the -combat key before attempting the Friars or the Spooky Forest. Also high priority to unlock the hidden temple for SR. + if (possessEquipment($item[Key sausage])) { + if (L6_friarsGetParts() + || L2_mosquito() + || LX_unlockHiddenTemple() + || LX_unlockHauntedLibrary() + || LX_getLadySpookyravensDancingShoes() + || LX_getLadySpookyravensPowderPuff()) { return true; } + } else { + // Make sure Cobb's Knob is open so we can get the key. + if (L5_getEncryptionKey() || L5_findKnob()) { return true; } } - if (LX_acquireLegendaryEpicWeapon()) { + + if (internalQuestStatus("questL12War") > -1) { + // Don't start the war unless we've acquired the key from Belowdecks first as it gives +item. + if (possessEquipment($item[Treasure Chest key])) { + if (L12_preOutfit() || L12_getOutfit() || L12_startWar() || L12_flyerFinish()) { return true; } + } else { + // Make sure Belowdecks is open so we can get the key. + if (LX_pirateQuest()) { return true; } + } + + // Get the +combat key before attempting Sonofa Beach. + if (possessEquipment($item[Music Box Key])) { + if (L12_sonofaBeach() || L12_sonofaFinish()) { return true; } + } else { + // Make sure Spookyraven Third Floor is open so we can get the key. + if (LX_spookyravenManorFirstFloor() || LX_spookyravenManorSecondFloor()) { return true; } + } + + // Get the +meat keys before attempting Themthar Hills. + if (possessEquipment($item[Knob treasury key]) && possessEquipment($item[Kekekey])) { + if (L12_themtharHills()) { return true; } + } else { + // Make sure Cobb's Knob is open so we can get the key. + if (L5_getEncryptionKey() || L5_findKnob()) { return true; } + // Make sure The Valley is open so we can get the key. + if (L9_chasmBuild() || L9_highLandlord()) { return true; } + } + + // Do the rest of the war. Should have the +item key already before we start the war. + if (L12_gremlins() || L12_filthworms() || L12_orchardFinalize() || L12_farm() || L12_finalizeWar()) { return true; } + } + + // Start the macguffin quest as we need it to unlock Belowdecks. + if (L11_blackMarket() || L11_forgedDocuments() || L11_mcmuffinDiary() || L11_getBeehive()) { return true; } + + // Lock in the Shen zones as soon as we can. + if (L11_shenStartQuest()) { return true; } + + if (internalQuestStatus("questL09Topping") > -1) { + // Get the Cold Damage key before doing the Orcs + // This gets blocked by the Shen softlock so do it as soon as we feasibly can as one of the +meat keys requires the L9 quest finished. + if (possessEquipment($item[Ice Key])) { + if (L9_chasmBuild()) { return true; } + } else { + // Make sure the Icy Peak is available so we can get the key + if (L8_trapperQuest()) { return true; } + } + // Get the ML keys before doing Oil peak and Spooky Res key before doing Aboo Peak (should have Cold Res key already for the Orc Chasm). + if (possessEquipment($item[F\'c\'le sh\'c\'le k\'y]) + && possessEquipment($item[Clown car key]) + && possessEquipment($item[Weremoose key])) { + if (L9_highLandlord()) { return true; } + } else { + // Make sure the F'c'le is open so we can get the key + if (LX_pirateOutfit() || LX_joinPirateCrew()) { return true; } + // Make sure the "Fun" House is open so we can get the key + if (LX_acquireEpicWeapon()) { return true; } + } + } + + if (internalQuestStatus("questL11MacGuffin") > -1) { + // open the hidden city up. + if (L11_nostrilOfTheSerpent() || L11_unlockHiddenCity()) { return true; } + + // +item helps with getting fulminate ingredients, Hidden City drops and Copperhead/Zeppelin. + if (possessEquipment($item[Treasure Chest key])) { + if (L11_talismanOfNam() || L11_mauriceSpookyraven()) { return true; } + } else { + // Make sure Belowdecks is open so we can get the key. + if (LX_pirateQuest()) { return true; } + } + + // Dance with lady spookyraven so we can go murder her undead husband and take the Eye of Ed + if (LX_spookyravenManorFirstFloor() || LX_spookyravenManorSecondFloor()) { return true; } + + // Murder pygmies for the ancient amulet. + if (L11_hiddenCityZones() || L11_hiddenCity()) { return true; } + + // Finish the other Macguffin zones so we can beat Ed to death repeatedly and waste all his Ka coins. + if (L11_palindome() || L11_aridDesert() || L11_unlockPyramid()) { return true; } + // should do the tavern before trying to do the pyramid so we can use any tangles we get lucky with. + if (internalQuestStatus("questL03Rat") > 2) { + if (L11_unlockEd() || L11_defeatEd()) { return true; } + } else { + set_property("auto_forceTavern", true); + if (L3_tavern()) { return true; } + } + } + + // Open up the top of the beanstalk. + if (L10_plantThatBean()) { return true; } + + // Should have the -combat key long before level 10 but lets just make sure. + if (possessEquipment($item[Key sausage])) { + if (L10_airship() || L10_basement() || L10_ground() || L10_topFloor() || L10_holeInTheSkyUnlock()) { return true; } + } else { + // Make sure Cobb's Knob is open so we can get the key. + if (L5_getEncryptionKey() || L5_findKnob()) { return true; } + } + + // Ascend the peak. + if (L8_trapperQuest()) { return true; } + + // -combat and ML keys help with 2 of these zones but this quest is a monolithic function. + // TODO: split it up into zones then guard with possession of keys. + if (L7_crypt()) { return true; } + + // Finish off the Goblin King. + if (L5_slayTheGoblinKing()) { return true; } + + // Show the Boss bat who's boss. + if (L4_batCave()) { return true; } + + // Fix that dripping tap. + if (L3_tavern()) { return true; } + + // this quest and these zones are open either from the start or level 4. + // so lets do this if we have nothing better to do yet. + if (possessEquipment($item[aquí]) && possessEquipment($item[batting cage key])) { + if (LX_unlockHauntedBilliardsRoom()) { return true; } + } else { + // hot res for the Haunted Kitchen. aquí needs Desert Beach Access + if (lowkey_keyAdv($item[aquí])) { return true; } + // stench res for the Haunted Kitchen + if (lowkey_keyAdv($item[batting cage key])) { return true; } + } + + // Spookyraven quest steps that don't need -combat or resists, just monster killin' (or dancing with a ghost for stats). + if (LX_danceWithLadySpookyraven() || LX_getLadySpookyravensFinestGown() || LX_unlockManorSecondFloor()) { return true; } + + if (L12_clearBattlefield()) { return true; } // This is a mess and if it's not last, it screws up the war massively. + + // Stuff we need to do in this path to unlock key zones. + if (LX_pirateQuest()) { return true; } + if (LX_acquireEpicWeapon()) { return true; } + + // If literally nothing better to do, go find some of the keys we don't actually care about but have to find anyway. + location loc = lowkey_nextAvailableKeyLocation(); + if (loc != $location[none] && autoAdv(loc)) { return true; } + + // unlock the door, climb the tower, commit sorceresscide. + if (L13_sorceressDoor() || L13_towerNSTower() || L13_towerNSNagamar() || L13_towerNSFinal()) { return true; } + + // Release the softblock on quests that are waiting for Shen quest. + if (my_level() > get_property("auto_shenSkipLastLevel").to_int() && get_property("questL11Shen") != "finished") { + auto_log_warning("I was trying to avoid zones that Shen might need, but I've run out of stuff to do.", "red"); + set_property("auto_shenSkipLastLevel", my_level()); return true; } + + if (LX_attemptPowerLevel()) { return true; } + return false; } \ No newline at end of file diff --git a/RELEASE/scripts/autoscend/quests/level_10.ash b/RELEASE/scripts/autoscend/quests/level_10.ash index 7f343b729..2cd21b8a8 100644 --- a/RELEASE/scripts/autoscend/quests/level_10.ash +++ b/RELEASE/scripts/autoscend/quests/level_10.ash @@ -62,15 +62,6 @@ boolean L10_airship() { bat_formBats(); } - else - { - providePlusNonCombat(25); - - buffMaintain($effect[Fishy Whiskers], 0, 1, 1); - buffMaintain($effect[Snow Shoes], 0, 1, 1); - buffMaintain($effect[Fishy\, Oily], 0, 1, 1); - buffMaintain($effect[Gummed Shoes], 0, 1, 1); - } if (isActuallyEd() && $location[The Penultimate Fantasy Airship].turns_spent < 1) { @@ -129,10 +120,8 @@ boolean L10_basement() set_property("choiceAdventure669", "1"); // The Fast and the Furry-ous: Open Ground floor (with Umbrella) or Neckbeard Choice } - if(!auto_forceNextNoncombat()) - { - providePlusNonCombat(25); - } + auto_forceNextNoncombat(); + if((my_class() == $class[Gelatinous Noob]) && auto_have_familiar($familiar[Robortender])) { if(!have_skill($skill[Bendable Knees]) && (item_amount($item[Bottle of Gregnadigne]) == 0)) @@ -226,7 +215,6 @@ boolean L10_ground() } auto_sourceTerminalEducate($skill[Extract], $skill[Portscan]); - providePlusNonCombat(25); if((my_class() == $class[Gelatinous Noob]) && auto_have_familiar($familiar[Robortender])) { @@ -305,10 +293,7 @@ boolean L10_topFloor() set_property("choiceAdventure679", 1); } - if(!auto_forceNextNoncombat()) - { - providePlusNonCombat(25); - } + auto_forceNextNoncombat(); autoEquip($item[mohawk wig]); autoAdv(1, $location[The Castle in the Clouds in the Sky (Top Floor)]); @@ -359,10 +344,7 @@ boolean L10_holeInTheSkyUnlock() set_property("choiceAdventure678", 3); set_property("choiceAdventure676", 4); - if(!auto_forceNextNoncombat()) - { - providePlusNonCombat(25); - } + auto_forceNextNoncombat(); autoAdv(1, $location[The Castle in the Clouds in the Sky (Top Floor)]); return true; diff --git a/RELEASE/scripts/autoscend/quests/level_11.ash b/RELEASE/scripts/autoscend/quests/level_11.ash index 887441f89..7d8a31a14 100644 --- a/RELEASE/scripts/autoscend/quests/level_11.ash +++ b/RELEASE/scripts/autoscend/quests/level_11.ash @@ -111,7 +111,6 @@ boolean LX_unlockHiddenTemple() { // TODO: add a check for delay burning auto_log_info("Attempting to make the Hidden Temple less hidden.", "blue"); pullXWhenHaveY($item[Spooky-Gro Fertilizer], 1, 0); - providePlusNonCombat(25, true); if (autoAdv($location[The Spooky Forest])) { if (item_amount($item[Spooky Temple map]) > 0 && item_amount($item[Spooky-Gro Fertilizer]) > 0 && item_amount($item[Spooky Sapling]) > 0) { use(1, $item[Spooky Temple Map]); @@ -249,10 +248,7 @@ boolean LX_unlockHauntedLibrary() //+3 pool skill & +1 training gains. speculative_pool_skill() already assumed we would use it if we can. buffMaintain($effect[Chalky Hand], 0, 1, 1); - if(!auto_forceNextNoncombat()) - { - providePlusNonCombat(25, true); - } + auto_forceNextNoncombat(); auto_log_info("It's billiards time!", "blue"); return autoAdv($location[The Haunted Billiards Room]); } @@ -293,15 +289,15 @@ boolean LX_spookyravenManorFirstFloor() { } boolean LX_danceWithLadySpookyraven() { - if (internalQuestStatus("questM21Dance") != 2) { + if (internalQuestStatus("questM21Dance") < 2 || internalQuestStatus("questM21Dance") > 3) { return false; } - if (item_amount($item[Lady Spookyraven\'s Powder Puff]) != 1 && item_amount($item[Lady Spookyraven\'s Dancing Shoes]) != 1 && item_amount($item[Lady Spookyraven\'s Finest Gown]) != 1) { - return false; + if (item_amount($item[Lady Spookyraven\'s Powder Puff]) == 1 && item_amount($item[Lady Spookyraven\'s Dancing Shoes]) == 1 && item_amount($item[Lady Spookyraven\'s Finest Gown]) == 1) { + visit_url("place.php?whichplace=manor2&action=manor2_ladys"); } + auto_log_info("Finished Spookyraven, just dancing with the lady.", "blue"); - visit_url("place.php?whichplace=manor2&action=manor2_ladys"); if (autoAdv($location[The Haunted Ballroom])) { if (in_lowkeysummer()) { // need to open the Haunted Nursery for the music box key. @@ -312,7 +308,7 @@ boolean LX_danceWithLadySpookyraven() { return false; } -boolean getLadySpookyravensFinestGown() { +boolean LX_getLadySpookyravensFinestGown() { if (internalQuestStatus("questM21Dance") != 1) { return false; } @@ -340,7 +336,7 @@ boolean getLadySpookyravensFinestGown() { return false; } -boolean getLadySpookyravensDancingShoes() { +boolean LX_getLadySpookyravensDancingShoes() { if (internalQuestStatus("questM21Dance") != 1) { return false; } @@ -355,10 +351,8 @@ boolean getLadySpookyravensDancingShoes() { auto_sourceTerminalEducate($skill[Extract], $skill[Portscan]); - if ($location[The Haunted Gallery].turns_spent >= 5) { - if (!auto_forceNextNoncombat()) { - providePlusNonCombat(25, true); - } + if (!zone_delay($location[The Haunted Gallery])._boolean) { + auto_forceNextNoncombat(); } if (autoAdv($location[The Haunted Gallery])) { return true; @@ -366,7 +360,7 @@ boolean getLadySpookyravensDancingShoes() { return false; } -boolean getLadySpookyravensPowderPuff() { +boolean LX_getLadySpookyravensPowderPuff() { if (internalQuestStatus("questM21Dance") != 1) { return false; } @@ -379,10 +373,8 @@ boolean getLadySpookyravensPowderPuff() { auto_sourceTerminalEducate($skill[Extract], $skill[Portscan]); - if ($location[The Haunted Bathroom].turns_spent >= 5) { - if (!auto_forceNextNoncombat()) { - providePlusNonCombat(25, true); - } + if (!zone_delay($location[The Haunted Bathroom])._boolean) { + auto_forceNextNoncombat(); } if (autoAdv($location[The Haunted Bathroom])) { return true; @@ -395,7 +387,7 @@ boolean LX_spookyravenManorSecondFloor() if (get_property("lastSecondFloorUnlock").to_int() < my_ascensions()) { return false; } - if (LX_danceWithLadySpookyraven() || getLadySpookyravensFinestGown() || getLadySpookyravensDancingShoes() || getLadySpookyravensPowderPuff()) { + if (LX_danceWithLadySpookyraven() || LX_getLadySpookyravensFinestGown() || LX_getLadySpookyravensDancingShoes() || LX_getLadySpookyravensPowderPuff()) { return true; } return false; @@ -438,11 +430,6 @@ boolean L11_blackMarket() set_property("auto_getBeehive", false); } - if(auto_my_path() != "Live. Ascend. Repeat.") - { - providePlusCombat(5, true); - } - autoEquip($slot[acc3], $item[Blackberry Galoshes]); //If we want the Beehive, and don\'t have enough adventures, this is dangerous. @@ -476,18 +463,13 @@ boolean L11_getBeehive() auto_log_info("Must find a beehive!", "blue"); - if (!auto_forceNextNoncombat()) { - providePlusNonCombat(25, true); - } + auto_forceNextNoncombat(); boolean advSpent = autoAdv($location[The Black Forest]); if(item_amount($item[beehive]) > 0) { set_property("auto_getBeehive", false); } - if (advSpent) { - return true; - } - return false; + return advSpent; } boolean L11_forgedDocuments() @@ -1410,11 +1392,6 @@ boolean L11_hiddenCityZones() } if (needMachete || needRelocate) { - // Try to get the NC so that we can relocate Janitors and get items quickly - if ($location[The Hidden Park].turns_spent < 6 && !auto_forceNextNoncombat()) { - // Machete NC is guaranteed on the 7th adventure here - providePlusNonCombat(25, true); - } return autoAdv($location[The Hidden Park]); } @@ -1490,10 +1467,9 @@ boolean L11_mauriceSpookyraven() return false; } - if (!auto_forceNextNoncombat()) { - providePlusNonCombat(25, true); + if (!zone_delay($location[The Haunted Ballroom])._boolean) { + auto_forceNextNoncombat(); } - return autoAdv($location[The Haunted Ballroom]); } if(item_amount($item[recipe: mortar-dissolving solution]) == 0) @@ -1692,8 +1668,6 @@ boolean L11_redZeppelin() buffMaintain($effect[Blood-Gorged], 0, 1, 1); pullXWhenHaveY($item[deck of lewd playing cards], 1, 0); - providePlusNonCombat(25); - if(item_amount($item[Flamin\' Whatshisname]) > 0) { backupSetting("choiceAdventure866", 3); @@ -1841,6 +1815,29 @@ boolean L11_ronCopperhead() return false; } +boolean L11_shenStartQuest() { + // as the first adventure in the Copperhead Club is always the first Shen NC + // we can adventure there once as soon as it's open to start the quest and lock in + // our zones + if (internalQuestStatus("questL11Shen") != 0) + { + return false; + } + if (autoAdv($location[The Copperhead Club])) { + if (internalQuestStatus("questL11Shen") == 1) { + set_property("auto_shenStarted", my_daycount()); + auto_log_info("It seems Shen has given us a quest.", "blue"); + auto_log_info("I am going to avoid the following zones until Shen tells me to go there or until I run out of other things to do:"); + int linec = 1; + foreach z, _ in shenZonesToAvoidBecauseMaybeSnake() { + auto_log_info(linec++ + ". " + z); + } + } + return true; + } + return false; +} + boolean L11_shenCopperhead() { if (internalQuestStatus("questL11Shen") < 0 || internalQuestStatus("questL11Shen") > 7) @@ -1850,7 +1847,11 @@ boolean L11_shenCopperhead() set_property("choiceAdventure1074", 1); - if (internalQuestStatus("questL11Shen") == 0 || internalQuestStatus("questL11Shen") == 2 || internalQuestStatus("questL11Shen") == 4 || internalQuestStatus("questL11Shen") == 6) + if (L11_shenStartQuest()) { + return true; + } + + if (internalQuestStatus("questL11Shen") == 2 || internalQuestStatus("questL11Shen") == 4 || internalQuestStatus("questL11Shen") == 6) { if (item_amount($item[Crappy Waiter Disguise]) > 0 && have_effect($effect[Crappily Disguised as a Waiter]) == 0 && !in_tcrs()) { @@ -1858,11 +1859,11 @@ boolean L11_shenCopperhead() // default to getting unnamed cocktails to turn into Flamin' Whatsisnames. int behindtheStacheOption = 4; - if (item_amount($item[priceless diamond]) > 0 || item_amount($item[Red Zeppelin Ticket]) > 0 || (internalQuestStatus("questL11Shen") == 6 && item_amount($item[unnamed cocktail]) > 0)) + if (item_amount($item[priceless diamond]) > 0 || item_amount($item[Red Zeppelin Ticket]) > 0 || my_meat() > 10000 || (internalQuestStatus("questL11Shen") == 6 && item_amount($item[unnamed cocktail]) > 0)) { if (get_property("copperheadClubHazard") != "lantern") { - // got priceless diamond or zeppelin ticket so lets burn the place down (and make Flamin' Whatsisnames) + // got priceless diamond or zeppelin ticket (or we are rich) so lets burn the place down (and make Flamin' Whatsisnames) behindtheStacheOption = 3; } } @@ -1877,16 +1878,8 @@ boolean L11_shenCopperhead() set_property("choiceAdventure855", behindtheStacheOption); } - if (!maximizeContains("-10ml")) - { - addToMaximize("-10ml"); - } - boolean retval = autoAdv($location[The Copperhead Club]); - if (maximizeContains("-10ml")) - { - removeFromMaximize("-10ml"); - } - return retval; + addToMaximize("-10ml"); + return autoAdv($location[The Copperhead Club]); } if((internalQuestStatus("questL11Shen") == 1) || (internalQuestStatus("questL11Shen") == 3) || (internalQuestStatus("questL11Shen") == 5)) diff --git a/RELEASE/scripts/autoscend/quests/level_12.ash b/RELEASE/scripts/autoscend/quests/level_12.ash index ced684dbb..d7dcd0103 100644 --- a/RELEASE/scripts/autoscend/quests/level_12.ash +++ b/RELEASE/scripts/autoscend/quests/level_12.ash @@ -731,8 +731,6 @@ boolean L12_startWar() handleBjornify($familiar[Grimstone Golem]); } - providePlusNonCombat(25); - if((my_path() != "Dark Gyffte") && (my_mp() > 50) && have_skill($skill[Incredible Self-Esteem]) && !get_property("_incredibleSelfEsteemCast").to_boolean()) { use_skill(1, $skill[Incredible Self-Esteem]); @@ -861,8 +859,6 @@ boolean L12_filthworms() } buffMaintain($effect[Frosty], 0, 1, 1); - addToMaximize("200item"); - //craft IOTM derivative that gives high item bonus if((!possessEquipment($item[A Light That Never Goes Out])) && (item_amount($item[Lump of Brituminous Coal]) > 0)) { @@ -1087,13 +1083,6 @@ boolean L12_sonofaBeach() if(auto_my_path() != "Live. Ascend. Repeat.") { - if(!providePlusCombat(25, true)) - { - auto_log_warning("Failure in +Combat acquisition or -Combat shrugging (lobsterfrogman), delaying", "red"); - equipBaseline(); - return false; - } - if(equipped_item($slot[acc1]) == $item[over-the-shoulder folder holder]) { if((item_amount($item[Ass-Stompers of Violence]) > 0) && (equipped_item($slot[acc1]) != $item[Ass-Stompers of Violence]) && can_equip($item[Ass-Stompers of Violence])) @@ -1234,12 +1223,6 @@ boolean L12_sonofaPrefix() if(auto_my_path() != "Live. Ascend. Repeat.") { - if(!providePlusCombat(25)) - { - auto_log_warning("Failure in +Combat acquisition or -Combat shrugging (lobsterfrogman), delaying", "red"); - return false; - } - if(equipped_item($slot[acc1]) == $item[over-the-shoulder folder holder]) { if((item_amount($item[Ass-Stompers of Violence]) > 0) && (equipped_item($slot[acc1]) != $item[Ass-Stompers of Violence]) && can_equip($item[Ass-Stompers of Violence])) @@ -1548,16 +1531,8 @@ boolean L12_themtharHills() } buffMaintain($effect[Purr of the Feline], 10, 1, 1); songboomSetting("meat"); - - if(!canChangeFamiliar()) - { - addToMaximize("200meat drop"); - } - else - { - addToMaximize("200meat drop,switch Hobo Monkey,switch rockin' robin,switch adventurous spelunker,switch Grimstone Golem,switch Fist Turkey,switch Unconscious Collective,switch Golden Monkey,switch Angry Jung Man,switch Leprechaun,switch cat burglar"); - handleFamiliar(my_familiar()); - } + handleFamiliar("meat"); + addToMaximize("200meat drop"); if(get_property("auto_useWishes").to_boolean()) { @@ -1623,6 +1598,7 @@ boolean L12_themtharHills() // if we're in a 100% run, this property returns "none" which will unequip our familiar and ruin a 100% run. use_familiar(to_familiar(get_property("auto_familiarChoice"))); } + equipMaximizedGear(); float meatDropHave = meat_drop_modifier(); if (isActuallyEd() && have_skill($skill[Curse of Fortune]) && item_amount($item[Ka Coin]) > 0) diff --git a/RELEASE/scripts/autoscend/quests/level_13.ash b/RELEASE/scripts/autoscend/quests/level_13.ash index 480c27765..437fc70b0 100644 --- a/RELEASE/scripts/autoscend/quests/level_13.ash +++ b/RELEASE/scripts/autoscend/quests/level_13.ash @@ -649,14 +649,16 @@ boolean L13_sorceressDoor() return false; } + if (LX_getDigitalKey() || LX_getStarKey()) { + return true; + } + // Low Key Summer has an entirely different door. if (in_lowkeysummer()) { return L13_sorceressDoorLowKey(); } - if(LX_getDigitalKey()) return true; - string page = visit_url("place.php?whichplace=nstower_door"); if(contains_text(page, "ns_lock6")) { @@ -956,14 +958,10 @@ boolean L13_towerNSTower() { cli_execute("concert 2"); } - if(!canChangeFamiliar()) - { - addToMaximize("200meat drop"); - } - else - { - addToMaximize("200meat drop,switch hobo monkey,switch rockin' robin,switch adventurous spelunker,switch grimstone golem,switch fist turkey,switch unconscious collective,switch golden monkey,switch angry jung man,switch leprechaun,switch cat burglar"); - } + + handleFamiliar("meat"); + addToMaximize("200meat drop"); + if(my_class() == $class[Seal Clubber]) { autoEquip($item[Meat Tenderizer is Murder]); diff --git a/RELEASE/scripts/autoscend/quests/level_2.ash b/RELEASE/scripts/autoscend/quests/level_2.ash index 7e3d4189f..ced1ea1d3 100644 --- a/RELEASE/scripts/autoscend/quests/level_2.ash +++ b/RELEASE/scripts/autoscend/quests/level_2.ash @@ -8,7 +8,6 @@ boolean L2_mosquito() } // Arboreal Respite choice adventure has a delay of 5 adventures. // TODO: add a check for delay burning? - providePlusNonCombat(25, true); auto_log_info("Trying to find a mosquito.", "blue"); if (autoAdv($location[The Spooky Forest])) { if (internalQuestStatus("questL02Larva") > 0 || item_amount($item[mosquito larva]) > 0) diff --git a/RELEASE/scripts/autoscend/quests/level_5.ash b/RELEASE/scripts/autoscend/quests/level_5.ash index 7b98a2e78..e7ea69c04 100644 --- a/RELEASE/scripts/autoscend/quests/level_5.ash +++ b/RELEASE/scripts/autoscend/quests/level_5.ash @@ -147,4 +147,9 @@ boolean L5_goblinKing() council(); } return advSpent; +} + +boolean L5_slayTheGoblinKing() { + if (L5_getEncryptionKey() || L5_findKnob() || L5_haremOutfit() || L5_goblinKing()) { return true; } + return false; } \ No newline at end of file diff --git a/RELEASE/scripts/autoscend/quests/level_6.ash b/RELEASE/scripts/autoscend/quests/level_6.ash index dff02564c..f8de65b21 100644 --- a/RELEASE/scripts/autoscend/quests/level_6.ash +++ b/RELEASE/scripts/autoscend/quests/level_6.ash @@ -11,9 +11,6 @@ boolean L6_friarsGetParts() handleBjornify($familiar[Grimstone Golem]); } - buffMaintain($effect[Snow Shoes], 0, 1, 1); - buffMaintain($effect[Gummed Shoes], 0, 1, 1); - if($location[The Dark Heart of the Woods].turns_spent == 0) { visit_url("friars.php?action=friars&pwd"); @@ -31,8 +28,6 @@ boolean L6_friarsGetParts() autoEquip($slot[Shirt], $item[none]); } - providePlusNonCombat(25); - if(auto_have_familiar($familiar[Space Jellyfish]) && (get_property("_spaceJellyfishDrops").to_int() < 2)) { handleFamiliar($familiar[Space Jellyfish]); diff --git a/RELEASE/scripts/autoscend/quests/level_7.ash b/RELEASE/scripts/autoscend/quests/level_7.ash index fa82fd165..af1aaed3d 100644 --- a/RELEASE/scripts/autoscend/quests/level_7.ash +++ b/RELEASE/scripts/autoscend/quests/level_7.ash @@ -172,8 +172,6 @@ boolean L7_crypt() auto_MaxMLToCap(auto_convertDesiredML(149), true); - providePlusNonCombat(25); - addToMaximize("200ml " + auto_convertDesiredML(149) + "max"); autoAdv(1, $location[The Defiled Cranny]); return true; diff --git a/RELEASE/scripts/autoscend/quests/level_8.ash b/RELEASE/scripts/autoscend/quests/level_8.ash index 1464d203b..13703ebfa 100644 --- a/RELEASE/scripts/autoscend/quests/level_8.ash +++ b/RELEASE/scripts/autoscend/quests/level_8.ash @@ -318,7 +318,6 @@ boolean L8_getMineOres() } else { if (!possessOutfit("Mining Gear")) { auto_log_info("Getting Mining Gear.", "blue"); - providePlusNonCombat(25); return autoAdv($location[Itznotyerzitz Mine]); } else if (possessOutfit("Mining Gear", true)) { equipMaximizedGear(); @@ -415,7 +414,6 @@ boolean L8_trapperExtreme() } auto_log_info("Penguin Tony Hawk time. Extreme!! SSX Tricky!!", "blue"); - providePlusNonCombat(25); return autoAdv($location[The eXtreme Slope]); } diff --git a/RELEASE/scripts/autoscend/quests/level_9.ash b/RELEASE/scripts/autoscend/quests/level_9.ash index c9c2c32df..e30fc8ecb 100644 --- a/RELEASE/scripts/autoscend/quests/level_9.ash +++ b/RELEASE/scripts/autoscend/quests/level_9.ash @@ -625,7 +625,6 @@ boolean L9_twinPeak() { handleBjornify($familiar[Grimstone Golem]); } - providePlusNonCombat(25); buffMaintain($effect[Fishy Whiskers], 0, 1, 1); //heavy rains specific reduce item drop penalty by 10% @@ -820,12 +819,6 @@ boolean L9_oilPeak() } } - // Help protect ourselves against not getting enough crudes if tackling cartels - if(simMaximizeWith("1000ml 100min")) - { - addToMaximize("120item"); - } - addToMaximize("1000ml " + auto_convertDesiredML(100) + "max"); auto_log_info("Oil Peak with ML: " + monster_level_adjustment(), "blue"); diff --git a/RELEASE/scripts/autoscend/quests/level_any.ash b/RELEASE/scripts/autoscend/quests/level_any.ash index 134bc367f..a0984c54b 100644 --- a/RELEASE/scripts/autoscend/quests/level_any.ash +++ b/RELEASE/scripts/autoscend/quests/level_any.ash @@ -247,7 +247,7 @@ boolean LX_hippyBoatman() { return false; } - if (get_property("questM19Hippy") == "finished") { // TODO: replace this with internalQuestStatus when you have the steps + if (internalQuestStatus("questM19Hippy") > 3) { return false; } @@ -264,26 +264,40 @@ boolean LX_hippyBoatman() { return true; } - if (autoAdv($location[The Old Landfill])) { - if (item_amount($item[Old Claw-Foot Bathtub]) > 0 && item_amount($item[Old Clothesline Pole]) > 0 && item_amount($item[Antique Cigar Sign]) > 0 && item_amount($item[Worse Homes and Gardens]) > 0) { - create(1, $item[junk junk]); - visit_url("place.php?whichplace=woods&action=woods_hippy"); + if (item_amount($item[Old Claw-Foot Bathtub]) > 0 && item_amount($item[Old Clothesline Pole]) > 0 && item_amount($item[Antique Cigar Sign]) > 0 && item_amount($item[Worse Homes and Gardens]) > 0) { + create(1, $item[junk junk]); + visit_url("place.php?whichplace=woods&action=woods_hippy"); + if (internalQuestStatus("questM19Hippy") > 3) { + return true; } - return true; + abort("Failed to create the junk junk or finish the quest for some reason!"); } - return false; + + return autoAdv($location[The Old Landfill]); } void oldLandfillChoiceHandler(int choice) { if (choice == 794) { // Once More Unto the Junk - if (item_amount($item[Old Claw-Foot Bathtub]) == 0) { - run_choice(1); // go to The Bathroom of Ten Men (#795) - } else if(item_amount($item[Old Clothesline Pole]) == 0) { - run_choice(2); // go to The Den of Iquity (#796) - } else if(item_amount($item[Antique Cigar Sign]) == 0) { - run_choice(3); // go to Let's Workshop This a Little (#797) + if (item_amount($item[junk junk]) == 0) { + if (item_amount($item[Old Claw-Foot Bathtub]) == 0) { + run_choice(1); // go to The Bathroom of Ten Men (#795) + } else if(item_amount($item[Old Clothesline Pole]) == 0) { + run_choice(2); // go to The Den of Iquity (#796) + } else if(item_amount($item[Antique Cigar Sign]) == 0) { + run_choice(3); // go to Let's Workshop This a Little (#797) + } else { + run_choice(1); // go to The Bathroom of Ten Men (#795) + } } else { - run_choice(1); // go to The Bathroom of Ten Men (#795) + // TODO: Add handling to get the eternal car battery + // doesn't look like there's mafia tracking for it yet. + if (item_amount($item[tangle of copper wire]) == 0) { + run_choice(2); // go to The Den of Iquity (#796) + } else if (item_amount($item[Junk-Bond]) == 0) { + run_choice(3); // go to Let's Workshop This a Little (#797) + } else { + run_choice(1); // go to The Bathroom of Ten Men (#795) + } } } else if (choice == 795) { // The Bathroom of Ten Men if (item_amount($item[Old Claw-Foot Bathtub]) == 0) { diff --git a/RELEASE/scripts/autoscend/quests/optional.ash b/RELEASE/scripts/autoscend/quests/optional.ash index 6a38794fb..6add2c538 100644 --- a/RELEASE/scripts/autoscend/quests/optional.ash +++ b/RELEASE/scripts/autoscend/quests/optional.ash @@ -42,6 +42,133 @@ boolean LX_artistQuest() return false; } +boolean LX_unlockThinknerdWarehouse(boolean spend_resources) +{ + //unlocks [The Thinknerd Warehouse], returns true if successful or adv is spent + //much easier to do if you already have torso awaregness + + if(internalQuestStatus("questM22Shirt") > -1) + { + return false; + } + + auto_log_debug("Trying to unlock [The Thinknerd Warehouse] with spend_resources set to " + spend_resources); + + //unlocking is a multi step process. We want to try things in reverse to conserve resources and in case some steps were already complete. + + boolean useLetter() + { + if(item_amount($item[Letter for Melvign the Gnome]) > 0) + { + if(use(1, $item[Letter for Melvign the Gnome])) + { + auto_log_debug("Successfully unlocked the [The Thinknerd Warehouse]"); + return true; + } + else + { + abort("Somehow failed to use [Letter for Melvign the Gnome]... aborting to prevent infinite loops"); + } + } + return false; + } + + item target_shirt = $item[none]; + boolean hasShirt = false; + + //one time initial scan of inventory + foreach it in get_inventory() + { + if(to_slot(it) == $slot[shirt]) + { + target_shirt = it; + hasShirt = true; + break; + } + } + + boolean useShirtThenLetter() + { + if(!hasShirt) + { + return false; + } + string temp = visit_url("inv_equip.php?pwd&which=2&action=equip&whichitem=" + target_shirt.to_int()); + if(useLetter()) return true; + auto_log_error("For some reason LX_unlockThinknerdWarehouse failed when trying to use the shirt [" + target_shirt + "] to get [Letter for Melvign the Gnome] to start the quest", "red"); + return false; + } + void getShirtWhenHaveNone(item it) + { + if(hasShirt) return; + if(canPull(it)) + { + if(pullXWhenHaveY(it, 1, 0)) + { + target_shirt = it; + hasShirt = true; + } + } + else if(creatable_amount(it) > 0 && (spend_resources || knoll_available())) + { + if(create(1, it)) + { + target_shirt = it; + hasShirt = true; + } + } + } + + //if you already had a shirt or a letter, then just unlock the quest now + if(useLetter()) return true; + if(useShirtThenLetter()) return true; + + //Try to acquire a shirt. + + //IOTM that does not require a pull + januaryToteAcquire($item[Letter For Melvign The Gnome]); //no stats and no pull required + if(useLetter()) return true; + + //TODO, make the following IOTM foldables actually work + //getShirtWhenHaveNone($item[flaming pink shirt]) //foldable IOTM that requires torso awaregness. + //getShirtWhenHaveNone($item[origami pasties]) //foldable IOTM that requires torso awaregness. + //getShirtWhenHaveNone($item[sugar shirt]) //libram summons sugar sheet, multiuse 1 with torso awaregness to get sugar shirt + + //Shirts to pull + getShirtWhenHaveNone($item[Sneaky Pete\'s leather jacket]); //useful IOTM shirt with no state requirements to wear + getShirtWhenHaveNone($item[Sneaky Pete\'s leather jacket (collar popped)]); + getShirtWhenHaveNone($item[Professor What T-Shirt]); //you likely have it, no requirements to wear, very cheap in mall + + //Shirts to smith. Will likely cost 1 adv unless in knoll sign. + getShirtWhenHaveNone($item[white snakeskin duster]); //7 mus req + getShirtWhenHaveNone($item[clownskin harness]); //15 mus req + getShirtWhenHaveNone($item[demonskin jacket]); //25 mus req + getShirtWhenHaveNone($item[gnauga hide vest]); //25 mus req + getShirtWhenHaveNone($item[tuxedo shirt]); //35 mus req + getShirtWhenHaveNone($item[yak anorak]); //42 mus req + getShirtWhenHaveNone($item[hipposkin poncho]); //45 mus req + getShirtWhenHaveNone($item[lynyrdskin tunic]); //70 mus req + getShirtWhenHaveNone($item[bat-ass leather jacket]); //77 mus req + + //wish for a shirt + if(spend_resources && wishesAvailable() > 0 && shouldUseWishes() && item_amount($item[blessed rustproof +2 gray dragon scale mail]) == 0) + { + makeGenieWish("for a blessed rustproof +2 gray dragon scale mail"); + target_shirt = $item[blessed rustproof +2 gray dragon scale mail]; + hasShirt = true; + } + + //TODO adventure somewhere to acquire shirt + //if(spend_resources && hasTorso()) + + //did we succeeded in getting a shirt? use it and then the letter. + if(useShirtThenLetter()) return true; + + //sadness, we couldn't unlock this zone. + auto_log_debug("Failed to unlock [The Thinknerd Warehouse]"); + return false; +} + boolean LX_melvignShirt() { //Do the quest [The Shirt Off His Lack of Back] to get the skill [Torso Awaregness] from melvign the gnome. @@ -136,15 +263,6 @@ boolean LX_steelOrgan() { if((!possessEquipment($item[Observational Glasses]) || item_amount($item[Imp Air]) < 5) && item_amount($item[Azazel\'s Tutu]) == 0) { - if(!possessEquipment($item[Observational Glasses])) - { - uneffect($effect[The Sonata of Sneakiness]); - buffMaintain($effect[Hippy Stench], 0, 1, 1); - buffMaintain($effect[Carlweather\'s Cantata of Confrontation], 10, 1, 1); - buffMaintain($effect[Musk of the Moose], 10, 1, 1); - # Should we check for -NC stuff and deal with it? - # We need a Combat Modifier controller - } autoAdv(1, $location[The Laugh Floor]); } else if(((item_amount($item[Azazel\'s Unicorn]) == 0) || (item_amount($item[Bus Pass]) < 5)) && (item_amount($item[Azazel\'s Tutu]) == 0)) @@ -218,16 +336,6 @@ boolean LX_steelOrgan() return true; } - if(item_amount($item[Azazel\'s Unicorn]) == 0) - { - uneffect($effect[Carlweather\'s Cantata of Confrontation]); - buffMaintain($effect[The Sonata of Sneakiness], 20, 1, 1); - buffMaintain($effect[Smooth Movements], 10, 1, 1); - } - else - { - uneffect($effect[The Sonata of Sneakiness]); - } autoAdv(1, $location[Infernal Rackets Backstage]); } else if((item_amount($item[Azazel\'s Lollipop]) == 0) && (item_amount($item[Azazel\'s Tutu]) == 0)) @@ -363,18 +471,20 @@ boolean LX_pirateOutfit() { if (get_property("lastIslandUnlock").to_int() < my_ascensions()) { return LX_islandAccess(); } + if (possessEquipment($item[peg key]) && !in_hardcore()) { + // if we have the key, just pull any outfit parts we are still missing + foreach _, it in outfit_pieces("Swashbuckling Getup") { + pullXWhenHaveY(it, 1, 0); + } + } if (possessOutfit("Swashbuckling Getup")) { - if (item_amount($item[The Big Book Of Pirate Insults]) == 0 && my_meat() > npc_price($item[The Big Book Of Pirate Insults])) { + if (possessOutfit("Swashbuckling Getup", true) && item_amount($item[The Big Book Of Pirate Insults]) == 0 && my_meat() > npc_price($item[The Big Book Of Pirate Insults])) { buyUpTo(1, $item[The Big Book Of Pirate Insults]); } return false; } auto_log_info("Searching for a pirate outfit.", "blue"); - providePlusNonCombat(25, true); - if (autoAdv($location[The Obligatory Pirate\'s Cove])) { - return true; - } - return false; + return autoAdv($location[The Obligatory Pirate\'s Cove]); } void piratesCoveChoiceHandler(int choice) { @@ -527,9 +637,6 @@ boolean LX_joinPirateCrew() { if (internalQuestStatus("questM12Pirate") == -1 || internalQuestStatus("questM12Pirate") == 1 || internalQuestStatus("questM12Pirate") == 3) { auto_log_info("Findin' the Cap'n", "blue"); autoOutfit("Swashbuckling Getup"); - if (numPirateInsults() >= 6) { - providePlusNonCombat(25, true); - } autoAdv($location[Barrrney\'s Barrr]); // this returns false on the Cap'n Caronch adventures for some reason. return true; } else if (internalQuestStatus("questM12Pirate") == 0) { @@ -541,12 +648,15 @@ boolean LX_joinPirateCrew() { auto_log_info("Attempting to infiltrate the frat house", "blue"); boolean infiltrationReady = false; if (possessOutfit("Frat Boy Ensemble", true)) { - autoOutfit("Frat Boy Ensemble"); + auto_log_info("We have the Frat Boy Ensemble, begin infiltration!", "blue"); + outfit("Frat Boy Ensemble"); infiltrationReady = true; } else if (possessEquipment($item[mullet wig]) && item_amount($item[briefcase]) > 0) { + auto_log_info("We have a mullet wig and a briefcase, begin infiltration!", "blue"); autoForceEquip($item[mullet wig]); infiltrationReady = true; } else if (possessEquipment($item[frilly skirt]) && item_amount($item[hot wing]) > 2) { + auto_log_info("We have hot wings and a frilly skirt, begin infiltration!", "blue"); autoForceEquip($item[frilly skirt]); infiltrationReady = true; } @@ -554,10 +664,12 @@ boolean LX_joinPirateCrew() { if (!infiltrationReady) { if (item_amount($item[hot wing]) > 2) { if (knoll_available() && my_meat() > npc_price($item[frilly skirt])) { + auto_log_info("We have hot wings but no frilly skirt. Lets go shopping!", "blue"); buyUpTo(1, $item[frilly skirt]); autoForceEquip($item[frilly skirt]); infiltrationReady = true; } else { + auto_log_info("We have hot wings but no frilly skirt. Lets go to the gym!", "blue"); if (internalQuestStatus("questM01Untinker") == -1) { visit_url("place.php?whichplace=forestvillage&preaction=screwquest&action=fv_untinker_quest"); } @@ -586,7 +698,6 @@ boolean LX_joinPirateCrew() { } else { auto_log_info("Insult gathering party.", "blue"); addToMaximize("-outfit Swashbuckling Getup"); - providePlusCombat(25, true); if (autoAdv($location[The Obligatory Pirate\'s Cove])) { return true; } @@ -627,11 +738,7 @@ boolean LX_fledglingPirateIsYou() { auto_log_info("F'c'le t'me!", "blue"); autoOutfit("Swashbuckling Getup"); - providePlusCombat(25, true); - if (autoAdv($location[The F\'c\'le])) { - return true; - } - return false; + return autoAdv($location[The F\'c\'le]); } void fcleChoiceHandler(int choice) { @@ -667,11 +774,7 @@ boolean LX_unlockBelowdecks() { auto_log_info("Swordfish? Every password was swordfish!", "blue"); autoEquip($item[pirate fledges]); - providePlusNonCombat(25, true); - if (autoAdv($location[The Poop Deck])) { - return true; - } - return false; + return autoAdv($location[The Poop Deck]); } boolean LX_pirateQuest() { @@ -681,14 +784,14 @@ boolean LX_pirateQuest() { return false; } -item[class] legendaryEpicWeapons; -legendaryEpicWeapons[$class[Seal Clubber]] = $item[Hammer of Smiting]; -legendaryEpicWeapons[$class[Turtle Tamer]] = $item[Chelonian Morningstar]; -legendaryEpicWeapons[$class[Pastamancer]] = $item[Greek Pasta Spoon of Peril]; -legendaryEpicWeapons[$class[Sauceror]] = $item[17-alarm Saucepan]; -legendaryEpicWeapons[$class[Disco Bandit]] = $item[Shagadelic Disco Banjo]; -legendaryEpicWeapons[$class[Accordion Thief]] = $item[Squeezebox of the Ages]; -// usage: item legendaryEpicWeapon = legendaryEpicWeapons[my_class()]; +item[class] epicWeapons; +epicWeapons[$class[Seal Clubber]] = $item[Hammer of Smiting]; +epicWeapons[$class[Turtle Tamer]] = $item[Chelonian Morningstar]; +epicWeapons[$class[Pastamancer]] = $item[Greek Pasta Spoon of Peril]; +epicWeapons[$class[Sauceror]] = $item[17-alarm Saucepan]; +epicWeapons[$class[Disco Bandit]] = $item[Shagadelic Disco Banjo]; +epicWeapons[$class[Accordion Thief]] = $item[Squeezebox of the Ages]; +// usage: item epicWeapon = epicWeapons[my_class()]; item[class] starterWeapons; starterWeapons[$class[Seal Clubber]] = $item[seal-clubbing club]; @@ -699,7 +802,7 @@ starterWeapons[$class[Disco Bandit]] = $item[disco ball]; starterWeapons[$class[Accordion Thief]] = $item[stolen accordion]; // usage: item starterWeapon = starterWeapons[my_class()]; -boolean LX_acquireLegendaryEpicWeapon() +boolean LX_acquireEpicWeapon() { if (internalQuestStatus("questG04Nemesis") > 4) { @@ -712,6 +815,7 @@ boolean LX_acquireLegendaryEpicWeapon() if(internalQuestStatus("questG04Nemesis") < 0) { visit_url("guild.php?place=scg"); //start quest + visit_url("guild.php?place=scg"); // No really, start the quest. cli_execute("refresh quests"); //fixes buggy tracking. confirmed still in mafia r20143 if (internalQuestStatus("questG04Nemesis") < 0) { @@ -719,9 +823,7 @@ boolean LX_acquireLegendaryEpicWeapon() } } - if (item_amount(legendaryEpicWeapons[my_class()]) > 0) { - return false; - } + if (item_amount(epicWeapons[my_class()]) > 0) { return false; } if (internalQuestStatus("questG04Nemesis") == 4) { visit_url("guild.php?place=scg"); @@ -735,17 +837,12 @@ boolean LX_acquireLegendaryEpicWeapon() addToMaximize("-equip " + starterWeapons[my_class()].to_string()); - if (autoAdv($location[The Unquiet Garves])) { - return true; - } - return false; + return autoAdv($location[The Unquiet Garves]); } // TODO: Add the rest of the Nemesis quest with a flag to enable doing it in-run? boolean LX_NemesisQuest() { - if(LX_guildUnlock()) return true; - if(LX_acquireLegendaryEpicWeapon()) return true; - + if (LX_guildUnlock() || LX_acquireEpicWeapon()) { return true; } return false; } \ No newline at end of file From c0b6d2ac6f9e2da7673cd66beddcf7c314e966e5 Mon Sep 17 00:00:00 2001 From: Perire2017 <32006553+Perire2017@users.noreply.github.com> Date: Thu, 9 Jul 2020 03:43:25 -0500 Subject: [PATCH 49/52] Fix trying to burn mana on Pre-adventure in Dark Gryffte (#483) * Fix trying to burn mana on Pre-adventure in Dark Gryffte The Pre-adventure attempt to burn mana (in my case by casting libram spells) would cause a script abort. * Update RELEASE/scripts/autoscend/auto_pre_adv.ash Co-authored-by: taltamir <7625366+taltamir@users.noreply.github.com> Co-authored-by: taltamir <7625366+taltamir@users.noreply.github.com> --- RELEASE/scripts/autoscend/auto_pre_adv.ash | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/RELEASE/scripts/autoscend/auto_pre_adv.ash b/RELEASE/scripts/autoscend/auto_pre_adv.ash index a9b74c8f8..245805568 100644 --- a/RELEASE/scripts/autoscend/auto_pre_adv.ash +++ b/RELEASE/scripts/autoscend/auto_pre_adv.ash @@ -487,11 +487,15 @@ boolean auto_pre_adventure() acquireHP(); } - int wasted_mp = my_mp() + mp_regen() - my_maxmp(); - if(wasted_mp > 0 && my_mp() > 400) + //my_mp is broken in Dark Gyffte + if (my_class() != $class[Vampyre]) { - auto_log_info("Burning " + wasted_mp + " MP..."); - cli_execute("burn " + wasted_mp); + int wasted_mp = my_mp() + mp_regen() - my_maxmp(); + if(wasted_mp > 0 && my_mp() > 400) + { + auto_log_info("Burning " + wasted_mp + " MP..."); + cli_execute("burn " + wasted_mp); + } } borisWastedMP(); @@ -534,4 +538,4 @@ void main() set_property("auto_interrupt", true); } } -} \ No newline at end of file +} From ff1aaef17c1266a6e779aff355702cf8d99a5fa6 Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Fri, 10 Jul 2020 00:50:01 -0600 Subject: [PATCH 50/52] fat loot token and daily dungeon (#482) reworked fat loot token acquisition. Primarily daily dungeon: - removed useMalware() function. it was an outdated duplicate of our daily dungeon code plus setting a combat directive to use maleware. this should have been done via combat function being set to use malware, which actually someone did add some time ago making useMalware() function entirely redundant - migrate choice handling for daily dungeon from old method (changing the choice adventure setting) to new method which uses auto_choice_adv.ash. in this case it points at void dailyDungeonChoiceHandler(int choice, string[int] options) - if you do not have a lockpick in the locked door daily dungeon NC use your primestat instead of hardcoding to always use muscle - in softcore if you do not have or cannot use a cubeling then pull daily dungeon tools which saves about 30 to 40 adv - when pulling lockpicks prefer to pull Platinum Yendorian Express Card if available instead of lockpicks - created and used float estimateDailyDungeonAdvNeeded() instead of just checking if you have 15 adventures. if you have the tools it takes fewer adventures - boolean LX_dailyDungeonToken() split off from LX_phatLootToken(). the latter has improved logic on when to do daily dungeon and when to do fantasy realm. fantasyrealm is always 5 adv. daily dungeon is 15 adv without the tools and ~3 adv with the tools. So we only want to prioritize daily dungeon over fantasy realm if we have the tools. - do not assume success when adventuring in daily dungeon. return the result of autoAdv() - make sure we have the means to handle choice adventure 692 [I Wanna Be a Door] before adventuring in daily dungeon - auto_forcePhatLootToken setting added. it lets you force grabbing phat loot tokens every day. mainly used for new accounts who need to farm enough tokens to grab the cubeling and the 3 skills Co-authored-by: Malibu Stacey <50261170+Malibu-Stacey@users.noreply.github.com> --- BUILD/settings/any.dat | 1 + RELEASE/data/autoscend_familiars.txt | 4 +- RELEASE/data/autoscend_settings.txt | 1 + RELEASE/scripts/autoscend/auto_choice_adv.ash | 11 +- .../scripts/autoscend/autoscend_header.ash | 5 +- RELEASE/scripts/autoscend/iotms/mr2016.ash | 86 +------ RELEASE/scripts/autoscend/quests/level_13.ash | 6 +- .../scripts/autoscend/quests/level_any.ash | 229 +++++++++++++----- 8 files changed, 190 insertions(+), 153 deletions(-) diff --git a/BUILD/settings/any.dat b/BUILD/settings/any.dat index 63e0aa7f5..53b60cb9a 100644 --- a/BUILD/settings/any.dat +++ b/BUILD/settings/any.dat @@ -48,3 +48,4 @@ auto_secondPlaceOrBust boolean When true, abort before each tower test if we can auto_helpMeMafiaIsSuperBrokenAaah boolean Pretty much just for werebear. If for some reason you find that mafia completely fails to detect item drops occasionally, leading to wasting a ton of adventures continuing to look for an item you already found, try this out. auto_logLevel string One of: critical, error, warning, info, debug, trace. Sets the level of log output for autoscend gcli and session log output. Critical showing the least detail (only critical messages) and trace showing the most detail (print everything). Defaults to info. auto_restoreUseBloodBond boolean Whether to use extra hp to cast blood bond. Blood bond has a recurring HP drain, set to false if you are worried about getting killed or wasting resources healing. Defaults to false. +auto_forcePhatLootToken boolean force grabbing the phat loot tokens from daily dungeon and fantasy realm every day even if you already have enough for this run. This is mainly for new accounts who want to get the cubeling and/or skillbooks. diff --git a/RELEASE/data/autoscend_familiars.txt b/RELEASE/data/autoscend_familiars.txt index f47d514e0..c9c4abfb4 100644 --- a/RELEASE/data/autoscend_familiars.txt +++ b/RELEASE/data/autoscend_familiars.txt @@ -27,7 +27,7 @@ drop 0 Fist Turkey prop:_turkeyBooze<5 # drops 1 per combat with chance of 2nd if wearing familiar specific equip drop 1 Puck Man item:Yellow Pixel<20 drop 2 Ms. Puck Man item:Yellow Pixel<20 -# 1st wax drop per run only takes 5 combats, afterwards 30. makes a single size 2 density 4.25 food or drink +# 1st wax drop per run only takes 5 combats, afterwards 30. makes a single size 2 density 4.25 food or drink drop 3 Optimistic Candle prop:optimisticCandleProgress>=25 # 1st robin egg per run only takes 5 combats, afterwards 30. potion that gives all res +3 drop 4 Rockin' Robin prop:rockinRobinProgress>=25 @@ -95,7 +95,7 @@ drop 32 XO Skeleton drop 33 Intergnat # Generates adventures after combat drop 34 Reagnimated Gnome -# Every 30 combats drops wax which makes a single size 2 density 4.25 food or drink +# Every 30 combats drops wax which makes a single size 2 density 4.25 food or drink drop 35 Optimistic Candle # Drops robin's egg every 30 combats. +3 all res potion drop 36 Rockin' Robin diff --git a/RELEASE/data/autoscend_settings.txt b/RELEASE/data/autoscend_settings.txt index 0c077756e..bbc62b5d9 100644 --- a/RELEASE/data/autoscend_settings.txt +++ b/RELEASE/data/autoscend_settings.txt @@ -56,6 +56,7 @@ any 46 auto_secondPlaceOrBust boolean When true, abort before each tower test if any 47 auto_helpMeMafiaIsSuperBrokenAaah boolean Pretty much just for werebear. If for some reason you find that mafia completely fails to detect item drops occasionally, leading to wasting a ton of adventures continuing to look for an item you already found, try this out. any 48 auto_logLevel string One of: critical, error, warning, info, debug, trace. Sets the level of log output for autoscend gcli and session log output. Critical showing the least detail (only critical messages) and trace showing the most detail (print everything). Defaults to info. any 49 auto_restoreUseBloodBond boolean Whether to use extra hp to cast blood bond. Blood bond has a recurring HP drain, set to false if you are worried about getting killed or wasting resources healing. Defaults to false. +any 50 auto_forcePhatLootToken boolean force grabbing the phat loot tokens from daily dungeon and fantasy realm every day even if you already have enough for this run. This is mainly for new accounts who want to get the cubeling and/or skillbooks. post 0 auto_getBeehive boolean Go for the beehive? post 1 auto_getStarKey boolean Get Richard's Star Key? diff --git a/RELEASE/scripts/autoscend/auto_choice_adv.ash b/RELEASE/scripts/autoscend/auto_choice_adv.ash index ff8ccbeec..83759e23a 100644 --- a/RELEASE/scripts/autoscend/auto_choice_adv.ash +++ b/RELEASE/scripts/autoscend/auto_choice_adv.ash @@ -4,6 +4,7 @@ import boolean auto_run_choice(int choice, string page) { auto_log_debug("Running auto_choice_adv.ash"); + string[int] options = available_choice_options(); switch (choice) { case 15: // Yeti Nother Hippy (The eXtreme Slope) @@ -136,6 +137,13 @@ boolean auto_run_choice(int choice, string page) case 575: // Duffel on the Double (The eXtreme Slope) theeXtremeSlopeChoiceHandler(choice); break; + case 689: // The Final Reward (Daily Dungeon 15th room) + case 690: // The First Chest Isn't the Deepest. (Daily Dungeon 5th room) + case 691: // Second Chest (Daily Dungeon 10th room) + case 692: // I Wanna Be a Door (Daily Dungeon) + case 693: // It's Almost Certainly a Trap (Daily Dungeon) + dailyDungeonChoiceHandler(choice, options); + break; case 780: // Action Elevator (The Hidden Apartment Building) if (auto_my_path() == "Pocket Familiars" && get_property("relocatePygmyLawyer").to_int() != my_ascensions()) { run_choice(3); // relocate lawyers to park @@ -375,7 +383,6 @@ boolean auto_run_choice(int choice, string page) } break; case 1062: // Lots of Options (The Overgrown Lot) - string[int] options = available_choice_options(); if (options contains 1) { run_choice(1); // get flowers for the doc } else { @@ -405,7 +412,7 @@ boolean auto_run_choice(int choice, string page) } int glchoice = 0; - foreach idx, str in available_choice_options() + foreach idx, str in options { if(contains_text(str,search)) { diff --git a/RELEASE/scripts/autoscend/autoscend_header.ash b/RELEASE/scripts/autoscend/autoscend_header.ash index 9658fffbb..a4b6ba67a 100644 --- a/RELEASE/scripts/autoscend/autoscend_header.ash +++ b/RELEASE/scripts/autoscend/autoscend_header.ash @@ -23,7 +23,9 @@ boolean LM_edTheUndying(); //Defined in autoscend/auto_edTheUndying.ash boolean LX_desertAlternate(); boolean LX_hippyBoatman(); boolean LX_lockPicking(); -boolean LX_phatLootToken(); +float estimateDailyDungeonAdvNeeded(); //Defined in autoscend/quests/level_any.ash +boolean LX_phatLootToken(); //Defined in autoscend/quests/level_any.ash +boolean LX_dailyDungeonToken(); //Defined in autoscend/quests/level_any.ash boolean LX_islandAccess(); boolean fancyOilPainting(); boolean LX_fcle(); @@ -1297,3 +1299,4 @@ void barrrneysBarrrChoiceHandler(int choice, string page); void fcleChoiceHandler(int choice); void itznotyerzitzMineChoiceHandler(int choice); void theeXtremeSlopeChoiceHandler(int choice); +void dailyDungeonChoiceHandler(int choice, string[int] options); //Defined in autoscend/quests/level_any.ash \ No newline at end of file diff --git a/RELEASE/scripts/autoscend/iotms/mr2016.ash b/RELEASE/scripts/autoscend/iotms/mr2016.ash index 8f8b74d54..743c106dc 100644 --- a/RELEASE/scripts/autoscend/iotms/mr2016.ash +++ b/RELEASE/scripts/autoscend/iotms/mr2016.ash @@ -1520,88 +1520,4 @@ boolean rethinkingCandy(effect acquire, boolean simulate) return false; } return false; -} - -// this function is completely pointless. This should be handled in auto_combathandler -// instead of writing a duplicate of our daily dungeon handling function. -boolean useMalware() -{ - if(towerKeyCount() >= 3) - { - return false; - } - - if(item_amount($item[Daily Dungeon Malware]) == 0) - { - return false; - } - - if(get_property("_dailyDungeonMalwareUsed").to_boolean()) - { - return false; - } - - if(get_property("dailyDungeonDone").to_boolean()) - { - return false; - } - - - backupSetting("choiceAdventure692", 4); - if(item_amount($item[Platinum Yendorian Express Card]) > 0) - { - backupSetting("choiceAdventure692", 7); - } - else if(item_amount($item[Pick-O-Matic Lockpicks]) > 0) - { - backupSetting("choiceAdventure692", 3); - } - else - { - int keysNeeded = 2; - if(contains_text(get_property("nsTowerDoorKeysUsed"), $item[Skeleton Key])) - { - keysNeeded = 1; - } - - if((item_amount($item[Skeleton Key]) < keysNeeded) && (available_amount($item[Skeleton Key]) >= keysNeeded)) - { - cli_execute("make 1 " + $item[Skeleton Key]); - } - if((item_amount($item[Skeleton Key]) < keysNeeded) && (available_amount($item[Skeleton Key]) >= keysNeeded)) - { - cli_execute("make 1 " + $item[Skeleton Key]); - } - if(item_amount($item[Skeleton Key]) >= keysNeeded) - { - backupSetting("choiceAdventure692", 2); - } - } - - if(item_amount($item[Eleven-Foot Pole]) > 0) - { - backupSetting("choiceAdventure693", 2); - } - else - { - backupSetting("choiceAdventure693", 1); - } - if(equipped_amount($item[Ring of Detect Boring Doors]) > 0) - { - backupSetting("choiceAdventure690", 2); - } - else - { - backupSetting("choiceAdventure690", 3); - } - - - //Wanderers may appear but they don\'t cause us to lose the malware. - set_property("auto_combatDirective", "start;item daily dungeon malware"); - autoAdv($location[The Daily Dungeon]); - set_property("auto_combatDirective", ""); - restoreSetting("choiceAdventure692"); - restoreSetting("choiceAdventure693"); - restoreSetting("choiceAdventure690"); - return true; -} +} \ No newline at end of file diff --git a/RELEASE/scripts/autoscend/quests/level_13.ash b/RELEASE/scripts/autoscend/quests/level_13.ash index 437fc70b0..13e3bdd35 100644 --- a/RELEASE/scripts/autoscend/quests/level_13.ash +++ b/RELEASE/scripts/autoscend/quests/level_13.ash @@ -675,11 +675,7 @@ boolean L13_sorceressDoor() if(towerKeyCount() < 3) { - while(useMalware()); - if(towerKeyCount() < 3) - { - abort("Do not have enough hero keys"); - } + abort("Do not have enough hero keys"); } if(contains_text(page, "ns_lock1")) diff --git a/RELEASE/scripts/autoscend/quests/level_any.ash b/RELEASE/scripts/autoscend/quests/level_any.ash index a0984c54b..04bf4b7d7 100644 --- a/RELEASE/scripts/autoscend/quests/level_any.ash +++ b/RELEASE/scripts/autoscend/quests/level_any.ash @@ -363,104 +363,217 @@ boolean LX_lockPicking() return get_property("lockPicked").to_boolean(); } -boolean LX_phatLootToken() +float estimateDailyDungeonAdvNeeded() { - if(towerKeyCount(false) >= 3) + //estimates the amount of adventures we expect to need to do the daily dungeon. the result is only an estimate and not exact. + //uses your current tools rather than potential tools. so it does not account for the possibility of pulling something or getting a cubeling drop. + + float progress = get_property("_lastDailyDungeonRoom").to_float(); + float adv_needed = 15 - progress; + if(progress < 5) { - return false; + adv_needed = adv_needed - 2; + if(possessEquipment($item[Ring of Detect Boring Doors])) + { + adv_needed = adv_needed - 4; + } } - if (get_property("dailyDungeonDone").to_boolean()) + else if(progress < 10) { - if (fantasyRealmToken()) + adv_needed = adv_needed - 1; + if(possessEquipment($item[Ring of Detect Boring Doors])) { - return true; + adv_needed = adv_needed - 2; } - return false; } - if(my_adventures() <= 15 - get_property("_lastDailyDungeonRoom").to_int()) + + int random_NC_tool_count = 0; + if(item_amount($item[Eleven-Foot Pole]) > 0) { - return false; + random_NC_tool_count++; } + if(item_amount($item[Platinum Yendorian Express Card]) > 0 || + item_amount($item[Pick-O-Matic Lockpicks]) > 0 || + (creatable_amount($item[Skeleton Key]) + item_amount($item[Skeleton Key]) > 2)) + { + random_NC_tool_count++; + } + + if(random_NC_tool_count > 0) + { + adv_needed = adv_needed / (1 + random_NC_tool_count); + } + + return adv_needed; +} +boolean LX_phatLootToken() +{ + if(towerKeyCount(false) >= 3 && !get_property("auto_forcePhatLootToken").to_boolean()) + { + return false; //have enough tokens + } + + if(!canChangeToFamiliar($familiar[Gelatinous Cubeling]) && in_hardcore()) + { + //if unable to get the daily dungeon tools then prefer to do fantasy realm over daily dungeon + if(fantasyRealmToken()) return true; + } + if(LX_dailyDungeonToken()) return true; + if(get_property("dailyDungeonDone").to_boolean()) + { + //wait until daily dungeon is done before considering doing fantasy realm + if(fantasyRealmToken()) return true; + } + + return false; +} + +boolean LX_dailyDungeonToken() +{ + if(get_property("dailyDungeonDone").to_boolean()) + { + return false; // already done today + } + if(!possessEquipment($item[Ring of Detect Boring Doors]) || item_amount($item[Eleven-Foot Pole]) == 0 || item_amount($item[Pick-O-Matic Lockpicks]) == 0) { if(canChangeToFamiliar($familiar[Gelatinous Cubeling])) { - return false; + return false; //we can switch to cubeling so wait until we have all the tools before doing daily dungeon } - else if(can_interact()) + } + + if(can_interact()) //if you can not use cubeling then mallbuy missing tools in casual and postronin + { + buyUpTo(1, $item[Eleven-Foot Pole]); + buyUpTo(1, $item[Pick-O-Matic Lockpicks]); + if(!possessEquipment($item[Ring of Detect Boring Doors])) //do not buy a second one if already equipped { - buyUpTo(1, $item[Eleven-Foot Pole]); - buyUpTo(1, $item[Pick-O-Matic Lockpicks]); buyUpTo(1, $item[Ring of Detect Boring Doors]); } } - - auto_log_info("Phat Loot Token Get!", "blue"); - set_property("choiceAdventure691", "2"); - if(get_property("_lastDailyDungeonRoom").to_int() == 4 || get_property("_lastDailyDungeonRoom").to_int() == 9) + + //if you can not use the cubeling then pull the missing tools if possible + pullXWhenHaveY($item[Eleven-Foot Pole], 1, 0); + if(!possessEquipment($item[Ring of Detect Boring Doors])) //do not pull a second one if already equipped { - autoEquip($slot[acc3], $item[Ring Of Detect Boring Doors]); + pullXWhenHaveY($item[Ring of Detect Boring Doors], 1, 0); } - - backupSetting("choiceAdventure692", 4); - if(item_amount($item[Platinum Yendorian Express Card]) > 0) + if(item_amount($item[Pick-O-Matic Lockpicks]) == 0) { - backupSetting("choiceAdventure692", 7); + pullXWhenHaveY($item[Platinum Yendorian Express Card], 1, 0); } - else if(item_amount($item[Pick-O-Matic Lockpicks]) > 0) + if(item_amount($item[Platinum Yendorian Express Card]) == 0) { - backupSetting("choiceAdventure692", 3); + pullXWhenHaveY($item[Pick-O-Matic Lockpicks], 1, 0); } - else + + //if you do not have an unlimited lockpick then handle skeleton keys and verify primary stat + if(item_amount($item[Platinum Yendorian Express Card]) == 0 && item_amount($item[Pick-O-Matic Lockpicks]) == 0) { - int keysNeeded = 2; + int skeleton_key_amt_needed = 2; if(contains_text(get_property("nsTowerDoorKeysUsed"), $item[Skeleton Key])) { - keysNeeded = 1; - } - - if((item_amount($item[Skeleton Key]) < keysNeeded) && (available_amount($item[Skeleton Key]) >= keysNeeded)) - { - cli_execute("make 1 " + $item[Skeleton Key]); + skeleton_key_amt_needed--; } - if((item_amount($item[Skeleton Key]) < keysNeeded) && (available_amount($item[Skeleton Key]) >= keysNeeded)) + + int skeleton_key_amt_to_create = skeleton_key_amt_needed - item_amount($item[Skeleton Key]); + skeleton_key_amt_to_create = min(creatable_amount($item[Skeleton Key]), skeleton_key_amt_to_create); + if(skeleton_key_amt_to_create > 0) { - cli_execute("make 1 " + $item[Skeleton Key]); + create(skeleton_key_amt_to_create, $item[Skeleton Key]); } - if(item_amount($item[Skeleton Key]) >= keysNeeded) + + //make sure we have the means to handle choice adventure 692 [I Wanna Be a Door] + if(item_amount($item[Skeleton Key]) < skeleton_key_amt_needed && my_basestat(my_primestat()) < 30) { - backupSetting("choiceAdventure692", 2); + //no lockpick, not enough skeleton key, and not enough primestat. + //checking basestat because buffed can become lower based on equipment worn. and also if mainstat is under 30 and you got no lockpicks then you should probably delay daily dungeon + return false; } } - - if(item_amount($item[Eleven-Foot Pole]) > 0) - { - backupSetting("choiceAdventure693", 2); - } - else - { - backupSetting("choiceAdventure693", 1); - } - if(possessEquipment($item[Ring of Detect Boring Doors])) + + // make sure we have enough adventures. since partial completion means wasted adventures. + int adv_budget = my_adventures() - auto_advToReserve(); + if(adv_budget < 1 + ceil(estimateDailyDungeonAdvNeeded())) { - backupSetting("choiceAdventure690", 2); - backupSetting("choiceAdventure691", 2); + return false; //not enough adv } - else + + auto_log_info("Doing the daily dungeon", "blue"); + + if(get_property("_lastDailyDungeonRoom").to_int() == 4 || get_property("_lastDailyDungeonRoom").to_int() == 9) { - backupSetting("choiceAdventure690", 3); - backupSetting("choiceAdventure691", 3); + autoEquip($slot[acc3], $item[Ring Of Detect Boring Doors]); } + return autoAdv(1, $location[The Daily Dungeon]); +} - autoAdv(1, $location[The Daily Dungeon]); - restoreSetting("choiceAdventure690"); - restoreSetting("choiceAdventure691"); - restoreSetting("choiceAdventure692"); - restoreSetting("choiceAdventure693"); +void dailyDungeonChoiceHandler(int choice, string[int] options) +{ + //noncombat choices handler for daily dungeon. + + switch (choice) + { + case 689: // The Final Reward (Daily Dungeon 15th room) + run_choice(1); // Get fat loot token + break; + case 690: // The First Chest Isn't the Deepest. (Daily Dungeon 5th room) + case 691: // Second Chest (Daily Dungeon 10th room) + if(options contains 2) + { + run_choice(2); // skip 3 rooms using ring of Detect Boring Doors + } + else + { + run_choice(3); // skip 1 room + } + break; + case 692: // I Wanna Be a Door (Daily Dungeon) + if(options contains 3) + { + run_choice(3); // use [Pick-O-Matic Lockpicks] to skip + } + else if(options contains 7) + { + run_choice(7); // use [Platinum Yendorian Express Card] to skip + } + else if(item_amount($item[Skeleton Key]) > 1 || + (item_amount($item[Skeleton Key]) > 0 && contains_text(get_property("nsTowerDoorKeysUsed"), $item[Skeleton Key]))) + { + run_choice(2); // use [Skeleton Key] to skip + } + else if(my_primestat() == $stat[Muscle] && my_buffedstat($stat[Muscle]) >= 30) + { + run_choice(4); // spend adv and not guarenteed to work + } + else if(my_primestat() == $stat[Mysticality] && my_buffedstat($stat[Mysticality]) >= 30) + { + run_choice(5); // spend adv and not guarenteed to work + } + else if(my_primestat() == $stat[Moxie] && my_buffedstat($stat[Moxie]) >= 30) + { + run_choice(6); // spend adv and not guarenteed to work + } + else abort("I made an error and tried to adventure in the daily dungeon when I have no means of handling [I Wanna Be a Door]"); + break; + case 693: // It's Almost Certainly a Trap (Daily Dungeon) + if(options contains 2) + { + run_choice(2); // use eleven-foot pole to skip + } + else + { + run_choice(1); // take damage to progress + } + break; + default: + abort("unhandled choice in dailyDungeonChoiceHandler"); + break; - return true; + } } boolean LX_dolphinKingMap() @@ -553,4 +666,4 @@ boolean dependenceDayClovers() return use(1, $item[green rocket]); } return false; -} \ No newline at end of file +} From a0f7bd2b1f0c61228016e2da049fe8d53d3cd549 Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Fri, 10 Jul 2020 01:14:31 -0600 Subject: [PATCH 51/52] fat loot tokens not phat loot token (#485) spelling correction --- BUILD/settings/any.dat | 2 +- RELEASE/data/autoscend_settings.txt | 2 +- RELEASE/relay/autoscend_quests.txt | 2 +- RELEASE/scripts/autoscend.ash | 2 +- RELEASE/scripts/autoscend/auto_deprecation.ash | 4 ++++ RELEASE/scripts/autoscend/autoscend_header.ash | 8 ++------ RELEASE/scripts/autoscend/paths/low_key_summer.ash | 2 +- RELEASE/scripts/autoscend/quests/level_any.ash | 4 ++-- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/BUILD/settings/any.dat b/BUILD/settings/any.dat index 53b60cb9a..f799f4220 100644 --- a/BUILD/settings/any.dat +++ b/BUILD/settings/any.dat @@ -48,4 +48,4 @@ auto_secondPlaceOrBust boolean When true, abort before each tower test if we can auto_helpMeMafiaIsSuperBrokenAaah boolean Pretty much just for werebear. If for some reason you find that mafia completely fails to detect item drops occasionally, leading to wasting a ton of adventures continuing to look for an item you already found, try this out. auto_logLevel string One of: critical, error, warning, info, debug, trace. Sets the level of log output for autoscend gcli and session log output. Critical showing the least detail (only critical messages) and trace showing the most detail (print everything). Defaults to info. auto_restoreUseBloodBond boolean Whether to use extra hp to cast blood bond. Blood bond has a recurring HP drain, set to false if you are worried about getting killed or wasting resources healing. Defaults to false. -auto_forcePhatLootToken boolean force grabbing the phat loot tokens from daily dungeon and fantasy realm every day even if you already have enough for this run. This is mainly for new accounts who want to get the cubeling and/or skillbooks. +auto_forceFatLootToken boolean force grabbing the fat loot tokens from daily dungeon and fantasy realm every day even if you already have enough for this run. This is mainly for new accounts who want to get the cubeling and/or skillbooks. diff --git a/RELEASE/data/autoscend_settings.txt b/RELEASE/data/autoscend_settings.txt index bbc62b5d9..c97e972a7 100644 --- a/RELEASE/data/autoscend_settings.txt +++ b/RELEASE/data/autoscend_settings.txt @@ -56,7 +56,7 @@ any 46 auto_secondPlaceOrBust boolean When true, abort before each tower test if any 47 auto_helpMeMafiaIsSuperBrokenAaah boolean Pretty much just for werebear. If for some reason you find that mafia completely fails to detect item drops occasionally, leading to wasting a ton of adventures continuing to look for an item you already found, try this out. any 48 auto_logLevel string One of: critical, error, warning, info, debug, trace. Sets the level of log output for autoscend gcli and session log output. Critical showing the least detail (only critical messages) and trace showing the most detail (print everything). Defaults to info. any 49 auto_restoreUseBloodBond boolean Whether to use extra hp to cast blood bond. Blood bond has a recurring HP drain, set to false if you are worried about getting killed or wasting resources healing. Defaults to false. -any 50 auto_forcePhatLootToken boolean force grabbing the phat loot tokens from daily dungeon and fantasy realm every day even if you already have enough for this run. This is mainly for new accounts who want to get the cubeling and/or skillbooks. +any 50 auto_forceFatLootToken boolean force grabbing the fat loot tokens from daily dungeon and fantasy realm every day even if you already have enough for this run. This is mainly for new accounts who want to get the cubeling and/or skillbooks. post 0 auto_getBeehive boolean Go for the beehive? post 1 auto_getStarKey boolean Get Richard's Star Key? diff --git a/RELEASE/relay/autoscend_quests.txt b/RELEASE/relay/autoscend_quests.txt index 9ff50db8f..d4f0e9b3b 100644 --- a/RELEASE/relay/autoscend_quests.txt +++ b/RELEASE/relay/autoscend_quests.txt @@ -6,7 +6,7 @@ 6 auto_clanstuff string ANY What was the last day we did 'end of day' clan stuff. 7 auto_cookie integer ANY HCCS Only: Tracks fortune cookie. 8 auto_crackpotjar string ANY Status of Crackpot Mystic Jar of Psychoses -9 auto_cubeItems boolean ANY Do we need to use the Gelatinous Cube for Phat Loot Tokens? +9 auto_cubeItems boolean ANY Do we need to use the Gelatinous Cube for Fat Loot Tokens? 10 auto_day1_dna string ANY 'finished' if we have hybridized ourselves at the start of Ascension. 11 auto_day_init string ANY Current daycount if we finished initializing today. 12 auto_disableAdventureHandling string ANY When set this prevents post/preadventure behavior. This is necessary for multi-adventure situations and 'a choice follows this' situations. diff --git a/RELEASE/scripts/autoscend.ash b/RELEASE/scripts/autoscend.ash index 0203535a8..fce092943 100644 --- a/RELEASE/scripts/autoscend.ash +++ b/RELEASE/scripts/autoscend.ash @@ -3383,7 +3383,7 @@ boolean doTasks() if(L6_dakotaFanning()) return true; if(L5_haremOutfit()) return true; if(LX_lockPicking()) return true; - if(LX_phatLootToken()) return true; + if(LX_fatLootToken()) return true; if(L5_goblinKing()) return true; if(LX_islandAccess()) return true; diff --git a/RELEASE/scripts/autoscend/auto_deprecation.ash b/RELEASE/scripts/autoscend/auto_deprecation.ash index 4b8621d33..1d1380895 100644 --- a/RELEASE/scripts/autoscend/auto_deprecation.ash +++ b/RELEASE/scripts/autoscend/auto_deprecation.ash @@ -394,6 +394,10 @@ boolean settingFixer() { remove_property("auto_phatloot"); } + if (property_exists("auto_forcePhatLootToken")) + { + remove_property("auto_forcePhatLootToken"); + } if (property_exists("auto_prewar")) { remove_property("auto_prewar"); diff --git a/RELEASE/scripts/autoscend/autoscend_header.ash b/RELEASE/scripts/autoscend/autoscend_header.ash index a4b6ba67a..d736ed7ca 100644 --- a/RELEASE/scripts/autoscend/autoscend_header.ash +++ b/RELEASE/scripts/autoscend/autoscend_header.ash @@ -24,7 +24,7 @@ boolean LX_desertAlternate(); boolean LX_hippyBoatman(); boolean LX_lockPicking(); float estimateDailyDungeonAdvNeeded(); //Defined in autoscend/quests/level_any.ash -boolean LX_phatLootToken(); //Defined in autoscend/quests/level_any.ash +boolean LX_fatLootToken(); //Defined in autoscend/quests/level_any.ash boolean LX_dailyDungeonToken(); //Defined in autoscend/quests/level_any.ash boolean LX_islandAccess(); boolean fancyOilPainting(); @@ -284,15 +284,11 @@ void removeCombat(); //Defined in autoscend/auto_equipment.ash int[item] auto_get_campground(); //Defined in autoscend/auto_util.ash -//Returns how many Hero Keys and Phat Loot tokens we have. +//Returns how many Hero Keys and Fat Loot tokens we have. //effective count (with malware) vs true count. int towerKeyCount(boolean effective); //Defined in autoscend/auto_util.ash int towerKeyCount(); //Defined in autoscend/auto_util.ash - -//Uses Daily Dungeon Malware to get Phat Loot. -boolean useMalware(); //Defined in autoscend.ash - //Determines if we need ore for the trapper or not. boolean needOre(); //Defined in autoscend/auto_util.ash diff --git a/RELEASE/scripts/autoscend/paths/low_key_summer.ash b/RELEASE/scripts/autoscend/paths/low_key_summer.ash index 1bb3a8270..cadff6c8c 100644 --- a/RELEASE/scripts/autoscend/paths/low_key_summer.ash +++ b/RELEASE/scripts/autoscend/paths/low_key_summer.ash @@ -353,7 +353,7 @@ boolean LX_lowkeySummer() { if (LX_hippyBoatman()) { return true; } // Desert access, Daily Dungeon and other early random stuff. - if (LX_loggingHatchet() || LX_unlockDesert() || LX_lockPicking() || LX_phatLootToken()) { return true; } + if (LX_loggingHatchet() || LX_unlockDesert() || LX_lockPicking() || LX_fatLootToken()) { return true; } // Get the Steel Organ if the user wants it (probably good in this path since turnbloat). if (LX_steelOrgan()) { return true; } diff --git a/RELEASE/scripts/autoscend/quests/level_any.ash b/RELEASE/scripts/autoscend/quests/level_any.ash index 04bf4b7d7..25de8cc54 100644 --- a/RELEASE/scripts/autoscend/quests/level_any.ash +++ b/RELEASE/scripts/autoscend/quests/level_any.ash @@ -407,9 +407,9 @@ float estimateDailyDungeonAdvNeeded() return adv_needed; } -boolean LX_phatLootToken() +boolean LX_fatLootToken() { - if(towerKeyCount(false) >= 3 && !get_property("auto_forcePhatLootToken").to_boolean()) + if(towerKeyCount(false) >= 3 && !get_property("auto_forceFatLootToken").to_boolean()) { return false; //have enough tokens } From 4e4afa3e5f5bbca0d096da1227edb30aa40eb0eb Mon Sep 17 00:00:00 2001 From: Samuel Gaus Date: Fri, 10 Jul 2020 10:16:51 +0100 Subject: [PATCH 52/52] =?UTF-8?q?Better=20handling=20for=20offhand/familia?= =?UTF-8?q?r=20equip/familiar=20in=20desert=20(+=20supp=E2=80=A6=20(#484)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Better handling for offhand/familiar equip/familiar in desert (+ support using melodramedary there!) * *make sure artistic goth kid has remaining free combats before using it in desert *add using mini hipster there too for free combats Co-authored-by: taltamir <7625366+taltamir@users.noreply.github.com> --- RELEASE/scripts/autoscend/quests/level_11.ash | 141 +++++++++++++++--- 1 file changed, 122 insertions(+), 19 deletions(-) diff --git a/RELEASE/scripts/autoscend/quests/level_11.ash b/RELEASE/scripts/autoscend/quests/level_11.ash index 7d8a31a14..2bf5b12d9 100644 --- a/RELEASE/scripts/autoscend/quests/level_11.ash +++ b/RELEASE/scripts/autoscend/quests/level_11.ash @@ -1,5 +1,112 @@ script "level_11.ash" + +record desert_buff_record +{ + item offhand; + item fam_equip; + familiar fam; + int progress; +}; + +desert_buff_record desertBuffs() +{ + desert_buff_record dbr; + + dbr.progress = 1; + + boolean possessUnrestricted(item it) + { + return possessEquipment(it) && is_unrestricted(it); + } + + boolean compassValid = possessUnrestricted($item[UV-resistant compass]); + boolean lhmValid = canChangeToFamiliar($familiar[Left-Hand Man]); + boolean meloValid = canChangeToFamiliar($familiar[Melodramedary]); + boolean odrValid = possessUnrestricted($item[Ornate Dowsing Rod]); + + dbr.fam = $familiar[none]; + dbr.fam_equip = $item[none]; + dbr.offhand = $item[none]; + + // If we can't use the Ornate dowsing rod + if (!odrValid) + { + // And we can use the compass + if (compassValid) + { + // And we have the Left-Hand man but not the Melodramedary + // Free up our offhand for something useful + if (lhmValid && !meloValid) + { + dbr.fam = $familiar[Left-Hand Man]; + dbr.fam_equip = $item[UV-resistant compass]; + dbr.progress += 1; + } + // Otherwise hold the compass + else + { + dbr.offhand = $item[UV-resistant compass]; + dbr.progress += 1; + } + } + + // If we have the Melodramedary use it! + if (meloValid) + { + dbr.fam = $familiar[Melodramedary]; + dbr.progress += 1; + } + } + // Otherwise + else + { + // If we have it and a Left-Hand man is our best familiar choice + // but we have no compass free up our offhand + if (!compassValid && lhmValid && !meloValid) + { + dbr.fam = $familiar[Left-Hand Man]; + dbr.fam_equip = $item[Ornate Dowsing Rod]; + dbr.progress += 2; + } + // Otherwise we can just hold it + else + { + dbr.offhand = $item[Ornate Dowsing Rod]; + dbr.progress += 2; + } + + // Melodramedary is better here though + if (meloValid) + { + dbr.fam = $familiar[Melodramedary]; + dbr.progress += 1; + } + // Otherwise we can give the compass to the Left-Hand man if possible + else if (compassValid && lhmValid) + { + dbr.fam = $familiar[Left-Hand Man]; + dbr.fam_equip = $item[UV-resistant compass]; + dbr.progress += 1; + } + } + + // There are some other familiars we might choose if nothing affects progress + if (dbr.fam == $familiar[none]) + { + if(get_property("_hipsterAdv").to_int() < 7 && canChangeToFamiliar($familiar[Artistic Goth Kid])) + { + dbr.fam = $familiar[Artistic Goth Kid]; + } + else if(get_property("_hipsterAdv").to_int() < 7 && canChangeToFamiliar($familiar[Mini-Hipster])) + { + dbr.fam = $familiar[Mini-Hipster]; + } + } + + return dbr; +} + int shenItemsReturned() { int progress = internalQuestStatus("questL11Shen"); @@ -613,18 +720,10 @@ boolean L11_aridDesert() if(LX_ornateDowsingRod(true)) return true; //spend adv trying to get [Ornate Dowsing Rod]. doing_desert_now = true. if(L11_getUVCompass()) return true; //spend adv trying to get [UV-resistant compass] - item desertBuff = $item[none]; - int progress = 1; - if(possessEquipment($item[UV-resistant compass])) - { - desertBuff = $item[UV-resistant compass]; - progress = 2; - } - if(possessEquipment($item[Ornate Dowsing Rod]) && is_unrestricted($item[Ornate Dowsing Rod])) - { - desertBuff = $item[Ornate Dowsing Rod]; - progress = 3; - } + desert_buff_record dbr = desertBuffs(); + + int progress = dbr.progress; + if(get_property("bondDesert").to_boolean()) { progress += 2; @@ -641,10 +740,6 @@ boolean L11_aridDesert() { autoEquip($item[Thor\'s Pliers]); } - if(canChangeToFamiliar($familiar[Artistic Goth Kid])) - { - handleFamiliar($familiar[Artistic Goth Kid]); - } if(possessEquipment($item[reinforced beaded headband]) && possessEquipment($item[bullet-proof corduroys]) && possessEquipment($item[round purple sunglasses])) { @@ -700,9 +795,17 @@ boolean L11_aridDesert() } } - if(desertBuff != $item[none]) + if (dbr.fam != $familiar[none]) + { + handleFamiliar(dbr.fam); + } + if (dbr.offhand != $item[none]) { - autoEquip(desertBuff); + autoEquip($slot[off-hand], dbr.offhand); + } + if (dbr.fam_equip != $item[none]) + { + autoEquip($slot[familiar], dbr.fam_equip); } set_property("choiceAdventure805", 1); int need = 100 - get_property("desertExploration").to_int(); @@ -2423,4 +2526,4 @@ boolean L11_defeatEd() council(); } return true; -} +} \ No newline at end of file