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


Java Blacksmith类代码示例

本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith的典型用法代码示例。如果您正苦于以下问题:Java Blacksmith类的具体用法?Java Blacksmith怎么用?Java Blacksmith使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Blacksmith类属于com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs包,在下文中一共展示了Blacksmith类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onSelect

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith; //导入依赖的package包/类
@Override
public void onSelect( Item item ) {
	if (item != null) {
		btnPressed.item( item );
		
		if (btnItem1.item != null && btnItem2.item != null) {
			String result = Blacksmith.verify( btnItem1.item, btnItem2.item );
			if (result != null) {
				GameScene.show( new WndMessage( result ) );
				btnReforge.enable( false );
			} else {
				btnReforge.enable( true );
			}
		}
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:17,代码来源:WndBlacksmith.java

示例2: paint

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith; //导入依赖的package包/类
public static void paint( Level level, Room room ) {

		fill( level, room, Terrain.WALL );
		fill( level, room, 1, Terrain.FIRE_TRAP );
		fill( level, room, 2, Terrain.EMPTY_SP );
		
		for (int i=0; i < 2; i++) {
			int pos;
			do {
				pos = room.random();
			} while (level.map[pos] != Terrain.EMPTY_SP);
			level.drop( 
				Generator.random( Random.oneOf( 
					Generator.Category.ARMOR, 
					Generator.Category.WEAPON
				) ), pos );
		}
		
		for (Room.Door door : room.connected.values()) {
			door.set( Room.Door.Type.UNLOCKED );
			drawInside( level, room, door, 1, Terrain.EMPTY );
		}
		
		Blacksmith npc = new Blacksmith();
		do {
			npc.pos = room.random( 1 );
		} while (level.heaps.get( npc.pos ) != null);
		level.mobs.add( npc );
		Actor.occupyCell( npc );
	}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:31,代码来源:BlacksmithPainter.java

示例3: assignRoomType

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith; //导入依赖的package包/类
@Override
protected boolean assignRoomType() {
	super.assignRoomType();

	if (!Blacksmith.Quest.spawn( rooms ) && Dungeon.depth == 14)
		return false;

	return true;
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:10,代码来源:CavesLevel.java

示例4: paint

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith; //导入依赖的package包/类
public void paint(Level level ) {

		Painter.fill( level, this, Terrain.WALL );
		Painter.fill( level, this, 1, Terrain.TRAP );
		Painter.fill( level, this, 2, Terrain.EMPTY_SP );
		
		for (int i=0; i < 2; i++) {
			int pos;
			do {
				pos = level.pointToCell(random());
			} while (level.map[pos] != Terrain.EMPTY_SP);
			level.drop(
				Generator.random( Random.oneOf(
					Generator.Category.ARMOR,
					Generator.Category.WEAPON
				) ), pos );
		}
		
		for (Door door : connected.values()) {
			door.set( Door.Type.REGULAR );
			Painter.drawInside( level, this, door, 1, Terrain.EMPTY );
		}
		
		Blacksmith npc = new Blacksmith();
		do {
			npc.pos = level.pointToCell(random( 2 ));
		} while (level.heaps.get( npc.pos ) != null);
		level.mobs.add( npc );

		for(Point p : getPoints()) {
			int cell = level.pointToCell(p);
			if (level.map[cell] == Terrain.TRAP){
				level.setTrap(new BurningTrap().reveal(), cell);
			}
		}
	}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:37,代码来源:BlacksmithRoom.java

示例5: WndBlacksmith

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith; //导入依赖的package包/类
public WndBlacksmith( Blacksmith troll, Hero hero ) {
	
	super();
	
	IconTitle titlebar = new IconTitle();
	titlebar.icon( troll.sprite() );
	titlebar.label( Utils.capitalize( troll.name ) );
	titlebar.setRect( 0, 0, WIDTH, 0 );
	add( titlebar );
	
	BitmapTextMultiline message = PixelScene.createMultiline( TXT_PROMPT, 6 );
	message.maxWidth = WIDTH;
	message.measure();
	message.y = titlebar.bottom() + GAP;
	add( message );
	
	btnItem1 = new ItemButton() {
		@Override
		protected void onClick() {
			btnPressed = btnItem1;
			GameScene.selectItem( itemSelector, WndBag.Mode.UPGRADEABLE, TXT_SELECT );
		}
	};
	btnItem1.setRect( (WIDTH - BTN_GAP) / 2 - BTN_SIZE, message.y + message.height() + BTN_GAP, BTN_SIZE, BTN_SIZE );
	add( btnItem1 );
	
	btnItem2 = new ItemButton() {
		@Override
		protected void onClick() {
			btnPressed = btnItem2;
			GameScene.selectItem( itemSelector, WndBag.Mode.UPGRADEABLE, TXT_SELECT );
		}
	};
	btnItem2.setRect( btnItem1.right() + BTN_GAP, btnItem1.top(), BTN_SIZE, BTN_SIZE );
	add( btnItem2 );
	
	btnReforge = new RedButton( TXT_REFORGE ) {
		@Override
		protected void onClick() {
			Blacksmith.upgrade( btnItem1.item, btnItem2.item );
			hide();
		}
	};
	btnReforge.enable( false );
	btnReforge.setRect( 0, btnItem1.bottom() + BTN_GAP, WIDTH, 20 );
	add( btnReforge );
	
	
	resize( WIDTH, (int)btnReforge.bottom() );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:51,代码来源:WndBlacksmith.java

示例6: WndBlacksmith

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith; //导入依赖的package包/类
public WndBlacksmith( Blacksmith troll, Hero hero ) {
	
	super();
	
	IconTitle titlebar = new IconTitle();
	titlebar.icon( troll.sprite() );
	titlebar.label( Messages.titleCase( troll.name ) );
	titlebar.setRect( 0, 0, WIDTH, 0 );
	add( titlebar );
	
	RenderedTextMultiline message = PixelScene.renderMultiline( Messages.get(this, "prompt"), 6 );
	message.maxWidth( WIDTH);
	message.setPos(0, titlebar.bottom() + GAP);
	add( message );
	
	btnItem1 = new ItemButton() {
		@Override
		protected void onClick() {
			btnPressed = btnItem1;
			GameScene.selectItem( itemSelector, WndBag.Mode.UPGRADEABLE, Messages.get(WndBlacksmith.class, "select") );
		}
	};
	btnItem1.setRect( (WIDTH - BTN_GAP) / 2 - BTN_SIZE, message.top() + message.height() + BTN_GAP, BTN_SIZE, BTN_SIZE );
	add( btnItem1 );
	
	btnItem2 = new ItemButton() {
		@Override
		protected void onClick() {
			btnPressed = btnItem2;
			GameScene.selectItem( itemSelector, WndBag.Mode.UPGRADEABLE, Messages.get(WndBlacksmith.class, "select") );
		}
	};
	btnItem2.setRect( btnItem1.right() + BTN_GAP, btnItem1.top(), BTN_SIZE, BTN_SIZE );
	add( btnItem2 );
	
	btnReforge = new RedButton( Messages.get(this, "reforge") ) {
		@Override
		protected void onClick() {
			Blacksmith.upgrade( btnItem1.item, btnItem2.item );
			hide();
		}
	};
	btnReforge.enable( false );
	btnReforge.setRect( 0, btnItem1.bottom() + BTN_GAP, WIDTH, 20 );
	add( btnReforge );
	
	
	resize( WIDTH, (int)btnReforge.bottom() );
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:50,代码来源:WndBlacksmith.java

示例7: saveGame

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith; //导入依赖的package包/类
public static void saveGame( String fileName ) throws IOException {
	try {
		Bundle bundle = new Bundle();

		version = Game.versionCode;
		bundle.put( VERSION, version );
		bundle.put( SEED, seed );
		bundle.put( CHALLENGES, challenges );
		bundle.put( HERO, hero );
		bundle.put( GOLD, gold );
		bundle.put( DEPTH, depth );

		for (int d : droppedItems.keyArray()) {
			bundle.put(Messages.format(DROPPED, d), droppedItems.get(d));
		}

		quickslot.storePlaceholders( bundle );

		Bundle limDrops = new Bundle();
		LimitedDrops.store( limDrops );
		bundle.put ( LIMDROPS, limDrops );
		
		int count = 0;
		int ids[] = new int[chapters.size()];
		for (Integer id : chapters) {
			ids[count++] = id;
		}
		bundle.put( CHAPTERS, ids );
		
		Bundle quests = new Bundle();
		Ghost		.Quest.storeInBundle( quests );
		Wandmaker	.Quest.storeInBundle( quests );
		Blacksmith	.Quest.storeInBundle( quests );
		Imp			.Quest.storeInBundle( quests );
		bundle.put( QUESTS, quests );
		
		SpecialRoom.storeRoomsInBundle( bundle );
		SecretRoom.storeRoomsInBundle( bundle );
		
		Statistics.storeInBundle( bundle );
		Notes.storeInBundle( bundle );
		Generator.storeInBundle( bundle );
		
		Scroll.save( bundle );
		Potion.save( bundle );
		Ring.save( bundle );

		Actor.storeNextID( bundle );
		
		Bundle badges = new Bundle();
		Badges.saveLocal( badges );
		bundle.put( BADGES, badges );
		
		OutputStream output = Game.instance.openFileOutput( fileName, Game.MODE_PRIVATE );
		Bundle.write( bundle, output );
		output.close();
		
	} catch (IOException e) {
		GamesInProgress.setUnknown( hero.heroClass );
		ShatteredPixelDungeon.reportException(e);
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:63,代码来源:Dungeon.java

示例8: initRooms

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith; //导入依赖的package包/类
@Override
protected ArrayList<Room> initRooms() {
	return Blacksmith.Quest.spawn(super.initRooms());
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:5,代码来源:CavesLevel.java

示例9: saveGame

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith; //导入依赖的package包/类
public static void saveGame( String fileName ) throws IOException {
	try {
		Bundle bundle = new Bundle();

		version = Game.versionCode;
		bundle.put( VERSION, version );
		bundle.put( SEED, seed );
		bundle.put( CHALLENGES, challenges );
		bundle.put( HERO, hero );
		bundle.put( GOLD, gold );
		bundle.put( DEPTH, depth );

		for (int d : droppedItems.keyArray()) {
			bundle.put(Messages.format(DROPPED, d), droppedItems.get(d));
		}

		quickslot.storePlaceholders( bundle );

		Bundle limDrops = new Bundle();
		LimitedDrops.store( limDrops );
		bundle.put ( LIMDROPS, limDrops );
		
		int count = 0;
		int ids[] = new int[chapters.size()];
		for (Integer id : chapters) {
			ids[count++] = id;
		}
		bundle.put( CHAPTERS, ids );
		
		Bundle quests = new Bundle();
		Ghost		.Quest.storeInBundle( quests );
		Wandmaker	.Quest.storeInBundle( quests );
		Blacksmith	.Quest.storeInBundle( quests );
		Imp			.Quest.storeInBundle( quests );
		bundle.put( QUESTS, quests );
		
		SpecialRoom.storeRoomsInBundle( bundle );
		SecretRoom.storeRoomsInBundle( bundle );
		
		Statistics.storeInBundle( bundle );
		Notes.storeInBundle( bundle );
		Generator.storeInBundle( bundle );
		
		Scroll.save( bundle );
		Potion.save( bundle );
		Ring.save( bundle );

		Actor.storeNextID( bundle );
		
		Bundle badges = new Bundle();
		Badges.saveLocal( badges );
		bundle.put( BADGES, badges );
		
		OutputStream output = Game.instance.openFileOutput( fileName );
		Bundle.write( bundle, output );
		output.close();
		
	} catch (IOException e) {
		GamesInProgress.setUnknown( hero.heroClass );
		ShatteredPixelDungeon.reportException(e);
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon-gdx,代码行数:63,代码来源:Dungeon.java

示例10: init

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith; //导入依赖的package包/类
public static void init() {

        challenges = ShatteredPixelDungeon.challenges();

        Generator.initArtifacts();

		Actor.clear();
		
		PathFinder.setMapSize( Level.WIDTH, Level.HEIGHT );
		
		Scroll.initLabels();
		Potion.initColors();
		Wand.initWoods();
		Ring.initGems();
		
		Statistics.reset();
		Journal.reset();

		quickslot.reset();
		
		depth = 0;
		gold = 0;
		
		for (limitedDrops a : limitedDrops.values())
            a.count = 0;

		dewVial = true;
		transmutation = Random.IntRange( 6, 14 );
		
		chapters = new HashSet<Integer>();
		
		Ghost.Quest.reset();
		Wandmaker.Quest.reset();
		Blacksmith.Quest.reset();
		Imp.Quest.reset();
		
		Room.shuffleTypes();
		
		hero = new Hero();
		hero.live();
		
		Badges.reset();
		
		StartScene.curClass.initHero( hero );
	}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:46,代码来源:Dungeon.java

示例11: init

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith; //导入依赖的package包/类
public static void init() {

		version = Game.versionCode;
		challenges = ShatteredPixelDungeon.challenges();

		seed = DungeonSeed.randomSeed();

		Actor.clear();
		Actor.resetNextID();
		
		Random.seed( seed );

			Scroll.initLabels();
			Potion.initColors();
			Ring.initGems();

			SpecialRoom.initForRun();
			SecretRoom.initForRun();

		Random.seed();
		
		Statistics.reset();
		Notes.reset();

		quickslot.reset();
		QuickSlotButton.reset();
		
		depth = 0;
		gold = 0;

		droppedItems = new SparseArray<ArrayList<Item>>();

		for (LimitedDrops a : LimitedDrops.values())
			a.count = 0;
		
		chapters = new HashSet<Integer>();
		
		Ghost.Quest.reset();
		Wandmaker.Quest.reset();
		Blacksmith.Quest.reset();
		Imp.Quest.reset();

		Generator.reset();
		Generator.initArtifacts();
		hero = new Hero();
		hero.live();
		
		Badges.reset();
		
		StartScene.curClass.initHero( hero );
	}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:52,代码来源:Dungeon.java


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