本文整理汇总了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 );
}
}
}
}
示例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 );
}
示例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;
}
示例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);
}
}
}
示例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() );
}
示例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() );
}
示例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);
}
}
示例8: initRooms
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith; //导入依赖的package包/类
@Override
protected ArrayList<Room> initRooms() {
return Blacksmith.Quest.spawn(super.initRooms());
}
示例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);
}
}
示例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 );
}
示例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 );
}