Permalink
Browse files

Correctly swap Boris's Helm and Boris's Helm (askew) when twisting, e…

…ither from inventory or when it is equipped as a hat or familiar item

git-svn-id: http://kolmafia.svn.sourceforge.net/svnroot/kolmafia@10874 b29ace70-8910-0410-8dcc-aa2fc6433167
  • Loading branch information...
Rinn
Rinn committed Apr 2, 2012
1 parent 3c9d07d commit 104cc8535d438a50eb330a5e681f3e10dcb86797
View
@@ -5654,7 +5654,7 @@
5645 the Nostril of the Serpent none none 0
5646 ancient calendar fragment usable all 25
5647 ancient calendar offhand all 400
-5648 Boris's Helm hat, reusable all 0
+5648 Boris's Helm hat, usable all 0
5649 staph of homophones weapon all 135
-5650 Boris's Helm (askew) hat, reusable all 0
+5650 Boris's Helm (askew) hat, usable all 0
5651 mime soul fragment none all 0
@@ -1430,6 +1430,8 @@
public static final int TRUSTY = 5552;
public static final int RAIN_DOH_BOX = 5563;
public static final int RAIN_DOH_MONSTER = 5564;
+ public static final int BORIS_HELM = 5648;
+ public static final int BORIS_HELM_ASKEW = 5650;
public static final AdventureResult get( String itemName, int count )
{
@@ -4245,6 +4245,36 @@ public static boolean registerRequest( final String urlString )
}
AdventureResult item = UseItemRequest.extractItem( urlString );
+
+ // Special handing for twisting Boris's Helm when it is equipped
+ if ( item == null && urlString.indexOf( "action=twisthorns" ) != -1 )
+ {
+ if ( urlString.indexOf( "slot=hat" ) != -1 )
+ {
+ if ( KoLCharacter.hasEquipped( ItemPool.BORIS_HELM, EquipmentManager.HAT ) )
+ {
+ EquipmentManager.setEquipment( EquipmentManager.HAT, new AdventureResult( ItemPool.BORIS_HELM_ASKEW, 1 ) );
+ }
+ else if ( KoLCharacter.hasEquipped( ItemPool.BORIS_HELM_ASKEW, EquipmentManager.HAT ) )
+ {
+ EquipmentManager.setEquipment( EquipmentManager.HAT, new AdventureResult( ItemPool.BORIS_HELM, 1 ) );
+ }
+ }
+ else if ( urlString.indexOf( "slot=familiarequip" ) != -1 )
+ {
+ if ( KoLCharacter.hasEquipped( ItemPool.BORIS_HELM, EquipmentManager.FAMILIAR ) )
+ {
+ EquipmentManager.setEquipment( EquipmentManager.FAMILIAR, new AdventureResult( ItemPool.BORIS_HELM_ASKEW, 1 ) );
+ }
+ else if ( KoLCharacter.hasEquipped( ItemPool.BORIS_HELM_ASKEW, EquipmentManager.FAMILIAR ) )
+ {
+ EquipmentManager.setEquipment( EquipmentManager.FAMILIAR, new AdventureResult( ItemPool.BORIS_HELM, 1 ) );
+ }
+ }
+
+ return false;
+ }
+
if ( item == null )
{
return UseItemRequest.registerBingeRequest( urlString );

0 comments on commit 104cc85

Please sign in to comment.