From 54510b83fd0106cb56882b3112af89a0017a0b68 Mon Sep 17 00:00:00 2001 From: Chris Midgley Date: Thu, 9 Jan 2025 09:53:46 +0000 Subject: [PATCH] fix: do cast using bat wings if Mafia won't (#1536) * fix: do cast using bat wings if Mafia won't * fix: metadata.name is lowercase * feat: equip the previous back item --- RELEASE/scripts/autoscend/auto_restore.ash | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/RELEASE/scripts/autoscend/auto_restore.ash b/RELEASE/scripts/autoscend/auto_restore.ash index 295c11b2b..a304d6709 100644 --- a/RELEASE/scripts/autoscend/auto_restore.ash +++ b/RELEASE/scripts/autoscend/auto_restore.ash @@ -1708,6 +1708,20 @@ boolean __restore(string resource_type, int goal, int meat_reserve, boolean useF if(!success) { + // did we have exactly one option and fail to cast rest upside down because we have a back item with +HP/MP? + if (count(options) == 1 && options[0].metadata.name == "rest upside down") { + item current_back = equipped_item($slot[back]); + // do we have less than max minus what the back item provides + if (current_resource() < max_resource() - numeric_modifier(current_back, "Maximum " + resource_type)) + { + auto_log_info("Manually equipping the bat wings"); + equip($item[bat wings]); + recover_discount_pants(); + success = use_skill(1, $skill[rest upside down]); + equip(current_back); + return success; + } + } auto_log_warning("Target "+resource_type+" => " + goal + " - Uh oh. All restore options tried ("+count(options)+") failed. Sorry.", "red"); recover_discount_pants(); return false;