Skip to content

Commit

Permalink
Several fixes
Browse files Browse the repository at this point in the history
-Fixes teambuilder edits stacking (my bad)
-Alt formes gaining movesets in mods no longer messes up other formats
-Gourgeist Large/Small load movesets (still don't know why this isn't a problem on main)
-Technician only shows extra Useful moves that it actually boosts
  • Loading branch information
EnPassant4264 committed Nov 17, 2023
1 parent 2e12e14 commit 1fa7a8a
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/battle-dex-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -877,12 +877,14 @@ abstract class BattleTypedSearch<T extends SearchType> {
if (this.mod) {
const overrideLearnsets = BattleTeambuilderTable[this.mod].overrideLearnsets;
if (overrideLearnsets[learnsetid]) {
if(!learnset) learnset = overrideLearnsets[learnsetid]; //Didn't have learnset and mod gave it one
else {
for (const learnedMove in overrideLearnsets[learnsetid]) learnset[learnedMove] = overrideLearnsets[learnsetid][learnedMove];
}
if (!learnset) learnset = overrideLearnsets[learnsetid]; //Didn't have learnset and mod gave it one
learnset = JSON.parse(JSON.stringify(learnset));
for (const learnedMove in overrideLearnsets[learnsetid]) learnset[learnedMove] = overrideLearnsets[learnsetid][learnedMove];
}
}
if (!Object.keys(learnset).length) { //Doesn't have learnset but one is loaded; some other mod gave it one
learnsetid = toID(this.dex.species.get(learnsetid).baseSpecies);
}
// Modified this function to account for pet mods with tradebacks enabled
const tradebacksMod = ['gen1expansionpack', 'gen1burgundy'];
if (learnset && (moveid in learnset) && (!(this.format.startsWith('tradebacks') || tradebacksMod.includes(this.mod)) ? learnset[moveid].includes(genChar) :
Expand Down Expand Up @@ -1640,7 +1642,7 @@ class BattleMoveSearch extends BattleTypedSearch<'move'> {
if (moveData.flags?.slicing && abilityid === 'sharpness') {
return true;
}
if (moveData.basePower < 75 && !(abilityid === 'technician' && moveData.basePower >= 50)) {
if (moveData.basePower < 75 && !(abilityid === 'technician' && moveData.basePower <= 60 && moveData.basePower >= 50)) {
return BattleMoveSearch.GOOD_WEAK_MOVES.includes(id);
}
return !BattleMoveSearch.BAD_STRONG_MOVES.includes(id);
Expand Down Expand Up @@ -1698,12 +1700,15 @@ class BattleMoveSearch extends BattleTypedSearch<'move'> {
const overrideLearnsets = BattleTeambuilderTable[this.mod].overrideLearnsets;
if (overrideLearnsets[learnsetid]) {
if(!learnset) learnset = overrideLearnsets[learnsetid]; //Didn't have learnset and mod gave it one
else {
for (const moveid in overrideLearnsets[learnsetid]) learnset[moveid] = overrideLearnsets[learnsetid][moveid];
}
learnset = JSON.parse(JSON.stringify(learnset));
for (const moveid in overrideLearnsets[learnsetid]) learnset[moveid] = overrideLearnsets[learnsetid][moveid];
}
}
if (learnset) {
if (!Object.keys(learnset).length) { //Doesn't have learnset but one is loaded; some other mod gave it one
learnsetid = toID(this.dex.species.get(learnsetid).baseSpecies);
continue;
}
for (let moveid in learnset) {
let learnsetEntry = learnset[moveid];
const move = dex.moves.get(moveid);
Expand Down

0 comments on commit 1fa7a8a

Please sign in to comment.