• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java GameScene类的典型用法和代码示例

java 2次浏览

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

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

示例1: doRead

点赞 3

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
@Override
protected void doRead() {
	
	GameScene.flash( 0xFFFFFF );
	
	Sample.INSTANCE.play( Assets.SND_BLAST );
	Invisibility.dispel();
	
	for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
		if (Level.fieldOfView[mob.pos]) {
			Buff.prolong( mob, Blindness.class, Random.Int( 3, 6 ) );
			mob.damage( Random.IntRange( 1, mob.HT * 2 / 3 ), this );
		}
	}
	
	Buff.prolong( curUser, Blindness.class, Random.Int( 3, 6 ) );
	Dungeon.observe();
	
	setKnown();
	
	readAnimation();
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:23,
代码来源:ScrollOfPsionicBlast.java

示例2: onComplete

点赞 3

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的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 if (tweener == motion) {
		
		isMoving = false;
		
		motion.killAndErase();
		motion = null;
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:20,
代码来源:CharSprite.java

示例3: affectCell

点赞 3

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
public static void affectCell( int cell ) {
	
	Class<?>[] waters = {WaterOfHealth.class, WaterOfAwareness.class, WaterOfTransmutation.class};
	
	for (Class<?>waterClass : waters) {
		WellWater water = (WellWater)Dungeon.level.blobs.get( waterClass );
		if (water != null && 
			water.volume > 0 && 
			water.pos == cell && 
			water.affect()) {
			
			Level.set( cell, Terrain.EMPTY_WELL );
			GameScene.updateMap( cell );
			
			return;
		}
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:19,
代码来源:WellWater.java

示例4: die

点赞 3

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
@Override
public void die( Object cause  ) {
	
	curAction = null;
	
	DewVial.autoDrink( this );
	if (isAlive()) {
		new Flare( 8, 32 ).color( 0xFFFF66, true ).show( sprite, 2f ) ;
		return;
	}
	
	Actor.fixTime();
	super.die( cause );
	
	Ankh ankh = (Ankh)belongings.getItem( Ankh.class );
	if (ankh == null) {
		
		reallyDie( cause );
		
	} else {
		
		Dungeon.deleteGame( Dungeon.hero.heroClass, false );
		GameScene.show( new WndResurrect( ankh, cause ) );
		
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:27,
代码来源:Hero.java

示例5: die

点赞 3

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void die( Object cause ) {

	for (Mob mob : (Iterable<Mob>)Dungeon.level.mobs.clone()) {
		if (mob instanceof BurningFist || mob instanceof RottingFist) {
			mob.die( cause );
		}
	}
	
	GameScene.bossSlain();
	Dungeon.level.drop( new SkeletonKey(), pos ).sprite.drop();
	super.die( cause );
	
	yell( "..." );
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:17,
代码来源:Yog.java

示例6: interact

点赞 3

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的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.className() );
		}
		
	} else {
		tell( Quest.alternative ? TXT_MONKS1 : TXT_GOLEMS1 );
		Quest.given = true;
		Quest.completed = false;
		
		Journal.add( Journal.Feature.IMP );
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:22,
代码来源:Imp.java

示例7: replace

点赞 3

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
public static void replace( final Mob a, final Mob b ) {
	final float FADE_TIME = 0.5f;
	
	a.destroy();
	a.sprite.parent.add( new AlphaTweener( a.sprite, 0, FADE_TIME ) {
		protected void onComplete() {
			a.sprite.killAndErase();
			parent.erase( this );
		};
	} );
	
	b.pos = a.pos;
	GameScene.add( b );
	
	b.sprite.flipHorizontal = a.sprite.flipHorizontal;
	b.sprite.alpha( 0 );
	b.sprite.parent.add( new AlphaTweener( b.sprite, 1, FADE_TIME ) );
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:19,
代码来源:Ghost.java

示例8: processSewersKill

点赞 3

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
public static void processSewersKill( int pos ) {
	if (spawned && given && !processed && (depth == Dungeon.depth)) {
		switch (type) {
		case ROSE:
			if (Random.Int( left2kill ) == 0) {
				Dungeon.level.drop( new DriedRose(), pos ).sprite.drop();
				processed = true;
			} else {
				left2kill--;
			}
			break;
		case RAT:
			FetidRat rat = new FetidRat();
			rat.pos = Dungeon.level.randomRespawnCell();
			if (rat.pos != -1) {
				GameScene.add( rat );
				processed = true;
			}
			break;
		default:
		}
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:24,
代码来源:Ghost.java

示例9: spawnAt

点赞 3

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
public static Wraith spawnAt( int pos ) {
	if (Level.passable[pos] && Actor.findChar( pos ) == null) {
		
		Wraith w = new Wraith();
		w.adjustStats( Dungeon.depth );
		w.pos = pos;
		w.state = w.HUNTING;
		GameScene.add( w, SPAWN_DELAY );
		
		w.sprite.alpha( 0 );
		w.sprite.parent.add( new AlphaTweener( w.sprite, 1, 0.5f ) );
		
		w.sprite.emitter().burst( ShadowParticle.CURSE, 5 );
		
		return w;
	} else {
		return null;
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:20,
代码来源:Wraith.java

示例10: confirmCancelation

点赞 3

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
private void confirmCancelation() {
	GameScene.show( new WndOptions( name(), TXT_WARNING, TXT_YES, TXT_NO ) {
		@Override
		protected void onSelect( int index ) {
			switch (index) {
			case 0:
				curUser.spendAndNext( TIME_TO_READ );
				identifiedByUse = false;
				break;
			case 1:
				GameScene.selectItem( itemSelector, mode, inventoryTitle );
				break;
			}
		}
		public void onBackPressed() {};
	} );
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:18,
代码来源:InventoryScroll.java

示例11: onSelect

点赞 3

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
@Override
public void onSelect( Item item ) {
	if (item != null) {
		btnPressed.item( item );
		
		if (btnItem1.item != null && btnItem2.item != null) {
			String result = Blacksmith.verify( btnItem1.item, btnItem2.item );
			if (result != null) {
				GameScene.show( new WndMessage( result ) );
				btnReforge.enable( false );
			} else {
				btnReforge.enable( true );
			}
		}
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:17,
代码来源:WndBlacksmith.java

示例12: execute

点赞 3

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
@Override
public void execute( Hero hero, String action ) {
	if (action.equals( AC_DISENCHANT )) {
		
		if (hero.belongings.weapon == this) {
			disenchantEquipped = true;
			hero.belongings.weapon = null;
			updateQuickslot();
		} else {
			disenchantEquipped = false;
			detach( hero.belongings.backpack );
		}
		
		curUser = hero;
		GameScene.selectItem( itemSelector, WndBag.Mode.WAND, TXT_SELECT_WAND );
		
	} else {
	
		super.execute( hero, action );
		
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:23,
代码来源:WandOfMagicMissile.java

示例13: execute

点赞 3

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
@Override
public void execute( Hero hero, String action ) {
	if (action == AC_REFORGE) {
		
		if (hero.belongings.weapon == this) {
			equipped = true;
			hero.belongings.weapon = null;
		} else {
			equipped = false;
			detach( hero.belongings.backpack );
		}
		
		curUser = hero;
		
		GameScene.selectItem( itemSelector, WndBag.Mode.WEAPON, TXT_SELECT_WEAPON );
		
	} else {
		
		super.execute( hero, action );
		
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:23,
代码来源:ShortSword.java

示例14: respawner

点赞 3

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
public Actor respawner() {
	return new Actor() {	
		@Override
		protected boolean act() {
			if (mobs.size() < nMobs()) {

				Mob mob = Bestiary.mutable( Dungeon.depth );
				mob.state = mob.WANDERING;
				mob.pos = randomRespawnCell();
				if (Dungeon.hero.isAlive() && mob.pos != -1) {
					GameScene.add( mob );
					if (Statistics.amuletObtained) {
						mob.beckon( Dungeon.hero.pos );
					}
				}
			}
			spend( Dungeon.nightMode || Statistics.amuletObtained ? TIME_TO_RESPAWN / 2 : TIME_TO_RESPAWN );
			return true;
		}
	};
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:22,
代码来源:Level.java

示例15: add

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
public void add( State state ) {
	switch (state) {
	case BURNING:
		burning = emitter();
		burning.pour( FlameParticle.FACTORY, 0.06f );
		if (visible) {
			Sample.INSTANCE.play( Assets.SND_BURNING );
		}
		break;
	case LEVITATING:
		levitation = emitter();
		levitation.pour( Speck.factory( Speck.JET ), 0.02f );
		break;
	case INVISIBLE:
		PotionOfInvisibility.melt( ch );
		break;
	case PARALYSED:
		paused = true;
		break;
	case FROZEN:
		iceBlock = IceBlock.freeze( this );
		paused = true;
		break;
	case ILLUMINATED:
		GameScene.effect( halo = new TorchHalo( this ) );
		break;
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:29,
代码来源:CharSprite.java

示例16: onComplete

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
@Override
public void onComplete( Animation anim ) {
	super.onComplete( anim );
	
	if (anim == attack) {
		GameScene.ripple( ch.pos );
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:9,
代码来源:PiranhaSprite.java

示例17: sacrifice

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
public static void sacrifice( Char ch ) {
		
		Wound.hit( ch );
		
		SacrificialFire fire = (SacrificialFire)Dungeon.level.blobs.get( SacrificialFire.class );
		if (fire != null) {
			
			int exp = 0;
			if (ch instanceof Mob) {
				exp = ((Mob)ch).exp() * Random.IntRange( 1, 3 );
			} else if (ch instanceof Hero) {
				exp = ((Hero)ch).maxExp();
			}
			
			if (exp > 0) {
				
				int volume = fire.volume - exp;
				if (volume > 0) {
					fire.seed( fire.pos, volume );
					GLog.w( TXT_WORTHY );
				} else {
					fire.seed( fire.pos, 0 );
					Journal.remove( Feature.SACRIFICIAL_FIRE );
					
					GLog.w( TXT_REWARD );
//					GameScene.effect( new Flare( 7, 32 ).color( 0x66FFFF, true ).show( ch.sprite.parent, DungeonTilemap.tileCenterToWorld( fire.pos ), 2f ) );
					GameScene.effect( new Flare( 7, 32 ).color( 0x66FFFF, true ).show( ch.sprite, 2f ) );
					Dungeon.level.drop( new ScrollOfWipeOut(), fire.pos ).sprite.drop();
				}
			} else {
				
				GLog.w( TXT_UNWORTHY );
				
			}
		}
	}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:37,
代码来源:SacrificialFire.java

示例18: evolve

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
@Override
protected void evolve() {
	super.evolve();
	
	if (volume > 0) {
		
		boolean mapUpdated = false;
		
		for (int i=0; i < LENGTH; i++) {
			if (off[i] > 0) {
				int c = Dungeon.level.map[i];
				int c1 = c;
				if (c == Terrain.EMPTY || c == Terrain.EMBERS || c == Terrain.EMPTY_DECO) {
					c1 = cur[i] > 9 ? Terrain.HIGH_GRASS : Terrain.GRASS;
				} else if (c == Terrain.GRASS && cur[i] > 9) {
					c1 = Terrain.HIGH_GRASS ;
				}
				
				if (c1 != c) {
					Level.set( i, Terrain.HIGH_GRASS );
					mapUpdated = true;
					
					GameScene.updateMap( i );
					if (Dungeon.visible[i]) {
						GameScene.discoverTile( i, c );
					}
				}
				
				Char ch = Actor.findChar( i );
				if (ch != null) {
					Buff.prolong( ch, Roots.class, TICK );
				}
			}
		}
		
		if (mapUpdated) {
			Dungeon.observe();
		}
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:41,
代码来源:Regrowth.java

示例19: ready

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
private void ready() {
	sprite.idle();
	curAction = null;
	ready = true;
	
	GameScene.ready();
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:8,
代码来源:Hero.java

示例20: shatter

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
private void shatter( int pos ) {
	Sample.INSTANCE.play( Assets.SND_SHATTER );
	
	if (Dungeon.visible[pos]) {
		Splash.at( pos, 0xffd500, 5 );
	}
	
	int newPos = pos;
	if (Actor.findChar( pos ) != null) {
		ArrayList<Integer> candidates = new ArrayList<Integer>();
		boolean[] passable = Level.passable;
		
		for (int n : Level.NEIGHBOURS4) {
			int c = pos + n;
			if (passable[c] && Actor.findChar( c ) == null) {
				candidates.add( c );
			}
		}

		newPos = candidates.size() > 0 ? Random.element( candidates ) : -1;
	}
	
	if (newPos != -1) {
		Bee bee = new Bee();
		bee.spawn( Dungeon.depth );
		bee.HP = bee.HT;
		bee.pos = newPos;
		
		GameScene.add( bee );
		Actor.addDelayed( new Pushing( bee, pos, newPos ), -1 );
		
		bee.sprite.alpha( 0 );
		bee.sprite.parent.add( new AlphaTweener( bee.sprite, 1, 0.15f ) );
		
		Sample.INSTANCE.play( Assets.SND_BEE );
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:38,
代码来源:Honeypot.java

示例21: actAscend

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
private boolean actAscend( HeroAction.Ascend action ) {
	int stairs = action.dst;
	if (pos == stairs && pos == Dungeon.level.entrance) {
		
		if (Dungeon.depth == 1) {
			
			if (belongings.getItem( Amulet.class ) == null) {
				GameScene.show( new WndMessage( TXT_LEAVE ) );
				ready();
			} else {
				Dungeon.win( ResultDescriptions.WIN );
				Dungeon.deleteGame( Dungeon.hero.heroClass, true );
				Game.switchScene( SurfaceScene.class );
			}
			
		} else {
			
			curAction = null;
			
			Hunger hunger = buff( Hunger.class );
			if (hunger != null && !hunger.isStarving()) {
				hunger.satisfy( -Hunger.STARVING / 10 );
			}
			
			InterlevelScene.mode = InterlevelScene.Mode.ASCEND;
			Game.switchScene( InterlevelScene.class );
		}
		
		return false;
		
	} else if (getCloser( stairs )) {
		
		return true;
		
	} else {
		ready();
		return false;
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:40,
代码来源:Hero.java

示例22: onOperateComplete

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
@Override
public void onOperateComplete() {
	
	if (curAction instanceof HeroAction.Unlock) {
		
		if (theKey != null) {
			theKey.detach( belongings.backpack );
			theKey = null;
		}
		
		int doorCell = ((HeroAction.Unlock)curAction).dst;
		int door = Dungeon.level.map[doorCell];
		
		Level.set( doorCell, door == Terrain.LOCKED_DOOR ? Terrain.DOOR : Terrain.UNLOCKED_EXIT );
		GameScene.updateMap( doorCell );
		
	} else if (curAction instanceof HeroAction.OpenChest) {
		
		if (theKey != null) {
			theKey.detach( belongings.backpack );
			theKey = null;
		}
		
		Heap heap = Dungeon.level.heaps.get( ((HeroAction.OpenChest)curAction).dst ); 
		if (heap.type == Type.SKELETON) {
			Sample.INSTANCE.play( Assets.SND_BONES );
		}
		heap.open( this );
	}
	curAction = null;

	super.onOperateComplete();
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:34,
代码来源:Hero.java

示例23: doRead

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
@Override
protected void doRead() {
	
	if (!isKnown()) {
		setKnown();
		identifiedByUse = true;
	} else {
		identifiedByUse = false;
	}
	
	GameScene.selectItem( itemSelector, mode, inventoryTitle );
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:13,
代码来源:InventoryScroll.java

示例24: act

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
@Override
public boolean act() {
	for (int i=0; i < Level.NEIGHBOURS9.length; i++) {
		GameScene.add( Blob.seed( pos + Level.NEIGHBOURS9[i], 2, Fire.class ) );
	}
	
	return super.act();
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:9,
代码来源:Yog.java

示例25: doThrow

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
@Override
public void doThrow( final Hero hero ) {

	if (isKnown() && (
		this instanceof PotionOfExperience || 
		this instanceof PotionOfHealing || 
		this instanceof PotionOfLevitation ||
		this instanceof PotionOfMindVision ||
		this instanceof PotionOfStrength ||
		this instanceof PotionOfInvisibility || 
		this instanceof PotionOfMight)) {
	
		GameScene.show( 
			new WndOptions( TXT_BENEFICIAL, TXT_R_U_SURE_THROW, TXT_YES, TXT_NO ) {
				@Override
				protected void onSelect(int index) {
					if (index == 0) {
						Potion.super.doThrow( hero );
					}
				};
			}
		);
		
	} else {
		super.doThrow( hero );
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:28,
代码来源:Potion.java

示例26: defenseProc

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
@Override
public int defenseProc( Char enemy, int damage ) {

	if (HP >= damage + 2) {
		ArrayList<Integer> candidates = new ArrayList<Integer>();
		boolean[] passable = Level.passable;
		
		int[] neighbours = {pos + 1, pos - 1, pos + Level.WIDTH, pos - Level.WIDTH};
		for (int n : neighbours) {
			if (passable[n] && Actor.findChar( n ) == null) {
				candidates.add( n );
			}
		}

		if (candidates.size() > 0) {
			
			Swarm clone = split();
			clone.HP = (HP - damage) / 2;
			clone.pos = Random.element( candidates );
			clone.state = clone.HUNTING;
			
			if (Dungeon.level.map[clone.pos] == Terrain.DOOR) {
				Door.enter( clone.pos );
			}
			
			GameScene.add( clone, SPLIT_DELAY );
			Actor.addDelayed( new Pushing( clone, pos, clone.pos ), -1 );
			
			HP -= clone.HP;
		}
	}
	
	return damage;
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:35,
代码来源:Swarm.java

示例27: die

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
@Override
public void die( Object cause ) {
	
	Badges.Badge badgeToCheck = null;
	switch (Dungeon.hero.heroClass) {
	case WARRIOR:
		badgeToCheck = Badge.MASTERY_WARRIOR;
		break;
	case MAGE:
		badgeToCheck = Badge.MASTERY_MAGE;
		break;
	case ROGUE:
		badgeToCheck = Badge.MASTERY_ROGUE;
		break;
	case HUNTRESS:
		badgeToCheck = Badge.MASTERY_HUNTRESS;
		break;
	}
	if (!Badges.isUnlocked( badgeToCheck ) || Dungeon.hero.subClass != HeroSubClass.NONE) {
		Dungeon.level.drop( new TomeOfMastery(), pos ).sprite.drop();
	}
	
	GameScene.bossSlain();
	Dungeon.level.drop( new SkeletonKey(), pos ).sprite.drop();
	super.die( cause );
	
	Badges.validateBossSlain();
	
	yell( "Free at last..." );
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:31,
代码来源:Tengu.java

示例28: jump

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
private void jump() {
	timeToJump = JUMP_DELAY;
	
	for (int i=0; i < 4; i++) {
		int trapPos;
		do {
			trapPos = Random.Int( Level.LENGTH );
		} while (!Level.fieldOfView[trapPos] || !Level.passable[trapPos]);
		
		if (Dungeon.level.map[trapPos] == Terrain.INACTIVE_TRAP) {
			Level.set( trapPos, Terrain.POISON_TRAP );
			GameScene.updateMap( trapPos );
			ScrollOfMagicMapping.discover( trapPos );
		}
	}
	
	int newPos;
	do {
		newPos = Random.Int( Level.LENGTH );
	} while (
		!Level.fieldOfView[newPos] || 
		!Level.passable[newPos] || 
		(enemy != null && Level.adjacent( newPos, enemy.pos )) ||
		Actor.findChar( newPos ) != null);
	
	sprite.move( pos, newPos );
	move( newPos );
	
	if (Dungeon.visible[newPos]) {
		CellEmitter.get( newPos ).burst( Speck.factory( Speck.WOOL ), 6 );
		Sample.INSTANCE.play( Assets.SND_PUFF );
	}
	
	spend( 1 / speed() );
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:36,
代码来源:Tengu.java

示例29: execute

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
@Override
public void execute( final Hero hero, String action ) {
	if (action.equals( AC_DRINK )) {
		
		if (isKnown() && (
				this instanceof PotionOfLiquidFlame || 
				this instanceof PotionOfToxicGas || 
				this instanceof PotionOfParalyticGas)) {
			
				GameScene.show( 
					new WndOptions( TXT_HARMFUL, TXT_R_U_SURE_DRINK, TXT_YES, TXT_NO ) {
						@Override
						protected void onSelect(int index) {
							if (index == 0) {
								drink( hero );
							}
						};
					}
				);
				
			} else {
				drink( hero );
			}
		
	} else {
		
		super.execute( hero, action );
		
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:31,
代码来源:Potion.java

示例30: onZap

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
@Override
protected void onZap( int cell ) {

	int level = power();
	
	for (int i=1; i < Ballistica.distance - 1; i++) {
		int c = Ballistica.trace[i];
		if (Level.flamable[c]) {
			GameScene.add( Blob.seed( c, 1, Fire.class ) );
		}
	}
	
	GameScene.add( Blob.seed( cell, 1, Fire.class ) );
				
	Char ch = Actor.findChar( cell );
	if (ch != null) {	
		
		ch.damage( Random.Int( 1, 8 + level * level ), this );
		Buff.affect( ch, Burning.class ).reignite( ch );

		ch.sprite.emitter().burst( FlameParticle.FACTORY, 5 );
		
		if (ch == curUser && !ch.isAlive()) {
			Dungeon.fail( Utils.format( ResultDescriptions.WAND, name, Dungeon.depth ) );
			GLog.n( "You killed yourself with your own Wand of Firebolt..." );
		}
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:29,
代码来源:WandOfFirebolt.java

示例31: doPickUp

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
@Override
public boolean doPickUp( Hero hero ) {
	
	Dungeon.gold += quantity;
	Statistics.goldCollected += quantity;
	Badges.validateGoldCollected();
	
	GameScene.pickUp( this );
	hero.sprite.showStatus( CharSprite.NEUTRAL, TXT_VALUE, quantity );
	hero.spendAndNext( TIME_TO_PICK_UP );
	
	Sample.INSTANCE.play( Assets.SND_GOLD, 1, 1, Random.Float( 0.9f, 1.1f ) );
	
	return true;
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:16,
代码来源:Gold.java

示例32: onClick

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
public boolean onClick( float x, float y ) {
	if (identified && inside( x, y )) {
		GameScene.show( new WndInfoItem( item ) );
		return true;
	} else {
		return false;
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:9,
代码来源:WndCatalogus.java

示例33: drop

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
@Override
public Heap drop( Item item, int cell ) {
	
	if (!keyDropped && item instanceof SkeletonKey) {
		
		keyDropped = true;
		
		set( arenaDoor, Terrain.DOOR );
		GameScene.updateMap( arenaDoor );
		Dungeon.observe();
	}
	
	return super.drop( item, cell );
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:15,
代码来源:CityBossLevel.java

示例34: enter

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
public static void enter( int pos ) {
	Level.set( pos, Terrain.OPEN_DOOR );
	GameScene.updateMap( pos );
	Dungeon.observe();
	
	if (Dungeon.visible[pos]) {
		Sample.INSTANCE.play( Assets.SND_OPEN );
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:10,
代码来源:Door.java

示例35: leave

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
public static void leave( int pos ) {
	if (Dungeon.level.heaps.get( pos ) == null) {
		Level.set( pos, Terrain.DOOR );
		GameScene.updateMap( pos );
		Dungeon.observe();
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:8,
代码来源:Door.java

示例36: read

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
private void read( Hero hero, HeroSubClass sc1, HeroSubClass sc2 ) {
	if (hero.subClass == sc1) {
		GameScene.show( new WndChooseWay( this, sc2 ) );
	} else if (hero.subClass == sc2) {
		GameScene.show( new WndChooseWay( this, sc1 ) );
	} else {
		GameScene.show( new WndChooseWay( this, sc1, sc2 ) );
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:10,
代码来源:TomeOfMastery.java

示例37: doRead

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
private void doRead() {
	GameScene.flash( 0xFF6644 );
	
	Invisibility.dispel();
	
	for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
		if (!Bestiary.isBoss( mob )) {
			Sample.INSTANCE.play( Assets.SND_CURSED, 0.3f, 0.3f, Random.Float( 0.6f, 0.9f ) );
			mob.die( this );
		}
	}
	
	for (Heap heap : Dungeon.level.heaps.values()) {
		switch (heap.type) {
		case FOR_SALE:
			heap.type = Type.HEAP;
			if (Dungeon.visible[heap.pos]) {
				CellEmitter.center( heap.pos ).burst( Speck.factory( Speck.COIN ), 2 );
			}
			break;
		case MIMIC:
			heap.type = Type.HEAP;
			heap.sprite.link();
			Sample.INSTANCE.play( Assets.SND_CURSED, 0.3f, 0.3f, Random.Float( 0.6f, 0.9f ) );
			break;
		default:
		}
	}
	
	curUser.spend( TIME_TO_READ );
	curUser.busy();
	((HeroSprite)curUser.sprite).read();
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:34,
代码来源:ScrollOfWipeOut.java

示例38: trample

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的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 herbalismLevel = 0;
		if (ch != null) {
			Herbalism herbalism = ch.buff( Herbalism.class );
			if (herbalism != null) {
				herbalismLevel = herbalism.level;
			}
		}
		// Seed
		if (herbalismLevel >= 0 && Random.Int( 18 ) <= Random.Int( herbalismLevel + 1 )) {
			level.drop( Generator.random( Generator.Category.SEED ), pos ).sprite.drop();
		}
		
		// Dew
		if (herbalismLevel >= 0 && Random.Int( 6 ) <= Random.Int( herbalismLevel + 1 )) {
			level.drop( new Dewdrop(), pos ).sprite.drop();
		}
	}
	
	int leaves = 4;
	
	// Warlock's barkskin
	if (ch instanceof Hero && ((Hero)ch).subClass == HeroSubClass.WARDEN) {
		Buff.affect( ch, Barkskin.class ).level( ch.HT / 3 );
		leaves = 8;
	}
	
	CellEmitter.get( pos ).burst( LeafParticle.LEVEL_SPECIFIC, leaves );
	Dungeon.observe();
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:36,
代码来源:HighGrass.java

示例39: update

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
@Override
public void update() {
	if (visible = Dungeon.visible[pos]) {
		
		super.update();
		
		if ((rippleDelay -= Game.elapsed) <= 0) {
			GameScene.ripple( pos + WIDTH ).y -= DungeonTilemap.SIZE / 2;
			rippleDelay = Random.Float( 0.2f, 0.3f );
		}
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:13,
代码来源:SewerLevel.java

示例40: press

点赞 2

import com.watabou.pixeldungeon.scenes.GameScene; //导入依赖的package包/类
@Override
public void press( int cell, Char ch ) {
	
	super.press( cell, ch );
	
	if (ch == Dungeon.hero && !enteredArena && roomExit.inside( cell )) {
		
		enteredArena = true;
	
		int pos;
		do {
			pos = roomExit.random();
		} while (pos == cell || Actor.findChar( pos ) != null);
		
		Mob boss = Bestiary.mob( Dungeon.depth );
		boss.state = boss.HUNTING;
		boss.pos = pos;
		GameScene.add( boss );
		boss.notice();
		
		mobPress( boss );
		
		set( arenaDoor, Terrain.LOCKED_DOOR );
		GameScene.updateMap( arenaDoor );
		Dungeon.observe();
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:28,
代码来源:PrisonBossLevel.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)