mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
commit
8a1619f9b4
6 changed files with 347 additions and 8 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue