mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-05-09 04:23:01 -05:00
Merge 6cb516f803 into 10f8967023
This commit is contained in:
commit
4ea8aeea21
|
|
@ -243,7 +243,7 @@ export class PSSearchResults extends preact.Component<{
|
|||
let pp = (move.pp === 1 || move.noPPBoosts ? move.pp : move.pp * 8 / 5);
|
||||
if (search.dex.gen < 3) pp = Math.min(61, pp);
|
||||
if (search.dex.modid === 'champions') {
|
||||
pp = move.pp > 20 ? 20 : pp;
|
||||
pp = move.pp > 20 ? 20 : move.pp;
|
||||
if (!move.noPPBoosts) pp = (pp / 5 + 1) * 4;
|
||||
}
|
||||
return <li class="result"><a
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ export class TeamEditorState extends PSModel {
|
|||
isLetsGo = false;
|
||||
isNatDex = false;
|
||||
isBDSP = false;
|
||||
isChampions = false;
|
||||
formeLegality: 'normal' | 'hackmons' | 'custom' = 'normal';
|
||||
abilityLegality: 'normal' | 'hackmons' = 'normal';
|
||||
defaultLevel = 100;
|
||||
|
|
@ -98,6 +99,7 @@ export class TeamEditorState extends PSModel {
|
|||
this.isLetsGo = formatid.includes('letsgo');
|
||||
this.isNatDex = formatid.includes('nationaldex') || formatid.includes('natdex');
|
||||
this.isBDSP = formatid.includes('bdsp');
|
||||
this.isChampions = formatid.includes('champions');
|
||||
if (formatid.includes('almostanyability') || formatid.includes('aaa')) {
|
||||
this.abilityLegality = 'hackmons';
|
||||
} else {
|
||||
|
|
@ -663,7 +665,8 @@ export class TeamEditorState extends PSModel {
|
|||
}
|
||||
}
|
||||
getStat(stat: StatName, set: Dex.PokemonSet, ivOverride: number, evOverride?: number, natureOverride?: number) {
|
||||
const supportsEVs = !this.isLetsGo;
|
||||
const usesStatPoints = this.isChampions;
|
||||
const supportsEVs = !this.isLetsGo && !usesStatPoints;
|
||||
const supportsAVs = !supportsEVs;
|
||||
|
||||
// do this after setting set.evs because it's assumed to exist
|
||||
|
|
@ -1677,7 +1680,7 @@ class TeamTextbox extends preact.Component<{
|
|||
<span class="detailcell">
|
||||
<label>Shiny</label>{set.shiny ? 'Yes' : '\u2014'}
|
||||
</span>
|
||||
{editor.gen === 9 ? (
|
||||
{editor.gen === 9 && !editor.isChampions ? (
|
||||
<span class="detailcell">
|
||||
<label>Tera</label><PSIcon type={set.teraType || species.requiredTeraType || species.types[0]} />
|
||||
</span>
|
||||
|
|
@ -2001,7 +2004,7 @@ class TeamWizard extends preact.Component<{
|
|||
<strong class="label">Shiny</strong> {}
|
||||
{set.shiny ? <img src={`${Dex.resourcePrefix}sprites/misc/shiny.png`} width={22} height={22} alt="Yes" /> : '\u2014'}
|
||||
</span>}
|
||||
{editor.gen === 9 && <span class="detailcell">
|
||||
{editor.gen === 9 && !editor.isChampions && <span class="detailcell">
|
||||
<strong class="label">Tera</strong> {}
|
||||
<PSIcon type={set.teraType || species.requiredTeraType || species.types[0]} />
|
||||
</span>}
|
||||
|
|
@ -2481,7 +2484,7 @@ class StatForm extends preact.Component<{
|
|||
const autoSpread = set.ivs && editor.defaultIVs(set, false);
|
||||
const autoSpreadValue = autoSpread && Object.values(autoSpread).join('/');
|
||||
if (!hpIVdata) {
|
||||
return <select name="ivspread" class="button" onChange={this.changeIVSpread}>
|
||||
return <select name="ivspread" class="button" onChange={this.changeIVSpread} disabled={editor.isChampions}>
|
||||
<option value="" selected>IV spreads</option>
|
||||
{autoSpreadValue && <option value="auto">Auto ({autoSpreadValue})</option>}
|
||||
<optgroup label="min Atk">
|
||||
|
|
@ -2836,8 +2839,9 @@ class StatForm extends preact.Component<{
|
|||
};
|
||||
maxEVs() {
|
||||
const editor = this.props.editor;
|
||||
const useEVs = !editor.isLetsGo && editor.gen >= 3;
|
||||
return useEVs ? 510 : Infinity;
|
||||
const usesStatPoints = editor.isChampions;
|
||||
const useEVs = !editor.isLetsGo && editor.gen >= 3 && !usesStatPoints;
|
||||
return usesStatPoints ? 66 : useEVs ? 510 : Infinity;
|
||||
}
|
||||
override render() {
|
||||
const { editor, set } = this.props;
|
||||
|
|
@ -2847,9 +2851,10 @@ class StatForm extends preact.Component<{
|
|||
|
||||
const nature = BattleNatures[set.nature || 'Serious'];
|
||||
|
||||
const useEVs = !editor.isLetsGo;
|
||||
const usesStatPoints = editor.isChampions;
|
||||
const useEVs = !editor.isLetsGo && !usesStatPoints;
|
||||
// const useAVs = !useEVs && team.format.endsWith('norestrictions');
|
||||
const maxEV = useEVs ? 252 : 200;
|
||||
const maxEV = usesStatPoints ? 32 : useEVs ? 252 : 200;
|
||||
const stepEV = useEVs ? 4 : 1;
|
||||
const defaultEV = useEVs && editor.gen <= 2 && !set.evs ? maxEV : 0;
|
||||
const useIVs = editor.gen > 2;
|
||||
|
|
@ -2893,7 +2898,7 @@ class StatForm extends preact.Component<{
|
|||
<th>{/* Stat name */}</th>
|
||||
<th>Base</th>
|
||||
<th class="setstatbar">{/* Stat bar */}</th>
|
||||
<th>{useEVs ? 'EVs' : 'AVs'}</th>
|
||||
<th>{useEVs ? 'EVs' : usesStatPoints ? 'Points' : 'AVs'}</th>
|
||||
<th>{/* EV slider */}</th>
|
||||
<th>{useIVs ? 'IVs' : 'DVs'}</th>
|
||||
<th>{/* Final stat */}</th>
|
||||
|
|
@ -2914,7 +2919,8 @@ class StatForm extends preact.Component<{
|
|||
/></td>
|
||||
<td><input
|
||||
name={`iv-${statID}`} min={0} max={useIVs ? 31 : 15} placeholder={`${defaultIVs[statID]}`} style="width:40px"
|
||||
type="number" inputMode="numeric" class="textbox default-placeholder" onInput={this.changeIV} onChange={this.changeIV}
|
||||
type="number" inputMode="numeric" class="textbox default-placeholder" onInput={this.changeIV}
|
||||
onChange={this.changeIV} disabled={usesStatPoints}
|
||||
/></td>
|
||||
<td style="text-align:right"><strong>{stat}</strong></td>
|
||||
</tr>)}
|
||||
|
|
@ -3075,7 +3081,7 @@ class DetailsForm extends preact.Component<{
|
|||
name="level" value={set.level ?? ''} placeholder={`${editor.defaultLevel}`}
|
||||
type="number" inputMode="numeric" min="1" max="100" step="1"
|
||||
class="textbox inputform numform default-placeholder" style="width: 50px"
|
||||
onInput={this.changeLevel} onChange={this.changeLevel}
|
||||
onInput={this.changeLevel} onChange={this.changeLevel} disabled={editor.isChampions}
|
||||
/></label><small>(You probably want to change the team's levels by changing the format, not here)</small></p>
|
||||
{editor.gen > 1 && (<>
|
||||
<p><div class="label">Shiny: <div class="labeled">
|
||||
|
|
@ -3151,7 +3157,7 @@ class DetailsForm extends preact.Component<{
|
|||
))}
|
||||
</select></label>
|
||||
</p>}
|
||||
{editor.gen === 9 && <p>
|
||||
{editor.gen === 9 && !editor.isChampions && <p>
|
||||
<label class="label" title="Tera Type">
|
||||
Tera Type: {}
|
||||
{species.requiredTeraType && editor.formeLegality === 'normal' ? (
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user