本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.levels.CityLevel类的典型用法代码示例。如果您正苦于以下问题:Java CityLevel类的具体用法?Java CityLevel怎么用?Java CityLevel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CityLevel类属于com.shatteredpixel.shatteredpixeldungeon.levels包,在下文中一共展示了CityLevel类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: spawn
import com.shatteredpixel.shatteredpixeldungeon.levels.CityLevel; //导入依赖的package包/类
public static void spawn( CityLevel level ) {
if (!spawned && Dungeon.depth > 16 && Random.Int( 20 - Dungeon.depth ) == 0) {
Imp npc = new Imp();
do {
npc.pos = level.randomRespawnCell();
} while (npc.pos == -1 || level.heaps.get( npc.pos ) != null);
level.mobs.add( npc );
Actor.occupyCell( npc );
spawned = true;
alternative = Random.Int( 2 ) == 0;
given = false;
do {
reward = (Ring)Generator.random( Generator.Category.RING );
} while (reward.cursed);
reward.upgrade( 2 );
reward.cursed = true;
}
}
示例2: spawn
import com.shatteredpixel.shatteredpixeldungeon.levels.CityLevel; //导入依赖的package包/类
public static void spawn( CityLevel level ) {
if (!spawned && Dungeon.depth > 16 && Random.Int( 20 - Dungeon.depth ) == 0) {
Imp npc = new Imp();
do {
npc.pos = level.randomRespawnCell();
} while (
npc.pos == -1 ||
level.heaps.get( npc.pos ) != null ||
level.findMob( npc.pos ) != null ||
//The imp doesn't move, so he cannot obstruct a passageway
!(level.passable[npc.pos + PathFinder.CIRCLE4[0]] && level.passable[npc.pos + PathFinder.CIRCLE4[2]]) ||
!(level.passable[npc.pos + PathFinder.CIRCLE4[1]] && level.passable[npc.pos + PathFinder.CIRCLE4[3]]));
level.mobs.add( npc );
spawned = true;
alternative = Random.Int( 2 ) == 0;
given = false;
do {
reward = (Ring)Generator.random( Generator.Category.RING );
} while (reward.cursed);
reward.upgrade( 2 );
reward.cursed = true;
}
}