Merge pull request #1361 from nigelzor/vanguard

add Momir Basic game type
This commit is contained in:
LevelX2 2015-11-12 09:22:52 +01:00 committed by emerald000
commit ae3640557a
28 changed files with 846 additions and 278 deletions

View file

@ -71,16 +71,17 @@ public class LimitedTimesPerTurnActivatedAbility extends ActivatedAbilityImpl {
@Override
public boolean canActivate(UUID playerId, Game game) {
if (super.canActivate(playerId, game)) {
ActivationInfo activationInfo = getActivationInfo(game);
return activationInfo == null || activationInfo.turnNum != game.getTurnNum() || activationInfo.activationCounter < maxActivationsPerTurn;
}
return false;
return super.canActivate(playerId, game) && hasMoreActivationsThisTurn(game);
}
private boolean hasMoreActivationsThisTurn(Game game) {
ActivationInfo activationInfo = getActivationInfo(game);
return activationInfo == null || activationInfo.turnNum != game.getTurnNum() || activationInfo.activationCounter < maxActivationsPerTurn;
}
@Override
public boolean activate(Game game, boolean noMana) {
if (canActivate(this.controllerId, game)) {
if (hasMoreActivationsThisTurn(game)) {
if (super.activate(game, noMana)) {
ActivationInfo activationInfo = getActivationInfo(game);
if (activationInfo == null) {

View file

@ -59,6 +59,7 @@ public class CardCriteria {
private boolean red;
private boolean white;
private boolean colorless;
private Integer convertedManaCost;
private String sortBy;
private Long start;
private Long count;
@ -173,6 +174,11 @@ public class CardCriteria {
return this;
}
public CardCriteria convertedManaCost(Integer convertedManaCost) {
this.convertedManaCost = convertedManaCost;
return this;
}
public CardCriteria maxCardNumber(int maxCardNumber) {
this.maxCardNumber = maxCardNumber;
return this;
@ -248,6 +254,11 @@ public class CardCriteria {
clausesCount++;
}
if (convertedManaCost != null) {
where.eq("convertedManaCost", convertedManaCost);
clausesCount++;
}
if (!black || !blue || !green || !red || !white || !colorless) {
int colorClauses = 0;
if (black) {