mirror of
https://github.com/correl/mage.git
synced 2025-01-11 19:13:02 +00:00
Fixed setTapped(true\false) not correctly used in various places.
This commit is contained in:
parent
8e3f2b8634
commit
aed19fe183
10 changed files with 13 additions and 11 deletions
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue