From ad8d15b4834de9afb6d38cf092412eb164defcf1 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 14 Sep 2014 20:43:13 -0400 Subject: [PATCH] V0.2.0: Tied artifact drops into rooms --- .../shatteredpixeldungeon/levels/painters/PitPainter.java | 8 +++++--- .../levels/painters/VaultPainter.java | 3 ++- .../shatteredpixeldungeon/windows/WndInfoItem.java | 6 +++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/PitPainter.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/PitPainter.java index 4ad1fbfdd..86cf268e6 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/PitPainter.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/PitPainter.java @@ -56,10 +56,12 @@ public class PitPainter extends Painter { } level.drop( new IronKey( Dungeon.depth ), remains ).type = Type.SKELETON; - - if (Random.Int( 5 ) == 0) { + int loot = Random.Int( 3 ); + if (loot == 0) { level.drop( Generator.random( Generator.Category.RING ), remains ); - } else { + } else if (loot == 1) { + level.drop( Generator.random( Generator.Category.ARTIFACT ), remains ); + } else { level.drop( Generator.random( Random.oneOf( Generator.Category.WEAPON, Generator.Category.ARMOR diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/VaultPainter.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/VaultPainter.java index 92055278d..6cc6726c5 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/VaultPainter.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/VaultPainter.java @@ -70,7 +70,8 @@ public class VaultPainter extends Painter { private static Item prize( Level level ) { return Generator.random( Random.oneOf( Generator.Category.WAND, - Generator.Category.RING + Generator.Category.RING, + Generator.Category.ARTIFACT ) ); } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoItem.java b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoItem.java index 7c65a9cf2..3c4694954 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoItem.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoItem.java @@ -17,6 +17,7 @@ */ package com.shatteredpixel.shatteredpixeldungeon.windows; +import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact; import com.watabou.noosa.BitmapTextMultiline; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Heap.Type; @@ -80,7 +81,10 @@ public class WndInfoItem extends Window { info = TXT_REMAINS; } else if (heap.type == Type.CRYSTAL_CHEST) { title = TXT_CRYSTAL_CHEST; - info = Utils.format( TXT_INSIDE, Utils.indefinite( heap.peek().name() ) ); + 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; info = TXT_NEED_KEY;