fixed issue 45 - show cast when cycle is available

This commit is contained in:
BetaSteward 2011-05-07 23:08:34 -04:00
parent 31e5dff618
commit 33e7569f87
5 changed files with 21 additions and 2 deletions

View file

@ -46,7 +46,7 @@ public class AbilityPickerView implements Serializable {
public AbilityPickerView(Collection<? extends Ability> abilities) {
for (Ability ability: abilities) {
choices.put(ability.getId(), ability.getRule());
choices.put(ability.getId(), ability.getRule(true));
}
}

View file

@ -74,6 +74,7 @@ public interface Ability extends Serializable {
public Zone getZone();
public boolean isUsesStack();
public String getRule();
public String getRule(boolean all);
public String getRule(String source);
public boolean activate(Game game, boolean noMana);
public boolean resolve(Game game);

View file

@ -283,9 +283,14 @@ public abstract class AbilityImpl<T extends AbilityImpl<T>> implements Ability {
@Override
public String getRule() {
return getRule(false);
}
@Override
public String getRule(boolean all) {
StringBuilder sbRule = new StringBuilder();
if (!(this.abilityType == AbilityType.SPELL)) {
if (all || this.abilityType != AbilityType.SPELL) {
if (manaCosts.size() > 0) {
sbRule.append(manaCosts.getText());
}

View file

@ -73,6 +73,14 @@ public class SpellAbility extends ActivatedAbilityImpl<SpellAbility> {
return " casts " + getMessageText(game);
}
@Override
public String getRule(boolean all) {
if (all) {
return super.getRule(all) + name;
}
return "";
}
public void clear() {
this.choices.clearChosen();
this.targets.clearChosen();

View file

@ -192,6 +192,11 @@ public class StackAbility implements StackObject, Ability {
return ability.getRule();
}
@Override
public String getRule(boolean all) {
return ability.getRule(all);
}
@Override
public String getRule(String source) {
return ability.getRule(source);