本文整理匯總了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();
}
}