• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java IronKey类的典型用法和代码示例

java 1次浏览

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

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

示例1: createItems

点赞 3

import com.watabou.pixeldungeon.items.keys.IronKey; //导入依赖的package包/类
@Override
protected void createItems() {
	int keyPos = anteroom.random();
	while (!passable[keyPos]) {
		keyPos = anteroom.random();
	}
	drop( new IronKey(), keyPos ).type = Heap.Type.CHEST;
	
	Item item = Bones.get();
	if (item != null) {
		int pos;
		do {
			pos = roomEntrance.random();
		} while (pos == entrance || map[pos] == Terrain.SIGN);
		drop( item, pos ).type = Heap.Type.SKELETON;
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:18,
代码来源:PrisonBossLevel.java

示例2: createItems

点赞 3

import com.watabou.pixeldungeon.items.keys.IronKey; //导入依赖的package包/类
@Override
protected void createItems() {

	int keyPos = anteroom.random(this);
	while (!passable[keyPos]) {
		keyPos = anteroom.random(this);
	}
	drop( new IronKey(), keyPos ).type = Heap.Type.CHEST;
	
	Item item = Bones.get();
	if (item != null) {
		int pos;
		do {
			pos = roomEntrance.random(this);
		} while (pos == entrance);
		drop( item, pos ).type = Heap.Type.SKELETON;
	}
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:19,
代码来源:PrisonBossLevel.java

示例3: countIronKeys

点赞 2

import com.watabou.pixeldungeon.items.keys.IronKey; //导入依赖的package包/类
public void countIronKeys() {
	
	IronKey.curDepthQuantity = 0;
	
	for (Item item : backpack) {
		if (item instanceof IronKey && ((IronKey)item).depth == Dungeon.depth) {
			IronKey.curDepthQuantity++;
		}
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:11,
代码来源:Belongings.java

示例4: paint

点赞 2

import com.watabou.pixeldungeon.items.keys.IronKey; //导入依赖的package包/类
public static void paint( Level level, Room room ) {

		fill( level, room, Terrain.WALL );
		fill( level, room, 1, Terrain.EMPTY );

		Point c = room.center();
		int cx = c.x;
		int cy = c.y;
		
		Room.Door entrance = room.entrance();
		
		entrance.set( Room.Door.Type.LOCKED );
		level.addItemToSpawn( new IronKey() );
		
		if (entrance.x == room.left) {
			set( level, new Point( room.right-1, room.top+1 ), Terrain.STATUE );
			set( level, new Point( room.right-1, room.bottom-1 ), Terrain.STATUE );
			cx = room.right - 2;
		} else if (entrance.x == room.right) {
			set( level, new Point( room.left+1, room.top+1 ), Terrain.STATUE );
			set( level, new Point( room.left+1, room.bottom-1 ), Terrain.STATUE );
			cx = room.left + 2;
		} else if (entrance.y == room.top) {
			set( level, new Point( room.left+1, room.bottom-1 ), Terrain.STATUE );
			set( level, new Point( room.right-1, room.bottom-1 ), Terrain.STATUE );
			cy = room.bottom - 2;
		} else if (entrance.y == room.bottom) {
			set( level, new Point( room.left+1, room.top+1 ), Terrain.STATUE );
			set( level, new Point( room.right-1, room.top+1 ), Terrain.STATUE );
			cy = room.top + 2;
		}
		
		level.drop( prize( level ), cx + cy * Level.WIDTH ).type = Type.TOMB;
	}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:35,
代码来源:CryptPainter.java

示例5: paint

点赞 2

import com.watabou.pixeldungeon.items.keys.IronKey; //导入依赖的package包/类
public static void paint( Level level, Room room ) {

		fill( level, room, Terrain.WALL );
		fill( level, room, 1, Terrain.EMPTY_SP );
		fill( level, room, 2, Terrain.EMPTY );
		
		int cx = (room.left + room.right) / 2;
		int cy = (room.top + room.bottom) / 2;
		int c = cx + cy * Level.WIDTH;
		
		switch (Random.Int( 3 )) {
		
		case 0:
			level.drop( prize( level ), c ).type = Type.LOCKED_CHEST;
			level.addItemToSpawn( new GoldenKey() );
			break;
			
		case 1:
			Item i1, i2;
			do {
				i1 = prize( level );
				i2 = prize( level );
			} while (i1.getClass() == i2.getClass());
			level.drop( i1, c ).type = Type.CRYSTAL_CHEST;
			level.drop( i2, c + Level.NEIGHBOURS8[Random.Int( 8 )]).type = Type.CRYSTAL_CHEST;
			level.addItemToSpawn( new GoldenKey() );
			break;
			
		case 2:
			level.drop( prize( level ), c );
			set( level, c, Terrain.PEDESTAL );
			break;
		}
		
		room.entrance().set( Room.Door.Type.LOCKED );
		level.addItemToSpawn( new IronKey() );
	}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:38,
代码来源:VaultPainter.java

示例6: paint

点赞 2

import com.watabou.pixeldungeon.items.keys.IronKey; //导入依赖的package包/类
public static void paint( Level level, Room room ) {

		fill( level, room, Terrain.WALL );
		fill( level, room, 1, Terrain.EMPTY );
		
		int cx = (room.left + room.right) / 2;
		int cy = (room.top + room.bottom) / 2;
		int c = cx + cy * Level.WIDTH;
		
		switch (Random.Int( 3 )) {
		
		case 0:
			level.drop( prize( level ), c ).type = Type.LOCKED_CHEST;
			level.addItemToSpawn( new GoldenKey() );
			break;
			
		case 1:
			Item i1, i2;
			do {
				i1 = prize( level );
				i2 = prize( level );
			} while (i1.getClass() == i2.getClass());
			level.drop( i1, c ).type = Type.CRYSTAL_CHEST;
			level.drop( i2, c + Level.NEIGHBOURS8[Random.Int( 8 )]).type = Type.CRYSTAL_CHEST;
			level.addItemToSpawn( new GoldenKey() );
			break;
			
		case 2:
			level.drop( prize( level ), c );
			set( level, c, Terrain.PEDESTAL );
			break;
		}
		
		room.entrance().set( Room.Door.Type.LOCKED );
		level.addItemToSpawn( new IronKey() );
	}
 

开发者ID:skynet67,
项目名称:pixel-dungeon-rebirth,
代码行数:37,
代码来源:VaultPainter.java

示例7: countIronKeys

点赞 2

import com.watabou.pixeldungeon.items.keys.IronKey; //导入依赖的package包/类
public void countIronKeys() {
	
	IronKey.curDepthQuantity = 0;
	
	for (Item item : backpack) {
		if (item instanceof IronKey && ((IronKey)item).levelId.equals(DungeonGenerator.getCurrentLevelId())) {
			IronKey.curDepthQuantity++;
		}
	}
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:11,
代码来源:Belongings.java

示例8: actUnlock

点赞 2

import com.watabou.pixeldungeon.items.keys.IronKey; //导入依赖的package包/类
private boolean actUnlock(HeroAction.Unlock action) {
	int doorCell = action.dst;

	if (Dungeon.level.adjacent(getPos(), doorCell)) {
		theKey = null;
		int door = Dungeon.level.map[doorCell];

		if (door == Terrain.LOCKED_DOOR) {
			theKey = belongings.getKey(IronKey.class, Dungeon.depth, Dungeon.level.levelId);
		} else if (door == Terrain.LOCKED_EXIT) {
			theKey = belongings.getKey(SkeletonKey.class, Dungeon.depth, Dungeon.level.levelId);
		}

		if (theKey != null) {
			spend(Key.TIME_TO_UNLOCK);
			getSprite().operate(doorCell);
			Sample.INSTANCE.play(Assets.SND_UNLOCK);
		} else {
			GLog.w(TXT_LOCKED_DOOR);
			ready();
		}

		return false;

	} else if (getCloser(doorCell)) {
		return true;
	} else {
		ready();
		return false;
	}
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:32,
代码来源:Hero.java

示例9: paint

点赞 2

import com.watabou.pixeldungeon.items.keys.IronKey; //导入依赖的package包/类
public static void paint( Level level, Room room ) {

		fill( level, room, Terrain.WALL );
		fill( level, room, 1, Terrain.EMPTY );

		Point c = room.center();
		int cx = c.x;
		int cy = c.y;
		
		Room.Door entrance = room.entrance();
		
		entrance.set( Room.Door.Type.LOCKED );
		level.addItemToSpawn( new IronKey() );
		
		if (entrance.x == room.left) {
			set( level, new Point( room.right-1, room.top+1 ), Terrain.STATUE );
			set( level, new Point( room.right-1, room.bottom-1 ), Terrain.STATUE );
			cx = room.right - 2;
		} else if (entrance.x == room.right) {
			set( level, new Point( room.left+1, room.top+1 ), Terrain.STATUE );
			set( level, new Point( room.left+1, room.bottom-1 ), Terrain.STATUE );
			cx = room.left + 2;
		} else if (entrance.y == room.top) {
			set( level, new Point( room.left+1, room.bottom-1 ), Terrain.STATUE );
			set( level, new Point( room.right-1, room.bottom-1 ), Terrain.STATUE );
			cy = room.bottom - 2;
		} else if (entrance.y == room.bottom) {
			set( level, new Point( room.left+1, room.top+1 ), Terrain.STATUE );
			set( level, new Point( room.right-1, room.top+1 ), Terrain.STATUE );
			cy = room.top + 2;
		}
		
		level.drop( prize( level ), cx + cy * level.getWidth() ).type = Type.TOMB;
	}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:35,
代码来源:CryptPainter.java

示例10: paint

点赞 2

import com.watabou.pixeldungeon.items.keys.IronKey; //导入依赖的package包/类
public static void paint( Level level, Room room ) {

		fill( level, room, Terrain.WALL );
		fill( level, room, 1, Terrain.EMPTY );
		
		int cx = (room.left + room.right) / 2;
		int cy = (room.top + room.bottom) / 2;
		int c = cx + cy * level.getWidth();
		
		switch (Random.Int( 3 )) {
		
		case 0:
			level.drop( prize( level ), c ).type = Type.LOCKED_CHEST;
			level.addItemToSpawn( new GoldenKey() );
			break;
			
		case 1:
			Item i1, i2;
			do {
				i1 = prize( level );
				i2 = prize( level );
			} while (i1.getClass() == i2.getClass());
			level.drop( i1, c ).type = Type.CRYSTAL_CHEST;
			level.drop( i2, c + Level.NEIGHBOURS8[Random.Int( 8 )]).type = Type.CRYSTAL_CHEST;
			level.addItemToSpawn( new GoldenKey() );
			break;
			
		case 2:
			level.drop( prize( level ), c );
			set( level, c, Terrain.PEDESTAL );
			break;
		}
		
		room.entrance().set( Room.Door.Type.LOCKED );
		level.addItemToSpawn( new IronKey() );
	}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:37,
代码来源:VaultPainter.java

示例11: update

点赞 2

import com.watabou.pixeldungeon.items.keys.IronKey; //导入依赖的package包/类
@Override
public void update() {
	super.update();
	
	if (tagDanger != danger.visible || tagLoot != loot.visible || tagResume != resume.visible) {
		
		tagDanger = danger.visible;
		tagLoot = loot.visible;
		tagResume = resume.visible;
		
		layoutTags();
	}
	
	float health = (float)Dungeon.hero.HP / Dungeon.hero.HT;
	
	if (health == 0) {
		avatar.tint( 0x000000, 0.6f );
		blood.on = false;
	} else if (health < 0.25f) {
		avatar.tint( 0xcc0000, 0.4f );
		blood.on = true;
	} else {
		avatar.resetColor();
		blood.on = false;
	}
	
	hp.scale.x = health;
	exp.scale.x = (width / exp.width) * Dungeon.hero.exp / Dungeon.hero.maxExp();
	
	if (Dungeon.hero.lvl != lastLvl) {
		
		if (lastLvl != -1) {
			Emitter emitter = (Emitter)recycle( Emitter.class );
			emitter.revive();
			emitter.pos( 27, 27 );
			emitter.burst( Speck.factory( Speck.STAR ), 12 );
		}
		
		lastLvl = Dungeon.hero.lvl;
		level.text( Integer.toString( lastLvl ) );
		level.measure();
		level.x = PixelScene.align( 27.5f - level.width() / 2 );
		level.y = PixelScene.align( 28.0f - level.baseLine() / 2 );
	}
	
	int k = IronKey.curDepthQuantity;
	if (k != lastKeys) {
		lastKeys = k;
		keys.text( Integer.toString( lastKeys ) );
		keys.measure();
		keys.x = width - 8 - keys.width()    - 18;
	}
	
	int tier = Dungeon.hero.tier();
	if (tier != lastTier) {
		lastTier = tier;
		avatar.copy( HeroSprite.avatar( Dungeon.hero.heroClass, tier ) );
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:60,
代码来源:StatusPane.java

示例12: update

点赞 2

import com.watabou.pixeldungeon.items.keys.IronKey; //导入依赖的package包/类
@Override
public void update() {
    super.update();

    if (tagDanger != danger.visible || tagLoot != loot.visible || tagResume != resume.visible) {

        tagDanger = danger.visible;
        tagLoot = loot.visible;
        tagResume = resume.visible;

        layoutTags();
    }

    float health = (float) Dungeon.hero.HP / Dungeon.hero.HT;

    if (health == 0) {
        avatar.tint(0x000000, 0.6f);
        blood.on = false;
    } else if (health < 0.25f) {
        avatar.tint(0xcc0000, 0.4f);
        blood.on = true;
    } else {
        avatar.resetColor();
        blood.on = false;
    }

    hp.scale.x = health;
    exp.scale.x = (width / exp.width) * Dungeon.hero.exp / Dungeon.hero.maxExp();

    if (Dungeon.hero.lvl != lastLvl) {

        if (lastLvl != -1) {
            Emitter emitter = (Emitter) recycle(Emitter.class);
            emitter.revive();
            emitter.pos(27, 27);
            emitter.burst(Speck.factory(Speck.STAR), 12);
        }

        lastLvl = Dungeon.hero.lvl;
        level.text(Integer.toString(lastLvl));
        level.measure();
        level.x = PixelScene.align(27.0f - level.width() / 2);
        level.y = PixelScene.align(27.5f - level.baseLine() / 2);
    }

    int k = IronKey.curDepthQuantity;
    if (k != lastKeys) {
        lastKeys = k;
        keys.text(Integer.toString(lastKeys));
        keys.measure();
        keys.x = width - 8 - keys.width() - 18;
    }

    int tier = Dungeon.hero.tier();
    if (tier != lastTier) {
        lastTier = tier;
        avatar.copy(HeroSprite.avatar(Dungeon.hero.heroClass, tier));
    }
}
 

开发者ID:skynet67,
项目名称:pixel-dungeon-rebirth,
代码行数:60,
代码来源:StatusPane.java

示例13: update

点赞 2

import com.watabou.pixeldungeon.items.keys.IronKey; //导入依赖的package包/类
@Override
public void update() {
	super.update();
	
	float health = (float)hero.hp() / hero.ht();
	float sPoints = (float)hero.getSoulPoints() / hero.getSoulPointsMax();

	if (health == 0) {
		avatar.tint( 0x000000, 0.6f );
		blood.on = false;
	} else if (health < 0.25f) {
		avatar.tint( 0xcc0000, 0.4f );
		blood.on = true;
	} else {
		avatar.resetColor();
		blood.on = false;
	}

	hp.Scale().x = health;
	sp.Scale().x = sPoints;
	exp.Scale().x = (width / exp.width) * hero.getExp() / hero.maxExp();

	if (hero.lvl() != lastLvl) {
		
		if (lastLvl != -1) {
			Emitter emitter = (Emitter)recycle( Emitter.class );
			emitter.revive();
			emitter.pos( 27, 27 );
			emitter.burst( Speck.factory( Speck.STAR ), 12 );
		}
		
		lastLvl = hero.lvl();
		level.text( Integer.toString( lastLvl ) );
		level.measure();
		level.x = PixelScene.align( 27.0f - level.width() / 2 );
		level.y = PixelScene.align( 27.5f - level.baseLine() / 2 );
	}
	
	int k = IronKey.curDepthQuantity;
	if (k != lastKeys) {
		lastKeys = k;
		keys.text( Integer.toString( lastKeys ) );
		keys.measure();
		keys.x = width - 8 - keys.width()    - 18;
	}
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:47,
代码来源:StatusPane.java

示例14: actUnlock

点赞 1

import com.watabou.pixeldungeon.items.keys.IronKey; //导入依赖的package包/类
private boolean actUnlock( HeroAction.Unlock action ) {
	int doorCell = action.dst;
	if (Level.adjacent( pos, doorCell )) {
		
		theKey = null;
		int door = Dungeon.level.map[doorCell];
		
		if (door == Terrain.LOCKED_DOOR) {
			
			theKey = belongings.getKey( IronKey.class, Dungeon.depth );
			
		} else if (door == Terrain.LOCKED_EXIT) {
			
			theKey = belongings.getKey( SkeletonKey.class, Dungeon.depth );
			
		}
		
		if (theKey != null) {
			
			spend( Key.TIME_TO_UNLOCK );
			sprite.operate( doorCell );
			
			Sample.INSTANCE.play( Assets.SND_UNLOCK );
			
		} else {
			GLog.w( TXT_LOCKED_DOOR );
			ready();
		}
		
		return false;
		
	} else if (getCloser( doorCell )) {
		
		return true;
		
	} else {
		ready();
		return false;
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:41,
代码来源:Hero.java

示例15: paint

点赞 1

import com.watabou.pixeldungeon.items.keys.IronKey; //导入依赖的package包/类
public static void paint( Level level, Room room ) {

		fill( level, room, Terrain.WALL );
		fill( level, room, 1, Terrain.EMPTY );

		Point c = room.center();
		int cx = c.x;
		int cy = c.y;
		
		Room.Door door = room.entrance();
		
		door.set( Room.Door.Type.LOCKED );
		level.addItemToSpawn( new IronKey() );
		
		if (door.x == room.left) {
			
			fill( level, room.right - 1, room.top + 1, 1, room.height() - 1 , Terrain.STATUE );
			cx = room.right - 2;
			
		} else if (door.x == room.right) {
			
			fill( level, room.left + 1, room.top + 1, 1, room.height() - 1 , Terrain.STATUE );
			cx = room.left + 2;
			
		} else if (door.y == room.top) {
			
			fill( level, room.left + 1, room.bottom - 1, room.width() - 1, 1 , Terrain.STATUE );
			cy = room.bottom - 2;
			
		} else if (door.y == room.bottom) {
			
			fill( level, room.left + 1, room.top + 1, room.width() - 1, 1 , Terrain.STATUE );
			cy = room.top + 2;
			
		}
		
		Statue statue = new Statue();
		statue.pos = cx + cy * Level.WIDTH;
		level.mobs.add( statue );
		Actor.occupyCell( statue );
	}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:42,
代码来源:StatuePainter.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)