| | |
| | | isLoadFinished = false;
|
| | |
|
| | | // 加载配置文件
|
| | | int totalConfigs = 15;
|
| | | int totalConfigs = 11;
|
| | | List<Type> configTypes = new List<Type>() {
|
| | | typeof(ChestsAwardConfig),
|
| | | typeof(CTGConfig),
|
| | | typeof(DirtyWordConfig),
|
| | | typeof(EquipGSParamConfig),
|
| | | typeof(ItemConfig),
|
| | | typeof(NPCConfig),
|
| | | typeof(NPCExConfig),
|
| | | typeof(OrderInfoConfig),
|
| | | typeof(PlayerFaceConfig),
|
| | | typeof(StoreConfig),
|
| | | typeof(SuccessConfig),
|
| | | typeof(SysInfoConfig),
|
| | | typeof(EquipPlaceMapConfig),
|
| | | typeof(FaceConfig),
|
| | | typeof(HeroConfig),
|
| | | typeof(MainChapterConfig),
|
| | | typeof(MainLevelConfig),
|
| | | typeof(NPCLineupConfig),
|
| | | typeof(PlayerLVConfig),
|
| | | typeof(TitleStarUpConfig),
|
| | | typeof(TreasureSetConfig),
|
| | | typeof(XBGetItemConfig)
|
| | | typeof(TreeLVConfig)
|
| | | };
|
| | |
|
| | | #if UNITY_EDITOR
|
| | |
| | |
|
| | | public override void Release()
|
| | | {
|
| | | // 清空 ChestsAwardConfig 字典
|
| | | ClearConfigDictionary<ChestsAwardConfig>();
|
| | | // 清空 CTGConfig 字典
|
| | | ClearConfigDictionary<CTGConfig>();
|
| | | // 清空 DirtyWordConfig 字典
|
| | | ClearConfigDictionary<DirtyWordConfig>();
|
| | | // 清空 EquipGSParamConfig 字典
|
| | | ClearConfigDictionary<EquipGSParamConfig>();
|
| | | // 清空 ItemConfig 字典
|
| | | ClearConfigDictionary<ItemConfig>();
|
| | | // 清空 NPCConfig 字典
|
| | | ClearConfigDictionary<NPCConfig>();
|
| | | // 清空 NPCExConfig 字典
|
| | | ClearConfigDictionary<NPCExConfig>();
|
| | | // 清空 OrderInfoConfig 字典
|
| | | ClearConfigDictionary<OrderInfoConfig>();
|
| | | // 清空 PlayerFaceConfig 字典
|
| | | ClearConfigDictionary<PlayerFaceConfig>();
|
| | | // 清空 StoreConfig 字典
|
| | | ClearConfigDictionary<StoreConfig>();
|
| | | // 清空 SuccessConfig 字典
|
| | | ClearConfigDictionary<SuccessConfig>();
|
| | | // 清空 SysInfoConfig 字典
|
| | | ClearConfigDictionary<SysInfoConfig>();
|
| | | // 清空 EquipPlaceMapConfig 字典
|
| | | ClearConfigDictionary<EquipPlaceMapConfig>();
|
| | | // 清空 FaceConfig 字典
|
| | | ClearConfigDictionary<FaceConfig>();
|
| | | // 清空 HeroConfig 字典
|
| | | ClearConfigDictionary<HeroConfig>();
|
| | | // 清空 MainChapterConfig 字典
|
| | | ClearConfigDictionary<MainChapterConfig>();
|
| | | // 清空 MainLevelConfig 字典
|
| | | ClearConfigDictionary<MainLevelConfig>();
|
| | | // 清空 NPCLineupConfig 字典
|
| | | ClearConfigDictionary<NPCLineupConfig>();
|
| | | // 清空 PlayerLVConfig 字典
|
| | | ClearConfigDictionary<PlayerLVConfig>();
|
| | | // 清空 TitleStarUpConfig 字典
|
| | | ClearConfigDictionary<TitleStarUpConfig>();
|
| | | // 清空 TreasureSetConfig 字典
|
| | | ClearConfigDictionary<TreasureSetConfig>();
|
| | | // 清空 XBGetItemConfig 字典
|
| | | ClearConfigDictionary<XBGetItemConfig>();
|
| | | // 清空 TreeLVConfig 字典
|
| | | ClearConfigDictionary<TreeLVConfig>();
|
| | | }
|
| | | }
|
New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2025年7月7日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Threading; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class FaceConfig : ConfigBase<string, FaceConfig> |
| | | { |
| | | |
| | | public string name; |
| | | public int frameCnt; |
| | | public int speed; |
| | | public int frameType; |
| | | public int EmojiPackID; |
| | | public string folder; |
| | | |
| | | public override string LoadKey(string _key) |
| | | { |
| | | string key = GetKey(_key); |
| | | return key; |
| | | } |
| | | |
| | | public override void LoadConfig(string input) |
| | | { |
| | | try { |
| | | string[] tables = input.Split('\t'); |
| | | name = tables[0]; |
| | | |
| | | int.TryParse(tables[1],out frameCnt); |
| | | |
| | | int.TryParse(tables[2],out speed); |
| | | |
| | | int.TryParse(tables[3],out frameType); |
| | | |
| | | int.TryParse(tables[4],out EmojiPackID); |
| | | |
| | | folder = tables[5]; |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2de14c27ba9038a44ae61b13813ae151 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: Friday, June 27, 2025 |
| | | // [ Date ]: 2025年7月7日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | |
| | | public int HeroID; |
| | | public int Country; |
| | | public int Quality; |
| | | public int[] SkinNPCIDList; |
| | | public int[] SkinIDList; |
| | | public int AtkSkillID; |
| | | public int AngerSkillID; |
| | | public int AtkInheritPer; |
| | |
| | | |
| | | if (tables[3].Contains("[")) |
| | | { |
| | | SkinNPCIDList = JsonMapper.ToObject<int[]>(tables[3]); |
| | | SkinIDList = JsonMapper.ToObject<int[]>(tables[3]); |
| | | } |
| | | else |
| | | { |
| | | string[] SkinNPCIDListStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | SkinNPCIDList = new int[SkinNPCIDListStringArray.Length]; |
| | | for (int i=0;i<SkinNPCIDListStringArray.Length;i++) |
| | | string[] SkinIDListStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | SkinIDList = new int[SkinIDListStringArray.Length]; |
| | | for (int i=0;i<SkinIDListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(SkinNPCIDListStringArray[i],out SkinNPCIDList[i]); |
| | | int.TryParse(SkinIDListStringArray[i],out SkinIDList[i]); |
| | | } |
| | | } |
| | | |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: Friday, June 27, 2025 |
| | | // [ Date ]: 2025年7月7日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | |
| | | public partial class HeroSkinConfig : ConfigBase<int, HeroSkinConfig> |
| | | { |
| | | |
| | | public int SkinNPCID; |
| | | public int SkinID; |
| | | public int[] WearAttrIDList; |
| | | public int[] WearAttrValueList; |
| | | public int[] AllBatAttrIDList; |
| | | public int[] AllBatAttrValueList; |
| | | public string Tachie; |
| | | public string SquareIcon; |
| | | public string RectangleIcon; |
| | | public string SpineRes; |
| | | public string BigSizeSpine; |
| | | |
| | | public override int LoadKey(string _key) |
| | | { |
| | |
| | | { |
| | | try { |
| | | string[] tables = input.Split('\t'); |
| | | int.TryParse(tables[0],out SkinNPCID); |
| | | int.TryParse(tables[0],out SkinID); |
| | | |
| | | if (tables[1].Contains("[")) |
| | | { |
| | |
| | | int.TryParse(AllBatAttrValueListStringArray[i],out AllBatAttrValueList[i]); |
| | | } |
| | | } |
| | | |
| | | Tachie = tables[5]; |
| | | |
| | | SquareIcon = tables[6]; |
| | | |
| | | RectangleIcon = tables[7]; |
| | | |
| | | SpineRes = tables[8]; |
| | | |
| | | BigSizeSpine = tables[9]; |
| | | } |
| | | catch (Exception exception) |
| | | { |
New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2025年7月7日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Threading; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class MainChapterConfig : ConfigBase<int, MainChapterConfig> |
| | | { |
| | | |
| | | public int ChapterID; |
| | | public string ChapterName; |
| | | public string Level; |
| | | public string MapBG; |
| | | public int[][] DailyBootyUpperList; |
| | | public string BootyWeightList; |
| | | |
| | | public override int LoadKey(string _key) |
| | | { |
| | | int key = GetKey(_key); |
| | | return key; |
| | | } |
| | | |
| | | public override void LoadConfig(string input) |
| | | { |
| | | try { |
| | | string[] tables = input.Split('\t'); |
| | | int.TryParse(tables[0],out ChapterID); |
| | | |
| | | ChapterName = tables[1]; |
| | | |
| | | Level = tables[2]; |
| | | |
| | | MapBG = tables[3]; |
| | | |
| | | DailyBootyUpperList = JsonMapper.ToObject<int[][]>(tables[4].Replace("(", "[").Replace(")", "]")); |
| | | |
| | | BootyWeightList = tables[5]; |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: b8a28ea2370eac443bd9c94299bab990 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2025年7月7日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Threading; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class MainLevelConfig : ConfigBase<int, MainLevelConfig> |
| | | { |
| | | |
| | | public int LevelID; |
| | | public int ChapterID; |
| | | public int LevelNum; |
| | | public int[] WaveLineupIDList1; |
| | | public int[] WaveLineupIDList2; |
| | | public int[] WaveLineupIDList3; |
| | | public int[] WaveLineupIDList4; |
| | | public int[] WaveLineupIDList5; |
| | | public int[] WaveLineupIDList6; |
| | | public int[] BossLineupIDList; |
| | | public int[][] AwardItemList; |
| | | |
| | | public override int LoadKey(string _key) |
| | | { |
| | | int key = GetKey(_key); |
| | | return key; |
| | | } |
| | | |
| | | public override void LoadConfig(string input) |
| | | { |
| | | try { |
| | | string[] tables = input.Split('\t'); |
| | | int.TryParse(tables[0],out LevelID); |
| | | |
| | | int.TryParse(tables[1],out ChapterID); |
| | | |
| | | int.TryParse(tables[2],out LevelNum); |
| | | |
| | | if (tables[3].Contains("[")) |
| | | { |
| | | WaveLineupIDList1 = JsonMapper.ToObject<int[]>(tables[3]); |
| | | } |
| | | else |
| | | { |
| | | string[] WaveLineupIDList1StringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | WaveLineupIDList1 = new int[WaveLineupIDList1StringArray.Length]; |
| | | for (int i=0;i<WaveLineupIDList1StringArray.Length;i++) |
| | | { |
| | | int.TryParse(WaveLineupIDList1StringArray[i],out WaveLineupIDList1[i]); |
| | | } |
| | | } |
| | | |
| | | if (tables[4].Contains("[")) |
| | | { |
| | | WaveLineupIDList2 = JsonMapper.ToObject<int[]>(tables[4]); |
| | | } |
| | | else |
| | | { |
| | | string[] WaveLineupIDList2StringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | WaveLineupIDList2 = new int[WaveLineupIDList2StringArray.Length]; |
| | | for (int i=0;i<WaveLineupIDList2StringArray.Length;i++) |
| | | { |
| | | int.TryParse(WaveLineupIDList2StringArray[i],out WaveLineupIDList2[i]); |
| | | } |
| | | } |
| | | |
| | | if (tables[5].Contains("[")) |
| | | { |
| | | WaveLineupIDList3 = JsonMapper.ToObject<int[]>(tables[5]); |
| | | } |
| | | else |
| | | { |
| | | string[] WaveLineupIDList3StringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | WaveLineupIDList3 = new int[WaveLineupIDList3StringArray.Length]; |
| | | for (int i=0;i<WaveLineupIDList3StringArray.Length;i++) |
| | | { |
| | | int.TryParse(WaveLineupIDList3StringArray[i],out WaveLineupIDList3[i]); |
| | | } |
| | | } |
| | | |
| | | if (tables[6].Contains("[")) |
| | | { |
| | | WaveLineupIDList4 = JsonMapper.ToObject<int[]>(tables[6]); |
| | | } |
| | | else |
| | | { |
| | | string[] WaveLineupIDList4StringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | WaveLineupIDList4 = new int[WaveLineupIDList4StringArray.Length]; |
| | | for (int i=0;i<WaveLineupIDList4StringArray.Length;i++) |
| | | { |
| | | int.TryParse(WaveLineupIDList4StringArray[i],out WaveLineupIDList4[i]); |
| | | } |
| | | } |
| | | |
| | | if (tables[7].Contains("[")) |
| | | { |
| | | WaveLineupIDList5 = JsonMapper.ToObject<int[]>(tables[7]); |
| | | } |
| | | else |
| | | { |
| | | string[] WaveLineupIDList5StringArray = tables[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | WaveLineupIDList5 = new int[WaveLineupIDList5StringArray.Length]; |
| | | for (int i=0;i<WaveLineupIDList5StringArray.Length;i++) |
| | | { |
| | | int.TryParse(WaveLineupIDList5StringArray[i],out WaveLineupIDList5[i]); |
| | | } |
| | | } |
| | | |
| | | if (tables[8].Contains("[")) |
| | | { |
| | | WaveLineupIDList6 = JsonMapper.ToObject<int[]>(tables[8]); |
| | | } |
| | | else |
| | | { |
| | | string[] WaveLineupIDList6StringArray = tables[8].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | WaveLineupIDList6 = new int[WaveLineupIDList6StringArray.Length]; |
| | | for (int i=0;i<WaveLineupIDList6StringArray.Length;i++) |
| | | { |
| | | int.TryParse(WaveLineupIDList6StringArray[i],out WaveLineupIDList6[i]); |
| | | } |
| | | } |
| | | |
| | | if (tables[9].Contains("[")) |
| | | { |
| | | BossLineupIDList = JsonMapper.ToObject<int[]>(tables[9]); |
| | | } |
| | | else |
| | | { |
| | | string[] BossLineupIDListStringArray = tables[9].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | BossLineupIDList = new int[BossLineupIDListStringArray.Length]; |
| | | for (int i=0;i<BossLineupIDListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(BossLineupIDListStringArray[i],out BossLineupIDList[i]); |
| | | } |
| | | } |
| | | |
| | | AwardItemList = JsonMapper.ToObject<int[][]>(tables[10].Replace("(", "[").Replace(")", "]")); |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: aa5d3f0253beb4f4aa4e9ae8ed5c4d25 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2025年7月7日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Threading; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class NPCLineupConfig : ConfigBase<int, NPCLineupConfig> |
| | | { |
| | | |
| | | public int LineupID; |
| | | public int PosNPCID1; |
| | | public int PosNPCID2; |
| | | public int PosNPCID3; |
| | | public int PosNPCID4; |
| | | public int PosNPCID5; |
| | | public int PosNPCID6; |
| | | public int PosNPCID7; |
| | | public int BossID; |
| | | |
| | | public override int LoadKey(string _key) |
| | | { |
| | | int key = GetKey(_key); |
| | | return key; |
| | | } |
| | | |
| | | public override void LoadConfig(string input) |
| | | { |
| | | try { |
| | | string[] tables = input.Split('\t'); |
| | | int.TryParse(tables[0],out LineupID); |
| | | |
| | | int.TryParse(tables[1],out PosNPCID1); |
| | | |
| | | int.TryParse(tables[2],out PosNPCID2); |
| | | |
| | | int.TryParse(tables[3],out PosNPCID3); |
| | | |
| | | int.TryParse(tables[4],out PosNPCID4); |
| | | |
| | | int.TryParse(tables[5],out PosNPCID5); |
| | | |
| | | int.TryParse(tables[6],out PosNPCID6); |
| | | |
| | | int.TryParse(tables[7],out PosNPCID7); |
| | | |
| | | int.TryParse(tables[8],out BossID); |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: cd54c8c6c3a65fe489caa3c17fbe2297 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2025年7月7日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Threading; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class TreeLVConfig : ConfigBase<int, TreeLVConfig> |
| | | { |
| | | |
| | | public int TreeLV; |
| | | public int LVUPNeedMoney; |
| | | public int LVUPNeedTime; |
| | | public int[] EquipColorRateList; |
| | | public string ExAwardItemRateList; |
| | | |
| | | public override int LoadKey(string _key) |
| | | { |
| | | int key = GetKey(_key); |
| | | return key; |
| | | } |
| | | |
| | | public override void LoadConfig(string input) |
| | | { |
| | | try { |
| | | string[] tables = input.Split('\t'); |
| | | int.TryParse(tables[0],out TreeLV); |
| | | |
| | | int.TryParse(tables[1],out LVUPNeedMoney); |
| | | |
| | | int.TryParse(tables[2],out LVUPNeedTime); |
| | | |
| | | if (tables[3].Contains("[")) |
| | | { |
| | | EquipColorRateList = JsonMapper.ToObject<int[]>(tables[3]); |
| | | } |
| | | else |
| | | { |
| | | string[] EquipColorRateListStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | EquipColorRateList = new int[EquipColorRateListStringArray.Length]; |
| | | for (int i=0;i<EquipColorRateListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(EquipColorRateListStringArray[i],out EquipColorRateList[i]); |
| | | } |
| | | } |
| | | |
| | | ExAwardItemRateList = tables[4]; |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 5443aed733119144aa28ba3bc83b225c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using LitJson; |
| | | using System.Collections.Generic; |
| | | |
| | | // B4 24 回合战斗初始化 #tagSCTurnFightInit |
| | | |
| | | public class DTCB424_tagSCTurnFightInit : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | public override void Done(GameNetPackBasic vNetPack) |
| | | { |
| | | base.Done(vNetPack); |
| | | HB424_tagSCTurnFightInit vNetData = vNetPack as HB424_tagSCTurnFightInit; |
| | | |
| | | // 【战斗地图定义】 |
| | | // 前后端协议通讯时,如果有MapID、FuncLineID信息,一般代表的是某个战斗功能, |
| | | // 并可绑定某个战斗场景(相当于MMO中的不同功能及战斗场景地图) |
| | | // 卡牌中也可理解为不同的战斗功能及绑定不同的战斗背景图之类 |
| | | // 目前几个固定MapID定义 |
| | | // 主线小怪战斗 MapID = 1 |
| | | // FuncLineID = 章节*10000+关卡编号*100+第x波,如第一章,第10关卡,第5波时值 = 11005, |
| | | // 单章最大支持99小关,单关最大支持99波怪 |
| | | // 主线boss战斗 MapID = 2 |
| | | // FuncLineID = 章节*10000+关卡编号*100+第x波,如第一章,第10关卡的boss值 = 11001, |
| | | // 注:关卡boss波数固定为只有1波 |
| | | // 前端可通过MapID及对应的FuncLineID加载不同的战斗场景背景、背景音乐等 |
| | | |
| | | // HB424_tagSCTurnFightInit |
| | | // MapID; // 自定义地图ID,可用于绑定战斗地图场景功能(如主线关卡、主线boss、爬塔、竞技场等) |
| | | // FuncLineID; // MapID对应的扩展值,如具体某个关卡等 |
| | | // TurnMax; // 最大轮次 |
| | | // Len; |
| | | // Msg; // 本场战斗扩展信息,一般为json格式,具体内容由MapID决定 |
| | | // FactionCnt; |
| | | // FactionList; // 阵营列表,通常固定只有两个阵营 |
| | | |
| | | |
| | | |
| | | uint chapter = vNetData.FuncLineID / 10000; |
| | | uint wave = vNetData.MapID == 1 ? vNetData.FuncLineID % 100 : 1;//第几波怪 |
| | | uint level = (vNetData.FuncLineID % 10000) / 100; |
| | | JsonData extendData = JsonMapper.ToObject(vNetData.Msg); |
| | | |
| | | List<TeamBase> redTeamList = new List<TeamBase>(); |
| | | List<TeamBase> blueTeamList = new List<TeamBase>(); |
| | | |
| | | if (null != vNetData.FactionList) |
| | | { |
| | | foreach (var vFaction in vNetData.FactionList) |
| | | { |
| | | if (vFaction.Faction == 1) |
| | | { |
| | | foreach (var lineUp in vFaction.LineupList) |
| | | { |
| | | redTeamList.Add(new TeamBase(lineUp)); |
| | | } |
| | | } |
| | | else if (vFaction.Faction == 2) |
| | | { |
| | | foreach (var lineUp in vFaction.LineupList) |
| | | { |
| | | blueTeamList.Add(new TeamBase(lineUp)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | FactionList[i].LineupList[j].ObjList[k] = new tagSCTurnFightObj(); |
| | | TransBytes (out FactionList[i].LineupList[j].ObjList[k].ObjID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out FactionList[i].LineupList[j].ObjList[k].NPCID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out FactionList[i].LineupList[j].ObjList[k].HeroID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out FactionList[i].LineupList[j].ObjList[k].SkinID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out FactionList[i].LineupList[j].ObjList[k].HP, vBytes, NetDataType.DWORD); |
| | | TransBytes (out FactionList[i].LineupList[j].ObjList[k].HPEx, vBytes, NetDataType.DWORD); |
| | | TransBytes (out FactionList[i].LineupList[j].ObjList[k].MaxHP, vBytes, NetDataType.DWORD); |
| | |
| | | } |
| | | |
| | | public struct tagSCTurnFightObj { |
| | | public uint ObjID; // 实例唯一ID |
| | | public uint NPCID; // 绑定的NPCID,不同的实例ID对应的NPCID可能一样 |
| | | public uint ObjID; // 战斗单位唯一ID |
| | | public uint NPCID; // 战斗NPCID,不同的实例ID对应的NPCID可能一样 |
| | | public uint HeroID; // 玩家武将ID,仅玩家阵容有 |
| | | public uint SkinID; // 玩家武将皮肤ID,仅玩家阵容有 |
| | | public uint HP; // 当前血量,求余20亿部分 |
| | | public uint HPEx; // 当前血量,整除20亿部分 |
| | | public uint MaxHP; // 最大血量,求余20亿部分 |
| | |
| | | |
| | | public class RecordModeOperationAgent : IOperationAgent |
| | | { |
| | | // GameNetPackage[] packs |
| | | |
| | | |
| | | |
| | | |
| | | public RecordModeOperationAgent(BattleField battleField) : base(battleField) |
| | | { |
| | | |
| | |
| | | public override void DoNext() |
| | | { |
| | | base.DoNext(); |
| | | |
| | | // if (!playing()) |
| | | // packs.Dequeue(); |
| | | // actions = pack.Distribute(); |
| | | |
| | | // recordPlayer.Play(actions); |
| | | } |
| | | } |
| | |
| | | case SkillTargetRangeType.HighestAttack: |
| | | returnList = new List<BattleObject>(from BO in returnList where !BO.IsDead() select BO); |
| | | BattleObject mostHighestAttckObj = null; |
| | | for (int i = 0; i < returnList.Count; i++) |
| | | { |
| | | if (mostHighestAttckObj == null) |
| | | { |
| | | mostHighestAttckObj = returnList[i]; |
| | | continue; |
| | | } |
| | | if (returnList[i].teamHero.attack > mostHighestAttckObj.teamHero.attack) |
| | | { |
| | | mostHighestAttckObj = returnList[i]; |
| | | } |
| | | } |
| | | // 客户端不包含数据 这里取第一个 |
| | | mostHighestAttckObj = returnList[0]; |
| | | returnList.Clear(); |
| | | if (mostHighestAttckObj != null) |
| | | returnList.Add(mostHighestAttckObj); |
| | |
| | | { |
| | | List<int> damageList = new List<int>(); |
| | | |
| | | int totalDamage = teamHero.attack - obj.teamHero.defense; |
| | | int totalDamage = 100; |
| | | |
| | | int damage1 = (int)((float)totalDamage * 0.3f); |
| | | |
| | |
| | | public static int[] flashCntMoreArr; //雷诛更多次数层需求 [天星塔,境界塔,符印塔(按第几个塔算)] |
| | | public static int flashKillMaxCount; //雷诛最大次数 |
| | | |
| | | public static readonly int HundredMillion = 100000000;//1亿 |
| | | |
| | | public static void Init() |
| | | { |
| | | try |
| | |
| | | public int SkinIndex = 0; |
| | | |
| | | // 服务器数据 皮肤ID |
| | | public int SkinID |
| | | { |
| | | get |
| | | { |
| | | if (null == heroConfig) |
| | | return 0; |
| | | |
| | | if (SkinIndex > heroConfig.SkinNPCIDList.Length && SkinIndex >= 0) |
| | | { |
| | | return heroConfig.SkinNPCIDList[SkinIndex]; |
| | | } |
| | | return heroConfig.SkinNPCIDList[0]; |
| | | } |
| | | } |
| | | public int SkinID; |
| | | |
| | | // 皮肤配置 |
| | | public HeroSkinConfig skinConfig; |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | using log4net.Core; |
| | | |
| | | public partial class HeroInfo |
| | | { |
| | |
| | | public long sid; |
| | | |
| | | // 武将配置表ID |
| | | public int heroId |
| | | { |
| | | get |
| | | { |
| | | #if UNITY_EDITOR |
| | | if (null == itemHero) |
| | | { |
| | | return 520001; |
| | | } |
| | | #endif |
| | | |
| | | return itemHero.config.ID; |
| | | } |
| | | } |
| | | public int heroId; |
| | | |
| | | // 武将等级 |
| | | public int heroLevel; |
| | |
| | | return heroConfig.Quality; |
| | | } |
| | | } |
| | | |
| | | public ItemModel itemHero; |
| | | |
| | | // public readonly CB122_tagSCHeroInfo.tagSCHero scHeroInfo; |
| | | |
| | | // 武将配置 |
| | |
| | | |
| | | } |
| | | |
| | | public HeroInfo(HB424_tagSCTurnFightInit.tagSCTurnFightObj fightObj) |
| | | { |
| | | // 战斗表现需要这些基本就够 不够还需要服务器加 |
| | | |
| | | heroId = (int)fightObj.HeroID; |
| | | heroConfig = HeroConfig.Get(heroId); |
| | | SkinID = (int)fightObj.SkinID; |
| | | skinConfig = HeroSkinConfig.Get(SkinID); |
| | | heroLevel = (int)fightObj.LV; |
| | | } |
| | | |
| | | #if UNITY_EDITOR |
| | | public HeroInfo() |
| | | { |
| | | heroId = 520001; // 默认英雄ID |
| | | heroLevel = 1; |
| | | heroStar = 1; |
| | | breakLevel = 1; |
| | |
| | | |
| | | // public HeroInfo Clone() => JsonMapper.ToObject<HeroInfo>(JsonMapper.ToJson(this)); |
| | | |
| | | // 图鉴信息 |
| | | public void UpdateSCHero(CB122_tagSCHeroInfo.tagSCHero _scHeroInfo) |
| | | { |
| | | |
| | | } |
| | | |
| | | public void UpdateHero(ItemModel _itemHero) |
| | | public void UpdateHero(ItemModel itemHero) |
| | | { |
| | | itemHero = _itemHero; |
| | | // HeroConfigUtility |
| | | |
| | | heroId = itemHero.config.ID; |
| | | // 70 # 英雄等级 |
| | | heroLevel = itemHero.GetUseData(70)[0]; |
| | | // 72 # 英雄星级 |
| | |
| | | |
| | | public partial class TeamBase |
| | | { |
| | | |
| | | // 区分一下阵营跟阵容 阵营为一个TeamBase列表 可能是多个玩家组合而成 |
| | | // 阵容为一个TeamBase 是玩家的一个队伍 |
| | | private int teamIndex = 0;//该阵营的第几个队伍 |
| | | |
| | | private uint playerId = 0; //该阵容的玩家id |
| | | |
| | | private int ShapeType; //本阵容阵型,0为默认阵型,可扩展不同的阵型,如boss特殊战斗阵型,或者其他不同站位的阵型 |
| | | |
| | | public bool IsPlayer |
| | | { |
| | | get |
| | | { |
| | | return playerId == 0; |
| | | } |
| | | } |
| | | |
| | | public TeamHero[] teamHeros = new TeamHero[TeamConst.MaxTeamSlotCount]; |
| | | |
| | | public TeamBase() |
| | | { |
| | | |
| | | } |
| | | |
| | | public TeamBase(HB424_tagSCTurnFightInit.tagSCTurnFightLineup lineUp) |
| | | { |
| | | teamIndex = lineUp.Num; |
| | | playerId = lineUp.OwnerID; |
| | | ShapeType = lineUp.ShapeType; |
| | | |
| | | for (int i = 0; i < lineUp.ObjCnt; i++) |
| | | { |
| | | if (i < teamHeros.Length) |
| | | { |
| | | TeamHero hero = new TeamHero(lineUp.ObjList[i], this); |
| | | AddTeamHero(hero); |
| | | } |
| | | } |
| | | |
| | | Update(); |
| | | |
| | | |
| | | } |
| | | |
| | | protected void Update() |
| | | { |
| | | // 检查国籍 |
| | | |
| | | // 检查羁绊 |
| | | |
| | | // 检查阵型 |
| | | |
| | | // 更新队伍英雄属性 |
| | | foreach (var teamHero in teamHeros) |
| | | { |
| | | teamHero.Update(); |
| | | } |
| | | |
| | | // 更新队伍属性 |
| | | // UpdateProperties(); |
| | | |
| | | // CalculatePower(); |
| | | } |
| | | |
| | | public void SetShapeType(int shapeType) |
| | | { |
| | | ShapeType = shapeType; |
| | | } |
| | | |
| | | public int GetTeamHeroCount() |
| | | { |
| | |
| | | return true; |
| | | } |
| | | |
| | | public void AddTeamHeros(List<HeroInfo> heroInfos) |
| | | public void AddHeroInfos(List<HeroInfo> heroInfos) |
| | | { |
| | | for (int i = 0; i < heroInfos.Count; i++) |
| | | { |
| | | AddTeamHero(heroInfos[i]); |
| | | AddHeroInfo(heroInfos[i]); |
| | | } |
| | | |
| | | UpdateProperties(); |
| | | } |
| | | |
| | | public bool AddTeamHero(HeroInfo heroInfo) |
| | | |
| | | public bool AddHeroInfo(HeroInfo heroInfo) |
| | | { |
| | | if (heroInfo == null) |
| | | { |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | public void AddTeamHero(TeamHero teamHero) |
| | | { |
| | | if (null == teamHero) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | teamHeros[teamHero.heroIndex] = teamHero; |
| | | } |
| | | |
| | | |
| | | public bool RemoveTeamHero(int index) |
| | | { |
| | |
| | | return GetTeamHeroCount() == 0; |
| | | } |
| | | |
| | | public void InitByLevelId(int levelId) |
| | | { |
| | | |
| | | } |
| | | |
| | | #if UNITY_EDITOR |
| | | public void FillWithFakeData() |
| | |
| | | { |
| | | TeamHero hero = new TeamHero(); |
| | | hero.curHp = 100; |
| | | hero.attack = UnityEngine.Random.Range(300, 500); |
| | | hero.defense = UnityEngine.Random.Range(80, 100); |
| | | hero.heroInfo = new HeroInfo(); |
| | | hero.teamBase = this; |
| | | hero.heroIndex = i; |
| | |
| | | |
| | | public partial class TeamHero |
| | | { |
| | | // 基础属性 |
| | | // 生命 |
| | | public int hp = 0; |
| | | // 攻击力 |
| | | public int attack = 0; |
| | | // 防御力 |
| | | public int defense = 0; |
| | | |
| | | |
| | | //战斗属性 击晕、暴击、连击、格挡、反击、吸血 |
| | | //眩晕概率 |
| | | public int stunRate = 0; |
| | | //暴击概率 |
| | | public int critRate = 0; |
| | | //连击概率 |
| | | public int comboRate = 0; |
| | | //格挡概率 |
| | | public int blockRate = 0; |
| | | //反击概率 |
| | | public int counterAttackRate = 0; |
| | | //攻击目标时,造成伤害转化成生命的百分比数值提升 |
| | | public int recoverRate = 0; |
| | | |
| | | //战斗抵抗属性 |
| | | //眩晕抵抗 |
| | | public int stunResist = 0; |
| | | //暴击抵抗 |
| | | public int critResist = 0; |
| | | //连击抵抗 |
| | | public int comboResist = 0; |
| | | //格挡抵抗 |
| | | public int blockResist = 0; |
| | | //反击抵抗 |
| | | public int counterAttackResist = 0; |
| | | //减少攻击时吸血转化成生命的百分比数值 |
| | | public int recoverResist = 0; |
| | | |
| | | |
| | | |
| | | |
| | | // 当前属性 |
| | | |
| | | // 怒气值 |
| | | public int rage = 0; |
| | | |
| | | // 当前血量 |
| | | public int curHp; |
| | | public long curHp; |
| | | |
| | | // 最大血量 |
| | | public int maxHp; |
| | | public long maxHp; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | using UnityEngine; |
| | | using UnityEngine.PlayerLoop; |
| | | |
| | | public partial class TeamHero |
| | | { |
| | |
| | | public TeamBase teamBase; |
| | | public int heroIndex; |
| | | |
| | | // 战场数据 |
| | | public uint ObjID = 0;// 战斗单位唯一ID |
| | | |
| | | public uint NPCID = 0;// 战斗NPCID,不同的实例ID对应的NPCID可能一样 |
| | | |
| | | |
| | | public TeamHero() |
| | | { |
| | | |
| | | } |
| | | |
| | | public TeamHero(HB424_tagSCTurnFightInit.tagSCTurnFightObj fightObj, TeamBase _teamBase) |
| | | { |
| | | heroInfo = new HeroInfo(fightObj); |
| | | teamBase = _teamBase; |
| | | if (fightObj.PosNum < 0 || fightObj.PosNum >= TeamConst.MaxTeamSlotCount) |
| | | { |
| | | Debug.LogError("Invalid PosNum: " + fightObj.PosNum); |
| | | } |
| | | else |
| | | { |
| | | teamBase.teamHeros[fightObj.PosNum] = this; // 将当前对象添加到对应位置 |
| | | } |
| | | |
| | | ObjID = fightObj.ObjID; |
| | | NPCID = fightObj.NPCID; |
| | | |
| | | // HPEx * 1亿 + HP |
| | | |
| | | curHp = (long)fightObj.HPEx * GeneralDefine.HundredMillion +(long)fightObj.HP; |
| | | maxHp = (long)fightObj.MaxHPEx * GeneralDefine.HundredMillion +(long)fightObj.MaxHP; |
| | | rage = (int)fightObj.AngreXP; |
| | | |
| | | heroIndex = fightObj.PosNum; |
| | | |
| | | Update(); |
| | | } |
| | | |
| | | public void Update() |
| | | { |
| | | |
| | | } |
| | | |
| | | // 最终属性 当前属性应该是要在这一层的 |
| | | |
| | | public int GetPower() |
| | |
| | | if (!teamDict.TryGetValue(teamType, out team)) |
| | | { |
| | | team = new TeamBase(); |
| | | team.AddTeamHeros(HeroManager.Instance.GetPowerfulHeroList()); |
| | | team.AddHeroInfos(HeroManager.Instance.GetPowerfulHeroList()); |
| | | teamDict.Add(teamType, team); |
| | | } |
| | | |