本文整理汇总了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();
}
示例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 );
}
示例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();
}
}