From 23ef235a263191230031dfaa02c054197fdddd91 Mon Sep 17 00:00:00 2001 From: chenxin <chenxin6991@163.com> Date: Tue, 20 Oct 2020 14:08:19 +0800 Subject: [PATCH] 完善PVE界面逻辑,使用正式的界面资源 解决bug:1.打掉小怪没有获得金币 2.摧毁塔位 塔没有消失 --- Assets/Scripts/Net/NetExtends/Table.cs | 181 +++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 175 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/Net/NetExtends/Table.cs b/Assets/Scripts/Net/NetExtends/Table.cs index 9df6259..4d8d902 100644 --- a/Assets/Scripts/Net/NetExtends/Table.cs +++ b/Assets/Scripts/Net/NetExtends/Table.cs @@ -42,11 +42,14 @@ "endless_buff.json", "endless_enemy.json", "endless_port.json", + "scoreshop.json", + "donateshop.json", "gemcost.json", "buffinfo.json", "skilllevelinfo.json", "arena.json", "fuckword.json", + "notice.json", "storearea.json", "store.json", "goldInfo.json", @@ -200,6 +203,28 @@ break; + case "scoreshop": + //allData.Clear(); + foreach (JsonData item in data) + { + scoreshop tmp = scoreshop.CreateFromJson(item); + allData.Add(tmp as tabledata); + } + JsonDataCenter.allData.Add(tablename, allData); + break; + + + case "donateshop": + //allData.Clear(); + foreach (JsonData item in data) + { + donateshop tmp = donateshop.CreateFromJson(item); + allData.Add(tmp as tabledata); + } + JsonDataCenter.allData.Add(tablename, allData); + break; + + case "gemcost": //allData.Clear(); foreach (JsonData item in data) @@ -249,6 +274,17 @@ foreach (JsonData item in data) { fuckword tmp = fuckword.CreateFromJson(item); + allData.Add(tmp as tabledata); + } + JsonDataCenter.allData.Add(tablename, allData); + break; + + + case "notice": + //allData.Clear(); + foreach (JsonData item in data) + { + notice tmp = notice.CreateFromJson(item); allData.Add(tmp as tabledata); } JsonDataCenter.allData.Add(tablename, allData); @@ -805,6 +841,12 @@ // 出现关卡上限 public int upper_level; + // 对应资源 + public int image; + + // 品质 + public int rare; + public static endless_buff CreateFromJson(JsonData item) @@ -820,6 +862,8 @@ _endless_buff.brief = GameUtils.GetString(item[index++].ToString()); _endless_buff.down_level = int.Parse(GameUtils.GetString(item[index++].ToString())); _endless_buff.upper_level = int.Parse(GameUtils.GetString(item[index++].ToString())); + _endless_buff.image = int.Parse(GameUtils.GetString(item[index++].ToString())); + _endless_buff.rare = int.Parse(GameUtils.GetString(item[index++].ToString())); return _endless_buff; } @@ -842,7 +886,7 @@ public int type; // 血量增幅 - public int hp_rate; + public float hp_rate; // 速度增幅 public float speed_rate; @@ -863,7 +907,7 @@ _endless_enemy.id = int.Parse(GameUtils.GetString(item[index++].ToString())); _endless_enemy.name = GameUtils.GetString(item[index++].ToString()); _endless_enemy.type = int.Parse(GameUtils.GetString(item[index++].ToString())); - _endless_enemy.hp_rate = int.Parse(GameUtils.GetString(item[index++].ToString())); + _endless_enemy.hp_rate = float.Parse(GameUtils.GetString(item[index++].ToString())); _endless_enemy.speed_rate = float.Parse(GameUtils.GetString(item[index++].ToString())); _endless_enemy.coin_rate = int.Parse(GameUtils.GetString(item[index++].ToString())); _endless_enemy.resource = int.Parse(GameUtils.GetString(item[index++].ToString())); @@ -916,10 +960,10 @@ public int cooldown; // 怪物掉落 - public reward drop; + public List<reward> drop; // 掉落概率 - public int drop_rate; + public List<int> drop_rate; @@ -940,10 +984,104 @@ _endless_port.b_speed = float.Parse(GameUtils.GetString(item[index++].ToString())); _endless_port.b_coin = int.Parse(GameUtils.GetString(item[index++].ToString())); _endless_port.cooldown = int.Parse(GameUtils.GetString(item[index++].ToString())); - _endless_port.drop = GameUtils.GetReward(item[index++]); - _endless_port.drop_rate = int.Parse(GameUtils.GetString(item[index++].ToString())); + _endless_port.drop = GameUtils.GetRewardList(item[index++]); + _endless_port.drop_rate = GameUtils.GetIntList(item[index++]); return _endless_port; + } + + } + + //! 生成文件 G_公会积分商店.xlsx + public class scoreshop : tabledata { + public int getid(){ + return id; + } + + // 标识符 + public int id; + + // 道具名称 + public string name; + + // 效果描述 + public string description; + + // 有效时间s + public int time; + + // 效果类型 + public int buff; + + // 效果数值 + public float buffnum; + + // 价格 + public int price; + + // 奖励上限 + public int rewardlimit; + + // 限购次数 + public int purchaselimit; + + + + public static scoreshop CreateFromJson(JsonData item) + { + scoreshop _scoreshop = new scoreshop(); + + int index = 0; + _scoreshop.id = int.Parse(GameUtils.GetString(item[index++].ToString())); + _scoreshop.name = GameUtils.GetString(item[index++].ToString()); + _scoreshop.description = GameUtils.GetString(item[index++].ToString()); + _scoreshop.time = int.Parse(GameUtils.GetString(item[index++].ToString())); + _scoreshop.buff = int.Parse(GameUtils.GetString(item[index++].ToString())); + _scoreshop.buffnum = float.Parse(GameUtils.GetString(item[index++].ToString())); + _scoreshop.price = int.Parse(GameUtils.GetString(item[index++].ToString())); + _scoreshop.rewardlimit = int.Parse(GameUtils.GetString(item[index++].ToString())); + _scoreshop.purchaselimit = int.Parse(GameUtils.GetString(item[index++].ToString())); + + return _scoreshop; + } + + } + + //! 生成文件 G_工会捐赠商店.xlsx + public class donateshop : tabledata { + public int getid(){ + return id; + } + + // 标识符 + public int id; + + // 道具名称 + public string name; + + // 道具奖励数量 + public List<reward> reward; + + // 价格 + public int price; + + // 限购次数 + public int purchaselimit; + + + + public static donateshop CreateFromJson(JsonData item) + { + donateshop _donateshop = new donateshop(); + + int index = 0; + _donateshop.id = int.Parse(GameUtils.GetString(item[index++].ToString())); + _donateshop.name = GameUtils.GetString(item[index++].ToString()); + _donateshop.reward = GameUtils.GetRewardList(item[index++]); + _donateshop.price = int.Parse(GameUtils.GetString(item[index++].ToString())); + _donateshop.purchaselimit = int.Parse(GameUtils.GetString(item[index++].ToString())); + + return _donateshop; } } @@ -1127,6 +1265,37 @@ } + //! 生成文件 N_通知消息字符串(notice).xlsx + public class notice : tabledata { + public int getid(){ + return id; + } + + // id + public int id; + + // 键 + public string key; + + // 说明 + public string dec; + + + + public static notice CreateFromJson(JsonData item) + { + notice _notice = new notice(); + + int index = 0; + _notice.id = int.Parse(GameUtils.GetString(item[index++].ToString())); + _notice.key = GameUtils.GetString(item[index++].ToString()); + _notice.dec = GameUtils.GetString(item[index++].ToString()); + + return _notice; + } + + } + //! 生成文件 S_商店分区表 .xlsx public class storearea : tabledata { public int getid(){ -- Gitblit v1.9.1