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