本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.MirrorImage类的典型用法代码示例。如果您正苦于以下问题:Java MirrorImage类的具体用法?Java MirrorImage怎么用?Java MirrorImage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MirrorImage类属于com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs包,在下文中一共展示了MirrorImage类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: proc
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.MirrorImage; //导入依赖的package包/类
@Override
public int proc( Armor armor, Char attacker, Char defender, int damage) {
int level = Math.max( 0, armor.level );
if (Random.Int( level / 2 + 6 ) >= 5) {
ArrayList<Integer> respawnPoints = new ArrayList<Integer>();
for (int i=0; i < Level.NEIGHBOURS8.length; i++) {
int p = defender.pos + Level.NEIGHBOURS8[i];
if (Actor.findChar( p ) == null && (Level.passable[p] || Level.avoid[p])) {
respawnPoints.add( p );
}
}
if (respawnPoints.size() > 0) {
MirrorImage mob = new MirrorImage();
mob.duplicate( (Hero)defender );
GameScene.add( mob );
WandOfBlink.appear( mob, Random.element( respawnPoints ) );
defender.damage( Random.IntRange( 1, defender.HT / 6 ), /*attacker*/ this );
checkOwner( defender );
}
}
return damage;
}
示例2: doRead
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.MirrorImage; //导入依赖的package包/类
@Override
protected void doRead() {
ArrayList<Integer> respawnPoints = new ArrayList<Integer>();
for (int i=0; i < Level.NEIGHBOURS8.length; i++) {
int p = curUser.pos + Level.NEIGHBOURS8[i];
if (Actor.findChar( p ) == null && (Level.passable[p] || Level.avoid[p])) {
respawnPoints.add( p );
}
}
int nImages = NIMAGES;
while (nImages > 0 && respawnPoints.size() > 0) {
int index = Random.index( respawnPoints );
MirrorImage mob = new MirrorImage();
mob.duplicate( curUser );
GameScene.add( mob );
WandOfBlink.appear( mob, respawnPoints.get( index ) );
respawnPoints.remove( index );
nImages--;
}
if (nImages < NIMAGES) {
setKnown();
}
Sample.INSTANCE.play( Assets.SND_READ );
Invisibility.dispel();
curUser.spendAndNext( TIME_TO_READ );
}
示例3: spawnImages
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.MirrorImage; //导入依赖的package包/类
public static int spawnImages( Hero hero, int nImages ){
ArrayList<Integer> respawnPoints = new ArrayList<Integer>();
for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) {
int p = hero.pos + PathFinder.NEIGHBOURS8[i];
if (Actor.findChar( p ) == null && (Dungeon.level.passable[p] || Dungeon.level.avoid[p])) {
respawnPoints.add( p );
}
}
int spawned = 0;
while (nImages > 0 && respawnPoints.size() > 0) {
int index = Random.index( respawnPoints );
MirrorImage mob = new MirrorImage();
mob.duplicate( hero );
GameScene.add( mob );
ScrollOfTeleportation.appear( mob, respawnPoints.get( index ) );
respawnPoints.remove( index );
nImages--;
spawned++;
}
return spawned;
}
示例4: link
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.MirrorImage; //导入依赖的package包/类
@Override
public void link( Char ch ) {
super.link( ch );
updateArmor( ((MirrorImage)ch).tier );
}