mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
updates to spMakeToken
This commit is contained in:
@@ -5709,22 +5709,34 @@ public class CardFactory implements NewConstants {
|
|||||||
card.removeIntrinsicKeyword(parse);
|
card.removeIntrinsicKeyword(parse);
|
||||||
final String[] k = parse.split("<>");
|
final String[] k = parse.split("<>");
|
||||||
|
|
||||||
SpellAbility spell = new Spell(card) {
|
|
||||||
private static final long serialVersionUID = -5286946184688616830L;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void resolve() {
|
|
||||||
final int num = "X".equals(k[1]) ? CardFactoryUtil.xCount(card, card.getSVar("X")) : Integer.valueOf(k[1]);
|
final int num = "X".equals(k[1]) ? CardFactoryUtil.xCount(card, card.getSVar("X")) : Integer.valueOf(k[1]);
|
||||||
final String name = k[2];
|
final String name = k[2];
|
||||||
final String imageName = k[3];
|
final String imageName = k[3];
|
||||||
final String controller = (k[4].equals("Controller") ? card.getController() : AllZone.GameAction.getOpponent(card.getController()));
|
final String controllerString = k[4];
|
||||||
final String manaCost = k[5];
|
final String manaCost = k[5];
|
||||||
final String[] types = k[6].split(";");
|
final String[] types = k[6].split(";");
|
||||||
final int attack = Integer.valueOf(k[7]);
|
final int attack = Integer.valueOf(k[7]);
|
||||||
final int defense = Integer.valueOf(k[8]);
|
final int defense = Integer.valueOf(k[8]);
|
||||||
final String[] keywords = k[9].split(";");
|
final String[] keywords = k[9].split(";");
|
||||||
|
|
||||||
|
SpellAbility spell = new Spell(card) {
|
||||||
|
private static final long serialVersionUID = -5286946184688616830L;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPlayAI() {
|
||||||
|
if(num == 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void resolve() {
|
||||||
|
String controller = (controllerString.equals("Controller") ? card.getController() : AllZone.GameAction.getOpponent(card.getController()));
|
||||||
for(int i = 0; i < num; i ++ ){
|
for(int i = 0; i < num; i ++ ){
|
||||||
if(k[9].equals("None")) keywords[0] = "";
|
if(keywords[0].equals("None")) keywords[0] = "";
|
||||||
CardFactoryUtil.makeToken(name, imageName, controller, manaCost, types, attack, defense, keywords);
|
CardFactoryUtil.makeToken(name, imageName, controller, manaCost, types, attack, defense, keywords);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user