RedDotData.cs 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using Excel2Json;
  5. using Fort23.Core;
  6. using Fort23.UTool;
  7. using GameLogic.Hero;
  8. using Utility;
  9. namespace Fort23.Mono
  10. {
  11. public class RedDotData
  12. {
  13. /// <summary>
  14. /// 具体Id
  15. /// </summary>
  16. public int Id;
  17. /// <summary>
  18. /// 红点组ID
  19. /// </summary>
  20. public int GroupId;
  21. /// <summary>
  22. /// 当前红点所属于层级 1级为最上层
  23. /// </summary>
  24. public int Layer;
  25. /// <summary>
  26. /// 是否已经激活
  27. /// </summary>
  28. private bool _isEnable;
  29. public bool isEnable
  30. {
  31. get { return _isEnable; }
  32. set { _isEnable = value; }
  33. }
  34. public int EnableId;
  35. public void Update()
  36. {
  37. switch (GroupId)
  38. {
  39. //上阵的功法可以升级显示红点
  40. case 16:
  41. isEnable = false;
  42. switch (EnableId)
  43. {
  44. case 0: //没有自己的红点逻辑根据下层红点来决定
  45. isEnable = RedDotManager.Instance.AllRedDotGroupData[GroupId].TargetLayerIsEnable(Layer);
  46. break;
  47. case 1:
  48. foreach (var _skillInfo in PlayerManager.Instance.GongFaControl.allSkill)
  49. {
  50. if (RedDotManager.Instance.isSkillStar(_skillInfo))
  51. {
  52. isEnable = true;
  53. return;
  54. }
  55. }
  56. foreach (var _skillInfo in PlayerManager.Instance.GongFaControl.allUseSkill)
  57. {
  58. if (!PlayerManager.Instance.GongFaControl.allUseSkill.Contains(_skillInfo))
  59. {
  60. continue;
  61. }
  62. if (RedDotManager.Instance.isSkillUpgradeDaYu4(_skillInfo))
  63. {
  64. isEnable = true;
  65. return;
  66. }
  67. }
  68. break;
  69. }
  70. break;
  71. case 14:
  72. isEnable = false;
  73. switch (EnableId)
  74. {
  75. case 0: //没有自己的红点逻辑根据下层红点来决定
  76. isEnable = RedDotManager.Instance.AllRedDotGroupData[GroupId].TargetLayerIsEnable(Layer);
  77. break;
  78. case 1:
  79. int count = 0;
  80. for (var i = 0; i < PlayerManager.Instance.GongFaControl.allUseSkill.Length; i++)
  81. {
  82. if (PlayerManager.Instance.GongFaControl.allUseSkill[i] != null &&
  83. PlayerManager.Instance.GongFaControl.allUseSkill[i].skillConfig.SkillType == 1)
  84. {
  85. count++;
  86. }
  87. }
  88. if (count < PlayerManager.Instance.myHero.powerUpConfig.MaxActiveGongfaNum)
  89. {
  90. isEnable = true;
  91. }
  92. break;
  93. }
  94. break;
  95. case 17:
  96. isEnable = false;
  97. switch (EnableId)
  98. {
  99. case 0: //没有自己的红点逻辑根据下层红点来决定
  100. isEnable = RedDotManager.Instance.AllRedDotGroupData[GroupId].TargetLayerIsEnable(Layer);
  101. break;
  102. case 1:
  103. int count = 0;
  104. for (var i = 0; i < PlayerManager.Instance.GongFaControl.allUseSkill.Length; i++)
  105. {
  106. if (PlayerManager.Instance.GongFaControl.allUseSkill[i] != null &&
  107. PlayerManager.Instance.GongFaControl.allUseSkill[i].skillConfig.SkillType == 2)
  108. {
  109. count++;
  110. }
  111. }
  112. if (count < PlayerManager.Instance.myHero.powerUpConfig.MaxPassiveGongfaNum)
  113. {
  114. isEnable = true;
  115. }
  116. break;
  117. }
  118. break;
  119. //境界升级
  120. case 5:
  121. isEnable = false;
  122. switch (EnableId)
  123. {
  124. case 0: //没有自己的红点逻辑根据下层红点来决定
  125. isEnable = RedDotManager.Instance.AllRedDotGroupData[GroupId].TargetLayerIsEnable(Layer);
  126. break;
  127. case 1:
  128. float allexp = PlayerManager.Instance.myHero.GetAllExp();
  129. if (allexp <
  130. PlayerManager.Instance.myHero.powerUpConfig.levelUpExp)
  131. {
  132. isEnable = false;
  133. return;
  134. }
  135. int redDotID = 5;
  136. AccountFileInfo.RedDot redDot = RedDotManager.Instance.GetRedDot(redDotID);
  137. HeroInfo heroInfo = PlayerManager.Instance.myHero.CopyHero();
  138. heroInfo.InitHero(PlayerManager.Instance.myHero.heroData.heroModelId,
  139. PlayerManager.Instance.myHero.heroData.heroPowerId + 1);
  140. if (PlayerManager.Instance.myHero.powerUpConfig.jingjie1 == heroInfo.powerUpConfig.jingjie1)
  141. {
  142. //小突破
  143. if (PlayerManager.Instance.myHero.powerUpConfig.jingjie2 ==
  144. heroInfo.powerUpConfig.jingjie2)
  145. {
  146. isEnable = true;
  147. return;
  148. }
  149. //大突破
  150. else
  151. {
  152. for (var i = 0;
  153. i < PlayerManager.Instance.myHero.powerUpConfig.DujieMustItemIDs.Length;
  154. i++)
  155. {
  156. if (!PlayerManager.Instance.BagController.IsEnough(
  157. PlayerManager.Instance.myHero.powerUpConfig.DujieMustItemIDs[i], 1))
  158. {
  159. isEnable = false;
  160. return;
  161. }
  162. }
  163. if (PlayerManager.Instance.myHero.powerUpConfig.ID > 60)
  164. {
  165. //当前升级已经查看了也不显示红点
  166. if (redDot != null &&
  167. redDot.Params.Contains(
  168. PlayerManager.Instance.myHero.powerUpConfig.ID.ToString()))
  169. {
  170. isEnable = false;
  171. return;
  172. }
  173. }
  174. }
  175. }
  176. //渡劫
  177. else
  178. {
  179. for (var i = 0;
  180. i < PlayerManager.Instance.myHero.powerUpConfig.DujieMustItemIDs.Length;
  181. i++)
  182. {
  183. if (!PlayerManager.Instance.BagController.IsEnough(
  184. PlayerManager.Instance.myHero.powerUpConfig.DujieMustItemIDs[i], 1))
  185. {
  186. isEnable = false;
  187. return;
  188. }
  189. }
  190. if (PlayerManager.Instance.myHero.powerUpConfig.ID > 60)
  191. {
  192. //当前升级已经查看了也不显示红点
  193. if (redDot != null &&
  194. redDot.Params.Contains(
  195. PlayerManager.Instance.myHero.powerUpConfig.ID.ToString()))
  196. {
  197. isEnable = false;
  198. return;
  199. }
  200. }
  201. }
  202. isEnable = true;
  203. break;
  204. }
  205. break;
  206. case 7: //具上的代金卷可以免费抽
  207. isEnable = false;
  208. switch (EnableId) //具体出现条件
  209. {
  210. case 0: //没有自己的红点逻辑根据下层红点来决定
  211. isEnable = RedDotManager.Instance.AllRedDotGroupData[GroupId].TargetLayerIsEnable(Layer);
  212. break;
  213. case 1:
  214. AccountFileInfo.SummonData summonData =
  215. PlayerManager.Instance.SummonManager.summonDataMap[1];
  216. OpenBoxConfig openBoxConfig = ConfigComponent.Instance.Get<OpenBoxConfig>(1);
  217. //有免费次数,并且让到时间了就免费抽
  218. if (summonData.tenFreeCount < openBoxConfig.oneConsumeFreePara_1[1] &&
  219. PlayerManager.Instance.serverTime >= summonData.nextTenFreeTime)
  220. {
  221. isEnable = true;
  222. return;
  223. }
  224. isEnable = false;
  225. break;
  226. }
  227. break;
  228. case 8: //法宝可以升级或者有新槽位
  229. isEnable = false;
  230. switch (EnableId) //具体出现条件
  231. {
  232. case 0: //没有自己的红点逻辑根据下层红点来决定
  233. isEnable = RedDotManager.Instance.AllRedDotGroupData[GroupId].TargetLayerIsEnable(Layer);
  234. break;
  235. case 1:
  236. for (int i = 0; i < 4; i++)
  237. {
  238. FaBaoInfo faBaoInfo = PlayerManager.Instance.FaBaoControl.FightFaBao[i];
  239. if (RedDotManager.Instance.IsFabaoUpgrade1(i, faBaoInfo))
  240. {
  241. isEnable = true;
  242. return;
  243. }
  244. }
  245. break;
  246. }
  247. break;
  248. case 11: //挂机奖励大于300分钟
  249. isEnable = false;
  250. switch (EnableId) //具体出现条件
  251. {
  252. case 0: //没有自己的红点逻辑根据下层红点来决定
  253. isEnable = RedDotManager.Instance.AllRedDotGroupData[GroupId].TargetLayerIsEnable(Layer);
  254. break;
  255. case 1:
  256. if (AccountFileInfo.Instance.playerData.QiankundaiLingQuAwardTime == 0)
  257. {
  258. isEnable = true;
  259. return;
  260. }
  261. int miao = (int)((PlayerManager.Instance.serverTime -
  262. AccountFileInfo.Instance.playerData.QiankundaiLingQuAwardTime) / 1000);
  263. if (miao >= 300)
  264. {
  265. isEnable = true;
  266. }
  267. break;
  268. }
  269. break;
  270. case 15: //丹药小红点
  271. isEnable = false;
  272. switch (EnableId) //具体出现条件
  273. {
  274. case 0: //没有自己的红点逻辑根据下层红点来决定
  275. isEnable = RedDotManager.Instance.AllRedDotGroupData[GroupId].TargetLayerIsEnable(Layer);
  276. break;
  277. case 1:
  278. foreach (var keyValuePair in PlayerManager.Instance.BagController.allBagDic)
  279. {
  280. if (keyValuePair.Value.config.itemTag == 5 && keyValuePair.Value.count.Value > 0)
  281. {
  282. isEnable = true;
  283. return;
  284. }
  285. }
  286. break;
  287. }
  288. break;
  289. }
  290. }
  291. }
  292. }