Skip to content

Commit f9ad0e9

Browse files
committed
Don't update PP Ups of other moves when selecting a new move
1 parent 3954c8c commit f9ad0e9

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

Diff for: play.pokemonshowdown.com/js/client-teambuilder.js

+13-6
Original file line numberDiff line numberDiff line change
@@ -3374,13 +3374,15 @@
33743374
this.unChooseMove(this.curSet.moves[0]);
33753375
this.curSet.moves[0] = val;
33763376
this.chooseMove(val);
3377+
this.setPPUps(val, 0);
33773378
if (selectNext) this.$('input[name=move2]').select();
33783379
break;
33793380
case 'move2':
33803381
if (!this.curSet.moves[0]) this.curSet.moves[0] = '';
33813382
this.unChooseMove(this.curSet.moves[1]);
33823383
this.curSet.moves[1] = val;
33833384
this.chooseMove(val);
3385+
this.setPPUps(val, 1);
33843386
if (selectNext) this.$('input[name=move3]').select();
33853387
break;
33863388
case 'move3':
@@ -3389,6 +3391,7 @@
33893391
this.unChooseMove(this.curSet.moves[2]);
33903392
this.curSet.moves[2] = val;
33913393
this.chooseMove(val);
3394+
this.setPPUps(val, 2);
33923395
if (selectNext) this.$('input[name=move4]').select();
33933396
break;
33943397
case 'move4':
@@ -3398,6 +3401,7 @@
33983401
this.unChooseMove(this.curSet.moves[3]);
33993402
this.curSet.moves[3] = val;
34003403
this.chooseMove(val);
3404+
this.setPPUps(val, 3);
34013405
if (selectNext) {
34023406
this.stats();
34033407
this.$('button.setstats').focus();
@@ -3507,12 +3511,6 @@
35073511
if (minSpe === false && moveName === 'Gyro Ball') {
35083512
minSpe = undefined;
35093513
}
3510-
if (!set.movePPUps) set.movePPUps = [];
3511-
if (move.id === 'trumpcard') {
3512-
set.movePPUps[i] = 0;
3513-
} else {
3514-
set.movePPUps[i] = 3;
3515-
}
35163514
}
35173515

35183516
if (!set.ivs) {
@@ -3597,6 +3595,15 @@
35973595
this.updateSetTop();
35983596
if (selectNext) this.$(set.item || !this.$('input[name=item]').length ? (this.$('input[name=ability]').length ? 'input[name=ability]' : 'input[name=move1]') : 'input[name=item]').select();
35993597
},
3598+
setPPUps: function (move, slot) {
3599+
var set = this.curSet;
3600+
if (!set.movePPUps) set.movePPUps = [];
3601+
if (toID(move) === 'trumpcard') {
3602+
set.movePPUps[slot] = 0;
3603+
} else {
3604+
set.movePPUps[slot] = 3;
3605+
}
3606+
},
36003607

36013608
/*********************************************************
36023609
* Utility functions

0 commit comments

Comments
 (0)