Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plumber] Always equip plumber combat tool before Ed fight #327

Merged
merged 1 commit into from
Apr 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 2 additions & 23 deletions RELEASE/scripts/autoscend/auto_pre_adv.ash
Original file line number Diff line number Diff line change
Expand Up @@ -223,35 +223,14 @@ void main()
if ((is_ghost_in_zone(place) && !skip_equipping_flower)
|| (place == $location[The Smut Orc Logging Camp] && possessEquipment($item[frosty button])))
{
if (possessEquipment($item[bonfire flower]))
{
autoEquip($item[bonfire flower]);
}
else if (possessEquipment($item[[10462]fire flower]))
{
autoEquip($item[[10462]fire flower]);
}
else if (item_amount($item[coin]) >= 20)
{
// 20 coins to avoid doing clever re-routing? Yes please!
retrieve_item(1, $item[[10462]fire flower]);
autoEquip($item[[10462]fire flower]);
}
else
if(!zelda_equipTool($stat[mysticality]))
{
abort("I'm scared to adventure in a zone with ghosts without a fire flower. Please fight a bit and buy me a fire flower.");
}
}
else
{
if (possessEquipment($item[fancy boots]))
{
autoEquip($slot[acc3], $item[fancy boots]);
}
else if (possessEquipment($item[work boots]))
{
autoEquip($slot[acc3], $item[work boots]);
}
zelda_equipTool($stat[moxie]);
}

// It is dangerous out there! Take this!
Expand Down
6 changes: 6 additions & 0 deletions RELEASE/scripts/autoscend/auto_quest_level_11.ash
Original file line number Diff line number Diff line change
Expand Up @@ -2284,6 +2284,12 @@ boolean L11_defeatEd()
autoForceEquip($item[low-pressure oxygen tank]);
}

zelda_equipTool($stat[moxie]);

// When we disable adventure handling, we also disable the maximizer that
// would normally happen in pre-adventure.
equipMaximizedGear();

acquireHP();
auto_log_info("Time to waste all of Ed's Ka Coins :(", "blue");

Expand Down
31 changes: 31 additions & 0 deletions RELEASE/scripts/autoscend/auto_zelda.ash
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,34 @@ boolean zelda_skillValid(skill sk)
return true;
}

boolean zelda_equipTool(stat st)
{
if (!in_zelda()) return false;

boolean equipWithFallback(item to_equip, item fallback_to_equip)
{
if (possessEquipment(to_equip) && autoEquip(to_equip))
{
return true;
}
else if (possessEquipment(fallback_to_equip))
{
return autoEquip(fallback_to_equip);
}
else if (item_amount($item[coin]) >= 20)
{
// 20 coins to avoid doing clever re-routing? Yes please!
retrieve_item(1, fallback_to_equip);
return autoEquip(fallback_to_equip);
}
return false;
}

switch (st)
{
case $stat[muscle]: return equipWithFallback($item[heavy hammer], $item[hammer]);
case $stat[mysticality]: return equipWithFallback($item[bonfire flower], $item[[10462]fire flower]);
case $stat[moxie]: return equipWithFallback($item[fancy boots], $item[work boots]);
}
return false;
}
1 change: 1 addition & 0 deletions RELEASE/scripts/autoscend/autoscend_header.ash
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,7 @@ boolean zelda_buyStuff(); // Defined in autoscend/auto_zelda.ash
int zelda_ppCost(skill sk); // Defined in autoscend/auto_zelda.ash
boolean zelda_canDealScalingDamage(); // Defined in autoscend/auto_zelda.ash
boolean zelda_skillValid(skill sk); // Defined in autoscend/auto_zelda.ash
boolean zelda_equipTool(stat st); // Defined in autoscend/auto_zelda.ash

element currentFlavour(); // Defined in autoscend/auto_util.ash
void resetFlavour(); // Defined in autoscend/auto_util.ash
Expand Down