| | |
| | | public class AlchemyModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | Dictionary<int, uint> m_AlchemyTimes = new Dictionary<int, uint>();
|
| | | Dictionary<int, AlchemyCount> m_AlchemyCounts = new Dictionary<int, AlchemyCount>();
|
| | | Dictionary<int, Dictionary<int, AlchemyCount>> m_AlchemyCounts = new Dictionary<int, Dictionary<int, AlchemyCount>>();
|
| | | Dictionary<int, int> m_AlchemyQualityLucks = new Dictionary<int, int>();
|
| | | Dictionary<int, List<Item>> m_AlchemyMaterials = new Dictionary<int, List<Item>>();
|
| | | Dictionary<int, AlchemyDrugUseLimit> m_AlchemyDrugUseLimits = new Dictionary<int, AlchemyDrugUseLimit>();
|
| | |
| | | var intArray = LitJson.JsonMapper.ToObject<int[][]>(config.CntRateList);
|
| | | var min = intArray[0][1];
|
| | | var max = intArray[intArray.Length - 1][1];
|
| | | if (m_AlchemyCounts.ContainsKey(config.AlchemyQuality))
|
| | | if (!m_AlchemyCounts.ContainsKey(config.AlchemyQuality))
|
| | | {
|
| | | var alchemyCount = m_AlchemyCounts[config.AlchemyQuality];
|
| | | if (min < alchemyCount.min)
|
| | | {
|
| | | alchemyCount.min = min;
|
| | | m_AlchemyCounts[config.AlchemyQuality] = alchemyCount;
|
| | | }
|
| | | if (max > alchemyCount.max)
|
| | | {
|
| | | alchemyCount.max = max;
|
| | | m_AlchemyCounts[config.AlchemyQuality] = alchemyCount;
|
| | | }
|
| | | m_AlchemyCounts[config.AlchemyQuality] = new Dictionary<int, AlchemyCount>();
|
| | | }
|
| | | else
|
| | | m_AlchemyCounts[config.AlchemyQuality].Add(config.LuckValue, new AlchemyCount()
|
| | | {
|
| | | m_AlchemyCounts[config.AlchemyQuality] = new AlchemyCount()
|
| | | {
|
| | | min = min,
|
| | | max = max,
|
| | | };
|
| | | }
|
| | | min = min,
|
| | | max = max,
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return m_AlchemyTimes.TryGetValue(alchemyId, out tick);
|
| | | }
|
| | |
|
| | | public bool TryGetAlchemyCount(int alchemyId, out AlchemyCount alchemyCount)
|
| | | public bool TryGetAlchemyCount(int alchemyId, int luckValue, out AlchemyCount alchemyCount)
|
| | | {
|
| | | var config = AlchemyConfig.Get(alchemyId);
|
| | | alchemyCount = default(AlchemyCount);
|
| | | if (config == null)
|
| | | {
|
| | | alchemyCount = default(AlchemyCount);
|
| | | return false;
|
| | | }
|
| | | if (config.AlchemType == (int)AlchemyType.Fairy)
|
| | |
| | | alchemyCount = AlchemyCount.one;
|
| | | return true;
|
| | | }
|
| | | return m_AlchemyCounts.TryGetValue(config.AlchemyQuality, out alchemyCount);
|
| | | var dict = m_AlchemyCounts[config.AlchemyQuality];
|
| | | foreach (var _luckValue in dict.Keys)
|
| | | {
|
| | | if (luckValue >= _luckValue)
|
| | | {
|
| | | alchemyCount = dict[_luckValue];
|
| | | }
|
| | | }
|
| | | return alchemyCount.Equals(default(AlchemyCount));
|
| | | }
|
| | |
|
| | | public bool TryGetAlchemyMaterials(int alchemyId, out List<Item> items)
|