* Brawl - fixed rollback error on gain ability usage;

This commit is contained in:
Oleg Agafonov 2020-01-13 13:50:50 +04:00
parent 4a004a27b3
commit bfdce903e9

View file

@ -1,12 +1,9 @@
package mage.cards.b;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.DamageWithPowerTargetEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.DamageWithPowerFromSourceToAnotherTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -15,8 +12,9 @@ import mage.constants.Duration;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author L_J
*/
public final class Brawl extends CardImpl {
@ -25,10 +23,10 @@ public final class Brawl extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{R}{R}");
// Until end of turn, all creatures gain "{T}: This creature deals damage equal to its power to target creature."
Ability ability = new SimpleActivatedAbility(new DamageWithPowerTargetEffect(), new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent());
Ability gainAbility = new SimpleActivatedAbility(new DamageWithPowerFromSourceToAnotherTargetEffect("This creature"), new TapSourceCost());
gainAbility.addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(
new GainAbilityAllEffect(ability, Duration.EndOfTurn, new FilterCreaturePermanent())
new GainAbilityAllEffect(gainAbility, Duration.EndOfTurn, new FilterCreaturePermanent())
.setText("Until end of turn, all creatures gain \"{T}: This creature deals damage equal to its power to target creature.\"")
);
}