some rebalancing, including bigger maps

This commit is contained in:
Ellpeck 2020-06-05 23:00:03 +02:00
parent 317bc72e13
commit 349d9e230b
4 changed files with 25 additions and 15 deletions

View file

@ -19,7 +19,7 @@ namespace TouchyTickets.Attractions {
public static readonly AttractionType HauntedHouse = Register(new AttractionType("HauntedHouse", RectArea(2, 2), Attraction.Texture[3, 5, 2, 2], 30, 12000));
public static readonly AttractionType WildMouse = Register(new AttractionType("WildMouse", RectArea(3, 2), Attraction.Texture[2, 1, 3, 2], 50, 24000));
public static readonly AttractionType LogFlume = Register(new AttractionType("LogFlume", new[,] {{true, true, false}, {true, true, true}}, Attraction.Texture[0, 3, 3, 2], 75, 38000));
public static readonly AttractionType WoodCoaster = Register(new AttractionType("WoodCoaster", RectArea(3, 3), Attraction.Texture[0, 5, 3, 3], 90, 60000));
public static readonly AttractionType WoodCoaster = Register(new AttractionType("WoodCoaster", RectArea(3, 3), Attraction.Texture[0, 5, 3, 3], 140, 60000));
public readonly string Name;
public readonly bool[,] Area;

View file

@ -45,7 +45,7 @@ namespace TouchyTickets {
this.Analytics.Setup(settings);
if (!SaveHandler.Load(this))
this.Map = new ParkMap(12, 12);
this.Map = new ParkMap(20, 20);
this.Ui = new Ui(this.UiSystem);
this.Camera = new Camera(this.GraphicsDevice) {

View file

@ -13,7 +13,7 @@ namespace TouchyTickets {
TypeNameHandling = TypeNameHandling.Auto,
Formatting = Formatting.Indented
});
private const int SaveVersion = 1;
private const int SaveVersion = 2;
public static void Save(GameImpl game) {
var file = GetSaveFile(true);
@ -36,18 +36,28 @@ namespace TouchyTickets {
var file = GetSaveFile(false);
if (!file.Exists)
return false;
using (var stream = new JsonTextReader(file.OpenText())) {
var data = Serializer.Deserialize<SaveData>(stream);
game.Tickets = data.Tickets;
game.LastUpdate = data.LastUpdate;
game.Map = data.Map.Copy();
game.Stars = data.Stars;
game.TimesRestarted = data.TimesRestarted;
game.AppliedUpgrades.Clear();
foreach (var name in data.Upgrades)
game.AppliedUpgrades.Add(Upgrade.Upgrades[name]);
game.Tutorial.CurrentStep = data.TutorialStep;
SaveData data;
using (var stream = new JsonTextReader(file.OpenText()))
data = Serializer.Deserialize<SaveData>(stream);
game.Tickets = data.Tickets;
game.LastUpdate = data.LastUpdate;
game.Map = data.Map.Copy();
game.Stars = data.Stars;
game.TimesRestarted = data.TimesRestarted;
game.AppliedUpgrades.Clear();
foreach (var name in data.Upgrades)
game.AppliedUpgrades.Add(Upgrade.Upgrades[name]);
game.Tutorial.CurrentStep = data.TutorialStep;
Console.WriteLine("OLD SAVE VERSION: " + data.SaveVersion);
// version 1 had smaller maps
if (data.SaveVersion <= 1) {
game.Map = game.Map.Copy(20, 20);
foreach (var upgrade in game.AppliedUpgrades.Intersect(Upgrade.MapSize))
upgrade.OnApplied();
}
return true;
}

View file

@ -42,7 +42,7 @@ namespace TouchyTickets {
// map size upgrades
if (MapSize.Contains(this)) {
var oldMap = GameImpl.Instance.Map;
GameImpl.Instance.Map = oldMap.Copy(oldMap.Width + 5, oldMap.Height + 5);
GameImpl.Instance.Map = oldMap.Copy(oldMap.Width + 10, oldMap.Height + 10);
}
}