本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica.cast方法的典型用法代码示例。如果您正苦于以下问题:Java Ballistica.cast方法的具体用法?Java Ballistica.cast怎么用?Java Ballistica.cast使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica
的用法示例。
在下文中一共展示了Ballistica.cast方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: canAttack
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; //导入方法依赖的package包/类
@Override
protected boolean canAttack( Char enemy ) {
if (!Level.adjacent(pos, enemy.pos) && Ballistica.cast( pos, enemy.pos, false, true ) == enemy.pos){
combo++;
return true;
} else {
return false;
}
}
示例2: canAttack
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; //导入方法依赖的package包/类
@Override
protected boolean canAttack( Char enemy ) {
hitCell = Ballistica.cast( pos, enemy.pos, true, false );
for (int i=1; i < Ballistica.distance; i++) {
if (Ballistica.trace[i] == enemy.pos) {
return true;
}
}
return false;
}
示例3: onSelect
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; //导入方法依赖的package包/类
@Override
public void onSelect( Integer target ) {
if (target != null && target != curUser.pos) {
int cell = Ballistica.cast( curUser.pos, target, false, true );
if (Actor.findChar( cell ) != null && cell != curUser.pos) {
cell = Ballistica.trace[Ballistica.distance - 2];
}
curUser.HP -= (curUser.HP / 3);
if (curUser.subClass == HeroSubClass.BERSERKER && curUser.HP <= curUser.HT * Fury.LEVEL) {
Buff.affect( curUser, Fury.class );
}
final int dest = cell;
curUser.busy();
((HeroSprite)curUser.sprite).jump(curUser.pos, cell, new Callback() {
@Override
public void call() {
curUser.move(dest);
Dungeon.level.press(dest, curUser);
Dungeon.observe();
for (int i = 0; i < Level.NEIGHBOURS8.length; i++) {
Char mob = Actor.findChar(curUser.pos + Level.NEIGHBOURS8[i]);
if (mob != null && mob != curUser) {
Buff.prolong(mob, Paralysis.class, SHOCK_TIME);
}
}
CellEmitter.center(dest).burst(Speck.factory(Speck.DUST), 10);
Camera.main.shake(2, 0.5f);
curUser.spendAndNext(LEAP_TIME);
}
});
}
}
示例4: cast
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; //导入方法依赖的package包/类
public void cast( final Hero user, int dst ) {
final int cell = Ballistica.cast( user.pos, dst, false, true );
user.sprite.zap( cell );
user.busy();
Char enemy = Actor.findChar( cell );
QuickSlotButton.target(enemy);
float delay = TIME_TO_THROW;
if (this instanceof MissileWeapon) {
// FIXME
delay *= ((MissileWeapon)this).speedFactor( user );
if (enemy != null && enemy.buff( SnipersMark.class ) != null) {
delay *= 0.5f;
}
}
final float finalDelay = delay;
((MissileSprite)user.sprite.parent.recycle( MissileSprite.class )).
reset( user.pos, cell, this, new Callback() {
@Override
public void call() {
Item.this.detach( user.belongings.backpack ).onThrow( cell );
user.spendAndNext( finalDelay );
}
} );
}
示例5: canAttack
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; //导入方法依赖的package包/类
@Override
protected boolean canAttack( Char enemy ) {
return Ballistica.cast( pos, enemy.pos, false, true ) == enemy.pos;
}
示例6: canAttack
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; //导入方法依赖的package包/类
@Override
protected boolean canAttack( Char enemy ) {
return !Level.adjacent( pos, enemy.pos ) && Ballistica.cast( pos, enemy.pos, false, true ) == enemy.pos;
}
示例7: onSelect
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; //导入方法依赖的package包/类
@Override
public void onSelect( Integer target ) {
if (target != null) {
if (target == curUser.pos) {
GLog.i( TXT_SELF_TARGET );
return;
}
final Wand curWand = (Wand)Wand.curItem;
curWand.setKnown();
final int cell = Ballistica.cast( curUser.pos, target, true, curWand.hitChars );
curUser.sprite.zap( cell );
QuickSlotButton.target(Actor.findChar(cell));
if (curWand.curCharges > 0) {
curUser.busy();
curWand.fx( cell, new Callback() {
@Override
public void call() {
curWand.onZap( cell );
curWand.wandUsed();
}
} );
Invisibility.dispel();
} else {
curUser.spendAndNext( TIME_TO_ZAP );
GLog.w( TXT_FIZZLES );
curWand.levelKnown = true;
curWand.updateQuickslot();
}
}
}
示例8: blink
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; //导入方法依赖的package包/类
private void blink( int target ) {
int cell = Ballistica.cast( pos, target, true, true );
if (Actor.findChar( cell ) != null && Ballistica.distance > 1) {
cell = Ballistica.trace[Ballistica.distance - 2];
}
WandOfBlink.appear( this, cell );
delay = BLINK_DELAY;
}