本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey类的典型用法代码示例。如果您正苦于以下问题:Java SkeletonKey类的具体用法?Java SkeletonKey怎么用?Java SkeletonKey使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SkeletonKey类属于com.shatteredpixel.shatteredpixeldungeon.items.keys包,在下文中一共展示了SkeletonKey类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: die
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void die( Object cause ) {
for (Mob mob : (Iterable<Mob>)Dungeon.level.mobs.clone()) {
if (mob instanceof BurningFist || mob instanceof RottingFist) {
mob.die( cause );
}
}
GameScene.bossSlain();
Dungeon.level.drop( new SkeletonKey( Dungeon.depth ), pos ).sprite.drop();
super.die( cause );
yell( "..." );
}
示例2: drop
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; //导入依赖的package包/类
@Override
public Heap drop( Item item, int cell ) {
if (!keyDropped && item instanceof SkeletonKey) {
keyDropped = true;
locked = false;
CellEmitter.get( arenaDoor ).start( Speck.factory( Speck.ROCK ), 0.07f, 10 );
set( arenaDoor, Terrain.EMPTY_DECO );
GameScene.updateMap( arenaDoor );
Dungeon.observe();
}
return super.drop( item, cell );
}
示例3: die
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; //导入依赖的package包/类
@Override
public void die( Object cause ) {
GameScene.bossSlain();
Dungeon.level.drop( new ArmorKit(), pos ).sprite.drop();
Dungeon.level.drop( new SkeletonKey( Dungeon.depth ), pos ).sprite.drop();
super.die( cause );
Badges.validateBossSlain();
LloydsBeacon beacon = Dungeon.hero.belongings.getItem(LloydsBeacon.class);
if (beacon != null) {
beacon.upgrade();
}
yell( Messages.get(this, "defeated", Dungeon.hero.givenName()) );
}
示例4: die
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void die( Object cause ) {
for (Mob mob : (Iterable<Mob>)Dungeon.level.mobs.clone()) {
if (mob instanceof BurningFist || mob instanceof RottingFist) {
mob.die( cause );
}
}
GameScene.bossSlain();
Dungeon.level.drop( new SkeletonKey( Dungeon.depth ), pos ).sprite.drop();
super.die( cause );
yell( Messages.get(this, "defeated") );
}
示例5: die
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; //导入依赖的package包/类
@Override
public void die( Object cause ) {
super.die( cause );
GameScene.bossSlain();
Dungeon.level.drop( new SkeletonKey( Dungeon.depth ), pos ).sprite.drop();
Badges.validateBossSlain();
LloydsBeacon beacon = Dungeon.hero.belongings.getItem(LloydsBeacon.class);
if (beacon != null) {
beacon.upgrade();
}
yell( Messages.get(this, "defeated") );
}
示例6: drop
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; //导入依赖的package包/类
@Override
public Heap drop( Item item, int cell ) {
if (!keyDropped && item instanceof SkeletonKey) {
keyDropped = true;
unseal();
CellEmitter.get( arenaDoor ).start( Speck.factory( Speck.ROCK ), 0.07f, 10 );
set( arenaDoor, Terrain.EMPTY_DECO );
GameScene.updateMap( arenaDoor );
Dungeon.observe();
}
return super.drop( item, cell );
}
示例7: die
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; //导入依赖的package包/类
@Override
public void die( Object cause ) {
Badges.Badge badgeToCheck = null;
switch (Dungeon.hero.heroClass) {
case WARRIOR:
badgeToCheck = Badge.MASTERY_WARRIOR;
break;
case MAGE:
badgeToCheck = Badge.MASTERY_MAGE;
break;
case ROGUE:
badgeToCheck = Badge.MASTERY_ROGUE;
break;
case HUNTRESS:
badgeToCheck = Badge.MASTERY_HUNTRESS;
break;
}
if (!Badges.isUnlocked( badgeToCheck )) {
Dungeon.level.drop( new TomeOfMastery(), pos ).sprite.drop();
}
GameScene.bossSlain();
Dungeon.level.drop( new SkeletonKey( Dungeon.depth ), pos ).sprite.drop();
super.die( cause );
Badges.validateBossSlain();
yell( "Free at last..." );
}
示例8: drop
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; //导入依赖的package包/类
@Override
public Heap drop( Item item, int cell ) {
if (!keyDropped && item instanceof SkeletonKey) {
keyDropped = true;
locked = false;
set( arenaDoor, Terrain.DOOR );
GameScene.updateMap( arenaDoor );
Dungeon.observe();
}
return super.drop( item, cell );
}
示例9: drop
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; //导入依赖的package包/类
@Override
public Heap drop( Item item, int cell ) {
if (!keyDropped && item instanceof SkeletonKey) {
keyDropped = true;
locked = false;
entrance = stairs;
set( entrance, Terrain.ENTRANCE );
GameScene.updateMap( entrance );
}
return super.drop( item, cell );
}
示例10: onOperateComplete
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; //导入依赖的package包/类
@Override
public void onOperateComplete() {
if (curAction instanceof HeroAction.Unlock) {
int doorCell = ((HeroAction.Unlock)curAction).dst;
int door = Dungeon.level.map[doorCell];
if (door == Terrain.LOCKED_DOOR){
Notes.remove(new IronKey(Dungeon.depth));
Level.set( doorCell, Terrain.DOOR );
} else {
Notes.remove(new SkeletonKey(Dungeon.depth));
Level.set( doorCell, Terrain.UNLOCKED_EXIT );
}
GameScene.updateKeyDisplay();
Level.set( doorCell, door == Terrain.LOCKED_DOOR ? Terrain.DOOR : Terrain.UNLOCKED_EXIT );
GameScene.updateMap( doorCell );
} else if (curAction instanceof HeroAction.OpenChest) {
Heap heap = Dungeon.level.heaps.get( ((HeroAction.OpenChest)curAction).dst );
if (heap.type == Type.SKELETON || heap.type == Type.REMAINS) {
Sample.INSTANCE.play( Assets.SND_BONES );
} else if (heap.type == Type.LOCKED_CHEST){
Notes.remove(new GoldenKey(Dungeon.depth));
} else if (heap.type == Type.CRYSTAL_CHEST){
Notes.remove(new CrystalKey(Dungeon.depth));
}
GameScene.updateKeyDisplay();
heap.open( this );
}
curAction = null;
super.onOperateComplete();
}
示例11: drop
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; //导入依赖的package包/类
@Override
public Heap drop( Item item, int cell ) {
if (!keyDropped && item instanceof SkeletonKey) {
keyDropped = true;
unseal();
set( arenaDoor, Terrain.DOOR );
GameScene.updateMap( arenaDoor );
Dungeon.observe();
}
return super.drop( item, cell );
}
示例12: drop
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; //导入依赖的package包/类
@Override
public Heap drop( Item item, int cell ) {
if (!keyDropped && item instanceof SkeletonKey) {
keyDropped = true;
unseal();
entrance = stairs;
set( entrance, Terrain.ENTRANCE );
GameScene.updateMap( entrance );
}
return super.drop( item, cell );
}
示例13: restoreFromBundle
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; //导入依赖的package包/类
public void restoreFromBundle( Bundle bundle ) {
//moving keys to Notes, for pre-0.6.1 saves
if (bundle.contains("ironKeys")) {
int[] ironKeys = bundle.getIntArray( "ironKeys" );
for (int i = 0; i < ironKeys.length; i++){
if (ironKeys[i] > 0){
Notes.add((Key) new IronKey(i).quantity(ironKeys[i]));
}
}
}
if (bundle.contains("specialKeys")) {
int[] specialKeys = bundle.getIntArray( "specialKeys" );
for (int i = 0; i < specialKeys.length; i++){
if (specialKeys[i] > 0){
if (i % 5 == 0){
Notes.add((Key) new SkeletonKey(i).quantity(specialKeys[i]));
} else {
Notes.add((Key) new GoldenKey(i).quantity(specialKeys[i]));
}
}
}
}
backpack.clear();
backpack.restoreFromBundle( bundle );
weapon = (KindOfWeapon) bundle.get(WEAPON);
if (weapon != null) {
weapon.activate(owner);
}
armor = (Armor)bundle.get( ARMOR );
if (armor != null){
armor.activate( owner );
}
misc1 = (KindofMisc)bundle.get(MISC1);
if (misc1 != null) {
misc1.activate( owner );
}
misc2 = (KindofMisc)bundle.get(MISC2);
if (misc2 != null) {
misc2.activate( owner );
}
}
示例14: updateText
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; //导入依赖的package包/类
private void updateText(){
if (bottomRightIcon != null){
remove(bottomRightIcon);
bottomRightIcon = null;
}
if (item == null){
topLeft.visible = topRight.visible = bottomRight.visible = false;
return;
} else {
topLeft.visible = topRight.visible = bottomRight.visible = true;
}
topLeft.text( item.status() );
boolean isArmor = item instanceof Armor;
boolean isWeapon = item instanceof Weapon;
if (isArmor || isWeapon) {
if (item.levelKnown || (isWeapon && !(item instanceof MeleeWeapon))) {
int str = isArmor ? ((Armor)item).STRReq() : ((Weapon)item).STRReq();
topRight.text( Messages.format( TXT_STRENGTH, str ) );
if (str > Dungeon.hero.STR()) {
topRight.hardlight( DEGRADED );
} else {
topRight.resetColor();
}
} else {
topRight.text( Messages.format( TXT_TYPICAL_STR, isArmor ?
((Armor)item).STRReq(0) :
((Weapon)item).STRReq(0) ) );
topRight.hardlight( WARNING );
}
topRight.measure();
} else if (item instanceof Key && !(item instanceof SkeletonKey)) {
topRight.text(Messages.format(TXT_KEY_DEPTH, ((Key) item).depth));
topRight.measure();
} else {
topRight.text( null );
}
int level = item.visiblyUpgraded();
if (level != 0) {
bottomRight.text( item.levelKnown ? Messages.format( TXT_LEVEL, level ) : TXT_CURSED );
bottomRight.measure();
bottomRight.hardlight( level > 0 ? UPGRADED : DEGRADED );
} else if (item instanceof Scroll || item instanceof Potion) {
bottomRight.text( null );
Integer iconInt;
if (item instanceof Scroll){
iconInt = ((Scroll) item).initials();
} else {
iconInt = ((Potion) item).initials();
}
if (iconInt != null && iconVisible) {
bottomRightIcon = new Image(Assets.CONS_ICONS);
int left = iconInt*7;
int top = item instanceof Potion ? 0 : 8;
bottomRightIcon.frame(left, top, 7, 8);
add(bottomRightIcon);
}
} else {
bottomRight.text( null );
}
layout();
}
示例15: actUnlock
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; //导入依赖的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;
}
}