gt: 			GLog.w( TXT_WATER );
context: /*
   * Pixel Dungeon
   * Copyright (C) 2012-2014  Oleg Dolya
   *
   * This program is free software: you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as published by
   * the Free Software Foundation, either version 3 of the License, or
   * (at your option) any later version.
   *
   * This program is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
   *
   * You should have received a copy of the GNU General Public License
   * along with this program.  If not, see <http://www.gnu.org/licenses/>
   */
  package com.shatteredpixel.shatteredpixeldungeon.scenes;
  
  import java.io.IOException;
  
  import com.shatteredpixel.shatteredpixeldungeon.*;
  import com.watabou.noosa.Camera;
  import com.watabou.noosa.Game;
  import com.watabou.noosa.Group;
  import com.watabou.noosa.SkinnedBlock;
  import com.watabou.noosa.Visual;
  import com.watabou.noosa.audio.Music;
  import com.watabou.noosa.audio.Sample;
  import com.watabou.noosa.particles.Emitter;
  import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
  import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
  import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
  import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
  import com.shatteredpixel.shatteredpixeldungeon.effects.BannerSprites;
  import com.shatteredpixel.shatteredpixeldungeon.effects.BlobEmitter;
  import com.shatteredpixel.shatteredpixeldungeon.effects.EmoIcon;
  import com.shatteredpixel.shatteredpixeldungeon.effects.Flare;
  import com.shatteredpixel.shatteredpixeldungeon.effects.FloatingText;
  import com.shatteredpixel.shatteredpixeldungeon.effects.Ripple;
  import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite;
  import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
  import com.shatteredpixel.shatteredpixeldungeon.items.Item;
  import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfBlink;
  import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
  import com.shatteredpixel.shatteredpixeldungeon.levels.RegularLevel;
  import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm;
  import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
  import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
  import com.shatteredpixel.shatteredpixeldungeon.sprites.DiscardedItemSprite;
  import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
  import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
  import com.shatteredpixel.shatteredpixeldungeon.sprites.PlantSprite;
  import com.shatteredpixel.shatteredpixeldungeon.ui.AttackIndicator;
  import com.shatteredpixel.shatteredpixeldungeon.ui.Banner;
  import com.shatteredpixel.shatteredpixeldungeon.ui.BusyIndicator;
  import com.shatteredpixel.shatteredpixeldungeon.ui.GameLog;
  import com.shatteredpixel.shatteredpixeldungeon.ui.HealthIndicator;
  import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
  import com.shatteredpixel.shatteredpixeldungeon.ui.StatusPane;
  import com.shatteredpixel.shatteredpixeldungeon.ui.Toast;
  import com.shatteredpixel.shatteredpixeldungeon.ui.Toolbar;
  import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
  import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
  import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag.Mode;
  import com.shatteredpixel.shatteredpixeldungeon.windows.WndGame;
  import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
  import com.shatteredpixel.shatteredpixeldungeon.windows.WndStory;
  import com.watabou.utils.Random;
  
  public class GameScene extends PixelScene {
  	
  	private static final String TXT_WELCOME			= "Welcome to the level %d of Pixel Dungeon!";
  	private static final String TXT_WELCOME_BACK	= "Welcome back to the level %d of Pixel Dungeon!";
  	
  	private static final String TXT_CHASM	= "Your steps echo across the dungeon.";
  	private static final String TXT_WATER	= "You hear water splashing around you.";
  	private static final String TXT_GRASS	= "The smell of vegetation is thick in the air.";
  	private static final String TXT_DARK	= "You can hear enemies moving in the darkness...";
  	private static final String TXT_SECRETS	= "The atmosphere hints that this floor hides many secrets.";
  	
  	static GameScene scene;
  
  	private SkinnedBlock water;
  	private DungeonTilemap tiles;
  	private FogOfWar fog;
  	private HeroSprite hero;
  	
  	private GameLog log;
  	
  	private BusyIndicator busy;
  	
  	private static CellSelector cellSelector;
  	
  	private Group terrain;
  	private Group ripples;
  	private Group plants;
  	private Group heaps;
  	private Group mobs;
  	private Group emitters;
  	private Group effects;
  	private Group gases;
  	private Group spells;
  	private Group statuses;
  	private Group emoicons;
  	
  	private Toolbar toolbar;
  	private Toast prompt;
  	
  	@Override
  	public void create() {
  		
  		Music.INSTANCE.play( Assets.TUNE, true );
  		Music.INSTANCE.volume( 1f );
  		
  		ShatteredPixelDungeon.lastClass(Dungeon.hero.heroClass.ordinal());
  		
  		super.create();
  		Camera.main.zoom( defaultZoom + ShatteredPixelDungeon.zoom() );
  		
  		scene = this;
  		
  		terrain = new Group();
  		add( terrain );
  		
  		water = new SkinnedBlock( 
  			Level.WIDTH * DungeonTilemap.SIZE, 
  			Level.HEIGHT * DungeonTilemap.SIZE,
  			Dungeon.level.waterTex() );
  		terrain.add( water );
  		
  		ripples = new Group();
  		terrain.add( ripples );
  		
  		tiles = new DungeonTilemap();
  		terrain.add( tiles );
  		
  		Dungeon.level.addVisuals( this );
  		
  		plants = new Group();
  		add( plants );
  		
  		int size = Dungeon.level.plants.size();
  		for (int i=0; i < size; i++) {
  			addPlantSprite( Dungeon.level.plants.valueAt( i ) );
  		}
  		
  		heaps = new Group();
  		add( heaps );
  		
  		size = Dungeon.level.heaps.size();
  		for (int i=0; i < size; i++) {
  			addHeapSprite( Dungeon.level.heaps.valueAt( i ) );
  		}
  		
  		emitters = new Group();
  		effects = new Group();
  		emoicons = new Group();
  		
  		mobs = new Group();
  		add( mobs );
  		
  		for (Mob mob : Dungeon.level.mobs) {
  			addMobSprite( mob );
  			if (Statistics.amuletObtained) {
  				mob.beckon( Dungeon.hero.pos );
  			}
  		}
  		
  		add( emitters );
  		add( effects );
  		
  		gases = new Group();
  		add( gases );
  		
  		for (Blob blob : Dungeon.level.blobs.values()) {
  			blob.emitter = null;
  			addBlobSprite( blob );
  		}
  		
  		fog = new FogOfWar( Level.WIDTH, Level.HEIGHT );
  		fog.updateVisibility( Dungeon.visible, Dungeon.level.visited, Dungeon.level.mapped );
  		add( fog );
  		
  		brightness( ShatteredPixelDungeon.brightness() );
  		
  		spells = new Group();
  		add( spells );
  		
  		statuses = new Group();
  		add( statuses );
  		
  		add( emoicons );
  		
  		hero = new HeroSprite();
  		hero.place( Dungeon.hero.pos );
  		hero.updateArmor();
  		mobs.add( hero );
  
  		
  		add( new HealthIndicator() );
  		
  		add( cellSelector = new CellSelector( tiles ) );
  		
  		StatusPane sb = new StatusPane();
  		sb.camera = uiCamera;
  		sb.setSize( uiCamera.width, 0 );
  		add( sb );
  		
  		toolbar = new Toolbar();
  		toolbar.camera = uiCamera;
  		toolbar.setRect( 0,uiCamera.height - toolbar.height(), uiCamera.width, toolbar.height() );
  		add( toolbar );
  		
  		AttackIndicator attack = new AttackIndicator();
  		attack.camera = uiCamera;
  		attack.setPos( 
  			uiCamera.width - attack.width(), 
  			toolbar.top() - attack.height() );
  		add( attack );
  		
  		log = new GameLog();
  		log.camera = uiCamera;
  		log.setRect( 0, toolbar.top(), attack.left(),  0 );
  		add( log );
  		
  		if (Dungeon.depth < Statistics.deepestFloor)
  			GLog.i( TXT_WELCOME_BACK, Dungeon.depth );
  		else
  			GLog.i( TXT_WELCOME, Dungeon.depth );
          Sample.INSTANCE.play( Assets.SND_DESCEND );
  		switch (Dungeon.level.feeling) {
  		case CHASM:
  			GLog.w( TXT_CHASM );
  			break;
  		case WATER:
  