v0.8.2: Added shops to landmarks & sale price back to item info windows

This commit is contained in:
Evan Debenham 2020-07-17 19:01:12 -04:00
parent f05c11e673
commit 554ef6ef20
7 changed files with 19 additions and 8 deletions

View File

@ -1631,6 +1631,7 @@ items.equipableitem.ac_unequip=UNEQUIP
items.gold.name=gold items.gold.name=gold
items.gold.desc=A pile of gold coins. Collect gold coins to spend them later in a shop. items.gold.desc=A pile of gold coins. Collect gold coins to spend them later in a shop.
items.heap.for_sale=%1$dg: %2$s
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

View File

@ -46,6 +46,7 @@ journal.notes$landmark.well_of_transmutation=well of transmutation
journal.notes$landmark.alchemy=alchemy pot journal.notes$landmark.alchemy=alchemy pot
journal.notes$landmark.garden=garden journal.notes$landmark.garden=garden
journal.notes$landmark.statue=animated statue journal.notes$landmark.statue=animated statue
journal.notes$landmark.shop=shop
journal.notes$landmark.ghost=sad ghost journal.notes$landmark.ghost=sad ghost
journal.notes$landmark.wandmaker=old wandmaker journal.notes$landmark.wandmaker=old wandmaker
journal.notes$landmark.troll=troll blacksmith journal.notes$landmark.troll=troll blacksmith

View File

@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle;
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.journal.Notes;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ShopkeeperSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ShopkeeperSprite;
@ -48,6 +49,10 @@ public class Shopkeeper extends NPC {
protected boolean act() { protected boolean act() {
throwItem(); throwItem();
if (Dungeon.level.heroFOV[pos]){
Notes.add(Notes.Landmark.SHOP);
}
sprite.turnTo( pos, Dungeon.hero.pos ); sprite.turnTo( pos, Dungeon.hero.pos );
spend( TICK ); spend( TICK );
@ -66,6 +71,8 @@ public class Shopkeeper extends NPC {
public void flee() { public void flee() {
destroy(); destroy();
Notes.remove(Notes.Landmark.SHOP);
sprite.killAndErase(); sprite.killAndErase();
CellEmitter.get( pos ).burst( ElmoParticle.FACTORY, 6 ); CellEmitter.get( pos ).burst( ElmoParticle.FACTORY, 6 );

View File

@ -351,6 +351,9 @@ public class Heap implements Bundlable {
@Override @Override
public String toString(){ public String toString(){
switch(type){ switch(type){
case FOR_SALE:
Item i = peek();
return Messages.get(this, "for_sale", i.sellPrice(), i.toString());
case CHEST: case CHEST:
case MIMIC: case MIMIC:
return Messages.get(this, "chest"); return Messages.get(this, "chest");

View File

@ -441,6 +441,10 @@ public class Item implements Bundlable {
public int price() { public int price() {
return 0; return 0;
} }
public final int sellPrice(){
return price() * 5 * (Dungeon.depth / 5 + 1);
}
public Item virtual(){ public Item virtual(){
Item item = Reflection.newInstance(getClass()); Item item = Reflection.newInstance(getClass());

View File

@ -70,6 +70,7 @@ public class Notes {
ALCHEMY, ALCHEMY,
GARDEN, GARDEN,
STATUE, STATUE,
SHOP,
GHOST, GHOST,
WANDMAKER, WANDMAKER,

View File

@ -38,14 +38,8 @@ public class WndInfoItem extends Window {
public WndInfoItem( Heap heap ) { public WndInfoItem( Heap heap ) {
super(); super();
if (heap.type == Heap.Type.HEAP || heap.type == Heap.Type.FOR_SALE) { fillFields( heap );
fillFields( heap.peek() );
} else {
fillFields( heap );
}
} }
public WndInfoItem( Item item ) { public WndInfoItem( Item item ) {