mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
Merge branch 'manalki' into 'master'
ManaSpent: check source at time it produced See merge request core-developers/forge!5158
This commit is contained in:
@@ -434,7 +434,7 @@ public abstract class GameState {
|
||||
boolean first = true;
|
||||
StringBuilder counterString = new StringBuilder();
|
||||
|
||||
for(Entry<CounterType, Integer> kv : counters.entrySet()) {
|
||||
for (Entry<CounterType, Integer> kv : counters.entrySet()) {
|
||||
if (!first) {
|
||||
counterString.append(",");
|
||||
}
|
||||
@@ -470,7 +470,7 @@ public abstract class GameState {
|
||||
}
|
||||
|
||||
public void parse(List<String> lines) {
|
||||
for(String line : lines) {
|
||||
for (String line : lines) {
|
||||
parseLine(line);
|
||||
}
|
||||
}
|
||||
@@ -1110,13 +1110,13 @@ public abstract class GameState {
|
||||
|
||||
private void handleCardAttachments() {
|
||||
// Unattach all permanents first
|
||||
for(Entry<Card, Integer> entry : cardToAttachId.entrySet()) {
|
||||
for (Entry<Card, Integer> entry : cardToAttachId.entrySet()) {
|
||||
Card attachedTo = idToCard.get(entry.getValue());
|
||||
attachedTo.unAttachAllCards();
|
||||
}
|
||||
|
||||
// Attach permanents by ID
|
||||
for(Entry<Card, Integer> entry : cardToAttachId.entrySet()) {
|
||||
for (Entry<Card, Integer> entry : cardToAttachId.entrySet()) {
|
||||
Card attachedTo = idToCard.get(entry.getValue());
|
||||
Card attacher = entry.getKey();
|
||||
if (attacher.isAttachment()) {
|
||||
@@ -1125,7 +1125,7 @@ public abstract class GameState {
|
||||
}
|
||||
|
||||
// Enchant players by ID
|
||||
for(Entry<Card, Integer> entry : cardToEnchantPlayerId.entrySet()) {
|
||||
for (Entry<Card, Integer> entry : cardToEnchantPlayerId.entrySet()) {
|
||||
// TODO: improve this for game states with more than two players
|
||||
Card attacher = entry.getKey();
|
||||
Game game = attacher.getGame();
|
||||
@@ -1136,9 +1136,9 @@ public abstract class GameState {
|
||||
}
|
||||
|
||||
private void handleMergedCards() {
|
||||
for(Entry<Card, List<String>> entry : cardToMergedCards.entrySet()) {
|
||||
for (Entry<Card, List<String>> entry : cardToMergedCards.entrySet()) {
|
||||
Card mergedTo = entry.getKey();
|
||||
for(String mergedCardName : entry.getValue()) {
|
||||
for (String mergedCardName : entry.getValue()) {
|
||||
Card c;
|
||||
PaperCard pc = StaticData.instance().getCommonCards().getCard(mergedCardName. replace("^", ","));
|
||||
if (pc == null) {
|
||||
|
||||
@@ -20,8 +20,10 @@ package forge.game.mana;
|
||||
import forge.card.MagicColor;
|
||||
import forge.card.mana.ManaAtom;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.card.CardUtil;
|
||||
import forge.game.spellability.AbilityManaPart;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.zone.ZoneType;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -71,7 +73,7 @@ public class Mana {
|
||||
public Mana(final byte color, final Card source, final AbilityManaPart manaAbility) {
|
||||
this.color = color;
|
||||
this.manaAbility = manaAbility;
|
||||
this.sourceCard = source;
|
||||
this.sourceCard = source.isInZone(ZoneType.Battlefield) ? CardUtil.getLKICopy(source) : source.getGame().getChangeZoneLKIInfo(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user