Fixed setTapped(true\false) not correctly used in various places.

This commit is contained in:
magenoxx 2011-06-02 09:03:06 +04:00
parent 8e3f2b8634
commit aed19fe183
10 changed files with 13 additions and 11 deletions

View file

@ -134,7 +134,7 @@ class FinestHourEffect extends OneShotEffect<FinestHourEffect> {
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
permanent.setTapped(false);
permanent.untap(game);
game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false));
}
else {

View file

@ -96,7 +96,7 @@ public class VolitionReins extends CardImpl<VolitionReins> {
if (enchantment != null && enchantment.getAttachedTo() != null) {
Permanent permanent = game.getPermanent(enchantment.getAttachedTo());
if (permanent != null && permanent.isTapped()) {
permanent.setTapped(false);
permanent.untap(game);
return true;
}
}

View file

@ -56,7 +56,7 @@ public class RegenerateSourceEffect extends ReplacementEffectImpl<RegenerateSour
//20110204 - 701.11
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
permanent.setTapped(true);
permanent.tap(game);
permanent.removeFromCombat(game);
permanent.removeAllDamage(game);
this.used = true;

View file

@ -56,7 +56,7 @@ public class RegenerateTargetEffect extends ReplacementEffectImpl<RegenerateTar
//20110204 - 701.11
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
permanent.setTapped(true);
permanent.tap(game);
permanent.removeFromCombat(game);
permanent.removeAllDamage(game);
this.used = true;

View file

@ -57,7 +57,7 @@ public class TapSourceEffect extends OneShotEffect<TapSourceEffect> {
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
permanent.setTapped(true);
permanent.tap(game);
return true;
}
return false;

View file

@ -64,7 +64,7 @@ public class TapSourceUnlessPaysEffect extends OneShotEffect<TapSourceUnlessPays
if (cost.pay(game, source.getId(), source.getControllerId(), false))
return true;
}
permanent.setTapped(true);
permanent.tap(game);
return true;
}
return false;

View file

@ -52,7 +52,7 @@ public class UntapSourceEffect extends OneShotEffect<UntapSourceEffect> {
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
permanent.setTapped(false);
permanent.untap(game);
return true;
}
return false;

View file

@ -60,7 +60,7 @@ public class UntapTargetEffect extends OneShotEffect<UntapTargetEffect> {
for (UUID target: source.getTargets().get(0).getTargets()) {
Permanent permanent = game.getPermanent(target);
if (permanent != null) {
permanent.setTapped(false);
permanent.untap(game);
}
else {
return false;

View file

@ -231,8 +231,9 @@ public class Combat implements Serializable, Copyable<Combat> {
CombatGroup newGroup = new CombatGroup(defenderId, defender != null);
newGroup.attackers.add(attackerId);
Permanent attacker = game.getPermanent(attackerId);
if (!attacker.getAbilities().containsKey(VigilanceAbility.getInstance().getId()))
attacker.setTapped(true);
if (!attacker.getAbilities().containsKey(VigilanceAbility.getInstance().getId())) {
attacker.tap(game);
}
attacker.setAttacking(true);
groups.add(newGroup);
}

View file

@ -44,7 +44,8 @@ public interface Permanent extends Card {
public boolean untap(Game game);
public boolean tap(Game game);
// use tap(game)
// setTapped doesn't trigger TAPPED event
// setTapped doesn't trigger TAPPED event and should be used
// only if you want permanent to enter battlefield tapped
@Deprecated
public void setTapped(boolean tapped);
public boolean canTap();