Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several fixes #19

Merged
merged 1 commit into from
Nov 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading