-
Notifications
You must be signed in to change notification settings - Fork 745
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
fix Release to the Wind, small rework/clean for edge cases #12226
base: master
Are you sure you want to change the base?
Conversation
} | ||
} | ||
return ActivationStatus.getFalse(); | ||
} | ||
|
||
private ActivationStatus canActivateUsingForetell(SpellAbility spellAbility, UUID playerId, Game game) { | ||
return spellAbility.copy().setSpellAbilityCastMode(SpellAbilityCastMode.FORETELL).canActivate(playerId, game); |
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.
wtf
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.
Do you understand the problem this is solving?
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.
Yes, I understand -- you introduced new workaround with injecting global identifier in abilities, it doesn't work with game engine and that's second workaround required to support it.
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.
small rework/clean for edge cases
It's not small rework. There are multiple changes with many workaround/hacks all around game engine.
Most important problem: it also uses objects modifications on playable calc -- it's smells very bad and do not contains any comments about it. Must be more safer way to do same things in read only.
Please, split it by smaller steps/PRs.
- Fixed card/implementation;
- Broken use cases/tests;
- Migrate all old cards/abilities/code to new version -- xmage must use same code/logic for all.
Current PR can't be merged without each workaround reviewed and checked.
ad52436
to
8dd3f4a
Compare
8dd3f4a
to
7c6cf00
Compare
Fix #12224
This is part of the general work to consolidate "you may play/you may cast" effects, add unit tests and fix edge cases.
Changes are along several axes:
MayCastTargetCardEffect
effect.MayCastTargetCardEffect
now supports:MageIdentifier.WithoutPayingManaCostAlternateCast
has been introduced to support the last bullet point (and not affect other alternate ways to cast the card from exile. e.g. [[Misthollow Griffin]])AdventureSpellAbilityImpl::canActivate
was not correct in edge cases. See the two TODO comments on weird choice in the Kess test and the AdventureCards test, the adventure cast was sometimes wrongly enabled to be activated, and it is now fixed.Plot
(resp.Foretell
) are now calling thecanActivate
method of theSpellAbility
they want to cast, usingSpellAbilityCastMode.PLOT
(resp. the newly addedSpellAbilityCastMode.FORETELL
). This allow bypassing the "from your hand" check inAdventureSpellAbilityImpl::canActivate
, as this way of casting does not want to actually check if the card can be cast from hand or with an activator.