本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.items.Stylus类的典型用法代码示例。如果您正苦于以下问题:Java Stylus类的具体用法?Java Stylus怎么用?Java Stylus使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Stylus类属于com.shatteredpixel.shatteredpixeldungeon.items包,在下文中一共展示了Stylus类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import com.shatteredpixel.shatteredpixeldungeon.items.Stylus; //导入依赖的package包/类
public void create() {
Random.seed( Dungeon.seedCurDepth() );
if (!(Dungeon.bossLevel() || Dungeon.depth == 21) /*final shop floor*/) {
addItemToSpawn( Generator.random( Generator.Category.FOOD ) );
if (Dungeon.posNeeded()) {
addItemToSpawn( new PotionOfStrength() );
Dungeon.LimitedDrops.STRENGTH_POTIONS.count++;
}
if (Dungeon.souNeeded()) {
addItemToSpawn( new ScrollOfUpgrade() );
Dungeon.LimitedDrops.UPGRADE_SCROLLS.count++;
}
if (Dungeon.asNeeded()) {
addItemToSpawn( new Stylus() );
Dungeon.LimitedDrops.ARCANE_STYLI.count++;
}
DriedRose rose = Dungeon.hero.belongings.getItem( DriedRose.class );
if (rose != null && rose.isIdentified() && !rose.cursed){
//aim to drop 1 petal every 2 floors
int petalsNeeded = (int) Math.ceil((float)((Dungeon.depth / 2) - rose.droppedPetals) / 3);
for (int i=1; i <= petalsNeeded; i++) {
//the player may miss a single petal and still max their rose.
if (rose.droppedPetals < 11) {
addItemToSpawn(new DriedRose.Petal());
rose.droppedPetals++;
}
}
}
if (Dungeon.depth > 1) {
switch (Random.Int( 10 )) {
case 0:
if (!Dungeon.bossLevel( Dungeon.depth + 1 )) {
feeling = Feeling.CHASM;
}
break;
case 1:
feeling = Feeling.WATER;
break;
case 2:
feeling = Feeling.GRASS;
break;
case 3:
feeling = Feeling.DARK;
addItemToSpawn(new Torch());
viewDistance = Math.round(viewDistance/2f);
break;
}
}
}
do {
width = height = length = 0;
mobs = new HashSet<>();
heaps = new SparseArray<>();
blobs = new HashMap<>();
plants = new SparseArray<>();
traps = new SparseArray<>();
customTiles = new HashSet<>();
customWalls = new HashSet<>();
} while (!build());
buildFlagMaps();
cleanWalls();
createMobs();
createItems();
Random.seed();
}