Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: Fish
|
| | | // [ Date ]: Wednesday, May 15, 2019
|
| | | // [ Date ]: Wednesday, June 26, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | public readonly int EquipClass;
|
| | | public readonly int EquipColor;
|
| | | public readonly int IsSuit;
|
| | | public readonly int Star;
|
| | | public readonly int BaseEquipMaxHPAddPerC;
|
| | | public readonly int BaseEquipAtkAddPerC;
|
| | | public readonly int SuperHitC;
|
| | |
| | |
|
| | | int.TryParse(tables[3],out IsSuit);
|
| | |
|
| | | int.TryParse(tables[4],out BaseEquipMaxHPAddPerC); |
| | | int.TryParse(tables[4],out Star); |
| | |
|
| | | int.TryParse(tables[5],out BaseEquipAtkAddPerC); |
| | | int.TryParse(tables[5],out BaseEquipMaxHPAddPerC); |
| | |
|
| | | int.TryParse(tables[6],out SuperHitC); |
| | | int.TryParse(tables[6],out BaseEquipAtkAddPerC); |
| | |
|
| | | int.TryParse(tables[7],out SuperHitPerC); |
| | | int.TryParse(tables[7],out SuperHitC); |
| | |
|
| | | int.TryParse(tables[8],out LuckyHitRateC); |
| | | int.TryParse(tables[8],out SuperHitPerC); |
| | |
|
| | | int.TryParse(tables[9],out LuckyHitRateReduceC); |
| | | int.TryParse(tables[9],out LuckyHitRateC); |
| | |
|
| | | int.TryParse(tables[10],out LuckPerC); |
| | | int.TryParse(tables[10],out LuckyHitRateReduceC); |
| | |
|
| | | int.TryParse(tables[11],out PerLVAtkC); |
| | | int.TryParse(tables[11],out LuckPerC); |
| | |
|
| | | int.TryParse(tables[12],out PerLVMaxHPC); |
| | | int.TryParse(tables[12],out PerLVAtkC); |
| | |
|
| | | int.TryParse(tables[13],out DropMoneyPerC); |
| | | int.TryParse(tables[13],out PerLVMaxHPC); |
| | |
|
| | | int.TryParse(tables[14],out SuperHitReduceC); |
| | | int.TryParse(tables[14],out DropMoneyPerC); |
| | |
|
| | | int.TryParse(tables[15],out HitC); |
| | | int.TryParse(tables[15],out SuperHitReduceC); |
| | |
|
| | | int.TryParse(tables[16],out MissC); |
| | | int.TryParse(tables[16],out HitC); |
| | |
|
| | | int.TryParse(tables[17],out MissC); |
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | |
| | | fileFormatVersion: 2 |
| | | guid: b14139202185e114e8c1b11ee6917430 |
| | | timeCreated: 1557892128 |
| | | timeCreated: 1561530128 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | |
|
| | | public void OnConfigParseCompleted()
|
| | | {
|
| | | string key = StringUtility.Contact(EquipClass, EquipColor, IsSuit);
|
| | | string key = StringUtility.Contact(EquipClass, EquipColor, IsSuit ,Star);
|
| | | s_tagGSModelDict.Add(key, this);
|
| | | }
|
| | |
|
| | | public static EquipGSParamConfig GetGSModel(int lv, int color, int isSuit)
|
| | | public static EquipGSParamConfig GetGSModel(int lv, int color, int isSuit, int star)
|
| | | {
|
| | | string key = StringUtility.Contact(lv, color, isSuit);
|
| | | string key = StringUtility.Contact(lv, color, isSuit, star);
|
| | | EquipGSParamConfig gsModel = null;
|
| | | s_tagGSModelDict.TryGetValue(key, out gsModel);
|
| | | return gsModel;
|
| | | }
|
| | |
|
| | | public static Dictionary<PropertyType, int> GetTagGsProValueDict(int lv, int color, int isSuit)
|
| | | public static Dictionary<PropertyType, int> GetTagGsProValueDict(int lv, int color, int isSuit, int star)
|
| | | {
|
| | | _tagGsProValueDict.Clear();
|
| | | EquipGSParamConfig gsModel = GetGSModel(lv, color, isSuit);
|
| | | EquipGSParamConfig gsModel = GetGSModel(lv, color, isSuit , star);
|
| | | if (gsModel == null)
|
| | | return null;
|
| | |
|
| | |
| | | int _color = LuaAPI.xlua_tointeger(L, 2); |
| | | int _isSuit = LuaAPI.xlua_tointeger(L, 3); |
| | | |
| | | EquipGSParamConfig gen_ret = EquipGSParamConfig.GetGSModel( _lv, _color, _isSuit ); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | |
| | | |
| | |
| | | int _lv = LuaAPI.xlua_tointeger(L, 1); |
| | | int _color = LuaAPI.xlua_tointeger(L, 2); |
| | | int _isSuit = LuaAPI.xlua_tointeger(L, 3); |
| | | |
| | | System.Collections.Generic.Dictionary<PropertyType, int> gen_ret = EquipGSParamConfig.GetTagGsProValueDict( _lv, _color, _isSuit ); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | |
| | | |
| | |
| | | System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<int>> _useDataDic = (System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<int>>)translator.GetObject(L, 4, typeof(System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<int>>)); |
| | | bool _isPreview = LuaAPI.lua_toboolean(L, 5); |
| | | |
| | | int gen_ret = gen_to_be_invoked.GetEquipScore( _type, _itemId, _useDataDic, _isPreview ); |
| | | LuaAPI.xlua_pushinteger(L, gen_ret); |
| | | |
| | | |
| | | |
| | |
| | | int _itemId = LuaAPI.xlua_tointeger(L, 3); |
| | | System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<int>> _useDataDic = (System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<int>>)translator.GetObject(L, 4, typeof(System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<int>>)); |
| | | |
| | | int gen_ret = gen_to_be_invoked.GetEquipScore( _type, _itemId, _useDataDic ); |
| | | LuaAPI.xlua_pushinteger(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | |
| | | { |
| | | PackType _type;translator.Get(L, 2, out _type); |
| | | int _itemId = LuaAPI.xlua_tointeger(L, 3); |
| | | |
| | | int gen_ret = gen_to_be_invoked.GetEquipScore( _type, _itemId ); |
| | | LuaAPI.xlua_pushinteger(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | |
| | | isAuction = false, |
| | | isEquiped = false, |
| | | isPreview = true, |
| | | score = ItemLogicUtility.Instance.GetEquipScore(PackType.Item, itemId, null, true), |
| | | score = ItemLogicUtility.Instance.GetEquipScore(itemId, null, true), |
| | | auctionSurplusTime = 0, |
| | | levelLimit = config.UseLV, |
| | | realmLimit = config.RealmLimit, |
| | |
| | | |
| | | } |
| | | |
| | | public int GetEquipScore(PackType type, int itemId, Dictionary<int, List<int>> useDataDic = null, bool isPreview = false) |
| | | public int GetEquipScore(int itemId, Dictionary<int, List<int>> useDataDic = null, bool isPreview = false) |
| | | { |
| | | var config = ItemConfig.Get(itemId); |
| | | if (config.EquipPlace == 0)
|
| | |
| | | { |
| | | properties.AddBaseProperties(config.EffectValueA1, equipBaseProperties); |
| | | properties.AddCustomProperties(itemId); |
| | | return CalculateEquipScore(type, config.EffectValueA1, properties); |
| | | return CalculateEquipScore( config.EffectValueA1, properties); |
| | | } |
| | | |
| | | properties.AddBaseProperties(itemId, equipBaseProperties); |
| | |
| | | break; |
| | | } |
| | | |
| | | return CalculateEquipScore(type, itemId, properties); |
| | | return CalculateEquipScore( itemId, properties); |
| | | } |
| | | |
| | | if (useDataDic != null) |
| | |
| | | } |
| | | } |
| | | |
| | | return CalculateEquipScore(type, itemId, properties); |
| | | return CalculateEquipScore( itemId, properties); |
| | | } |
| | | |
| | | private Dictionary<int, int> GetEquipLegendProperties(int itemId) |
| | |
| | | /// <param name="itemId"></param> |
| | | /// <returns></returns> |
| | | private Dictionary<PropertyType, float> curEquipAttrDict = new Dictionary<PropertyType, float>(); //存储当前装备属性对应的数值 key 属性 value 属性值 |
| | | private int CalculateEquipScore(PackType type, int itemId, EquipSorceProperties properties) |
| | | private int CalculateEquipScore(int itemId, EquipSorceProperties properties) |
| | | { |
| | | var config = ItemConfig.Get(itemId); |
| | | if (config == null || !GeneralDefine.CompareEquipPlaces.Contains(config.EquipPlace)) |
| | |
| | | Equation.Instance.Clear(); |
| | | curEquipAttrDict.Clear(); |
| | | |
| | | var GSProValueDict = EquipGSParamConfig.GetTagGsProValueDict(config.LV, config.ItemColor, config.SuiteiD > 0 ? 1 : 0); |
| | | var GSProValueDict = EquipGSParamConfig.GetTagGsProValueDict(config.LV, config.ItemColor, config.SuiteiD > 0 ? 1 : 0 ,config.StarLevel); |
| | | foreach (var key in properties.Keys) |
| | | { |
| | | var attrType = (PropertyType)key; |
| | |
| | | } |
| | | } |
| | | |
| | | if (type == PackType.Deleted) |
| | | { |
| | | type = GeneralDefine.GetPackTypeByItemType(config.Type); |
| | | } |
| | | |
| | | var skillScore = 0; |
| | | if (config.AddSkill1 != 0 && equipSkillScores.ContainsKey(config.AddSkill1)) |
| | | { |
| | |
| | | spiritWeaponScore = SpiritWeaponConfig.Get(itemId).AttrScore;
|
| | | } |
| | | |
| | | switch (type) |
| | | { |
| | | case PackType.DogzEquip: |
| | | case PackType.DogzItem: |
| | | return Equation.Instance.Eval<int>(dogzGSFormula); |
| | | default: |
| | | return spiritWeaponScore + skillScore + Equation.Instance.Eval<int>(normalGSFormula); |
| | | if (IsDogzEquip(itemId))
|
| | | {
|
| | | return Equation.Instance.Eval<int>(dogzGSFormula);
|
| | | }
|
| | | else
|
| | | {
|
| | | return spiritWeaponScore + skillScore + Equation.Instance.Eval<int>(normalGSFormula);
|
| | | } |
| | | } |
| | | |
| | |
| | | }
|
| | | }
|
| | |
|
| | | this.score = ItemLogicUtility.Instance.GetEquipScore(packType, itemId, useDataDict, isAuction);
|
| | | this.score = ItemLogicUtility.Instance.GetEquipScore(itemId, useDataDict, isAuction);
|
| | | }
|
| | |
|
| | | public void RefreshCount(int count)
|
| | |
| | | this.useDataDic = useDataDic;
|
| | | this.packType = type;
|
| | |
|
| | | this.score = ItemLogicUtility.Instance.GetEquipScore(type, itemId, useDataDic, isPreview);
|
| | | this.score = ItemLogicUtility.Instance.GetEquipScore( itemId, useDataDic, isPreview);
|
| | | }
|
| | |
|
| | | public ItemCellModel(int itemId)
|
| | |
| | | this.useDataDic = null;
|
| | | this.packType = PackType.Deleted;
|
| | |
|
| | | this.score = ItemLogicUtility.Instance.GetEquipScore(PackType.Deleted, itemId, null, isPreview);
|
| | | this.score = ItemLogicUtility.Instance.GetEquipScore( itemId, null, isPreview);
|
| | | }
|
| | |
|
| | | int AdjustItemId(int itemId)
|
| | |
| | | starLevel = itemplus.Star,
|
| | | gems = gems,
|
| | | legendProperties = legendProperties,
|
| | | score = ItemLogicUtility.Instance.GetEquipScore(PackType.Item, itemId, useDataDict, true),
|
| | | score = ItemLogicUtility.Instance.GetEquipScore(itemId, useDataDict, true),
|
| | | gemHoleActiveStates = gemHoleActiveStates,
|
| | | suitLevels = suitLevels,
|
| | | suitPlaces = suitplaces,
|
| | |
| | | legendValues.Add(property.y); |
| | | } |
| | | |
| | | this.score = ItemLogicUtility.Instance.GetEquipScore(PackType.Item, itemId, userData); |
| | | this.score = ItemLogicUtility.Instance.GetEquipScore(itemId, userData); |
| | | } |
| | | |
| | | } |