mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
more fixes
This commit is contained in:
parent
c61881e5df
commit
58c4ae1f38
12 changed files with 43 additions and 29 deletions
|
@ -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.
|
||||
|
@ -85,7 +85,7 @@ class BloodhallOozeTriggeredAbility1 extends TriggeredAbilityImpl<BloodhallOozeT
|
|||
}
|
||||
|
||||
public BloodhallOozeTriggeredAbility1() {
|
||||
super(Zone.BATTLEFIELD, new AddPlusOneCountersSourceEffect(1));
|
||||
super(Zone.BATTLEFIELD, new AddPlusOneCountersSourceEffect(1), true);
|
||||
}
|
||||
|
||||
public BloodhallOozeTriggeredAbility1(final BloodhallOozeTriggeredAbility1 ability) {
|
||||
|
@ -127,7 +127,7 @@ class BloodhallOozeTriggeredAbility2 extends TriggeredAbilityImpl<BloodhallOozeT
|
|||
}
|
||||
|
||||
public BloodhallOozeTriggeredAbility2() {
|
||||
super(Zone.BATTLEFIELD, new AddPlusOneCountersSourceEffect(1));
|
||||
super(Zone.BATTLEFIELD, new AddPlusOneCountersSourceEffect(1), true);
|
||||
}
|
||||
|
||||
public BloodhallOozeTriggeredAbility2(final BloodhallOozeTriggeredAbility2 ability) {
|
||||
|
|
|
@ -41,7 +41,7 @@ import mage.filter.FilterPermanent;
|
|||
*/
|
||||
public class BackToNature extends CardImpl<BackToNature> {
|
||||
|
||||
private static FilterPermanent filter = new FilterPermanent();
|
||||
private static FilterPermanent filter = new FilterPermanent("enchantments");
|
||||
|
||||
static {
|
||||
filter.getCardType().add(CardType.ENCHANTMENT);
|
||||
|
|
|
@ -92,4 +92,9 @@ class BloodTitheEffect extends OneShotEffect<BloodTitheEffect> {
|
|||
return new BloodTitheEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Ability source) {
|
||||
return "Each opponent loses 3 life. You gain life equal to the life lost this way";
|
||||
}
|
||||
|
||||
}
|
|
@ -132,8 +132,8 @@ class BloodcrazedGoblinEffect extends ReplacementEffectImpl<BloodcrazedGoblinEff
|
|||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == EventType.DECLARE_ATTACKER && source.getSourceId().equals(event.getSourceId())) {
|
||||
Watcher watcher = game.getState().getWatchers().get(source.getControllerId(), "OpponentDamaged");
|
||||
if (watcher != null && watcher.conditionMet())
|
||||
return true;
|
||||
if (watcher != null)
|
||||
return !watcher.conditionMet();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ public class CallToMind extends CardImpl<CallToMind> {
|
|||
}
|
||||
|
||||
public CallToMind(UUID ownerId) {
|
||||
super(ownerId, 47, "CallToMind", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{U}");
|
||||
super(ownerId, 47, "Call to Mind", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{U}");
|
||||
this.expansionSetCode = "M11";
|
||||
this.color.setBlue(true);
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
public class CaptivatingVampire extends CardImpl<CaptivatingVampire> {
|
||||
|
||||
private static FilterCreaturePermanent filter1 = new FilterCreaturePermanent("Vampire creatures");
|
||||
private static FilterControlledCreaturePermanent filter2 = new FilterControlledCreaturePermanent("five untapped Vampires");
|
||||
private static FilterControlledCreaturePermanent filter2 = new FilterControlledCreaturePermanent("untapped Vampire");
|
||||
|
||||
static {
|
||||
filter1.getSubtype().add("Vampire");
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
package mage.abilities.costs.common;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.CostImpl;
|
||||
import mage.abilities.costs.VariableCost;
|
||||
import mage.game.Game;
|
||||
|
@ -45,7 +44,7 @@ public class PayVariableLoyaltyCost extends CostImpl<PayVariableLoyaltyCost> imp
|
|||
protected int amountPaid = 0;
|
||||
|
||||
public PayVariableLoyaltyCost() {
|
||||
this.text = "X loyalty";
|
||||
this.text = "-X loyalty";
|
||||
}
|
||||
|
||||
public PayVariableLoyaltyCost(final PayVariableLoyaltyCost cost) {
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
package mage.abilities.costs.common;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.Constants.Outcome;
|
||||
import mage.abilities.costs.CostImpl;
|
||||
|
@ -41,19 +42,22 @@ import mage.target.common.TargetControlledPermanent;
|
|||
*/
|
||||
public class TapTargetCost extends CostImpl<TapTargetCost> {
|
||||
|
||||
TargetControlledPermanent target;
|
||||
|
||||
public TapTargetCost(TargetControlledPermanent target) {
|
||||
this.addTarget(target);
|
||||
this.text = "tap " + target.getTargetName() + " you control";
|
||||
this.target = target;
|
||||
this.text = "tap " + target.getMaxNumberOfTargets() + " " + target.getTargetName() + " you control";
|
||||
}
|
||||
|
||||
public TapTargetCost(final TapTargetCost cost) {
|
||||
super(cost);
|
||||
this.target = cost.target.copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean pay(Game game, UUID sourceId, UUID controllerId, boolean noMana) {
|
||||
if (targets.choose(Outcome.Tap, controllerId, game)) {
|
||||
for (UUID targetId: targets.get(0).getTargets()) {
|
||||
if (target.choose(Outcome.Tap, controllerId, game)) {
|
||||
for (UUID targetId: (List<UUID>)target.getTargets()) {
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent == null)
|
||||
return false;
|
||||
|
@ -65,7 +69,7 @@ public class TapTargetCost extends CostImpl<TapTargetCost> {
|
|||
|
||||
@Override
|
||||
public boolean canPay(UUID sourceId, UUID controllerId, Game game) {
|
||||
return targets.canChoose(controllerId, controllerId, game);
|
||||
return target.canChoose(controllerId, controllerId, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -94,7 +94,7 @@ public class CantTargetControlledEffect extends ReplacementEffectImpl<CantTarget
|
|||
if (filterSource == null)
|
||||
return true;
|
||||
else {
|
||||
StackObject sourceObject = game.getStack().getStackObject(source.getSourceId());
|
||||
StackObject sourceObject = game.getStack().getStackObject(event.getSourceId());
|
||||
if (sourceObject != null && filterSource.match(sourceObject)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -358,11 +358,14 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
|
|||
@Override
|
||||
public boolean addAttachment(UUID permanentId, Game game) {
|
||||
if (!this.attachments.contains(permanentId)) {
|
||||
if (!game.replaceEvent(new GameEvent(GameEvent.EventType.ATTACH, objectId, permanentId, controllerId, damage))) {
|
||||
if (!game.replaceEvent(new GameEvent(GameEvent.EventType.ATTACH, objectId, permanentId, controllerId))) {
|
||||
this.attachments.add(permanentId);
|
||||
game.getPermanent(permanentId).attachTo(objectId);
|
||||
game.fireEvent(new GameEvent(GameEvent.EventType.ATTACHED, objectId, permanentId, controllerId, damage));
|
||||
return true;
|
||||
Permanent attachment = game.getPermanent(permanentId);
|
||||
if (attachment != null) {
|
||||
attachment.attachTo(objectId);
|
||||
game.fireEvent(new GameEvent(GameEvent.EventType.ATTACHED, objectId, permanentId, controllerId));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
@ -371,10 +374,13 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
|
|||
@Override
|
||||
public boolean removeAttachment(UUID permanentId, Game game) {
|
||||
if (this.attachments.contains(permanentId)) {
|
||||
if (!game.replaceEvent(new GameEvent(GameEvent.EventType.UNATTACH, objectId, permanentId, controllerId, damage))) {
|
||||
if (!game.replaceEvent(new GameEvent(GameEvent.EventType.UNATTACH, objectId, permanentId, controllerId))) {
|
||||
this.attachments.remove(permanentId);
|
||||
game.getPermanent(permanentId).attachTo(null);
|
||||
game.fireEvent(new GameEvent(GameEvent.EventType.UNATTACHED, objectId, permanentId, controllerId, damage));
|
||||
Permanent attachment = game.getPermanent(permanentId);
|
||||
if (attachment != null) {
|
||||
attachment.attachTo(null);
|
||||
}
|
||||
game.fireEvent(new GameEvent(GameEvent.EventType.UNATTACHED, objectId, permanentId, controllerId));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ public class TargetControlledCreaturePermanent extends TargetControlledPermanent
|
|||
}
|
||||
|
||||
public TargetControlledCreaturePermanent(int minNumTargets, int maxNumTargets, FilterControlledCreaturePermanent filter, boolean notTarget) {
|
||||
super(1, 1, filter, notTarget);
|
||||
super(minNumTargets, maxNumTargets, filter, notTarget);
|
||||
this.targetName = filter.getMessage();
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ public class TargetControlledPermanent<T extends TargetControlledPermanent<T>> e
|
|||
}
|
||||
|
||||
public TargetControlledPermanent(int minNumTargets, int maxNumTargets, FilterControlledPermanent filter, boolean notTarget) {
|
||||
super(1, 1, filter, notTarget);
|
||||
super(minNumTargets, maxNumTargets, filter, notTarget);
|
||||
this.targetName = filter.getMessage();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue