mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-05-27 11:02:38 -05:00
Teambuilder: Autoselect item if it's required
For instance, selecting Megazard X autoselects Charizardite X, selecting Arceus-Dark autoselects Dread Plate, and selecting Giratina-Origin autoselects Griseous Orb.
This commit is contained in:
parent
95657e8249
commit
3dea2e43b3
|
|
@ -1697,14 +1697,15 @@
|
|||
if (template.gender && template.gender !== 'N') set.gender = template.gender;
|
||||
if (set.happiness) delete set.happiness;
|
||||
if (set.shiny) delete set.shiny;
|
||||
set.item = '';
|
||||
var formatsData = window.BattleFormatsData && BattleFormatsData[template.speciesid];
|
||||
set.item = (formatsData.requiredItem || '');
|
||||
set.ability = template.abilities['0'];
|
||||
set.moves = [];
|
||||
set.evs = {};
|
||||
set.ivs = {};
|
||||
set.nature = '';
|
||||
this.updateSetTop();
|
||||
if (selectNext) this.$('input[name=item]').select();
|
||||
if (selectNext) this.$(set.item ? 'input[name=ability]' : 'input[name=item]').select();
|
||||
},
|
||||
|
||||
/*********************************************************
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user