お客さんの購入テーブルとセレブ客の出現確率を更新

This commit is contained in:
kimura 2021-11-12 11:11:15 +09:00
parent 05cd34e727
commit 2969c2d950
1 changed files with 11 additions and 7 deletions

View File

@ -18,14 +18,17 @@ public enum ShopState
public class Market : SingletonMonoBehaviour<Market> public class Market : SingletonMonoBehaviour<Market>
{ {
public static readonly int ShopStockCount = 20; public static readonly int ShopStockCount = 20;
private static readonly int SpecialOrderCount = 5;
private static readonly (int want, float weight)[] CustomerWeightTable = { private static readonly (int want, float weight)[] CustomerWeightTable = {
(1, 70f), (1, 75f),
(2, 20f), (2, 15f),
(3, 3f), (3, 3.5f),
(4, 1.5f), (4, 1.25f),
(5, .5f), (5, .25f),
(0, 5f), (0, 5f),
}; };
private static readonly float walkerSpecialRate = .01f;
private static readonly float customerSpecialRate = .01f;
[SerializeField] private CustomerFlow customerFlow; [SerializeField] private CustomerFlow customerFlow;
[SerializeField] private GameObject orderPosisionObject; [SerializeField] private GameObject orderPosisionObject;
@ -340,10 +343,11 @@ public class Market : SingletonMonoBehaviour<Market>
public static (bool isSpecial, int orderCount) GetCustomerData (bool isCustomer) public static (bool isSpecial, int orderCount) GetCustomerData (bool isCustomer)
{ {
var isSpecial = isCustomer ? Random.value < .01f : Random.value < .03f; var specialRate = isCustomer ? walkerSpecialRate : customerSpecialRate;
var isSpecial = Random.value < specialRate;
// セレブは5個購入固定 // セレブは5個購入固定
return isSpecial ? (true, 5) : (false, GetOrderCount()); return isSpecial ? (true, specialOrderCount: SpecialOrderCount) : (false, GetOrderCount());
} }
// お客さん出現パターン確率計算と行動パターン計算 // お客さん出現パターン確率計算と行動パターン計算