player progress
This commit is contained in:
parent
5bdbfa4d82
commit
27d839b86f
27 changed files with 236 additions and 68 deletions
|
|
@ -9,5 +9,10 @@ public partial class MoneyReward : RewardResource
|
|||
{
|
||||
return Scene;
|
||||
}
|
||||
public override bool Redeem()
|
||||
{
|
||||
PlayerProgress.Instance.Money += Cost;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue