cleaned up formatting:
- removed trailing whitespace - changed all leading whitespace to tabs - removed IDE created author comments
This commit is contained in:
@@ -79,10 +79,10 @@ public class Item implements Bundlable {
|
||||
// Unique items persist through revival
|
||||
public boolean unique = false;
|
||||
|
||||
// whether an item can be included in heroes remains
|
||||
public boolean bones = false;
|
||||
// whether an item can be included in heroes remains
|
||||
public boolean bones = false;
|
||||
|
||||
private static Comparator<Item> itemComparator = new Comparator<Item>() {
|
||||
private static Comparator<Item> itemComparator = new Comparator<Item>() {
|
||||
@Override
|
||||
public int compare( Item lhs, Item rhs ) {
|
||||
return Generator.Category.order( lhs ) - Generator.Category.order( rhs );
|
||||
@@ -109,16 +109,16 @@ public class Item implements Bundlable {
|
||||
}
|
||||
}
|
||||
|
||||
public void doDrop( Hero hero ) {
|
||||
hero.spendAndNext( TIME_TO_DROP );
|
||||
Dungeon.level.drop( detachAll( hero.belongings.backpack ), hero.pos ).sprite.drop( hero.pos );
|
||||
public void doDrop( Hero hero ) {
|
||||
hero.spendAndNext( TIME_TO_DROP );
|
||||
Dungeon.level.drop( detachAll( hero.belongings.backpack ), hero.pos ).sprite.drop( hero.pos );
|
||||
}
|
||||
|
||||
public void syncVisuals(){
|
||||
//do nothing by default, as most items need no visual syncing.
|
||||
}
|
||||
public void syncVisuals(){
|
||||
//do nothing by default, as most items need no visual syncing.
|
||||
}
|
||||
|
||||
public void doThrow( Hero hero ) {
|
||||
public void doThrow( Hero hero ) {
|
||||
GameScene.selectCell( thrower );
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ public class Item implements Bundlable {
|
||||
item.updateQuickslot();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (items.size() < container.size) {
|
||||
@@ -219,15 +219,15 @@ public class Item implements Bundlable {
|
||||
|
||||
try {
|
||||
|
||||
//pssh, who needs copy constructors?
|
||||
Item detached = getClass().newInstance();
|
||||
Bundle copy = new Bundle();
|
||||
this.storeInBundle(copy);
|
||||
detached.restoreFromBundle(copy);
|
||||
detached.quantity(1);
|
||||
//pssh, who needs copy constructors?
|
||||
Item detached = getClass().newInstance();
|
||||
Bundle copy = new Bundle();
|
||||
this.storeInBundle(copy);
|
||||
detached.restoreFromBundle(copy);
|
||||
detached.quantity(1);
|
||||
|
||||
detached.onDetach( );
|
||||
return detached;
|
||||
detached.onDetach( );
|
||||
return detached;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
@@ -239,17 +239,17 @@ public class Item implements Bundlable {
|
||||
updateQuickslot();
|
||||
|
||||
for (Item item : container.items) {
|
||||
if (item == this) {
|
||||
container.items.remove(this);
|
||||
item.onDetach();
|
||||
return this;
|
||||
} else if (item instanceof Bag) {
|
||||
Bag bag = (Bag)item;
|
||||
if (bag.contains( this )) {
|
||||
return detachAll( bag );
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item == this) {
|
||||
container.items.remove(this);
|
||||
item.onDetach();
|
||||
return this;
|
||||
} else if (item instanceof Bag) {
|
||||
Bag bag = (Bag)item;
|
||||
if (bag.contains( this )) {
|
||||
return detachAll( bag );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
@@ -258,7 +258,7 @@ public class Item implements Bundlable {
|
||||
return getClass() == item.getClass();
|
||||
}
|
||||
|
||||
protected void onDetach(){}
|
||||
protected void onDetach(){}
|
||||
|
||||
public Item upgrade() {
|
||||
|
||||
@@ -481,7 +481,7 @@ public class Item implements Bundlable {
|
||||
final float finalDelay = delay;
|
||||
|
||||
((MissileSprite)user.sprite.parent.recycle( MissileSprite.class )).
|
||||
reset( user.pos, cell, this, new Callback() {
|
||||
reset( user.pos, cell, this, new Callback() {
|
||||
@Override
|
||||
public void call() {
|
||||
Item.this.detach( user.belongings.backpack ).onThrow( cell );
|
||||
@@ -492,7 +492,7 @@ public class Item implements Bundlable {
|
||||
|
||||
protected static Hero curUser = null;
|
||||
protected static Item curItem = null;
|
||||
protected static CellSelector.Listener thrower = new CellSelector.Listener() {
|
||||
protected static CellSelector.Listener thrower = new CellSelector.Listener() {
|
||||
@Override
|
||||
public void onSelect( Integer target ) {
|
||||
if (target != null) {
|
||||
|
||||
Reference in New Issue
Block a user