本文整理匯總了Java中com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEvasion類的典型用法代碼示例。如果您正苦於以下問題:Java RingOfEvasion類的具體用法?Java RingOfEvasion怎麽用?Java RingOfEvasion使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
RingOfEvasion類屬於com.shatteredpixel.shatteredpixeldungeon.items.rings包,在下文中一共展示了RingOfEvasion類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: defenseSkill
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEvasion; //導入依賴的package包/類
@Override
public int defenseSkill( Char enemy ) {
int bonus = 0;
for (Buff buff : buffs( RingOfEvasion.Evasion.class )) {
bonus += ((RingOfEvasion.Evasion)buff).effectiveLevel;
}
float evasion = (float)Math.pow( 1.15, bonus );
if (paralysed) {
evasion /= 2;
}
int aEnc = belongings.armor != null ? belongings.armor.STR - STR() : 9 - STR();
if (aEnc > 0) {
return (int)(defenseSkill * evasion / Math.pow( 1.5, aEnc ));
} else {
if (heroClass == HeroClass.ROGUE) {
return (int)((defenseSkill - aEnc) * evasion);
} else {
return (int)(defenseSkill * evasion);
}
}
}
示例2: defenseSkill
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEvasion; //導入依賴的package包/類
@Override
public int defenseSkill( Char enemy ) {
float evasion = 1f * RingOfEvasion.evasionMultiplier( this );
if (paralysed > 0) {
evasion /= 2;
}
int aEnc = belongings.armor != null ? belongings.armor.STRReq() - STR() : 10 - STR();
if (aEnc > 0) {
evasion /= Math.pow( 1.5, aEnc );
}
int bonus = 0;
if (belongings.armor != null && belongings.armor.hasGlyph(Swiftness.class))
bonus += 5 + belongings.armor.level()*1.5f;
Momentum momentum = buff(Momentum.class);
if (momentum != null){
bonus += momentum.evasionBonus(Math.max(0, -aEnc));
}
return Math.round((defenseSkill + bonus) * evasion);
}