-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Allow PP Ups to be edited #10167
base: master
Are you sure you want to change the base?
Allow PP Ups to be edited #10167
Conversation
Server-side change; will post more on the client-side.
Regarding uploading to the team database: I did not test it, but by inspecting the code, it doesn't seem like anything needs to be done as the values should be preserved.
Probably better to avoid unusual PP values this way. Also changed the packed format to treat empty values as 3 PP Ups.
@@ -20869,7 +20869,6 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { | |||
isNonstandard: "Past", | |||
name: "Trump Card", | |||
pp: 5, | |||
noPPBoosts: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if we could still default Trump Card to 0 unless overridden.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A simple implementation on the client side only would be to automatically set a move slot's PP Ups to 0 if Trump Card is selected. Otherwise, the import format would have to be edited to make an exception for Trump Card.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could modify noPPBoosts
to PPBoosts
, allowing it to accept either a number or false, with false indicating things that can't be PP boosted. The default value would be 3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although that is not really move data, so it's probably better to just add a condition for Trump Card.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added exceptions for Trump Card on the server and client-side. It should be backwards-compatible for all regular teambuilder usage, but it wouldn't be for direct usage of packed format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I don't think it would be backwards-compatible in general.
Client PR at smogon/pokemon-showdown-client#2222 |
sim/teams.ts
Outdated
if (move.startsWith(`Hidden Power `) && move.charAt(13) !== '[') { | ||
move = `Hidden Power [${move.slice(13)}]`; | ||
} | ||
out += `- ${move} \n`; | ||
if (set.movePPUps && !isNaN(set.movePPUps[i]) && set.movePPUps[i] < 3) { | ||
PPUps = ` (PP Ups: ${set.movePPUps[i]})`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. How do I feel about this...
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
This reverts commit 86a003a.
sim/teams.ts
Outdated
if (move.startsWith(`Hidden Power `) && move.charAt(13) !== '[') { | ||
move = `Hidden Power [${move.slice(13)}]`; | ||
} | ||
out += `- ${move} \n`; | ||
if (set.movePPUps && !isNaN(set.movePPUps[i]) && set.movePPUps[i] < 3) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If someone puts 3 PP Ups on Trump Card, it's not gonna get exported properly here, unfortunately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have fixed this by changing the unpack format. Old teams will need to adjust Trump Card's PP Ups to be 0, but newly created teams will automatically set this; is this something that you're fine with? (Trump Card hasn't been usable since Gen 7, and it's otherwise an unviable move, so I doubt it will have much impact anyway.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with making tradeoffs if they're necessary, but this doesn't seem necessary to me...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made it so that the default PP Ups for Trump Card is 0, and I've also made changes to the client PR to match the code here.
hi Linter
Server-side change; will post more on the client-side.