mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
* Drain Power - Improved conditonal mana handling.
This commit is contained in:
parent
940fe603c6
commit
0ceb5fc88f
4 changed files with 35 additions and 70 deletions
|
|
@ -63,9 +63,9 @@ public class AddConditionalManaOfAnyColorEffect extends ManaEffect {
|
|||
staticText = "Add "
|
||||
+ (amount instanceof StaticValue ? (CardUtil.numberToText(((StaticValue) amount).toString())) : "")
|
||||
+ " mana "
|
||||
+ (oneChoice ? "of any"
|
||||
+ (amount instanceof StaticValue && (((StaticValue) amount).toString()).equals("1") ? "" : " one")
|
||||
+ " color" : "in any combination of colors")
|
||||
+ (oneChoice || (amount instanceof StaticValue && (((StaticValue) amount).toString()).equals("1"))
|
||||
? "of any" + (amount instanceof StaticValue && (((StaticValue) amount).toString()).equals("1") ? "" : " one") + " color"
|
||||
: "in any combination of colors")
|
||||
+ ". " + manaBuilder.getRule();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -395,7 +395,8 @@ public class ManaPool implements Serializable {
|
|||
Mana mana = manaToAdd.copy();
|
||||
if (!game.replaceEvent(new ManaEvent(EventType.ADD_MANA, source.getId(), source.getSourceId(), playerId, mana))) {
|
||||
if (mana instanceof ConditionalMana) {
|
||||
ManaPoolItem item = new ManaPoolItem((ConditionalMana) mana, source.getSourceObject(game), source.getOriginalId());
|
||||
ManaPoolItem item = new ManaPoolItem((ConditionalMana) mana, source.getSourceObject(game),
|
||||
((ConditionalMana) mana).getManaProducerOriginalId() != null ? ((ConditionalMana) mana).getManaProducerOriginalId() : source.getOriginalId());
|
||||
if (emptyOnTurnsEnd) {
|
||||
item.setDuration(Duration.EndOfTurn);
|
||||
}
|
||||
|
|
@ -505,4 +506,13 @@ public class ManaPool implements Serializable {
|
|||
public boolean isEmpty() {
|
||||
return count() == 0;
|
||||
}
|
||||
|
||||
public List<ManaPoolItem> getManaItems() {
|
||||
List<ManaPoolItem> itemsCopy = new ArrayList<>();
|
||||
for (ManaPoolItem manaItem : manaItems) {
|
||||
itemsCopy.add(manaItem.copy());
|
||||
}
|
||||
return itemsCopy;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue