* Enshrouding Mist - Fixed that the target creature was not untapped if renowned.

This commit is contained in:
LevelX2 2015-07-07 17:09:52 +02:00
parent 322d2dd0e5
commit 51c6a89753
11 changed files with 135 additions and 40 deletions

View file

@ -16,15 +16,15 @@ import mage.game.permanent.Permanent;
* @author LevelX2
*/
public class RenownCondition implements Condition {
public class RenownedSourceCondition implements Condition {
private static RenownCondition fInstance = null;
private static RenownedSourceCondition fInstance = null;
private RenownCondition() {}
private RenownedSourceCondition() {}
public static RenownCondition getInstance() {
public static RenownedSourceCondition getInstance() {
if (fInstance == null) {
fInstance = new RenownCondition();
fInstance = new RenownedSourceCondition();
}
return fInstance;
}
@ -33,7 +33,7 @@ public class RenownCondition implements Condition {
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
return permanent.isRenown();
return permanent.isRenowned();
}
return false;
}

View file

@ -0,0 +1,67 @@
/*
* 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
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* 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.
*/
package mage.abilities.condition.common;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author LevelX2
*/
public class RenownedTargetCondition implements Condition {
private static RenownedTargetCondition fInstance = null;
private RenownedTargetCondition() {
}
public static RenownedTargetCondition getInstance() {
if (fInstance == null) {
fInstance = new RenownedTargetCondition();
}
return fInstance;
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget());
if (permanent != null) {
return permanent.isRenowned();
}
return false;
}
@Override
public String toString() {
return "it's renowned";
}
}

View file

@ -27,7 +27,7 @@ public class RenownAbility extends TriggeredAbilityImpl {
private int renownValue;
public RenownAbility(int renownValue) {
super(Zone.BATTLEFIELD, new BecomeRenownSourceEffect(renownValue), false);
super(Zone.BATTLEFIELD, new BecomesRenownedSourceEffect(renownValue), false);
this.renownValue = renownValue;
}
@ -49,7 +49,7 @@ public class RenownAbility extends TriggeredAbilityImpl {
@Override
public boolean checkInterveningIfClause(Game game) {
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(getSourceId());
return sourcePermanent != null && !sourcePermanent.isRenown();
return sourcePermanent != null && !sourcePermanent.isRenowned();
}
@Override
@ -63,20 +63,20 @@ public class RenownAbility extends TriggeredAbilityImpl {
}
}
class BecomeRenownSourceEffect extends OneShotEffect {
class BecomesRenownedSourceEffect extends OneShotEffect {
public BecomeRenownSourceEffect(int renownValue) {
public BecomesRenownedSourceEffect(int renownValue) {
super(Outcome.BoostCreature);
this.staticText = setText(renownValue);
}
public BecomeRenownSourceEffect(final BecomeRenownSourceEffect effect) {
public BecomesRenownedSourceEffect(final BecomesRenownedSourceEffect effect) {
super(effect);
}
@Override
public BecomeRenownSourceEffect copy() {
return new BecomeRenownSourceEffect(this);
public BecomesRenownedSourceEffect copy() {
return new BecomesRenownedSourceEffect(this);
}
@Override
@ -90,7 +90,7 @@ class BecomeRenownSourceEffect extends OneShotEffect {
renownValue = source.getManaCostsToPay().getX();
}
new AddCountersSourceEffect(CounterType.P1P1.createInstance(renownValue), true).apply(game, source);
permanent.setRenown(true);
permanent.setRenowned(true);
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.BECOMES_RENOWNED, source.getSourceId(), source.getSourceId(), source.getControllerId(), renownValue));
return true;
}

View file

@ -75,8 +75,8 @@ public interface Permanent extends Card, Controllable {
boolean isMonstrous();
void setMonstrous(boolean value);
boolean isRenown();
void setRenown(boolean value);
boolean isRenowned();
void setRenowned(boolean value);
void setCardNumber(int cid);
void setExpansionSetCode(String expansionSetCode);

View file

@ -90,7 +90,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
protected boolean flipped;
protected boolean transformed;
protected boolean monstrous;
protected boolean renown;
protected boolean renowned;
protected boolean manifested = false;
protected boolean morphed = false;
protected UUID originalControllerId;
@ -176,7 +176,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
this.maxBlockedBy = permanent.maxBlockedBy;
this.transformed = permanent.transformed;
this.monstrous = permanent.monstrous;
this.renown = permanent.renown;
this.renowned = permanent.renowned;
this.pairedCard = permanent.pairedCard;
this.timesLoyaltyUsed = permanent.timesLoyaltyUsed;
@ -1268,13 +1268,13 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
}
@Override
public boolean isRenown() {
return this.renown;
public boolean isRenowned() {
return this.renowned;
}
@Override
public void setRenown(boolean value) {
this.renown = value;
public void setRenowned(boolean value) {
this.renowned = value;
}
@Override