本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.items.quest.DwarfToken类的典型用法代码示例。如果您正苦于以下问题:Java DwarfToken类的具体用法?Java DwarfToken怎么用?Java DwarfToken使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DwarfToken类属于com.shatteredpixel.shatteredpixeldungeon.items.quest包,在下文中一共展示了DwarfToken类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: interact
import com.shatteredpixel.shatteredpixeldungeon.items.quest.DwarfToken; //导入依赖的package包/类
@Override
public void interact() {
sprite.turnTo( pos, Dungeon.hero.pos );
if (Quest.given) {
DwarfToken tokens = Dungeon.hero.belongings.getItem( DwarfToken.class );
if (tokens != null && (tokens.quantity() >= 8 || (!Quest.alternative && tokens.quantity() >= 6))) {
GameScene.show( new WndImp( this, tokens ) );
} else {
tell( Quest.alternative ? TXT_MONKS2 : TXT_GOLEMS2, Dungeon.hero.givenName() );
}
} else {
tell( Quest.alternative ? TXT_MONKS1 : TXT_GOLEMS1 );
Quest.given = true;
Quest.completed = false;
Journal.add( Journal.Feature.IMP );
}
}
示例2: takeReward
import com.shatteredpixel.shatteredpixeldungeon.items.quest.DwarfToken; //导入依赖的package包/类
private void takeReward( Imp imp, DwarfToken tokens, Item reward ) {
hide();
tokens.detachAll( Dungeon.hero.belongings.backpack );
reward.identify();
if (reward.doPickUp( Dungeon.hero )) {
GLog.i( Hero.TXT_YOU_NOW_HAVE, reward.name() );
} else {
Dungeon.level.drop( reward, imp.pos ).sprite.drop();
}
imp.flee();
Imp.Quest.complete();
}
示例3: interact
import com.shatteredpixel.shatteredpixeldungeon.items.quest.DwarfToken; //导入依赖的package包/类
@Override
public boolean interact() {
sprite.turnTo( pos, Dungeon.hero.pos );
if (Quest.given) {
DwarfToken tokens = Dungeon.hero.belongings.getItem( DwarfToken.class );
if (tokens != null && (tokens.quantity() >= 8 || (!Quest.alternative && tokens.quantity() >= 6))) {
GameScene.show( new WndImp( this, tokens ) );
} else {
tell( Quest.alternative ?
Messages.get(this, "monks_2", Dungeon.hero.givenName())
: Messages.get(this, "golems_2", Dungeon.hero.givenName()) );
}
} else {
tell( Quest.alternative ? Messages.get(this, "monks_1") : Messages.get(this, "golems_1") );
Quest.given = true;
Quest.completed = false;
Notes.add( Notes.Landmark.IMP );
}
return false;
}
示例4: WndImp
import com.shatteredpixel.shatteredpixeldungeon.items.quest.DwarfToken; //导入依赖的package包/类
public WndImp( final Imp imp, final DwarfToken tokens ) {
super();
IconTitle titlebar = new IconTitle();
titlebar.icon( new ItemSprite( tokens.image(), null ) );
titlebar.label( Messages.titleCase( tokens.name() ) );
titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar );
RenderedTextMultiline message = PixelScene.renderMultiline( Messages.get(this, "message"), 6 );
message.maxWidth(WIDTH);
message.setPos(0, titlebar.bottom() + GAP);
add( message );
RedButton btnReward = new RedButton( Messages.get(this, "reward") ) {
@Override
protected void onClick() {
takeReward( imp, tokens, Imp.Quest.reward );
}
};
btnReward.setRect( 0, message.top() + message.height() + GAP, WIDTH, BTN_HEIGHT );
add( btnReward );
resize( WIDTH, (int)btnReward.bottom() );
}
示例5: takeReward
import com.shatteredpixel.shatteredpixeldungeon.items.quest.DwarfToken; //导入依赖的package包/类
private void takeReward( Imp imp, DwarfToken tokens, Item reward ) {
hide();
tokens.detachAll( Dungeon.hero.belongings.backpack );
reward.identify();
if (reward.doPickUp( Dungeon.hero )) {
GLog.i( Messages.get(Dungeon.hero, "you_now_have", reward.name()) );
} else {
Dungeon.level.drop( reward, imp.pos ).sprite.drop();
}
imp.flee();
Imp.Quest.complete();
}
示例6: process
import com.shatteredpixel.shatteredpixeldungeon.items.quest.DwarfToken; //导入依赖的package包/类
public static void process( Mob mob ) {
if (spawned && given && !completed) {
if ((alternative && mob instanceof Monk) ||
(!alternative && mob instanceof Golem)) {
Dungeon.level.drop( new DwarfToken(), mob.pos ).sprite.drop();
}
}
}
示例7: WndImp
import com.shatteredpixel.shatteredpixeldungeon.items.quest.DwarfToken; //导入依赖的package包/类
public WndImp( final Imp imp, final DwarfToken tokens ) {
super();
IconTitle titlebar = new IconTitle();
titlebar.icon( new ItemSprite( tokens.image(), null ) );
titlebar.label( Utils.capitalize( tokens.name() ) );
titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar );
BitmapTextMultiline message = PixelScene.createMultiline( TXT_MESSAGE, 6 );
message.maxWidth = WIDTH;
message.measure();
message.y = titlebar.bottom() + GAP;
add( message );
RedButton btnReward = new RedButton( TXT_REWARD ) {
@Override
protected void onClick() {
takeReward( imp, tokens, Imp.Quest.reward );
}
};
btnReward.setRect( 0, message.y + message.height() + GAP, WIDTH, BTN_HEIGHT );
add( btnReward );
resize( WIDTH, (int)btnReward.bottom() );
}