Galaxy.IsPrelude is the one owner of whether a run is the prelude: ActionGameManager.IsTutorial and PlayerSettings.TutorialPassed are cut
IsTutorial duplicated Galaxy.IsPrelude; its readers read CurrentGalaxy.IsPrelude, and RunSave.Capture writes SavedGame.IsTutorial from galaxy.IsPrelude with no isTutorial argument. TutorialPassed was never written and its only reader was New Game's unreachable main-galaxy branch, which goes with it (S2 brings the main galaxy back as a scenario). spawnturret's two identical generator branches collapse to one. Old player.cc files still load. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c37d6adfa8
commit
8a0a29e0de
6 changed files with 60 additions and 46 deletions
|
|
@ -106,7 +106,6 @@ public class ActionGameManager : MonoBehaviour
|
|||
}
|
||||
|
||||
public static Galaxy CurrentGalaxy;
|
||||
public static bool IsTutorial;
|
||||
|
||||
public GameSettings Settings;
|
||||
//public string StarterShipTemplate = "Longinus";
|
||||
|
|
@ -250,7 +249,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
{
|
||||
if (CurrentGalaxy != null)
|
||||
{
|
||||
var (game, zones) = RunSave.Capture(CultCache, CurrentGalaxy, Zone, DockedEntity ?? CurrentEntity, IsTutorial,
|
||||
var (game, zones) = RunSave.Capture(CultCache, CurrentGalaxy, Zone, DockedEntity ?? CurrentEntity,
|
||||
_actionBarSlots.Select(s => s.Save()).ToArray());
|
||||
RunSave.Commit(CultCache, game, zones, ItemManager.Lots);
|
||||
}
|
||||
|
|
@ -578,19 +577,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
{
|
||||
var nearestFaction = CurrentGalaxy.Factions.MinBy(f => CurrentGalaxy.HomeZones[f].Distance[Zone.GalaxyZone]);
|
||||
|
||||
var loadoutGenerator = IsTutorial ? new LoadoutGenerator(
|
||||
ref ItemManager.Random,
|
||||
ItemManager,
|
||||
CurrentGalaxy,
|
||||
Zone.GalaxyZone,
|
||||
nearestFaction,
|
||||
.5f) : new LoadoutGenerator(
|
||||
ref ItemManager.Random,
|
||||
ItemManager,
|
||||
CurrentGalaxy,
|
||||
Zone.GalaxyZone,
|
||||
nearestFaction,
|
||||
.5f);
|
||||
var loadoutGenerator = new LoadoutGenerator(ref ItemManager.Random, ItemManager, CurrentGalaxy, Zone.GalaxyZone, nearestFaction, .5f);
|
||||
|
||||
var turret = EntitySerializer.Unpack(ItemManager, Zone, loadoutGenerator.GenerateTurretLoadout());
|
||||
turret.Position.xz = _currentEntity.Position.xz +
|
||||
|
|
@ -728,7 +715,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
Settings.ZoneSettings,
|
||||
CurrentGalaxy,
|
||||
galaxyZone,
|
||||
IsTutorial
|
||||
CurrentGalaxy.IsPrelude
|
||||
);
|
||||
galaxyZone.Contents = new Zone(ItemManager, Settings.PlanetSettings, galaxyZone.PackedContents, galaxyZone, CurrentGalaxy);
|
||||
}
|
||||
|
|
@ -815,7 +802,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
PopulateLevel(CurrentGalaxy.Entrance);
|
||||
var failures = new List<string>();
|
||||
var staged = RunStart.Stage(ItemManager, Zone, null, Settings.StartingHullName,
|
||||
IsTutorial ? CurrentGalaxy.ResolveFaction(Settings.TutorialGenerationSettings.ProtagonistFaction) : null, failures)
|
||||
CurrentGalaxy.IsPrelude ? CurrentGalaxy.ResolveFaction(Settings.TutorialGenerationSettings.ProtagonistFaction) : null, failures)
|
||||
?? throw new InvalidOperationException($"The new run could not stage: {string.Join("; ", failures)}");
|
||||
BindToEntity(staged.Player);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue