improve usability of Rebound ability (#11261)

* remove boilerplate template comments

* fix Rebound, now need to choose only once

* fix text: Harmless Assault
This commit is contained in:
xenohedron 2023-10-05 22:03:23 -04:00 committed by GitHub
parent cf395f9f66
commit cd6c5aa7ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 13 additions and 57 deletions

View file

@ -1,4 +1,3 @@
package mage.cards.h;
import java.util.UUID;
@ -15,13 +14,13 @@ import mage.filter.common.FilterAttackingCreature;
*/
public final class HarmlessAssault extends CardImpl {
private static final FilterAttackingCreature filter = new FilterAttackingCreature("attacking creatures");
public HarmlessAssault(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{W}{W}");
// Prevent all combat damage that would be dealt this turn by attacking
// creatures.
this.getSpellAbility().addEffect(new PreventAllDamageByAllPermanentsEffect(new FilterAttackingCreature(), Duration.EndOfTurn, true));
// Prevent all combat damage that would be dealt this turn by attacking creatures.
this.getSpellAbility().addEffect(new PreventAllDamageByAllPermanentsEffect(filter, Duration.EndOfTurn, true));
}
private HarmlessAssault(final HarmlessAssault card) {

View file

@ -1,7 +1,3 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.mage.test.cards.abilities.keywords;
import mage.constants.PhaseStep;
@ -39,6 +35,7 @@ public class ReboundTest extends CardTestPlayerBase {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Distortion Strike", "Memnite");
setStrictChooseMode(true);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
@ -63,6 +60,11 @@ public class ReboundTest extends CardTestPlayerBase {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Distortion Strike", "Memnite");
// Yes to rebound
setChoice(playerA, true);
addTarget(playerA, "Memnite");
setStrictChooseMode(true);
setStopAt(3, PhaseStep.PRECOMBAT_MAIN);
execute();
@ -91,6 +93,7 @@ public class ReboundTest extends CardTestPlayerBase {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Distortion Strike", "Memnite");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Counterspell", "Distortion Strike");
setStrictChooseMode(true);
setStopAt(3, PhaseStep.PRECOMBAT_MAIN);
execute();

View file

@ -1,7 +1,3 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.common;
import mage.abilities.TriggeredAbilityImpl;

View file

@ -1,7 +1,3 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.common;
import mage.abilities.TriggeredAbilityImpl;

View file

@ -1,7 +1,3 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.common.delayed;
import mage.abilities.DelayedTriggeredAbility;
@ -43,4 +39,3 @@ public class AtTheBeginOfYourNextDrawStepDelayedTriggeredAbility extends Delayed
return event.getPlayerId().equals(this.controllerId);
}
}

View file

@ -1,7 +1,3 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.common.delayed;
import mage.abilities.DelayedTriggeredAbility;
@ -43,4 +39,3 @@ public class AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility extends DelayedTr
return event.getPlayerId().equals(this.controllerId);
}
}

View file

@ -1,7 +1,3 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.decorator;
import mage.abilities.ActivatedAbilityImpl;

View file

@ -1,7 +1,3 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.effects.common;
import mage.MageObject;

View file

@ -1,7 +1,3 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.effects.common;
import mage.abilities.Ability;

View file

@ -127,7 +127,7 @@ class ReboundCastFromHandReplacementEffect extends ReplacementEffectImpl {
class ReboundEffectCastFromExileDelayedTrigger extends DelayedTriggeredAbility {
ReboundEffectCastFromExileDelayedTrigger(Card card, Game game) {
super(new ReboundCastSpellFromExileEffect().setTargetPointer(new FixedTarget(card, game)), Duration.Custom, true, true);
super(new ReboundCastSpellFromExileEffect().setTargetPointer(new FixedTarget(card, game)), Duration.Custom, true, false);
}
private ReboundEffectCastFromExileDelayedTrigger(final ReboundEffectCastFromExileDelayedTrigger ability) {

View file

@ -1,7 +1,3 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mage.constants;
/**

View file

@ -1,7 +1,3 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mage.filter.common;
import mage.constants.TargetController;

View file

@ -1,7 +1,3 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mage.filter.common;
import mage.constants.CardType;

View file

@ -1,7 +1,3 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mage.filter.common;
import mage.constants.CardType;
@ -32,4 +28,4 @@ public class FilterInstantOrSorceryCard extends FilterCard {
return new FilterInstantOrSorceryCard(this);
}
}
}