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


Java Flare类代码示例

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


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

示例1: doRead

import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
protected void doRead() {
	
	new Flare( 6, 32 ).show( curUser.sprite, 2f ) ;
	Sample.INSTANCE.play( Assets.SND_READ );
	Invisibility.dispel();
	
	boolean procced = uncurse( curUser, curUser.belongings.backpack.items.toArray( new Item[0] ) ); 
	procced = uncurse( curUser, 
		curUser.belongings.weapon, 
		curUser.belongings.armor, 
		curUser.belongings.misc1,
		curUser.belongings.misc2) || procced;
	
	Weakness.detach( curUser, Weakness.class );
	
	if (procced) {
		GLog.p( TXT_PROCCED );			
	} else {		
		GLog.i( TXT_NOT_PROCCED );		
	}
	
	setKnown();
	
	curUser.spendAndNext( TIME_TO_READ );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:27,代码来源:ScrollOfRemoveCurse.java

示例2: doRead

import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
protected void doRead() {
	
	new Flare( 5, 32 ).color( 0xFF0000, true ).show( curUser.sprite, 2f );
	Sample.INSTANCE.play( Assets.SND_READ );
	Invisibility.dispel();
	
	int count = 0;
	Mob affected = null;
	for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
		if (Level.fieldOfView[mob.pos]) {
			Terror terror = Buff.affect( mob, Terror.class, Terror.DURATION );
			terror.source = curUser;
			
			count++;
			affected = mob;
		}
	}
	
	switch (count) {
	case 0:
		GLog.i( "The scroll emits a brilliant flash of red light" );
		break;
	case 1:
		GLog.i( "The scroll emits a brilliant flash of red light and the " + affected.name + " flees!" );
		break;
	default:
		GLog.i( "The scroll emits a brilliant flash of red light and the monsters flee!" );
	}
	setKnown();
	
	curUser.spendAndNext( TIME_TO_READ );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:34,代码来源:ScrollOfTerror.java

示例3: die

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

	float lootChance = this.lootChance;
	lootChance *= RingOfWealth.dropChanceMultiplier( Dungeon.hero );
	
	if (Random.Float() < lootChance && Dungeon.hero.lvl <= maxLvl + 2) {
		Item loot = createLoot();
		if (loot != null)
			Dungeon.level.drop( loot , pos ).sprite.drop();
	}
	
	if (alignment == Alignment.ENEMY && Dungeon.hero.lvl <= maxLvl + 2){
		int rolls = 1;
		if (properties.contains(Property.BOSS))             rolls = 15;
		else if (properties.contains(Property.MINIBOSS))    rolls = 5;
		ArrayList<Item> bonus = RingOfWealth.tryRareDrop(Dungeon.hero, rolls);
		if (bonus != null){
			for (Item b : bonus) Dungeon.level.drop( b , pos ).sprite.drop();
			new Flare(8, 32).color(0xFFFF00, true).show(sprite, 2f);
		}
	}
	
	if (Dungeon.hero.isAlive() && !Dungeon.level.heroFOV[pos]) {
		GLog.i( Messages.get(this, "died") );
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:30,代码来源:Mob.java

示例4: open

import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; //导入依赖的package包/类
public void open( Hero hero ) {
	switch (type) {
	case MIMIC:
		if (Mimic.spawnAt(pos, items) != null) {
			destroy();
		} else {
			type = Type.CHEST;
		}
		break;
	case TOMB:
		Wraith.spawnAround( hero.pos );
		break;
	case REMAINS:
	case SKELETON:
		CellEmitter.center( pos ).start(Speck.factory(Speck.RATTLE), 0.1f, 3);
		for (Item item : items) {
			if (item.cursed) {
				if (Wraith.spawnAt( pos ) == null) {
					hero.sprite.emitter().burst( ShadowParticle.CURSE, 6 );
					hero.damage( hero.HP / 2, this );
				}
				Sample.INSTANCE.play( Assets.SND_CURSED );
				break;
			}
		}
		break;
	default:
	}

	if (type != Type.MIMIC) {
		type = Type.HEAP;
		ArrayList<Item> bonus = RingOfWealth.tryRareDrop(hero, 1);
		if (bonus != null){
			items.addAll(0, bonus);
			new Flare(8, 32).color(0xFFFF00, true).show(sprite, 2f);
		}
		sprite.link();
		sprite.drop();
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:41,代码来源:Heap.java

示例5: onItemSelected

import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
protected void onItemSelected(Item item) {
	new Flare( 6, 32 ).show( curUser.sprite, 2f ) ;

	boolean procced = uncurse( curUser, item );

	Weakness.detach( curUser, Weakness.class );

	if (procced) {
		GLog.p( Messages.get(this, "cleansed") );
	} else {
		GLog.i( Messages.get(this, "not_cleansed") );
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:15,代码来源:ScrollOfRemoveCurse.java

示例6: doRead

import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
public void doRead() {
	
	new Flare( 5, 32 ).color( 0xFF0000, true ).show( curUser.sprite, 2f );
	Sample.INSTANCE.play( Assets.SND_READ );
	Invisibility.dispel();
	
	int count = 0;
	Mob affected = null;
	for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
		if (Dungeon.level.heroFOV[mob.pos]) {
			Buff.affect( mob, Terror.class, Terror.DURATION ).object = curUser.id();

			if (mob.buff(Terror.class) != null){
				count++;
				affected = mob;
			}
		}
	}
	
	switch (count) {
	case 0:
		GLog.i( Messages.get(this, "none") );
		break;
	case 1:
		GLog.i( Messages.get(this, "one", affected.name) );
		break;
	default:
		GLog.i( Messages.get(this, "many") );
	}
	setKnown();

	readAnimation();
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:35,代码来源:ScrollOfTerror.java

示例7: summon

import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; //导入依赖的package包/类
private void summon() {

		nextPedestal = !nextPedestal;
		
		sprite.centerEmitter().start( Speck.factory( Speck.SCREAM ), 0.4f, 2 );		
		Sample.INSTANCE.play( Assets.SND_CHALLENGE );
		
		boolean[] passable = Level.passable.clone();
		for (Actor actor : Actor.all()) {
			if (actor instanceof Char) {
				passable[((Char)actor).pos] = false;
			}
		}
		
		int undeadsToSummon = maxArmySize() - Undead.count;

		PathFinder.buildDistanceMap( pos, passable, undeadsToSummon );
		PathFinder.distance[pos] = Integer.MAX_VALUE;
		int dist = 1;
		
	undeadLabel:
		for (int i=0; i < undeadsToSummon; i++) {
			do {
				for (int j=0; j < Level.LENGTH; j++) {
					if (PathFinder.distance[j] == dist) {
						
						Undead undead = new Undead();
						undead.pos = j;
						GameScene.add( undead );
						
						WandOfBlink.appear( undead, j );
						new Flare( 3, 32 ).color( 0x000000, false ).show( undead.sprite, 2f ) ;
						
						PathFinder.distance[j] = Integer.MAX_VALUE;
						
						continue undeadLabel;
					}
				}
				dist++;
			} while (dist < undeadsToSummon);
		}
		
		yell( "Arise, slaves!" );
	}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:45,代码来源:King.java

示例8: Record

import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; //导入依赖的package包/类
public Record( int pos, boolean latest, Rankings.Record rec ) {
	super();
	
	this.rec = rec;
	
	if (latest) {
		flare = new Flare( 6, 24 );
		flare.angularSpeed = 90;
		flare.color( rec.win ? FLARE_WIN : FLARE_LOSE );
		addToBack( flare );
	}

	if (pos != Rankings.TABLE_SIZE-1) {
		position.text(Integer.toString(pos + 1));
	} else
		position.text(" ");
	position.measure();
	
	desc.text( rec.info );

	desc.measure();

	int odd = pos % 2;
	
	if (rec.win) {
		shield.view( ItemSpriteSheet.AMULET, null );
		position.hardlight( TEXT_WIN[odd] );
		desc.hardlight( TEXT_WIN[odd] );
		depth.hardlight( TEXT_WIN[odd] );
		level.hardlight( TEXT_WIN[odd] );
	} else {
		position.hardlight( TEXT_LOSE[odd] );
		desc.hardlight( TEXT_LOSE[odd] );
		depth.hardlight( TEXT_LOSE[odd] );
		level.hardlight( TEXT_LOSE[odd] );

		if (rec.depth != 0){
			depth.text( Integer.toString(rec.depth) );
			depth.measure();
			steps.copy(Icons.DEPTH_LG.get());

			add(steps);
			add(depth);
		}

	}

	if (rec.herolevel != 0){
		level.text( Integer.toString(rec.herolevel) );
		level.measure();
		add(level);
	}
	
	classIcon.copy( Icons.get( rec.heroClass ) );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:56,代码来源:RankingsScene.java

示例9: create

import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
public void create() {
	super.create();
	
	BitmapTextMultiline text = null;
	if (!noText) {
		text = createMultiline( TXT, 8 );
		text.maxWidth = WIDTH;
		text.measure();
		add( text );
	}
	
	amulet = new Image( Assets.AMULET );
	add( amulet );
	
	RedButton btnExit = new RedButton( TXT_EXIT ) {
		@Override
		protected void onClick() {
               Dungeon.win( ResultDescriptions.WIN );
			Dungeon.deleteGame( Dungeon.hero.heroClass, true );
			Game.switchScene( noText ? TitleScene.class : RankingsScene.class );
		}
	};
	btnExit.setSize( WIDTH, BTN_HEIGHT );
	add( btnExit );
	
	RedButton btnStay = new RedButton( TXT_STAY ) {
		@Override
		protected void onClick() {
			onBackPressed();
		}
	};
	btnStay.setSize( WIDTH, BTN_HEIGHT );
	add( btnStay );
	
	float height;
	if (noText) {
		height = amulet.height + LARGE_GAP + btnExit.height() + SMALL_GAP + btnStay.height();
		
		amulet.x = align( (Camera.main.width - amulet.width) / 2 );
		amulet.y = align( (Camera.main.height - height) / 2 );
		
		btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, amulet.y + amulet.height + LARGE_GAP );
		btnStay.setPos( btnExit.left(), btnExit.bottom() + SMALL_GAP );
		
	} else {
		height = amulet.height + LARGE_GAP + text.height() + LARGE_GAP + btnExit.height() + SMALL_GAP + btnStay.height();
		
		amulet.x = align( (Camera.main.width - amulet.width) / 2 );
		amulet.y = align( (Camera.main.height - height) / 2 );
		
		text.x =  align( (Camera.main.width - text.width()) / 2 );
		text.y = amulet.y + amulet.height + LARGE_GAP;
		
		btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, text.y + text.height() + LARGE_GAP );
		btnStay.setPos( btnExit.left(), btnExit.bottom() + SMALL_GAP );
	}

	new Flare( 8, 48 ).color( 0xFFDDBB, true ).show( amulet, 0 ).angularSpeed = +30;
	
	fadeIn();
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:63,代码来源:AmuletScene.java

示例10: summon

import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; //导入依赖的package包/类
private void summon() {

		nextPedestal = !nextPedestal;
		
		sprite.centerEmitter().start( Speck.factory( Speck.SCREAM ), 0.4f, 2 );
		Sample.INSTANCE.play( Assets.SND_CHALLENGE );
		
		boolean[] passable = Dungeon.level.passable.clone();
		for (Char c : Actor.chars()) {
			passable[c.pos] = false;
		}
		
		int undeadsToSummon = maxArmySize() - Undead.count;

		PathFinder.buildDistanceMap( pos, passable, undeadsToSummon );
		PathFinder.distance[pos] = Integer.MAX_VALUE;
		int dist = 1;
		
	undeadLabel:
		for (int i=0; i < undeadsToSummon; i++) {
			do {
				for (int j=0; j < Dungeon.level.length(); j++) {
					if (PathFinder.distance[j] == dist) {
						
						Undead undead = new Undead();
						undead.pos = j;
						GameScene.add( undead );
						
						ScrollOfTeleportation.appear( undead, j );
						new Flare( 3, 32 ).color( 0x000000, false ).show( undead.sprite, 2f ) ;
						
						PathFinder.distance[j] = Integer.MAX_VALUE;
						
						continue undeadLabel;
					}
				}
				dist++;
			} while (dist < undeadsToSummon);
		}
		
		yell( Messages.get(this, "arise") );
	}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:43,代码来源:King.java

示例11: Record

import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; //导入依赖的package包/类
public Record( int pos, boolean latest, Rankings.Record rec ) {
	super();
	
	this.rec = rec;
	
	if (latest) {
		flare = new Flare( 6, 24 );
		flare.angularSpeed = 90;
		flare.color( rec.win ? FLARE_WIN : FLARE_LOSE );
		addToBack( flare );
	}

	if (pos != Rankings.TABLE_SIZE-1) {
		position.text(Integer.toString(pos + 1));
	} else
		position.text(" ");
	position.measure();
	
	desc.text( Messages.titleCase(rec.desc()) );

	//desc.measure();

	int odd = pos % 2;
	
	if (rec.win) {
		shield.view( ItemSpriteSheet.AMULET, null );
		position.hardlight( TEXT_WIN[odd] );
		desc.hardlight( TEXT_WIN[odd] );
		depth.hardlight( TEXT_WIN[odd] );
		level.hardlight( TEXT_WIN[odd] );
	} else {
		position.hardlight( TEXT_LOSE[odd] );
		desc.hardlight( TEXT_LOSE[odd] );
		depth.hardlight( TEXT_LOSE[odd] );
		level.hardlight( TEXT_LOSE[odd] );

		if (rec.depth != 0){
			depth.text( Integer.toString(rec.depth) );
			depth.measure();
			steps.copy(Icons.DEPTH.get());

			add(steps);
			add(depth);
		}

	}

	if (rec.herolevel != 0){
		level.text( Integer.toString(rec.herolevel) );
		level.measure();
		add(level);
	}
	
	classIcon.copy( Icons.get( rec.heroClass ) );
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:56,代码来源:RankingsScene.java

示例12: create

import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
public void create() {
	super.create();
	
	RenderedTextMultiline text = null;
	if (!noText) {
		text = renderMultiline( Messages.get(this, "text"), 8 );
		text.maxWidth(WIDTH);
		add( text );
	}
	
	amulet = new Image( Assets.AMULET );
	add( amulet );
	
	RedButton btnExit = new RedButton( Messages.get(this, "exit") ) {
		@Override
		protected void onClick() {
			Dungeon.win( Amulet.class );
			Dungeon.deleteGame( Dungeon.hero.heroClass, true );
			Game.switchScene( RankingsScene.class );
		}
	};
	btnExit.setSize( WIDTH, BTN_HEIGHT );
	add( btnExit );
	
	RedButton btnStay = new RedButton( Messages.get(this, "stay") ) {
		@Override
		protected void onClick() {
			onBackPressed();
		}
	};
	btnStay.setSize( WIDTH, BTN_HEIGHT );
	add( btnStay );
	
	float height;
	if (noText) {
		height = amulet.height + LARGE_GAP + btnExit.height() + SMALL_GAP + btnStay.height();
		
		amulet.x = (Camera.main.width - amulet.width) / 2;
		amulet.y = (Camera.main.height - height) / 2;
		align(amulet);

		btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, amulet.y + amulet.height + LARGE_GAP );
		btnStay.setPos( btnExit.left(), btnExit.bottom() + SMALL_GAP );
		
	} else {
		height = amulet.height + LARGE_GAP + text.height() + LARGE_GAP + btnExit.height() + SMALL_GAP + btnStay.height();
		
		amulet.x = (Camera.main.width - amulet.width) / 2;
		amulet.y = (Camera.main.height - height) / 2;
		align(amulet);

		text.setPos((Camera.main.width - text.width()) / 2, amulet.y + amulet.height + LARGE_GAP);
		align(text);
		
		btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, text.top() + text.height() + LARGE_GAP );
		btnStay.setPos( btnExit.left(), btnExit.bottom() + SMALL_GAP );
	}

	new Flare( 8, 48 ).color( 0xFFDDBB, true ).show( amulet, 0 ).angularSpeed = +30;
	
	fadeIn();
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:64,代码来源:AmuletScene.java

示例13: Record

import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; //导入依赖的package包/类
public Record( int pos, boolean latest, Rankings.Record rec ) {
	super();

	this.rec = rec;

	if (latest) {
		flare = new Flare( 6, 24 );
		flare.angularSpeed = 90;
		flare.color( rec.win ? FLARE_WIN : FLARE_LOSE );
		addToBack( flare );
	}

	if (pos != Rankings.TABLE_SIZE-1) {
		position.text(Integer.toString(pos + 1));
	} else
		position.text(" ");
	position.measure();

	desc.text( Messages.titleCase(rec.desc()) );

	//desc.measure();

	int odd = pos % 2;

	if (rec.win) {
		shield.view( ItemSpriteSheet.AMULET, null );
		position.hardlight( TEXT_WIN[odd] );
		desc.hardlight( TEXT_WIN[odd] );
		depth.hardlight( TEXT_WIN[odd] );
		level.hardlight( TEXT_WIN[odd] );
	} else {
		position.hardlight( TEXT_LOSE[odd] );
		desc.hardlight( TEXT_LOSE[odd] );
		depth.hardlight( TEXT_LOSE[odd] );
		level.hardlight( TEXT_LOSE[odd] );

		if (rec.depth != 0){
			depth.text( Integer.toString(rec.depth) );
			depth.measure();
			steps.copy(Icons.DEPTH.get());

			add(steps);
			add(depth);
		}

	}

	if (rec.herolevel != 0){
		level.text( Integer.toString(rec.herolevel) );
		level.measure();
		add(level);
	}

	classIcon.copy( Icons.get( rec.heroClass ) );
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon-gdx,代码行数:56,代码来源:RankingsScene.java

示例14: create

import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
public void create() {
	super.create();

	RenderedTextMultiline text = null;
	if (!noText) {
		text = renderMultiline( Messages.get(this, "text"), 8 );
		text.maxWidth(WIDTH);
		add( text );
	}

	amulet = new Image( Assets.AMULET );
	add( amulet );

	RedButton btnExit = new RedButton( Messages.get(this, "exit") ) {
		@Override
		protected void onClick() {
			Dungeon.win( Amulet.class );
			Dungeon.deleteGame( Dungeon.hero.heroClass, true );
			Game.switchScene( RankingsScene.class );
		}
	};
	btnExit.setSize( WIDTH, BTN_HEIGHT );
	add( btnExit );

	RedButton btnStay = new RedButton( Messages.get(this, "stay") ) {
		@Override
		protected void onClick() {
			onBackPressed();
		}
	};
	btnStay.setSize( WIDTH, BTN_HEIGHT );
	add( btnStay );

	float height;
	if (noText) {
		height = amulet.height + LARGE_GAP + btnExit.height() + SMALL_GAP + btnStay.height();

		amulet.x = (Camera.main.width - amulet.width) / 2;
		amulet.y = (Camera.main.height - height) / 2;
		align(amulet);

		btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, amulet.y + amulet.height + LARGE_GAP );
		btnStay.setPos( btnExit.left(), btnExit.bottom() + SMALL_GAP );

	} else {
		height = amulet.height + LARGE_GAP + text.height() + LARGE_GAP + btnExit.height() + SMALL_GAP + btnStay.height();

		amulet.x = (Camera.main.width - amulet.width) / 2;
		amulet.y = (Camera.main.height - height) / 2;
		align(amulet);

		text.setPos((Camera.main.width - text.width()) / 2, amulet.y + amulet.height + LARGE_GAP);
		align(text);

		btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, text.top() + text.height() + LARGE_GAP );
		btnStay.setPos( btnExit.left(), btnExit.bottom() + SMALL_GAP );
	}

	new Flare( 8, 48 ).color( 0xFFDDBB, true ).show( amulet, 0 ).angularSpeed = +30;

	fadeIn();
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon-gdx,代码行数:64,代码来源:AmuletScene.java


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