本文整理汇总了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 );
}
}
}
示例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;
}