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