mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Merge pull request #6510 from kevlahnota/master2
fix newgame/newgame plus entering spawn point
This commit is contained in:
@@ -266,7 +266,7 @@ public class NewGameScene extends MenuScene {
|
||||
editionIds[starterEdition.getCurrentIndex()], 0);//maybe replace with enum
|
||||
GamePlayerUtil.getGuiPlayer().setName(selectedName.getText());
|
||||
SoundSystem.instance.changeBackgroundTrack();
|
||||
WorldStage.getInstance().setDirectlyEnterPOI();
|
||||
WorldStage.getInstance().enterSpawnPOI();
|
||||
if (AdventurePlayer.current().getQuests().stream().noneMatch(q -> q.getID() == 28)) {
|
||||
AdventurePlayer.current().addQuest("28"); //Temporary link to Shandalar main questline
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ public class SaveLoadScene extends UIScene {
|
||||
Current.player().resetQuestFlags();
|
||||
Current.player().setCharacterFlag("newGamePlus", 1);
|
||||
AdventurePlayer.current().addQuest("28");
|
||||
WorldStage.getInstance().setDirectlyEnterPOI();
|
||||
WorldStage.getInstance().enterSpawnPOI();
|
||||
SoundSystem.instance.changeBackgroundTrack();
|
||||
Forge.switchScene(GameScene.instance());
|
||||
} else {
|
||||
|
||||
@@ -44,7 +44,7 @@ public class WorldStage extends GameStage implements SaveFileContent {
|
||||
protected ArrayList<Pair<Float, EnemySprite>> enemies = new ArrayList<>();
|
||||
private final static Float dieTimer = 20f;//todo config
|
||||
private Float globalTimer = 0f;
|
||||
private transient boolean directlyEnterPOI = false;
|
||||
private transient boolean enterSpawnPOI = false;
|
||||
|
||||
NavArrowActor navArrow;
|
||||
public WorldStage() {
|
||||
@@ -372,8 +372,8 @@ public class WorldStage extends GameStage implements SaveFileContent {
|
||||
}
|
||||
}
|
||||
|
||||
public void setDirectlyEnterPOI(){
|
||||
directlyEnterPOI = true; //On a new game, we want to automatically enter any POI the player overlaps with.
|
||||
public void enterSpawnPOI(){
|
||||
enterSpawnPOI = true; //On a new game, we want to automatically enter spawn POI the player overlaps with.
|
||||
}
|
||||
|
||||
public PointOfInterestMapSprite getMapSprite(PointOfInterest poi) {
|
||||
@@ -393,8 +393,12 @@ public class WorldStage extends GameStage implements SaveFileContent {
|
||||
public void enter() {
|
||||
getPlayerSprite().LoadPos();
|
||||
getPlayerSprite().setMovementDirection(Vector2.Zero);
|
||||
if (directlyEnterPOI) {
|
||||
directlyEnterPOI = false;
|
||||
if (enterSpawnPOI) {
|
||||
enterSpawnPOI = false;
|
||||
PointOfInterest poi = Current.world().findPointsOfInterest("Spawn");
|
||||
if (poi != null) { //shouldn't be null
|
||||
WorldStage.getInstance().loadPOI(poi);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (Actor actor : foregroundSprites.getChildren()) {
|
||||
|
||||
Reference in New Issue
Block a user