-
Notifications
You must be signed in to change notification settings - Fork 786
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: simpler method for mana that lasts until end of turn (#12667)
- Loading branch information
1 parent
44fb947
commit 34ae226
Showing
7 changed files
with
49 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
Mage/src/main/java/mage/abilities/effects/mana/UntilEndOfTurnManaEffect.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package mage.abilities.effects.mana; | ||
|
||
import mage.Mana; | ||
import mage.abilities.Ability; | ||
import mage.abilities.dynamicvalue.DynamicValue; | ||
import mage.game.Game; | ||
import mage.players.Player; | ||
|
||
public class UntilEndOfTurnManaEffect extends BasicManaEffect { | ||
|
||
public UntilEndOfTurnManaEffect(Mana mana) { | ||
this(mana, null); | ||
} | ||
|
||
public UntilEndOfTurnManaEffect(Mana mana, DynamicValue netAmount) { | ||
super(mana, netAmount); | ||
staticText += ". Until end of turn, you don't lose this mana as steps and phases end"; | ||
} | ||
|
||
protected UntilEndOfTurnManaEffect(final UntilEndOfTurnManaEffect effect) { | ||
super(effect); | ||
} | ||
|
||
@Override | ||
public UntilEndOfTurnManaEffect copy() { | ||
return new UntilEndOfTurnManaEffect(this); | ||
} | ||
|
||
@Override | ||
protected void addManaToPool(Player player, Mana manaToAdd, Game game, Ability source) { | ||
player.getManaPool().addMana(manaToAdd, game, source, true); | ||
} | ||
|
||
} |