player progress

This commit is contained in:
Rendo 2025-07-21 02:13:02 +05:00
commit 27d839b86f
27 changed files with 236 additions and 68 deletions

View file

@ -9,5 +9,10 @@ public partial class MoneyReward : RewardResource
{
return Scene;
}
public override bool Redeem()
{
PlayerProgress.Instance.Money += Cost;
return true;
}
}

View file

@ -11,5 +11,18 @@ public partial class PlantReward : RewardResource
{
return Plant.Scene;
}
public override bool Redeem()
{
if (PlayerProgress.Instance.PlayerPlants.Contains(Plant) == false)
{
PlayerProgress.Instance.PlayerPlants.Add(Plant);
return true;
}
else
{
return false;
}
}
}

View file

@ -9,4 +9,5 @@ public abstract partial class RewardResource : Resource
[Export] public string Name { get; private set; }
[Export] public string Description { get; private set; }
public abstract PackedScene GetPreview();
public abstract bool Redeem();
}