Skip to content

Commit

Permalink
More Bat Wings Support (#1511)
Browse files Browse the repository at this point in the history
* free fights

* use new has function in lvl4 quest

* leap bridge

* restore skill

* start on airship support

* airship support

* fix how to force not equipping wings

* fix to leaping bridge

* fix L9

* pickpocket support

* free fights no longer swallow bat wings free fights

* name fix

* minor cleanup

* only sniff goat if need cheese

* bump mafia verison

* function for bridge goal

* more spots for bridgeGoal()

* account for skills that cost mp and have a daily limit

---------

Co-authored-by: Chris Midgley <[email protected]>
  • Loading branch information
Alium58 and midgleyc authored Oct 17, 2024
1 parent 95bdbf5 commit e480102
Show file tree
Hide file tree
Showing 23 changed files with 115 additions and 34 deletions.
2 changes: 1 addition & 1 deletion BUILD/monsters/sniff.dat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pygmy shaman loc:The Hidden Apartment Building;!effect:Thrice-Cursed;prop:hiddenApartmentProgress<7
Writing Desk prop:writingDesksDefeated<4
cabinet of Dr. Limpieza
Dairy Goat loc:The Goatlet
Dairy Goat loc:The Goatlet;item:goat cheese<3
Pygmy Bowler
Pygmy Witch Surgeon
pygmy witch accountant loc:The Hidden Office Building
Expand Down
1 change: 1 addition & 0 deletions BUILD/restoration/skill.dat
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Shake it Off ALL 0 0 0 All Negative none
Gelatinous Reconstruction 13 0 0 0 Beaten Up none
Disco Nap 20 0 0 0 none none
Lasagna Bandages 20 0 0 0 none none
Rest Upside Down 1000 1000 0 0 none none
2 changes: 1 addition & 1 deletion RELEASE/data/autoscend_monsters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ replace 34 trendy bugbear chef path:Bugbear Invasion;loc:Galley
sniff 0 pygmy shaman loc:The Hidden Apartment Building;!effect:Thrice-Cursed;prop:hiddenApartmentProgress<7
sniff 1 Writing Desk prop:writingDesksDefeated<4
sniff 2 cabinet of Dr. Limpieza
sniff 3 Dairy Goat loc:The Goatlet
sniff 3 Dairy Goat loc:The Goatlet;item:goat cheese<3
sniff 4 Pygmy Bowler
sniff 5 Pygmy Witch Surgeon
sniff 6 pygmy witch accountant loc:The Hidden Office Building
Expand Down
1 change: 1 addition & 0 deletions RELEASE/data/autoscend_restoration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,5 @@ skill 2 Shake it Off ALL 0 0 0 All Negative none
skill 3 Gelatinous Reconstruction 13 0 0 0 Beaten Up none
skill 4 Disco Nap 20 0 0 0 none none
skill 5 Lasagna Bandages 20 0 0 0 none none
skill 6 Rest Upside Down 1000 1000 0 0 none none

2 changes: 1 addition & 1 deletion RELEASE/scripts/autoscend.ash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
since r28077; // feat: various iotm improvements
since r28084; // feat: make bat wings rest always available
/***
autoscend_header.ash must be first import
All non-accessory scripts must be imported here
Expand Down
6 changes: 3 additions & 3 deletions RELEASE/scripts/autoscend/auto_acquire.ash
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ int handlePulls(int day)
}
// do this regardless of day if we still need to complete the bridge.
if (canPull($item[smut orc keepsake box]) && lumberCount() < 26 && fastenerCount() < 26)
if (canPull($item[smut orc keepsake box]) && (lumberCount() + 5 <= bridgeGoal()) && (fastenerCount() + 5 <= bridgeGoal()))
{
if (pullXWhenHaveY($item[smut orc keepsake box], 1, 0))
{
Expand Down Expand Up @@ -844,10 +844,10 @@ boolean LX_craftAcquireItems()
cli_execute("make 1 snow cleats");
}
if((item_amount($item[snow berries]) > 0) && (my_daycount() > 1) && (get_property("chasmBridgeProgress").to_int() >= 30) && (my_level() >= 9))
if((item_amount($item[snow berries]) > 0) && (my_daycount() > 1) && (get_property("chasmBridgeProgress").to_int() >= bridgeGoal()) && (my_level() >= 9))
{
visit_url("place.php?whichplace=orc_chasm");
if(get_property("chasmBridgeProgress").to_int() >= 30)
if(get_property("chasmBridgeProgress").to_int() >= bridgeGoal())
{
#if(in_hardcore() && isGuildClass())
if(isGuildClass())
Expand Down
4 changes: 4 additions & 0 deletions RELEASE/scripts/autoscend/auto_choice_adv.ash
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ boolean auto_run_choice(int choice, string page)
{
run_choice(4); // get the model airship
}
else if (options contains 6)
{
run_choice(6); // advance immateria quest
}
else if (options contains 5)
{
run_choice(5); // get titanium umbrella, metallic A, SGEEA and a penultimate fantasy chest
Expand Down
6 changes: 6 additions & 0 deletions RELEASE/scripts/autoscend/auto_equipment.ash
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,12 @@ void finalizeMaximize(boolean speculative)
addBonusToMaximize($item[spring shoes], 50);
}
}
if(auto_haveBatWings() && get_property("_batWingsFreeFights").to_int() < 5)
{
addBonusToMaximize($item[bat wings], 200); // get the 5 free fights
}
// We still need pixels in KoE, badly.
if(in_koe() && auto_hasPowerfulGlove())
{
Expand Down
6 changes: 6 additions & 0 deletions RELEASE/scripts/autoscend/auto_pre_adv.ash
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,12 @@ boolean auto_pre_adventure()
addBonusToMaximize(exting, 200); // extinguisher prevents per-round hot damage in wildfire path
}
if(place == $location[The Penultimate Fantasy Airship] && auto_haveBatWings())
{
// only here to get immateria. Get it faster with bat wings
autoEquip($item[Bat Wings]);
}
if(in_plumber())
{
Expand Down
19 changes: 18 additions & 1 deletion RELEASE/scripts/autoscend/auto_restore.ash
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,20 @@ __RestorationOptimization __calculate_objective_values(int hp_goal, int mp_goal,
}
else if(metadata.type == "skill")
{
available = floor(get_value("mp_starting") / mp_cost(to_skill(metadata.name)));
int dailyLimit = to_skill(metadata.name).dailylimit;
int mpCost = mp_cost(to_skill(metadata.name));
if(dailyLimit != -1 && mpCost > 0)
{
available = min(dailyLimit, floor(get_value("mp_starting") / mpCost));
}
else if(dailyLimit != -1)
{
available = dailyLimit;
}
else
{
available = floor(get_value("mp_starting") / mpCost);
}
}
else if(metadata.name == __HOT_TUB)
{
Expand Down Expand Up @@ -955,6 +968,10 @@ __RestorationOptimization __calculate_objective_values(int hp_goal, int mp_goal,
if(metadata.type == "skill")
{
skill s = to_skill(metadata.name);
if(s.dailylimit != -1)
{
return s.dailylimit > 0;
}
if(my_maxmp() >= mp_cost(s))
{
return true;
Expand Down
4 changes: 2 additions & 2 deletions RELEASE/scripts/autoscend/auto_zone.ash
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ generic_t zone_needItem(location loc)
value = 20.0;
break;
case $location[The Smut Orc Logging Camp]:
if(get_property("chasmBridgeProgress").to_int() < 30)
if(get_property("chasmBridgeProgress").to_int() < bridgeGoal())
{
value = 10.0;
}
Expand Down Expand Up @@ -870,7 +870,7 @@ generic_t zone_delay(location loc)
}
break;
case $location[The Smut Orc Logging Camp]:
if (shenZones contains loc && get_property("chasmBridgeProgress").to_int() >= 30)
if (shenZones contains loc && get_property("chasmBridgeProgress").to_int() >= bridgeGoal())
{
value = 3 - (loc.turns_spent - shenZones[loc]);
}
Expand Down
3 changes: 3 additions & 0 deletions RELEASE/scripts/autoscend/autoscend_header.ash
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,8 @@ boolean auto_MayamClaimBelt();
boolean auto_MayamClaimWhatever();
boolean auto_MayamClaimAll();
boolean auto_haveRoman();
boolean auto_haveBatWings();
boolean auto_canLeapBridge();

########################################################################################################
//Defined in autoscend/paths/actually_ed_the_undying.ash
Expand Down Expand Up @@ -1081,6 +1083,7 @@ boolean L8_trapperQuest();
boolean LX_loggingHatchet();
boolean L9_leafletQuest();
void L9_chasmMaximizeForNoncombat();
int bridgeGoal();
int fastenerCount();
int lumberCount();
boolean finishBuildingSmutOrcBridge();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ string auto_combatDefaultStage2(int round, monster enemy, string text)

# Instakill handler
boolean couldInstaKill = true;
if($monsters[Smut Orc Pipelayer,Smut Orc Jacker,Smut Orc Screwer,Smut Orc Nailer] contains enemy && get_property("chasmBridgeProgress").to_int() < 30)
if($monsters[Smut Orc Pipelayer,Smut Orc Jacker,Smut Orc Screwer,Smut Orc Nailer] contains enemy && get_property("chasmBridgeProgress").to_int() < bridgeGoal())
{
//want to do cold damage in stage3
if(my_adventures() > 6)
Expand Down
11 changes: 9 additions & 2 deletions RELEASE/scripts/autoscend/combat/auto_combat_default_stage3.ash
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,14 @@ string auto_combatDefaultStage3(int round, monster enemy, string text)
{
boolean polarVortexAvailable = canUse($skill[Fire Extinguisher: Polar Vortex], false) && auto_fireExtinguisherCharges() > 10;
boolean mildEvilAvailable = canUse($skill[Perpetrate Mild Evil],false) && get_property("_mildEvilPerpetrated").to_int() < 3;
// mild evil only can pick pocket. Use it before fire extinguisher
boolean swoopAvailable = canUse($skill[Swoop like a Bat], true) && get_property("_batWingsSwoopUsed").to_int() < 11;

// mild evil and swoop can only pick pocket. Use them before fire extinguisher
if(swoopAvailable)
{
handleTracker(enemy, $skill[Swoop like a Bat], "auto_otherstuff");
return useSkill($skill[Swoop like a Bat]);
}
if(mildEvilAvailable)
{
handleTracker(enemy, $skill[Perpetrate Mild Evil], "auto_otherstuff");
Expand Down Expand Up @@ -349,7 +356,7 @@ string auto_combatDefaultStage3(int round, monster enemy, string text)
}
}

if(my_location() == $location[The Smut Orc Logging Camp] && canSurvive(1.0) && get_property("chasmBridgeProgress").to_int() < 30)
if(my_location() == $location[The Smut Orc Logging Camp] && canSurvive(1.0) && get_property("chasmBridgeProgress").to_int() < bridgeGoal())
{
boolean coldMortarShell = canUse($skill[Stuffed Mortar Shell]) && have_effect($effect[Spirit of Peppermint]) != 0;
skill coldSkillToUse;
Expand Down
3 changes: 2 additions & 1 deletion RELEASE/scripts/autoscend/combat/auto_combat_util.ash
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,7 @@ boolean wantToForceDrop(monster enemy)
//skills that can be used on any combat round, repeatedly until an item is stolen
//take into account if a yellow ray has been used. Must have been one that doesn't insta-kill
boolean mildEvilAvailable = canUse($skill[Perpetrate Mild Evil],false) && get_property("_mildEvilPerpetrated").to_int() < 3;
boolean swoopAvailable = canUse($skill[Swoop like a Bat], true) && get_property("_batWingsSwoopUsed").to_int() < 11;

boolean forceDrop = false;

Expand All @@ -956,7 +957,7 @@ boolean wantToForceDrop(monster enemy)

// polar vortex/mild evil is more likely to pocket an item the higher the drop rate. Unlike XO which has equal chance for all drops
// reserve extinguisher 30 charge for filth worms
if(auto_fireExtinguisherCharges() > 20 || mildEvilAvailable)
if(auto_fireExtinguisherCharges() > 20 || mildEvilAvailable || swoopAvailable)
{
int dropsFromYR = 0;
if(combat_status_check("yellowray"))
Expand Down
6 changes: 3 additions & 3 deletions RELEASE/scripts/autoscend/iotms/mr2014.ash
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ boolean considerGrimstoneGolem(boolean bjornCrown)
return false;
}

if((get_property("desertExploration").to_int() >= 70) && (get_property("chasmBridgeProgress").to_int() >= 29))
if((get_property("desertExploration").to_int() >= 70) && (get_property("chasmBridgeProgress").to_int() >= (bridgeGoal() - 1)))
{
return false;
}

if(get_property("chasmBridgeProgress").to_int() >= 29)
if(get_property("chasmBridgeProgress").to_int() >= (bridgeGoal() - 1))
{
if(!get_property("auto_grimstoneOrnateDowsingRod").to_boolean())
{
Expand Down Expand Up @@ -407,7 +407,7 @@ boolean LX_ornateDowsingRod()
boolean fancyOilPainting()
{
if(get_property("chasmBridgeProgress").to_int() >= 30)
if(get_property("chasmBridgeProgress").to_int() >= bridgeGoal())
{
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion RELEASE/scripts/autoscend/iotms/mr2021.ash
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ string auto_FireExtinguisherCombatString(location place)
return "skill " + $skill[Fire Extinguisher: Zone Specific];
}
if(place == $location[The Smut Orc Logging Camp] && !get_property("fireExtinguisherChasmUsed").to_boolean() && get_property("chasmBridgeProgress").to_int() < 30 && !auto_hasAutumnaton())
if(place == $location[The Smut Orc Logging Camp] && !get_property("fireExtinguisherChasmUsed").to_boolean() && get_property("chasmBridgeProgress").to_int() < bridgeGoal() && !auto_hasAutumnaton())
{
return "skill " + $skill[Fire Extinguisher: Zone Specific];
}
Expand Down
23 changes: 23 additions & 0 deletions RELEASE/scripts/autoscend/iotms/mr2024.ash
Original file line number Diff line number Diff line change
Expand Up @@ -358,3 +358,26 @@ boolean auto_haveRoman()
}
return false;
}

boolean auto_haveBatWings()
{
if(auto_is_valid($item[Bat Wings]) && possessEquipment($item[Bat Wings]))
{
return true;
}
return false;
}

boolean auto_canLeapBridge()
{
// bat wings allow for us to leap bridge at 5/6 progress (25 of 30)
if(!auto_haveBatWings())
{
return false;
}
if(fastenerCount() < 25 || lumberCount() < 25)
{
return false;
}
return true;
}
2 changes: 1 addition & 1 deletion RELEASE/scripts/autoscend/paths/license_to_adventure.ash
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ boolean bond_buySkills()
points -= 1;
}
}
else if(!get_property("bondBridge").to_boolean() && (get_property("chasmBridgeProgress").to_int() < 28))
else if(!get_property("bondBridge").to_boolean() && (get_property("chasmBridgeProgress").to_int() < (bridgeGoal() - 2)))
{
if(points >= 3)
{
Expand Down
2 changes: 1 addition & 1 deletion RELEASE/scripts/autoscend/paths/low_key_summer.ash
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ boolean LX_findHelpfulLowKey()
}
// cold spell damage before orcs. Ice Key needs The Icy Peak access
if (internalQuestStatus("questL09Topping") == 0 && get_property("chasmBridgeProgress").to_int() < 30)
if (internalQuestStatus("questL09Topping") == 0 && get_property("chasmBridgeProgress").to_int() < bridgeGoal())
{
if (lowkey_keyAdv($item[Ice Key])) { return true; }
}
Expand Down
2 changes: 1 addition & 1 deletion RELEASE/scripts/autoscend/paths/you_robot.ash
Original file line number Diff line number Diff line change
Expand Up @@ -1323,7 +1323,7 @@ void robot_directive()
boolean desert_ready = internalQuestStatus("questL11Desert") == 0;
boolean desert_done = internalQuestStatus("questL11Desert") > 0;
boolean chasm_offhand_slot_needed = possessEquipment($item[Loadstone]) || canPull($item[Loadstone]);
boolean chasm_ready = internalQuestStatus("questL09Topping") == 0 && get_property("chasmBridgeProgress").to_int() < 30 && !shenShouldDelayZone($location[The Smut Orc Logging Camp]);
boolean chasm_ready = internalQuestStatus("questL09Topping") == 0 && get_property("chasmBridgeProgress").to_int() < bridgeGoal() && !shenShouldDelayZone($location[The Smut Orc Logging Camp]);
boolean chasm_done = internalQuestStatus("questL09Topping") > 0;

if(directive == "chasm" && chasm_done)
Expand Down
2 changes: 1 addition & 1 deletion RELEASE/scripts/autoscend/quests/level_04.ash
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ boolean L4_batCave()

auto_log_info("In the bat hole!", "blue");

if (possessEquipment($item[bat wings]) && auto_can_equip($item[bat wings]))
if (auto_haveBatWings())
{
if (!get_property("batWingsBatHoleEntrance").to_boolean() && zone_available($location[The Bat Hole Entrance]))
{
Expand Down
Loading

0 comments on commit e480102

Please sign in to comment.