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

[Move] Improve Future Sight & Doom Desire (still partial) #4545

Merged
merged 8 commits into from
Nov 5, 2024

Conversation

DayKev
Copy link
Collaborator

@DayKev DayKev commented Oct 2, 2024

What are the changes the user will see?

Future Sight and Doom Desire improvements:

  • Enable Future Sight / Doom Desire to hit if mon switches out / dies
  • Fail if mon is already being targeted by one of these moves
  • Enables Future Sight / Doom Desire to hit through protection moves.

Not fixed:

  • Cannot be used on multiple Pokémon in doubles, only the first target will be hit.
  • ???

Why am I making these changes?

The moves were barely implemented.

What are the changes from a developer perspective?

Added checks/code in MovePhase and MoveEffectPhase for delayed attacks.

How to test the changes?

npm run test future_sight

Checklist

  • I'm using beta as my base branch
  • There is no overlap with another PR?
  • The PR is self-contained and cannot be split into smaller PRs?
  • Have I provided a clear explanation of the changes?
  • Have I considered writing automated tests for the issue?
  • [ ] If I have text, did I make it translatable and add a key in the English locale file(s)?
  • Have I tested the changes (manually)?
    • Are all unit tests still passing? (npm run test)
  • [ ] Are the changes visual?
    • [ ] Have I provided screenshots/videos of the changes?

@DayKev DayKev added the Move Affects a move label Oct 2, 2024
@DayKev DayKev requested a review from a team as a code owner October 2, 2024 08:33
@Snailman11
Copy link
Collaborator

Snailman11 commented Oct 2, 2024

I think this
Fixes #1568
[BUG] Future Sight does not behave like the mainline games

(Player's Future Sight goes away if player user switches.)
https://discord.com/channels/1125469663833370665/1245140616392867950
-Also contains Known Bugs (Enigma Consumed on Predict, Crash on missing target)

EDIT: it seems to fix all of the above

@DayKev
Copy link
Collaborator Author

DayKev commented Oct 2, 2024

It fixes some of the issues but not all of them. I suppose the original issue could be closed upon merge and a new, updated issue could be opened afterwards with the remaining bugs.

@DayKev DayKev linked an issue Oct 2, 2024 that may be closed by this pull request
@frutescens
Copy link
Collaborator

re: Cannot be used on multiple Pokémon in doubles, only the first target will be hit.

Could creating a BattlerTag class function onSwitch() stop these current restrictions? Well, it's out of scope.

@DayKev
Copy link
Collaborator Author

DayKev commented Oct 3, 2024

re: Cannot be used on multiple Pokémon in doubles, only the first target will be hit.

Could creating a BattlerTag class function onSwitch() stop these current restrictions? Well, it's out of scope.

I tried swapping to a BattlerTag implementation (handling normal switching is fairly easy) but the problem is when a Pokémon faints (and I didn't test with non-normal switching, such as with U-Turn or Roar etc). If there was a way to apply arena tags to a field index instead of the whole side... that's probably what the final solution will need, but that's potentially a lot of refactoring.

@frutescens
Copy link
Collaborator

Yeah, I ran into a similar issue with Imprison.

src/data/move.ts Outdated Show resolved Hide resolved
src/test/moves/future_sight.test.ts Outdated Show resolved Hide resolved
src/test/moves/future_sight.test.ts Outdated Show resolved Hide resolved
geefuoco and others added 2 commits October 21, 2024 02:10
@PigeonBar
Copy link
Collaborator

I think the "Future Sight hits immediately when called by Metronome or Copycat" bug is occurring due to Future Sight using PokemonMove.virtual to keep track of whether it is currently the predict turn or the hit turn (see new PokemonMove(this.sourceMove!, 0, 0, true)):

class DelayedAttackTag extends ArenaTag {
public targetIndex: BattlerIndex;
constructor(tagType: ArenaTagType, sourceMove: Moves | undefined, sourceId: number, targetIndex: BattlerIndex) {
super(tagType, 3, sourceMove, sourceId);
this.targetIndex = targetIndex;
}
lapse(arena: Arena): boolean {
const ret = super.lapse(arena);
if (!ret) {
arena.scene.unshiftPhase(new MoveEffectPhase(arena.scene, this.sourceId!, [ this.targetIndex ], new PokemonMove(this.sourceMove!, 0, 0, true))); // TODO: are those bangs correct?
}
return ret;
}
onRemove(arena: Arena): void { }
}

Not sure what's the best way to fix this, maybe pass another argument into MoveEffectPhase specifically for whether or not it is specifically the hit turn of a delayed attack move?

src/data/move.ts Outdated Show resolved Hide resolved
src/data/move.ts Outdated Show resolved Hide resolved
src/data/move.ts Outdated Show resolved Hide resolved
@Tempo-anon Tempo-anon merged commit ab6d15e into pagefaultgames:beta Nov 5, 2024
13 checks passed
@DayKev DayKev deleted the fix-future-sight branch November 9, 2024 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Move Affects a move
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Future Sight does not behave like the mainline games
7 participants