@Override public void onDrawItemForeground(Object data, Batch batch, int x, int y, int width, int height) { if (data instanceof AbilityTree) { AbilityTree tree = (AbilityTree) data; if (((AbilityTree) data).current.current instanceof PassiveAbility) { batch.draw(passiveTileBorder, x, y, width, height); } if (tree.current.needsLevelAnim) { Sprite sprite = AssetManager.loadSprite("EffectSprites/Heal/Heal", 0.1f); GameScreen.Instance.addSpriteAction(sprite, x + width / 2, y + height / 2, width, height); Global.CurrentLevel.player.pendingMessages.add( new Message( tree.current.current.getName() + " levelled up! (Level " + tree.current.current.getLevel() + ")", Color.GOLD)); levelUpSound.play(Global.CurrentLevel.player.tile[0][0]); tree.current.needsLevelAnim = false; } } }
public AbilityPanel(Skin skin, Stage stage) { super( skin, stage, AssetManager.loadSprite("GUI/TileBackground"), AssetManager.loadSprite("GUI/TileBorder"), 1, Global.NUM_ABILITY_SLOTS, 48, false); drawHorizontalBackground = false; font = skin.getFont("default"); padding = 10; this.white = AssetManager.loadTextureRegion("Sprites/white.png"); passiveTileBorder = AssetManager.loadTextureRegion("Sprites/GUI/PassiveTileBorder.png"); }
// ---------------------------------------------------------------------- protected void baseInternalLoad(Element xml) { name = xml.get("Name", name); size = xml.getInt("Size", size); if (size < 1) { size = 1; } tile = new GameTile[size][size]; quality = xml.getInt("Quality", quality); Element spriteElement = xml.getChildByName("Sprite"); if (spriteElement != null) { sprite = AssetManager.loadSprite(xml.getChildByName("Sprite")); } if (sprite != null) { sprite.size[0] = size; sprite.size[1] = size; } Element raisedSpriteElement = xml.getChildByName("TilingSprite"); if (raisedSpriteElement != null) { tilingSprite = TilingSprite.load(raisedSpriteElement); } if (tilingSprite != null) { // for (Sprite sprite : tilingSprite.sprites) // { // sprite.size = size; // } } Element lightElement = xml.getChildByName("Light"); if (lightElement != null) { light = Roguelike.Lights.Light.load(lightElement); } Element statElement = xml.getChildByName("Statistics"); if (statElement != null) { Statistic.load(statElement, statistics); HP = getMaxHP(); statistics.put(Statistic.WALK, 1); // statistics.put( Statistic.ENTITY, 1 ); } Element inventoryElement = xml.getChildByName("Inventory"); if (inventoryElement != null) { inventory.load(inventoryElement); } Element immuneElement = xml.getChildByName("Immune"); if (immuneElement != null) { immune = immuneElement.getText().toLowerCase().split(","); } canTakeDamage = xml.getBoolean("CanTakeDamage", canTakeDamage); UID = getClass().getSimpleName() + " " + name + ": ID " + hashCode(); }