From 659f20edff11d4a4eca1f36a9c96fc0ab485941d Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Sat, 13 Aug 2022 13:07:42 +0800 Subject: [PATCH] Update TileMapScene.java --- .../src/forge/adventure/scene/TileMapScene.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/forge-gui-mobile/src/forge/adventure/scene/TileMapScene.java b/forge-gui-mobile/src/forge/adventure/scene/TileMapScene.java index 9f10556f089..f3f95ec5b89 100644 --- a/forge-gui-mobile/src/forge/adventure/scene/TileMapScene.java +++ b/forge-gui-mobile/src/forge/adventure/scene/TileMapScene.java @@ -8,8 +8,11 @@ import forge.adventure.pointofintrest.PointOfInterest; import forge.adventure.stage.MapStage; import forge.adventure.stage.PointOfInterestMapRenderer; import forge.adventure.util.Config; +import forge.adventure.util.Current; import forge.adventure.util.TemplateTmxMapLoader; import forge.adventure.world.WorldSave; +import forge.sound.SoundEffectType; +import forge.sound.SoundSystem; /** * Scene that will render tiled maps. @@ -19,6 +22,7 @@ public class TileMapScene extends HudScene { TiledMap map; PointOfInterestMapRenderer tiledMapRenderer; private String nextMap; + private boolean autoheal = false; private float cameraWidth = 0f, cameraHeight = 0f; public TileMapScene() { @@ -46,6 +50,10 @@ public class TileMapScene extends HudScene { } stage.act(Gdx.graphics.getDeltaTime()); hud.act(Gdx.graphics.getDeltaTime()); + if (autoheal) { //todo add simple bg animation or effect also add check if auto heal is needed if player has full life so sound don't keep playing + SoundSystem.instance.play(SoundEffectType.Enchantment, false); + autoheal = false; + } } @Override @@ -80,6 +88,11 @@ public class TileMapScene extends HudScene { @Override public void enter() { super.enter(); + if (inTown()) { + // auto heal + Current.player().fullHeal(); + autoheal = true; + } } public void load(PointOfInterest point) {