本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.levels.Level.distance方法的典型用法代码示例。如果您正苦于以下问题:Java Level.distance方法的具体用法?Java Level.distance怎么用?Java Level.distance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.shatteredpixel.shatteredpixeldungeon.levels.Level
的用法示例。
在下文中一共展示了Level.distance方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onComplete
import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
@Override
public void onComplete( Animation anim ) {
super.onComplete( anim );
if (visible && emitter != null && anim == idle) {
emitter.burst( Speck.factory( Speck.FORGE ), 3 );
float volume = 0.2f / (Level.distance( ch.pos, Dungeon.hero.pos ));
Sample.INSTANCE.play( Assets.SND_EVOKE, volume, volume, 0.8f );
}
}
示例2: jump
import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
public void jump( int from, int to, Callback callback ) {
jumpCallback = callback;
int distance = Level.distance( from, to );
jumpTweener = new JumpTweener( this, worldToCamera( to ), distance * 4, distance * 0.1f );
jumpTweener.listener = this;
parent.add( jumpTweener );
turnTo( from, to );
play( fly );
}
示例3: attackSkill
import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
@Override
public int attackSkill( Char target ) {
float accuracy = 1;
if (rangedWeapon != null && Level.distance( pos, target.pos ) == 1) {
accuracy *= 0.5f;
}
KindOfWeapon wep = rangedWeapon != null ? rangedWeapon : belongings.weapon;
if (wep != null) {
return (int)(attackSkill * accuracy * wep.acuracyFactor( this ));
} else {
return (int)(attackSkill * accuracy);
}
}
示例4: getCloser
import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
@Override
protected boolean getCloser( int target ) {
if (Level.fieldOfView[target] && Level.distance( pos, target ) > 2 && delay <= 0) {
blink( target );
spend( -1 / speed() );
return true;
} else {
delay--;
return super.getCloser( target );
}
}
示例5: distance
import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
public int distance( Char other ) {
return Level.distance( pos, other.pos );
}
示例6: doAttack
import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
@Override
protected boolean doAttack( Char enemy ) {
if (Level.distance( pos, enemy.pos ) <= 1) {
return super.doAttack( enemy );
} else {
boolean visible = Level.fieldOfView[pos] || Level.fieldOfView[enemy.pos];
if (visible) {
((ShamanSprite)sprite).zap( enemy.pos );
}
spend( TIME_TO_ZAP );
if (hit( this, enemy, true )) {
int dmg = Random.Int( 2, 12 );
if (Level.water[enemy.pos] && !enemy.flying) {
dmg *= 1.5f;
}
enemy.damage( dmg, LightningTrap.LIGHTNING );
enemy.sprite.centerEmitter().burst( SparkParticle.FACTORY, 3 );
enemy.sprite.flash();
if (enemy == Dungeon.hero) {
Camera.main.shake( 2, 0.3f );
if (!enemy.isAlive()) {
Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name ) ) );
GLog.n( TXT_LIGHTNING_KILLED, name );
}
}
} else {
enemy.sprite.showStatus( CharSprite.NEUTRAL, enemy.defenseVerb() );
}
return !visible;
}
}
示例7: getCloser
import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
@Override
protected boolean getCloser( int target ) {
if (state == WANDERING || Level.distance(target, Dungeon.hero.pos) > 6)
this.target = target = Dungeon.hero.pos;
return super.getCloser( target );
}