mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
fixed issue 45 - show cast when cycle is available
This commit is contained in:
parent
31e5dff618
commit
33e7569f87
5 changed files with 21 additions and 2 deletions
|
@ -46,7 +46,7 @@ public class AbilityPickerView implements Serializable {
|
||||||
|
|
||||||
public AbilityPickerView(Collection<? extends Ability> abilities) {
|
public AbilityPickerView(Collection<? extends Ability> abilities) {
|
||||||
for (Ability ability: abilities) {
|
for (Ability ability: abilities) {
|
||||||
choices.put(ability.getId(), ability.getRule());
|
choices.put(ability.getId(), ability.getRule(true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,6 +74,7 @@ public interface Ability extends Serializable {
|
||||||
public Zone getZone();
|
public Zone getZone();
|
||||||
public boolean isUsesStack();
|
public boolean isUsesStack();
|
||||||
public String getRule();
|
public String getRule();
|
||||||
|
public String getRule(boolean all);
|
||||||
public String getRule(String source);
|
public String getRule(String source);
|
||||||
public boolean activate(Game game, boolean noMana);
|
public boolean activate(Game game, boolean noMana);
|
||||||
public boolean resolve(Game game);
|
public boolean resolve(Game game);
|
||||||
|
|
|
@ -283,9 +283,14 @@ public abstract class AbilityImpl<T extends AbilityImpl<T>> implements Ability {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRule() {
|
public String getRule() {
|
||||||
|
return getRule(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRule(boolean all) {
|
||||||
StringBuilder sbRule = new StringBuilder();
|
StringBuilder sbRule = new StringBuilder();
|
||||||
|
|
||||||
if (!(this.abilityType == AbilityType.SPELL)) {
|
if (all || this.abilityType != AbilityType.SPELL) {
|
||||||
if (manaCosts.size() > 0) {
|
if (manaCosts.size() > 0) {
|
||||||
sbRule.append(manaCosts.getText());
|
sbRule.append(manaCosts.getText());
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,6 +73,14 @@ public class SpellAbility extends ActivatedAbilityImpl<SpellAbility> {
|
||||||
return " casts " + getMessageText(game);
|
return " casts " + getMessageText(game);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRule(boolean all) {
|
||||||
|
if (all) {
|
||||||
|
return super.getRule(all) + name;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
public void clear() {
|
public void clear() {
|
||||||
this.choices.clearChosen();
|
this.choices.clearChosen();
|
||||||
this.targets.clearChosen();
|
this.targets.clearChosen();
|
||||||
|
|
|
@ -192,6 +192,11 @@ public class StackAbility implements StackObject, Ability {
|
||||||
return ability.getRule();
|
return ability.getRule();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRule(boolean all) {
|
||||||
|
return ability.getRule(all);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRule(String source) {
|
public String getRule(String source) {
|
||||||
return ability.getRule(source);
|
return ability.getRule(source);
|
||||||
|
|
Loading…
Reference in a new issue