WealthData.ts 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. import AdM from "../manager/AdM";
  2. import GameM from "../manager/GameM";
  3. import HttpM from "../manager/HttpM";
  4. import { thirdVideoTS } from "../manager/topon/AnyThinkAdsMgr/thirdVideoTS";
  5. import WealthMng, { WealthState } from "../manager/WealthMng";
  6. import UIMng, { PanelType } from "../uiFrames/UIMng";
  7. import Random from "../utils/Random";
  8. import Sciencen_M from "../utils/Sciencen_M";
  9. import { HTTP_TYPE } from "./CommonData";
  10. import { MateData } from "./MateData";
  11. export class WealthData {
  12. //财神降临数据管理类
  13. private static _ins: WealthData = null;
  14. public static get Ins(): WealthData {
  15. if (this._ins == null) {
  16. this._ins = new WealthData();
  17. }
  18. return this._ins;
  19. }
  20. wealthMng: WealthMng = null;
  21. isUnlock: boolean = false;
  22. wealthInfo: any = null;
  23. /**财神配置文件*/
  24. wealthCfg: any = null;
  25. /**已挑战次数*/
  26. challengedTimes: number = 0;
  27. /**能挑战的总次数*/
  28. challengeTimes: number = 2;
  29. private isFirstChallenge: boolean = false;
  30. blood: string = "200";
  31. bloodValue: string = "200";
  32. giftValue: string = "150";
  33. /**财神挑战周期*/
  34. lifeDuration: number = 100;
  35. /**财神降临周期计时器 初始化 后台获取*/
  36. lifeTimer: number = 0;
  37. /**冷却时间*/
  38. coolingTime: number = 20;
  39. /**是否在冷却中*/
  40. isCooling: boolean = false;
  41. /**冷却时间计时器 初始化 后台获取*/
  42. coolingTimer: number = 0;
  43. /**金钟罩时间*/
  44. shieldTime: number = 10;
  45. /**金钟罩计时器 初始化 后台获取*/
  46. shieldTimer: number = 0;
  47. shieldIndex: number = 0;
  48. /**金钟罩触发的血量值数组*/
  49. shieldBloods: number[] = [150, 130, 100, 50, 10];
  50. /**眩晕技能 技能1 触发概率*/
  51. skill1Rate: number = 5;
  52. /**眩晕时间*/
  53. skill1Time: number = 30;
  54. /**眩晕时间计时器*/
  55. skill1Timer: number = 0;
  56. /**血量系数 金币系数*/
  57. paramBlood: number = 3.5;
  58. /**结算礼包金币系数*/
  59. paramGift: number = 2;
  60. /**武将攻击系数 财神掉落的金币*/
  61. paramMasterAttack: number = 0.0005;
  62. /**玩家攻击系数数组*/
  63. paramPlayAttackECPMAry: string[] = null;
  64. /**金钟罩触发系数 血量百分比 数组*/
  65. paramBloodShieldECPMAry: string[] = null;
  66. norEcpm: number = 100;
  67. /**武将攻击间隔系数*/
  68. paramAttackTime: number = 1;
  69. /**平均ecpm*/
  70. paramEcpm: number = 0;
  71. /**ecpm请求是否完毕*/
  72. private isReqEcpmEnd: boolean = false;
  73. /**财神开始战斗请求是否完毕*/
  74. private isReqFightEnd: boolean = false;
  75. /**是否开始战斗 完全进入战斗*/
  76. isWealthing: boolean = false;
  77. /**是否触发战斗*/
  78. isTriggerWealth: boolean = false;
  79. //1.冷却 2.可触发 3.已触发(战斗) 4.云游
  80. //wealthGodStatus
  81. //operationType 1.可触发 2.战斗 3.战斗结束
  82. Destroy() {
  83. WealthData._ins = null;
  84. if (this.wealthMng != null) {
  85. this.wealthMng.Destroy();
  86. }
  87. }
  88. /**财神战斗数据初始化*/
  89. WealthFightInit() {
  90. this.shieldIndex = 0;
  91. this.isTriggerWealth = true;
  92. }
  93. /**检查是否满足金钟罩技能触发条件
  94. */
  95. CheckShield() {
  96. let param = 0;
  97. for (let i = 0; i < this.paramBloodShieldECPMAry.length; i++) {
  98. if (Number(Sciencen_M.instance.accDiv(this.blood, this.bloodValue)) > Number(this.paramBloodShieldECPMAry[i].split(',')[0])) {
  99. param = Number(this.paramBloodShieldECPMAry[i].split(',')[1]);
  100. break;
  101. }
  102. }
  103. //console.log("Shield Rate P:" + param);
  104. if (this.paramEcpm <= this.norEcpm) {
  105. param *= (1 + Math.min(0.8, (this.norEcpm - this.paramEcpm) / 40 * 0.42));
  106. } else {
  107. param *= (1 - Math.min(0.15, (this.paramEcpm - this.norEcpm) / 80 * 0.06));
  108. }
  109. //console.log("Shield Rate: " + param + " a:" + this.paramEcpm + " b:" + this.norEcpm);
  110. //param = 0;
  111. return Random.Range(0, 100, false) < param;
  112. //console.log("Index: "+this.shieldIndex+" cur: "+curblood+" Target: "+this.shieldBloods[this.shieldIndex]);
  113. //if (this.shieldIndex < this.shieldBloods.length
  114. // && curblood <= this.shieldBloods[this.shieldIndex]) {
  115. // this.shieldIndex++;
  116. // //console.log("-------------1");
  117. // return true;
  118. //}
  119. //return false;
  120. }
  121. /**检测是否触发眩晕技能*/
  122. CheckTriggerSkill1() {
  123. let p = Random.Range(0, 100, false);
  124. //console.log("--CheckSkillRandom:" + p + " TargetRate:" + this.skill1Rate);
  125. if (p < this.skill1Rate) {
  126. return true;
  127. }
  128. return false;
  129. }
  130. /**触发*/
  131. CheckTrigger() {
  132. //财神降临
  133. //console.log("--CheckTriggerWealth: IsUnlock:" + this.isUnlock + " ClgedTimes:" + this.challengedTimes + " ClgTimes: " + this.challengeTimes);
  134. //console.log("--CheckTriggerWealth: Info:", this.wealthInfo);
  135. if (this.wealthInfo != null && this.wealthInfo.wealthGodStatus != 3 && Random.Range(0, 100, false) < this.wealthCfg.TriggerRate) {
  136. WealthMng.Ins.CheckTriggerWealth();
  137. }
  138. }
  139. /**检查是否可以触发财神降临*/
  140. CheckTriggerWealth(isunlocktrigger: boolean = false, callback: Function) {
  141. if (this.isUnlock && this.challengedTimes < this.challengeTimes) {
  142. if (!this.isCooling) {
  143. console.log("trigger");
  144. this.isReqEcpmEnd = this.isReqFightEnd = this.isWealthing = false;
  145. this.GoldInit();
  146. //获取ecpm
  147. HttpM.Instance.SendData(HTTP_TYPE.adShowConfig,
  148. {}, (res) => {
  149. //console.log("redMoneyInGiftBag:", res);
  150. if (res && res.data) {
  151. this.paramEcpm = res.data.average_ecpm;
  152. this.isReqEcpmEnd = true;
  153. if (this.isReqEcpmEnd && this.isReqFightEnd) {
  154. this.TriggerWealth(callback);
  155. }
  156. }
  157. }, null, () => {
  158. this.isReqEcpmEnd = true;
  159. })
  160. if (isunlocktrigger) {
  161. this.isReqFightEnd = true;
  162. if (this.isReqEcpmEnd && this.isReqFightEnd) {
  163. this.TriggerWealth(callback);
  164. }
  165. } else {
  166. //operationType 1.可触发 2.战斗 3.战斗结束
  167. HttpM.Instance.SendData(HTTP_TYPE.wealthUpdateStatus, {
  168. consumeGold: "0",
  169. gold: this.bloodValue,
  170. giftGold: this.giftValue,
  171. operationType: 2
  172. }, (res) => {
  173. console.log("-->WealthUpdateStatus fight:", res);
  174. if (res.data != null) {
  175. this.wealthInfo = res.data.WealthGodInfo;
  176. this.lifeTimer = res.data.WealthGodInfo.endLifeSurplusTime;
  177. this.isFirstChallenge = res.data.WealthGodInfo.isFistChallenge == 1;
  178. this.isReqFightEnd = true;
  179. if (this.isReqEcpmEnd && this.isReqFightEnd) {
  180. this.TriggerWealth(callback);
  181. }
  182. }
  183. });
  184. }
  185. }
  186. }
  187. }
  188. /**触发战斗*/
  189. TriggerWealth(callback: Function) {
  190. if (!this.isWealthing) {
  191. this.isWealthing = true;
  192. this.challengedTimes++;
  193. callback();
  194. AdM.onSendEvent('caishen_fight', '财神触发战斗', 'caishen');
  195. GameM.commonData.addDailyFinishTimesDataByType(8)
  196. }
  197. }
  198. /**财神降临开始冷却计时*/
  199. WealthCooling() {
  200. this.lifeTimer = 0;
  201. if (this.challengedTimes >= this.challengeTimes) {
  202. this.coolingTimer = 0;
  203. this.isCooling = false;
  204. this.wealthMng.isCooling = false;
  205. } else {
  206. this.coolingTimer = this.coolingTime;
  207. this.isCooling = true;
  208. this.wealthMng.isCooling = true;
  209. }
  210. }
  211. /**财神准备就位*/
  212. WealthReady() {
  213. this.wealthMng.isCooling = false;
  214. this.isCooling = false;
  215. this.coolingTimer = 0;
  216. this.wealthMng.wealthState = WealthState.ReadyFight;
  217. //operationType 1.可触发 2.战斗 3.战斗结束
  218. HttpM.Instance.SendData(HTTP_TYPE.wealthUpdateStatus, {
  219. consumeGold: "0",
  220. gold: this.bloodValue,
  221. giftGold: this.giftValue,
  222. operationType: 1
  223. }, (res) => {
  224. if (res.data != null) {
  225. this.wealthInfo = res.data.WealthGodInfo;
  226. console.log("-->WealthUpdateStatus ready:", res);
  227. }
  228. });
  229. }
  230. /**直接切换为战斗状态 离开游戏时 还处于财神降临状态*/
  231. SwitchFightingState() {
  232. //this.coolingTimer = 20;
  233. //this.lifeTimer = 20;
  234. //this.shieldTimer = 10;
  235. this.isWealthing = true;
  236. this.isCooling = this.coolingTimer > 0;
  237. console.log("Cooling1:" + this.isCooling);
  238. }
  239. Click_MainWealthBtn() {
  240. //console.log("+++++------");
  241. if (this.wealthMng.wealthState != WealthState.Fighting) {
  242. if (this.challengedTimes < this.challengeTimes) {
  243. console.log("Cooling:" + this.isCooling);
  244. if (!this.isCooling) {
  245. console.log("-------1");
  246. UIMng.Ins.AsyncGetPanel(PanelType.WealthPanel, (panel) => {
  247. panel.OnEnter(1);
  248. });
  249. //UIMng.Ins.GetPanel(PanelType.WealthPanel).OnEnter(1);
  250. } else {
  251. console.log("-------2");
  252. UIMng.Ins.AsyncGetPanel(PanelType.WealthPanel, (panel) => {
  253. panel.OnEnter(2);
  254. });
  255. //UIMng.Ins.GetPanel(PanelType.WealthPanel).OnEnter(2);
  256. }
  257. } else {
  258. console.log("-------5");
  259. UIMng.Ins.AsyncGetPanel(PanelType.WealthPanel, (panel) => {
  260. panel.OnEnter(5);
  261. });
  262. //UIMng.Ins.GetPanel(PanelType.WealthPanel).OnEnter(5);
  263. }
  264. } else {
  265. console.log("-------6");
  266. UIMng.Ins.AsyncGetPanel(PanelType.WealthPanel, (panel) => {
  267. panel.OnEnter(6);
  268. });
  269. //UIMng.Ins.GetPanel(PanelType.WealthPanel).OnEnter(6);
  270. }
  271. }
  272. /**解锁财神降临*/
  273. CheckUnLockWealth() {
  274. if (GameM.commonData.maxCarLevel >= GameM.commonData.unlockWealthLevel) {
  275. this.GoldInit();
  276. HttpM.Instance.SendData(HTTP_TYPE.wealthGodOpen, {
  277. gold: this.bloodValue,
  278. giftGold: this.giftValue
  279. }, (res) => {
  280. //console.log("WealthOpenRes------------:", res);
  281. if (res.data != null) {
  282. console.log("WealthOpen:", res.data);
  283. this.isUnlock = true;
  284. this.wealthInfo = res.data.WealthGodInfo;
  285. this.lifeTimer = res.data.WealthGodInfo.endLifeSurplusTime;
  286. this.shieldTimer = res.data.WealthGodInfo.defenseSurplusSecond;
  287. this.coolingTimer = res.data.WealthGodInfo.coolingSurplusSecond;
  288. this.isFirstChallenge = res.data.WealthGodInfo.isFistChallenge == 1;
  289. console.log("解锁财神:" + this.bloodValue);
  290. console.log("财神参数:武将攻击:" + this.GetMasterDamageCoin(1));
  291. this.wealthMng.CheckTriggerWealth(true);
  292. }
  293. }, null, null, null, false);
  294. }
  295. }
  296. /**财神战斗结束
  297. * @param callback 回调
  298. */
  299. WealthFightEnd(callback: Function = null) {
  300. //this.wealthState = WealthState.ReadyFight;
  301. //
  302. //if (this.challengedTimes < this.challengeTimes) {
  303. // this.coolingTimer = this.coolingTime;
  304. // this.isCooling = true;
  305. // this.wealthMng.isCooling = true;
  306. //}
  307. this.isReqEcpmEnd = this.isReqFightEnd = this.isWealthing = this.isTriggerWealth = false;
  308. //operationType 1.可触发 2.战斗 3.战斗结束
  309. HttpM.Instance.SendData(HTTP_TYPE.wealthUpdateStatus, {
  310. consumeGold: Sciencen_M.instance.subtraction(this.bloodValue, this.blood),
  311. gold: 0,
  312. giftGold: this.giftValue,
  313. operationType: 3
  314. }, (res) => {
  315. console.log("-->WealthUpdateStatus fight end:", res);
  316. if (res.data != null) {
  317. this.wealthInfo = res.data.WealthGodInfo;
  318. //let dnow = new Date();
  319. //console.log("CoolingTimer FightEnd:" + (this.wealthInfo.coolingSurplusSecond - dnow.getTime()));
  320. //this.coolingTimer = (this.wealthInfo.coolingSurplusSecond - dnow.getTime()) * 0.001;
  321. if (callback)
  322. callback();
  323. }
  324. });
  325. }
  326. WealthInit(wealthinfo, ecpm) {
  327. if (this.wealthCfg != null) {
  328. GameM.commonData.unlockWealthLevel = this.wealthCfg.GodOpenGrade;
  329. this.challengeTimes = this.wealthCfg.triggerCount;
  330. this.lifeDuration = this.wealthCfg.triggerTime;
  331. this.coolingTime = this.wealthCfg.coolingTime;
  332. this.shieldTime = this.wealthCfg.CoverskillTime;
  333. this.skill1Time = this.wealthCfg.VertigoskillTime;
  334. this.skill1Rate = this.wealthCfg.Vertigoskillprobability;
  335. this.paramBlood = this.wealthCfg.Beatcoincoefficient;
  336. this.paramGift = this.wealthCfg.Settlementcoincoefficient;
  337. //怪物攻击系数 攻击伤害 掉落的金币
  338. this.paramMasterAttack = this.wealthCfg.Monsters_attack_coefficient
  339. //玩家攻击系数
  340. this.paramPlayAttackECPMAry = this.wealthCfg.Player_attack_coefficient_ecpm.split(";");
  341. this.paramBloodShieldECPMAry = this.wealthCfg.Blood_Coverskill_probability.split(";");
  342. this.norEcpm = this.wealthCfg.NorECPM;
  343. this.paramAttackTime = this.wealthCfg.AttackTimeParam;
  344. }
  345. //1.冷却 2.可触发 3.已触发(战斗) 4.云游
  346. //wealthGodStatus
  347. if (wealthinfo != null) {
  348. this.wealthInfo = wealthinfo;
  349. this.isUnlock = true;
  350. this.lifeTimer = this.wealthInfo.endLifeSurplusTime;
  351. this.shieldTimer = this.wealthInfo.defenseSurplusSecond;
  352. this.isFirstChallenge = this.wealthInfo.isFistChallenge == 1;
  353. let dnow = new Date();
  354. //let dserver=new Date(this.wealthInfo.coolingSurplusSecond);
  355. //console.log("CoolingTimer:" + (this.wealthInfo.coolingSurplusSecond - dnow.getTime() * 0.001));
  356. this.coolingTimer = (this.wealthInfo.coolingSurplusSecond - dnow.getTime() * 0.001);
  357. this.isCooling = this.coolingTimer > 0;
  358. this.blood = Sciencen_M.instance.subtraction(this.wealthInfo.gold, this.wealthInfo.consumeGold);// this.wealthInfo.consumeGold "1000000";// this.wealthInfo.consumeGold;
  359. this.bloodValue = this.wealthInfo.gold;// this.wealthInfo.gold;
  360. this.giftValue = this.wealthInfo.giftGold;
  361. let status = this.wealthInfo.wealthGodStatus;
  362. this.challengedTimes = this.challengeTimes - this.wealthInfo.triggerSurplusCount;
  363. }
  364. this.paramEcpm = ecpm;
  365. console.log("--->WealthDataInit:", wealthinfo, ecpm);
  366. //console.log("-----------PlayCfg:", this.paramPlayAttackECPMAry);
  367. }
  368. WealthStatusInit() {
  369. this.isCooling = this.coolingTimer > 0;
  370. this.wealthMng.isCooling = this.coolingTimer > 0;
  371. }
  372. /**更新财神降临 时间*/
  373. UpdateWealthState() {
  374. //console.log("WealthData2:",this.wealthMng);
  375. if (this.wealthMng.isWealthing || this.coolingTimer > 0) {
  376. //console.log("_______1:"+this.shieldTimer);
  377. HttpM.Instance.SendData(HTTP_TYPE.wealthUpdateTime, {
  378. //coolingSurplusSecond: this.coolingTimer,
  379. defenseSurplusSecond: this.shieldTimer,
  380. endLifeSurplusTime: this.lifeTimer
  381. }, (res) => {
  382. //console.log("WealthTimeStateRes------------:", res);
  383. if (res.data != null) {
  384. //console.log("_____WealthTimeStateRes:", res.data);
  385. }
  386. });
  387. if (this.wealthMng.isWealthing) {
  388. HttpM.Instance.SendData(HTTP_TYPE.wealthUpdateGold, {
  389. consumeGold: Sciencen_M.instance.subtraction(this.bloodValue, this.blood),
  390. gold: this.bloodValue
  391. }, (res) => {
  392. //console.log("wealthUpdateGold------------:", res);
  393. if (res.data != null) {
  394. //console.log("wealthUpdateGold:", res.data);
  395. }
  396. });
  397. }
  398. }
  399. }
  400. GetBloodGold(isDynamicGet: boolean = true) {
  401. if (isDynamicGet) {
  402. let gold = GameM.commonData.buyNumCfg[(GameM.commonData.buyTimeTotal + 1).toString()].gold;
  403. //唐僧天赋3
  404. gold = Sciencen_M.instance.addition(gold, Sciencen_M.instance.accMul(gold, (MateData.Ins.Mate1Talent3 * 0.01).toString()));
  405. gold = Sciencen_M.instance.accMul(gold, this.paramBlood.toString());//Sciencen_M.instance.addition(gold, Sciencen_M.instance.accMul(gold, this.paramBlood.toString()));
  406. //console.log("--------Gold1:" + gold);
  407. return Sciencen_M.instance.format(gold);
  408. } else {
  409. return Sciencen_M.instance.format(this.bloodValue);
  410. }
  411. }
  412. GetGiftGold(isDynamicGet: boolean = true) {
  413. if (isDynamicGet) {
  414. let gold = GameM.commonData.buyNumCfg[(GameM.commonData.buyTimeTotal + 1).toString()].gold;
  415. //唐僧天赋3
  416. gold = Sciencen_M.instance.addition(gold, Sciencen_M.instance.accMul(gold, (MateData.Ins.Mate1Talent3 * 0.01).toString()));
  417. gold = Sciencen_M.instance.accMul(gold, this.paramGift.toString());//Sciencen_M.instance.addition(gold, Sciencen_M.instance.accMul(gold, this.paramGift.toString()));
  418. //console.log("--------Gold2:" + gold);
  419. return Sciencen_M.instance.format(gold);
  420. }
  421. else {
  422. return Sciencen_M.instance.format(this.giftValue);
  423. }
  424. }
  425. /**金币初始化*/
  426. GoldInit() {
  427. let gold = GameM.commonData.buyNumCfg[(GameM.commonData.buyTimeTotal + 1).toString()].gold;
  428. let giftgold = gold;
  429. //唐僧天赋3
  430. gold = Sciencen_M.instance.addition(gold, Sciencen_M.instance.accMul(gold, (MateData.Ins.Mate1Talent3 * 0.01).toString()));
  431. gold = Sciencen_M.instance.accMul(gold, this.paramBlood.toString());// Sciencen_M.instance.addition(gold, Sciencen_M.instance.accMul(gold, this.paramBlood.toString()));
  432. //唐僧天赋3
  433. giftgold = Sciencen_M.instance.addition(giftgold, Sciencen_M.instance.accMul(giftgold, (MateData.Ins.Mate1Talent3 * 0.01).toString()));
  434. giftgold = Sciencen_M.instance.accMul(giftgold, this.paramGift.toString());//Sciencen_M.instance.addition(giftgold, Sciencen_M.instance.accMul(giftgold, this.paramGift.toString()));
  435. this.bloodValue = this.blood = gold;
  436. this.giftValue = giftgold;
  437. }
  438. /**获取武将攻击伤害 掉落的金币*/
  439. GetMasterDamageCoin(masterlv: number) {
  440. let gold = Sciencen_M.instance.accDiv(this.bloodValue, this.paramBlood.toString());
  441. //唐僧天赋3
  442. gold = Sciencen_M.instance.addition(gold, Sciencen_M.instance.accMul(gold, (MateData.Ins.Mate1Talent3 * 0.01).toString()));
  443. let p = this.paramMasterAttack / Number(GameM.commonData.carCfg[masterlv.toString()].cost_time) * this.paramAttackTime * GameM.commonData.carCfg[masterlv.toString()].attack_rate;
  444. //gold = Sciencen_M.instance.accMul(gold, this.paramMasterAttack.toString());
  445. //p=0;
  446. gold = Sciencen_M.instance.accMul(gold, p.toString());
  447. //console.log("--MasterAttack:"+gold);
  448. return gold;
  449. }
  450. /**获取玩家攻击伤害 掉落的金币*/
  451. GetPlayDamageCoin() {
  452. let gold = Sciencen_M.instance.accDiv(this.bloodValue, this.paramBlood.toString());
  453. //唐僧天赋3
  454. gold = Sciencen_M.instance.addition(gold, Sciencen_M.instance.accMul(gold, (MateData.Ins.Mate1Talent3 * 0.01).toString()));
  455. //console.log("-----------PlayCfg:", this.paramPlayAttackECPMAry);
  456. let param = 1;
  457. for (let i = 0; i < this.paramPlayAttackECPMAry.length; i++) {
  458. if (this.paramEcpm <= Number(this.paramPlayAttackECPMAry[i].split(',')[0])) {
  459. param = Number(this.paramPlayAttackECPMAry[i].split(',')[1]);
  460. break;
  461. }
  462. }
  463. if (this.isFirstChallenge) {
  464. //param *= this.wealthCfg.FirstChallengeAtkParam;
  465. gold = Sciencen_M.instance.accMul(gold, this.wealthCfg.FirstChallengeAtkParam.toString());
  466. } else {
  467. gold = Sciencen_M.instance.accMul(gold, (param * this.paramMasterAttack).toString());
  468. }
  469. //param *= 40; //test
  470. //console.log("---------PlayParam:" + param + " attack:" + this.paramMasterAttack);
  471. //gold = Sciencen_M.instance.accMul(gold, (param * this.paramMasterAttack).toString());
  472. //console.log("---------PlayParam:" + param + " attack:" + this.paramMasterAttack + " gold:" + gold);
  473. //console.log("--PlayerAttack:"+gold);
  474. return gold;
  475. }
  476. /**获取武将攻击时间
  477. * @param type 武将类型id
  478. */
  479. GetMasterAttackTime(type: number) {
  480. return GameM.commonData.carCfg[type.toString()].attack_rate;
  481. }
  482. }