Bug - Won't Fix I can fight my shadow!

Bale

Minion
When using mafia's automated quest "Tower (to completion)" it will abort if you have only 5 gauze garter/filthy poutices for the reason of "Insufficient healing items to continue." However, it will fight if you have 6 of them.

The Shadow has exactly 400 HP and a gg/fp will do 80-100 damage, so even if you do minimum damage only 5 of those items are needed to kill it. With funk-slinging it's risk free.
 

lostcalpolydude

Developer
Staff member
It's actually 80-120, not that it matters here. Red pixel potions are 100-120 so you only need 4 of them, and mafia won't allow you to continue with fewer than 6 of those either. Line 2264 of SorceressLairManager
Code:
		if ( itemCount < 6 )
could have a 5 instead with no drawbacks.
 

Bale

Minion
could have a 5 instead with no drawbacks.

It turns out that you may have been wrong about that, but at least it didn't cause me to lose the fight.

Code:
Fighting your shadow...

[910] Sorceress Tower: Shadow Fight
Encounter: Shadow Hemi-Apprentice Accordion Thief
Round 0: bale loses initiative!
You lose 117 hit points
Round 1: bale uses the filthy poultice and uses the filthy poultice!
You gain 102 hit points
You gain 101 hit points
You lose 117 hit points
Round 2: bale uses the filthy poultice and uses the gauze garter!
You gain 80 hit points
You gain 82 hit points
You lose 117 hit points
Unexpected error, debug log printed.

I'm using r8900 with this modification. It doesn't seem likely to have caused a debug log, but I'm posing it here anyway.

Code:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
         KoLmafia v14.3 r8900, Windows XP, Java 1.6.0_22
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Please note: do not post this log in the KoLmafia thread. If you
 would like the dev team to look at it, please write a bug report
 at kolmafia.us. Include specific information about what you were 
 doing when you made this and include the log as an attachment.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Timestamp: Wed Jan 12 03:34:37 EST 2011
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Unexpected error, debug log printed.
class java.lang.reflect.InvocationTargetException: null
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.sourceforge.kolmafia.swingui.menu.InvocationMenuItem.run(InvocationMenuItem.java:91)
	at net.sourceforge.kolmafia.swingui.menu.ThreadedMenuItem$ThreadedMenuItemListener.actionPerformed(ThreadedMenuItem.java:71)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at javax.swing.AbstractButton.doClick(Unknown Source)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 3
	at net.sourceforge.kolmafia.session.SorceressLairManager.fightShadow(SorceressLairManager.java:2313)
	at net.sourceforge.kolmafia.session.SorceressLairManager.fightTowerGuardians(SorceressLairManager.java:2004)
	at net.sourceforge.kolmafia.session.SorceressLairManager.fightAllTowerGuardians(SorceressLairManager.java:1843)
	... 33 more
class java.lang.ArrayIndexOutOfBoundsException: 3
java.lang.ArrayIndexOutOfBoundsException: 3
	at net.sourceforge.kolmafia.session.SorceressLairManager.fightShadow(SorceressLairManager.java:2313)
	at net.sourceforge.kolmafia.session.SorceressLairManager.fightTowerGuardians(SorceressLairManager.java:2004)
	at net.sourceforge.kolmafia.session.SorceressLairManager.fightAllTowerGuardians(SorceressLairManager.java:1843)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.sourceforge.kolmafia.swingui.menu.InvocationMenuItem.run(InvocationMenuItem.java:91)
	at net.sourceforge.kolmafia.swingui.menu.ThreadedMenuItem$ThreadedMenuItemListener.actionPerformed(ThreadedMenuItem.java:71)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at javax.swing.AbstractButton.doClick(Unknown Source)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
 

lostcalpolydude

Developer
Staff member
Starting on line 2297, there's a check for Ambidextrous Funkslinging. It looks like mafia wants to use 2 healing items even if you only have one to use, which could be why it was set to require 6 items to begin with.
 

Theraze

Active member
Since the spading on that hasn't been a question for the past 3 years, I think the impetus is on you to prove it's not...
 

Theraze

Active member
Here's a question... could the HEALING_ITEMS group be changed to provide the count there? That does present potential issues with mixed amounts between them, but in the absense of actually tracking how much healing items do, it might be one way to solve this.

Another is, the itemIndex incremented for changing items doesn't have a fallover for how many items are possible... would
Code:
count(SorceressLairManager.HEALING_ITEMS)
provide for how many healing items are in the index (3, currently)? If so, we could set needed amount to 5 and validate that the current itemIndex <= count before running line 2319.

Alternatively, we could punish people for having funkslinging by validating whether or not they have the skill on checking counts of items. If funkslinging, you need 6. If going individually, 5 works. It's not as nice as it could be, but it does solve the funk problem.
 

Theraze

Active member
Where does it say it's not? http://kol.coldfront.net/thekolwiki/index.php/Shadow_Class has it as a single number and in the strategy guide below, says:
It has exactly 400 HP.
It is not affected by Monster Level modifiers.

As well, the strategy page linked off the Wiki also supports this... http://wooledge.org/~greg/kol/shadow.html (unmodified since August 18th, 2009) contains the following:
First of all, the shadow has 400 HP, precisely. There is no variance; +ML has no effect. You need to inflict 400 hit points of damage on the shadow, by using healing items/spells. Since no in-combat healing spell can do anywhere near this amount, that means you're stuck using combat items.

On searching for your "wiki says it's not" I fail to find any support for your claim. Can you provide some please?
 

Theraze

Active member
Ah... the joys of unmarked inline links. :D Totally missed noticing that [link] was in there. But yes... the pages that are actually dedicated to the shadow, including its metadata page, the strategy pages, and the like, all agree on 400.

Regardless of which it is (395 or 400), it's irrelevant to the main point which is that 400 is enough to guarantee death.
 
Top