some rebalancing, including bigger maps
This commit is contained in:
parent
317bc72e13
commit
349d9e230b
4 changed files with 25 additions and 15 deletions
|
@ -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 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 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 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 string Name;
|
||||||
public readonly bool[,] Area;
|
public readonly bool[,] Area;
|
||||||
|
|
|
@ -45,7 +45,7 @@ namespace TouchyTickets {
|
||||||
this.Analytics.Setup(settings);
|
this.Analytics.Setup(settings);
|
||||||
|
|
||||||
if (!SaveHandler.Load(this))
|
if (!SaveHandler.Load(this))
|
||||||
this.Map = new ParkMap(12, 12);
|
this.Map = new ParkMap(20, 20);
|
||||||
|
|
||||||
this.Ui = new Ui(this.UiSystem);
|
this.Ui = new Ui(this.UiSystem);
|
||||||
this.Camera = new Camera(this.GraphicsDevice) {
|
this.Camera = new Camera(this.GraphicsDevice) {
|
||||||
|
|
|
@ -13,7 +13,7 @@ namespace TouchyTickets {
|
||||||
TypeNameHandling = TypeNameHandling.Auto,
|
TypeNameHandling = TypeNameHandling.Auto,
|
||||||
Formatting = Formatting.Indented
|
Formatting = Formatting.Indented
|
||||||
});
|
});
|
||||||
private const int SaveVersion = 1;
|
private const int SaveVersion = 2;
|
||||||
|
|
||||||
public static void Save(GameImpl game) {
|
public static void Save(GameImpl game) {
|
||||||
var file = GetSaveFile(true);
|
var file = GetSaveFile(true);
|
||||||
|
@ -36,8 +36,10 @@ namespace TouchyTickets {
|
||||||
var file = GetSaveFile(false);
|
var file = GetSaveFile(false);
|
||||||
if (!file.Exists)
|
if (!file.Exists)
|
||||||
return false;
|
return false;
|
||||||
using (var stream = new JsonTextReader(file.OpenText())) {
|
SaveData data;
|
||||||
var data = Serializer.Deserialize<SaveData>(stream);
|
using (var stream = new JsonTextReader(file.OpenText()))
|
||||||
|
data = Serializer.Deserialize<SaveData>(stream);
|
||||||
|
|
||||||
game.Tickets = data.Tickets;
|
game.Tickets = data.Tickets;
|
||||||
game.LastUpdate = data.LastUpdate;
|
game.LastUpdate = data.LastUpdate;
|
||||||
game.Map = data.Map.Copy();
|
game.Map = data.Map.Copy();
|
||||||
|
@ -47,7 +49,15 @@ namespace TouchyTickets {
|
||||||
foreach (var name in data.Upgrades)
|
foreach (var name in data.Upgrades)
|
||||||
game.AppliedUpgrades.Add(Upgrade.Upgrades[name]);
|
game.AppliedUpgrades.Add(Upgrade.Upgrades[name]);
|
||||||
game.Tutorial.CurrentStep = data.TutorialStep;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace TouchyTickets {
|
||||||
// map size upgrades
|
// map size upgrades
|
||||||
if (MapSize.Contains(this)) {
|
if (MapSize.Contains(this)) {
|
||||||
var oldMap = GameImpl.Instance.Map;
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue