v0.8.2: Added shops to landmarks & sale price back to item info windows
This commit is contained in:
parent
f05c11e673
commit
554ef6ef20
|
@ -1631,6 +1631,7 @@ items.equipableitem.ac_unequip=UNEQUIP
|
|||
items.gold.name=gold
|
||||
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_desc=You won't know what's inside until you open it!
|
||||
items.heap.locked_chest=Locked chest
|
||||
|
|
|
@ -46,6 +46,7 @@ journal.notes$landmark.well_of_transmutation=well of transmutation
|
|||
journal.notes$landmark.alchemy=alchemy pot
|
||||
journal.notes$landmark.garden=garden
|
||||
journal.notes$landmark.statue=animated statue
|
||||
journal.notes$landmark.shop=shop
|
||||
journal.notes$landmark.ghost=sad ghost
|
||||
journal.notes$landmark.wandmaker=old wandmaker
|
||||
journal.notes$landmark.troll=troll blacksmith
|
||||
|
|
|
@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ShopkeeperSprite;
|
||||
|
@ -49,6 +50,10 @@ public class Shopkeeper extends NPC {
|
|||
|
||||
throwItem();
|
||||
|
||||
if (Dungeon.level.heroFOV[pos]){
|
||||
Notes.add(Notes.Landmark.SHOP);
|
||||
}
|
||||
|
||||
sprite.turnTo( pos, Dungeon.hero.pos );
|
||||
spend( TICK );
|
||||
return true;
|
||||
|
@ -67,6 +72,8 @@ public class Shopkeeper extends NPC {
|
|||
public void flee() {
|
||||
destroy();
|
||||
|
||||
Notes.remove(Notes.Landmark.SHOP);
|
||||
|
||||
sprite.killAndErase();
|
||||
CellEmitter.get( pos ).burst( ElmoParticle.FACTORY, 6 );
|
||||
}
|
||||
|
|
|
@ -351,6 +351,9 @@ public class Heap implements Bundlable {
|
|||
@Override
|
||||
public String toString(){
|
||||
switch(type){
|
||||
case FOR_SALE:
|
||||
Item i = peek();
|
||||
return Messages.get(this, "for_sale", i.sellPrice(), i.toString());
|
||||
case CHEST:
|
||||
case MIMIC:
|
||||
return Messages.get(this, "chest");
|
||||
|
|
|
@ -442,6 +442,10 @@ public class Item implements Bundlable {
|
|||
return 0;
|
||||
}
|
||||
|
||||
public final int sellPrice(){
|
||||
return price() * 5 * (Dungeon.depth / 5 + 1);
|
||||
}
|
||||
|
||||
public Item virtual(){
|
||||
Item item = Reflection.newInstance(getClass());
|
||||
if (item == null) return null;
|
||||
|
|
|
@ -70,6 +70,7 @@ public class Notes {
|
|||
ALCHEMY,
|
||||
GARDEN,
|
||||
STATUE,
|
||||
SHOP,
|
||||
|
||||
GHOST,
|
||||
WANDMAKER,
|
||||
|
|
|
@ -39,13 +39,7 @@ public class WndInfoItem extends Window {
|
|||
|
||||
super();
|
||||
|
||||
if (heap.type == Heap.Type.HEAP || heap.type == Heap.Type.FOR_SALE) {
|
||||
fillFields( heap.peek() );
|
||||
|
||||
} else {
|
||||
fillFields( heap );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public WndInfoItem( Item item ) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user