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


Java PotionOfStrength类代码示例

本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength的典型用法代码示例。如果您正苦于以下问题:Java PotionOfStrength类的具体用法?Java PotionOfStrength怎么用?Java PotionOfStrength使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PotionOfStrength类属于com.shatteredpixel.shatteredpixeldungeon.items.potions包,在下文中一共展示了PotionOfStrength类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: transport

import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; //导入依赖的package包/类
private void transport( Heap heap ) {
	Item item = heap.pickUp();
	if (item.doPickUp( curUser )) {
		
		if (item instanceof Dewdrop) {

		} 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() );
			}
		}

	} else {
		Dungeon.level.drop( item, curUser.pos ).sprite.drop();
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:21,代码来源:WandOfTelekinesis.java

示例2: freeze

import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; //导入依赖的package包/类
public void freeze() {

		if (type == Type.MIMIC) {
			Mimic m = Mimic.spawnAt( pos, items );
			if (m != null) {
				Buff.prolong( m, Frost.class, Frost.duration( m ) * Random.Float( 1.0f, 1.5f ) );
				destroy();
			}
		}

		if (type != Type.HEAP) {
			return;
		}
		
		boolean frozen = false;
		for (Item item : items.toArray( new Item[0] )) {
			if (item instanceof MysteryMeat) {
				replace( item, FrozenCarpaccio.cook( (MysteryMeat)item ) );
				frozen = true;
			} else if (item instanceof Potion
					&& !(item instanceof PotionOfStrength || item instanceof PotionOfMight)) {
				items.remove(item);
				((Potion) item).shatter(pos);
				frozen = true;
			} else if (item instanceof Bomb){
				((Bomb) item).fuse = null;
				frozen = true;
			}
		}
		
		if (frozen) {
			if (isEmpty()) {
				destroy();
			} else if (sprite != null) {
				sprite.view( items.peek() );
			}
		}
	}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:39,代码来源:Heap.java

示例3: actPickUp

import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; //导入依赖的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

示例4: actPickUp

import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; //导入依赖的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

示例5: attachTo

import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; //导入依赖的package包/类
@Override
public boolean attachTo( Char target ) {
	if (super.attachTo( target )) {
		
		target.paralysed++;
		Buff.detach( target, Burning.class );
		Buff.detach( target, Chill.class );

		if (target instanceof Hero) {

			Hero hero = (Hero)target;
			ArrayList<Item> freezable = new ArrayList<>();
			//does not reach inside of containers
			for (Item i : hero.belongings.backpack.items){
				if ((i instanceof Potion && !(i instanceof PotionOfStrength || i instanceof PotionOfMight))
					|| i instanceof MysteryMeat){
					freezable.add(i);
				}
			}
			
			if (!freezable.isEmpty()){
				Item toFreeze = Random.element(freezable).detach( hero.belongings.backpack );
				if (toFreeze instanceof Potion){
					((Potion) toFreeze).shatter(hero.pos);
				} else if (toFreeze instanceof MysteryMeat){
					FrozenCarpaccio carpaccio = new FrozenCarpaccio();
					if (!carpaccio.collect( hero.belongings.backpack )) {
						Dungeon.level.drop( carpaccio, target.pos ).sprite.drop();
					}
				}
				GLog.w( Messages.get(this, "freezes", toFreeze.toString()) );
			}
			
		} else if (target instanceof Thief) {

			Item item = ((Thief) target).item;

			if (item instanceof Potion && !(item instanceof PotionOfStrength || item instanceof PotionOfMight)) {
				((Potion) ((Thief) target).item).shatter(target.pos);
				((Thief) target).item = null;
			} else if (item instanceof MysteryMeat){
				((Thief) target).item = new FrozenCarpaccio();;
			}

		}

		return true;
	} else {
		return false;
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:52,代码来源:Frost.java

示例6: create

import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; //导入依赖的package包/类
public void create() {

		Random.seed( Dungeon.seedCurDepth() );
		
		if (!(Dungeon.bossLevel() || Dungeon.depth == 21) /*final shop floor*/) {
			addItemToSpawn( Generator.random( Generator.Category.FOOD ) );

			if (Dungeon.posNeeded()) {
				addItemToSpawn( new PotionOfStrength() );
				Dungeon.LimitedDrops.STRENGTH_POTIONS.count++;
			}
			if (Dungeon.souNeeded()) {
				addItemToSpawn( new ScrollOfUpgrade() );
				Dungeon.LimitedDrops.UPGRADE_SCROLLS.count++;
			}
			if (Dungeon.asNeeded()) {
				addItemToSpawn( new Stylus() );
				Dungeon.LimitedDrops.ARCANE_STYLI.count++;
			}

			DriedRose rose = Dungeon.hero.belongings.getItem( DriedRose.class );
			if (rose != null && rose.isIdentified() && !rose.cursed){
				//aim to drop 1 petal every 2 floors
				int petalsNeeded = (int) Math.ceil((float)((Dungeon.depth / 2) - rose.droppedPetals) / 3);

				for (int i=1; i <= petalsNeeded; i++) {
					//the player may miss a single petal and still max their rose.
					if (rose.droppedPetals < 11) {
						addItemToSpawn(new DriedRose.Petal());
						rose.droppedPetals++;
					}
				}
			}
			
			if (Dungeon.depth > 1) {
				switch (Random.Int( 10 )) {
				case 0:
					if (!Dungeon.bossLevel( Dungeon.depth + 1 )) {
						feeling = Feeling.CHASM;
					}
					break;
				case 1:
					feeling = Feeling.WATER;
					break;
				case 2:
					feeling = Feeling.GRASS;
					break;
				case 3:
					feeling = Feeling.DARK;
					addItemToSpawn(new Torch());
					viewDistance = Math.round(viewDistance/2f);
					break;
				}
			}
		}
		
		do {
			width = height = length = 0;

			mobs = new HashSet<>();
			heaps = new SparseArray<>();
			blobs = new HashMap<>();
			plants = new SparseArray<>();
			traps = new SparseArray<>();
			customTiles = new HashSet<>();
			customWalls = new HashSet<>();
			
		} while (!build());
		
		buildFlagMaps();
		cleanWalls();
		
		createMobs();
		createItems();

		Random.seed();
	}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:78,代码来源:Level.java

示例7: imbuePotion

import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; //导入依赖的package包/类
public Item imbuePotion(Potion potion){

		potionAttrib = potion;
		potionAttrib.ownedByFruit = true;

		potionAttrib.image = ItemSpriteSheet.BLANDFRUIT;

		if (potionAttrib instanceof PotionOfHealing){
			name = Messages.get(this, "sunfruit");
			potionGlow = new ItemSprite.Glowing( 0x2EE62E );
		} else if (potionAttrib instanceof PotionOfStrength){
			name = Messages.get(this, "rotfruit");
			potionGlow = new ItemSprite.Glowing( 0xCC0022 );
		} else if (potionAttrib instanceof PotionOfParalyticGas){
			name = Messages.get(this, "earthfruit");
			potionGlow = new ItemSprite.Glowing( 0x67583D );
		} else if (potionAttrib instanceof PotionOfInvisibility){
			name = Messages.get(this, "blindfruit");
			potionGlow = new ItemSprite.Glowing( 0xE5D273 );
		} else if (potionAttrib instanceof PotionOfLiquidFlame){
			name = Messages.get(this, "firefruit");
			potionGlow = new ItemSprite.Glowing( 0xFF7F00 );
		} else if (potionAttrib instanceof PotionOfFrost){
			name = Messages.get(this, "icefruit");
			potionGlow = new ItemSprite.Glowing( 0x66B3FF );
		} else if (potionAttrib instanceof PotionOfMindVision){
			name = Messages.get(this, "fadefruit");
			potionGlow = new ItemSprite.Glowing( 0xB8E6CF );
		} else if (potionAttrib instanceof PotionOfToxicGas){
			name = Messages.get(this, "sorrowfruit");
			potionGlow = new ItemSprite.Glowing( 0xA15CE5 );
		} else if (potionAttrib instanceof PotionOfLevitation) {
			name = Messages.get(this, "stormfruit");
			potionGlow = new ItemSprite.Glowing( 0x1C3A57 );
		} else if (potionAttrib instanceof PotionOfPurity) {
			name = Messages.get(this, "dreamfruit");
			potionGlow = new ItemSprite.Glowing( 0x8E2975 );
		} else if (potionAttrib instanceof PotionOfExperience) {
			name = Messages.get(this, "starfruit");
			potionGlow = new ItemSprite.Glowing( 0xA79400 );
		}

		return this;
	}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:45,代码来源:Blandfruit.java


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