mirror of
https://github.com/magefree/mage.git
synced 2025-12-29 23:12:10 -08:00
added missing Planeswalker damage redirection effect + some fixes
This commit is contained in:
parent
120de78d97
commit
06b7e63843
37 changed files with 347 additions and 75 deletions
|
|
@ -137,7 +137,7 @@ public class ProteanHydra extends CardImpl<ProteanHydra> {
|
|||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
boolean retValue = false;
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount());
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false);
|
||||
int damage = event.getAmount();
|
||||
if (!game.replaceEvent(preventEvent)) {
|
||||
event.setAmount(0);
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ import mage.Constants.Zone;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.common.PutIntoGraveFromBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
|
@ -117,7 +118,7 @@ class NecroticPlagueEffect extends ContinuousEffectImpl<NecroticPlagueEffect> {
|
|||
case AbilityAddingRemovingEffects_6:
|
||||
if (sublayer == SubLayer.NA) {
|
||||
creature.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new SacrificeSourceEffect()));
|
||||
creature.addAbility(new LeavesBattlefieldTriggeredAbility(new NecroticPlagueEffect2(source.getSourceId()), false));
|
||||
creature.addAbility(new PutIntoGraveFromBattlefieldTriggeredAbility(new NecroticPlagueEffect2(source.getSourceId()), false));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -187,4 +188,9 @@ class NecroticPlagueEffect2 extends OneShotEffect<NecroticPlagueEffect2> {
|
|||
return new NecroticPlagueEffect2(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Ability source) {
|
||||
return "its controller chooses target creature one of his or her opponents controls. Return Necrotic Plague from its owner's graveyard to the battlefield attached to that creature.";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -112,7 +112,7 @@ class VengefulArchonEffect extends PreventionEffectImpl<VengefulArchonEffect> {
|
|||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getControllerId(), source.getId(), source.getControllerId(), event.getAmount());
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getControllerId(), source.getId(), source.getControllerId(), event.getAmount(), false);
|
||||
if (!game.replaceEvent(preventEvent)) {
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
if (player != null) {
|
||||
|
|
|
|||
|
|
@ -74,20 +74,23 @@ public class BraveTheElements extends CardImpl<BraveTheElements> {
|
|||
|
||||
class BraveTheElementsEffect extends GainAbilityControlledEffect {
|
||||
|
||||
FilterCreaturePermanent filter1 = new FilterCreaturePermanent();
|
||||
private static FilterCreaturePermanent filter1 = new FilterCreaturePermanent();
|
||||
|
||||
static {
|
||||
filter1.setUseColor(true);
|
||||
filter1.getColor().setWhite(true);
|
||||
}
|
||||
|
||||
FilterCard filter2;
|
||||
|
||||
public BraveTheElementsEffect() {
|
||||
super(new ProtectionAbility(new FilterCard()), Duration.EndOfTurn);
|
||||
filter1.setUseColor(true);
|
||||
filter1.getColor().setWhite(true);
|
||||
super(new ProtectionAbility(new FilterCard()), Duration.EndOfTurn, filter1);
|
||||
filter2 = (FilterCard)((ProtectionAbility)ability).getFilter();
|
||||
filter2.setUseColor(true);
|
||||
}
|
||||
|
||||
public BraveTheElementsEffect(final BraveTheElementsEffect effect) {
|
||||
super(effect);
|
||||
this.filter1 = effect.filter1.copy();
|
||||
this.filter2 = effect.filter2.copy();
|
||||
}
|
||||
|
||||
|
|
@ -101,10 +104,8 @@ class BraveTheElementsEffect extends GainAbilityControlledEffect {
|
|||
ChoiceColor choice = (ChoiceColor) source.getChoices().get(0);
|
||||
filter2.setColor(choice.getColor());
|
||||
filter2.setMessage(choice.getChoice());
|
||||
for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter1, source.getControllerId())) {
|
||||
perm.addAbility(ability);
|
||||
}
|
||||
return true;
|
||||
ability = new ProtectionAbility(new FilterCard(filter2));
|
||||
return super.apply(game, source);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue