Persist Sarco data
This commit is contained in:
@@ -43,7 +43,7 @@ public partial class Sarco : Node3D
|
||||
|
||||
public void OnResolved()
|
||||
{
|
||||
_interactionComplete = _game.SarcoData.IgneousSarcoAcquired;
|
||||
_interactionComplete = GetSaveDataByAffinity();
|
||||
if (_interactionComplete)
|
||||
ShowFlower();
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public partial class Sarco : Node3D
|
||||
{
|
||||
GetTree().Paused = false;
|
||||
_interactionComplete = true;
|
||||
_game.SarcoData.IgneousSarcoAcquired = true;
|
||||
SetSaveDataByAffinity();
|
||||
await _game.Save();
|
||||
}
|
||||
|
||||
@@ -84,4 +84,42 @@ public partial class Sarco : Node3D
|
||||
{
|
||||
_isInInteractZone = false;
|
||||
}
|
||||
|
||||
private bool GetSaveDataByAffinity()
|
||||
{
|
||||
if (Affinity == ElementType.Aeolic)
|
||||
return _game.SarcoData.AeolicSarcoAcquired;
|
||||
if (Affinity == ElementType.Igneous)
|
||||
return _game.SarcoData.IgneousSarcoAcquired;
|
||||
if (Affinity == ElementType.Telluric)
|
||||
return _game.SarcoData.TelluricSarcoAcquired;
|
||||
if (Affinity == ElementType.Hydric)
|
||||
return _game.SarcoData.HydricSarcoAcquired;
|
||||
if (Affinity == ElementType.Ferrum)
|
||||
return _game.SarcoData.FerrumSarcoAcquired;
|
||||
if (Affinity == ElementType.Sankta)
|
||||
return _game.SarcoData.SanktaSarcoAcquired;
|
||||
if (Affinity == ElementType.Shura)
|
||||
return _game.SarcoData.ShuraSarcoAcquired;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void SetSaveDataByAffinity()
|
||||
{
|
||||
if (Affinity == ElementType.Aeolic)
|
||||
_game.SarcoData.AeolicSarcoAcquired = true;
|
||||
if (Affinity == ElementType.Igneous)
|
||||
_game.SarcoData.IgneousSarcoAcquired = true;
|
||||
if (Affinity == ElementType.Telluric)
|
||||
_game.SarcoData.TelluricSarcoAcquired = true;
|
||||
if (Affinity == ElementType.Hydric)
|
||||
_game.SarcoData.HydricSarcoAcquired = true;
|
||||
if (Affinity == ElementType.Ferrum)
|
||||
_game.SarcoData.FerrumSarcoAcquired = true;
|
||||
if (Affinity == ElementType.Sankta)
|
||||
_game.SarcoData.SanktaSarcoAcquired = true;
|
||||
if (Affinity == ElementType.Shura)
|
||||
_game.SarcoData.ShuraSarcoAcquired = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user