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


Java Ballistica.cast方法代码示例

本文整理汇总了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;
    }
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:10,代码来源:Ghost.java

示例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;
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:13,代码来源:Eye.java

示例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);
                  }
              });
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:41,代码来源:WarriorArmor.java

示例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 );
			}
		} );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:30,代码来源:Item.java

示例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;
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:5,代码来源:Yog.java

示例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;
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:5,代码来源:Scorpio.java

示例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();
		}
		
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:45,代码来源:Wand.java

示例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;
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:13,代码来源:Succubus.java


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