| | |
| | | public Dictionary<int, Dictionary<int, int>> godWeaponSkillDict = new Dictionary<int, Dictionary<int, int>>();
|
| | | Dictionary<int, List<GodWeaponCondition>> godWeaponConditions = new Dictionary<int, List<GodWeaponCondition>>();
|
| | | public List<int> godWeaponSorts = new List<int>();
|
| | |
|
| | | Dictionary<int, AutoHammerCost> autoHammerCostDict = new Dictionary<int, AutoHammerCost>();
|
| | | Dictionary<int, int[]> godWeaponStageDict = new Dictionary<int, int[]>();
|
| | | int[] autoHammerExpArea { get; set; }
|
| | | int[] autoHammerCount { get; set; }
|
| | |
|
| | |
| | | public int gotoType = 0;
|
| | |
|
| | | public int autoHammerLevel { get; set; }
|
| | | public int autoHammerSingleCost { get; private set; }
|
| | | public int autoHammerSingleExp { get; private set; }
|
| | |
|
| | | public int[] godWeaponStages { get; private set; }
|
| | | void ParseConfig()
|
| | | {
|
| | | godWeaponTypes = GodWeaponConfig.GetGodWeaponType();
|
| | |
| | | autoHammerCount = ConfigParse.GetMultipleStr<int>(autoHammerConfig.Numerical2);
|
| | | }
|
| | |
|
| | | autoHammerSingleCost = 10;
|
| | | autoHammerSingleExp = 10;
|
| | | var funcConfig = Config.Instance.Get<FuncConfigConfig>("GodMagicExp");
|
| | | json = LitJson.JsonMapper.ToObject(funcConfig.Numerical1);
|
| | | foreach (var key in json.Keys)
|
| | | {
|
| | | var type = int.Parse(key);
|
| | | var array = LitJson.JsonMapper.ToObject<int[]>(json[key].ToJson());
|
| | | autoHammerCostDict.Add(type, new AutoHammerCost()
|
| | | {
|
| | | cost = array[0],
|
| | | exp = array[1],
|
| | | });
|
| | | }
|
| | |
|
| | | godWeaponStages = new int[] { 100, 200, 300 };
|
| | | funcConfig = Config.Instance.Get<FuncConfigConfig>("GodMagicEffect");
|
| | | json = LitJson.JsonMapper.ToObject(funcConfig.Numerical1);
|
| | | foreach (var key in json.Keys)
|
| | | {
|
| | | var type = int.Parse(key);
|
| | | var array = LitJson.JsonMapper.ToObject<int[]>(json[key].ToJson());
|
| | | godWeaponStageDict.Add(type, array);
|
| | | }
|
| | | }
|
| | |
|
| | | public int[] GetLevelUpItemByType(int type)
|
| | |
| | |
|
| | | public int GetAutoHammerCount(int type)
|
| | | {
|
| | | ulong totalExp = 0;
|
| | | var godWeaponInfo = GetGodWeaponInfo(type);
|
| | | if (godWeaponInfo == null || autoHammerExpArea == null || autoHammerCount == null)
|
| | | {
|
| | | return 1;
|
| | | }
|
| | | totalExp += godWeaponInfo.exp;
|
| | | for (int i = 1; i < godWeaponInfo.level; i++)
|
| | | {
|
| | | var config = GodWeaponConfig.GetConfig(type, i);
|
| | | totalExp += (ulong)config.NeedExp;
|
| | | }
|
| | | var index = 0;
|
| | | for (int i = 0; i < autoHammerExpArea.Length; i++)
|
| | | {
|
| | | if (totalExp < (ulong)autoHammerExpArea[i])
|
| | | {
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | if (index < autoHammerCount.Length)
|
| | | {
|
| | | return autoHammerCount[index];
|
| | | }
|
| | | return autoHammerCount[autoHammerCount.Length - 1];
|
| | | return 1;
|
| | | //ulong totalExp = 0;
|
| | | //var godWeaponInfo = GetGodWeaponInfo(type);
|
| | | //if (godWeaponInfo == null || autoHammerExpArea == null || autoHammerCount == null)
|
| | | //{
|
| | | // return 1;
|
| | | //}
|
| | | //totalExp += godWeaponInfo.exp;
|
| | | //for (int i = 1; i < godWeaponInfo.level; i++)
|
| | | //{
|
| | | // var config = GodWeaponConfig.GetConfig(type, i);
|
| | | // totalExp += (ulong)config.NeedExp;
|
| | | //}
|
| | | //var index = 0;
|
| | | //for (int i = 0; i < autoHammerExpArea.Length; i++)
|
| | | //{
|
| | | // if (totalExp < (ulong)autoHammerExpArea[i])
|
| | | // {
|
| | | // index = i;
|
| | | // break;
|
| | | // }
|
| | | //}
|
| | | //if (index < autoHammerCount.Length)
|
| | | //{
|
| | | // return autoHammerCount[index];
|
| | | //}
|
| | | //return autoHammerCount[autoHammerCount.Length - 1];
|
| | | }
|
| | |
|
| | | public int GetAutoHammerCount(int type, int index)
|
| | | {
|
| | | return 1;
|
| | | //var items = GetLevelUpItemByType(type);
|
| | | //var moneyCount = GetAutoHammerCount(type);
|
| | | //AutoHammerCost autoHammerCost;
|
| | | //var totalExp = 0;
|
| | | //if (TryGetAutoHammerCost(type, out autoHammerCost))
|
| | | //{
|
| | | // totalExp = moneyCount * autoHammerCost.exp;
|
| | | //}
|
| | | //var itemId = items[index];
|
| | | //var itemConfig = Config.Instance.Get<ItemConfig>(itemId);
|
| | | //var expCount = Mathf.CeilToInt((float)totalExp / itemConfig.EffectValueA1);
|
| | | //var packCount = packModel.GetItemCountByID(PackType.rptItem, itemId);
|
| | | //return Mathf.Min(expCount, packCount);
|
| | | }
|
| | |
|
| | | public bool ContainsCondition(int type)
|
| | |
| | | var godWeaponInfo = GetGodWeaponInfo(type);
|
| | | if (godWeaponInfo != null)
|
| | | {
|
| | | var godWeaponStages = godWeaponStageDict[type];
|
| | | for (int i = 0; i < godWeaponStages.Length; i++)
|
| | | {
|
| | | if (godWeaponInfo.level >= godWeaponStages[i])
|
| | |
| | | return 0;
|
| | | }
|
| | |
|
| | | public int GetGodWeaponStageRequireLevel(int stage)
|
| | | public int GetGodWeaponStageRequireLevel(int type, int stage)
|
| | | {
|
| | | var godWeaponStages = godWeaponStageDict[type];
|
| | | if (stage > 0 && stage - 1 < godWeaponStages.Length)
|
| | | {
|
| | | return godWeaponStages[stage - 1];
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | public bool TryGetAutoHammerCost(int type,out AutoHammerCost autoHammerCost)
|
| | | {
|
| | | return autoHammerCostDict.TryGetValue(type, out autoHammerCost);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public class GodWeaponInfo
|
| | |
| | | public int type;
|
| | | public int level;
|
| | | }
|
| | |
|
| | | public struct AutoHammerCost
|
| | | {
|
| | | public int cost;
|
| | | public int exp;
|
| | | }
|
| | | }
|
| | |
|