mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- Added Call to Arms
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1656,6 +1656,7 @@ forge-gui/res/cardsfolder/c/call_of_the_herd.txt svneol=native#text/plain
|
||||
forge-gui/res/cardsfolder/c/call_of_the_nightwing.txt -text
|
||||
forge-gui/res/cardsfolder/c/call_of_the_wild.txt svneol=native#text/plain
|
||||
forge-gui/res/cardsfolder/c/call_the_skybreaker.txt svneol=native#text/plain
|
||||
forge-gui/res/cardsfolder/c/call_to_arms.txt -text
|
||||
forge-gui/res/cardsfolder/c/call_to_glory.txt svneol=native#text/plain
|
||||
forge-gui/res/cardsfolder/c/call_to_heel.txt svneol=native#text/plain
|
||||
forge-gui/res/cardsfolder/c/call_to_mind.txt svneol=native#text/plain
|
||||
|
||||
14
forge-gui/res/cardsfolder/c/call_to_arms.txt
Normal file
14
forge-gui/res/cardsfolder/c/call_to_arms.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
Name:Call to Arms
|
||||
ManaCost:1 W
|
||||
Types:Enchantment
|
||||
K:ETBReplacement:Other:ChooseColor
|
||||
SVar:ChooseColor:DB$ ChooseColor | AILogic$ MostProminentHumanControls | Defined$ You | SubAbility$ ChooseOpp | SpellDescription$ As CARDNAME enters the battlefield, choose a color and an opponent.
|
||||
SVar:ChooseOpp:DB$ ChoosePlayer | Defined$ You | Choices$ Player.Opponent | AILogic$ Curse
|
||||
SVar:X:Count$Valid Permanent.nonToken+ChosenColor+ChosenCtrl
|
||||
SVar:Y:Count$SecondMostProminentColor Permanent.nonToken+ChosenCtrl
|
||||
S:Mode$ Continuous | Affected$ Creature.White | AddPower$ 1 | AddToughness$ 1 | CheckSVar$ X | SVarCompare$ GTY | Description$ White creatures get +1/+1 as long as the chosen color is the most common color among nontoken permanents the chosen player controls but isn't tied for most common.
|
||||
T:Mode$ Always | CheckSVar$ X | SVarCompare$ LEY | TriggerZones$ Battlefield | Execute$ TrigSac | TriggerDescription$ When the chosen color isn't the most common color among nontoken permanents the chosen player controls or is tied for most common, sacrifice CARDNAME.
|
||||
SVar:TrigSac:DB$ Sacrifice | SacValid$ Self
|
||||
SVar:RemRandomDeck:True
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/call_to_arms.jpg
|
||||
Oracle:As Call to Arms enters the battlefield, choose a color and an opponent.\nWhite creatures get +1/+1 as long as the chosen color is the most common color among nontoken permanents the chosen player controls but isn't tied for most common.\nWhen the chosen color isn't the most common color among nontoken permanents the chosen player controls or is tied for most common, sacrifice Call to Arms.
|
||||
@@ -1117,6 +1117,13 @@ public class CardFactoryUtil {
|
||||
return doXMath(getMostProminentCreatureTypeSize(list), m, c);
|
||||
}
|
||||
|
||||
if (l[0].startsWith("SecondMostProminentColor")) {
|
||||
String restriction = l[0].split(" ")[1];
|
||||
List<Card> list = CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield), restriction, cc, c);
|
||||
int[] colorSize = SortColorsFromList(list);
|
||||
return doXMath(colorSize[colorSize.length - 2], m, c);
|
||||
}
|
||||
|
||||
if (l[0].startsWith("RolledThisTurn")) {
|
||||
return game.getPhaseHandler().getPlanarDiceRolledthisTurn();
|
||||
}
|
||||
@@ -1822,6 +1829,33 @@ public class CardFactoryUtil {
|
||||
return mask;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* SortColorsFromList.
|
||||
* </p>
|
||||
*
|
||||
* @param list
|
||||
* a {@link forge.CardList} object.
|
||||
* @return a List.
|
||||
*/
|
||||
public static int[] SortColorsFromList(final List<Card> list) {
|
||||
int cntColors = MagicColor.WUBRG.length;
|
||||
final int[] map = new int[cntColors];
|
||||
for(int i = 0; i < cntColors; i++) {
|
||||
map[i] = 0;
|
||||
}
|
||||
|
||||
for (final Card crd : list) {
|
||||
ColorSet color = CardUtil.getColors(crd);
|
||||
for(int i = 0; i < cntColors; i++) {
|
||||
if( color.hasAnyColor(MagicColor.WUBRG[i]))
|
||||
map[i]++;
|
||||
}
|
||||
} // for
|
||||
Arrays.sort(map);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* getMostProminentColorsFromList.
|
||||
|
||||
Reference in New Issue
Block a user