diff --git a/Assets/Resources/Scripts/Control/FoodSpawner.cs b/Assets/Resources/Scripts/Control/FoodSpawner.cs index 3545b8a..3c58474 100644 --- a/Assets/Resources/Scripts/Control/FoodSpawner.cs +++ b/Assets/Resources/Scripts/Control/FoodSpawner.cs @@ -18,6 +18,7 @@ public class FoodSpawner : MonoBehaviour public WorldSettings worldSettings; public static List foodsList = new List(); + public static List absorbableFoodsList = new List(); public static List edibleFoodsList = new List(); public static Sprite[] foodSprites; public static Sprite[] foodSpawnerSprites; @@ -38,19 +39,19 @@ public void GetFoodSubclasses() foreach (Type type in types) { - if (type != typeof(Corpse)) + if (type.BaseType == typeof(EdibleFood) && !foodsList.Contains(type) && !edibleFoodsList.Contains(type)) { - if (type.BaseType == typeof(EdibleFood) && !foodsList.Contains(type) && !edibleFoodsList.Contains(type)) + foodsList.Add(type); + if (type != typeof(Corpse)) { - foodsList.Add(type); edibleFoodsList.Add(type); - } + } - if (type.BaseType == typeof(AbsorbableFood) && !foodsList.Contains(type)) - { - foodsList.Add(type); - } + if (type.BaseType == typeof(AbsorbableFood) && !foodsList.Contains(type) && !absorbableFoodsList.Contains(type)) + { + foodsList.Add(type); + absorbableFoodsList.Add(type); } } } diff --git a/Assets/Resources/Scripts/Core/WorldSettings.cs b/Assets/Resources/Scripts/Core/WorldSettings.cs index f685f84..16710a0 100644 --- a/Assets/Resources/Scripts/Core/WorldSettings.cs +++ b/Assets/Resources/Scripts/Core/WorldSettings.cs @@ -158,13 +158,13 @@ private void Awake() SpawnRatio[i] = 1; } - EnergyCoefficients = new int[foodsList.Count]; + EnergyCoefficients = new int[edibleFoodsList.Count + absorbableFoodsList.Count]; for (int i = 0; i < EnergyCoefficients.Length; i++) { EnergyCoefficients[i] = 1; } - HealCoefficients = new int[foodsList.Count]; + HealCoefficients = new int[edibleFoodsList.Count + absorbableFoodsList.Count]; for (int i = 0; i < HealCoefficients.Length; i++) { HealCoefficients[i] = 1; diff --git a/Assets/Resources/Scripts/Main items/Inspector/FoodVariables.cs b/Assets/Resources/Scripts/Main items/Inspector/FoodVariables.cs index 6227fbe..8144ae3 100644 --- a/Assets/Resources/Scripts/Main items/Inspector/FoodVariables.cs +++ b/Assets/Resources/Scripts/Main items/Inspector/FoodVariables.cs @@ -15,6 +15,16 @@ public float EnergyValue linkedFood.energyValue = value; } } + + [SerializeField] + public float HealValue + { + get => linkedFood.healValue; + set + { + linkedFood.healValue = value; + } + } // Start is called before the first frame update private void Awake() { diff --git a/Assets/StreamingAssets/Built-in translations/en.txt b/Assets/StreamingAssets/Built-in translations/en.txt index 82d0a53..4e7f1db 100644 --- a/Assets/StreamingAssets/Built-in translations/en.txt +++ b/Assets/StreamingAssets/Built-in translations/en.txt @@ -42,6 +42,7 @@ EdibleFood:EdibleFood ConditionsReactions:ConditionsReactions EnergyValue:EnergyValue +HealValue:HealValue HBorder:HBorder VBorder:VBorder @@ -49,7 +50,7 @@ MaxFood:MaxFood SpawnRatio:SpawnRatio BaseEnergy:BaseEnergy EnergyCoefficients:EnergyCoefficients -BaseEnergy:HealEnergy +BaseHeal:BaseHeal HealCoefficients:HealCoefficients LightMapScale:LightMapScale LightMapMoving:LightMapMoving diff --git a/Assets/StreamingAssets/Built-in translations/ru.txt b/Assets/StreamingAssets/Built-in translations/ru.txt index 822ea13..527513e 100644 --- a/Assets/StreamingAssets/Built-in translations/ru.txt +++ b/Assets/StreamingAssets/Built-in translations/ru.txt @@ -42,6 +42,7 @@ EdibleFood:Съедобная еда ConditionsReactions:Реакция на условия EnergyValue:Питательные свойства +HealValue:Лечебные свойства HBorder:Горизонтальный размер VBorder:Вертикальный размер diff --git a/Assets/StreamingAssets/Built-in translations/ua.txt b/Assets/StreamingAssets/Built-in translations/ua.txt index ed8595b..9e0517d 100644 --- a/Assets/StreamingAssets/Built-in translations/ua.txt +++ b/Assets/StreamingAssets/Built-in translations/ua.txt @@ -42,6 +42,7 @@ EdibleFood:Їстівна їжа ConditionsReactions:Реакція на оточення EnergyValue:Енергетична цінність +HealValue:Лікувальна цінність HBorder:Горизонтальний розмір VBorder:Вертикальний розмір diff --git a/Assets/StreamingAssets/build_info b/Assets/StreamingAssets/build_info index ee7b0a7..2806c1a 100644 --- a/Assets/StreamingAssets/build_info +++ b/Assets/StreamingAssets/build_info @@ -1 +1 @@ -Build from HOME-PC at 20.04.2021 14:53:11 \ No newline at end of file +Build from HOME-PC at 21.04.2021 10:52:16 \ No newline at end of file