当前位置: 首页>>代码示例>>Java>>正文


Java Ghost类代码示例

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


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

示例1: selectReward

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; //导入依赖的package包/类
private void selectReward( Ghost ghost, Item reward ) {
	
	hide();
	
	if (reward == null) return;
	
	reward.identify();
	if (reward.doPickUp( Dungeon.hero )) {
		GLog.i( Messages.get(Dungeon.hero, "you_now_have", reward.name()) );
	} else {
		Dungeon.level.drop( reward, ghost.pos ).sprite.drop();
	}
	
	ghost.yell( Messages.get(this, "farewell") );
	ghost.die( null );
	
	Ghost.Quest.complete();
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:19,代码来源:WndSadGhost.java

示例2: selectReward

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; //导入依赖的package包/类
private void selectReward( Ghost ghost, Item reward ) {
	
	hide();
	
	if (reward.doPickUp( Dungeon.hero )) {
		GLog.i( Hero.TXT_YOU_NOW_HAVE, reward.name() );
	} else {
		Dungeon.level.drop( reward, ghost.pos ).sprite.drop();
	}
	
	ghost.yell( "Farewell, adventurer!" );
	ghost.die( null );
	
	Ghost.Quest.complete();
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:16,代码来源:WndSadGhost.java

示例3: createItems

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; //导入依赖的package包/类
@Override
protected void createItems() {
	if (Dungeon.dewVial && Random.Int( 4 - Dungeon.depth ) == 0) {
		addItemToSpawn( new DewVial() );
		Dungeon.dewVial = false;
	}

	Ghost.Quest.spawn( this );
	
	super.createItems();
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:12,代码来源:SewerLevel.java

示例4: die

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; //导入依赖的package包/类
@Override
public void die( Object cause ) {
	super.die( cause );

	Ghost.Quest.process();

	Dungeon.level.drop( new MysteryMeat(), pos );
	Dungeon.level.drop( new MysteryMeat(), pos ).sprite.drop();
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:10,代码来源:GreatCrab.java

示例5: createItems

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; //导入依赖的package包/类
@Override
protected void createItems() {
	if (!Dungeon.LimitedDrops.DEW_VIAL.dropped()) {
		addItemToSpawn( new DewVial() );
		Dungeon.LimitedDrops.DEW_VIAL.drop();
	}

	Ghost.Quest.spawn( this );
	
	super.createItems();
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:12,代码来源:SewerLevel.java

示例6: isUnique

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; //导入依赖的package包/类
public static boolean isUnique( Char mob ) {
	return mob instanceof Goo || mob instanceof Tengu || mob instanceof DM300 || mob instanceof King
			|| mob instanceof Yog.BurningFist || mob instanceof Yog.RottingFist
		|| mob instanceof Ghost.FetidRat || mob instanceof Ghost.GnollTrickster || mob instanceof Ghost.GreatCrab;
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:6,代码来源:Bestiary.java

示例7: WndSadGhost

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; //导入依赖的package包/类
public WndSadGhost( final Ghost ghost, final int type ) {
	
	super();
	
	IconTitle titlebar = new IconTitle();
       BitmapTextMultiline message;
       switch (type){
           case 1:default:
               titlebar.icon( new FetidRatSprite() );
               titlebar.label( "DEFEATED FETID RAT" );
               message = PixelScene.createMultiline( TXT_RAT+TXT_GIVEITEM, 6 );
               break;
           case 2:
               titlebar.icon( new GnollTricksterSprite() );
               titlebar.label( "DEFEATED GNOLL TRICKSTER" );
               message = PixelScene.createMultiline( TXT_GNOLL+TXT_GIVEITEM, 6 );
               break;
           case 3:
               titlebar.icon( new GreatCrabSprite());
               titlebar.label( "DEFEATED GREAT CRAB" );
               message = PixelScene.createMultiline( TXT_CRAB+TXT_GIVEITEM, 6 );
               break;

       }


	titlebar.setRect( 0, 0, WIDTH, 0 );
	add( titlebar );

	message.maxWidth = WIDTH;
	message.measure();
	message.y = titlebar.bottom() + GAP;
	add( message );
	
	RedButton btnWeapon = new RedButton( TXT_WEAPON ) {
		@Override
		protected void onClick() {
			selectReward( ghost, Ghost.Quest.weapon );
		}
	};
	btnWeapon.setRect( 0, message.y + message.height() + GAP, WIDTH, BTN_HEIGHT );
	add( btnWeapon );

       if (!Dungeon.isChallenged( Challenges.NO_ARMOR )) {
           RedButton btnArmor = new RedButton(TXT_ARMOR) {
               @Override
               protected void onClick() {
                   selectReward(ghost, Ghost.Quest.armor);
               }
           };
           btnArmor.setRect(0, btnWeapon.bottom() + GAP, WIDTH, BTN_HEIGHT);
           add(btnArmor);

           resize(WIDTH, (int) btnArmor.bottom());
       } else {
           resize(WIDTH, (int) btnWeapon.bottom());
       }
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:59,代码来源:WndSadGhost.java

示例8: die

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; //导入依赖的package包/类
@Override
public void die( Object cause ) {
	super.die( cause );

	Ghost.Quest.process();
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:7,代码来源:FetidRat.java

示例9: WndSadGhost

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; //导入依赖的package包/类
public WndSadGhost( final Ghost ghost, final int type ) {
	
	super();
	
	IconTitle titlebar = new IconTitle();
	RenderedTextMultiline message;
	switch (type){
		case 1:default:
			titlebar.icon( new FetidRatSprite() );
			titlebar.label( Messages.get(this, "rat_title") );
			message = PixelScene.renderMultiline( Messages.get(this, "rat")+Messages.get(this, "give_item"), 6 );
			break;
		case 2:
			titlebar.icon( new GnollTricksterSprite() );
			titlebar.label( Messages.get(this, "gnoll_title") );
			message = PixelScene.renderMultiline( Messages.get(this, "gnoll")+Messages.get(this, "give_item"), 6 );
			break;
		case 3:
			titlebar.icon( new GreatCrabSprite());
			titlebar.label( Messages.get(this, "crab_title") );
			message = PixelScene.renderMultiline( Messages.get(this, "crab")+Messages.get(this, "give_item"), 6 );
			break;

	}

	titlebar.setRect( 0, 0, WIDTH, 0 );
	add( titlebar );

	message.maxWidth(WIDTH);
	message.setPos(0, titlebar.bottom() + GAP);
	add( message );
	
	RedButton btnWeapon = new RedButton( Messages.get(this, "weapon") ) {
		@Override
		protected void onClick() {
			selectReward( ghost, Ghost.Quest.weapon );
		}
	};
	btnWeapon.setRect( 0, message.top() + message.height() + GAP, WIDTH, BTN_HEIGHT );
	add( btnWeapon );

	if (!Dungeon.isChallenged( Challenges.NO_ARMOR )) {
		RedButton btnArmor = new RedButton( Messages.get(this, "armor") ) {
			@Override
			protected void onClick() {
				selectReward(ghost, Ghost.Quest.armor);
			}
		};
		btnArmor.setRect(0, btnWeapon.bottom() + GAP, WIDTH, BTN_HEIGHT);
		add(btnArmor);

		resize(WIDTH, (int) btnArmor.bottom());
	} else {
		resize(WIDTH, (int) btnWeapon.bottom());
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:57,代码来源:WndSadGhost.java

示例10: saveGame

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; //导入依赖的package包/类
public static void saveGame( String fileName ) throws IOException {
	try {
		Bundle bundle = new Bundle();

		version = Game.versionCode;
		bundle.put( VERSION, version );
		bundle.put( SEED, seed );
		bundle.put( CHALLENGES, challenges );
		bundle.put( HERO, hero );
		bundle.put( GOLD, gold );
		bundle.put( DEPTH, depth );

		for (int d : droppedItems.keyArray()) {
			bundle.put(Messages.format(DROPPED, d), droppedItems.get(d));
		}

		quickslot.storePlaceholders( bundle );

		Bundle limDrops = new Bundle();
		LimitedDrops.store( limDrops );
		bundle.put ( LIMDROPS, limDrops );
		
		int count = 0;
		int ids[] = new int[chapters.size()];
		for (Integer id : chapters) {
			ids[count++] = id;
		}
		bundle.put( CHAPTERS, ids );
		
		Bundle quests = new Bundle();
		Ghost		.Quest.storeInBundle( quests );
		Wandmaker	.Quest.storeInBundle( quests );
		Blacksmith	.Quest.storeInBundle( quests );
		Imp			.Quest.storeInBundle( quests );
		bundle.put( QUESTS, quests );
		
		SpecialRoom.storeRoomsInBundle( bundle );
		SecretRoom.storeRoomsInBundle( bundle );
		
		Statistics.storeInBundle( bundle );
		Notes.storeInBundle( bundle );
		Generator.storeInBundle( bundle );
		
		Scroll.save( bundle );
		Potion.save( bundle );
		Ring.save( bundle );

		Actor.storeNextID( bundle );
		
		Bundle badges = new Bundle();
		Badges.saveLocal( badges );
		bundle.put( BADGES, badges );
		
		OutputStream output = Game.instance.openFileOutput( fileName, Game.MODE_PRIVATE );
		Bundle.write( bundle, output );
		output.close();
		
	} catch (IOException e) {
		GamesInProgress.setUnknown( hero.heroClass );
		ShatteredPixelDungeon.reportException(e);
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:63,代码来源:Dungeon.java

示例11: saveGame

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; //导入依赖的package包/类
public static void saveGame( String fileName ) throws IOException {
	try {
		Bundle bundle = new Bundle();

		version = Game.versionCode;
		bundle.put( VERSION, version );
		bundle.put( SEED, seed );
		bundle.put( CHALLENGES, challenges );
		bundle.put( HERO, hero );
		bundle.put( GOLD, gold );
		bundle.put( DEPTH, depth );

		for (int d : droppedItems.keyArray()) {
			bundle.put(Messages.format(DROPPED, d), droppedItems.get(d));
		}

		quickslot.storePlaceholders( bundle );

		Bundle limDrops = new Bundle();
		LimitedDrops.store( limDrops );
		bundle.put ( LIMDROPS, limDrops );
		
		int count = 0;
		int ids[] = new int[chapters.size()];
		for (Integer id : chapters) {
			ids[count++] = id;
		}
		bundle.put( CHAPTERS, ids );
		
		Bundle quests = new Bundle();
		Ghost		.Quest.storeInBundle( quests );
		Wandmaker	.Quest.storeInBundle( quests );
		Blacksmith	.Quest.storeInBundle( quests );
		Imp			.Quest.storeInBundle( quests );
		bundle.put( QUESTS, quests );
		
		SpecialRoom.storeRoomsInBundle( bundle );
		SecretRoom.storeRoomsInBundle( bundle );
		
		Statistics.storeInBundle( bundle );
		Notes.storeInBundle( bundle );
		Generator.storeInBundle( bundle );
		
		Scroll.save( bundle );
		Potion.save( bundle );
		Ring.save( bundle );

		Actor.storeNextID( bundle );
		
		Bundle badges = new Bundle();
		Badges.saveLocal( badges );
		bundle.put( BADGES, badges );
		
		OutputStream output = Game.instance.openFileOutput( fileName );
		Bundle.write( bundle, output );
		output.close();
		
	} catch (IOException e) {
		GamesInProgress.setUnknown( hero.heroClass );
		ShatteredPixelDungeon.reportException(e);
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon-gdx,代码行数:63,代码来源:Dungeon.java

示例12: init

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; //导入依赖的package包/类
public static void init() {

        challenges = ShatteredPixelDungeon.challenges();

        Generator.initArtifacts();

		Actor.clear();
		
		PathFinder.setMapSize( Level.WIDTH, Level.HEIGHT );
		
		Scroll.initLabels();
		Potion.initColors();
		Wand.initWoods();
		Ring.initGems();
		
		Statistics.reset();
		Journal.reset();

		quickslot.reset();
		
		depth = 0;
		gold = 0;
		
		for (limitedDrops a : limitedDrops.values())
            a.count = 0;

		dewVial = true;
		transmutation = Random.IntRange( 6, 14 );
		
		chapters = new HashSet<Integer>();
		
		Ghost.Quest.reset();
		Wandmaker.Quest.reset();
		Blacksmith.Quest.reset();
		Imp.Quest.reset();
		
		Room.shuffleTypes();
		
		hero = new Hero();
		hero.live();
		
		Badges.reset();
		
		StartScene.curClass.initHero( hero );
	}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:46,代码来源:Dungeon.java

示例13: init

import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; //导入依赖的package包/类
public static void init() {

		version = Game.versionCode;
		challenges = ShatteredPixelDungeon.challenges();

		seed = DungeonSeed.randomSeed();

		Actor.clear();
		Actor.resetNextID();
		
		Random.seed( seed );

			Scroll.initLabels();
			Potion.initColors();
			Ring.initGems();

			SpecialRoom.initForRun();
			SecretRoom.initForRun();

		Random.seed();
		
		Statistics.reset();
		Notes.reset();

		quickslot.reset();
		QuickSlotButton.reset();
		
		depth = 0;
		gold = 0;

		droppedItems = new SparseArray<ArrayList<Item>>();

		for (LimitedDrops a : LimitedDrops.values())
			a.count = 0;
		
		chapters = new HashSet<Integer>();
		
		Ghost.Quest.reset();
		Wandmaker.Quest.reset();
		Blacksmith.Quest.reset();
		Imp.Quest.reset();

		Generator.reset();
		Generator.initArtifacts();
		hero = new Hero();
		hero.live();
		
		Badges.reset();
		
		StartScene.curClass.initHero( hero );
	}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:52,代码来源:Dungeon.java


注:本文中的com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。