V0.2.0: updated sprites, reworked some class hierarchies (probably adds some bugs!)

This commit is contained in:
Evan Debenham 2014-08-24 23:55:10 -04:00
parent ac1e6ff8f3
commit c96c3c5bed
10 changed files with 75 additions and 50 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -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) {

View File

@ -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<Item> {
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<Item> {
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<Item> {
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<Item> {
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<Item> {
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<Item> {
}
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<Item> {
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<Item> {
private Iterator<Item> 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<Item> {
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();

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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

View File

@ -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 );

View File

@ -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;

View File

@ -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) {

View File

@ -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 &&