Skip to content

Commit 796b4f7

Browse files
committed
updated to shortcut to work between saves
1 parent 17eca84 commit 796b4f7

5 files changed

Lines changed: 14 additions & 9 deletions

File tree

Globals/SaveSystem.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ public class SaveFile
385385
public int[] NoteIds { get; init; }
386386
public int[] RelicIds { get; init; }
387387
public int PlayerHealth { get; init; }
388+
public int UsedShortcuts { get; init; }
388389

389390
public SaveFile(
390391
ulong rngSeed,
@@ -394,7 +395,8 @@ public SaveFile(
394395
int[] relicIds,
395396
int playerHealth,
396397
int area,
397-
int money
398+
int money,
399+
int usedShortcuts
398400
)
399401
{
400402
RngSeed = rngSeed;
@@ -405,6 +407,7 @@ int money
405407
PlayerHealth = playerHealth;
406408
Area = area;
407409
Money = money;
410+
UsedShortcuts = usedShortcuts;
408411
}
409412
}
410413

@@ -420,7 +423,8 @@ public static void SaveGame()
420423
relicIds,
421424
StageProducer.PlayerStats.CurrentHealth,
422425
StageProducer.CurLevel.Id,
423-
StageProducer.PlayerStats.Money
426+
StageProducer.PlayerStats.Money,
427+
StageProducer.PlayerStats.usedShortcuts
424428
);
425429
string json = JsonSerializer.Serialize(sv);
426430

Globals/Scribe.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,8 @@ e is BattleDirector.Harbinger.OnDamageInstanceArgs dmgArgs
401401
new RelicEffect(
402402
BattleEffectTrigger.OnPickup,
403403
1,
404-
(e, self, val) =>
405-
{
406-
StageProducer.PlayerStats.MapLaneChanges = 1;
404+
(e, self, val) => {
405+
// this no longer has an effect, we just check that the player has looted it :)
407406
}
408407
),
409408
}

Globals/StageProducer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ private bool LoadGame()
103103
}
104104
PlayerStats.CurrentHealth = sv.PlayerHealth;
105105
PlayerStats.Money = sv.Money;
106+
PlayerStats.usedShortcuts = sv.UsedShortcuts;
106107
IsInitialized = true;
107108
return true;
108109
}

Scenes/Maps/Scripts/Cartographer.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,11 @@ private void DrawMapSprite(MapGrid.Room room)
8787
AddChild(newButton);
8888
bool isChild = StageProducer.GetCurRoom().Children.Contains(room.Idx);
8989

90-
// checks if the next room is one below current room, and player has charges of maplanechanges
90+
// checks if the next room is one below current room, player has shortcut, and player hasn't used all its charges
9191
bool isLaneChangeAllowed =
9292
room.Y == StageProducer.GetCurRoom().Y + 1
93-
&& StageProducer.PlayerStats.MapLaneChanges > 0;
93+
&& StageProducer.PlayerStats.usedShortcuts < Scribe.RelicDictionary[13].Effects[0].Value
94+
&& StageProducer.PlayerStats.CurRelics.Any(r => r.Id == Scribe.RelicDictionary[13].Id);
9495

9596
//button is disabled if it is not a child of current room.
9697
//unless player has charges of lane changing
@@ -110,7 +111,7 @@ private void DrawMapSprite(MapGrid.Room room)
110111
newButton.Pressed += () =>
111112
{
112113
if (!isChild)
113-
StageProducer.PlayerStats.MapLaneChanges--;
114+
StageProducer.PlayerStats.usedShortcuts++;
114115

115116
EnterStage(room.Idx, newButton);
116117
};

Scenes/Puppets/Scripts/PlayerStats.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public partial class PlayerStats : Resource
1414
public int NotesToIncreaseCombo = 4;
1515
public int RewardAmountModifier = 0;
1616
public int Rerolls = 0;
17-
public int MapLaneChanges = 0;
17+
public int usedShortcuts = 0;
1818

1919
//Array in order of descending rarities, Legendary -> ... Common. Int odds out of 100.
2020
public int[] RarityOdds = [1, 5, 10, 20, 100];

0 commit comments

Comments
 (0)