* Some more changes for rework of ENTERS_THE_BATTLEFIELD event and card movement.

This commit is contained in:
LevelX2 2015-10-18 23:47:51 +02:00
parent 415700ccb2
commit fef34b65f6
4 changed files with 25 additions and 22 deletions

View file

@ -51,7 +51,6 @@ public class PrimalVigor extends CardImpl {
super(ownerId, 162, "Primal Vigor", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{G}");
this.expansionSetCode = "C13";
// If one or more tokens would be put onto the battlefield, twice that many of those tokens are put onto the battlefield instead.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PrimalVigorTokenEffect()));
// If one or more +1/+1 counters would be placed on a creature, twice that many +1/+1 counters are placed on that creature instead.
@ -121,7 +120,7 @@ class PrimalVigorCounterEffect extends ReplacementEffectImpl {
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
event.setAmount(event.getAmount() *2);
event.setAmount(event.getAmount() * 2);
return false;
}
@ -132,8 +131,11 @@ class PrimalVigorCounterEffect extends ReplacementEffectImpl {
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
Permanent target = game.getPermanent(event.getTargetId());
if (target != null && target.getCardType().contains(CardType.CREATURE)
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent == null) {
permanent = game.getPermanentEntering(event.getTargetId());
}
if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)
&& event.getData() != null && event.getData().equals("+1/+1")) {
return true;
}

View file

@ -53,7 +53,6 @@ public class HardenedScales extends CardImpl {
super(ownerId, 133, "Hardened Scales", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{G}");
this.expansionSetCode = "KTK";
// If one or more +1/+1 counters would be placed on a creature you control, that many plus one +1/+1 counters are placed on it instead.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new HardenedScalesEffect()));
@ -70,6 +69,7 @@ public class HardenedScales extends CardImpl {
}
class HardenedScalesEffect extends ReplacementEffectImpl {
HardenedScalesEffect() {
super(Duration.WhileOnBattlefield, Outcome.BoostCreature, false);
staticText = "If one or more +1/+1 counters would be placed on a creature you control, that many plus one +1/+1 counters are placed on it instead";
@ -94,9 +94,12 @@ class HardenedScalesEffect extends ReplacementEffectImpl {
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getData().equals(CounterType.P1P1.getName())) {
Permanent target = game.getPermanent(event.getTargetId());
if (target != null && target.getControllerId().equals(source.getControllerId())
&& target.getCardType().contains(CardType.CREATURE)) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent == null) {
permanent = game.getPermanentEntering(event.getTargetId());
}
if (permanent != null && permanent.getControllerId().equals(source.getControllerId())
&& permanent.getCardType().contains(CardType.CREATURE)) {
return true;
}
}

View file

@ -113,6 +113,7 @@ class DoublingSeasonTokenEffect extends ReplacementEffectImpl {
}
class DoublingSeasonCounterEffect extends ReplacementEffectImpl {
DoublingSeasonCounterEffect() {
super(Duration.WhileOnBattlefield, Outcome.BoostCreature, false);
staticText = "If an effect would place one or more counters on a permanent you control, it places twice that many of those counters on that permanent instead";
@ -135,8 +136,11 @@ class DoublingSeasonCounterEffect extends ReplacementEffectImpl {
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
Permanent target = game.getPermanent(event.getTargetId());
if (target != null && target.getControllerId().equals(source.getControllerId())) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent == null) {
permanent = game.getPermanentEntering(event.getTargetId());
}
if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) {
return true;
}
return false;

View file

@ -93,14 +93,8 @@ class CorpsejackMenaceReplacementEffect extends ReplacementEffectImpl {
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent == null) {
permanent = game.getPermanentEntering(event.getTargetId());
}
if (permanent != null) {
permanent.addCounters(CounterType.P1P1.createInstance(event.getAmount() * 2), game, event.getAppliedEffects());
}
return true;
event.setAmount(event.getAmount() * 2);
return false;
}
@Override