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


Java Level.water方法代码示例

本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.levels.Level.water方法的典型用法代码示例。如果您正苦于以下问题:Java Level.water方法的具体用法?Java Level.water怎么用?Java Level.water使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.shatteredpixel.shatteredpixeldungeon.levels.Level的用法示例。


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

示例1: move

import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
public void move( int from, int to ) {
	play( run );
	
	motion = new PosTweener( this, worldToCamera( to ), MOVE_INTERVAL );
	motion.listener = this;
	parent.add( motion );

       isMoving = true;
	
	turnTo( from , to );
	
	if (visible && Level.water[from] && !ch.flying) {
		GameScene.ripple( from );
	}

       ch.onMotionComplete();
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:18,代码来源:CharSprite.java

示例2: affect

import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
public static void affect( int cell, Fire fire ) {
	
	Char ch = Actor.findChar( cell ); 
	if (ch != null) {
           if (Level.water[ch.pos]){
               Buff.prolong(ch, Frost.class, Frost.duration(ch) * Random.Float(5f, 7.5f));
           } else {
               Buff.prolong(ch, Frost.class, Frost.duration(ch) * Random.Float(1.0f, 1.5f));
           }
	}
	
	if (fire != null) {
		fire.clear( cell );
	}
	
	Heap heap = Dungeon.level.heaps.get( cell );
	if (heap != null) {
		heap.freeze();
	}

	if (Dungeon.visible[cell]) {
		CellEmitter.get( cell ).start( SnowParticle.FACTORY, 0.2f, 6 );
	}
	
	
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:27,代码来源:Freezing.java

示例3: add

import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
@Override
public void add( Buff buff ) {
	if (buff instanceof Burning) {
		if (HP < HT) {
			HP++;
			sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 );
		}
	} else {
		if (buff instanceof Frost) {
               if (Level.water[this.pos])
                   damage( Random.NormalIntRange( HT / 2, HT ), buff );
               else
			    damage( Random.NormalIntRange( 1, HT * 2 / 3 ), buff );
		}
           if (isAlive())
		    super.add( buff );
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:19,代码来源:Elemental.java

示例4: act

import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
@Override
protected boolean act() {
	if (!Level.water[pos]) {
		die( null );
		return true;
	} else {
		//this causes pirahna to move away when a door is closed on them.
		Dungeon.level.updateFieldOfView( this );
		enemy = chooseEnemy();
		if (state == this.HUNTING && !(enemy.isAlive() && Level.fieldOfView[enemy.pos] && enemy.invisible <= 0)){
			state = this.WANDERING;
			int oldPos = pos;
			int i = 0;
			do {
				i++;
				target = Dungeon.level.randomDestination();
				if (i == 100) return true;
			} while (!getCloser(target));
			moveSprite( oldPos, pos );
			return true;
		}

		return super.act();
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:26,代码来源:Piranha.java

示例5: act

import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
@Override
public boolean act() {
	if (target.isAlive()) {
           if (Dungeon.depth > 4)
		    target.damage( Dungeon.depth/5, this );
           else if (Random.Int(2) == 0)
               target.damage( 1, this );
		if (!target.isAlive() && target == Dungeon.hero) {
			Dungeon.fail( ResultDescriptions.OOZE );
			GLog.n( TXT_HERO_KILLED, toString() );
		}
		spend( TICK );
	}
	if (Level.water[target.pos]) {
		detach();
	}
	return true;
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:19,代码来源:Ooze.java

示例6: onComplete

import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
@Override
public void onComplete( Tweener tweener ) {
    if (tweener == jumpTweener) {

        if (visible && Level.water[ch.pos] && !ch.flying) {
            GameScene.ripple( ch.pos );
        }
        if (jumpCallback != null) {
            jumpCallback.call();
        }

    } else {
        super.onComplete( tweener );
    }
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:16,代码来源:HeroSprite.java

示例7: move

import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
@Override
public void move( int step ) {
	super.move( step );
	
	if (!flying) {
		
		if (Level.water[pos]) {
			Sample.INSTANCE.play( Assets.SND_WATER, 1, 1, Random.Float( 0.8f, 1.25f ) );
		} else {
			Sample.INSTANCE.play( Assets.SND_STEP );
		}
		Dungeon.level.press(pos, this);
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:15,代码来源:Hero.java

示例8: act

import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
@Override
public boolean act() {

	if (Level.water[pos] && HP < HT) {
		sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 );
		HP++;
	}

	return super.act();
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:11,代码来源:Goo.java

示例9: act

import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
@Override
public boolean act() {
	
	if (Level.water[pos] && HP < HT) {
		sprite.emitter().burst( ShadowParticle.UP, 2 );
		HP += REGENERATION;
	}
	
	return super.act();
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:11,代码来源:Yog.java

示例10: move

import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
@Override
public void move( int from, int to ) {
	
	place( to );
	
	play( run );
	turnTo( from , to );

       isMoving = true;

       if (Level.water[to]) {
		GameScene.ripple( to );
	}

       ch.onMotionComplete();
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:17,代码来源:TenguSprite.java

示例11: update

import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
@Override
public void update() {
	super.update();

	// Visibility
	visible = heap == null || Dungeon.visible[heap.pos];
	
	// Dropping
	if (dropInterval > 0 && (dropInterval -= Game.elapsed) <= 0) {
		
		speed.set( 0 );
		acc.set( 0 );
		place( heap.pos );
		
		if (Level.water[heap.pos]) {
			GameScene.ripple( heap.pos );
		}
	}
	
	// Glowing
	if (visible && glowing != null) {
		if (glowUp && (phase += Game.elapsed) > glowing.period) {
			
			glowUp = false;
			phase = glowing.period;
			
		} else if (!glowUp && (phase -= Game.elapsed) < 0) {
			
			glowUp = true;
			phase = 0;
			
		}
		
		float value = phase / glowing.period * 0.6f;
		
		rm = gm = bm = 1 - value;
		ra = glowing.red * value;
		ga = glowing.green * value;
		ba = glowing.blue * value;
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:42,代码来源:ItemSprite.java

示例12: damage

import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
public void damage( int dmg, Object src ) {
	
	if (HP <= 0) {
		return;
	}
	if (this.buff(Frost.class) != null){
           Buff.detach( this, Frost.class );
           if (Level.water[this.pos]) {
               Buff.prolong(this, Paralysis.class, 1f);
           }
       }
       if (this.buff(MagicalSleep.class) != null){
           Buff.detach(this, MagicalSleep.class);
       }
	
	Class<?> srcClass = src.getClass();
	if (immunities().contains( srcClass )) {
		dmg = 0;
	} else if (resistances().contains( srcClass )) {
		dmg = Random.IntRange( 0, dmg );
	}
	
	if (buff( Paralysis.class ) != null) {
		if (Random.Int( dmg ) >= Random.Int( HP )) {
			Buff.detach( this, Paralysis.class );
			if (Dungeon.visible[pos]) {
				GLog.i( TXT_OUT_OF_PARALYSIS, name );
			}
		}
	}
	
	HP -= dmg;
	if (dmg > 0 || src instanceof Char) {
		sprite.showStatus( HP > HT / 2 ? 
			CharSprite.WARNING : 
			CharSprite.NEGATIVE,
			Integer.toString( dmg ) );
	}
	if (HP <= 0) {
		die( src );
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:43,代码来源:Char.java

示例13: doAttack

import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
@Override
protected boolean doAttack( Char enemy ) {

	if (Level.distance( pos, enemy.pos ) <= 1) {
		
		return super.doAttack( enemy );
		
	} else {
		
		boolean visible = Level.fieldOfView[pos] || Level.fieldOfView[enemy.pos]; 
		if (visible) {
			((ShamanSprite)sprite).zap( enemy.pos );
		}
		
		spend( TIME_TO_ZAP );
		
		if (hit( this, enemy, true )) {
			int dmg = Random.Int( 2, 12 );
			if (Level.water[enemy.pos] && !enemy.flying) {
				dmg *= 1.5f;
			}
			enemy.damage( dmg, LightningTrap.LIGHTNING );
			
			enemy.sprite.centerEmitter().burst( SparkParticle.FACTORY, 3 );
			enemy.sprite.flash();
			
			if (enemy == Dungeon.hero) {
				
				Camera.main.shake( 2, 0.3f );
				
				if (!enemy.isAlive()) {
					Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name ) ) );
					GLog.n( TXT_LIGHTNING_KILLED, name );
				}
			}
		} else {
			enemy.sprite.showStatus( CharSprite.NEUTRAL,  enemy.defenseVerb() );
		}
		
		return !visible;
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:43,代码来源:Shaman.java

示例14: move

import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
@Override
public void move( int step ) {
	super.move( step );
	
	if (Dungeon.level.map[step] == Terrain.INACTIVE_TRAP && HP < HT) {
		
		HP += Random.Int( 1, HT - HP );
		sprite.emitter().burst( ElmoParticle.FACTORY, 5 );
		
		if (Dungeon.visible[step] && Dungeon.hero.isAlive()) {
			GLog.n( "DM-300 repairs itself!" );
		}
	}
	
	int[] cells = {
		step-1, step+1, step-Level.WIDTH, step+Level.WIDTH, 
		step-1-Level.WIDTH, 
		step-1+Level.WIDTH, 
		step+1-Level.WIDTH, 
		step+1+Level.WIDTH
	};
	int cell = cells[Random.Int( cells.length )];
	
	if (Dungeon.visible[cell]) {
		CellEmitter.get( cell ).start( Speck.factory( Speck.ROCK ), 0.07f, 10 );
		Camera.main.shake( 3, 0.7f );
		Sample.INSTANCE.play( Assets.SND_ROCKS );
		
		if (Level.water[cell]) {
			GameScene.ripple( cell );
		} else if (Dungeon.level.map[cell] == Terrain.EMPTY) {
			Level.set( cell, Terrain.EMPTY_DECO );
			GameScene.updateMap( cell );
		}
	}

	Char ch = Actor.findChar( cell );
	if (ch != null && ch != this) {
		Buff.prolong( ch, Paralysis.class, 2 );
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:42,代码来源:DM300.java

示例15: act

import com.shatteredpixel.shatteredpixeldungeon.levels.Level; //导入方法依赖的package包/类
@Override
public boolean act() {
	
	if (target.isAlive()) {
		
		if (target instanceof Hero) {
			Buff.prolong( target, Light.class, TICK * 1.01f );
		}
		
		target.damage( Random.Int( 1, 5 ), this );
		
		if (target instanceof Hero) {
			
			Item item = ((Hero)target).belongings.randomUnequipped();
			if (item instanceof Scroll) {
				
				item = item.detach( ((Hero)target).belongings.backpack );
				GLog.w( TXT_BURNS_UP, item.toString() );
				
				Heap.burnFX( target.pos );
				
			} else if (item instanceof MysteryMeat) {
				
				item = item.detach( ((Hero)target).belongings.backpack );
				ChargrilledMeat steak = new ChargrilledMeat(); 
				if (!steak.collect( ((Hero)target).belongings.backpack )) {
					Dungeon.level.drop( steak, target.pos ).sprite.drop();
				}
				GLog.w( TXT_BURNS_UP, item.toString() );
				
				Heap.burnFX( target.pos );
				
			}
			
		} else if (target instanceof Thief && ((Thief)target).item instanceof Scroll) {
			
			((Thief)target).item = null;
			target.sprite.emitter().burst( ElmoParticle.FACTORY, 6 );
		}

	} else {
		detach();
	}
	
	if (Level.flamable[target.pos]) {
		GameScene.add( Blob.seed( target.pos, 4, Fire.class ) );
	}
	
	spend( TICK );
	left -= TICK;
	
	if (left <= 0 ||
		Random.Float() > (2 + (float)target.HP / target.HT) / 3 ||
		(Level.water[target.pos] && !target.flying)) {
		
		detach();
	}
	
	return true;
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:61,代码来源:Burning.java


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