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


Java WndSadGhost类代码示例

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


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

示例1: interact

import com.shatteredpixel.shatteredpixeldungeon.windows.WndSadGhost; //导入依赖的package包/类
@Override
public void interact() {
	sprite.turnTo( pos, Dungeon.hero.pos );
	
	Sample.INSTANCE.play( Assets.SND_GHOST );
	
	if (Quest.given) {
		if (Quest.weapon != null) {
               if (Quest.processed) {
                   GameScene.show(new WndSadGhost(this, Quest.type));
               } else {
                   switch (Quest.type) {
                       case 1:
                       default:
                           GameScene.show(new WndQuest(this, TXT_RAT2));
                           break;
                       case 2:
                           GameScene.show(new WndQuest(this, TXT_GNOLL2));
                           break;
                       case 3:
                           GameScene.show(new WndQuest(this, TXT_CRAB2));
                           break;
                   }

                   int newPos = -1;
                   for (int i = 0; i < 10; i++) {
                       newPos = Dungeon.level.randomRespawnCell();
                       if (newPos != -1) {
                           break;
                       }
                   }
                   if (newPos != -1) {

                       Actor.freeCell(pos);

                       CellEmitter.get(pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3);
                       pos = newPos;
                       sprite.place(pos);
                       sprite.visible = Dungeon.visible[pos];
                   }
               }
           }
	} else {
           Mob questBoss;
           String txt_quest;

           switch (Quest.type){
               case 1: default:
                   questBoss = new FetidRat();
                   txt_quest = Utils.format(TXT_RAT1, Dungeon.hero.givenName()); break;
               case 2:
                   questBoss = new GnollTrickster();
                   txt_quest = Utils.format(TXT_GNOLL1, Dungeon.hero.givenName()); break;
               case 3:
                   questBoss = new GreatCrab();
                   txt_quest = Utils.format(TXT_CRAB1, Dungeon.hero.givenName()); break;
           }

           questBoss.pos = Dungeon.level.randomRespawnCell();

           if (questBoss.pos != -1) {
               GameScene.add(questBoss);
               GameScene.show( new WndQuest( this, txt_quest ) );
               Quest.given = true;
               Journal.add( Journal.Feature.GHOST );
           }

	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:70,代码来源:Ghost.java

示例2: interact

import com.shatteredpixel.shatteredpixeldungeon.windows.WndSadGhost; //导入依赖的package包/类
@Override
public boolean interact() {
	sprite.turnTo( pos, Dungeon.hero.pos );
	
	Sample.INSTANCE.play( Assets.SND_GHOST );
	
	if (Quest.given) {
		if (Quest.weapon != null) {
			if (Quest.processed) {
				GameScene.show(new WndSadGhost(this, Quest.type));
			} else {
				switch (Quest.type) {
					case 1:
					default:
						GameScene.show(new WndQuest(this, Messages.get(this, "rat_2")));
						break;
					case 2:
						GameScene.show(new WndQuest(this, Messages.get(this, "gnoll_2")));
						break;
					case 3:
						GameScene.show(new WndQuest(this, Messages.get(this, "crab_2")));
						break;
				}

				int newPos = -1;
				for (int i = 0; i < 10; i++) {
					newPos = Dungeon.level.randomRespawnCell();
					if (newPos != -1) {
						break;
					}
				}
				if (newPos != -1) {

					CellEmitter.get(pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3);
					pos = newPos;
					sprite.place(pos);
					sprite.visible = Dungeon.level.heroFOV[pos];
				}
			}
		}
	} else {
		Mob questBoss;
		String txt_quest;

		switch (Quest.type){
			case 1: default:
				questBoss = new FetidRat();
				txt_quest = Messages.get(this, "rat_1", Dungeon.hero.givenName()); break;
			case 2:
				questBoss = new GnollTrickster();
				txt_quest = Messages.get(this, "gnoll_1", Dungeon.hero.givenName()); break;
			case 3:
				questBoss = new GreatCrab();
				txt_quest = Messages.get(this, "crab_1", Dungeon.hero.givenName()); break;
		}

		questBoss.pos = Dungeon.level.randomRespawnCell();

		if (questBoss.pos != -1) {
			GameScene.add(questBoss);
			GameScene.show( new WndQuest( this, txt_quest ) );
			Quest.given = true;
			Notes.add( Notes.Landmark.GHOST );
		}

	}

	return false;
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:70,代码来源:Ghost.java


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