本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass.sandBag方法的典型用法代码示例。如果您正苦于以下问题:Java TimekeepersHourglass.sandBag方法的具体用法?Java TimekeepersHourglass.sandBag怎么用?Java TimekeepersHourglass.sandBag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass
的用法示例。
在下文中一共展示了TimekeepersHourglass.sandBag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actPickUp
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; //导入方法依赖的package包/类
private boolean actPickUp( HeroAction.PickUp action ) {
int dst = action.dst;
if (pos == dst) {
Heap heap = Dungeon.level.heaps.get( pos );
if (heap != null) {
Item item = heap.pickUp();
if (item.doPickUp( this )) {
if (item instanceof Dewdrop
|| item instanceof TimekeepersHourglass.sandBag
|| item instanceof DriedRose.Petal) {
} else {
if ((item instanceof ScrollOfUpgrade && ((ScrollOfUpgrade)item).isKnown()) ||
(item instanceof PotionOfStrength && ((PotionOfStrength)item).isKnown())) {
GLog.p( TXT_YOU_NOW_HAVE, item.name() );
} else {
GLog.i( TXT_YOU_NOW_HAVE, item.name() );
}
//Alright, if anyone complains about not knowing the vial doesn't revive
//after this... I'm done, I'm just done.
if (item instanceof DewVial) {
GLog.w("Its revival power seems to have faded.");
}
}
if (!heap.isEmpty()) {
GLog.i( TXT_SOMETHING_ELSE );
}
curAction = null;
} else {
Dungeon.level.drop( item, pos ).sprite.drop();
ready();
}
} else {
ready();
}
return false;
} else if (getCloser( dst )) {
return true;
} else {
ready();
return false;
}
}
示例2: actPickUp
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; //导入方法依赖的package包/类
private boolean actPickUp( HeroAction.PickUp action ) {
int dst = action.dst;
if (pos == dst) {
Heap heap = Dungeon.level.heaps.get( pos );
if (heap != null) {
Item item = heap.peek();
if (item.doPickUp( this )) {
heap.pickUp();
if (item instanceof Dewdrop
|| item instanceof TimekeepersHourglass.sandBag
|| item instanceof DriedRose.Petal
|| item instanceof Key) {
//Do Nothing
} else {
boolean important =
((item instanceof ScrollOfUpgrade || item instanceof ScrollOfMagicalInfusion) && ((Scroll)item).isKnown()) ||
((item instanceof PotionOfStrength || item instanceof PotionOfMight) && ((Potion)item).isKnown());
if (important) {
GLog.p( Messages.get(this, "you_now_have", item.name()) );
} else {
GLog.i( Messages.get(this, "you_now_have", item.name()) );
}
}
curAction = null;
} else {
heap.sprite.drop();
ready();
}
} else {
ready();
}
return false;
} else if (getCloser( dst )) {
return true;
} else {
ready();
return false;
}
}