v0.2.2: gave heroes remains a unique heap type & sprite

This commit is contained in:
Evan Debenham 2014-10-30 10:02:25 -04:00
parent 6810d0adef
commit 462f4c9d8b
14 changed files with 66 additions and 50 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -658,6 +658,7 @@ public class Hero extends Char {
Camera.main.shake( 1, 0.5f );
break;
case SKELETON:
case REMAINS:
break;
default:
Sample.INSTANCE.play( Assets.SND_UNLOCK );
@ -1318,7 +1319,7 @@ public class Hero extends Char {
}
Heap heap = Dungeon.level.heaps.get( ((HeroAction.OpenChest)curAction).dst );
if (heap.type == Type.SKELETON) {
if (heap.type == Type.SKELETON || heap.type == Type.REMAINS) {
Sample.INSTANCE.play( Assets.SND_BONES );
}
heap.open( this );

View File

@ -56,7 +56,8 @@ public class Heap implements Bundlable {
LOCKED_CHEST,
CRYSTAL_CHEST,
TOMB,
SKELETON
SKELETON,
REMAINS
}
public Type type = Type.HEAP;
@ -81,6 +82,8 @@ public class Heap implements Bundlable {
return ItemSpriteSheet.TOMB;
case SKELETON:
return ItemSpriteSheet.BONES;
case REMAINS:
return ItemSpriteSheet.REMAINS;
default:
return 0;
}
@ -96,6 +99,7 @@ public class Heap implements Bundlable {
Wraith.spawnAround( hero.pos );
break;
case SKELETON:
case REMAINS:
CellEmitter.center( pos ).start( Speck.factory( Speck.RATTLE ), 0.1f, 3 );
for (Item item : items) {
if (item.cursed) {

View File

@ -201,7 +201,7 @@ public class CavesBossLevel extends Level {
do {
pos = Random.IntRange( ROOM_LEFT, ROOM_RIGHT ) + Random.IntRange( ROOM_TOP + 1, ROOM_BOTTOM ) * WIDTH;
} while (pos == entrance || map[pos] == Terrain.SIGN);
drop( item, pos ).type = Heap.Type.SKELETON;
drop( item, pos ).type = Heap.Type.REMAINS;
}
}

View File

@ -159,7 +159,7 @@ public class CityBossLevel extends Level {
Random.IntRange( LEFT + 1, LEFT + HALL_WIDTH - 2 ) +
Random.IntRange( TOP + HALL_HEIGHT + 1, TOP + HALL_HEIGHT + CHAMBER_HEIGHT ) * WIDTH;
} while (pos == entrance || map[pos] == Terrain.SIGN);
drop( item, pos ).type = Heap.Type.SKELETON;
drop( item, pos ).type = Heap.Type.REMAINS;
}
}

View File

@ -150,7 +150,7 @@ public class HallsBossLevel extends Level {
do {
pos = Random.IntRange( ROOM_LEFT, ROOM_RIGHT ) + Random.IntRange( ROOM_TOP + 1, ROOM_BOTTOM ) * WIDTH;
} while (pos == entrance || map[pos] == Terrain.SIGN);
drop( item, pos ).type = Heap.Type.SKELETON;
drop( item, pos ).type = Heap.Type.REMAINS;
}
}

View File

@ -17,9 +17,6 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.levels;
import java.util.List;
import com.watabou.noosa.Scene;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Bones;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
@ -27,9 +24,12 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Imp;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.levels.Room.Type;
import com.watabou.noosa.Scene;
import com.watabou.utils.Graph;
import com.watabou.utils.Random;
import java.util.List;
public class LastShopLevel extends RegularLevel {
{
@ -170,7 +170,7 @@ public class LastShopLevel extends RegularLevel {
do {
pos = roomEntrance.random();
} while (pos == entrance || map[pos] == Terrain.SIGN);
drop( item, pos ).type = Heap.Type.SKELETON;
drop( item, pos ).type = Heap.Type.REMAINS;
}
}

View File

@ -17,9 +17,6 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.levels;
import java.util.List;
import com.watabou.noosa.Scene;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Bones;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
@ -34,11 +31,14 @@ import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey;
import com.shatteredpixel.shatteredpixeldungeon.levels.Room.Type;
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.watabou.noosa.Scene;
import com.watabou.utils.Bundle;
import com.watabou.utils.Graph;
import com.watabou.utils.Point;
import com.watabou.utils.Random;
import java.util.List;
public class PrisonBossLevel extends RegularLevel {
{
@ -297,7 +297,7 @@ public class PrisonBossLevel extends RegularLevel {
do {
pos = roomEntrance.random();
} while (pos == entrance || map[pos] == Terrain.SIGN);
drop( item, pos ).type = Heap.Type.SKELETON;
drop( item, pos ).type = Heap.Type.REMAINS;
}
}

View File

@ -17,11 +17,6 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.levels;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import com.shatteredpixel.shatteredpixeldungeon.Bones;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
@ -34,12 +29,17 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfWealth;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
import com.shatteredpixel.shatteredpixeldungeon.levels.Room.Type;
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.*;
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
import com.watabou.utils.Bundle;
import com.watabou.utils.Graph;
import com.watabou.utils.Random;
import com.watabou.utils.Rect;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
public abstract class RegularLevel extends Level {
protected HashSet<Room> rooms;
@ -632,7 +632,7 @@ public abstract class RegularLevel extends Level {
Item item = Bones.get();
if (item != null) {
drop( item, randomDropCell() ).type = Heap.Type.SKELETON;
drop( item, randomDropCell() ).type = Heap.Type.REMAINS;
}
}

View File

@ -17,10 +17,6 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.levels;
import java.util.ArrayList;
import java.util.List;
import com.watabou.noosa.Scene;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Bones;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
@ -31,10 +27,14 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.levels.Room.Type;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.watabou.noosa.Scene;
import com.watabou.utils.Bundle;
import com.watabou.utils.Graph;
import com.watabou.utils.Random;
import java.util.ArrayList;
import java.util.List;
public class SewerBossLevel extends RegularLevel {
{
@ -232,7 +232,7 @@ public class SewerBossLevel extends RegularLevel {
do {
pos = roomEntrance.random();
} while (pos == entrance || map[pos] == Terrain.SIGN);
drop( item, pos ).type = Heap.Type.SKELETON;
drop( item, pos ).type = Heap.Type.REMAINS;
}
}

View File

@ -43,15 +43,16 @@ public class ItemSpriteSheet {
public static final int DEWDROP = ROW1+1;
// Heaps (containers)
public static final int BONES = ROW1+2;
public static final int TOMB = ROW1+3;
public static final int CHEST = ROW1+4;
public static final int LOCKED_CHEST = ROW1+5;
public static final int CRYSTAL_CHEST = ROW1+6;
public static final int REMAINS = ROW1+3;
public static final int TOMB = ROW1+4;
public static final int CHEST = ROW1+5;
public static final int LOCKED_CHEST = ROW1+6;
public static final int CRYSTAL_CHEST = ROW1+7;
// Placeholders
public static final int WEAPON = ROW1+7;
public static final int ARMOR = ROW1+8;
public static final int RING = ROW1+9;
public static final int SMTH = ROW1+10;
public static final int WEAPON = ROW1+8;
public static final int ARMOR = ROW1+9;
public static final int RING = ROW1+10;
public static final int SMTH = ROW1+11;
//Row Two: Miscellaneous single use items
public static final int GOLD = ROW2+0;

View File

@ -17,20 +17,19 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.ui;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.Key;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey;
import com.watabou.noosa.BitmapText;
import com.watabou.noosa.ui.Button;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.Key;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
import com.watabou.noosa.BitmapText;
import com.watabou.noosa.ui.Button;
public class ItemSlot extends Button {
@ -68,6 +67,9 @@ public class ItemSlot extends Button {
public static final Item SKELETON = new Item() {
public int image() { return ItemSpriteSheet.BONES; };
};
public static final Item REMAINS = new Item() {
public int image() { return ItemSpriteSheet.REMAINS; };
};
public ItemSlot() {
super();

View File

@ -69,6 +69,7 @@ public class LootIndicator extends Tag {
heap.type == Heap.Type.CRYSTAL_CHEST ? ItemSlot.CRYSTAL_CHEST :
heap.type == Heap.Type.TOMB ? ItemSlot.TOMB :
heap.type == Heap.Type.SKELETON ? ItemSlot.SKELETON :
heap.type == Heap.Type.REMAINS ? ItemSlot.REMAINS :
heap.peek();
if (item != lastItem || item.quantity() != lastQuantity) {
lastItem = item;

View File

@ -30,18 +30,22 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
public class WndInfoItem extends Window {
private static final String TXT_CHEST = "Chest";
private static final String TXT_LOCKED_CHEST = "Locked chest";
private static final String TXT_CRYSTAL_CHEST = "Crystal chest";
private static final String TXT_TOMB = "Tomb";
private static final String TXT_SKELETON = "Skeletal remains";
private static final String TTL_CHEST = "Chest";
private static final String TTL_LOCKED_CHEST = "Locked chest";
private static final String TTL_CRYSTAL_CHEST = "Crystal chest";
private static final String TTL_TOMB = "Tomb";
private static final String TTL_SKELETON = "Skeletal remains";
private static final String TTL_REMAINS = "Heroes remains";
private static final String TXT_WONT_KNOW = "You won't know what's inside until you open it!";
private static final String TXT_NEED_KEY = TXT_WONT_KNOW + " But to open it you need a golden key.";
private static final String TXT_INSIDE = "You can see %s inside, but to open the chest you need a golden key.";
private static final String TXT_OWNER =
"This ancient tomb may contain something useful, " +
"but its owner will most certainly object to checking.";
private static final String TXT_REMAINS =
private static final String TXT_SKELETON =
"This is all that's left of some unfortunate adventurer. " +
"Maybe it's worth checking for any valuables.";
private static final String TXT_REMAINS =
"This is all that's left from one of your predecessors. " +
"Maybe it's worth checking for any valuables.";
@ -71,22 +75,25 @@ public class WndInfoItem extends Window {
String info;
if (heap.type == Type.CHEST) {
title = TXT_CHEST;
title = TTL_CHEST;
info = TXT_WONT_KNOW;
} else if (heap.type == Type.TOMB) {
title = TXT_TOMB;
title = TTL_TOMB;
info = TXT_OWNER;
} else if (heap.type == Type.SKELETON) {
title = TXT_SKELETON;
info = TXT_REMAINS;
title = TTL_SKELETON;
info = TXT_SKELETON;
} else if (heap.type == Type.REMAINS) {
title = TTL_REMAINS;
info = TXT_REMAINS;
} else if (heap.type == Type.CRYSTAL_CHEST) {
title = TXT_CRYSTAL_CHEST;
title = TTL_CRYSTAL_CHEST;
if (heap.peek() instanceof Artifact)
info = Utils.format( TXT_INSIDE, "an artifact" );
else
info = Utils.format( TXT_INSIDE, Utils.indefinite( heap.peek().name() ) );
} else {
title = TXT_LOCKED_CHEST;
title = TTL_LOCKED_CHEST;
info = TXT_NEED_KEY;
}