|
53 | 53 | },
|
54 | 54 | events: {
|
55 | 55 | 'click .replayDownloadButton': 'clickReplayDownloadButton',
|
| 56 | + 'change input[name=megaevox]': 'uncheckMegaEvoY', |
| 57 | + 'change input[name=megaevoy]': 'uncheckMegaEvoX', |
56 | 58 | 'change input[name=zmove]': 'updateZMove',
|
57 | 59 | 'change input[name=dynamax]': 'updateMaxMove'
|
58 | 60 | },
|
|
510 | 512 | }
|
511 | 513 | return '<button name="openTimer" class="button timerbutton' + timerTicking + '"><i class="fa fa-hourglass-start"></i> ' + time + '</button>';
|
512 | 514 | },
|
| 515 | + uncheckMegaEvoX: function () { |
| 516 | + this.$('input[name=megaevox]').prop('checked', false); |
| 517 | + }, |
| 518 | + uncheckMegaEvoY: function () { |
| 519 | + this.$('input[name=megaevoy]').prop('checked', false); |
| 520 | + }, |
513 | 521 | updateMaxMove: function () {
|
514 | 522 | var dynaChecked = this.$('input[name=dynamax]')[0].checked;
|
515 | 523 | if (dynaChecked) {
|
|
559 | 567 | if (!curActive) return;
|
560 | 568 | var trapped = curActive.trapped;
|
561 | 569 | var canMegaEvo = curActive.canMegaEvo || switchables[pos].canMegaEvo;
|
| 570 | + var canMegaEvoX = curActive.canMegaEvoX || switchables[pos].canMegaEvoX; |
| 571 | + var canMegaEvoY = curActive.canMegaEvoY || switchables[pos].canMegaEvoY; |
562 | 572 | var canZMove = curActive.canZMove || switchables[pos].canZMove;
|
563 | 573 | var canUltraBurst = curActive.canUltraBurst || switchables[pos].canUltraBurst;
|
564 | 574 | var canDynamax = curActive.canDynamax || switchables[pos].canDynamax;
|
|
721 | 731 | }
|
722 | 732 | if (canMegaEvo) {
|
723 | 733 | moveMenu += '<br /><label class="megaevo"><input type="checkbox" name="megaevo" /> Mega Evolution</label>';
|
| 734 | + } else if (canMegaEvoX && canMegaEvoY) { |
| 735 | + moveMenu += '<br /><label class="megaevo"><input type="checkbox" name="megaevox" /> Mega Evolution X</label>'; |
| 736 | + moveMenu += '<label class="megaevo"><input type="checkbox" name="megaevoy" /> Mega Evolution Y</label>'; |
| 737 | + } else if (canMegaEvoX) { |
| 738 | + moveMenu += '<br /><label class="megaevo"><input type="checkbox" name="megaevox" /> Mega Evolution X</label>'; |
| 739 | + } else if (canMegaEvoY) { |
| 740 | + moveMenu += '<br /><label class="megaevo"><input type="checkbox" name="megaevoy" /> Mega Evolution Y</label>'; |
724 | 741 | } else if (canZMove) {
|
725 | 742 | moveMenu += '<br /><label class="megaevo"><input type="checkbox" name="zmove" /> Z-Power</label>';
|
726 | 743 | } else if (canUltraBurst) {
|
|
983 | 1000 | buf += 'Mega Evolve, then ';
|
984 | 1001 | targetPos = parts[3];
|
985 | 1002 | }
|
| 1003 | + if (targetPos === 'megax') { |
| 1004 | + buf += 'Mega Evolve X, then '; |
| 1005 | + targetPos = parts[3]; |
| 1006 | + } |
| 1007 | + if (targetPos === 'megay') { |
| 1008 | + buf += 'Mega Evolve Y, then '; |
| 1009 | + targetPos = parts[3]; |
| 1010 | + } |
986 | 1011 | if (targetPos === 'zmove') {
|
987 | 1012 | move = this.request.active[i].canZMove[parseInt(parts[1], 10) - 1].move;
|
988 | 1013 | targetPos = parts[3];
|
|
1232 | 1257 | if (pos !== undefined) { // pos === undefined if called by chooseMoveTarget()
|
1233 | 1258 | var nearActive = this.battle.nearSide.active;
|
1234 | 1259 | var isMega = !!(this.$('input[name=megaevo]')[0] || '').checked;
|
| 1260 | + var isMegaX = !!(this.$('input[name=megaevox]')[0] || '').checked; |
| 1261 | + var isMegaY = !!(this.$('input[name=megaevoy]')[0] || '').checked; |
1235 | 1262 | var isZMove = !!(this.$('input[name=zmove]')[0] || '').checked;
|
1236 | 1263 | var isUltraBurst = !!(this.$('input[name=ultraburst]')[0] || '').checked;
|
1237 | 1264 | var isDynamax = !!(this.$('input[name=dynamax]')[0] || '').checked;
|
|
1240 | 1267 | var target = e.getAttribute('data-target');
|
1241 | 1268 | var choosableTargets = {normal: 1, any: 1, adjacentAlly: 1, adjacentAllyOrSelf: 1, adjacentFoe: 1};
|
1242 | 1269 |
|
1243 |
| - this.choice.choices.push('move ' + pos + (isMega ? ' mega' : '') + (isZMove ? ' zmove' : '') + (isUltraBurst ? ' ultra' : '') + (isDynamax ? ' dynamax' : '') + (isTerastal ? ' terastallize' : '')); |
| 1270 | + this.choice.choices.push('move ' + pos + (isMega ? ' mega' : '') + (isMegaX ? ' megax' : isMegaY ? ' megay' : '') + (isZMove ? ' zmove' : '') + (isUltraBurst ? ' ultra' : '') + (isDynamax ? ' dynamax' : '') + (isTerastal ? ' terastallize' : '')); |
1244 | 1271 | if (nearActive.length > 1 && target in choosableTargets) {
|
1245 | 1272 | this.choice.type = 'movetarget';
|
1246 | 1273 | this.choice.moveTarget = target;
|
|
0 commit comments