merged with changes to tap and untap
commit
95193c483b
|
@ -47,9 +47,7 @@ public class Air_Servant {
|
|||
final Object[] choiceResults) {
|
||||
event.processTargetPermanent(game,choiceResults,0,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent creature) {
|
||||
if (!creature.isTapped()) {
|
||||
game.doAction(new MagicTapAction(creature,true));
|
||||
}
|
||||
game.doAction(new MagicTapAction(creature,true));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -49,9 +49,7 @@ public class Avacynian_Priest {
|
|||
final Object[] choiceResults) {
|
||||
event.processTargetPermanent(game,choiceResults,0,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent creature) {
|
||||
if (!creature.isTapped()) {
|
||||
game.doAction(new MagicTapAction(creature,true));
|
||||
}
|
||||
game.doAction(new MagicTapAction(creature,true));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ public class Backlash {
|
|||
game.doAction(new MagicMoveCardAction((MagicCardOnStack)data[0]));
|
||||
event.processTargetPermanent(game,choiceResults,0,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent creature) {
|
||||
if (!creature.isTapped()) {
|
||||
if (creature.isUntapped()) {
|
||||
game.doAction(new MagicTapAction(creature,true));
|
||||
final MagicDamage damage=new MagicDamage(creature,creature.getController(),creature.getPower(game),false);
|
||||
game.doAction(new MagicDealDamageAction(damage));
|
||||
|
|
|
@ -39,7 +39,7 @@ public class Claustrophobia {
|
|||
final Object[] choiceResults) {
|
||||
final MagicPermanent permanent=(MagicPermanent)data[0];
|
||||
final MagicPermanent enchantedCreature = permanent.getEnchantedCreature();
|
||||
if (enchantedCreature.isValid() && !enchantedCreature.isTapped()) {
|
||||
if (enchantedCreature.isValid()) {
|
||||
game.doAction(new MagicTapAction(enchantedCreature,true));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,9 +101,7 @@ public class Deathbringer_Liege {
|
|||
if (MagicMayChoice.isYesChoice(choiceResults[0])) {
|
||||
event.processTargetPermanent(game,choiceResults,1,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent creature) {
|
||||
if (!creature.isTapped()) {
|
||||
game.doAction(new MagicTapAction(creature,true));
|
||||
}
|
||||
game.doAction(new MagicTapAction(creature,true));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -43,9 +43,7 @@ public class Gustcloak_Cavalier {
|
|||
if (MagicMayChoice.isYesChoice(choiceResults[0])) {
|
||||
event.processTargetPermanent(game,choiceResults,1,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent creature) {
|
||||
if (!creature.isTapped()) {
|
||||
game.doAction(new MagicTapAction(creature,true));
|
||||
}
|
||||
game.doAction(new MagicTapAction(creature,true));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ public class Howling_Mine {
|
|||
public static final MagicAtUpkeepTrigger T = new MagicAtUpkeepTrigger() {
|
||||
@Override
|
||||
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer player) {
|
||||
return (!permanent.isTapped()) ?
|
||||
return (permanent.isUntapped()) ?
|
||||
new MagicEvent(
|
||||
permanent,
|
||||
player,
|
||||
|
|
|
@ -49,9 +49,7 @@ public class Icy_Manipulator {
|
|||
final Object[] choiceResults) {
|
||||
event.processTargetPermanent(game,choiceResults,0,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent permanent) {
|
||||
if (!permanent.isTapped()) {
|
||||
game.doAction(new MagicTapAction(permanent,true));
|
||||
}
|
||||
game.doAction(new MagicTapAction(permanent,true));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -41,9 +41,7 @@ public class Kitsune_Dawnblade {
|
|||
if (MagicMayChoice.isYesChoice(choiceResults[0])) {
|
||||
event.processTargetPermanent(game,choiceResults,1,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent creature) {
|
||||
if (!creature.isTapped()) {
|
||||
game.doAction(new MagicTapAction(creature,true));
|
||||
}
|
||||
game.doAction(new MagicTapAction(creature,true));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -43,9 +43,7 @@ public class Merfolk_Seastalkers {
|
|||
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choiceResults) {
|
||||
event.processTargetPermanent(game,choiceResults,0,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent creature) {
|
||||
if (!creature.isTapped()) {
|
||||
game.doAction(new MagicTapAction(creature,true));
|
||||
}
|
||||
game.doAction(new MagicTapAction(creature,true));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -42,9 +42,7 @@ public class Mind_Games {
|
|||
final MagicCardOnStack cardOnStack = (MagicCardOnStack)data[0];
|
||||
event.processTargetPermanent(game,choiceResults,0,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent permanent) {
|
||||
if (!permanent.isTapped()) {
|
||||
game.doAction(new MagicTapAction(permanent,true));
|
||||
}
|
||||
game.doAction(new MagicTapAction(permanent,true));
|
||||
}
|
||||
});
|
||||
if (MagicBuybackChoice.isYesChoice(choiceResults[1])) {
|
||||
|
|
|
@ -21,7 +21,7 @@ public class Narcolepsy {
|
|||
@Override
|
||||
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer data) {
|
||||
final MagicPermanent enchantedCreature=permanent.getEnchantedCreature();
|
||||
return (enchantedCreature.isValid() && !enchantedCreature.isTapped()) ?
|
||||
return (enchantedCreature.isValid() && enchantedCreature.isUntapped()) ?
|
||||
new MagicEvent(
|
||||
permanent,
|
||||
permanent.getController(),
|
||||
|
@ -38,7 +38,7 @@ public class Narcolepsy {
|
|||
final Object[] choiceResults) {
|
||||
final MagicPermanent permanent=(MagicPermanent)data[0];
|
||||
final MagicPermanent enchantedCreature=permanent.getEnchantedCreature();
|
||||
if (enchantedCreature.isValid() && !enchantedCreature.isTapped()) {
|
||||
if (enchantedCreature.isValid()) {
|
||||
game.doAction(new MagicTapAction(enchantedCreature,true));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,9 +37,7 @@ public class Sidar_Jabari {
|
|||
final Object[] choiceResults) {
|
||||
event.processTargetPermanent(game,choiceResults,0,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent creature) {
|
||||
if (!creature.isTapped()) {
|
||||
game.doAction(new MagicTapAction(creature,true));
|
||||
}
|
||||
game.doAction(new MagicTapAction(creature,true));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -48,9 +48,7 @@ public class Stun_Sniper {
|
|||
public void doAction(final MagicPermanent creature) {
|
||||
final MagicDamage damage=new MagicDamage((MagicPermanent)data[0],creature,1,false);
|
||||
game.doAction(new MagicDealDamageAction(damage));
|
||||
if (!creature.isTapped()) {
|
||||
game.doAction(new MagicTapAction(creature,true));
|
||||
}
|
||||
game.doAction(new MagicTapAction(creature,true));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -230,6 +230,10 @@ public class MagicPermanent implements MagicSource,MagicTarget,Comparable<MagicP
|
|||
return hasState(MagicPermanentState.Tapped);
|
||||
}
|
||||
|
||||
public boolean isUntapped() {
|
||||
return !hasState(MagicPermanentState.Tapped);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MagicColoredType getColoredType() {
|
||||
return cardDefinition.getColoredType();
|
||||
|
|
|
@ -10,7 +10,7 @@ import magic.model.trigger.MagicTriggerType;
|
|||
public class MagicTapAction extends MagicAction {
|
||||
|
||||
private final MagicPermanent permanent;
|
||||
private boolean tap;
|
||||
private boolean isUntapped;
|
||||
private final boolean hasScore;
|
||||
|
||||
public MagicTapAction(final MagicPermanent permanent,final boolean hasScore) {
|
||||
|
@ -20,8 +20,8 @@ public class MagicTapAction extends MagicAction {
|
|||
|
||||
@Override
|
||||
public void doAction(final MagicGame game) {
|
||||
tap=!permanent.hasState(MagicPermanentState.Tapped);
|
||||
if (tap) {
|
||||
isUntapped=!permanent.hasState(MagicPermanentState.Tapped);
|
||||
if (isUntapped) {
|
||||
permanent.setState(MagicPermanentState.Tapped);
|
||||
if (hasScore) {
|
||||
setScore(permanent.getController(),ArtificialScoringSystem.getTappedScore(permanent,game));
|
||||
|
@ -33,7 +33,7 @@ public class MagicTapAction extends MagicAction {
|
|||
|
||||
@Override
|
||||
public void undoAction(final MagicGame game) {
|
||||
if (tap) {
|
||||
if (isUntapped) {
|
||||
permanent.clearState(MagicPermanentState.Tapped);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import magic.model.MagicPermanentState;
|
|||
public class MagicUntapAction extends MagicAction {
|
||||
|
||||
private final MagicPermanent permanent;
|
||||
private boolean untap;
|
||||
private boolean isTapped;
|
||||
|
||||
public MagicUntapAction(final MagicPermanent permanent) {
|
||||
this.permanent=permanent;
|
||||
|
@ -17,8 +17,8 @@ public class MagicUntapAction extends MagicAction {
|
|||
|
||||
@Override
|
||||
public void doAction(final MagicGame game) {
|
||||
untap=permanent.hasState(MagicPermanentState.Tapped);
|
||||
if (untap) {
|
||||
isTapped=permanent.hasState(MagicPermanentState.Tapped);
|
||||
if (isTapped) {
|
||||
permanent.clearState(MagicPermanentState.Tapped);
|
||||
setScore(permanent.getController(),-ArtificialScoringSystem.getTappedScore(permanent,game));
|
||||
game.setStateCheckRequired();
|
||||
|
@ -27,7 +27,7 @@ public class MagicUntapAction extends MagicAction {
|
|||
|
||||
@Override
|
||||
public void undoAction(final MagicGame game) {
|
||||
if (untap) {
|
||||
if (isTapped) {
|
||||
permanent.setState(MagicPermanentState.Tapped);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue