From d84ed470cd16b30cc6b6488584dd9bfb95056fe7 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 29 Aug 2014 13:54:28 -0400 Subject: [PATCH] V0.2.0: Cleaned up equip code(pending integration with KindOfMisc super) --- .../shatteredpixeldungeon/items/artifacts/Artifact.java | 9 +++++++-- .../shatteredpixeldungeon/items/rings/Ring.java | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java index 860bc0b54..85e86adb2 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java @@ -47,7 +47,13 @@ public class Artifact extends KindofMisc { if (hero.belongings.misc1 != null && hero.belongings.misc2 != null) { - GLog.w("you can only wear 2 rings at a time"); + GLog.w("you can only wear 2 misc items at a time"); + return false; + + } else if (hero.belongings.misc1.getClass() == this.getClass() + || hero.belongings.misc2.getClass() == this.getClass()){ + + GLog.w("you cannot wear two of the same artifact"); return false; } else { @@ -55,7 +61,6 @@ public class Artifact extends KindofMisc { if (hero.belongings.misc1 == null) { hero.belongings.misc1 = this; } else { - //TODO: decide if I want player to equip two of the same artifact, change logic here accordingly hero.belongings.misc2 = this; } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java index b480ee4bc..0d4e87f96 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java @@ -114,7 +114,7 @@ public class Ring extends KindofMisc { if (hero.belongings.misc1 != null && hero.belongings.misc2 != null) { - GLog.w( "you can only wear 2 rings at a time" ); + GLog.w( "you can only wear 2 misc items at a time" ); return false; } else {