当前位置: 首页>>代码示例>>Java>>正文


Java TimekeepersHourglass.sandBag方法代码示例

本文整理汇总了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;
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:53,代码来源:Hero.java

示例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;
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:48,代码来源:Hero.java


注:本文中的com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass.sandBag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。