本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.items.bags.WandHolster类的典型用法代码示例。如果您正苦于以下问题:Java WandHolster类的具体用法?Java WandHolster怎么用?Java WandHolster使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WandHolster类属于com.shatteredpixel.shatteredpixeldungeon.items.bags包,在下文中一共展示了WandHolster类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateAllBagsBought
import com.shatteredpixel.shatteredpixeldungeon.items.bags.WandHolster; //导入依赖的package包/类
public static void validateAllBagsBought( Item bag ) {
Badge badge = null;
if (bag instanceof SeedPouch) {
badge = Badge.BAG_BOUGHT_SEED_POUCH;
} else if (bag instanceof ScrollHolder) {
badge = Badge.BAG_BOUGHT_SCROLL_HOLDER;
} else if (bag instanceof WandHolster) {
badge = Badge.BAG_BOUGHT_WAND_HOLSTER;
}
if (badge != null) {
local.add( badge );
if (!local.contains( Badge.ALL_BAGS_BOUGHT ) &&
local.contains( Badge.BAG_BOUGHT_SCROLL_HOLDER ) &&
local.contains( Badge.BAG_BOUGHT_SEED_POUCH ) &&
local.contains( Badge.BAG_BOUGHT_WAND_HOLSTER )) {
badge = Badge.ALL_BAGS_BOUGHT;
local.add( badge );
displayBadge( badge );
}
}
}
示例2: selectItem
import com.shatteredpixel.shatteredpixeldungeon.items.bags.WandHolster; //导入依赖的package包/类
public static WndBag selectItem( WndBag.Listener listener, WndBag.Mode mode, String title ) {
cancelCellSelector();
WndBag wnd =
mode == Mode.SEED ?
WndBag.getBag( SeedPouch.class, listener, mode, title ) :
mode == Mode.SCROLL ?
WndBag.getBag( ScrollHolder.class, listener, mode, title ) :
mode == Mode.POTION ?
WndBag.getBag( PotionBandolier.class, listener, mode, title ) :
mode == Mode.WAND ?
WndBag.getBag( WandHolster.class, listener, mode, title ) :
WndBag.lastBag( listener, mode, title );
if (scene != null) scene.addToFront( wnd );
return wnd;
}
示例3: icon
import com.shatteredpixel.shatteredpixeldungeon.items.bags.WandHolster; //导入依赖的package包/类
private Image icon() {
if (bag instanceof SeedPouch) {
return Icons.get( Icons.SEED_POUCH );
} else if (bag instanceof ScrollHolder) {
return Icons.get( Icons.SCROLL_HOLDER );
} else if (bag instanceof WandHolster) {
return Icons.get( Icons.WAND_HOLSTER );
} else {
return Icons.get( Icons.BACKPACK );
}
}
示例4: validateAllBagsBought
import com.shatteredpixel.shatteredpixeldungeon.items.bags.WandHolster; //导入依赖的package包/类
public static void validateAllBagsBought( Item bag ) {
Badge badge = null;
if (bag instanceof SeedPouch) {
badge = Badge.BAG_BOUGHT_SEED_POUCH;
} else if (bag instanceof ScrollHolder) {
badge = Badge.BAG_BOUGHT_SCROLL_HOLDER;
} else if (bag instanceof PotionBandolier) {
badge = Badge.BAG_BOUGHT_POTION_BANDOLIER;
} else if (bag instanceof WandHolster) {
badge = Badge.BAG_BOUGHT_WAND_HOLSTER;
}
if (badge != null) {
local.add( badge );
if (!local.contains( Badge.ALL_BAGS_BOUGHT ) &&
local.contains( Badge.BAG_BOUGHT_SEED_POUCH ) &&
local.contains( Badge.BAG_BOUGHT_SCROLL_HOLDER ) &&
local.contains( Badge.BAG_BOUGHT_POTION_BANDOLIER ) &&
local.contains( Badge.BAG_BOUGHT_WAND_HOLSTER )) {
badge = Badge.ALL_BAGS_BOUGHT;
local.add( badge );
displayBadge( badge );
}
}
}
示例5: icon
import com.shatteredpixel.shatteredpixeldungeon.items.bags.WandHolster; //导入依赖的package包/类
private Image icon() {
if (bag instanceof SeedPouch) {
return Icons.get( Icons.SEED_POUCH );
} else if (bag instanceof ScrollHolder) {
return Icons.get( Icons.SCROLL_HOLDER );
} else if (bag instanceof WandHolster) {
return Icons.get( Icons.WAND_HOLSTER );
} else if (bag instanceof PotionBandolier) {
return Icons.get( Icons.POTION_BANDOLIER );
} else {
return Icons.get( Icons.BACKPACK );
}
}
示例6: ChooseBag
import com.shatteredpixel.shatteredpixeldungeon.items.bags.WandHolster; //导入依赖的package包/类
protected static Bag ChooseBag(Belongings pack){
int seeds = 0, scrolls = 0, potions = 0, wands = 0;
//count up items in the main bag, for bags which haven't yet been dropped.
for (Item item : pack.backpack.items) {
if (!Dungeon.LimitedDrops.SEED_POUCH.dropped() && item instanceof Plant.Seed)
seeds++;
else if (!Dungeon.LimitedDrops.SCROLL_HOLDER.dropped() && item instanceof Scroll)
scrolls++;
else if (!Dungeon.LimitedDrops.POTION_BANDOLIER.dropped() && item instanceof Potion)
potions++;
else if (!Dungeon.LimitedDrops.WAND_HOLSTER.dropped() && item instanceof Wand)
wands++;
}
//then pick whichever valid bag has the most items available to put into it.
//note that the order here gives a perference if counts are otherwise equal
if (seeds >= scrolls && seeds >= potions && seeds >= wands && !Dungeon.LimitedDrops.SEED_POUCH.dropped()) {
Dungeon.LimitedDrops.SEED_POUCH.drop();
return new SeedPouch();
} else if (scrolls >= potions && scrolls >= wands && !Dungeon.LimitedDrops.SCROLL_HOLDER.dropped()) {
Dungeon.LimitedDrops.SCROLL_HOLDER.drop();
return new ScrollHolder();
} else if (potions >= wands && !Dungeon.LimitedDrops.POTION_BANDOLIER.dropped()) {
Dungeon.LimitedDrops.POTION_BANDOLIER.drop();
return new PotionBandolier();
} else if (!Dungeon.LimitedDrops.WAND_HOLSTER.dropped()) {
Dungeon.LimitedDrops.WAND_HOLSTER.drop();
return new WandHolster();
}
return null;
}
示例7: collect
import com.shatteredpixel.shatteredpixeldungeon.items.bags.WandHolster; //导入依赖的package包/类
@Override
public boolean collect( Bag container ) {
if (super.collect( container )) {
if (container.owner != null) {
if (container instanceof WandHolster)
charge( container.owner, ((WandHolster) container).HOLSTER_SCALE_FACTOR );
else
charge( container.owner );
}
return true;
} else {
return false;
}
}
示例8: WndBag
import com.shatteredpixel.shatteredpixeldungeon.items.bags.WandHolster; //导入依赖的package包/类
public WndBag( Bag bag, Listener listener, Mode mode, String title ) {
super();
this.listener = listener;
this.mode = mode;
this.title = title;
lastMode = mode;
lastBag = bag;
BitmapText txtTitle = PixelScene.createText( title != null ? title : Utils.capitalize( bag.name() ), 9 );
txtTitle.hardlight( TITLE_COLOR );
txtTitle.measure();
txtTitle.x = (int)(SLOT_SIZE * COLS + SLOT_MARGIN * (COLS - 1) - txtTitle.width()) / 2;
txtTitle.y = (int)(TITLE_HEIGHT - txtTitle.height()) / 2;
add( txtTitle );
placeItems( bag );
resize(
SLOT_SIZE * COLS + SLOT_MARGIN * (COLS - 1),
SLOT_SIZE * ROWS + SLOT_MARGIN * (ROWS - 1) + TITLE_HEIGHT );
Belongings stuff = Dungeon.hero.belongings;
Bag[] bags = {
stuff.backpack,
stuff.getItem( SeedPouch.class ),
stuff.getItem( ScrollHolder.class ),
stuff.getItem( WandHolster.class )};
for (Bag b : bags) {
if (b != null) {
BagTab tab = new BagTab( b );
tab.setSize( TAB_WIDTH, tabHeight() );
add( tab );
tab.select( b == bag );
}
}
}
示例9: WndBag
import com.shatteredpixel.shatteredpixeldungeon.items.bags.WandHolster; //导入依赖的package包/类
public WndBag( Bag bag, Listener listener, Mode mode, String title ) {
super();
this.listener = listener;
this.mode = mode;
this.title = title;
lastMode = mode;
lastBag = bag;
nCols = ShatteredPixelDungeon.landscape() ? COLS_L : COLS_P;
nRows = (int)Math.ceil((Belongings.BACKPACK_SIZE + 4) / (float)nCols);
int slotsWidth = SLOT_WIDTH * nCols + SLOT_MARGIN * (nCols - 1);
int slotsHeight = SLOT_HEIGHT * nRows + SLOT_MARGIN * (nRows - 1);
placeTitle( bag, slotsWidth );
placeItems( bag );
resize( slotsWidth, slotsHeight + TITLE_HEIGHT );
Belongings stuff = Dungeon.hero.belongings;
Bag[] bags = {
stuff.backpack,
stuff.getItem( SeedPouch.class ),
stuff.getItem( ScrollHolder.class ),
stuff.getItem( PotionBandolier.class ),
stuff.getItem( WandHolster.class )};
for (Bag b : bags) {
if (b != null) {
BagTab tab = new BagTab( b );
add( tab );
tab.select( b == bag );
}
}
layoutTabs();
}