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


Java HornOfPlenty类代码示例

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


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

示例1: satisfy

import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty; //导入依赖的package包/类
public void satisfy( float energy ) {
	Artifact.ArtifactBuff buff = target.buff( HornOfPlenty.hornRecharge.class );
	if (buff != null && buff.isCursed()){
		energy = Math.round(energy*0.67f);
		GLog.n("The cursed horn steals some of the food energy as you eat.");
	}
	level -= energy;
	if (level < 0) {
		level = 0;
	} else if (level > STARVING) {
		level = STARVING;
	}
	
	BuffIndicator.refreshHero();
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:16,代码来源:Hunger.java

示例2: satisfy

import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty; //导入依赖的package包/类
public void satisfy( float energy ) {

		Artifact.ArtifactBuff buff = target.buff( HornOfPlenty.hornRecharge.class );
		if (buff != null && buff.isCursed()){
			energy *= 0.67f;
			GLog.n( Messages.get(this, "cursedhorn") );
		}

		if (!Dungeon.isChallenged(Challenges.NO_FOOD))
			reduceHunger( energy );
	}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:12,代码来源:Hunger.java

示例3: earnExp

import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty; //导入依赖的package包/类
public void earnExp( int exp ) {
	
	this.exp += exp;
	float percent = exp/(float)maxExp();

	EtherealChains.chainsRecharge chains = buff(EtherealChains.chainsRecharge.class);
	if (chains != null) chains.gainExp(percent);

	HornOfPlenty.hornRecharge horn = buff(HornOfPlenty.hornRecharge.class);
	if (horn != null) horn.gainCharge(percent);

	if (subClass == HeroSubClass.BERSERKER){
		berserk = Buff.affect(this, Berserk.class);
		berserk.recover(percent);
	}
	
	boolean levelUp = false;
	while (this.exp >= maxExp()) {
		this.exp -= maxExp();
		if (lvl < MAX_LEVEL) {
			lvl++;
			levelUp = true;

			updateHT( true );
			attackSkill++;
			defenseSkill++;

		} else {
			Buff.prolong(this, Bless.class, 30f);
			this.exp = 0;

			GLog.p( Messages.get(this, "level_cap"));
			Sample.INSTANCE.play( Assets.SND_LEVELUP );
		}
		
	}
	
	if (levelUp) {
		
		GLog.p( Messages.get(this, "new_level"), lvl );
		sprite.showStatus( CharSprite.POSITIVE, Messages.get(Hero.class, "level_up") );
		Sample.INSTANCE.play( Assets.SND_LEVELUP );
		
		Badges.validateLevelReached();
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:47,代码来源:Hero.java


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