diff --git a/assets/items.png b/assets/items.png index 5dc74a4e1..8e4e192b2 100644 Binary files a/assets/items.png and b/assets/items.png differ diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/Bones.java b/src/com/shatteredpixel/shatteredpixeldungeon/Bones.java index 1b12a6a64..8a4c92080 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/Bones.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/Bones.java @@ -49,10 +49,10 @@ public class Bones { item = Dungeon.hero.belongings.armor; break; case 2: - item = Dungeon.hero.belongings.ring1; + item = Dungeon.hero.belongings.misc1; break; case 3: - item = Dungeon.hero.belongings.ring2; + item = Dungeon.hero.belongings.misc2; break; } if (item == null) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java index b5751f0d9..b8f126ad5 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java @@ -21,13 +21,13 @@ import java.util.Iterator; import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.items.KindofMisc; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag; import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey; import com.shatteredpixel.shatteredpixeldungeon.items.keys.Key; -import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRemoveCurse; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; import com.watabou.utils.Bundle; @@ -43,8 +43,8 @@ public class Belongings implements Iterable { public KindOfWeapon weapon = null; public Armor armor = null; - public Ring ring1 = null; - public Ring ring2 = null; + public KindofMisc misc1 = null; + public KindofMisc misc2 = null; public Belongings( Hero owner ) { this.owner = owner; @@ -58,8 +58,8 @@ public class Belongings implements Iterable { private static final String WEAPON = "weapon"; private static final String ARMOR = "armor"; - private static final String RING1 = "ring1"; - private static final String RING2 = "ring2"; + private static final String MISC1 = "misc1"; + private static final String MISC2 = "misc2"; public void storeInBundle( Bundle bundle ) { @@ -67,8 +67,8 @@ public class Belongings implements Iterable { bundle.put( WEAPON, weapon ); bundle.put( ARMOR, armor ); - bundle.put( RING1, ring1 ); - bundle.put( RING2, ring2 ); + bundle.put( MISC1, misc1); + bundle.put( MISC2, misc2); } public void restoreFromBundle( Bundle bundle ) { @@ -83,14 +83,14 @@ public class Belongings implements Iterable { armor = (Armor)bundle.get( ARMOR ); - ring1 = (Ring)bundle.get( RING1 ); - if (ring1 != null) { - ring1.activate( owner ); + misc1 = (KindofMisc)bundle.get(MISC1); + if (misc1 != null) { + misc1.activate( owner ); } - ring2 = (Ring)bundle.get( RING2 ); - if (ring2 != null) { - ring2.activate( owner ); + misc2 = (KindofMisc)bundle.get(MISC2); + if (misc2 != null) { + misc2.activate( owner ); } } @@ -145,13 +145,13 @@ public class Belongings implements Iterable { armor.identify(); Badges.validateItemLevelAquired( armor ); } - if (ring1 != null) { - ring1.identify(); - Badges.validateItemLevelAquired( ring1 ); + if (misc1 != null) { + misc1.identify(); + Badges.validateItemLevelAquired(misc1); } - if (ring2 != null) { - ring2.identify(); - Badges.validateItemLevelAquired( ring2 ); + if (misc2 != null) { + misc2.identify(); + Badges.validateItemLevelAquired(misc2); } for (Item item : backpack) { item.cursedKnown = true; @@ -159,7 +159,7 @@ public class Belongings implements Iterable { } public void uncurseEquipped() { - ScrollOfRemoveCurse.uncurse( owner, armor, weapon, ring1, ring2 ); + ScrollOfRemoveCurse.uncurse( owner, armor, weapon, misc1, misc2); } public Item randomUnequipped() { @@ -189,13 +189,13 @@ public class Belongings implements Iterable { armor.cursed = false; } - if (ring1 != null) { - ring1.cursed = false; - ring1.activate( owner ); + if (misc1 != null) { + misc1.cursed = false; + misc1.activate( owner ); } - if (ring2 != null) { - ring2.cursed = false; - ring2.activate( owner ); + if (misc2 != null) { + misc2.cursed = false; + misc2.activate( owner ); } } @@ -248,7 +248,7 @@ public class Belongings implements Iterable { private Iterator backpackIterator = backpack.iterator(); - private Item[] equipped = {weapon, armor, ring1, ring2}; + private Item[] equipped = {weapon, armor, misc1, misc2}; private int backpackIndex = equipped.length; @Override @@ -286,10 +286,10 @@ public class Belongings implements Iterable { equipped[1] = armor = null; break; case 2: - equipped[2] = ring1 = null; + equipped[2] = misc1 = null; break; case 3: - equipped[3] = ring2 = null; + equipped[3] = misc2 = null; break; default: backpackIterator.remove(); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/KindofMisc.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/KindofMisc.java new file mode 100644 index 000000000..48eb556c3 --- /dev/null +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/KindofMisc.java @@ -0,0 +1,12 @@ +package com.shatteredpixel.shatteredpixeldungeon.items; + +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem; + +/** + * Created by Evan on 24/08/2014. + */ +public abstract class KindofMisc extends EquipableItem { + + public abstract void activate(Char ch); +} diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java new file mode 100644 index 000000000..5ce1eae6e --- /dev/null +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java @@ -0,0 +1,13 @@ +package com.shatteredpixel.shatteredpixeldungeon.items.artifacts; + +import com.shatteredpixel.shatteredpixeldungeon.items.KindofMisc; + +/** + * Created by Evan on 24/08/2014. + */ +public abstract class Artifact extends KindofMisc { + + private static final float TIME_TO_EQUIP = 1f; + + +} diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java index ed6cf155a..b480ee4bc 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java @@ -21,11 +21,11 @@ import java.util.ArrayList; import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.items.KindofMisc; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass; -import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.ItemStatusHandler; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -33,7 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.utils.Bundle; import com.watabou.utils.Random; -public class Ring extends EquipableItem { +public class Ring extends KindofMisc { private static final float TIME_TO_EQUIP = 1f; @@ -112,17 +112,17 @@ public class Ring extends EquipableItem { @Override public boolean doEquip( Hero hero ) { - if (hero.belongings.ring1 != null && hero.belongings.ring2 != null) { + if (hero.belongings.misc1 != null && hero.belongings.misc2 != null) { GLog.w( "you can only wear 2 rings at a time" ); return false; } else { - if (hero.belongings.ring1 == null) { - hero.belongings.ring1 = this; + if (hero.belongings.misc1 == null) { + hero.belongings.misc1 = this; } else { - hero.belongings.ring2 = this; + hero.belongings.misc2 = this; } detach( hero.belongings.backpack ); @@ -155,10 +155,10 @@ public class Ring extends EquipableItem { return false; } - if (hero.belongings.ring1 == this) { - hero.belongings.ring1 = null; + if (hero.belongings.misc1 == this) { + hero.belongings.misc1 = null; } else { - hero.belongings.ring2 = null; + hero.belongings.misc2 = null; } hero.remove( buff ); @@ -175,7 +175,7 @@ public class Ring extends EquipableItem { @Override public boolean isEquipped( Hero hero ) { - return hero.belongings.ring1 == this || hero.belongings.ring2 == this; + return hero.belongings.misc1 == this || hero.belongings.misc2 == this; } @Override diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRemoveCurse.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRemoveCurse.java index de6f31835..905374f05 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRemoveCurse.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRemoveCurse.java @@ -49,8 +49,8 @@ public class ScrollOfRemoveCurse extends Scroll { procced = uncurse( curUser, curUser.belongings.weapon, curUser.belongings.armor, - curUser.belongings.ring1, - curUser.belongings.ring2 ) || procced; + curUser.belongings.misc1, + curUser.belongings.misc2) || procced; Weakness.detach( curUser, Weakness.class ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java b/src/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java index 82dd24a53..79a1454df 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java @@ -69,7 +69,7 @@ public class ItemSpriteSheet { public static final int AMULET = ROW2+10; //Row Three: Melee weapons - public static final int KNUCKLEDUSTER = ROW8+1; + public static final int KNUCKLEDUSTER = ROW3+0; public static final int DAGGER = ROW3+1; public static final int SHORT_SWORD = ROW3+2; public static final int QUARTERSTAFF = ROW3+3; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java index 86c9c79f2..5ec25234c 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java @@ -154,8 +154,8 @@ public class WndBag extends WndTabbed { Belongings stuff = Dungeon.hero.belongings; placeItem( stuff.weapon != null ? stuff.weapon : new Placeholder( ItemSpriteSheet.WEAPON ) ); placeItem( stuff.armor != null ? stuff.armor : new Placeholder( ItemSpriteSheet.ARMOR ) ); - placeItem( stuff.ring1 != null ? stuff.ring1 : new Placeholder( ItemSpriteSheet.RING ) ); - placeItem( stuff.ring2 != null ? stuff.ring2 : new Placeholder( ItemSpriteSheet.RING ) ); + placeItem( stuff.misc1 != null ? stuff.misc1 : new Placeholder( ItemSpriteSheet.RING ) ); + placeItem( stuff.misc2 != null ? stuff.misc2 : new Placeholder( ItemSpriteSheet.RING ) ); // Unequipped items for (Item item : container.items) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndRanking.java b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndRanking.java index ac3655fc5..1447d98a6 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndRanking.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndRanking.java @@ -219,11 +219,11 @@ public class WndRanking extends WndTabbed { if (stuff.armor != null) { addItem( stuff.armor ); } - if (stuff.ring1 != null) { - addItem( stuff.ring1 ); + if (stuff.misc1 != null) { + addItem( stuff.misc1); } - if (stuff.ring2 != null) { - addItem( stuff.ring2 ); + if (stuff.misc2 != null) { + addItem( stuff.misc2); } if (Dungeon.quickslot instanceof Item &&