v0.7.5: added a new property for items that fall into the bottom of a heap, and added a convenience method for removing a specific item from a heap.
This commit is contained in:
parent
6c18bc613c
commit
5b8125a659
|
@ -36,6 +36,7 @@ public class Dewdrop extends Item {
|
||||||
image = ItemSpriteSheet.DEWDROP;
|
image = ItemSpriteSheet.DEWDROP;
|
||||||
|
|
||||||
stackable = true;
|
stackable = true;
|
||||||
|
dropsDownHeap = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -206,7 +206,7 @@ public class Heap implements Bundlable {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((item instanceof Dewdrop || item instanceof DriedRose.Petal) && type != Type.FOR_SALE) {
|
if (item.dropsDownHeap && type != Type.FOR_SALE) {
|
||||||
items.add( item );
|
items.add( item );
|
||||||
} else {
|
} else {
|
||||||
items.addFirst( item );
|
items.addFirst( item );
|
||||||
|
@ -229,6 +229,16 @@ public class Heap implements Bundlable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void remove( Item a ){
|
||||||
|
items.remove(a);
|
||||||
|
if (items.isEmpty()){
|
||||||
|
destroy();
|
||||||
|
} else {
|
||||||
|
sprite.view( image(), glowing() );
|
||||||
|
sprite.place( pos );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void burn() {
|
public void burn() {
|
||||||
|
|
||||||
if (type == Type.MIMIC) {
|
if (type == Type.MIMIC) {
|
||||||
|
|
|
@ -69,6 +69,7 @@ public class Item implements Bundlable {
|
||||||
|
|
||||||
public boolean stackable = false;
|
public boolean stackable = false;
|
||||||
protected int quantity = 1;
|
protected int quantity = 1;
|
||||||
|
public boolean dropsDownHeap = false;
|
||||||
|
|
||||||
private int level = 0;
|
private int level = 0;
|
||||||
|
|
||||||
|
|
|
@ -443,6 +443,8 @@ public class DriedRose extends Artifact {
|
||||||
|
|
||||||
{
|
{
|
||||||
stackable = true;
|
stackable = true;
|
||||||
|
dropsDownHeap = true;
|
||||||
|
|
||||||
image = ItemSpriteSheet.PETAL;
|
image = ItemSpriteSheet.PETAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user