mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
Big map update 8.1
Fix removing dungeon effects after a dungeon.
This commit is contained in:
@@ -59,6 +59,7 @@ public class DuelScene extends ForgeScene {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
SoundSystem.instance.setBackgroundMusic(MusicPlaylist.MENUS); //start background music
|
SoundSystem.instance.setBackgroundMusic(MusicPlaylist.MENUS); //start background music
|
||||||
|
dungeonEffect = null;
|
||||||
Scene last = Forge.switchToLast();
|
Scene last = Forge.switchToLast();
|
||||||
|
|
||||||
if (last instanceof HudScene) {
|
if (last instanceof HudScene) {
|
||||||
@@ -142,11 +143,11 @@ public class DuelScene extends ForgeScene {
|
|||||||
//Collect and add enemy effects (same as blessings but for individual enemies).
|
//Collect and add enemy effects (same as blessings but for individual enemies).
|
||||||
|
|
||||||
//Collect and add dungeon-wide effects.
|
//Collect and add dungeon-wide effects.
|
||||||
if(dungeonEffect != null)
|
if(dungeonEffect != null) {
|
||||||
oppEffects.add(dungeonEffect);
|
oppEffects.add(dungeonEffect);
|
||||||
if (dungeonEffect.opponent != null)
|
if (dungeonEffect.opponent != null)
|
||||||
playerEffects.add(dungeonEffect.opponent);
|
playerEffects.add(dungeonEffect.opponent);
|
||||||
|
}
|
||||||
|
|
||||||
addEffects(humanPlayer,playerEffects);
|
addEffects(humanPlayer,playerEffects);
|
||||||
addEffects(aiPlayer,oppEffects);
|
addEffects(aiPlayer,oppEffects);
|
||||||
|
|||||||
@@ -72,8 +72,10 @@ public class MapStage extends GameStage {
|
|||||||
public Dialog getDialog() {
|
public Dialog getDialog() {
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearIsInMap() {
|
public void clearIsInMap() {
|
||||||
isInMap = false;
|
isInMap = false;
|
||||||
|
effect = null;
|
||||||
GameHUD.getInstance().showHideMap(true);
|
GameHUD.getInstance().showHideMap(true);
|
||||||
}
|
}
|
||||||
public void draw (Batch batch) {
|
public void draw (Batch batch) {
|
||||||
@@ -82,9 +84,7 @@ public class MapStage extends GameStage {
|
|||||||
//update camera after all layers got drawn
|
//update camera after all layers got drawn
|
||||||
|
|
||||||
if (!getRoot().isVisible()) return;
|
if (!getRoot().isVisible()) return;
|
||||||
|
|
||||||
getRoot().draw(batch, 1);
|
getRoot().draw(batch, 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MapLayer getSpriteLayer() {
|
public MapLayer getSpriteLayer() {
|
||||||
@@ -186,7 +186,7 @@ public class MapStage extends GameStage {
|
|||||||
String text = "Strange magical energies flow within this place...\nAll opponents get:\n";
|
String text = "Strange magical energies flow within this place...\nAll opponents get:\n";
|
||||||
text += E.getDescription();
|
text += E.getDescription();
|
||||||
dialog.text(text);
|
dialog.text(text);
|
||||||
dialog.getButtonTable().add(Controls.newTextButton("OK", () -> { this.hideDialog(); }));
|
dialog.getButtonTable().add(Controls.newTextButton("OK", this::hideDialog));
|
||||||
dialog.setKeepWithinStage(true);
|
dialog.setKeepWithinStage(true);
|
||||||
showDialog();
|
showDialog();
|
||||||
}
|
}
|
||||||
@@ -334,7 +334,7 @@ public class MapStage extends GameStage {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
ShopData data = shops.get(WorldSave.getCurrentSave().getWorld().getRandom().nextInt(shops.size));
|
ShopData data = shops.get(WorldSave.getCurrentSave().getWorld().getRandom().nextInt(shops.size));
|
||||||
Array<Reward> ret = new Array<Reward>();
|
Array<Reward> ret = new Array<>();
|
||||||
for (RewardData rdata : new Array.ArrayIterator<>(data.rewards)) {
|
for (RewardData rdata : new Array.ArrayIterator<>(data.rewards)) {
|
||||||
ret.addAll(rdata.generate(false));
|
ret.addAll(rdata.generate(false));
|
||||||
}
|
}
|
||||||
@@ -417,7 +417,7 @@ public class MapStage extends GameStage {
|
|||||||
|
|
||||||
public EnemySprite getEnemyByID(int id) {
|
public EnemySprite getEnemyByID(int id) {
|
||||||
for(MapActor A : new Array.ArrayIterator<>(actors)){
|
for(MapActor A : new Array.ArrayIterator<>(actors)){
|
||||||
if(A instanceof EnemySprite && ((EnemySprite) A).getId() == id)
|
if(A instanceof EnemySprite && A.getId() == id)
|
||||||
return ((EnemySprite) A);
|
return ((EnemySprite) A);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -448,11 +448,10 @@ public class MapStage extends GameStage {
|
|||||||
resetPosition();
|
resetPosition();
|
||||||
showDialog();
|
showDialog();
|
||||||
mob.dialog.activate();
|
mob.dialog.activate();
|
||||||
break;
|
|
||||||
} else { //Duel the enemy.
|
} else { //Duel the enemy.
|
||||||
beginDuel(mob);
|
beginDuel(mob);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
} else if (actor instanceof RewardSprite) {
|
} else if (actor instanceof RewardSprite) {
|
||||||
Gdx.input.vibrate(50);
|
Gdx.input.vibrate(50);
|
||||||
startPause(0.1f, new Runnable() {
|
startPause(0.1f, new Runnable() {
|
||||||
@@ -495,7 +494,7 @@ public class MapStage extends GameStage {
|
|||||||
DuelScene S = ((DuelScene) SceneType.DuelScene.instance);
|
DuelScene S = ((DuelScene) SceneType.DuelScene.instance);
|
||||||
S.setEnemy(mob);
|
S.setEnemy(mob);
|
||||||
S.setPlayer(player);
|
S.setPlayer(player);
|
||||||
S.setDungeonEffect(effect);
|
if(isInMap && effect != null) S.setDungeonEffect(effect);
|
||||||
Forge.switchScene(SceneType.DuelScene.instance);
|
Forge.switchScene(SceneType.DuelScene.instance);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user