9895 子 【BT0.1】【主干】坐骑、灵宠、称号升星 / 【BT0.1】坐骑、灵宠、称号升星 - 坐骑升星, 并删除了很古老的坐骑升级消耗表
# Conflicts:
# Core/GameEngine/DataToCtl/PackageRegedit.cs
# System/Mount/MountWin.cs
3个文件已删除
11个文件已修改
6 文件已复制
7个文件已添加
3 文件已重命名
File was renamed from Core/GameEngine/Model/Config/HorseUpConfig.cs |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: Fish
|
| | | // [ Date ]: Wednesday, May 15, 2019
|
| | | // [ Date ]: 2023年10月22日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | using System.Threading;
|
| | | using System;
|
| | | using UnityEngine;
|
| | | using LitJson;
|
| | | using System.Linq;
|
| | |
|
| | |
|
| | | public partial class HorseUpConfig
|
| | | public partial class HorseStarUpConfig
|
| | | {
|
| | |
|
| | | public readonly int ID;
|
| | | public readonly int id;
|
| | | public readonly int HorseID;
|
| | | public readonly int LV;
|
| | | public readonly int NeedExp;
|
| | | public readonly int[] AttrType;
|
| | | public readonly int[] AttrValue;
|
| | | public readonly int[] SkillID;
|
| | | public readonly int NeedExpTotal;
|
| | | public readonly int HorseStar;
|
| | | public readonly List<int[]> StarUpNeedItemList;
|
| | | public readonly int[] StarAttrType;
|
| | | public readonly int[] StarAttrValue;
|
| | |
|
| | | public HorseUpConfig()
|
| | | public HorseStarUpConfig()
|
| | | {
|
| | | }
|
| | |
|
| | | public HorseUpConfig(string input)
|
| | | public HorseStarUpConfig(string input)
|
| | | {
|
| | | try
|
| | | {
|
| | | var tables = input.Split('\t');
|
| | |
|
| | | int.TryParse(tables[0],out ID); |
| | | int.TryParse(tables[0],out id); |
| | |
|
| | | int.TryParse(tables[1],out HorseID);
|
| | |
|
| | | int.TryParse(tables[2],out LV); |
| | | int.TryParse(tables[2],out HorseStar); |
| | |
|
| | | int.TryParse(tables[3],out NeedExp); |
| | | StarUpNeedItemList = JsonMapper.ToObject<int[][]>(tables[3]).ToList(); |
| | |
|
| | | string[] AttrTypeStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
|
| | | AttrType = new int[AttrTypeStringArray.Length];
|
| | | for (int i=0;i<AttrTypeStringArray.Length;i++)
|
| | | string[] StarAttrTypeStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | StarAttrType = new int[StarAttrTypeStringArray.Length]; |
| | | for (int i=0;i<StarAttrTypeStringArray.Length;i++) |
| | | {
|
| | | int.TryParse(AttrTypeStringArray[i],out AttrType[i]);
|
| | | int.TryParse(StarAttrTypeStringArray[i],out StarAttrType[i]); |
| | | }
|
| | |
|
| | | string[] AttrValueStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
|
| | | AttrValue = new int[AttrValueStringArray.Length];
|
| | | for (int i=0;i<AttrValueStringArray.Length;i++)
|
| | | string[] StarAttrValueStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | StarAttrValue = new int[StarAttrValueStringArray.Length]; |
| | | for (int i=0;i<StarAttrValueStringArray.Length;i++) |
| | | {
|
| | | int.TryParse(AttrValueStringArray[i],out AttrValue[i]);
|
| | | int.TryParse(StarAttrValueStringArray[i],out StarAttrValue[i]); |
| | | }
|
| | |
|
| | | string[] SkillIDStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
|
| | | SkillID = new int[SkillIDStringArray.Length];
|
| | | for (int i=0;i<SkillIDStringArray.Length;i++)
|
| | | {
|
| | | int.TryParse(SkillIDStringArray[i],out SkillID[i]);
|
| | | }
|
| | |
|
| | | int.TryParse(tables[7],out NeedExpTotal); |
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | static Dictionary<string, HorseUpConfig> configs = new Dictionary<string, HorseUpConfig>();
|
| | | public static HorseUpConfig Get(string id)
|
| | | static Dictionary<string, HorseStarUpConfig> configs = new Dictionary<string, HorseStarUpConfig>();
|
| | | public static HorseStarUpConfig Get(string id)
|
| | | {
|
| | | if (!inited)
|
| | | {
|
| | | Debug.Log("HorseUpConfig 还未完成初始化。");
|
| | | Debug.Log("HorseStarUpConfig 还未完成初始化。");
|
| | | return null;
|
| | | }
|
| | |
|
| | |
| | | return configs[id];
|
| | | }
|
| | |
|
| | | HorseUpConfig config = null;
|
| | | HorseStarUpConfig config = null;
|
| | | if (rawDatas.ContainsKey(id))
|
| | | {
|
| | | config = configs[id] = new HorseUpConfig(rawDatas[id]);
|
| | | config = configs[id] = new HorseStarUpConfig(rawDatas[id]);
|
| | | rawDatas.Remove(id);
|
| | | }
|
| | |
|
| | | return config;
|
| | | }
|
| | |
|
| | | public static HorseUpConfig Get(int id)
|
| | | public static HorseStarUpConfig Get(int id)
|
| | | {
|
| | | return Get(id.ToString());
|
| | | }
|
| | |
| | | return keys;
|
| | | }
|
| | |
|
| | | public static List<HorseUpConfig> GetValues()
|
| | | public static List<HorseStarUpConfig> GetValues()
|
| | | {
|
| | | var values = new List<HorseUpConfig>();
|
| | | var values = new List<HorseStarUpConfig>();
|
| | | values.AddRange(configs.Values);
|
| | |
|
| | | var keys = new List<string>(rawDatas.Keys);
|
| | | foreach (var key in keys)
|
| | | for (int i = 0; i < keys.Count; i++)
|
| | | {
|
| | | values.Add(Get(key));
|
| | | values.Add(Get(keys[i]));
|
| | | }
|
| | |
|
| | | return values;
|
| | |
| | | var path = string.Empty;
|
| | | if (AssetSource.refdataFromEditor)
|
| | | {
|
| | | path = ResourcesPath.CONFIG_FODLER +"/HorseUp.txt";
|
| | | path = ResourcesPath.CONFIG_FODLER +"/HorseStarUp.txt";
|
| | | }
|
| | | else
|
| | | {
|
| | | path = AssetVersionUtility.GetAssetFilePath("config/HorseUp.txt");
|
| | | path = AssetVersionUtility.GetAssetFilePath("config/HorseStarUp.txt");
|
| | | }
|
| | |
|
| | | configs.Clear();
|
| | | var tempConfig = new HorseUpConfig();
|
| | | var tempConfig = new HorseStarUpConfig();
|
| | | var preParse = tempConfig is IConfigPostProcess;
|
| | |
|
| | | if (sync)
|
| | |
| | |
|
| | | if (preParse)
|
| | | {
|
| | | var config = new HorseUpConfig(line);
|
| | | var config = new HorseStarUpConfig(line);
|
| | | configs[id] = config;
|
| | | (config as IConfigPostProcess).OnConfigParseCompleted();
|
| | | }
|
| | |
| | |
|
| | | if (preParse)
|
| | | {
|
| | | var config = new HorseUpConfig(line);
|
| | | var config = new HorseStarUpConfig(line);
|
| | | configs[id] = config;
|
| | | (config as IConfigPostProcess).OnConfigParseCompleted();
|
| | | }
|
copy from Core/GameEngine/Model/TelPartialConfig/tagHorseUpConfig.cs.meta
copy to Core/GameEngine/Model/Config/HorseStarUpConfig.cs.meta
File was copied from Core/GameEngine/Model/TelPartialConfig/tagHorseUpConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95567471ba5b9dd44b507afebe648e87 |
| | | timeCreated: 1502963061 |
| | | licenseType: Pro |
| | | guid: b16167c21e45f054a9629b81bdc6461e |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
New file |
| | |
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | |
|
| | | public partial class HorseStarUpConfig : IConfigPostProcess
|
| | | {
|
| | | public static Dictionary<int, List<int>> horseIDToIDs = new Dictionary<int, List<int>>(); //坐骑幻化升星
|
| | |
|
| | | public void OnConfigParseCompleted()
|
| | | {
|
| | | if (!horseIDToIDs.ContainsKey(HorseID))
|
| | | {
|
| | | horseIDToIDs.Add(HorseID, new List<int>());
|
| | | }
|
| | |
|
| | | horseIDToIDs[HorseID].Add(id);
|
| | | }
|
| | |
|
| | | public static List<int> GetIdsByHorseID(int horseID)
|
| | | {
|
| | | if (horseIDToIDs.ContainsKey(horseID))
|
| | | {
|
| | | return horseIDToIDs[horseID];
|
| | | }
|
| | |
|
| | | return null;
|
| | | }
|
| | |
|
| | | }
|
File was renamed from Core/GameEngine/Model/TelPartialConfig/tagHorseUpConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95567471ba5b9dd44b507afebe648e87 |
| | | timeCreated: 1502963061 |
| | | licenseType: Pro |
| | | guid: d237c2b8c0ed77642ad62ce20c50e052 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A5 35 坐骑升星 #tagCMHorseStarUp
|
| | |
|
| | | public class CA535_tagCMHorseStarUp : GameNetPackBasic {
|
| | | public uint HorseID; //坐骑ID,对应坐骑表ID
|
| | |
|
| | | public CA535_tagCMHorseStarUp () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xA535;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (HorseID, NetDataType.DWORD);
|
| | | }
|
| | |
|
| | | }
|
File was renamed from System/Mount/AutoTrainTipsWin.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 11720f48ce490cb4eb9282355be5f5ff |
| | | timeCreated: 1516001401 |
| | | licenseType: Free |
| | | guid: 73af8ddf1a5acbd43a3c7634c51d56ae |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A5 36 称号升星 #tagCMTitleStarUp
|
| | |
|
| | | public class CA536_tagCMTitleStarUp : GameNetPackBasic {
|
| | | public uint TitleID; //称号ID
|
| | |
|
| | | public CA536_tagCMTitleStarUp () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xA536;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (TitleID, NetDataType.DWORD);
|
| | | }
|
| | |
|
| | | }
|
copy from System/Mount/AutoTrainTipsWin.cs.meta
copy to Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA536_tagCMTitleStarUp.cs.meta
File was copied from System/Mount/AutoTrainTipsWin.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 11720f48ce490cb4eb9282355be5f5ff |
| | | timeCreated: 1516001401 |
| | | licenseType: Free |
| | | guid: 47bd2356f8f54de468961466c91b7996 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using Snxxz.UI;
|
| | |
|
| | | // A3 CD 坐骑星级信息 #tagMCHorseStarInfo
|
| | |
|
| | | public class DTCA3CD_tagMCHorseStarInfo : DtcBasic {
|
| | |
|
| | | MountModel mountModel { get { return ModelCenter.Instance.GetModel<MountModel>(); } }
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HA3CD_tagMCHorseStarInfo vNetData = vNetPack as HA3CD_tagMCHorseStarInfo;
|
| | | mountModel.UpdateHorseStarInfo(vNetData);
|
| | | }
|
| | | }
|
copy from System/Mount/AutoTrainTipsWin.cs.meta
copy to Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CD_tagMCHorseStarInfo.cs.meta
File was copied from System/Mount/AutoTrainTipsWin.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 11720f48ce490cb4eb9282355be5f5ff |
| | | timeCreated: 1516001401 |
| | | licenseType: Free |
| | | guid: cccbe4ed544541e4ab18164430e884e2 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A3 CE 称号星级信息 #tagMCTitleStarInfo
|
| | |
|
| | | public class DTCA3CE_tagMCTitleStarInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HA3CE_tagMCTitleStarInfo vNetData = vNetPack as HA3CE_tagMCTitleStarInfo;
|
| | | }
|
| | | }
|
copy from System/Mount/AutoTrainTipsWin.cs.meta
copy to Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CE_tagMCTitleStarInfo.cs.meta
File was copied from System/Mount/AutoTrainTipsWin.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 11720f48ce490cb4eb9282355be5f5ff |
| | | timeCreated: 1516001401 |
| | | licenseType: Free |
| | | guid: 57a249eb6099d224e87801e94dbdb655 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A3 CD 坐骑星级信息 #tagMCHorseStarInfo
|
| | |
|
| | | public class HA3CD_tagMCHorseStarInfo : GameNetPackBasic {
|
| | | public byte Count;
|
| | | public tagMCHorseStar[] HorseStarList;
|
| | |
|
| | | public HA3CD_tagMCHorseStarInfo () {
|
| | | _cmd = (ushort)0xA3CD;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Count, vBytes, NetDataType.BYTE);
|
| | | HorseStarList = new tagMCHorseStar[Count];
|
| | | for (int i = 0; i < Count; i ++) {
|
| | | HorseStarList[i] = new tagMCHorseStar();
|
| | | TransBytes (out HorseStarList[i].HorseID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out HorseStarList[i].Star, vBytes, NetDataType.BYTE);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagMCHorseStar {
|
| | | public uint HorseID; // 坐骑表ID
|
| | | public byte Star; // 星级
|
| | | }
|
| | |
|
| | | }
|
copy from System/Mount/AutoTrainTipsWin.cs.meta
copy to Core/NetworkPackage/ServerPack/HA3_Function/HA3CD_tagMCHorseStarInfo.cs.meta
File was copied from System/Mount/AutoTrainTipsWin.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 11720f48ce490cb4eb9282355be5f5ff |
| | | timeCreated: 1516001401 |
| | | licenseType: Free |
| | | guid: b9db0f104a0f45b4dac9f82736b83c51 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A3 CE 称号星级信息 #tagMCTitleStarInfo
|
| | |
|
| | | public class HA3CE_tagMCTitleStarInfo : GameNetPackBasic {
|
| | | public byte Count;
|
| | | public tagMCTitleStar[] TitleStarList;
|
| | |
|
| | | public HA3CE_tagMCTitleStarInfo () {
|
| | | _cmd = (ushort)0xA3CE;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Count, vBytes, NetDataType.BYTE);
|
| | | TitleStarList = new tagMCTitleStar[Count];
|
| | | for (int i = 0; i < Count; i ++) {
|
| | | TitleStarList[i] = new tagMCTitleStar();
|
| | | TransBytes (out TitleStarList[i].TitleID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out TitleStarList[i].Star, vBytes, NetDataType.BYTE);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagMCTitleStar {
|
| | | public uint TitleID; // 称号ID
|
| | | public byte Star; // 星级
|
| | | }
|
| | |
|
| | | }
|
copy from System/Mount/AutoTrainTipsWin.cs.meta
copy to Core/NetworkPackage/ServerPack/HA3_Function/HA3CE_tagMCTitleStarInfo.cs.meta
File was copied from System/Mount/AutoTrainTipsWin.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 11720f48ce490cb4eb9282355be5f5ff |
| | | timeCreated: 1516001401 |
| | | licenseType: Free |
| | | guid: 6d0589f4972dc7249a7c849972bc392a |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | |
| | | } |
| | | break; |
| | | case PetMountTipWin.ShowType.Mount: |
| | | var horseId = HorseConfig.GetItemUnLockHorse(itemId); |
| | | var horseUpConfigs = HorseUpConfig.GetMountlistById(horseId); |
| | | foreach (var config in horseUpConfigs) |
| | | { |
| | | foreach (var skill in config.SkillID) |
| | | { |
| | | if (skill > 0) |
| | | { |
| | | skillInfos.Add(new SkillInfo() { skillId = skill, unlockLevel = config.LV }); |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | m_Scroll.OnRefreshCell -= OnRefreshCell; |
| | |
| | | {
|
| | | unlockMountDict.Add(horselist[i].UnlockItemID, horselist[i]);
|
| | | }
|
| | | Dictionary<int, List<int>> skillDict = new Dictionary<int, List<int>>();
|
| | | List<HorseUpConfig> mountlist = HorseUpConfig.GetMountlistById(horselist[i].HorseID);
|
| | | if (mountlist != null)
|
| | | {
|
| | | for (int j = 0; j < mountlist.Count; j++)
|
| | | {
|
| | | int[] skills = mountlist[j].SkillID;
|
| | | List<int> skilllist = new List<int>();
|
| | | if (skills != null)
|
| | | {
|
| | | for (int k = 0; k < skills.Length; k++)
|
| | | {
|
| | | if (skills[k] != 0)
|
| | | {
|
| | | skilllist.Add(skills[k]);
|
| | | skillDict.Add(mountlist[j].LV, skilllist);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | |
| | | Dictionary<SkillEffectGroup, List<int>> integrationHorseSkills = new Dictionary<SkillEffectGroup, List<int>>(); |
| | | Dictionary<int, SkillEffectGroup> horseSkillEffectValues = new Dictionary<int, SkillEffectGroup>(); |
| | | Dictionary<int, int> horseSkills = new Dictionary<int, int>(); |
| | | public Dictionary<int, int> horseStarDict = new Dictionary<int, int>(); //坐骑幻化升星 |
| | | |
| | | Dictionary<int, int> unLockSkinItems = new Dictionary<int, int>(); |
| | | |
| | |
| | | HorseRidingBool = false; |
| | | Wait = true; |
| | | MountHA301MorePack = false; |
| | | horseStarDict.Clear(); |
| | | } |
| | | |
| | | public void OnPlayerLoginOk() |
| | |
| | | } |
| | | |
| | | List<HorseConfig> Hconfigs = new List<HorseConfig>(); |
| | | List<HorseUpConfig> Uconfigs = new List<HorseUpConfig>(); |
| | | |
| | | public int RedPoint_HuaxingID = MainRedDot.RedPoint_MountPackKey * 10; //化形红点 |
| | | int RedPoint_DanID = MainRedDot.RedPoint_MountPackKey * 10 + 1; //可用坐骑丹红点 |
| | |
| | | } |
| | | |
| | | } |
| | | private void MountChangeRedPoint()//坐骑激活红点 |
| | | { |
| | | return; |
| | | //foreach (var key in DeblockingRedPoint.Keys) |
| | | //{ |
| | | // DeblockingRedPoint[key].state = RedPointState.None; |
| | | //} |
| | | //if (!FuncOpen.Instance.IsFuncOpen(8)) |
| | | //{ |
| | | // return; |
| | | //} |
| | | //if (Hconfigs.Count <= 0) |
| | | //{ |
| | | // Hconfigs = HorseConfig.GetValues(); |
| | | //} |
| | | //// var configs = HorseConfig.GetValues(); |
| | | //foreach (var config in Hconfigs) |
| | | //{ |
| | | // int unlockItemID = config.UnlockItemID; |
| | | // int itemCount = playerPack.GetItemCountByID(PackType.Item, unlockItemID); |
| | | // int unlockItemCnt = config.UnlockItemCnt; |
| | | // if (itemCount >= unlockItemCnt && !_DicHorse.ContainsKey(config.HorseID)) |
| | | // { |
| | | // DeblockingRedPoint[config.HorseID].state = RedPointState.Simple; |
| | | // } |
| | | //} |
| | | } |
| | | |
| | | //void MountSkillAndItem()//获取坐骑技能 |
| | | //{ |
| | | // if (GetMountSkillAndItem.Count != 0) |
| | | // return; |
| | | // if (Uconfigs.Count <= 0) |
| | | // { |
| | | // Uconfigs = HorseUpConfig.GetValues(); |
| | | // } |
| | | // //var configs = HorseUpConfig.GetValues(); |
| | | // foreach (var config in Uconfigs) |
| | | // { |
| | | // if (!HorseConfig.Has(config.HorseID)) |
| | | // { |
| | | // continue; |
| | | // } |
| | | |
| | | // for (int i = 0; i < config.SkillID.Length; i++) |
| | | // { |
| | | // int skillID = config.SkillID[i]; |
| | | // if (skillID != 0 && !GetMountSkillAndItem.ContainsKey(skillID)) |
| | | // { |
| | | // SkillConfig _skillModel = SkillConfig.Get(skillID); |
| | | // if (_skillModel == null) |
| | | // { |
| | | // Debug.Log(skillID); |
| | | // } |
| | | |
| | | // HorseSkillClass horseSkillClass = new HorseSkillClass(); |
| | | // horseSkillClass.SkillID = skillID; |
| | | // horseSkillClass.SkillItem = _skillModel.ExAttr4; |
| | | // horseSkillClass.HorseID = config.HorseID; |
| | | // horseSkillClass.HorseLV = config.LV; |
| | | // GetMountSkillAndItem.Add(skillID, horseSkillClass); |
| | | // } |
| | | // } |
| | | // } |
| | | //} |
| | | //private const int Redpoint_key1 = 1050101; |
| | | //public Redpoint redPointStre1 = new Redpoint(MainRedDot.RedPoint_MountPackKey, Redpoint_key1);//坐骑外观 |
| | | private const int Redpoint_key2 = MainRedDot.RedPoint_MountPackKey * 10 + 2; |
| | | public Redpoint redPointStre2 = new Redpoint(MainRedDot.RedPoint_MountPackKey, Redpoint_key2);//坐骑兽魂 |
| | | |
| | |
| | | { |
| | | DeblockingRedPoint[activeID].state = RedPointState.Simple; |
| | | } |
| | | else
|
| | | { |
| | | RefreshStarRedpoint(id); |
| | | } |
| | | |
| | | } |
| | | ForsterHorseRed(id); |
| | | |
| | |
| | | { |
| | | DeblockingRedPoint[activeID].state = RedPointState.Simple; |
| | | } |
| | | else |
| | | {
|
| | | RefreshStarRedpoint(id);
|
| | | } |
| | | } |
| | | ForsterHorseRed(id); |
| | | |
| | | } |
| | | } |
| | | |
| | | //升星和解锁共用红点 |
| | | void RefreshStarRedpoint(int itemID)
|
| | | {
|
| | | int activeID = unLockSkinItems[itemID];
|
| | | int horseID = HorseConfig.GetItemUnLockHorse(itemID);
|
| | | if (!HorseStarUpConfig.horseIDToIDs.ContainsKey(horseID)) |
| | | return; |
| | | if (!isMountSkinActive(horseID))
|
| | | return;
|
| | |
|
| | | DeblockingRedPoint[activeID].state = RedPointState.None;
|
| | |
|
| | | int star = 0;
|
| | | horseStarDict.TryGetValue(horseID, out star);
|
| | | //满星
|
| | | if (star == HorseStarUpConfig.horseIDToIDs[horseID].Count)
|
| | | return;
|
| | |
|
| | | var id = HorseStarUpConfig.horseIDToIDs[horseID][star];
|
| | | var nextStarConfig = HorseStarUpConfig.Get(id);
|
| | | List<int[]> awards = nextStarConfig.StarUpNeedItemList;
|
| | | for (int i = 0; i < awards.Count; i++)
|
| | | { |
| | | if (playerPack.GetItemCountByID(PackType.Item, awards[i][0]) < awards[i][1]) |
| | | return; |
| | | } |
| | | DeblockingRedPoint[activeID].state = RedPointState.Simple; |
| | | } |
| | | |
| | | //private void OnFuncStateChangeEvent(int funcId) |
| | |
| | | } |
| | | |
| | | } |
| | | private void MountStoneRed()//坐骑魂石红点 |
| | | public void MountStoneRed()//坐骑魂石红点 |
| | | { |
| | | redPointStre2.state = RedPointState.None; |
| | | if (!FuncOpen.Instance.IsFuncOpen(8)) |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | private int GetRedPointMountID(List<int> MountList) |
| | | { |
| | | int GetSkillMinLv = 999; |
| | | for (int i = 0; i < MountList.Count; i++) |
| | | { |
| | | int SkillminLv = GetSkillLvDis(MountList[i]); |
| | | if (SkillminLv < GetSkillMinLv && SkillminLv != 0) |
| | | { |
| | | GetSkillMinLv = SkillminLv; |
| | | } |
| | | } |
| | | |
| | | int mountId = 0; |
| | | int ExpNumber = 999999999; |
| | | for (int i = 0; i < MountList.Count; i++) |
| | | { |
| | | int SkillLv = GetSkillLvDis(MountList[i]); |
| | | if (SkillLv > GetSkillMinLv || SkillLv == 0) |
| | | { |
| | | continue; |
| | | } |
| | | var Hor1 = HorseUpConfig.GetHorseIDAndLV(MountList[i], SkillLv); |
| | | var Hor2 = HorseUpConfig.GetHorseIDAndLV(MountList[i], _DicHorse[(MountList[i])].Lv); |
| | | int Exp = Hor1.NeedExpTotal - Hor2.NeedExpTotal - _DicHorse[(MountList[i])].Exp; |
| | | if (Exp < ExpNumber) |
| | | { |
| | | ExpNumber = Exp; |
| | | mountId = MountList[i]; |
| | | } |
| | | } |
| | | return mountId; |
| | | } |
| | | |
| | | private int GetSkillLvDis(int MountId)//获取离升级最近的技能等级 |
| | | { |
| | |
| | | else |
| | | { |
| | | int _AttT = 0;//攻击 |
| | | foreach (int key in _DicHorse.Keys) |
| | | { |
| | | HorseUpConfig tagMode = HorseUpConfig.GetHorseIDAndLV(key, _DicHorse[key].Lv); |
| | | int[] intAttrValue = tagMode.AttrValue; |
| | | if (intAttrValue.Length != 0) |
| | | { |
| | | _AttT += intAttrValue[1]; |
| | | } |
| | | } |
| | | |
| | | return _AttT + dicStone[7]; |
| | | } |
| | | } |
| | |
| | | RankHorseIDList.Add(horseConfig.HorseID); |
| | | } |
| | | } |
| | | |
| | | //坐骑幻化升星 |
| | | public void UpdateHorseStarInfo(HA3CD_tagMCHorseStarInfo netPack)
|
| | | { |
| | | for (int i = 0; i < netPack.HorseStarList.Length; i++)
|
| | | { |
| | | horseStarDict[(int)netPack.HorseStarList[i].HorseID] = netPack.HorseStarList[i].Star; |
| | | } |
| | | onMountSkinActive?.Invoke();
|
| | |
|
| | | foreach (var id in unLockSkinItems.Keys)
|
| | | {
|
| | | RefreshStarRedpoint(id);
|
| | | } |
| | | } |
| | | |
| | | //坐骑幻化物品是否可用于觉醒 |
| | | public bool IsHorseSkinCanAwake(int horseID)
|
| | | { |
| | | if (!isMountSkinActive(horseID))
|
| | | { |
| | | return false; |
| | | }
|
| | |
|
| | | if (!HorseStarUpConfig.horseIDToIDs.ContainsKey(horseID)) |
| | | return true; |
| | |
|
| | | int star = 0;
|
| | | horseStarDict.TryGetValue(horseID, out star);
|
| | | //满星
|
| | | if (star != HorseStarUpConfig.horseIDToIDs[horseID].Count)
|
| | | return false; |
| | | |
| | | return true; |
| | | } |
| | | } |
| | |
| | | // [ Date ]: Friday, January 05, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using LitJson;
|
| | | using Snxxz.UI; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | |
| | | using System.Linq;
|
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | //坐骑面板 |
| | |
| | | [SerializeField] Text MountItemName; |
| | | [SerializeField] List<Text> AttrNameList; |
| | | [SerializeField] List<Text> AttrValueList; |
| | |
|
| | | [SerializeField] Transform starUpObj;
|
| | | [SerializeField] List<Transform> starsObj;
|
| | | [SerializeField] List<ItemCell> itemCells;
|
| | | [SerializeField] ButtonEx starUpBtn;
|
| | | [SerializeField] Transform maxObj;
|
| | | [SerializeField] UIEffect starEffect;
|
| | | |
| | | List<Int3> sortMountlist = new List<Int3>();//坐骑顺序排列 |
| | | public int signHorseID = 0;//用来标记坐骑ID |
| | |
| | | { |
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见 |
| | | RefreshMountSkinPanel(); |
| | | if (mountModel.horseStarDict.ContainsKey(signHorseID) && mountModel.horseStarDict[signHorseID] > 0)
|
| | | {
|
| | | starEffect.Play();
|
| | | }
|
| | | else
|
| | | { |
| | | ridingAndPetActivationModel.RidingAndPetActivationSet(RidingAndPetActivation.MountActivation, signHorseID); |
| | | }
|
| | | sortMountlist.Clear(); |
| | | ToAddSorting(); |
| | | } |
| | |
| | | selectThemount.MountNameTxt.text = horseConfig.Name; |
| | | selectThemount.MountLvActivation.SetActive(!mountModel.isMountSkinActive(horseID)); |
| | | |
| | | int star = 0;
|
| | | mountModel.horseStarDict.TryGetValue(horseID, out star);
|
| | | for (int i = 0; i < selectThemount.starsImg.Count; i++)
|
| | | {
|
| | | selectThemount.starsImg[i].SetActive(i < star);
|
| | | }
|
| | |
|
| | | if (horseID == signHorseID) |
| | | { |
| | | selectThemount.ChoosenImg.SetActive(true); |
| | |
| | | { |
| | | m_RideBtton.SetActive(false); |
| | | } |
| | | if (HorseStarUpConfig.horseIDToIDs.ContainsKey(signHorseID))
|
| | | {
|
| | | starUpObj.SetActive(true);
|
| | | int star = 0;
|
| | | mountModel.horseStarDict.TryGetValue(signHorseID, out star);
|
| | | int maxStar = HorseStarUpConfig.horseIDToIDs[signHorseID].Count;
|
| | | for (int i = 0; i < starsObj.Count; i++)
|
| | | {
|
| | | if (i < maxStar)
|
| | | {
|
| | | starsObj[i].SetActive(true);
|
| | | starsObj[i].FindComponent("Image", "Img_Star_True").SetActive(i < star);
|
| | | }
|
| | | else
|
| | | {
|
| | | starsObj[i].SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | List<int[]> awards = new List<int[]>();
|
| | | if (star != maxStar)
|
| | | { |
| | | var id = HorseStarUpConfig.horseIDToIDs[signHorseID][star];
|
| | | var nextStarConfig = HorseStarUpConfig.Get(id);
|
| | | awards = nextStarConfig.StarUpNeedItemList;
|
| | | }
|
| | |
|
| | | for (int i = 0; i < itemCells.Count; i++)
|
| | | {
|
| | | if (i < awards.Count)
|
| | | {
|
| | | itemCells[i].SetActive(true);
|
| | | int itemID = awards[i][0];
|
| | | int needCnt = awards[i][1];
|
| | | int hasCnt = playerPack.GetItemCountByID(PackType.Item, itemID);
|
| | | itemCells[i].Init(new ItemCellModel(itemID, false, 1));
|
| | | itemCells[i].button.AddListener(() =>
|
| | | {
|
| | | ItemTipUtility.Show(itemID);
|
| | | });
|
| | |
|
| | | var cntTxt = itemCells[i].FindComponent("Text", "count") as Text;
|
| | | if (hasCnt >= needCnt)
|
| | | {
|
| | | cntTxt.text = UIHelper.AppendColor(TextColType.Green, hasCnt.ToString()) + "/" + needCnt.ToString();
|
| | | }
|
| | | else
|
| | | {
|
| | | cntTxt.text = UIHelper.AppendColor(TextColType.Red, hasCnt.ToString()) + "/" + needCnt.ToString();
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | itemCells[i].SetActive(false);
|
| | | }
|
| | | }
|
| | | starUpBtn.SetActive(star != maxStar);
|
| | | maxObj.SetActive(star == maxStar);
|
| | | starUpBtn.AddListener(() =>
|
| | | {
|
| | | if (star < maxStar)
|
| | | starsObj[star].GetComponent<UIEffect>().Play();
|
| | | CA535_tagCMHorseStarUp pak = new CA535_tagCMHorseStarUp();
|
| | | pak.HorseID = (uint)signHorseID;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | starUpObj.SetActive(false);
|
| | | }
|
| | | |
| | | return; |
| | | } |
| | |
| | | |
| | | m_DeblockingBtton.SetActive(true); |
| | | m_RideBtton.SetActive(false); |
| | | starUpObj.SetActive(false);
|
| | | } |
| | | |
| | | private void ShowAttrText() |
| | |
| | | showIndex++; |
| | | } |
| | | |
| | | int star = 0;
|
| | | mountModel.horseStarDict.TryGetValue(signHorseID, out star);
|
| | | Dictionary<int, int> addAttr = new Dictionary<int, int>();
|
| | | if (HorseStarUpConfig.horseIDToIDs.ContainsKey(signHorseID))
|
| | | {
|
| | | int[] starTypeArr = new int[] { };
|
| | | int[] starValueArr = new int[] { };
|
| | | if (star > 0)
|
| | | { |
| | | var id = HorseStarUpConfig.horseIDToIDs[signHorseID][star - 1];
|
| | | var starConfig = HorseStarUpConfig.Get(id);
|
| | | showIndex = 0;
|
| | | starTypeArr = starConfig.StarAttrType;
|
| | | starValueArr = starConfig.StarAttrValue;
|
| | | foreach (var attrID in starTypeArr)
|
| | | {
|
| | | if (allAttr.ContainsKey(attrID))
|
| | | {
|
| | | allAttr[attrID] = allAttr[attrID] + starValueArr[showIndex];
|
| | | }
|
| | | else
|
| | | { |
| | | allAttr[attrID] = starValueArr[showIndex];
|
| | | }
|
| | | showIndex++;
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | if (star < HorseStarUpConfig.horseIDToIDs[signHorseID].Count)
|
| | | {
|
| | | var id = HorseStarUpConfig.horseIDToIDs[signHorseID][star];
|
| | | var nextStarConfig = HorseStarUpConfig.Get(id);
|
| | | for (int i = 0; i < nextStarConfig.StarAttrType.Length; i++)
|
| | | {
|
| | | if (!allAttr.ContainsKey(nextStarConfig.StarAttrType[i]))
|
| | | {
|
| | | //预览用
|
| | | allAttr[nextStarConfig.StarAttrType[i]] = 0;
|
| | | }
|
| | | if (Array.IndexOf(starTypeArr, nextStarConfig.StarAttrType[i]) >= 0)
|
| | | {
|
| | | addAttr[nextStarConfig.StarAttrType[i]] = nextStarConfig.StarAttrValue[i] - starValueArr[i];
|
| | | }
|
| | | else
|
| | | {
|
| | | addAttr[nextStarConfig.StarAttrType[i]] = nextStarConfig.StarAttrValue[i];
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | showIndex = 0;
|
| | | foreach (var attrID in allAttr.Keys)
|
| | | {
|
| | | AttrNameList[showIndex].text = PlayerPropertyConfig.Get(attrID).ShowName;
|
| | | if (addAttr.ContainsKey(attrID))
|
| | | {
|
| | | AttrValueList[showIndex].text = PlayerPropertyConfig.GetValueDescription(attrID, allAttr[attrID]) + UIHelper.AppendColor(TextColType.Green, string.Format(" +{0}", PlayerPropertyConfig.GetValueDescription(attrID, addAttr[attrID])));
|
| | | }
|
| | | else
|
| | | { |
| | | AttrValueList[showIndex].text = PlayerPropertyConfig.GetValueDescription(attrID, allAttr[attrID]);
|
| | | }
|
| | | showIndex++;
|
| | | }
|
| | |
|
| | | m_FightPower.text = (UIHelper.GetFightPower(allAttr) + config.InitFightPower).ToString(); |
| | | } |
| | | |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using UnityEngine.UI;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | namespace Snxxz.UI {
|
| | |
|
| | |
| | | get { return m_QualityTxt1; }
|
| | | set { m_QualityTxt1 = value; }
|
| | | }
|
| | |
|
| | | [SerializeField] List<Image> m_starsImg;//星级
|
| | | public List<Image> starsImg
|
| | | {
|
| | | get { return m_starsImg; }
|
| | | set { starsImg = value; }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | private Dictionary<int, float> GetMountProperty(int mountID, int ValueKey, int Value)
|
| | | {
|
| | | Dictionary<int, float> DicSkill = new Dictionary<int, float>();
|
| | | DicSkill.Add(6, 0f);
|
| | | DicSkill.Add(7, 0f);
|
| | | if (mountModel._DicHorse.ContainsKey(mountID))
|
| | | {
|
| | | HorseUpConfig tagMode = HorseUpConfig.GetHorseIDAndLV(mountID, mountModel._DicHorse[mountID].Lv);
|
| | | int[] attrType = tagMode.AttrType;
|
| | | int[] attrValue = tagMode.AttrValue;
|
| | | for (int i = 0; i < attrType.Length; i++)
|
| | | {
|
| | | if (attrType[i] == ValueKey && DicSkill.ContainsKey(ValueKey))
|
| | | {
|
| | | DicSkill[ValueKey] = (float)attrValue[i] * ((float)Value / 10000);
|
| | | }
|
| | | }
|
| | | return DicSkill;
|
| | | }
|
| | | return DicSkill;
|
| | | }
|
| | | public Dictionary<int, float> GetOneMountProperty(int MountID)//获取单只坐骑的技能属性加成
|
| | |
| | | private Dictionary<int, float> GetMountPropertyQuality(int Quality, int ValueKey, int Value)
|
| | | {
|
| | | Dictionary<int, float> DicSkill = new Dictionary<int, float>();
|
| | | DicSkill.Add(6, 0f);
|
| | | DicSkill.Add(7, 0f);
|
| | | if (mountModel._DicHorse.Count > 0)
|
| | | {
|
| | | foreach (var key in mountModel._DicHorse.Keys)
|
| | | {
|
| | | HorseConfig horseConfig = HorseConfig.Get(key);
|
| | | if (horseConfig.Quality == Quality)
|
| | | {
|
| | | HorseUpConfig tagMode = HorseUpConfig.GetHorseIDAndLV(key, mountModel._DicHorse[key].Lv);
|
| | | int[] attrType = tagMode.AttrType;
|
| | | int[] attrValue =tagMode.AttrValue;
|
| | | for (int i = 0; i < attrType.Length; i++)
|
| | | {
|
| | | if (attrType[i] == ValueKey && DicSkill.ContainsKey(ValueKey))
|
| | | {
|
| | | DicSkill[ValueKey] += (float)attrValue[i] * ((float)Value / 10000);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | return DicSkill;
|
| | | }
|
| | |
|
| | | return DicSkill;
|
| | | }
|
| | | public Dictionary<int, float> GetOneMountPropertyQuality(int MountID)//根据品质获取单只坐骑的技能属性加成
|
| | |
| | | switch (propertyTip)
|
| | | {
|
| | | case PropertyTip.Mount:
|
| | | CurMountAttrCtrl(Id);
|
| | | break;
|
| | | case PropertyTip.Pet:
|
| | | CurPetAttrCtrl();
|
| | |
| | | }
|
| | | _scoreNumAll1 = Mathf.FloorToInt(_tagPetClassNext.AtkAdd * 2.5f) + _scoreNum1;
|
| | | curPetAttackText1.text = _scoreNumAll1.ToString();
|
| | | }
|
| | | }
|
| | | List<HorseSkillClass> MountSkills = new List<HorseSkillClass>();
|
| | | private void CurMountAttrCtrl(int ID)
|
| | | {
|
| | | MountSkills.Clear();
|
| | | foreach (var key in mountModel.GetMountSkillAndItem.Keys)
|
| | | {
|
| | | if (mountModel.GetMountSkillAndItem[key].HorseID == ID)
|
| | | {
|
| | | MountSkills.Add(mountModel.GetMountSkillAndItem[key]);
|
| | | }
|
| | | }
|
| | | NowAttTipPet1.SetActive(false);
|
| | | NowAttTipPet.SetActive(false);
|
| | | NowAttTipMount.SetActive(true);
|
| | | NowAttTipMount1.SetActive(true);
|
| | | HorseConfig horseconfig = HorseConfig.Get(ID);
|
| | | HorseUpConfig horseUpconfig = HorseUpConfig.GetHorseIDAndLV(ID, mountModel._DicHorse[ID].Lv);
|
| | | m_Property_Text.text = Language.Get("MountAttributes_Z");
|
| | | m_LVtextP.text = mountModel._DicHorse[ID].Lv + Language.Get("Z1041");
|
| | | int[] strAttrValue = horseUpconfig.AttrValue;
|
| | | Dictionary<int, int> AddPowerDic = new Dictionary<int, int>();
|
| | | AddPowerDic.Clear();
|
| | | if (strAttrValue.Length != 0)
|
| | | {
|
| | | curMountLifeText.text = strAttrValue[0].ToString();//生命
|
| | | curMountAttackText.text = strAttrValue[1].ToString();//攻击
|
| | | curMountSpeedText.text = strAttrValue[2].ToString();//速度
|
| | | AddPowerDic.Add(6, strAttrValue[0]);
|
| | | AddPowerDic.Add(7, strAttrValue[1]);
|
| | | }
|
| | | int _scoreNum = 0;
|
| | | int _scoreNumAll = 0;
|
| | | for (int i = 0; i < MountSkills.Count; i++)
|
| | | {
|
| | | if (mountModel._DicHorse[ID].Lv >= MountSkills[i].HorseLV)
|
| | | {
|
| | | SkillConfig skillconfig = SkillConfig.Get(MountSkills[i].SkillID);
|
| | | if (skillconfig != null)
|
| | | {
|
| | | _scoreNum += skillconfig.FightPower;
|
| | | }
|
| | | }
|
| | | }
|
| | | _scoreNumAll = UIHelper.GetFightPower(AddPowerDic) + _scoreNum;
|
| | | curMountFightingText.text = _scoreNumAll.ToString();
|
| | | if (mountModel._DicHorse[ID].Lv >= horseconfig.MaxLV)
|
| | | {
|
| | | m_LVtextP1.transform.parent.SetActive(false);
|
| | | curMountFightingText1.transform.parent.SetActive(false);
|
| | | curMountLifeText1.transform.parent.SetActive(false);
|
| | | curMountAttackText1.transform.parent.SetActive(false);
|
| | | curMountSpeedText1.transform.parent.SetActive(false);
|
| | | m_ManJiImage.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_ManJiImage.SetActive(false);
|
| | | m_LVtextP1.transform.parent.SetActive(true);
|
| | | curMountFightingText1.transform.parent.SetActive(true);
|
| | | curMountLifeText1.transform.parent.SetActive(true);
|
| | | curMountAttackText1.transform.parent.SetActive(true);
|
| | | curMountSpeedText1.transform.parent.SetActive(true);
|
| | | m_LVtextP1.text = (mountModel._DicHorse[ID].Lv+1) + Language.Get("Z1041");
|
| | | HorseUpConfig horseUpconfigNext = HorseUpConfig.GetHorseIDAndLV(ID, mountModel._DicHorse[ID].Lv + 1);
|
| | | int[] strAttrValueNext = horseUpconfigNext.AttrValue;
|
| | | Dictionary<int, int> AddPowerDic1 = new Dictionary<int, int>();
|
| | | AddPowerDic1.Clear();
|
| | | if (strAttrValueNext.Length != 0)
|
| | | {
|
| | | curMountLifeText1.text = strAttrValueNext[0].ToString();//生命
|
| | | curMountAttackText1.text = strAttrValueNext[1].ToString();//攻击
|
| | | curMountSpeedText1.text = strAttrValueNext[2].ToString();//速度
|
| | | AddPowerDic1.Add(6, strAttrValueNext[0]);
|
| | | AddPowerDic1.Add(7, strAttrValueNext[1]);
|
| | | }
|
| | | int _scoreNum1 = 0;
|
| | | int _scoreNumAll1 = 0;
|
| | | for (int i = 0; i < MountSkills.Count; i++)
|
| | | {
|
| | | if (mountModel._DicHorse[ID].Lv+1 >= MountSkills[i].HorseLV)
|
| | | {
|
| | | SkillConfig skillconfig = SkillConfig.Get(MountSkills[i].SkillID);
|
| | | if (skillconfig != null)
|
| | | {
|
| | | _scoreNum1 += skillconfig.FightPower;
|
| | | }
|
| | | }
|
| | | }
|
| | | _scoreNumAll1 = UIHelper.GetFightPower(AddPowerDic1) + _scoreNum1;
|
| | | curMountFightingText1.text = _scoreNumAll1.ToString();//战斗力
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | public int GetHorseFightPower(int _id, int lv)
|
| | | {
|
| | | var fightPower = GetHorseSkillFightPower(_id, lv);
|
| | | var horseUpConfig = HorseUpConfig.GetHorseIDAndLV(_id, lv);
|
| | | if (horseUpConfig == null)
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | Dictionary<int, int> dict = new Dictionary<int, int>();
|
| | | int[] propertys = horseUpConfig.AttrType;
|
| | | int[] values = horseUpConfig.AttrValue;
|
| | | for (int i = 0; i < propertys.Length; i++)
|
| | | {
|
| | | if (propertys[i] == (int)PropertyType.ATK || propertys[i] == (int)PropertyType.HP)
|
| | | {
|
| | | if (!dict.ContainsKey(propertys[i]))
|
| | | {
|
| | | dict.Add(propertys[i], values[i]);
|
| | | }
|
| | | else
|
| | | {
|
| | | dict[propertys[i]] += values[i];
|
| | | }
|
| | | }
|
| | | }
|
| | | fightPower += UIHelper.GetFightPower(dict);
|
| | | var config = HorseConfig.Get(_id);
|
| | | fightPower += config.InitFightPower;
|
| | | |
| | | return fightPower;
|
| | | }
|
| | |
|
| | | public int GetHorseSkillFightPower(int _id, int lv)
|
| | | {
|
| | | var fightPower = 0;
|
| | | HorseUpConfig.GetHorseSkills(_id, lv, true, ref skills);
|
| | | for (int i = 0; i < skills.Count; i++)
|
| | | {
|
| | | Dictionary<int, int> dict1 = null;
|
| | | Dictionary<int, int> dict2 = null;
|
| | | var skillConfig = SkillConfig.Get(skills[i]);
|
| | | if (skillConfig == null)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | if (skillConfig.Effect1 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
|
| | | || skillConfig.Effect1 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
|
| | | {
|
| | | bool single = skillConfig.Effect1 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
|
| | | Dictionary<int, int> dict = single ? dict1 : dict2;
|
| | | dict = GetHorseSkillProperty(skillConfig.EffectValue11, skillConfig.EffectValue12, skillConfig.EffectValue13, single);
|
| | | }
|
| | | if (skillConfig.Effect2 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
|
| | | || skillConfig.Effect2 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
|
| | | {
|
| | | bool single = skillConfig.Effect2 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
|
| | | Dictionary<int, int> dict = single ? dict1 : dict2;
|
| | | dict = GetHorseSkillProperty(skillConfig.EffectValue21, skillConfig.EffectValue22, skillConfig.EffectValue23, single);
|
| | | }
|
| | | if (skillConfig.Effect3 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
|
| | | || skillConfig.Effect3 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
|
| | | {
|
| | | bool single = skillConfig.Effect3 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
|
| | | Dictionary<int, int> dict = single ? dict1 : dict2;
|
| | | dict = GetHorseSkillProperty(skillConfig.EffectValue31, skillConfig.EffectValue32, skillConfig.EffectValue33, single);
|
| | | }
|
| | | if (skillConfig.Effect4 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
|
| | | || skillConfig.Effect4 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
|
| | | {
|
| | | bool single = skillConfig.Effect4 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
|
| | | Dictionary<int, int> dict = single ? dict1 : dict2;
|
| | | dict = GetHorseSkillProperty(skillConfig.EffectValue41, skillConfig.EffectValue42, skillConfig.EffectValue43, single);
|
| | | }
|
| | | if (skillConfig.Effect5 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
|
| | | || skillConfig.Effect5 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
|
| | | {
|
| | | bool single = skillConfig.Effect5 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
|
| | | Dictionary<int, int> dict = single ? dict1 : dict2;
|
| | | dict = GetHorseSkillProperty(skillConfig.EffectValue51, skillConfig.EffectValue52, skillConfig.EffectValue53, single);
|
| | | }
|
| | | if (skillConfig.Effect6 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
|
| | | || skillConfig.Effect6 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
|
| | | {
|
| | | bool single = skillConfig.Effect6 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
|
| | | Dictionary<int, int> dict = single ? dict1 : dict2;
|
| | | dict = GetHorseSkillProperty(skillConfig.EffectValue61, skillConfig.EffectValue62, skillConfig.EffectValue63, single);
|
| | | }
|
| | | fightPower += dict1 == null ? 0 : UIHelper.GetFightPower(dict1);
|
| | | fightPower += dict2 == null ? 0 : UIHelper.GetFightPower(dict2);
|
| | | fightPower += skillConfig.FightPower;
|
| | | }
|
| | | |
| | | return fightPower;
|
| | | }
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | | propertyDict.Clear();
|
| | | for (int i = 0; i < horses.Count; i++)
|
| | | {
|
| | | HorseUpConfig horseUpConfig = HorseUpConfig.GetHorseIDAndLV(horses[i].id, horses[i].lv);
|
| | | if (horseUpConfig == null)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | GetHorseProperty(horses[i].id, horses[i].lv, ref propertyDict);
|
| | | int[] propertys = horseUpConfig.AttrType;
|
| | | int[] values = horseUpConfig.AttrValue;
|
| | | for (int k = 0; k < propertys.Length; k++)
|
| | | {
|
| | | if (!propertyDict.ContainsKey(propertys[k]))
|
| | | {
|
| | | propertyDict.Add(propertys[k], values[k]);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (propertys[k] == (int)PropertyType.MoveSpeed)
|
| | | {
|
| | | if (values[k] > propertyDict[propertys[k]])
|
| | | {
|
| | | propertyDict[propertys[k]] = values[k];
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | propertyDict[propertys[k]] += values[k];
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | public void GetHorseProperty(int _id, int lv, ref Dictionary<int, int> propertyDict)
|
| | | {
|
| | | HorseUpConfig.GetHorseSkills(_id, lv, true, ref skills);
|
| | | for (int i = 0; i < skills.Count; i++)
|
| | | {
|
| | | Dictionary<int, int> dict1 = null;
|
| | | Dictionary<int, int> dict2 = null;
|
| | | var skillConfig = SkillConfig.Get(skills[i]);
|
| | | if (skillConfig == null)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | if (skillConfig.Effect1 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
|
| | | || skillConfig.Effect1 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
|
| | | {
|
| | | bool single = skillConfig.Effect1 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
|
| | | if (single)
|
| | | {
|
| | | dict1 = GetHorseSkillProperty(skillConfig.EffectValue11, skillConfig.EffectValue12, skillConfig.EffectValue13, single);
|
| | | }
|
| | | else
|
| | | {
|
| | | dict2 = GetHorseSkillProperty(skillConfig.EffectValue11, skillConfig.EffectValue12, skillConfig.EffectValue13, single);
|
| | | }
|
| | | }
|
| | | if (skillConfig.Effect2 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
|
| | | || skillConfig.Effect2 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
|
| | | {
|
| | | bool single = skillConfig.Effect2 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
|
| | | if (single)
|
| | | {
|
| | | dict1 = GetHorseSkillProperty(skillConfig.EffectValue21, skillConfig.EffectValue22, skillConfig.EffectValue23, single);
|
| | | }
|
| | | else
|
| | | {
|
| | | dict2 = GetHorseSkillProperty(skillConfig.EffectValue21, skillConfig.EffectValue22, skillConfig.EffectValue23, single);
|
| | | }
|
| | | }
|
| | | if (skillConfig.Effect3 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
|
| | | || skillConfig.Effect3 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
|
| | | {
|
| | | bool single = skillConfig.Effect3 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
|
| | | if (single)
|
| | | {
|
| | | dict1 = GetHorseSkillProperty(skillConfig.EffectValue31, skillConfig.EffectValue32, skillConfig.EffectValue33, single);
|
| | | }
|
| | | else
|
| | | {
|
| | | dict2 = GetHorseSkillProperty(skillConfig.EffectValue31, skillConfig.EffectValue32, skillConfig.EffectValue33, single);
|
| | | }
|
| | | }
|
| | | if (skillConfig.Effect4 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
|
| | | || skillConfig.Effect4 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
|
| | | {
|
| | | bool single = skillConfig.Effect4 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
|
| | | if (single)
|
| | | {
|
| | | dict1 = GetHorseSkillProperty(skillConfig.EffectValue41, skillConfig.EffectValue42, skillConfig.EffectValue43, single);
|
| | | }
|
| | | else
|
| | | {
|
| | | dict2 = GetHorseSkillProperty(skillConfig.EffectValue41, skillConfig.EffectValue42, skillConfig.EffectValue43, single);
|
| | | }
|
| | | }
|
| | | if (skillConfig.Effect5 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
|
| | | || skillConfig.Effect5 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
|
| | | {
|
| | | bool single = skillConfig.Effect5 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
|
| | | if (single)
|
| | | {
|
| | | dict1 = GetHorseSkillProperty(skillConfig.EffectValue51, skillConfig.EffectValue52, skillConfig.EffectValue53, single);
|
| | | }
|
| | | else
|
| | | {
|
| | | dict2 = GetHorseSkillProperty(skillConfig.EffectValue51, skillConfig.EffectValue52, skillConfig.EffectValue53, single);
|
| | | }
|
| | | }
|
| | | if (skillConfig.Effect6 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
|
| | | || skillConfig.Effect6 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
|
| | | {
|
| | | bool single = skillConfig.Effect6 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
|
| | | if (single)
|
| | | {
|
| | | dict1 = GetHorseSkillProperty(skillConfig.EffectValue61, skillConfig.EffectValue62, skillConfig.EffectValue63, single);
|
| | | }
|
| | | else
|
| | | {
|
| | | dict2 = GetHorseSkillProperty(skillConfig.EffectValue61, skillConfig.EffectValue62, skillConfig.EffectValue63, single);
|
| | | }
|
| | | }
|
| | | if (dict1 != null)
|
| | | {
|
| | | PastePropertyDict(dict1, propertyDict);
|
| | | }
|
| | | if (dict2 != null)
|
| | | {
|
| | | PastePropertyDict(dict2, propertyDict);
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | private void PastePropertyDict(Dictionary<int, int> source, Dictionary<int, int> target)
|
| | |
| | | private Dictionary<int, int> GetHorseSkillProperty(int condition, int property, int percent, bool single)
|
| | | {
|
| | | Dictionary<int, int> dict = new Dictionary<int, int>();
|
| | | dict.Add(6, 0);
|
| | | dict.Add(7, 0);
|
| | |
|
| | | var viewplayer = GetViewPlayerData(viewPlayer);
|
| | | var horses = viewplayer.rolePlusData.horses;
|
| | |
|
| | | if (single)
|
| | | {
|
| | | var horseInfo = horses.Find((x) =>
|
| | | {
|
| | | return x.id == condition;
|
| | | });
|
| | | HorseUpConfig horseUpConfig = HorseUpConfig.GetHorseIDAndLV(horseInfo.id, horseInfo.lv);
|
| | | if (horseUpConfig == null)
|
| | | {
|
| | | return dict;
|
| | | }
|
| | | int[] propertys = horseUpConfig.AttrType;
|
| | | int[] values = horseUpConfig.AttrValue;
|
| | | for (int k = 0; k < propertys.Length; k++)
|
| | | {
|
| | | if (propertys[k] == property && dict.ContainsKey(property))
|
| | | {
|
| | | dict[property] += (int)(values[k] * ((float)percent / 10000));
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | for (int i = 0; i < horses.Count; i++)
|
| | | {
|
| | | HorseConfig horseConfig = HorseConfig.Get(horses[i].id);
|
| | | if (horseConfig == null)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | if (horseConfig.Quality == condition)
|
| | | {
|
| | | HorseUpConfig horseUpConfig = HorseUpConfig.GetHorseIDAndLV(horses[i].id, horses[i].lv);
|
| | | int[] propertys = horseUpConfig.AttrType;
|
| | | int[] values = horseUpConfig.AttrValue;
|
| | | for (int k = 0; k < propertys.Length; k++)
|
| | | {
|
| | | if (propertys[k] == property && dict.ContainsKey(property))
|
| | | {
|
| | | dict[property] += (int)(values[k] * ((float)percent / 10000));
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | return dict;
|
| | | }
|
| | |
|
| | |
| | |
|
| | | if (viewPlayerData != null)
|
| | | {
|
| | | m_ViewHorse.SetActive(viewPlayerData.rolePlusData.horses.Count > 0);
|
| | | m_ViewHorse.SetActive(false);
|
| | | m_ViewPet.SetActive(viewPlayerData.rolePlusData.pets.Count > 0);
|
| | |
|
| | | if (viewPlayerData.rolePropData.FamilyID == 0)
|
| | |
| | |
|
| | | void DisplaySkills(int id, int lv)
|
| | | {
|
| | | HorseUpConfig.GetHorseSkills(id, lv, false, ref skills);
|
| | | for (int i = 0; i < m_HorseSkills.Length; i++)
|
| | | {
|
| | | if (i < skills.Count)
|
| | | {
|
| | | m_HorseSkills[i].SetActive(true);
|
| | | var condition = HorseUpConfig.GetSkillCondition(id, skills[i]);
|
| | | m_HorseSkills[i].Display(id, skills[i], lv >= condition ? 0 : condition);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_HorseSkills[i].SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayTotalSkills(List<RoleParticularModel.HorseInfo> horses)
|
| | |
| | | displayTotalSkills.Clear();
|
| | | unlockTotalSkills.Clear();
|
| | |
|
| | | for (int i = 0; i < horses.Count; i++)
|
| | | {
|
| | | HorseUpConfig.GetHorseSkills(horses[i].id, horses[i].lv, true, ref skills);
|
| | | unlockTotalSkills.AddRange(skills);
|
| | | foreach (var id in skills)
|
| | | {
|
| | | var config = SkillConfig.Get(id);
|
| | | var effect = SkillConfig.GetSkillEffectValue(config);
|
| | | var skillId = 0;
|
| | | if (mountModel.TryGetIntegrationSkill(effect, out skillId))
|
| | | {
|
| | | if (!displayTotalSkills.Contains(skillId))
|
| | | {
|
| | | displayTotalSkills.Add(skillId);
|
| | | }
|
| | | continue;
|
| | | }
|
| | | displayTotalSkills.Add(id);
|
| | | }
|
| | | }
|
| | |
|
| | | displayTotalSkills.Sort(Compare);
|
| | |
|
| | | m_SkillController.Refresh();
|
| | | var line = Mathf.CeilToInt((float)displayTotalSkills.Count / m_LineCount);
|
| | | for (int i = 0; i < line; i++)
|
| | | {
|
| | | m_SkillController.AddCell(ScrollerDataType.Header, i);
|
| | | }
|
| | | m_SkillController.Restart();
|
| | | }
|
| | |
|
| | | void DisplayModel(int id)
|
| | |
| | |
|
| | | private void OnClickSkill()
|
| | | {
|
| | | var config = HorseConfig.Get(horseId);
|
| | | var skillConfig = SkillConfig.Get(skillId);
|
| | | var label1 = skillConfig.Description;
|
| | | var label2 = Language.Get("pet_SkillTipLv", config.Name, HorseUpConfig.GetSkillCondition(horseId, skillId));
|
| | | SkillDetails.ShowSkillDetails(skillId, SkillDetails.SkillSourceType.ViewHorsePet, skillConfig.FightPower, label1, label2);
|
| | | }
|
| | |
|
| | | public void SetActive(bool active)
|
| | |
| | | normalTasks.Add(new ConfigInitTask("HolidayHomingConfig", () => { HolidayHomingConfig.Init(); }, () => { return HolidayHomingConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("HolidayHomingPointConfig", () => { HolidayHomingPointConfig.Init(); }, () => { return HolidayHomingPointConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("HorseConfig", () => { HorseConfig.Init(); }, () => { return HorseConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("HorseUpConfig", () => { HorseUpConfig.Init(); }, () => { return HorseUpConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("IceLodeStarAwardConfig", () => { IceLodeStarAwardConfig.Init(); }, () => { return IceLodeStarAwardConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("XMZZAchievementConfig", () => { XMZZAchievementConfig.Init(); }, () => { return XMZZAchievementConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("CrossRealmPKOrderAwardConfig", () => { CrossRealmPKOrderAwardConfig.Init(); }, () => { return CrossRealmPKOrderAwardConfig.inited; }));
|
| | |
| | | normalTasks.Add(new ConfigInitTask("CustomAward", () => { CustomAwardConfig.Init(); }, () => { return CustomAwardConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("FamilyBossHurtAward", () => { FamilyBossHurtAwardConfig.Init(); }, () => { return FamilyBossHurtAwardConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("RealmXXZL", () => { RealmXXZLConfig.Init(); }, () => { return RealmXXZLConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("HorseStarUp", () => { HorseStarUpConfig.Init(); }, () => { return HorseStarUpConfig.inited; }));
|
| | |
|
| | | }
|
| | |
|