mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
commit
429f434216
24 changed files with 1497 additions and 12 deletions
|
|
@ -60,7 +60,7 @@ public class PutIntoGraveFromBattlefieldAllTriggeredAbility extends TriggeredAbi
|
|||
public PutIntoGraveFromBattlefieldAllTriggeredAbility(final PutIntoGraveFromBattlefieldAllTriggeredAbility ability) {
|
||||
super(ability);
|
||||
this.filter = ability.filter;
|
||||
this.onlyToControllerGraveyard = ability.onlyToControllerGraveyard;
|
||||
this.onlyToControllerGraveyard = ability.onlyToControllerGraveyard;
|
||||
this.setTargetPointer = ability.setTargetPointer;
|
||||
}
|
||||
|
||||
|
|
@ -73,8 +73,11 @@ public class PutIntoGraveFromBattlefieldAllTriggeredAbility extends TriggeredAbi
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
if (zEvent.getFromZone() == Zone.BATTLEFIELD
|
||||
&& zEvent.getToZone() == Zone.GRAVEYARD) {
|
||||
&& zEvent.getToZone() == Zone.GRAVEYARD) {
|
||||
if (filter.match(zEvent.getTarget(), this.getSourceId(), this.getControllerId(), game)) {
|
||||
if(onlyToControllerGraveyard && !this.getControllerId().equals(zEvent.getPlayerId())) {
|
||||
return false;
|
||||
}
|
||||
if (setTargetPointer) {
|
||||
for (Effect effect :this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
|
|
@ -45,7 +45,7 @@ public class PreventDamageByTargetEffect extends PreventionEffectImpl {
|
|||
public PreventDamageByTargetEffect(Duration duration) {
|
||||
this(duration, false);
|
||||
}
|
||||
|
||||
|
||||
public PreventDamageByTargetEffect(Duration duration, int amount) {
|
||||
this(duration, amount, false);
|
||||
}
|
||||
|
|
@ -53,11 +53,11 @@ public class PreventDamageByTargetEffect extends PreventionEffectImpl {
|
|||
public PreventDamageByTargetEffect(Duration duration, boolean onlyCombat) {
|
||||
this(duration, Integer.MAX_VALUE, onlyCombat);
|
||||
}
|
||||
|
||||
|
||||
public PreventDamageByTargetEffect(Duration duration, int amount, boolean onlyCombat) {
|
||||
super(duration, amount, onlyCombat);
|
||||
}
|
||||
|
||||
|
||||
public PreventDamageByTargetEffect(final PreventDamageByTargetEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
|
@ -88,7 +88,7 @@ public class PreventDamageByTargetEffect extends PreventionEffectImpl {
|
|||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Prevent all");
|
||||
if (onlyCombat) {
|
||||
sb.append("combat ");
|
||||
sb.append(" combat ");
|
||||
}
|
||||
sb.append(" damage target ");
|
||||
sb.append(mode.getTargets().get(0).getTargetName()).append(" would deal ").append(duration.toString());
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ public class BoostEnchantedEffect extends ContinuousEffectImpl {
|
|||
if (affectedObjectsSet) {
|
||||
// Added boosts of activated or triggered abilities exist independent from the source they are created by
|
||||
// so a continuous effect for the permanent itself with the attachment is created
|
||||
Permanent equipment = game.getPermanent(source.getSourceId());
|
||||
Permanent equipment = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
if (equipment != null && equipment.getAttachedTo() != null) {
|
||||
this.setTargetPointer(new FixedTarget(equipment.getAttachedTo(), game.getState().getZoneChangeCounter(equipment.getAttachedTo())));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ public enum CounterType {
|
|||
POISON("poison"),
|
||||
PRESSURE("pressure"),
|
||||
QUEST("quest"),
|
||||
SHELL("shell"),
|
||||
SHIELD("shield"),
|
||||
SHRED("shred"),
|
||||
SLIME("slime"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue