Skip to content

Commit

Permalink
Get Campground Gear in Small (#1357)
Browse files Browse the repository at this point in the history
* Get campground gear in small and a couple QoL changes for Small
  • Loading branch information
Alium58 authored Oct 2, 2023
1 parent edc175b commit 8ad87f9
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 4 deletions.
1 change: 1 addition & 0 deletions RELEASE/scripts/autoscend.ash
Original file line number Diff line number Diff line change
Expand Up @@ -1855,6 +1855,7 @@ boolean doTasks()
if(LA_wildfire()) return true;
if(LA_robot()) return true;
if(auto_autumnatonQuest()) return true;
if(auto_smallCampgroundGear()) return true;
auto_lostStomach(false);

if (process_tasks()) return true;
Expand Down
5 changes: 5 additions & 0 deletions RELEASE/scripts/autoscend/auto_familiar.ash
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,11 @@ boolean autoChooseFamiliar(location place)
}
}

// want to ensure we get small gear. Only requires +100 item drop, fam essentially ensures this
if ($locations[Fight in the Dirt, Fight in the Tall Grass, Fight in the Very Tall Grass] contains place) {
famChoice = lookupFamiliarDatafile("item");
}

// places where meat drop is required to help save adventures.
if ($location[The Themthar Hills] == place) {
famChoice = lookupFamiliarDatafile("meat");
Expand Down
2 changes: 1 addition & 1 deletion RELEASE/scripts/autoscend/auto_pre_adv.ash
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ boolean auto_pre_adventure()
boolean purgeML = false;
boolean[location] highMLZones = $locations[Oil Peak, The Typical Tavern Cellar, The Haunted Boiler Room, The Defiled Cranny];
boolean[location] lowMLZones = $locations[The Smut Orc Logging Camp];
boolean[location] lowMLZones = $locations[The Smut Orc Logging Camp, Fight in the Dirt, Fight in the Tall Grass, Fight in the Very Tall Grass];
// Generic Conditions
if(inAftercore())
Expand Down
11 changes: 11 additions & 0 deletions RELEASE/scripts/autoscend/auto_zone.ash
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,17 @@ generic_t zone_needItem(location loc)
retval._float = 50.0;
break;
// End Bugbear Invasion Locations
// A Shrunken Adventurer Am I (Small) Locations
case $location[Fight in the Dirt]:
value = 50.0;
break;
case $location[Fight in the Tall Grass]:
value = 50.0;
break;
case $location[Fight in the Very Tall Grass]:
value = 50.0;
break;
// End A Shrunken Adventurer Am I (Small) Locations
default:
retval._error = true;
break;
Expand Down
1 change: 1 addition & 0 deletions RELEASE/scripts/autoscend/autoscend_header.ash
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,7 @@ boolean qt_FamiliarSwap (familiar fam);
boolean in_small();
void small_initializeSettings();
void auto_SmallPulls();
boolean auto_smallCampgroundGear();

########################################################################################################
//Defined in autoscend/paths/the_source.ash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ string auto_combatDefaultStage5(int round, monster enemy, string text)
{
return useSkill($skill[Thousand-Yard Stare]);
}
if($monsters[Aquagoblin, Lord Soggyraven, Groar] contains enemy && (my_mp() >= costMajor))
if($monsters[Aquagoblin, Lord Soggyraven, Groar, The Big Wisniewski, The Man] contains enemy && (my_mp() >= costMajor))
{
return attackMajor;
}
Expand Down Expand Up @@ -943,7 +943,7 @@ string auto_combatDefaultStage5(int round, monster enemy, string text)
return attackMajor;
}
if($monsters[Aquagoblin, Lord Soggyraven, Groar] contains enemy && (my_mp() >= costMajor))
if($monsters[Aquagoblin, Lord Soggyraven, Groar, The Big Wisniewski, The Man] contains enemy && (my_mp() >= costMajor))
{
return attackMajor;
}
Expand Down
77 changes: 76 additions & 1 deletion RELEASE/scripts/autoscend/paths/small.ash
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,30 @@ void small_initializeSettings()
{
//having vastly lower stats and no easy solutions in hardcore means you always die from flyering
//should be replaced with a more elegant solution where detailed estimation / calculation is done.
set_property("auto_ignoreFlyer", true);
//set_property("auto_ignoreFlyer", true);

//cap ML to 50 to help avoid getting beaten up
int MLCap = 50;
string MLSafetyLimit = get_property("auto_MLSafetyLimit");
if(MLSafetyLimit == "")
{
set_property("auto_MLSafetyLimitBackup","empty");
set_property("auto_MLSafetyLimit",MLCap);
}
if(MLSafetyLimit.to_int() > MLCap)
{
// record existing MLSafetyLimit so it can be restored at end of run
set_property("auto_MLSafetyLimitBackup",MLSafetyLimit);
set_property("auto_MLSafetyLimit",MLCap);
}

// don't disregard instant karma either. Helps keep ML low
string disregardKarma = get_property("auto_disregardInstantKarma");
if(disregardKarma == "true")
{
set_property("auto_disregardInstantKarmaBackup","true");
set_property("auto_disregardInstantKarma", "false");
}
}
}

Expand Down Expand Up @@ -45,3 +68,55 @@ void auto_SmallPulls()
}
}
boolean auto_smallCampgroundGear()
{
if(!in_small())
{
return false;
}
// don't get campground gear in in Normal and haven't gotten beaten up
int beatenUpCount = get_property("auto_beatenUpCount").to_int();
if(!in_hardcore() && beatenUpCount == 0)
{
return false;
}
boolean [item] dirtGear = $items[mesquito proboscis, ncle leg, rutabuga bag, senate fly thorax];
boolean [item] tallGrassGear = $items[birdybug antenna, daddy shortlegs leg, kilopede skull];
boolean [item] veryTallGrassGear = $items[beetle antenna, mantis skull, spider leg];
boolean haveGear(boolean [item] gear)
{
foreach it in gear
{
if(item_amount(it) == 0 && !have_equipped(it))
{
return false;
}
}
return true;
}
// get drops from dirt if we can survive at least 2 rounds of getting hit
// always get dirt drops in HC small
if(!haveGear(dirtGear))
{
return autoAdv($location[Fight in the Dirt]);
}
// get tall grass drops if we have gotten beaten up and can survive at least 2 rounds of getting hit
else if(beatenUpCount > 0 && !haveGear(tallGrassGear) && (my_maxhp() > expected_damage($monster[kilopede]) * 2))
{
return autoAdv($location[Fight in the Tall Grass]);
}
/*
// monsters here need spading. Don't know details of how they scale. Uncomment when mafia gets this info
// get tall grass drops if we have gotten beaten up twice and can survive at least 2 rounds of getting hit
else if(beatenUpCount > 0 && !haveGear(veryTallGrassGear) && (my_maxhp() > expected_damage($monster[flagellating mantis]) * 2))
{
return autoAdv($location[Fight in the Very Tall Grass]);
}
*/
return false;
}
16 changes: 16 additions & 0 deletions RELEASE/scripts/autoscend/quests/level_13.ash
Original file line number Diff line number Diff line change
Expand Up @@ -1756,6 +1756,22 @@ boolean L13_towerNSFinal()
}
}
// restore ML Safety Limit if this run changed it
if(property_exists("auto_MLSafetyLimitBackup"))
{
string MLSafetyLimitBackup = get_property("auto_MLSafetyLimitBackup");
if(MLSafetyLimitBackup == "empty") set_property("auto_MLSafetyLimit","");
else set_property("auto_MLSafetyLimit", MLSafetyLimitBackup);
remove_property("auto_MLSafetyLimitBackup");
}
// restore disregard karma if this run changed it
if(property_exists("auto_disregardInstantKarmaBackup"))
{
set_property("auto_disregardInstantKarma",get_property("auto_disregardInstantKarmaBackup"));
remove_property("auto_disregardInstantKarmaBackup");
}
if(get_property("auto_stayInRun").to_boolean())
{
abort("User wanted to stay in run (auto_stayInRun), we are done.");
Expand Down

0 comments on commit 8ad87f9

Please sign in to comment.