v0.6.2: implemented crystal keys, adjusted vault room, and added gold chests to regular drops

This commit is contained in:
Evan Debenham 2017-10-14 20:56:54 -04:00
parent 65edd066e3
commit 72eb5fe090
7 changed files with 80 additions and 35 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -73,6 +73,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.EtherealChains;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TalismanOfForesight; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TalismanOfForesight;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.CrystalKey;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.GoldenKey; import com.shatteredpixel.shatteredpixeldungeon.items.keys.GoldenKey;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey; import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.Key; import com.shatteredpixel.shatteredpixeldungeon.items.keys.Key;
@ -726,8 +727,8 @@ public class Hero extends Char {
Heap heap = Dungeon.level.heaps.get( dst ); Heap heap = Dungeon.level.heaps.get( dst );
if (heap != null && (heap.type != Type.HEAP && heap.type != Type.FOR_SALE)) { if (heap != null && (heap.type != Type.HEAP && heap.type != Type.FOR_SALE)) {
if ((heap.type == Type.LOCKED_CHEST || heap.type == Type.CRYSTAL_CHEST) if ((heap.type == Type.LOCKED_CHEST && Notes.keyCount(new GoldenKey(Dungeon.depth)) < 1)
&& Notes.keyCount(new GoldenKey(Dungeon.depth)) < 1) { || (heap.type == Type.CRYSTAL_CHEST && Notes.keyCount(new CrystalKey(Dungeon.depth)) < 1)){
GLog.w( Messages.get(this, "locked_chest") ); GLog.w( Messages.get(this, "locked_chest") );
ready(); ready();
@ -1476,8 +1477,10 @@ public class Hero extends Char {
Heap heap = Dungeon.level.heaps.get( ((HeroAction.OpenChest)curAction).dst ); Heap heap = Dungeon.level.heaps.get( ((HeroAction.OpenChest)curAction).dst );
if (heap.type == Type.SKELETON || heap.type == Type.REMAINS) { if (heap.type == Type.SKELETON || heap.type == Type.REMAINS) {
Sample.INSTANCE.play( Assets.SND_BONES ); Sample.INSTANCE.play( Assets.SND_BONES );
} else if (heap.type == Type.LOCKED_CHEST || heap.type == Type.CRYSTAL_CHEST){ } else if (heap.type == Type.LOCKED_CHEST){
Notes.remove(new GoldenKey(Dungeon.depth)); Notes.remove(new GoldenKey(Dungeon.depth));
} else if (heap.type == Type.CRYSTAL_CHEST){
Notes.remove(new CrystalKey(Dungeon.depth));
} }
StatusPane.needsKeyUpdate = true; StatusPane.needsKeyUpdate = true;
heap.open( this ); heap.open( this );

View File

@ -0,0 +1,41 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2017 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.items.keys;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class CrystalKey extends Key {
{
image = ItemSpriteSheet.CRYSTAL_KEY;
}
public CrystalKey() {
this( 0 );
}
public CrystalKey( int depth ) {
super();
this.depth = depth;
}
}

View File

@ -30,7 +30,9 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact;
import com.shatteredpixel.shatteredpixeldungeon.items.journal.GuidePage; import com.shatteredpixel.shatteredpixeldungeon.items.journal.GuidePage;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.GoldenKey;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
import com.shatteredpixel.shatteredpixeldungeon.journal.Document; import com.shatteredpixel.shatteredpixeldungeon.journal.Document;
@ -318,7 +320,16 @@ public abstract class RegularLevel extends Level {
map[cell] = Terrain.GRASS; map[cell] = Terrain.GRASS;
losBlocking[cell] = false; losBlocking[cell] = false;
} }
drop( Generator.random(), cell ).type = type;
Item toDrop = Generator.random();
if ((toDrop instanceof Artifact && Random.Int(2) > 0) ||
(toDrop.isUpgradable() && Random.Int(2 + toDrop.level()) > 0)){
drop( toDrop, cell ).type = Heap.Type.LOCKED_CHEST;
addItemToSpawn(new GoldenKey(Dungeon.depth));
} else {
drop( toDrop, cell ).type = type;
}
} }
for (Item item : itemsToSpawn) { for (Item item : itemsToSpawn) {

View File

@ -25,7 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.GoldenKey; import com.shatteredpixel.shatteredpixeldungeon.items.keys.CrystalKey;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey; import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
@ -50,29 +50,14 @@ public class VaultRoom extends SpecialRoom {
Random.shuffle(prizeClasses); Random.shuffle(prizeClasses);
switch (Random.Int( 3 )) { Item i1, i2;
do {
case 0: i1 = prize( level );
level.drop( prize( level ), c ).type = Heap.Type.LOCKED_CHEST; i2 = prize( level );
level.addItemToSpawn( new GoldenKey( Dungeon.depth ) ); } while (i1.getClass() == i2.getClass());
break; level.drop( i1, c ).type = Heap.Type.CRYSTAL_CHEST;
level.drop( i2, c + PathFinder.NEIGHBOURS8[Random.Int( 8 )]).type = Heap.Type.CRYSTAL_CHEST;
case 1: level.addItemToSpawn( new CrystalKey( Dungeon.depth ) );
Item i1, i2;
do {
i1 = prize( level );
i2 = prize( level );
} while (i1.getClass() == i2.getClass());
level.drop( i1, c ).type = Heap.Type.CRYSTAL_CHEST;
level.drop( i2, c + PathFinder.NEIGHBOURS8[Random.Int( 8 )]).type = Heap.Type.CRYSTAL_CHEST;
level.addItemToSpawn( new GoldenKey( Dungeon.depth ) );
break;
case 2:
level.drop( prize( level ), c );
Painter.set( level, c, Terrain.PEDESTAL );
break;
}
entrance().set( Door.Type.LOCKED ); entrance().set( Door.Type.LOCKED );
level.addItemToSpawn( new IronKey( Dungeon.depth ) ); level.addItemToSpawn( new IronKey( Dungeon.depth ) );

View File

@ -106,10 +106,11 @@ public class ItemSpriteSheet {
public static final int SHATTPOT = SINGLE_USE+8; public static final int SHATTPOT = SINGLE_USE+8;
public static final int IRON_KEY = SINGLE_USE+9; public static final int IRON_KEY = SINGLE_USE+9;
public static final int GOLDEN_KEY = SINGLE_USE+10; public static final int GOLDEN_KEY = SINGLE_USE+10;
public static final int SKELETON_KEY = SINGLE_USE+11; public static final int CRYSTAL_KEY = SINGLE_USE+11;
public static final int MASTERY = SINGLE_USE+12; public static final int SKELETON_KEY = SINGLE_USE+13;
public static final int KIT = SINGLE_USE+13; public static final int MASTERY = SINGLE_USE+14;
public static final int AMULET = SINGLE_USE+14; public static final int KIT = SINGLE_USE+15;
public static final int AMULET = SINGLE_USE+16;
static{ static{
assignItemRect(ANKH, 10, 16); assignItemRect(ANKH, 10, 16);
assignItemRect(STYLUS, 12, 13); assignItemRect(STYLUS, 12, 13);
@ -122,6 +123,7 @@ public class ItemSpriteSheet {
assignItemRect(SHATTPOT, 14, 12); assignItemRect(SHATTPOT, 14, 12);
assignItemRect(IRON_KEY, 8, 14); assignItemRect(IRON_KEY, 8, 14);
assignItemRect(GOLDEN_KEY, 8, 14); assignItemRect(GOLDEN_KEY, 8, 14);
assignItemRect(CRYSTAL_KEY, 8, 14);
assignItemRect(SKELETON_KEY, 8, 14); assignItemRect(SKELETON_KEY, 8, 14);
assignItemRect(MASTERY, 13, 16); assignItemRect(MASTERY, 13, 16);
assignItemRect(KIT, 16, 15); assignItemRect(KIT, 16, 15);

View File

@ -401,7 +401,10 @@ items.journal.guidepage.desc=A torn page from an adventuring guidebook.\n\nMost
###keys ###keys
items.keys.goldenkey.name=golden key items.keys.goldenkey.name=golden key
items.keys.goldenkey.desc=The notches on this golden key are tiny and intricate. Maybe it can open some chest lock? items.keys.goldenkey.desc=The notches on this golden key are tiny and intricate. Perhaps it will open a locked chest?
items.keys.crystalkey.name=Crystal key
items.keys.crystalkey.desc=The cut surfaces of this crystalline key shimmer in the darkness. Perhaps it will open a crystal chest?
items.keys.ironkey.name=iron key items.keys.ironkey.name=iron key
items.keys.ironkey.desc=The notches on this ancient iron key are well worn; its leather lanyard is battered by age. What door might it open? items.keys.ironkey.desc=The notches on this ancient iron key are well worn; its leather lanyard is battered by age. What door might it open?
@ -1017,9 +1020,9 @@ items.gold.desc=A pile of gold coins. Collect gold coins to spend them later in
items.heap.chest=Chest items.heap.chest=Chest
items.heap.chest_desc=You won't know what's inside until you open it! items.heap.chest_desc=You won't know what's inside until you open it!
items.heap.locked_chest=Locked chest items.heap.locked_chest=Locked chest
items.heap.locked_chest_desc=You won't know what's inside until you open it! But to open it you need a golden key. items.heap.locked_chest_desc=You won't know what's inside until you open it! But to open it you need a golden key.
items.heap.crystal_chest=Crystal chest items.heap.crystal_chest=Crystal chest
items.heap.crystal_chest_desc=You can see %s inside, but to open the chest you need a golden key. items.heap.crystal_chest_desc=You can see _%s_ inside, but to open the chest you need a crystal key.
items.heap.artifact=an artifact items.heap.artifact=an artifact
items.heap.wand=a wand items.heap.wand=a wand
items.heap.ring=a ring items.heap.ring=a ring