• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java RingOfEvasion类的典型用法和代码示例

java 1次浏览

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

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

示例1: defenseSkill

点赞 2

import com.watabou.pixeldungeon.items.rings.RingOfEvasion; //导入依赖的package包/类
@Override
public int defenseSkill( Char enemy ) {
	
	int bonus = 0;
	for (Buff buff : buffs( RingOfEvasion.Evasion.class )) {
		bonus += ((RingOfEvasion.Evasion)buff).level;
	}
	float evasion = bonus == 0 ? 1 : (float)Math.pow( 1.2, bonus );
	if (paralysed) {
		evasion /= 2;
	}
	
	int aEnc = belongings.armor != null ? belongings.armor.STR - STR() : 0;
	
	if (aEnc > 0) {
		return (int)(defenseSkill * evasion / Math.pow( 1.5, aEnc ));
	} else {
		
		if (heroClass == HeroClass.ROGUE) {
			
			if (curAction != null && subClass == HeroSubClass.FREERUNNER && !isStarving()) {
				evasion *= 2;
			}
			
			return (int)((defenseSkill - aEnc) * evasion);
		} else {
			return (int)(defenseSkill * evasion);
		}
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:31,
代码来源:Hero.java

示例2: defenseSkill

点赞 2

import com.watabou.pixeldungeon.items.rings.RingOfEvasion; //导入依赖的package包/类
@Override
public int defenseSkill(Char enemy) {

	int bonus = 0;
	for (Buff buff : buffs(RingOfEvasion.Evasion.class)) {
		bonus += ((RingOfEvasion.Evasion) buff).level;
	}

	Buff frostAura = buff(RingOfFrost.FrostAura.class);

	if (frostAura != null && enemy.distance(this) < 2) {
		int powerLevel = belongings.getItem(RingOfFrost.class).level();
		if (enemy.isAlive()) {
			Buff.affect(enemy, Slow.class, Slow.duration(enemy) / 5 + powerLevel);
			if (Random.Int(100) < 10 + powerLevel) {
				Buff.affect(enemy, Frost.class, Frost.duration(enemy) / 5 + powerLevel);
			}
			enemy.damage(powerLevel / 2, Frost.class);
		}
	}

	float evasion = bonus == 0 ? 1 : (float) Math.pow(1.2, bonus);
	if (paralysed) {
		evasion /= 2;
	}

	if (getDifficulty() == 0) {
		evasion *= 1.2;
	}

	int aEnc = belongings.armor != null ? belongings.armor.STR - effectiveSTR() : 0;

	if (aEnc > 0) {
		return (int) (defenseSkill * evasion / Math.pow(1.5, aEnc));
	} else {

		if (heroClass == HeroClass.ROGUE) {

			if (curAction != null && subClass == HeroSubClass.FREERUNNER && !isStarving()) {
				evasion *= 2;
			}

			return (int) ((defenseSkill - aEnc) * evasion);
		} else {
			return (int) (defenseSkill * evasion);
		}
	}
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:49,
代码来源:Hero.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)