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


Java Dungeon.bossLevel方法代码示例

本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.Dungeon.bossLevel方法的典型用法代码示例。如果您正苦于以下问题:Java Dungeon.bossLevel方法的具体用法?Java Dungeon.bossLevel怎么用?Java Dungeon.bossLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.shatteredpixel.shatteredpixeldungeon.Dungeon的用法示例。


在下文中一共展示了Dungeon.bossLevel方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: proc

import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //导入方法依赖的package包/类
@Override
public int proc( Armor armor, Char attacker, Char defender, int damage ) {

	if (Dungeon.bossLevel()) {
		return damage;
	}
	
	int nTries = (armor.level < 0 ? 1 : armor.level + 1) * 5;
	for (int i=0; i < nTries; i++) {
		int pos = Random.Int( Level.LENGTH );
		if (Dungeon.visible[pos] && Level.passable[pos] && Actor.findChar( pos ) == null) {
			
			WandOfBlink.appear( defender, pos );
			Dungeon.level.press( pos, defender );
			Dungeon.observe();

			break;
		}
	}
	
	return damage;
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:23,代码来源:Displacement.java

示例2: trigger

import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //导入方法依赖的package包/类
public static void trigger( int pos, Char c ) {
	
	if (Dungeon.bossLevel()) {
		return;
	}
	
	if (c != null) {
		Actor.occupyCell( c );
	}
	
	int nMobs = 1;
	if (Random.Int( 2 ) == 0) {
		nMobs++;
		if (Random.Int( 2 ) == 0) {
			nMobs++;
		}
	}
	
	// It's complicated here, because these traps can be activated in chain
	
	ArrayList<Integer> candidates = new ArrayList<Integer>();
	
	for (int i=0; i < Level.NEIGHBOURS8.length; i++) {
		int p = pos + Level.NEIGHBOURS8[i];
		if (Actor.findChar( p ) == null && (Level.passable[p] || Level.avoid[p])) {
			candidates.add( p );
		}
	}
	
	ArrayList<Integer> respawnPoints = new ArrayList<Integer>();
	
	while (nMobs > 0 && candidates.size() > 0) {
		int index = Random.index( candidates );
		
		DUMMY.pos = candidates.get( index );
		Actor.occupyCell( DUMMY );
		
		respawnPoints.add( candidates.remove( index ) );
		nMobs--;
	}
	
	for (Integer point : respawnPoints) {
		Mob mob = Bestiary.mob( Dungeon.depth );
		mob.state = mob.WANDERING;
		GameScene.add( mob, DELAY );
		WandOfBlink.appear( mob, point );
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:49,代码来源:SummoningTrap.java

示例3: paint

import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //导入方法依赖的package包/类
public static void paint( Level level, Room room ) {
	 
	Integer traps[] = {
		Terrain.TOXIC_TRAP, Terrain.TOXIC_TRAP, Terrain.TOXIC_TRAP, 
		Terrain.PARALYTIC_TRAP, Terrain.PARALYTIC_TRAP, 
		!Dungeon.bossLevel( Dungeon.depth + 1 ) ? Terrain.CHASM : Terrain.SUMMONING_TRAP };
	fill( level, room, Terrain.WALL );
	fill( level, room, 1, Random.element( traps ) );
	
	Room.Door door = room.entrance(); 
	door.set( Room.Door.Type.REGULAR );
	
	int lastRow = level.map[room.left + 1 + (room.top + 1) * Level.WIDTH] == Terrain.CHASM ? Terrain.CHASM : Terrain.EMPTY;

	int x = -1;
	int y = -1;
	if (door.x == room.left) {
		x = room.right - 1;
		y = room.top + room.height() / 2;
		fill( level, x, room.top + 1, 1, room.height() - 1 , lastRow );
	} else if (door.x == room.right) {
		x = room.left + 1;
		y = room.top + room.height() / 2;
		fill( level, x, room.top + 1, 1, room.height() - 1 , lastRow );
	} else if (door.y == room.top) {
		x = room.left + room.width() / 2;
		y = room.bottom - 1;
		fill( level, room.left + 1, y, room.width() - 1, 1 , lastRow );
	} else if (door.y == room.bottom) {
		x = room.left + room.width() / 2;
		y = room.top + 1;
		fill( level, room.left + 1, y, room.width() - 1, 1 , lastRow );
	}
	
	int pos = x + y * Level.WIDTH;
	if (Random.Int( 3 ) == 0) {
		if (lastRow == Terrain.CHASM) {
			set( level, pos, Terrain.EMPTY );
		}
		level.drop( prize( level ), pos ).type = Heap.Type.CHEST;
	} else {
		set( level, pos, Terrain.PEDESTAL );
		level.drop( prize( level ), pos );
	}
	
	level.addItemToSpawn( new PotionOfLevitation() );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:48,代码来源:TrapsPainter.java

示例4: paint

import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //导入方法依赖的package包/类
public static void paint( Level level, Room room ) {
	
	fill( level, room, Terrain.WALL );
	for (Room.Door door : room.connected.values()) {
		door.set( Room.Door.Type.REGULAR );
	}
	
	if (!Dungeon.bossLevel() && Random.Int( 5 ) == 0) {
		switch (Random.Int( 6 )) {
		case 0:
			if (level.feeling != Level.Feeling.GRASS) {
				if (Math.min( room.width(), room.height() ) >= 4 && Math.max( room.width(), room.height() ) >= 6) {
					paintGraveyard( level, room );
					return;
				}
				break;
			} else {
				// Burned room
			}
		case 1:
			if (Dungeon.depth > 1) {
				paintBurned( level, room );
				return;
			}
			break;
		case 2:
			if (Math.max( room.width(), room.height() ) >= 4) {
				paintStriped( level, room );
				return;
			}
			break;
		case 3:
			if (room.width() >= 6 && room.height() >= 6) {
				paintStudy( level, room );
				return;
			}
			break;
		case 4:
			if (level.feeling != Level.Feeling.WATER) {
				if (room.connected.size() == 2 && room.width() >= 4 && room.height() >= 4) {
					paintBridge( level, room );
					return;
				}
				break;
			} else {
				// Fissure
			}
		case 5:
			if (!Dungeon.bossLevel() && !Dungeon.bossLevel( Dungeon.depth + 1 ) && 
				Math.min( room.width(), room.height() ) >= 5) {
				paintFissure( level, room );
				return;
			}
			break;
		}
	}
	
	fill( level, room, 1, Terrain.EMPTY );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:60,代码来源:StandardPainter.java

示例5: execute

import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //导入方法依赖的package包/类
@Override
public void execute( Hero hero, String action ) {
	
	if (action == AC_SET || action == AC_RETURN) {
		
		if (Dungeon.bossLevel()) {
			hero.spend( LloydsBeacon.TIME_TO_USE );
			GLog.w( TXT_PREVENTING );
			return;
		}
		
		for (int i=0; i < Level.NEIGHBOURS8.length; i++) {
			if (Actor.findChar( hero.pos + Level.NEIGHBOURS8[i] ) != null) {
				GLog.w( TXT_CREATURES );
				return;
			}
		}
	}
	
	if (action == AC_SET) {
		
		returnDepth = Dungeon.depth;
		returnPos = hero.pos;
		
		hero.spend( LloydsBeacon.TIME_TO_USE );
		hero.busy();
		
		hero.sprite.operate( hero.pos );
		Sample.INSTANCE.play( Assets.SND_BEACON );
		
		GLog.i( TXT_RETURN );
		
	} else if (action == AC_RETURN) {
		
		if (returnDepth == Dungeon.depth) {
			reset();
			WandOfBlink.appear( hero, returnPos );
			Dungeon.level.press( returnPos, hero );
			Dungeon.observe();
		} else {

			Buff buff = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
			if (buff != null) buff.detach();

               for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] ))
                   if (mob instanceof DriedRose.GhostHero) mob.destroy();

			InterlevelScene.mode = InterlevelScene.Mode.RETURN;
			InterlevelScene.returnDepth = returnDepth;
			InterlevelScene.returnPos = returnPos;
			reset();
			Game.switchScene( InterlevelScene.class );
		}
		
		
	} else {
		
		super.execute( hero, action );
		
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:62,代码来源:LloydsBeacon.java


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