Cleanup: GainAbilityControlledSpellsEffect (#10446)

* Hide reminder text on Zhulodok

* Use logic from GainAbilitySpellsEffect, fix so that CastFromZonePredicate works

* Text adjustments

* Show cascade ability in hand for Abaddon the Despoiler

* Remove redundant class

* Simplify Cast Through Time

* Don't add additional instances of redundant abilities

* Remove redundant check

* Add option to ignore mana validation when checking playable objects

* Fix null errors

* Fix GainAbilityControlledSpellsEffect to apply ability to playable cards rather than owned cards

* Add unit test

* Revert bad workaround code

This reverts commit 17f5be6a79.
This reverts commit 7ebd2f1815.
This reverts commit 00969d1fe7.

* Remove ownership check on exiled cards

* Another test (currently failing)

* ignore test

* fix test: strict choose mode
This commit is contained in:
xenohedron 2023-06-24 01:15:58 -04:00 committed by GitHub
parent 90d35e0543
commit ec4c2e2170
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 154 additions and 226 deletions

View file

@ -1183,8 +1183,6 @@ public class GameState implements Serializable, Copyable<GameState> {
* @param ability
*/
public void addOtherAbility(Card attachedTo, Ability ability) {
checkWrongDynamicAbilityUsage(attachedTo, ability);
addOtherAbility(attachedTo, ability, true);
}
@ -1202,6 +1200,12 @@ public class GameState implements Serializable, Copyable<GameState> {
Ability newAbility;
if (ability instanceof MageSingleton || !copyAbility) {
// Avoid adding another instance of an ability where multiple copies are redundant
if (attachedTo.getAbilities().contains(ability)
|| (getAllOtherAbilities(attachedTo.getId()) != null
&& getAllOtherAbilities(attachedTo.getId()).contains(ability))) {
return;
}
newAbility = ability;
} else {
// must use new id, so you can add multiple instances of the same ability