123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895 |
- using System;
- using System.Linq;
- using System.Collections.Generic;
- using Newtonsoft.Json.Linq;
- using static global::LinqExt;
- /// <summary>
- /// 战斗模块
- /// </summary>
- public class FightProxy : ProxyBase<FightProxy>
- {
- #region 构造函数
- public FightProxy() => this.opeCode = OpeCode.ope_fight;
- #endregion
- #region ' 680x '
- /// <summary>
- /// 【6800】关卡挑战预先计算下奖励字符串
- /// </summary>
- /// <param name="domainId">区域Id</param>
- /// <param name="gateId"></param>
- /// <param name="difficulty"></param>
- /// <param name="callback">奖励字符串 id,num;id,num</param>
- public void ArenasPreFight(int domainId, int gateId, int difficulty, Action<string> callback = null)
- {
- Post(CmdCode.cmd_fight_ArenasPreFight, new object[] { gateId, difficulty }, resp =>
- {
- var rewardstr = resp.result["r"].ToString();
- DropManager.Instance.DropStr = rewardstr;
- callback?.Invoke(rewardstr);
- });
- }
- /// <summary>
- /// [6801] 挑战关卡
- /// </summary>
- /// <param name="uid">玩家Uid</param>
- /// <param name="domainId">区域id</param>
- /// <param name="gateId">关卡索引</param>
- /// <param name="difficulty">难度选择 0,1,2</param>
- /// <param name="stars">获得评星0,1,2,3, 如果战斗失败star=-1</param>
- /// <param name="TeamArray">队伍列表</param>
- /// <param name="callback">回调函数</param>
- public void ArenasFight(int domainId, int gateId, int difficulty, GateStar stars,
- List<string> TeamArray,
- Action<FightProxy_RetVo.ArenasFight_RetVo> callback = null)
- {
- UnityEngine.Debug.Assert(gateId > 0, "关卡id必须大于0(503001开始)");
- Post(CmdCode.cmd_fight_ArenasFight, new object[] { gateId, difficulty, stars.ToIntValue(), TeamArray },
- resp =>
- {
- var player = UserProxy.Instance.player;
- var nandu = difficulty + 1;
- FightProxy_RetVo.ArenasFight_RetVo vo = new FightProxy_RetVo.ArenasFight_RetVo(gateId, domainId);
- var smGate = sm_gate.GetMoById(gateId);
- vo.commander = new FightProxy_RetVo.CommanderChangeInfo();
- vo.commander.addExp = resp.result["exp"].ToObject<int>();
-
- vo.GateName = smGate.gateName;
- vo.WorldName = sm_gate_zone.GetMoById(domainId)?.zoneName ?? "本章之章";
- vo.teamChange = new List<FightProxy_RetVo.HeroChangedInfo>();
- foreach (var heroUid in TeamArray)
- {
- if (string.IsNullOrEmpty(heroUid))
- {
- continue;
- }
- var info = new FightProxy_RetVo.HeroChangedInfo();
- info.addExp = smGate.HeroExp(nandu);
- info.uid = int.Parse(heroUid);
- vo.teamChange.Add(info);
- }
- player.ChangeUserAccount(AccountType.exp, vo.commander.addExp); // 指挥官经验
- //player.ChangeUserAccount(AccountType.gold, vo.dropGold); // 掉落金币
- player.areansRecord.InitArenasGateData((JObject)resp.result["gates"]); // 同步关卡记录
- player.collectHero.InitData((JObject)resp.result["heros"],player); // 同步英雄数据
- //player.InitFromStore((JObject)resp.result["store"]); // 同步背包数据
- player.baseInfo.tili = resp.result["tili"].ToObject<int>(); // 同步体力
- player.baseInfo.gold = Convert.ToInt32(resp.result["gold"].ToString()); // 同步金币
- player.baseInfo.resPoint = Convert.ToInt32(resp.result["resPoint"].ToString()); // 同步资源点
- player.baseInfo.cash = Convert.ToInt32(resp.result["cash"].ToString()); // 同步钻石
- var priv = resp.result.TryGetValue("priv",out var prJ)?prJ.ToObject<Info_PrivateState>() : null; // 私有字段记录了挑战记录
- if (null != priv)
- {
- player.PrivateState = priv; // 同步挑战记录
- }
- TiliTime.Instance.SetTiliTime((long)resp.result["time"]); // 同步体力时间
- if (resp.result["isFirst"].ToObject<bool>())
- {
- if (smGate.First_Hero(nandu) > 0)
- {
- vo.UnlockHero = player.collectHero.GetHeroGameInfoByModelID(smGate.First_Hero(nandu).ToString());
- }
- }
- callback?.Invoke(vo);
- });
- }
- /// <summary>
- /// [6803] 拉取(挑战)对手的信息
- /// </summary>
- /// <param name="targetUID">对手UID</param>
- /// <param name="callback"></param>
- public void GetChallengeAdversaryInfo(string targetUID, Action<AdversaryInfo> callback = null)
- {
- Post(CmdCode.cmd_fight_GetChallengeAdversaryInfo, new object[] { targetUID },
- resp =>
- {
- if (null != resp.result)
- {
- var adversary = resp.result["adversaryInfo"].ToObject<AdversaryInfo>();
- foreach (var eqps in adversary.equipment.equipments.Values)
- { // 同步调整herouid的偏移
- if (eqps.herouid > 0)
- {
- eqps.herouid -= 10000;
- }
- }
- foreach (var yanls in adversary.yanling.items.Values)
- { // 同步进行herouid的偏移
- if (yanls.herouid > 0)
- {
- yanls.herouid -= 10000;
- }
- }
- foreach (var heroVo in adversary.heros.Values)
- {
- if (null == heroVo) continue;
- heroVo.uid = (int.Parse(heroVo.uid) - 10000).ToString();
- heroVo.EquipRef = adversary.equipment;
- heroVo.YanlingRef = adversary.yanling;
- }
- callback?.Invoke(adversary);
- }
- else
- {
- throw new Exception("故障, 未找到该玩家数据!");
- // 发生错误, 后台未找到此玩家数据...
- }
- });
- }
- /// <summary>
- /// [6804] 记录 挑战结果
- /// </summary>
- /// <param name="targetUID">对手UID</param>
- /// <param name="callback"></param>
- public void LogChallengeResult(string targetUID, string name, string headImg, bool win, string msg = "", Action callback = null)
- {
- Post(CmdCode.cmd_fight_LogChallengeResult, new object[] { targetUID, name, headImg, win, msg }, resp => callback?.Invoke());
- }
- /// <summary>
- /// [6805] 拉取(挑战)记录
- /// </summary>
- /// <param name="targetUID">对手UID</param>
- /// <param name="callback"></param>
- public void GetChallengeLog(Action<MyChallengeLog> callback = null)
- {
- Post(CmdCode.cmd_fight_GetChallengeLog, new object[] { },
- resp =>
- {
- if (null != resp.result)
- {
- var vo = resp.result.ToObject<MyChallengeLog>();
- callback?.Invoke(vo);
- }
- else
- {
- throw new Exception("故障, 未找到挑战记录数据!");
- }
- });
- }
- /// <summary>
- /// [6806] 领取(累计)星数奖励
- /// </summary>
- /// <param name="domainId"></param>
- /// <param name="diffculty"></param>
- /// <param name="stars"></param>
- /// <param name="callback"></param>
- public void GetStarRewards(int domainId, int diffculty, int stars, Action callback = null)
- {
- Post(CmdCode.cmd_fight_GetArenasActiveReward, new object[] { domainId, diffculty, stars },
- resp =>
- {
- var p = UserProxy.Instance.player;
- p.baseInfo.gold = resp.result["gold"].ToObject<int>();
- p.baseInfo.cash = resp.result["cash"].ToObject<int>();
- //p.InitFromStore((JObject)resp.result["store"]); // 同步背包
- // 同步领取奖励记录
- if (!p.areansRecord.chapterStarsRwd.ContainsKey(domainId))
- {
- p.areansRecord.chapterStarsRwd.Add(domainId, new Dictionary<int, List<int>>() { });
- }
- int hardLevel = 1 + diffculty;
- if (!p.areansRecord.chapterStarsRwd[domainId].ContainsKey(hardLevel))
- {
- p.areansRecord.chapterStarsRwd[domainId].Add(hardLevel, new List<int>());
- }
- p.areansRecord.chapterStarsRwd[domainId][hardLevel].Add(stars);
- callback?.Invoke();
- });
- }
- #endregion
- #region 闲置函数
- /// <summary>
- /// [6802] 扫荡关卡
- /// </summary>
- /// <param name="uid"></param>
- /// <param name="zoneid"></param>
- /// <param name="gateId">关卡索引</param>
- /// <param name="diff">难度</param>
- /// <param name="itemid">扫荡券id</param>
- /// <param name="callback"></param>
- [Obsolete("暂时不用2019年12月19日14:12:24")]
- public void ArenasSweep(int gateId, int difficulty, int sweepItemId, Action<JObject> callback = null)
- {
- Post(CmdCode.cmd_fight_ArenasSweep, new object[] { gateId, difficulty, sweepItemId },
- resp =>
- {
- if (callback != null)
- {
- callback.Invoke(resp.result);
- }
- });
- }
- #endregion
- #region ' 竞技场 681x '
- /// <summary>
- /// [6810] 竞技场 - 主界面信息
- /// </summary>
- /// <param name="callback"></param>
- public void PVP_MainInfo(Action<PVP_Main_UIVo> callback)
- {
- Post(CmdCode.cmd_pvp_maininfo, new object[] { },
- resp =>
- {
- if (callback != null)
- {
- var ret = resp.result.ToObject<PVP_Main_UIVo>();
- var pvp = UserProxy.Instance.player.pvpRecord;
- pvp.defTeam = ret.defTeam;
- pvp.pvpCoins = ret.pvpCoins;
- pvp.fightTicket = ret.fightTicket;
- FixArenasAdversaryInfo(ret.matches);
- callback.Invoke(ret);
- }
- });
- }
- private static void FixArenasAdversaryInfo(List<AdversaryInfo_Arenas> li)
- {
- li.ForEach(adversary =>
- {
- foreach (var eqps in adversary.equipment.equipments.Values)
- { // 同步调整herouid的偏移
- if (eqps.herouid > 0)
- {
- eqps.herouid -= 10000;
- }
- }
- foreach (var yanls in adversary.yanling.items.Values)
- { // 同步进行herouid的偏移
- if (yanls.herouid > 0)
- {
- yanls.herouid -= 10000;
- }
- }
- foreach (var heroVo in adversary.heros.Values)
- {
- if (null == heroVo) continue;
- heroVo.uid = (int.Parse(heroVo.uid) - 10000).ToString();
- heroVo.EquipRef = adversary.equipment;
- heroVo.YanlingRef = adversary.yanling;
- }
- });
- }
- /// <summary>
- /// [6811] 竞技场 - 刷新对手(建议客户端设置时间间隔)
- /// </summary>
- /// <param name="callback"></param>
- public void PVP_Refresh(Action<List<AdversaryInfo_Arenas>> callback)
- {
- Post(CmdCode.cmd_pvp_refresh, new object[] { },
- resp =>
- {
- var matches = resp.result["curMatches"].ToObject<List<AdversaryInfo_Arenas>>();
- callback?.Invoke(matches.ToList());
- });
- }
- /// <summary>
- /// [6812] 竞技场 - 挑战对手
- /// </summary>
- /// <param name="target_uid"></param>
- /// <param name="win"> 战斗结果0负, 1 胜</param>
- /// <param name="callback"></param>
- public void PVP_PK(string target_uid, bool win, string target_name, string target_headImg, Action<PVP_PK_Ret> callback)
- {
- Post(CmdCode.cmd_pvp_pk, new object[] { target_uid, win, target_name, target_headImg },
- resp => callback?.Invoke(resp.result.ToObject<PVP_PK_Ret>()));
- }
- /// <summary>
- /// [6813] 竞技场 - 设置防守队伍
- /// </summary>
- /// <param name="newTeam"></param>
- /// <param name="callback"></param>
- public void PVP_SetDefTeam(List<string> newTeam, Action<List<string>> callback)
- {
- Post(CmdCode.cmd_pvp_setteam, new object[] { newTeam },
- resp =>
- {
- var ret = resp.result.ToObject<Info_UserPVP>();
- //UnityEngine.Debug.Assert(newTeam == ret);
- UserProxy.Instance.player.pvpRecord = ret;
- callback?.Invoke(ret.defTeam);
- });
- }
- /// <summary>
- /// [6814] 竞技场 - 购买挑战票
- /// </summary>
- /// <param name="amt"> 补充几个</param>
- /// <param name="callback"></param>
- public void PVP_BuyTicket(int amt, Action<PVP_BuyTicket_Ret> callback)
- {
- Post(CmdCode.cmd_pvp_buyTicket, new object[] { amt },
- resp =>
- {
- if (callback != null)
- {
- var ret = resp.result.ToObject<PVP_BuyTicket_Ret>();
- UserProxy.Instance.player.pvpRecord.fightTicket = ret.fightTicket; // 同步挑战票
- UserProxy.Instance.player.baseInfo.cash = ret.userCash; // 同步玩家钻石
- callback.Invoke(ret);
- }
- });
- }
- /// <summary>
- /// 6815 竞技场 - 拉取排行榜信息
- /// </summary>
- /// <param name="start">排名起始索引 1,11,21,31,41,51,61,71,81,91</param>
- /// <param name="num">拉取数量,建议不超10, 排行榜最大500人</param>
- /// <param name="callback"></param>
- public void PVP_getRank(int start, int num, Action<PVP_RankInfo> callback)
- {
- Post(CmdCode.cmd_pvp_getRank, new object[] { start, num },
- resp => callback?.Invoke(resp.result.ToObject<PVP_RankInfo>()));
- }
- /// <summary>
- /// 6816 竞技场 - 查询战报
- /// </summary>
- /// <param name="callback"></param>
- public void PVP_getLog(Action<MyPVPLog> callback)
- {
- Post(CmdCode.cmd_pvp_getLog, new object[] { }, resp => callback?.Invoke(resp.result.ToObject<MyPVPLog>()));
- }
- #endregion
- #region ' 竞技 商店 '
- /// <summary>
- /// [6820] 竞技商店 - 主界面
- /// </summary>
- /// <param name="callback"></param>
- public void PVP_ShopMain(Action<Info_UserPVP> callback)
- {
- Post(CmdCode.cmd_fight_pvpShop_getMainInfo, new object[] { },
- resp =>
- {
- var ret = resp.result.ToObject<Info_UserPVP>();
- UserProxy.Instance.player.pvpRecord = ret;
- callback?.Invoke(ret);
- });
- }
- /// <summary>
- /// [6821] 竞技商店 - 购买道具
- /// </summary>
- /// <param name="callback"></param>
- public void PVP_ShopBuy(int itemId, Action<Info_UserPVP> callback)
- {
- Post(CmdCode.cmd_fight_pvpShop_buy, new object[] { itemId },
- resp =>
- {
- var p = UserProxy.Instance.player;
- var ret = resp.result["pvp"].ToObject<Info_UserPVP>();
- //p.InitFromStore(resp.result["store"] as JObject);
- p.pvpRecord = ret;
- callback?.Invoke(ret);
- });
- }
- /// <summary>
- /// [6822] 竞技商店 - 刷新道具
- /// </summary>
- /// <param name="callback"></param>
- public void PVP_ShopRefresh(Action<Info_UserPVP> callback)
- {
- Post(CmdCode.cmd_fight_pvpShop_refresh, new object[] { },
- resp =>
- {
- var ret = resp.result.ToObject<Info_UserPVP>();
- UserProxy.Instance.player.pvpRecord = ret;
- callback?.Invoke(ret);
- });
- }
- #endregion
- #region ' 世界boss '
- public void BossFight_Enter(int bossid) {
- Post(CmdCode.fight_worldBoss_enter, new object[] { BossFight.Instance.bossId },
- resp => {
- });
- }
- /// <summary>
- /// 6834 世界boss, 拉取排行榜
- /// </summary>
- /// <param name="callback"></param>
- public void BossFight_GetRank(Action<Dictionary<string, int>> callback)
- {
- Post(CmdCode.fight_worldBoss_refresh_rank, new object[] {BossFight.Instance.bossId },
- resp =>
- {
- var dic2 = new Dictionary<string, int>();
- if (resp.result["rank"].Count() > 0)
- {
- var dic = resp.result["rank"].ToObject<Dictionary<string, int>>();
- foreach (var kv in dic)
- {
- var arr = kv.Key.Explode("__");
- var name = (arr.Length > 1 ? arr[1] : arr[0]) ?? "-";
- dic2.Add(kv.Key.Substring(kv.Key.IndexOf("__") + 2), kv.Value);
- }
- }
- callback?.Invoke(dic2);
- });
- }
- #endregion
- #region ' 无尽塔 '
- /// <summary>
- /// 6841 无尽塔 - 查询当前进度
- /// </summary>
- /// <param name="callback"></param>
- public void EndlessTower_Get(Action<int> callback)
- {
- Post(CmdCode.fight_endlessTower_Get, new object[] { },
- resp => callback?.Invoke(resp.result["index"].ToObject<int>()));
- }
- /// <summary>
- /// 6842 无尽塔 - 前进
- /// </summary>
- /// <param name="passIndex">刚通关的索引</param>
- /// <param name="callback"></param>
- public void EndlessTower_Up(int passIndex, Action<int> callback)
- {
- Post(CmdCode.fight_endlessTower_Up, new object[] { passIndex },
- resp =>
- {
- var p = UserProxy.Instance.player;
- p.baseInfo = resp.result["baseInfo"].ToObject<Info_UserBase>();
- callback?.Invoke(resp.result["index"].ToObject<int>());
- });
- }
- /// <summary>
- /// 6843 无尽塔 - 领取特殊奖励
- /// </summary>
- /// <param name="index">遇到 5/10 会有特殊奖励可领取</param>
- /// <param name="callback">奖励字符串请自取</param>
- public void EndlessTower_Drawreward(int index, Action callback)
- {
- Post(CmdCode.fight_endlessTower_Drawreward, new object[] { index },
- resp =>
- {
- var p = UserProxy.Instance.player;
- p.baseInfo = resp.result["baseInfo"].ToObject<Info_UserBase>();
- callback?.Invoke();
- });
- }
- #endregion
- #region-------战斗复活
- /// <summary>
- /// 满血复活
- /// </summary>
- /// <param name="callback"></param>
- public void BackBloodRevive(Action<bool> callback)
- {
- Post(CmdCode.fight_fullBlood, new object[] { },
- resp =>
- {
- var p = UserProxy.Instance.player;
- p.baseInfo.cash = int.Parse(resp.result["cash"].ToString());
- callback?.Invoke(true);
- });
- }
- #endregion
- #region 内部类
- /// <summary>
- /// 任务/挑战目标达成记录(三星评价)
- /// </summary>
- /// <author>gwang</author>
- //[Obsolete("评星已经没什么意义了, 现在追求的是关卡内掉落.")] // ps. 2021.又给恢复了
- [Obsolete("后来又改成开放地图模式, 没有关卡了 -gwang 2022")]
- public class GateStar
- {
- /// <summary>
- /// 根据三个条件达成情况构造(战斗结果转给后台)
- /// </summary>
- /// <param name="p1"></param>
- /// <param name="p2"></param>
- /// <param name="p3"></param>
- public GateStar(bool p1, bool p2, bool p3)
- { this.S1 = p1; this.S2 = p2; this.S3 = p3; }
- /// <summary>
- /// 根据后台记录的数值构造(反向提供给前端显示层)
- /// </summary>
- /// <param name="i"></param>
- public GateStar(int i)
- {
- this.S1 = (i & 1) > 0;
- this.S2 = (i & 2) > 0;
- this.S3 = (i & 4) > 0;
- }
- /// <summary>
- /// 第一个目标达成
- /// </summary>
- public readonly bool S1;
- /// <summary>
- /// 第二个目标达成
- /// </summary>
- public readonly bool S2;
- /// <summary>
- /// 第三个目标达成
- /// </summary>
- public readonly bool S3;
- /// <summary>
- /// 取其压缩格式(三个变量压缩到一个int值中)
- /// </summary>
- /// <returns></returns>
- public int ToIntValue()
- {
- return ((S3 ? 1 : 0) << 2) | ((S2 ? 1 : 0) << 1) | (S1 ? 1 : 0);
- }
- /// <summary>
- /// 统计总星数
- /// </summary>
- public int Count => (S3 ? 1 : 0) + (S2 ? 1 : 0) + (S1 ? 1 : 0);
- }
- #region 普通挑战
- /// <summary>
- /// (挑战)对手信息
- /// </summary>
- /// <remarks >用该数据初始化对手战场信息的时候, 注意理清数据来源,不要引用到玩家的数据去(比如hero,equip和yanling)</remarks>
- public class AdversaryInfo
- {
- /// <summary>
- /// uid
- /// </summary>
- public string uid;
- /// <summary>
- /// 昵称
- /// </summary>
- public string name;
- /// <summary>
- /// 等级
- /// </summary>
- public int level;
- /// <summary>
- /// 头像
- /// </summary>
- public string headImg;
- /// <summary>
- /// 玩家装备数据
- /// </summary>
- public GameCollectEquips equipment;
- /// <summary>
- /// 玩家言灵数据
- /// </summary>
- public GameCollectYanling yanling;
- /// <summary>
- /// 玩家战队英雄数据集合
- /// </summary>
- public Dictionary<string, GameHeroVo> heros = new Dictionary<string, GameHeroVo>();
- }
- /// <summary>
- /// (挑战)日志
- /// </summary>
- public class MyChallengeLog
- {
- /// <summary>
- /// 主动挑战记录
- /// </summary>
- public List<AdversaryInfo> offLog;
- /// <summary>
- /// 被动防守记录
- /// </summary>
- public List<AdversaryInfo> defLog;
- /// <summary>
- /// 对手信息(简)
- /// </summary>
- public class AdversaryInfo
- {
- /// <summary>
- /// uid
- /// </summary>
- public string uid;
- /// <summary>
- /// 昵称
- /// </summary>
- public string name;
- /// <summary>
- /// 头像
- /// </summary>
- public string headImg;
- /// <summary>
- /// 战斗结果
- /// </summary>
- public bool win;
- /// <summary>
- /// 胜利者留言
- /// </summary>
- public string msg;
- /// <summary>
- /// 时间戳
- /// </summary>
- public int ts;
- // 其他信息再添加
- // . . . . . .
- }
- }
- #endregion
- #region 竞技场
- /// <summary>
- /// 竞技场 对手信息(比普通挑战对手增加了竞技场积分和总战力信息)
- /// </summary>
- public class AdversaryInfo_Arenas : AdversaryInfo
- {
- /// <summary>
- /// 竞技场积分
- /// </summary>
- public int score = 0;
- /// <summary>
- /// 总战力
- /// </summary>
- public int fpower = 0;
- }
- /// <summary>
- /// 竞技场主界面所需信息
- /// </summary>
- public class PVP_Main_UIVo
- {
- /// <summary>
- /// 竞技场积分
- /// </summary>
- public int score;
- /// <summary>
- /// 竞技场排名
- /// </summary>
- public int rank;
- /// <summary>
- /// 竞技币
- /// </summary>
- public int pvpCoins;
- /// <summary>
- /// 总战力
- /// </summary>
- public int fPower;
- /// <summary>
- /// 挑战票
- /// </summary>
- public int fightTicket;
- /// <summary>
- /// 玩家自己的防守战队(英雄的uid列表)
- /// </summary>
- public List<string> defTeam;
- /// <summary>
- /// 新挑战记录条数
- /// </summary>
- public int numNewLog;
- /// <summary>
- /// 匹配对手
- /// </summary>
- public List<AdversaryInfo_Arenas> matches;
- /// <summary>
- /// 当前奖励
- /// </summary>
- /// <returns></returns>
- public sm_pvp_rankreward currentReward()
- {
- return sm_pvp_rankreward.GetMoByRank(this.rank);
- }
- /// <summary>
- /// 产看所有奖励
- /// </summary>
- /// <returns></returns>
- public List<sm_pvp_rankreward> HaveALookOfAllRewards()
- {
- return GameConfigData.Ins.pvp_rankreward.Values.ToList();
- }
- }
- /// <summary>
- /// 竞技场挑战对手返回值
- /// </summary>
- public class PVP_PK_Ret
- {
- /// <summary>
- /// 自己剩余免费票
- /// </summary>
- public int freeFightTickets;
- /// <summary>
- /// 自己剩余挑战票
- /// </summary>
- public int fightTicket;
- /// <summary>
- /// 自己挑战之前积分
- /// </summary>
- public int RA;
- /// <summary>
- /// 对手挑战之前积分
- /// </summary>
- public int RB;
- /// <summary>
- /// 自己最新积分
- /// </summary>
- public int R_A;
- /// <summary>
- /// 对手最新积分
- /// </summary>
- public int R_B;
- /// <summary>
- /// 排名变化
- /// </summary>
- public int rank_diff;
- /// <summary>
- /// 最新排名
- /// </summary>
- public int rank_new;
- }
- /// <summary>
- /// 竞技场 购买挑战票返回值
- /// </summary>
- public class PVP_BuyTicket_Ret
- {
- /// <summary>
- /// 最新挑战票数量
- /// </summary>
- public int fightTicket;
- /// <summary>
- /// 花费钻石
- /// </summary>
- public int costCash;
- /// <summary>
- /// 玩家剩余钻石
- /// </summary>
- public int userCash;
- }
- /// <summary>
- /// (竞技场)战斗日志
- /// </summary>
- public class MyPVPLog
- {
- /// <summary>
- /// 主动挑战记录
- /// </summary>
- public List<AdversaryInfo> offLog;
- /// <summary>
- /// 被动防守记录
- /// </summary>
- public List<AdversaryInfo> defLog;
- /// <summary>
- /// 对手信息(简)
- /// </summary>
- public class AdversaryInfo
- {
- /// <summary>
- /// uid
- /// </summary>
- public string uid;
- /// <summary>
- /// 昵称
- /// </summary>
- public string name;
- /// <summary>
- /// 头像
- /// </summary>
- public string headImg;
- /// <summary>
- /// 战斗结果
- /// </summary>
- public bool win;
- /// <summary>
- /// 胜利者留言
- /// </summary>
- public string msg;
- /// <summary>
- /// 时间戳
- /// </summary>
- public int ts;
- /// <summary>
- /// 积分变更信息
- /// </summary>
- public int scoreInfo;
- // 其他信息再添加
- // . . . . . .
- }
- }
- /// <summary>
- /// 竞技场 排行榜信息
- /// </summary>
- public class PVP_RankInfo
- {
- /// <summary>
- /// 玩家列表
- /// </summary>
- public Dictionary<int, AdversaryInfo_Arenas> dic;
- /// <summary>
- /// 我的排名
- /// </summary>
- public int myRank;
- /// <summary>
- /// 我的积分
- /// </summary>
- public int myScore;
- }
- #endregion
- #endregion
- }
|