Merge pull request #4396 from spjspj/master

Add 3 cards  (UGL)
This commit is contained in:
spjspj 2018-01-11 17:56:55 +11:00 committed by GitHub
commit 8a1619f9b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 347 additions and 8 deletions

View file

@ -36,7 +36,9 @@ public class DoIfCostPaid extends OneShotEffect {
public DoIfCostPaid(Effect effect, Cost cost, String chooseUseText, boolean optional) {
super(Outcome.Benefit);
this.executingEffects.add(effect);
if (effect != null) {
this.executingEffects.add(effect);
}
this.cost = cost;
this.chooseUseText = chooseUseText;
this.optional = optional;
@ -74,10 +76,9 @@ public class DoIfCostPaid extends OneShotEffect {
message = CardUtil.replaceSourceName(message, mageObject.getLogName());
boolean result = true;
if (cost.canPay(source, source.getSourceId(), player.getId(), game)
&& (!optional || player.chooseUse(executingEffects.get(0).getOutcome(), message, source, game))) {
&& executingEffects.size() > 0 && (!optional || player.chooseUse(executingEffects.get(0).getOutcome(), message, source, game))) {
cost.clearPaid();
if (cost.pay(source, game, source.getSourceId(), player.getId(), false)) {
game.applyEffects(); // To end effects e.g. of sacrificed permanents
for (Effect effect : executingEffects) {
effect.setTargetPointer(this.targetPointer);
if (effect instanceof OneShotEffect) {
@ -87,7 +88,8 @@ public class DoIfCostPaid extends OneShotEffect {
}
}
player.resetStoredBookmark(game); // otherwise you can e.g. undo card drawn with Mentor of the Meek
} else if (!otherwiseEffects.isEmpty()) {
}
else if (!otherwiseEffects.isEmpty()) {
for (Effect effect : otherwiseEffects) {
effect.setTargetPointer(this.targetPointer);
if (effect instanceof OneShotEffect) {
@ -97,7 +99,8 @@ public class DoIfCostPaid extends OneShotEffect {
}
}
}
} else if (!otherwiseEffects.isEmpty()) {
}
else if (!otherwiseEffects.isEmpty()) {
for (Effect effect : otherwiseEffects) {
effect.setTargetPointer(this.targetPointer);
if (effect instanceof OneShotEffect) {

View file

@ -85,14 +85,14 @@ public enum SubType {
CENTAUR("Centaur", SubTypeSet.CreatureType),
CEREAN("Cerean", SubTypeSet.CreatureType, true), // Star Wars
CEPHALID("Cephalid", SubTypeSet.CreatureType),
CHICKEN("Chicken", SubTypeSet.CreatureType), // Unglued
CHICKEN("Chicken", SubTypeSet.CreatureType, true), // Unglued
CHIMERA("Chimera", SubTypeSet.CreatureType),
CHISS("Chiss", SubTypeSet.CreatureType, true),
CITIZEN("Citizen", SubTypeSet.CreatureType),
CLERIC("Cleric", SubTypeSet.CreatureType),
COCKATRICE("Cockatrice", SubTypeSet.CreatureType),
CONSTRUCT("Construct", SubTypeSet.CreatureType),
COW("Cow", SubTypeSet.CreatureType), // Unglued
COW("Cow", SubTypeSet.CreatureType, true), // Unglued
COWARD("Coward", SubTypeSet.CreatureType),
CRAB("Crab", SubTypeSet.CreatureType),
CROCODILE("Crocodile", SubTypeSet.CreatureType),
@ -134,7 +134,7 @@ public enum SubType {
FROG("Frog", SubTypeSet.CreatureType),
FUNGUS("Fungus", SubTypeSet.CreatureType),
// G
GAMER("Gamer", SubTypeSet.CreatureType), // Un-sets
GAMER("Gamer", SubTypeSet.CreatureType, true), // Un-sets
GAMORREAN("Gamorrean", SubTypeSet.CreatureType, true), // Star Wars
GAND("Gand", SubTypeSet.CreatureType, true), // Star Wars
GARGOYLE("Gargoyle", SubTypeSet.CreatureType),