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


Java RingOfSharpshooting类代码示例

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


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

示例1: acuracyFactor

import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfSharpshooting; //导入依赖的package包/类
@Override
public float acuracyFactor( Hero hero ) {
	
	int encumbrance = STR - hero.STR();

       float ACU = this.ACU;
	
	if (this instanceof MissileWeapon) {
		switch (hero.heroClass) {
		case WARRIOR:
			encumbrance += 3;
			break;
		case HUNTRESS:
			encumbrance -= 2;
			break;
		default:
		}
           int bonus = 0;
           for (Buff buff : hero.buffs(RingOfSharpshooting.Aim.class)) {
               bonus += ((RingOfSharpshooting.Aim)buff).level;
           }
           ACU *= (float)(Math.pow(1.1, bonus));
	}

       return encumbrance > 0 ? (float)(ACU / Math.pow( 1.5, encumbrance )) : ACU;
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:27,代码来源:Weapon.java

示例2: onThrow

import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfSharpshooting; //导入依赖的package包/类
@Override
protected void onThrow( int cell ) {
	Char enemy = Actor.findChar( cell );
	if (enemy == null || enemy == curUser) {
		if (Level.flamable[cell]) {
			GameScene.add( Blob.seed( cell, 4, Fire.class ) );
		} else {
			super.onThrow( cell );
		}
	} else {
		if (!curUser.shoot( enemy, this )) {
			Dungeon.level.drop( this, cell ).sprite.drop();
           } else {
               int bonus = 0;
               for (Buff buff : curUser.buffs(RingOfSharpshooting.Aim.class)) {
                   bonus += ((RingOfSharpshooting.Aim)buff).level;
               }
               if (Random.Float() > Math.pow(0.7, bonus))
                   Dungeon.level.drop( this, cell ).sprite.drop();
		}
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:23,代码来源:IncendiaryDart.java

示例3: onThrow

import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfSharpshooting; //导入依赖的package包/类
@Override
protected void onThrow( int cell ) {
	Char enemy = Actor.findChar( cell );
	if (enemy == null || enemy == curUser) {
           if (this instanceof Boomerang)
               super.onThrow( cell );
           else
               miss( cell );
	} else {
		if (!curUser.shoot( enemy, this )) {
			miss( cell );
		} else if (!(this instanceof Boomerang)){
               int bonus = 0;
               for (Buff buff : curUser.buffs(RingOfSharpshooting.Aim.class)) {
                   bonus += ((RingOfSharpshooting.Aim)buff).level;
               }
               if (Random.Float() > Math.pow(0.7, bonus))
                   Dungeon.level.drop( this, cell ).sprite.drop();
           }
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:22,代码来源:MissileWeapon.java

示例4: accuracyFactor

import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfSharpshooting; //导入依赖的package包/类
@Override
public float accuracyFactor( Char owner ) {
	
	int encumbrance = 0;
	
	if( owner instanceof Hero ){
		encumbrance = STRReq() - ((Hero)owner).STR();
	}

	if (hasEnchant(Wayward.class))
		encumbrance = Math.max(3, encumbrance+3);

	float ACC = this.ACC;
	
	if (this instanceof MissileWeapon) {
		ACC *= RingOfSharpshooting.accuracyMultiplier( owner );
	}

	return encumbrance > 0 ? (float)(ACC / Math.pow( 1.5, encumbrance )) : ACC;
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:21,代码来源:Weapon.java

示例5: miss

import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfSharpshooting; //导入依赖的package包/类
protected void miss( int cell ) {
       int bonus = 0;
       for (Buff buff : curUser.buffs(RingOfSharpshooting.Aim.class)) {
           bonus += ((RingOfSharpshooting.Aim)buff).level;
       }

       if (Random.Float() < Math.pow(0.6, -bonus))
           super.onThrow( cell );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:10,代码来源:MissileWeapon.java

示例6: onThrow

import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfSharpshooting; //导入依赖的package包/类
@Override
protected void onThrow( int cell ) {
	Char enemy = Actor.findChar( cell );
	if (enemy == null || enemy == curUser) {
		if (this instanceof Boomerang)
			super.onThrow( cell );
		else
			miss( cell );
	} else {
		if (!curUser.shoot( enemy, this )) {
			miss( cell );
		} else if (!(this instanceof Boomerang)){

			int bonus = RingOfSharpshooting.getBonus(curUser, RingOfSharpshooting.Aim.class);

			if (curUser.heroClass == HeroClass.HUNTRESS && enemy.buff(PinCushion.class) == null)
				bonus += 3;

			if (Random.Float() > Math.pow(0.7, bonus)){
				if (enemy.isAlive())
					Buff.affect(enemy, PinCushion.class).stick(this);
				else
					Dungeon.level.drop( this, enemy.pos).sprite.drop();
			}

		}
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:29,代码来源:MissileWeapon.java

示例7: miss

import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfSharpshooting; //导入依赖的package包/类
protected void miss( int cell ) {
	int bonus = RingOfSharpshooting.getBonus(curUser, RingOfSharpshooting.Aim.class);

	//degraded ring of sharpshooting will even make missed shots break.
	if (Random.Float() < Math.pow(0.6, -bonus))
		super.onThrow( cell );
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:8,代码来源:MissileWeapon.java


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