forked from External/mage
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 commit17f5be6a79. This reverts commit7ebd2f1815. This reverts commit00969d1fe7. * Remove ownership check on exiled cards * Another test (currently failing) * ignore test * fix test: strict choose mode
This commit is contained in:
parent
90d35e0543
commit
ec4c2e2170
22 changed files with 154 additions and 226 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue