mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Fixed Fork. It now correctly changes the color of the copied spell to red.
This commit is contained in:
@@ -2,7 +2,7 @@ Name:Fork
|
||||
ManaCost:R R
|
||||
Types:Instant
|
||||
Text:no text
|
||||
A:SP$ CopySpell | Cost$ R R | ValidTgts$ Instant,Sorcery | SpellDescription$ Copy target instant or sorcery spell. You may choose new targets for the copy.
|
||||
A:SP$ CopySpell | Cost$ R R | ValidTgts$ Instant,Sorcery | CopyIsColor$ Red | OverwriteColors$ True | SpellDescription$ Copy target instant or sorcery spell, except that the copy is red. You may choose new targets for the copy.
|
||||
SVar:RemAIDeck:True
|
||||
SVar:Rarity:Rare
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/fork.jpg
|
||||
|
||||
@@ -19,6 +19,8 @@ package forge.card.cardfactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import forge.AllZone;
|
||||
import forge.Card;
|
||||
@@ -158,6 +160,23 @@ public class CardFactory implements CardFactoryInterface {
|
||||
return;
|
||||
}*/
|
||||
final Card c = AllZone.getCardFactory().copyCard(original);
|
||||
|
||||
// change the color of the copy (eg: Fork)
|
||||
final SpellAbility sourceSA = source.getFirstSpellAbility();
|
||||
if (sourceSA.getAbilityFactory().getMapParams().containsKey("CopyIsColor")) {
|
||||
String tmp = "";
|
||||
final HashMap<String, String> params = sourceSA.getAbilityFactory().getMapParams();
|
||||
final String newColor = params.get("CopyIsColor");
|
||||
if (newColor.equals("ChosenColor")) {
|
||||
tmp = CardUtil.getShortColorsString(source.getChosenColor());
|
||||
} else {
|
||||
tmp = CardUtil.getShortColorsString(new ArrayList<String>(Arrays.asList(newColor.split(","))));
|
||||
}
|
||||
final String finalColors = tmp;
|
||||
|
||||
c.addColor(finalColors, c, !params.containsKey("OverwriteColors"), true);
|
||||
}
|
||||
|
||||
c.addController(controller);
|
||||
c.setCopiedSpell(true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user