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


Java LeafParticle类代码示例

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


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

示例1: wither

import com.shatteredpixel.shatteredpixeldungeon.effects.particles.LeafParticle; //导入依赖的package包/类
public void wither() {
	Dungeon.level.uproot( pos );
	
	sprite.kill();
	if (Dungeon.visible[pos]) {
		CellEmitter.get( pos ).burst( LeafParticle.GENERAL, 6 );
	}
	
	if (Dungeon.hero.subClass == HeroSubClass.WARDEN) {

           int naturalismLevel = 0;
           SandalsOfNature.Naturalism naturalism = Dungeon.hero.buff( SandalsOfNature.Naturalism.class );
           if (naturalism != null) {
               naturalismLevel = naturalism.level()+1;
           }

		if (Random.Int( 5 - (naturalismLevel/2) ) == 0) {
               Item seed = Generator.random(Generator.Category.SEED);

               if (seed instanceof BlandfruitBush.Seed) {
                   if (Random.Int(15) - Dungeon.limitedDrops.blandfruitSeed.count >= 0) {
                       Dungeon.level.drop(seed, pos).sprite.drop();
                       Dungeon.limitedDrops.blandfruitSeed.count++;
                   }
               } else
                   Dungeon.level.drop(seed, pos).sprite.drop();
		}
		if (Random.Int( 5 - naturalismLevel ) == 0) {
			Dungeon.level.drop( new Dewdrop(), pos ).sprite.drop();
		}
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:33,代码来源:Plant.java

示例2: wither

import com.shatteredpixel.shatteredpixeldungeon.effects.particles.LeafParticle; //导入依赖的package包/类
public void wither() {
	Dungeon.level.uproot( pos );

	if (Dungeon.level.heroFOV[pos]) {
		CellEmitter.get( pos ).burst( LeafParticle.GENERAL, 6 );
	}
	
	if (Dungeon.hero.subClass == HeroSubClass.WARDEN) {

		int naturalismLevel = 0;
		SandalsOfNature.Naturalism naturalism = Dungeon.hero.buff( SandalsOfNature.Naturalism.class );
		if (naturalism != null) {
			naturalismLevel = naturalism.itemLevel()+1;
		}

		if (Random.Int( 5 - (naturalismLevel/2) ) == 0) {
			Item seed = Generator.random(Generator.Category.SEED);

			if (seed instanceof BlandfruitBush.Seed) {
				if (Random.Int(5) - Dungeon.LimitedDrops.BLANDFRUIT_SEED.count >= 0) {
					Dungeon.level.drop(seed, pos).sprite.drop();
					Dungeon.LimitedDrops.BLANDFRUIT_SEED.count++;
				}
			} else
				Dungeon.level.drop(seed, pos).sprite.drop();
		}
		if (Random.Int( 5 - naturalismLevel ) == 0) {
			Dungeon.level.drop( new Dewdrop(), pos ).sprite.drop();
		}
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:32,代码来源:Plant.java

示例3: use

import com.shatteredpixel.shatteredpixeldungeon.effects.particles.LeafParticle; //导入依赖的package包/类
@Override
public void use( BlobEmitter emitter ) {
	super.use( emitter );
	
	emitter.start( LeafParticle.LEVEL_SPECIFIC, 0.2f, 0 );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:7,代码来源:Regrowth.java

示例4: foliage

import com.shatteredpixel.shatteredpixeldungeon.effects.particles.LeafParticle; //导入依赖的package包/类
public static void foliage( Group group, int from, int to, Callback callback ) {
	MagicMissile missile = ((MagicMissile)group.recycle( MagicMissile.class ));
	missile.reset( from, to, callback );
	missile.size( 4 );
	missile.pour( LeafParticle.GENERAL, 0.01f );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:7,代码来源:MagicMissile.java

示例5: trample

import com.shatteredpixel.shatteredpixeldungeon.effects.particles.LeafParticle; //导入依赖的package包/类
public static void trample( Level level, int pos, Char ch ) {
	
	Level.set( pos, Terrain.GRASS );
	GameScene.updateMap( pos );

	if (!Dungeon.isChallenged( Challenges.NO_HERBALISM )) {
		int naturalismLevel = 0;

		if (ch != null) {
			SandalsOfNature.Naturalism naturalism = ch.buff( SandalsOfNature.Naturalism.class );
			if (naturalism != null) {
				if (!naturalism.isCursed()) {
					naturalismLevel = naturalism.itemLevel() + 1;
					naturalism.charge();
				} else {
					naturalismLevel = -1;
				}
			}
		}

		if (naturalismLevel >= 0) {
			// Seed, scales from 1/16 to 1/4
			if (Random.Int(16 - ((int) (naturalismLevel * 3))) == 0) {
				Item seed = Generator.random(Generator.Category.SEED);

				if (seed instanceof BlandfruitBush.Seed) {
					if (Random.Int(5) - Dungeon.LimitedDrops.BLANDFRUIT_SEED.count >= 0) {
						level.drop(seed, pos).sprite.drop();
						Dungeon.LimitedDrops.BLANDFRUIT_SEED.count++;
					}
				} else
					level.drop(seed, pos).sprite.drop();
			}

			// Dew, scales from 1/6 to 1/3
			if (Random.Int(24 - naturalismLevel*3) <= 3) {
				level.drop(new Dewdrop(), pos).sprite.drop();
			}
		}
	}

	int leaves = 4;
	

	if (ch instanceof Hero) {
		Hero hero = (Hero)ch;

		// Barkskin
		if (hero.subClass == HeroSubClass.WARDEN) {
			Buff.affect(ch, Barkskin.class).level(ch.HT / 3);
			leaves += 4;
		}

		//Camouflage
		if (hero.belongings.armor != null && hero.belongings.armor.hasGlyph(Camouflage.class)){
			Buff.affect(hero, Camouflage.Camo.class).set(3 + hero.belongings.armor.level());
			leaves += 4;
		}
	}
	
	CellEmitter.get( pos ).burst( LeafParticle.LEVEL_SPECIFIC, leaves );
	if (Dungeon.level.heroFOV[pos]) Dungeon.observe();
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:64,代码来源:HighGrass.java

示例6: reset

import com.shatteredpixel.shatteredpixeldungeon.effects.particles.LeafParticle; //导入依赖的package包/类
public void reset( int type, PointF from, PointF to, Callback callback ) {
	this.callback = callback;
	
	revive();
	
	x = from.x;
	y = from.y;
	width = 0;
	height = 0;
	
	PointF d = PointF.diff( to, from );
	PointF speed = new PointF( d ).normalize().scale( SPEED );
	sx = speed.x;
	sy = speed.y;
	time = d.length() / SPEED;

	switch(type){
		case MAGIC_MISSILE: default:
			size( 4 );
			pour( WhiteParticle.FACTORY, 0.01f );
			break;
		case FROST:
			pour( MagicParticle.FACTORY, 0.01f );
			break;
		case FIRE:
			size( 4 );
			pour( FlameParticle.FACTORY, 0.01f );
			break;
		case POISON:
			size( 3 );
			pour( PoisonParticle.MISSILE, 0.01f );
			break;
		case FOLIAGE:
			size( 4 );
			pour( LeafParticle.GENERAL, 0.01f );
			break;
		case FORCE:
			pour( SlowParticle.FACTORY, 0.01f );
			break;
		case BEACON:
			pour( ForceParticle.FACTORY, 0.01f );
			break;
		case SHADOW:
			size( 4 );
			pour( ShadowParticle.MISSILE, 0.01f );
			break;
		case RAINBOW:
			size( 4 );
			pour( RainbowParticle.BURST, 0.01f );
			break;

		case FIRE_CONE:
			size( 10 );
			pour( FlameParticle.FACTORY, 0.03f );
			break;
		case FOLIAGE_CONE:
			size( 10 );
			pour( LeafParticle.GENERAL, 0.03f );
			break;
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:62,代码来源:MagicMissile.java


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