]> www.infradead.org Git - users/mchehab/andors-trail.git/commitdiff
Bugfix: also apply inventory effects to ring in right slot.
authorOskar Wiksten <oskar.wiksten@gmail.com>
Tue, 24 Jul 2012 10:46:20 +0000 (12:46 +0200)
committerOskar Wiksten <oskar.wiksten@gmail.com>
Sun, 7 Oct 2012 14:10:39 +0000 (16:10 +0200)
AndorsTrail/src/com/gpl/rpg/AndorsTrail/activity/HeroinfoActivity_Inventory.java
AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/ItemController.java
AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/item/Inventory.java

index 6906ce21d8c8570fe5d251db6b7a5561fda80a8a..735cadce52b828f38d6a998764e024da12864905 100644 (file)
@@ -83,8 +83,8 @@ public final class HeroinfoActivity_Inventory extends Activity {
         setWearSlot(Inventory.WEARSLOT_FEET, R.id.heroinfo_worn_feet, R.drawable.equip_feet);
         setWearSlot(Inventory.WEARSLOT_NECK, R.id.heroinfo_worn_neck, R.drawable.equip_neck);
         setWearSlot(Inventory.WEARSLOT_HAND, R.id.heroinfo_worn_hand, R.drawable.equip_hand);
-        setWearSlot(Inventory.WEARSLOT_RING, R.id.heroinfo_worn_ringleft, R.drawable.equip_ring);
-        setWearSlot(Inventory.WEARSLOT_RING+1, R.id.heroinfo_worn_ringright, R.drawable.equip_ring);
+        setWearSlot(Inventory.WEARSLOT_LEFTRING, R.id.heroinfo_worn_ringleft, R.drawable.equip_ring);
+        setWearSlot(Inventory.WEARSLOT_RIGHTRING, R.id.heroinfo_worn_ringright, R.drawable.equip_ring);
     }
 
     @Override
@@ -139,8 +139,8 @@ public final class HeroinfoActivity_Inventory extends Activity {
                int slot = itemType.category.inventorySlot;
                if (player.inventory.isEmptySlot(slot)) return slot;
                
-               if (slot == Inventory.WEARSLOT_RING) {
-                       return slot + 1;
+               if (slot == Inventory.WEARSLOT_LEFTRING) {
+                       return Inventory.WEARSLOT_RIGHTRING;
                } else if (itemType.isOffhandCapableWeapon()) {
                        ItemType mainWeapon = player.inventory.wear[Inventory.WEARSLOT_WEAPON];
                        if (mainWeapon != null && mainWeapon.isTwohandWeapon()) return slot;
@@ -200,7 +200,7 @@ public final class HeroinfoActivity_Inventory extends Activity {
                        if (type.isEquippable()) {
                                menu.findItem(R.id.inv_menu_equip).setVisible(true);
                                if (type.isOffhandCapableWeapon()) menu.findItem(R.id.inv_menu_equip_offhand).setVisible(true);
-                               else if (type.category.inventorySlot == Inventory.WEARSLOT_RING) menu.findItem(R.id.inv_menu_equip_offhand).setVisible(true);
+                               else if (type.category.inventorySlot == Inventory.WEARSLOT_LEFTRING) menu.findItem(R.id.inv_menu_equip_offhand).setVisible(true);
                        }
                        break;
                }
index 41cfe90741e40a6a69b9364340c1d33365cbf226..706193cf7276c9bd89525709df1195204c17aa81 100644 (file)
@@ -113,7 +113,8 @@ public final class ItemController {
                applyInventoryEffects(player, Inventory.WEARSLOT_HAND);
                applyInventoryEffects(player, Inventory.WEARSLOT_FEET);
                applyInventoryEffects(player, Inventory.WEARSLOT_NECK);
-               applyInventoryEffects(player, Inventory.WEARSLOT_RING);
+               applyInventoryEffects(player, Inventory.WEARSLOT_LEFTRING);
+               applyInventoryEffects(player, Inventory.WEARSLOT_RIGHTRING);
                
                SkillController.applySkillEffectsFromItemProficiencies(player);
                SkillController.applySkillEffectsFromFightingStyles(player);
index d2175681241b68b6a937f1ad56bfdf8e49d23540..5c3f31d8b7592fd40644524078640c0c43ffc067 100644 (file)
@@ -15,10 +15,11 @@ public final class Inventory extends ItemContainer {
        public static final int WEARSLOT_HAND = 4;\r
        public static final int WEARSLOT_FEET = 5;\r
        public static final int WEARSLOT_NECK = 6;\r
-       public static final int WEARSLOT_RING = 7;\r
+       public static final int WEARSLOT_LEFTRING = 7;\r
+       public static final int WEARSLOT_RIGHTRING = 8;\r
        \r
        public int gold = 0;\r
-       public static final int NUM_WORN_SLOTS = WEARSLOT_RING+1+1; // +1 for 0 based index. +1 for left+right rings.\r
+       public static final int NUM_WORN_SLOTS = WEARSLOT_RIGHTRING+1; // +1 for 0 based index.\r
        public static final int NUM_QUICK_SLOTS = 3;\r
        public final ItemType[] wear = new ItemType[NUM_WORN_SLOTS];\r
        public final ItemType[] quickitem = new ItemType[NUM_QUICK_SLOTS];\r