Persist Sarco data
This commit is contained in:
@@ -74,7 +74,7 @@ public partial class EnemyModelView2D : EnemyModelView, IEnemyModelView
|
||||
FlameHitAnimation.Stop();
|
||||
FlameHitAnimation.Play("FireHit");
|
||||
}
|
||||
else if (elementType == ElementType.Holy)
|
||||
else if (elementType == ElementType.Sankta)
|
||||
{
|
||||
if (HolyHitAnimation.IsPlaying())
|
||||
HolyHitAnimation.Stop();
|
||||
@@ -86,7 +86,7 @@ public partial class EnemyModelView2D : EnemyModelView, IEnemyModelView
|
||||
WindHitAnimation.Stop();
|
||||
WindHitAnimation.Play("WindHit");
|
||||
}
|
||||
else if (elementType == ElementType.Curse)
|
||||
else if (elementType == ElementType.Shura)
|
||||
{
|
||||
if (CurseHitAnimation.IsPlaying())
|
||||
CurseHitAnimation.Stop();
|
||||
|
||||
@@ -115,7 +115,13 @@ public partial class Game : Node3D, IGame
|
||||
},
|
||||
SarcoData = new SarcoData()
|
||||
{
|
||||
AeolicSarcoAcquired = SarcoData.AeolicSarcoAcquired,
|
||||
IgneousSarcoAcquired = SarcoData.IgneousSarcoAcquired,
|
||||
TelluricSarcoAcquired = SarcoData.TelluricSarcoAcquired,
|
||||
HydricSarcoAcquired = SarcoData.HydricSarcoAcquired,
|
||||
FerrumSarcoAcquired = SarcoData.FerrumSarcoAcquired,
|
||||
SanktaSarcoAcquired = SarcoData.SanktaSarcoAcquired,
|
||||
ShuraSarcoAcquired = SarcoData.ShuraSarcoAcquired,
|
||||
}
|
||||
};
|
||||
return gameData;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3017,10 +3017,6 @@ transform = Transform3D(0.921192, 0.0644309, 0.329915, -0.635509, 0.0745904, 0.4
|
||||
mesh = SubResource("ArrayMesh_pxsmp")
|
||||
skeleton = NodePath("")
|
||||
|
||||
[node name="Sarco2" parent="." instance=ExtResource("59_mic3u")]
|
||||
transform = Transform3D(-0.561658, 0, -0.196382, 0, 0.595, 0, 0.196382, 0, -0.561658, -328.661, 2.6811, 27.9079)
|
||||
Affinity = 4
|
||||
|
||||
[editable path="Node3D/Overworld Re-Scaled (Missing Distance Objects)"]
|
||||
[editable path="Actors/Rat"]
|
||||
[editable path="Actors/Clalo"]
|
||||
|
||||
@@ -102,7 +102,7 @@ public partial class InGameUI : Control, IInGameUI
|
||||
case ElementType.Telluric:
|
||||
TelluricImg.Visible = true;
|
||||
break;
|
||||
case ElementType.Curse:
|
||||
case ElementType.Shura:
|
||||
SanktaImg.Visible = true;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user