本文整理匯總了Java中com.shatteredpixel.shatteredpixeldungeon.Dungeon.depth方法的典型用法代碼示例。如果您正苦於以下問題:Java Dungeon.depth方法的具體用法?Java Dungeon.depth怎麽用?Java Dungeon.depth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.shatteredpixel.shatteredpixeldungeon.Dungeon
的用法示例。
在下文中一共展示了Dungeon.depth方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: evolve
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
@Override
protected void evolve() {
super.evolve();
int levelDamage = 5 + Dungeon.depth * 5;
Char ch;
for (int i=0; i < LENGTH; i++) {
if (cur[i] > 0 && (ch = Actor.findChar( i )) != null) {
int damage = (ch.HT + levelDamage) / 40;
if (Random.Int( 40 ) < (ch.HT + levelDamage) % 40) {
damage++;
}
ch.damage( damage, this );
}
}
}
示例2: spawn
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
public static boolean spawn( Collection<Room> rooms ) {
if (!spawned && Dungeon.depth > 11 && Random.Int( 15 - Dungeon.depth ) == 0) {
Room blacksmith = null;
for (Room r : rooms) {
if (r.type == Type.STANDARD && r.width() > 4 && r.height() > 4) {
blacksmith = r;
blacksmith.type = Type.BLACKSMITH;
spawned = true;
alternative = Random.Int( 2 ) == 0;
given = false;
break;
}
}
}
return spawned;
}
示例3: Statue
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
public Statue() {
super();
do {
weapon = (Weapon)Generator.random( Generator.Category.WEAPON );
} while (!(weapon instanceof MeleeWeapon) || weapon.level < 0);
weapon.identify();
weapon.enchant( Enchantment.random() );
HP = HT = 15 + Dungeon.depth * 5;
defenseSkill = 4 + Dungeon.depth;
}
示例4: assignRoomType
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
@Override
protected boolean assignRoomType() {
super.assignRoomType();
if (!Blacksmith.Quest.spawn( rooms ) && Dungeon.depth == 14)
return false;
return true;
}
示例5: saySpawned
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
public void saySpawned(){
int i = (Dungeon.depth - 1) / 5;
if (chooseEnemy() == DUMMY)
yell( Random.element( VOICE_AMBIENT[i] ) );
else
yell( Random.element( VOICE_ENEMIES[i][ Dungeon.bossLevel() ? 1 : 0 ] ) );
Sample.INSTANCE.play( Assets.SND_GHOST );
}
示例6: process
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
public static void process() {
if (spawned && given && !processed && (depth == Dungeon.depth)) {
GLog.n("sad ghost: Thank you... come find me...");
Sample.INSTANCE.play( Assets.SND_GHOST );
processed = true;
Generator.Category.ARTIFACT.probs[10] = 1; //flags the dried rose as spawnable.
}
}
示例7: paint
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
public static void paint( Level level, Room room ) {
fill( level, room, Terrain.WALL );
fill( level, room, 1, Terrain.EMPTY );
Point c = room.center();
set( level, c.x, c.y, Terrain.WELL );
@SuppressWarnings("unchecked")
Class<? extends WellWater> waterClass =
Dungeon.depth >= Dungeon.transmutation ?
WaterOfTransmutation.class :
(Class<? extends WellWater>)Random.element( WATERS );
if (waterClass == WaterOfTransmutation.class) {
Dungeon.transmutation = Integer.MAX_VALUE;
}
WellWater water = (WellWater)level.blobs.get( waterClass );
if (water == null) {
try {
water = waterClass.newInstance();
} catch (Exception e) {
water = null;
}
}
water.seed( c.x + Level.WIDTH * c.y, 1 );
level.blobs.put( waterClass, water );
room.entrance().set( Room.Door.Type.REGULAR );
}
示例8: doPickUp
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
@Override
public boolean doPickUp( Hero hero ) {
DewVial vial = hero.belongings.getItem( DewVial.class );
if (hero.HP < hero.HT || vial == null || vial.isFull()) {
int value = 1 + (Dungeon.depth - 1) / 5;
if (hero.heroClass == HeroClass.HUNTRESS) {
value++;
}
int effect = Math.min( hero.HT - hero.HP, value * quantity );
if (effect > 0) {
hero.HP += effect;
hero.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 );
hero.sprite.showStatus( CharSprite.POSITIVE, TXT_VALUE, effect );
}
} else if (vial != null) {
vial.collectDew( this );
}
Sample.INSTANCE.play( Assets.SND_DEWDROP );
hero.spendAndNext( TIME_TO_PICK_UP );
return true;
}
示例9: collect
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
@Override
public boolean collect( Bag bag ) {
boolean result = super.collect( bag );
if (result && depth == Dungeon.depth && Dungeon.hero != null) {
Dungeon.hero.belongings.countIronKeys();
}
return result;
}
示例10: returnTo
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
private void returnTo() throws IOException {
Actor.fixTime();
Dungeon.saveLevel();
Dungeon.depth = returnDepth;
Level level = Dungeon.loadLevel( Dungeon.hero.heroClass );
Dungeon.switchLevel( level, Level.resizingNeeded ? level.adjustPos( returnPos ) : returnPos );
}
示例11: restore
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
private void restore() throws IOException {
Actor.fixTime();
Dungeon.loadGame( StartScene.curClass );
if (Dungeon.depth == -1) {
Dungeon.depth = Statistics.deepestFloor;
Dungeon.switchLevel( Dungeon.loadLevel( StartScene.curClass ), -1 );
} else {
Level level = Dungeon.loadLevel( StartScene.curClass );
Dungeon.switchLevel( level, Level.resizingNeeded ? level.adjustPos( Dungeon.hero.pos ) : Dungeon.hero.pos );
}
}
示例12: ListItem
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
public ListItem( Journal.Feature f, int d ) {
super();
feature.text( f.desc );
feature.measure();
depth.text( Integer.toString( d ) );
depth.measure();
if (d == Dungeon.depth) {
feature.hardlight( TITLE_COLOR );
depth.hardlight( TITLE_COLOR );
}
}
示例13: execute
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
@Override
public void execute( final Hero hero, String action ) {
if (action.equals( AC_DRINK )) {
if (volume > 0) {
int value = 1 + (Dungeon.depth - 1) / 5;
if (hero.heroClass == HeroClass.HUNTRESS) {
value++;
}
value *= volume;
value = (int)Math.max(volume*volume*.01*hero.HT, value);
int effect = Math.min( hero.HT - hero.HP, value );
if (effect > 0) {
hero.HP += effect;
hero.sprite.emitter().burst( Speck.factory( Speck.HEALING ), volume > 5 ? 2 : 1 );
hero.sprite.showStatus( CharSprite.POSITIVE, TXT_VALUE, effect );
}
volume = 0;
hero.spend( TIME_TO_DRINK );
hero.busy();
Sample.INSTANCE.play( Assets.SND_DRINK );
hero.sprite.operate( hero.pos );
updateQuickslot();
} else {
GLog.w( TXT_EMPTY );
}
} else {
super.execute( hero, action );
}
}
示例14: 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 );
}
示例15: dr
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
@Override
public int dr() {
return Dungeon.depth;
}