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


Java PotionOfHealing类代码示例

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


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

示例1: createLoot

import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; //导入依赖的package包/类
@Override
public Item createLoot(){
    Item loot = super.createLoot();

    if (loot instanceof PotionOfHealing){

        //count/10 chance of not dropping potion
        if (Random.Int(10)-Dungeon.limitedDrops.warlockHP.count < 0){
            return null;
        } else
            Dungeon.limitedDrops.warlockHP.count++;

    }

    return loot;
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:17,代码来源:Warlock.java

示例2: createLoot

import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; //导入依赖的package包/类
@Override
protected Item createLoot() {
	//first see if we drop armor, overall chance is 1/8
	if (Random.Int(2) == 0){
		Armor loot;
		do{
			loot = Generator.randomArmor();
			//50% chance of re-rolling tier 4 or 5 items
		} while (loot.tier >= 4 && Random.Int(2) == 0);
		loot.level(0);
		return loot;
	//otherwise, we may drop a health potion. overall chance is 7/(8 * (7 + potions dropped))
	//with 0 potions dropped that simplifies to 1/8
	} else {
		if (Random.Int(7 + Dungeon.LimitedDrops.GUARD_HP.count) < 7){
			Dungeon.LimitedDrops.GUARD_HP.drop();
			return new PotionOfHealing();
		}
	}

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

示例3: createLoot

import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; //导入依赖的package包/类
@Override
public Item createLoot(){
	Item loot = super.createLoot();

	if (loot instanceof PotionOfHealing){

		//count/10 chance of not dropping potion
		if ((Random.Int(10) - Dungeon.LimitedDrops.WARLOCK_HP.count) < 0){
			return null;
		} else
			Dungeon.LimitedDrops.WARLOCK_HP.count++;

	}

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

示例4: affectHero

import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; //导入依赖的package包/类
@Override
protected boolean affectHero( Hero hero ) {
	
	Sample.INSTANCE.play( Assets.SND_DRINK );
	
	PotionOfHealing.heal( hero );
	hero.belongings.uncurseEquipped();
	((Hunger)hero.buff( Hunger.class )).satisfy( Hunger.STARVING );
	
	CellEmitter.get( pos ).start( ShaftParticle.FACTORY, 0.2f, 3 );

	Dungeon.hero.interrupt();

	GLog.p( TXT_PROCCED );
	
	Journal.remove( Feature.WELL_OF_HEALTH );
	
	return true;
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:20,代码来源:WaterOfHealth.java

示例5: affectHero

import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; //导入依赖的package包/类
@Override
protected boolean affectHero( Hero hero ) {
	
	Sample.INSTANCE.play( Assets.SND_DRINK );

	hero.HP = hero.HT;
	hero.sprite.emitter().start( Speck.factory( Speck.HEALING ), 0.4f, 4 );

	PotionOfHealing.cure( hero );
	hero.belongings.uncurseEquipped();
	((Hunger)hero.buff( Hunger.class )).satisfy( Hunger.STARVING );
	
	CellEmitter.get( pos ).start( ShaftParticle.FACTORY, 0.2f, 3 );

	Dungeon.hero.interrupt();

	GLog.p( Messages.get(this, "procced") );
	
	return true;
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:21,代码来源:WaterOfHealth.java

示例6: combine

import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; //导入依赖的package包/类
private void combine(){
	ArrayList<Plant.Seed> seeds = filterInput(Plant.Seed.class);
	ArrayList<Blandfruit> fruits = filterInput(Blandfruit.class);
	
	Item result = null;
	
	//potion creation
	if (seeds.size() == 3){
		
		if (Random.Int( 3 ) == 0) {
			
			result = Generator.random( Generator.Category.POTION );
			
		} else {
			
			Class<? extends Item> itemClass = Random.element(seeds).alchemyClass;
			try {
				result = itemClass.newInstance();
			} catch (Exception e) {
				ShatteredPixelDungeon.reportException(e);
				result = Generator.random( Generator.Category.POTION );
			}
			
		}
		
		while (result instanceof PotionOfHealing
				&& Random.Int(10) < Dungeon.LimitedDrops.COOKING_HP.count) {
			result = Generator.random(Generator.Category.POTION);
		}
		
		if (result instanceof PotionOfHealing) {
			Dungeon.LimitedDrops.COOKING_HP.count++;
		}
		
		Statistics.potionsCooked++;
		Badges.validatePotionsCooked();
		
	//blandfruit cooking
	} else if (fruits.size() == 1 && seeds.size() == 1) {
		result = fruits.get(0);
		((Blandfruit)result).cook(seeds.get(0));
	}
	
	if (result != null){
		bubbleEmitter.start(Speck.factory( Speck.BUBBLE ), 0.2f, 10 );
		smokeEmitter.burst(Speck.factory( Speck.WOOL ), 10 );
		Sample.INSTANCE.play( Assets.SND_PUFF );
		
		output.item(result);
		if (!result.collect()){
			Dungeon.level.drop(result, Dungeon.hero.pos);
		}
		
		for (int i = 0; i < inputs.length; i++){
			inputs[i].slot.item(new WndBag.Placeholder(ItemSpriteSheet.SOMETHING));
			inputs[i].item = null;
		}
		
		btnCombine.enable(false);
	}
	
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:63,代码来源:WndAlchemy.java

示例7: imbuePotion

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