レシピごとに調理パーフェクト時の商品の売値を指定できるように変更
This commit is contained in:
parent
acf553ec62
commit
985ffa79c8
|
|
@ -419,7 +419,7 @@ public class Market : SingletonMonoBehaviour<Market>
|
|||
var targetIndex = gameData.ShopStock.FindIndex(data => data.FlavorId == stockData.FlavorId && data.Rarity == stockData.Rarity);
|
||||
gameData.ShopStock.RemoveAt(targetIndex);
|
||||
gameData.AddSalesCount(stockData.FlavorId, 1, stockData.Rarity);
|
||||
coin += productData.price * (1 + rarityData.rate / 100);
|
||||
coin += productData.GetRarityPrice(rarityData.Rarity);
|
||||
}
|
||||
return coin;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,9 +119,8 @@ public class ProductManagement : MonoBehaviour
|
|||
var tankStock = gameData.StorageTanks.Where(x => x.FlavorId == tankData.FlavorId).Sum(x => x.Stock);
|
||||
var totalStock = shopStock + tankStock;
|
||||
var productData = productList.FirstOrDefault(data => data.id == tankData.FlavorId);
|
||||
var price = productData?.price ?? 0;
|
||||
List<(ProductRarity rarity, int price, int stock)> raritySummaryData = rarityDataList.Select(x =>
|
||||
(x.Rarity, price * x.rate / 100, tankData.Stocks.FirstOrDefault(sd => sd.Rarity == x.Rarity)?.Stock ?? 0)
|
||||
(x.Rarity, productData?.GetRarityPrice(x.Rarity) ?? 0, tankData.Stocks.FirstOrDefault(sd => sd.Rarity == x.Rarity)?.Stock ?? 0)
|
||||
).ToList();
|
||||
LocalCacheManager.Save(TankDetailView.TankDetailDataTag, (tankView.TankNumber, totalStock, tankData, productData, raritySummaryData));
|
||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.PopcornDescription);
|
||||
|
|
|
|||
|
|
@ -297,6 +297,27 @@ public sealed class ProductData
|
|||
{
|
||||
return materialList.Count(material => material.id != Const.NotSetMaterialId);
|
||||
}
|
||||
|
||||
public int GetRarityPrice(ProductRarity rarity)
|
||||
{
|
||||
switch (rarity)
|
||||
{
|
||||
case ProductRarity.Normal:
|
||||
return rarity1Price;
|
||||
case ProductRarity.Yellow:
|
||||
return rarity2Price;
|
||||
case ProductRarity.Copper:
|
||||
return rarity3Price;
|
||||
case ProductRarity.Silver:
|
||||
return rarity4Price;
|
||||
case ProductRarity.Gold:
|
||||
return rarity5Price;
|
||||
case ProductRarity.Rainbow:
|
||||
return rarity6Price;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(rarity), rarity, null);
|
||||
}
|
||||
}
|
||||
|
||||
public Transform GetIconPrefab()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue