Re: eqPump (was VanillaEquipment) keyword
I have finished the first stage revision of the VanilaEquipment keyword. The new format for the cards.txt entries are looking good. Here is an example of four of them:
The word "none" no longer appears in either cards.txt file or card detail panel. The keywords and the ampersand delimiter can be separated with a space character. This makes the cards.txt entries more readable. I am using the .trim() command and I think that we may want to add this to other keywords as time permits.
The new parsing code:
I will merge this work into the SVN and then start on the second stage revision, modifying the CardFactoryUtil.vanila_equip() methods to handle an array of strings containing the keywords.
- Bone Saw
0
Artifact Equipment
Equipped creature gets +1/+0.
eqPump 1:1/0
Fireshrieker
3
Artifact Equipment
Equipped creature has double strike.
eqPump 2:0/0/Double Strike
Lightning Greaves
2
Artifact Equipment
Equipped creature has haste and shroud.
eqPump 0:0/0/Haste & Shroud
Peregrine Mask
1
Artifact Equipment
Equipped creature has defender, flying, and first strike.
eqPump 2:0/0/Defender & Flying & First Strike
The word "none" no longer appears in either cards.txt file or card detail panel. The keywords and the ampersand delimiter can be separated with a space character. This makes the cards.txt entries more readable. I am using the .trim() command and I think that we may want to add this to other keywords as time permits.
The new parsing code:
- Code: Select all
if(shouldEquip(card) != -1) {
int n = shouldEquip(card);
if(n != -1) {
String parse = card.getKeyword().get(n).toString();
card.removeIntrinsicKeyword(parse);
String k[] = parse.split(":");
String kk[] = k[1].split("/");
String tmpCost;
tmpCost = k[0].substring(6);
final String manacost = tmpCost.trim();
final String P = kk[0].trim();
final String T = kk[1].trim();
final int Power = Integer.parseInt(P);
final int Tough = Integer.parseInt(T);
String tempAb1 = "none";
String tempAb2 = "none";
String tempAb3 = "none";
if (kk.length > 2) // then there is at least one keyword ability to assign
{
String kkk[] = kk[2].split("&");
tempAb1 = kkk[0].trim();
if (kkk.length > 1) tempAb2 = kkk[1].trim();
if (kkk.length > 2) tempAb3 = kkk[2].trim(); //quantity of keyword abilities could be modified
}
final String Ab1 = tempAb1;
final String Ab2 = tempAb2;
final String Ab3 = tempAb3;
card.addSpellAbility(CardFactoryUtil.vanila_equip(card, Power, Tough, Ab1, Ab2, Ab3, manacost));
card.addEquipCommand(CardFactoryUtil.vanila_onequip(card, Power, Tough, Ab1, Ab2, Ab3, manacost));
card.addUnEquipCommand(CardFactoryUtil.vanila_unequip(card, Power, Tough, Ab1, Ab2, Ab3, manacost));
}
}// eqPump (was VanillaEquipment)
I will merge this work into the SVN and then start on the second stage revision, modifying the CardFactoryUtil.vanila_equip() methods to handle an array of strings containing the keywords.
My previous message refers to my revision 1st stage.
I will merge my work into the SVN.