RomanRollPanel.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. var RollPanel = require("LBRollPanel");
  2. var Global = require("Global");
  3. var UIHelper = require("UIHelper");
  4. var BaseDefine = require("BaseDefine");
  5. var GameProtocol = require("RomanGameProtocol");
  6. import ScenceManager from 'HNScenceManager'
  7. const arr_posX = [-425, -214, 0, 213, 424];
  8. cc.Class({
  9. extends: RollPanel,
  10. editor: {
  11. menu: 'Game/Roman/RollPanel'
  12. },
  13. properties: {
  14. aniNode: cc.Node,
  15. itemLayer: cc.Node,
  16. endLayer: cc.Node,
  17. fraLayer: cc.Node,
  18. kuangClone: cc.Node,
  19. _hMoreMan: false,
  20. _hMoreWoman: false,
  21. },
  22. // LIFE-CYCLE CALLBACKS:
  23. initOthers () {
  24. this.goldTimes = [50, 100, 200, 500, 1000, 2000, 5000, 10000];
  25. this.endNode = [];
  26. this.endNodeJS = [];
  27. this.kuangArrs = [];
  28. this.endLayer.removeAllChildren();
  29. this.fraLayer.removeAllChildren();
  30. this.sunValue = [];
  31. for(let i = 0; i < this.MAX_COL_NUM; ++i) {
  32. this.sunValue[i] = [];
  33. for(let j = 0; j < this.maxRolItemlLen-5; ++j) {
  34. this.sunValue[i][j] = this.isSunGold(this.tempValue[i][j]) ? this.getRandomGoldValue() : 0;
  35. }
  36. for(let j = this.maxRolItemlLen-5; j < this.maxRolItemlLen; ++j) {
  37. this.sunValue[i][j] = this.sunValue[i][j-12];
  38. }
  39. }
  40. for(let i = 0; i < this.MAX_ROW_NUM; ++i) {
  41. this.endNode[i] = [];
  42. this.endNodeJS[i] = [];
  43. this.kuangArrs[i] = [];
  44. for(let j = 0; j < this.MAX_COL_NUM; ++j) {
  45. let item = cc.instantiate(this.itemClone);
  46. item.x = arr_posX[j];
  47. item.y = (1-i)*(this.sizec);
  48. item.parent = this.endLayer;
  49. item.active = false;
  50. this.endNode[i][j] = item;
  51. this.endNodeJS[i][j] = this.endNode[i][j].getComponent("LBItem");
  52. this.endNodeJS[i][j].setValue(this.tempValue[i][j], this.itemSpines[this.tempValue[i][j]], this.sunValue[i][j]);
  53. let kuang = cc.instantiate(this.kuangClone);
  54. kuang.x = arr_posX[j];
  55. kuang.y = (1-i)*(this.sizec);
  56. kuang.parent = this.fraLayer;
  57. kuang.active = false;
  58. this.kuangArrs[i][j] = kuang;
  59. }
  60. }
  61. this.endLayer.active = false;
  62. this.fraLayer.active = false;
  63. },
  64. forceStop() {
  65. for(let i = 0; i < this.MAX_COL_NUM; ++i) {
  66. let rollbg = this.rollBG[i];
  67. rollbg.active = true;
  68. rollbg.stopAllActions();
  69. rollbg.y = 0;
  70. }
  71. },
  72. resetView() {
  73. for(let i = 0; i < this.MAX_COL_NUM; ++i) {
  74. let rollbg = this.rollBG[i];
  75. rollbg.active = true;
  76. rollbg.y = 0;
  77. rollbg.stopAllActions();
  78. }
  79. },
  80. getRandomValue() {
  81. return Math.floor(Math.random()*100)%6;
  82. },
  83. getRandomGoldValue() {
  84. let val = Math.floor(Math.random()*10000);
  85. if(val < 5055) {
  86. return this.goldTimes[0];
  87. }else if(val < 7555) {
  88. return this.goldTimes[1];
  89. }else if(val < 9055) {
  90. return this.goldTimes[2];
  91. }else if(val < 9555) {
  92. return this.goldTimes[3];
  93. }else if(val < 9805) {
  94. return this.goldTimes[4];
  95. }else if(val < 9930) {
  96. return this.goldTimes[5];
  97. }else if(val < 9980) {
  98. return this.goldTimes[6];
  99. }else {
  100. return this.goldTimes[7];
  101. }
  102. },
  103. startRollActions() {
  104. this.itemLayer.active = true;
  105. this.endLayer.active = false;
  106. this.fraLayer.active = false;
  107. this._hMoreMan = false;
  108. this._hMoreWoman = false;
  109. this._bSunGame = false;
  110. this._rollSunData = null;
  111. // this._super();
  112. this.bGameEnd = false;
  113. this.node.stopAllActions();
  114. this.resetItemCounts();
  115. for(let i = 0; i < this.MAX_COL_NUM; ++i) {
  116. let rollbg = this.rollBG[i];
  117. rollbg.active = true;
  118. rollbg.y = 0;
  119. rollbg.stopAllActions();
  120. /*
  121. for(let j = 4; j < 9; ++j) {
  122. this.tempValue[i][j] = this.tempValue[i][j+12];
  123. this.elementJS[i][j].setValue(this.tempValue[i][j], this.itemSpines[this.tempValue[i][j]], this.sunValue[i][j]);
  124. }
  125. */
  126. cc.tween(rollbg)
  127. .sequence(
  128. cc.tween().to(0.4, {y: -6*this.sizec}),
  129. cc.tween().call(()=>{
  130. for(let j = this.maxRolItemlLen-5; j < this.maxRolItemlLen; ++j) {
  131. this.tempValue[i][j] = this.tempValue[i][j-12];
  132. // this.tempValue[i][j] = this.getSpecialRandomValue();
  133. this.elementJS[i][j].setValue(this.tempValue[i][j], this.itemSpines[this.tempValue[i][j]], this.isSpecialIcon(this.tempValue[i][j]));
  134. }
  135. }),
  136. cc.tween().to(0.4, {y: -12*this.sizec}),
  137. cc.tween().call(()=>{ rollbg.y = 0, this.resetRollingItemValue(i) })
  138. )
  139. .repeatForever()
  140. .start()
  141. }
  142. this._startRollTime = new Date().getTime();
  143. },
  144. openPrizes(justEnd, bQuick) {
  145. if(this.bGameEnd == true) {
  146. return;
  147. }
  148. let endTime = new Date().getTime();
  149. let leftTime = this._startRollTime - endTime + 1000;
  150. this.delayTime = 0.2;
  151. if(bQuick) {
  152. leftTime -= 700;
  153. }
  154. if(leftTime < 0 || justEnd) {
  155. leftTime = 0;
  156. }
  157. if(justEnd) {
  158. this.delayTime = 0;
  159. }
  160. this.node.stopAllActions();
  161. this.bQuick = bQuick;
  162. this.FreeCount = 0;
  163. //快速,并且前四排骷髅头总数少于2
  164. if(bQuick || justEnd) {
  165. for(let i = 0;i < this.MAX_COL_NUM; ++i) {
  166. if(this.FreeCount >= 2) {
  167. // SoundFun.playEffect("freeicon");
  168. cc.tween(this.node)
  169. .delay(leftTime/1000+0.2)
  170. .call(()=>{
  171. this.hotRolls(i);
  172. })
  173. .start()
  174. return;
  175. }
  176. cc.tween(this.node)
  177. .delay(leftTime/1000)
  178. .call(()=>{
  179. this.quickEnd(i);
  180. if(i >= 4) {
  181. this.delayShowPrizes(1000);
  182. }
  183. })
  184. .start()
  185. for(let j = 0; j < this.MAX_ROW_NUM; ++j) {
  186. if(this.tempValue[i][j+1] == this.SPECIAL_ICON) {
  187. // this.FreeCount++; //ma 取消hotRolls
  188. }
  189. }
  190. }
  191. // SoundFun.playEffect("normal_stop");
  192. return;
  193. }
  194. cc.tween(this.node)
  195. .delay(leftTime/1000)
  196. .call(()=>{
  197. this.rollEnds(0);
  198. })
  199. .start()
  200. },
  201. setItemColInfo(i, dIdx) {
  202. for(let j = this.maxRolItemlLen-5; j < this.maxRolItemlLen; ++j) {
  203. this.elementNode[i][j-this.maxRolItemlLen+dIdx-1].active = true;
  204. this.elementNode[i][j].active = true;
  205. this.tempValue[i][j] = this.tempValue[i][j-this.maxRolItemlLen+dIdx-1];
  206. this.sunValue[i][j] = this.sunValue[i][j-this.maxRolItemlLen+dIdx-1];
  207. this.elementJS[i][j].setValue(this.tempValue[i][j], this.itemSpines[this.tempValue[i][j]], this.sunValue[i][j]);
  208. }
  209. // for(let k = this.maxRolItemlLen-4; k < this.maxRolItemlLen-1; ++k) {
  210. // if(this.isSunGold(this.tempValue[i][k])){
  211. // this.elementJS[i][k].setGoldLabel(this.endNodeJS[k-this.maxRolItemlLen+4][i].getGoldLabel());
  212. // }
  213. // }
  214. this.playEffect("line"+i);
  215. },
  216. resetRollingItemValue(i) {
  217. for(let j = 9; j < this.maxRolItemlLen-5; ++j) {
  218. this.tempValue[i][j] = this.getRandomValue();
  219. if(this.isSunGold(this.tempValue[i][j])) {
  220. this.sunValue[i][j] = this.getRandomGoldValue()*this._singleLineBet;
  221. }else{
  222. this.sunValue[i][j] = 0;
  223. }
  224. this.elementJS[i][j].setValue(this.tempValue[i][j], this.itemSpines[this.tempValue[i][j]], this.sunValue[i][j]);
  225. }
  226. for(let j = this.maxRolItemlLen-5; j < this.maxRolItemlLen; ++j) {
  227. this.elementNode[i][j].active = true;
  228. }
  229. },
  230. quickEnd(i) {
  231. if(i >= this.MAX_COL_NUM) {
  232. return;
  233. }
  234. let rollbg = this.rollBG[i];
  235. rollbg.stopAllActions();
  236. let yy = rollbg.y;
  237. let destIdx = this.maxRolItemlLen - 3 - Math.floor(yy/-this.sizec);
  238. for(let j = destIdx-3; j >= destIdx-6; --j) {
  239. this.tempValue[i][j] = this.tempValue[i][j-destIdx+6];
  240. this.sunValue[i][j] = this.sunValue[i][j-destIdx+6];
  241. this.elementJS[i][j].setValue(this.tempValue[i][j], this.itemSpines[this.tempValue[i][j]], this.sunValue[i][j]);
  242. }
  243. let destY = (this.maxRolItemlLen - destIdx+1) * -this.sizec;
  244. let lastTime = (yy - destY + 50)/this.sizec/12;
  245. cc.tween(rollbg)
  246. .to(lastTime, {y: destY-50})
  247. .to(0.1, {y: destY}, {easing: 'sineInOut'})
  248. .call(()=>{
  249. this.setItemColInfo(i, destIdx);
  250. rollbg.y = 0;
  251. })
  252. .start()
  253. },
  254. justEnd(i) {
  255. if(i >= this.MAX_COL_NUM) {
  256. return;
  257. }
  258. let rollbg = this.rollBG[i];
  259. rollbg.stopAllActions();
  260. let yy = rollbg.y;
  261. let destIdx = this.maxRolItemlLen - 3 - Math.floor(yy/-this.sizec);
  262. for(let j = destIdx-3; j >= destIdx-6; --j) {
  263. this.tempValue[i][j] = this.tempValue[i][j-destIdx+6];
  264. this.sunValue[i][j] = this.sunValue[i][j-destIdx+6];
  265. this.elementJS[i][j].setValue(this.tempValue[i][j], this.itemSpines[this.tempValue[i][j]], this.sunValue[i][j]);
  266. }
  267. let destY = (this.maxRolItemlLen - destIdx+1) * -this.sizec;
  268. let lastTime = (yy - destY + 50)/this.sizec/12*0.5;
  269. cc.tween(rollbg)
  270. .to(lastTime, {y: destY-50})
  271. .call(()=>{
  272. this.hotRolls(i+1);
  273. })
  274. .to(0.1, {y: destY}, {easing: 'sineInOut'})
  275. .call(()=>{
  276. this.setItemColInfo(i, destIdx);
  277. rollbg.y = 0;
  278. })
  279. .start()
  280. },
  281. hotRolls(i) {
  282. if(i >= this.MAX_COL_NUM) {
  283. this.delayShowPrizes(600);
  284. return;
  285. }
  286. this.playLPEffect("hotroll");
  287. let rollbg = this.rollBG[i];
  288. rollbg.stopAllActions();
  289. this.aniNode.active = true;
  290. this.aniNode.x = arr_posX[i];
  291. let yy = rollbg.y;
  292. let lessY = yy + 12*this.sizec;
  293. let lastTime = lessY/this.sizec/12*0.3;
  294. cc.tween(rollbg)
  295. .to(lastTime, {y: -12*this.sizec})
  296. .sequence(
  297. cc.tween().call(()=>{ rollbg.y = 0, this.resetRollingItemValue(i) }),
  298. cc.tween().to(0.5, {y: -12*this.sizec})
  299. )
  300. .repeatForever()
  301. .start()
  302. cc.tween(this.node)
  303. .delay(2)
  304. .call(()=>{
  305. this.aniNode.active = false;
  306. this.justEnd(i);
  307. })
  308. .start()
  309. },
  310. rollEnds(i) {
  311. if(i == 0) {
  312. ScenceManager.Instance().getGameComponent().onGameEnd();
  313. }
  314. if(this.FreeCount >= 2) {
  315. cc.tween(this.node)
  316. .delay(0.3)
  317. .call(()=>{
  318. this.hotRolls(i);
  319. })
  320. .start()
  321. // this.hotRolls(i);
  322. return;
  323. }
  324. if(i > 4) {
  325. this.delayShowPrizes(400);
  326. return;
  327. }
  328. //先统计骷髅头数量
  329. for(let j = 0; j < this.MAX_ROW_NUM; ++j) {
  330. if(this.tempValue[i][j+1] == this.SPECIAL_ICON) {
  331. // this.FreeCount++; ////ma 取消hotRolls
  332. }
  333. }
  334. let rollbg = this.rollBG[i];
  335. rollbg.stopAllActions();
  336. let yy = rollbg.y;
  337. let destIdx = this.maxRolItemlLen - 3 - Math.floor(yy/-this.sizec);
  338. // Global.print("i"+i+" "+destIdx)
  339. for(let j = destIdx-3; j >= destIdx-6; --j) {
  340. this.tempValue[i][j] = this.tempValue[i][j-destIdx+6];
  341. this.sunValue[i][j] = this.sunValue[i][j-destIdx+6];
  342. this.elementJS[i][j].setValue(this.tempValue[i][j], this.itemSpines[this.tempValue[i][j]], this.sunValue[i][j]);
  343. }
  344. let destY = (this.maxRolItemlLen - destIdx+1) * -this.sizec;
  345. let lastTime = (yy - destY + 50)/this.sizec/12;
  346. if(this.bQuick) {
  347. cc.tween(rollbg)
  348. .call(()=>{
  349. this.rollEnds(i+1);
  350. })
  351. .to(lastTime, {y: destY-50})
  352. .to(0.1, {y: destY}, {easing: 'sineInOut'})
  353. .call(()=>{
  354. this.setItemColInfo(i, destIdx);
  355. rollbg.y = 0;
  356. })
  357. .start()
  358. return;
  359. }
  360. cc.tween(rollbg)
  361. .to(lastTime, {y: destY-50})
  362. .call(()=>{
  363. this.rollEnds(i+1);
  364. })
  365. .to(0.1, {y: destY}, {easing: 'sineInOut'})
  366. // .delay(this.delayTime)
  367. .call(()=>{
  368. this.setItemColInfo(i, destIdx);
  369. rollbg.y = 0;
  370. // rollbg.y = -16*140;
  371. // this.rollEnds(i+1);
  372. })
  373. .start()
  374. },
  375. delayShowPrizes(delayTime) {
  376. cc.tween(this.node)
  377. .delay(delayTime/1000)
  378. .call(()=>{
  379. this.beforeShowPrize();
  380. })
  381. .delay(0.1)
  382. .call(()=>{
  383. ScenceManager.Instance().getGameComponent().showGameWinScore();
  384. if(this._bSunGame) {
  385. this.showSpecialPrize()
  386. this.playEffect("sunstart")
  387. }else{
  388. this.bGameEnd = true;
  389. this.showPrizes();
  390. }
  391. })
  392. .delay(0.1)
  393. .call(()=>{
  394. if(!this._bSunGame) {
  395. ScenceManager.Instance().getGameComponent().showGameEnd();
  396. }else{
  397. // ScenceManager.Instance().getGameComponent().resetAllBtn();
  398. }
  399. // ScenceManager.Instance().getGameComponent().resetAllBtn();
  400. })
  401. .start()
  402. },
  403. beforeShowPrize() {
  404. this.endLayer.active = true;
  405. for(let i = 0; i < this.MAX_COL_NUM; ++i) {
  406. for(let j = 0; j < this.MAX_ROW_NUM; ++j) {
  407. this.endNodeJS[j][i].showNormal();
  408. this.kuangArrs[j][i].active = false;
  409. }
  410. }
  411. this.fraLayer.active = true;
  412. this.itemLayer.active = false;
  413. // if(this._hMoreMan) {
  414. // this.playEffect("man");
  415. // }
  416. // if(this._hMoreWoman) {
  417. // this.playEffect("woman");
  418. // }
  419. },
  420. showSpecialPrize() {
  421. for(let i = 0; i < this.MAX_COL_NUM; ++i) {
  422. for(let j = 0; j < this.MAX_ROW_NUM; ++j) {
  423. this.kuangArrs[j][i].active = this.endNodeJS[j][i].getCount() > 0;
  424. if(this._hasSpecial) {
  425. this.endNodeJS[j][i].showSpecialAni();
  426. }
  427. this.endNodeJS[j][i].playGoldCoinAni();
  428. }
  429. }
  430. cc.tween(this.node)
  431. .delay(3)
  432. .call(()=>{
  433. // ScenceManager.Instance().getGameComponent().onSunGameInfo();
  434. ScenceManager.Instance().getGameComponent().showSun2Game();
  435. })
  436. .start()
  437. },
  438. showPrizes() {
  439. for(let i = 0; i < this.MAX_COL_NUM; ++i) {
  440. for(let j = 0; j < this.MAX_ROW_NUM; ++j) {
  441. this.kuangArrs[j][i].active = this.endNodeJS[j][i].getCount() > 0;
  442. if(this._hasSpecial) {
  443. this.endNodeJS[j][i].showSpecialAni();
  444. }
  445. }
  446. }
  447. cc.tween(this.node)
  448. .delay(2.5)
  449. .call(()=>{
  450. this.resetItemsShow();
  451. })
  452. .delay(0.5)
  453. .call(()=>{
  454. this.showLines(0);
  455. })
  456. .start();
  457. },
  458. showLines(iIndex) {
  459. if(iIndex >= this._lineCount) {
  460. this.showPrizes();
  461. return;
  462. }
  463. let lineID = this._lineID[iIndex];
  464. let lineArr = this.linesArr[lineID];
  465. let count = this._lineSize[iIndex];
  466. let hWild = false;
  467. for(let k = 0; k < count; ++k) {
  468. let idx = lineArr[k];
  469. let i = idx % 10;
  470. let j = Math.floor(idx/10);
  471. this.kuangArrs[j][i].active = true;
  472. this.endNodeJS[j][i].showLightAni();
  473. if(this.endNodeJS[j][i]._value == GameProtocol.WILD_ICON) {
  474. hWild = true;
  475. }
  476. }
  477. if(hWild) {
  478. this.playEffect("wild");
  479. }
  480. cc.tween(this.node)
  481. .delay(2.6667)
  482. .call(()=>{
  483. this.resetItemsShow();
  484. })
  485. .delay(0.5)
  486. .call(()=>{
  487. this.showLines(iIndex+1);
  488. })
  489. .start();
  490. },
  491. setSpecialData(sunData) {
  492. this._rollSunData = sunData;
  493. },
  494. setItemDatas(itemData) {
  495. /*
  496. this._bSunGame = this._rollResultData.m_is_berserk;
  497. let sunVal = this._rollSunData ? this._rollSunData.wSunIconMulti : null;
  498. this._singleLineBet = ScenceManager.Instance().getGameComponent().getSingleLineBet();//this._rollResultData.m_chip_size / GameProtocol.MAX_LINE_COUNT;
  499. for(let i = 0; i < this.MAX_ROW_NUM; ++i) {
  500. for(let j = 0;j < this.MAX_COL_NUM; ++j) {
  501. this.tempValue[j][i+1] = itemData[i][j];
  502. if(this.isSunGold(itemData[i][j])) {
  503. if(this._bSunGame && sunVal) {
  504. this.sunValue[j][i+1] = sunVal[i][j]*this._singleLineBet;
  505. }else{
  506. this.sunValue[j][i+1] = this.getRandomGoldValue()*this._singl eLineBet;
  507. }
  508. }else{
  509. this.sunValue[j][i+1] = 0;
  510. }
  511. // this.sunValue[j][i+1] = this.isSunGold(itemData[i][j]) ? ((this._bSunGame && sunVal) ? sunVal[i][j] : this.getRandomGoldValue()) : 0;
  512. this.elementJS[j][i+1].setValue(itemData[i][j], this.itemSpines[this.tempValue[i][j]], this.sunValue[j][i+1]);
  513. }
  514. }
  515. Global.print(this.sunValue);
  516. // Global.print(itemData);
  517. */
  518. this._bSunGame = this._rollResultData.m_is_berserk;
  519. let sunValueArr = this._rollResultData.m_desk_value;
  520. for(let i=0; i < this.MAX_ROW_NUM; ++i){
  521. for(let j=0; j < this.MAX_COL_NUM; j++){
  522. this.tempValue[j][i+1] = itemData[i][j];
  523. this.sunValue[j][i+1] = sunValueArr[i][j]; //ma
  524. this.elementJS[j][i+1].setValue(itemData[i][j], this.itemSpines[this.tempValue[i][j]], this.sunValue[j][i+1]);
  525. }
  526. }
  527. },
  528. doOthersWithResultData() {
  529. let data = this._rollResultData.m_desk_data;
  530. let temp = [[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]];
  531. //每列统计连续数
  532. for(let i = 0; i < this.MAX_COL_NUM; ++i) {
  533. for(let j = 0; j < this.MAX_ROW_NUM; ++j) {
  534. this.endNodeJS[j][i].setValue(data[j][i], this.itemSpines[data[j][i]], this.sunValue[i][j+1]);
  535. // if(this.isManOrWomanIcon(data[j][i])) {
  536. // temp[j][i] = 1;
  537. // for(let k = j+1; k < this.MAX_ROW_NUM; ++k) {
  538. // if(this.isManOrWomanIcon(data[k][i]) && data[j][i] == data[k][i]) {
  539. // temp[j][i]++;
  540. // }else{
  541. // break;
  542. // }
  543. // }
  544. // }
  545. // if(this.isSunGold(data[j][i]) && !this._bSunGame) {
  546. // let val = this.getRandomGoldValue() * singleLine
  547. // this.endNodeJS[j][i].setGoldLabel(val);
  548. // }
  549. }
  550. }
  551. // Global.print(JSON.stringify(temp));
  552. // //每列从下到上,连续的只计算最上一个其余的置-1
  553. // for(let i = 0; i < this.MAX_COL_NUM; ++i) {
  554. // for(let j = this.MAX_ROW_NUM-1; j > 0; --j) {
  555. // if(temp[j][i] > 0 && temp[j-1][i] > 0 && data[j][i] == data[j-1][i]) {
  556. // temp[j][i] = -1;
  557. // if(data[j][i] == GameProtocol.MAN_ICON) {
  558. // this._hMoreMan = true;
  559. // }
  560. // if(data[j][i] == GameProtocol.WOMAN_ICON) {
  561. // this._hMoreWoman = true;
  562. // }
  563. // }
  564. // }
  565. // }
  566. // Global.print(JSON.stringify(temp));
  567. // //第一列统计合并连续的3
  568. // for(let i = 1; i < this.MAX_COL_NUM; ++i) {
  569. // if(temp[0][i] == 3 && temp[0][i-1] == 3 && data[0][i] == data[0][i-1]) {
  570. // temp[0][i-1] = 6;
  571. // temp[0][i] = -1;
  572. // }
  573. // }
  574. Global.print(JSON.stringify(temp));
  575. //设置
  576. for(let i = 0; i < this.MAX_COL_NUM; ++i) {
  577. for(let j = 0; j < this.MAX_ROW_NUM; ++j) {
  578. this.endNodeJS[j][i].setRowCount(temp[j][i]);
  579. this.endNodeJS[j][i].setCount(this.elementJS[i][j+17].getCount());
  580. }
  581. }
  582. // this.endLayer.active = true;
  583. // this.fraLayer.active = true;
  584. },
  585. isManOrWomanIcon(val) {
  586. return val == GameProtocol.MAN_ICON || val == GameProtocol.WOMAN_ICON;
  587. },
  588. isSunGold(val) {
  589. return val == GameProtocol.SUN_ICON;
  590. },
  591. resetItemsShow() {
  592. for(let i = 0; i < this.MAX_COL_NUM; ++i) {
  593. for(let j = 0; j < this.MAX_ROW_NUM; ++j) {
  594. this.kuangArrs[j][i].active = false;
  595. this.endNodeJS[j][i].resetShow();
  596. }
  597. }
  598. },
  599. // analyzeLinesData() {
  600. // this._allTimers = 0;
  601. // for(let i = 0; i < this._lineCount; ++i) {
  602. // let lineID = this._lineID[i];
  603. // let lineArr = linesArr[lineID];
  604. // this._allTimers += this._lineTimes[i];
  605. // for(let j = 0; j < this._lineSize[i]; ++j) {
  606. // let idx = lineArr[j];
  607. // let x = idx % 10;
  608. // let y = Math.floor(idx/10);
  609. // this.elementJS[x][y+17].addCount();
  610. // }
  611. // }
  612. // },
  613. });