| | |
| | | |
| | | |
| | | #region 属性 |
| | | |
| | | //激活时古宝是0星,基础属性只有和星级相关 |
| | | public Dictionary<int, long> GetBaseAttrByGBID(int gubaoID, bool isPreview = false) |
| | | { |
| | | Dictionary<int, long> attrDict = new Dictionary<int, long>(); |
| | |
| | | return attrDict; |
| | | } |
| | | |
| | | //单层的等级属性 |
| | | public float GetSpecLVAttrValueOneLayer(int quality, int lv, int specAttrID, int maxLV) |
| | | { |
| | | return GubaoLVAttrConfig.GetSpecLVAttrValue(quality, lv, specAttrID) * 1.0f / maxLV; |
| | | } |
| | | |
| | | |
| | | //获取特殊属性总属性值,激活时古宝是0星1级 |
| | | //特殊效果属性计算 = (取整)((初始值 + 每星成长 * 星级 + 品质等级总属性/总层级)* 特殊层) |
| | | public Dictionary<int, long> GetSpecialAttrByGBID(int gubaoID, bool isPreview = false) |
| | | { |
| | | Dictionary<int, long> attrDict = new Dictionary<int, long>(); |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | |
| | | if (config.SpecAttrID == 0) |
| | | { |
| | | //无属性 |
| | | return attrDict; |
| | | } |
| | | var gubaoInfo = TryGetGubaoInfo(gubaoID); |
| | | int star = 0; |
| | | int lv = 0; |
| | | int layer = 0; |
| | | int maxLayer = config.SpecEffType != 0 ? config.SpecEffLayerMax : 1; |
| | | int quality = config.GubaoQuality; |
| | | if (gubaoInfo == null) |
| | | { |
| | | if (isPreview) |
| | | { |
| | | //特殊属性激活属性 = 初始属性 + 1级的特殊属性 |
| | | attrDict[config.SpecAttrID] = config.SpecAttrValue + GubaoLVAttrConfig.GetSpecLVAttrValue(config.GubaoQuality, 1, config.SpecAttrID); |
| | | lv = 1; |
| | | layer = 1; |
| | | } |
| | | return attrDict; |
| | | else |
| | | { |
| | | lv = 0; |
| | | layer = 0; |
| | | } |
| | | } |
| | | |
| | | attrDict[config.SpecAttrID] = config.SpecAttrValue + config.SpecAttrPerStarAdd * gubaoInfo.GubaoStar |
| | | + GubaoLVAttrConfig.GetSpecLVAttrValue(gubaoInfo.Quality, gubaoInfo.GubaoLV, config.SpecAttrID); |
| | | |
| | | if (config.SpecEffType != 0) |
| | | { |
| | | //服务端记录 |
| | | attrDict[config.SpecAttrID] *= gubaoInfo.EffLayer; |
| | | } |
| | | |
| | | return attrDict; |
| | | } |
| | | |
| | | public Dictionary<int, long> GetSpecialMaxAttrByGBID(int gubaoID) |
| | | { |
| | | Dictionary<int, long> attrDict = new Dictionary<int, long>(); |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | int quality = config.GubaoQuality; |
| | | var maxStar = GubaoStarConfig.GetMaxStar(config.GubaoQuality); |
| | | var maxLV = GubaoLVAttrConfig.GetMaxLV(quality); |
| | | |
| | | |
| | | attrDict[config.SpecAttrID] = config.SpecAttrValue + config.SpecAttrPerStarAdd * maxStar |
| | | + GubaoLVAttrConfig.GetSpecLVAttrValue(quality, maxLV, config.SpecAttrID); |
| | | |
| | | if (config.SpecEffType != 0) |
| | | { |
| | | attrDict[config.SpecAttrID] *= config.SpecEffLayerMax; |
| | | } |
| | | |
| | | return attrDict; |
| | | } |
| | | |
| | | |
| | | //单层的属性,或者不需要层的 |
| | | public Dictionary<int, long> GetSpecialAttrSingleLayerByGBID(int gubaoID, int lv = 0, int star = 0) |
| | | { |
| | | Dictionary<int, long> attrDict = new Dictionary<int, long>(); |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | var gubaoInfo = TryGetGubaoInfo(gubaoID); |
| | | if (gubaoInfo == null) |
| | | { |
| | | //特殊属性激活属性 = 初始属性 + 1级的特殊属性 |
| | | attrDict[config.SpecAttrID] = config.SpecAttrValue + GubaoLVAttrConfig.GetSpecLVAttrValue(config.GubaoQuality, 1, config.SpecAttrID); |
| | | return attrDict; |
| | | } |
| | | |
| | | if (lv == 0) |
| | | { |
| | | lv = gubaoInfo.GubaoLV; |
| | | } |
| | | if (star == 0) |
| | | else |
| | | { |
| | | star = gubaoInfo.GubaoStar; |
| | | lv = gubaoInfo.GubaoLV; |
| | | layer = gubaoInfo.EffLayer; |
| | | } |
| | | |
| | | attrDict[config.SpecAttrID] = config.SpecAttrValue + config.SpecAttrPerStarAdd * star |
| | | + GubaoLVAttrConfig.GetSpecLVAttrValue(gubaoInfo.Quality, lv, config.SpecAttrID); |
| | | //特殊效果属性计算 = (取整)((初始值 + 每星成长 * 星级 + 品质等级总属性/总层级)* 特殊层) |
| | | attrDict[config.SpecAttrID] = (int)((config.SpecAttrValue + config.SpecAttrPerStarAdd * star + GetSpecLVAttrValueOneLayer(quality, lv, config.SpecAttrID, maxLayer)) * layer); |
| | | |
| | | return attrDict; |
| | | } |
| | | |
| | | //满星满级 单层 |
| | | public Dictionary<int, long> GetSpecialMaxAttrByGBID(int gubaoID, bool oneLayer = true) |
| | | { |
| | | Dictionary<int, long> attrDict = new Dictionary<int, long>(); |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | if (config.SpecAttrID == 0) |
| | | { |
| | | //无属性 |
| | | return attrDict; |
| | | } |
| | | |
| | | int quality = config.GubaoQuality; |
| | | int star = GubaoStarConfig.GetMaxStar(config.GubaoQuality); |
| | | int lv = GubaoLVAttrConfig.GetMaxLV(quality); |
| | | int maxLayer = config.SpecEffType != 0 ? config.SpecEffLayerMax : 1; |
| | | int layer = oneLayer ? 1 : maxLayer; |
| | | |
| | | attrDict[config.SpecAttrID] = (int)((config.SpecAttrValue + config.SpecAttrPerStarAdd * star + GetSpecLVAttrValueOneLayer(quality, lv, config.SpecAttrID, maxLayer)) * layer); |
| | | |
| | | return attrDict; |
| | | } |
| | | |
| | | |
| | | //单层的属性,或者不需要层的; 不需要层也就是总属性 |
| | | public Dictionary<int, long> GetSpecialAttrSingleLayerByGBID(int gubaoID, int thelv = 0, int thestar = 0) |
| | | { |
| | | Dictionary<int, long> attrDict = new Dictionary<int, long>(); |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | |
| | | if (config.SpecAttrID == 0) |
| | | { |
| | | //无属性 |
| | | return attrDict; |
| | | } |
| | | var gubaoInfo = TryGetGubaoInfo(gubaoID); |
| | | int star = thestar == 0 ? 0 : thestar; //如果没有数据默认 |
| | | int lv = thelv == 0 ? 1 : thelv; //如果没有数据默认 |
| | | int layer = 1; |
| | | int maxLayer = config.SpecEffType != 0 ? config.SpecEffLayerMax : 1; |
| | | int quality = config.GubaoQuality; |
| | | if (gubaoInfo != null) |
| | | { |
| | | if (thestar == 0) |
| | | { |
| | | star = gubaoInfo.GubaoStar; |
| | | } |
| | | if (thelv == 0) |
| | | { |
| | | lv = gubaoInfo.GubaoLV; |
| | | } |
| | | } |
| | | |
| | | //特殊效果属性计算 = (取整)((初始值 + 每星成长 * 星级 + 品质等级总属性/总层级)* 特殊层) |
| | | attrDict[config.SpecAttrID] = (int)((config.SpecAttrValue + config.SpecAttrPerStarAdd * star + GetSpecLVAttrValueOneLayer(quality, lv, config.SpecAttrID, maxLayer)) * layer); |
| | | |
| | | return attrDict; |
| | | } |