added Summoning Sickness property

This commit is contained in:
BetaSteward 2010-11-27 17:55:51 +00:00
parent e36d4e57e1
commit ecd0281d81
3 changed files with 12 additions and 1 deletions

View file

@ -46,6 +46,7 @@ public class PermanentView extends CardView {
private boolean flipped; private boolean flipped;
private boolean phasedIn; private boolean phasedIn;
private boolean faceUp; private boolean faceUp;
private boolean summoningSickness;
private int damage; private int damage;
private List<UUID> attachments; private List<UUID> attachments;
private List<CounterView> counters; private List<CounterView> counters;
@ -57,6 +58,7 @@ public class PermanentView extends CardView {
this.flipped = permanent.isFlipped(); this.flipped = permanent.isFlipped();
this.phasedIn = permanent.isPhasedIn(); this.phasedIn = permanent.isPhasedIn();
this.faceUp = permanent.isFaceUp(); this.faceUp = permanent.isFaceUp();
this.summoningSickness = permanent.hasSummoningSickness();
this.damage = permanent.getDamage(); this.damage = permanent.getDamage();
if (permanent.getAttachments().size() > 0) { if (permanent.getAttachments().size() > 0) {
attachments = new ArrayList<UUID>(); attachments = new ArrayList<UUID>();
@ -96,6 +98,10 @@ public class PermanentView extends CardView {
return faceUp; return faceUp;
} }
public boolean hasSummoningSickness(){
return summoningSickness;
}
public List<UUID> getAttachments() { public List<UUID> getAttachments() {
return attachments; return attachments;
} }

View file

@ -68,6 +68,7 @@ public interface Permanent extends Card {
public boolean changeControllerId(UUID controllerId, Game game); public boolean changeControllerId(UUID controllerId, Game game);
public boolean canBeTargetedBy(MageObject source); public boolean canBeTargetedBy(MageObject source);
public boolean hasProtectionFrom(MageObject source); public boolean hasProtectionFrom(MageObject source);
public boolean hasSummoningSickness();
public int getDamage(); public int getDamage();
public int damage(int damage, UUID sourceId, Game game, boolean preventable); public int damage(int damage, UUID sourceId, Game game, boolean preventable);
public void removeAllDamage(Game game); public void removeAllDamage(Game game);

View file

@ -274,7 +274,6 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
if (!phasedIn) { if (!phasedIn) {
if (!replaceEvent(EventType.PHASE_IN, game)) { if (!replaceEvent(EventType.PHASE_IN, game)) {
this.phasedIn = true; this.phasedIn = true;
// addEffects(game);
fireEvent(EventType.PHASED_IN, game); fireEvent(EventType.PHASED_IN, game);
return true; return true;
} }
@ -311,6 +310,11 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
return false; return false;
} }
@Override
public boolean hasSummoningSickness() {
return !this.controlledFromStartOfTurn;
}
@Override @Override
public boolean isAttacking() { public boolean isAttacking() {
return attacking; return attacking;