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


Java DwarfToken类代码示例

本文整理汇总了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 );
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:22,代码来源:Imp.java

示例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();
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:18,代码来源:WndImp.java

示例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;
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:26,代码来源:Imp.java

示例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() );
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:27,代码来源:WndImp.java

示例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();
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:18,代码来源:WndImp.java

示例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();
		}
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:10,代码来源:Imp.java

示例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() );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:28,代码来源:WndImp.java


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