mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Re-added the color fix for Fork (without the NPEs this time)
This commit is contained in:
@@ -162,20 +162,23 @@ public class CardFactory implements CardFactoryInterface {
|
|||||||
final Card c = AllZone.getCardFactory().copyCard(original);
|
final Card c = AllZone.getCardFactory().copyCard(original);
|
||||||
|
|
||||||
// change the color of the copy (eg: Fork)
|
// change the color of the copy (eg: Fork)
|
||||||
/*final SpellAbility sourceSA = source.getFirstSpellAbility();
|
// Currently won't work for abilities, only for spells
|
||||||
if (sourceSA.getAbilityFactory().getMapParams().containsKey("CopyIsColor")) {
|
if (null != source.getFirstSpellAbility().getAbilityFactory()) {
|
||||||
String tmp = "";
|
final SpellAbility sourceSA = source.getFirstSpellAbility();
|
||||||
final HashMap<String, String> params = sourceSA.getAbilityFactory().getMapParams();
|
if (sourceSA.getAbilityFactory().getMapParams().containsKey("CopyIsColor")) {
|
||||||
final String newColor = params.get("CopyIsColor");
|
String tmp = "";
|
||||||
if (newColor.equals("ChosenColor")) {
|
final HashMap<String, String> params = sourceSA.getAbilityFactory().getMapParams();
|
||||||
tmp = CardUtil.getShortColorsString(source.getChosenColor());
|
final String newColor = params.get("CopyIsColor");
|
||||||
} else {
|
if (newColor.equals("ChosenColor")) {
|
||||||
tmp = CardUtil.getShortColorsString(new ArrayList<String>(Arrays.asList(newColor.split(","))));
|
tmp = CardUtil.getShortColorsString(source.getChosenColor());
|
||||||
}
|
} else {
|
||||||
final String finalColors = tmp;
|
tmp = CardUtil.getShortColorsString(new ArrayList<String>(Arrays.asList(newColor.split(","))));
|
||||||
|
}
|
||||||
|
final String finalColors = tmp;
|
||||||
|
|
||||||
c.addColor(finalColors, c, !params.containsKey("OverwriteColors"), true);
|
c.addColor(finalColors, c, !params.containsKey("OverwriteColors"), true);
|
||||||
}*/
|
}
|
||||||
|
}
|
||||||
|
|
||||||
c.addController(controller);
|
c.addController(controller);
|
||||||
c.setCopiedSpell(true);
|
c.setCopiedSpell(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user