simple eating )

This commit is contained in:
2023-02-28 23:41:38 +02:00
parent 75b9665674
commit a54ce69e66
9 changed files with 58 additions and 501 deletions
+12 -6
View File
@@ -203,22 +203,28 @@ public class Player : MonoBehaviour
public void UpdateStatsByClock()
{
Stats[StatsId.Food].deduct(0.034m); // 48 hours it's 100, 100/2880=~0.034 per minute
Stats[StatsId.Food].deduct(0.034f); // 48 hours it's 100, 100/2880=~0.034 per minute
if (_currentAnimation != AnimationStates.Sleeping)
{
Stats[StatsId.Energy].deduct(0.1m); // 24 hours it's 100, 100/1440=~0.096 per minute
Stats[StatsId.Energy].deduct(0.1f); // 24 hours it's 100, 100/1440=~0.096 per minute
}
else
{
Stats[StatsId.Energy].increase(1m);
Stats[StatsId.Energy].increase(1f);
}
}
public void BuyAction(IPlayerAction action)
public void BuyObject(FoodObjectSO objectToBuy)
{
Stats[StatsId.Money].deduct(((ISellable)action).Price);
action.ApplyAction(this);
Stats[StatsId.Money].deduct(objectToBuy.objectPrice);
//action.ApplyAction(this);
}
public float Eat()
{
Stats[StatsId.Food].increase(10);
return Stats[StatsId.Food].Value;
}
private static string GetEnumMemberValue<T>(T value)