-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
[Move] Add makeContact To Physical Part Of Shell Side Arm #4982
base: beta
Are you sure you want to change the base?
[Move] Add makeContact To Physical Part Of Shell Side Arm #4982
Conversation
Hey geeilhan, are you on the discord server? I have some questions that I think may be easier discussed there |
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 don't think this works as it's making contact even when special. Can you add the following test?
it("should not make contact if the move becomes special", async () => {
game.override.enemySpecies(Species.SLOWBRO).enemyAbility(Abilities.ROUGH_SKIN);
await game.classicMode.startBattle([Species.XURKITREE]);
const player = game.scene.getPlayerPokemon()!;
game.move.select(Moves.SHELL_SIDE_ARM);
await game.toNextTurn();
expect(player.getMaxHp()).toBe(player.hp);
});
Thanks for the feedback. Will implement this too EDIT: That is weird because in my manual tests is works properly (no contact) Screencast.from.2024-12-11.01-32-47.webmI used this to manually test it:
I also tried to add |
That is weird. For reference I was testing out something like override apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
const category = args[0] as NumberHolder;
const predictedPhysDmg = target.getBaseDamage(user, move, MoveCategory.PHYSICAL, true, true);
const predictedSpecDmg = target.getBaseDamage(user, move, MoveCategory.SPECIAL, true, true);
// Random chance of being physical or special if predicted damage is tied
if (predictedPhysDmg > predictedSpecDmg || (predictedPhysDmg === predictedSpecDmg && user.randSeedInt(2) === 0)) {
category.value = MoveCategory.PHYSICAL;
move.makesContact();
console.log("CONTACT");
return true;
}
move.makesContact(false);
console.log("NO CONTACT");
return false;
} and when I
So it's definitely reaching the line where it's logging NO CONTACT but it's still having contact. |
Yes I found the same issue so I thought that maybe MAKES_CONTACT is set when the constructor is called or somewhere else at the beginning but it not set anywhere |
So the solution for the tests to work was to move the no-contact-test to the top of the automated tests... I think the Flags from when it made contact stays since they don't get reset. Edit: Added changes where apply() checks if MAKES_CONTACT is set (probably from some previous round) and removes it if Shell Side Arm stays special. |
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.
Tests should work now
Yep looks like tests pass with that. Strangely, replacing the code block if (move.hasFlag(MoveFlags.MAKES_CONTACT)) {
move.makesContact(false);
} with just |
This does seem weird |
What are the changes the user will see?
The user now makes physical contact if Shell Side Arm does physical damage.
What are the changes from a developer perspective?
Now calls
makesContact()
if move turns physical.Removed
.partial()
Added test that checks for contact
Screenshots/Videos
Before changes vs Rough Skin:
shell-side-arm-implementation-before.webm
After changes vs Rough Skin:
shell-side-arm-implementation-after.webm
How to test the changes?
Give enemy Pokemon Rough Skin (Ability) and use Side Shell Arm. Make sure the enemy Pokemon has more SPDEF than DEF.
Checklist
beta
as my base branchnpm run test
)npm run create-test
) or updated existing tests related to the PR's changes?