mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-14 17:58:01 +00:00
Merge branch 'equipExtras' into 'master'
CardFactoryUtil: add way to add Extra Parameters and Extra Description See merge request core-developers/forge!4980
This commit is contained in:
@@ -2627,8 +2627,10 @@ public class CardFactoryUtil {
|
||||
String[] k = keyword.split(":");
|
||||
// Get cost string
|
||||
String equipCost = k[1];
|
||||
String valid = k.length > 2 ? k[2] : "Creature.YouCtrl";
|
||||
String vstr = k.length > 3 ? k[3] : "creature";
|
||||
String valid = k.length > 2 && !k[2].isEmpty() ? k[2] : "Creature.YouCtrl";
|
||||
String vstr = k.length > 3 && !k[3].isEmpty() ? k[3] : "creature";
|
||||
String extra = k.length > 4 ? k[4] : "";
|
||||
String extraDesc = k.length > 5 ? k[5] : "";
|
||||
// Create attach ability string
|
||||
final StringBuilder abilityStr = new StringBuilder();
|
||||
abilityStr.append("AB$ Attach | Cost$ ");
|
||||
@@ -2641,7 +2643,7 @@ public class CardFactoryUtil {
|
||||
abilityStr.append("| ").append(card.getSVar("AttachAi"));
|
||||
}
|
||||
abilityStr.append("| PrecostDesc$ Equip");
|
||||
if (k.length > 3) {
|
||||
if (k.length > 3 && !k[3].isEmpty()) {
|
||||
abilityStr.append(" ").append(vstr);
|
||||
}
|
||||
Cost cost = new Cost(equipCost, true);
|
||||
@@ -2651,7 +2653,14 @@ public class CardFactoryUtil {
|
||||
abilityStr.append(" ");
|
||||
}
|
||||
abilityStr.append("| CostDesc$ ").append(cost.toSimpleString()).append(" ");
|
||||
abilityStr.append("| SpellDescription$ (").append(inst.getReminderText()).append(")");
|
||||
abilityStr.append("| SpellDescription$ ");
|
||||
if (!extraDesc.isEmpty()) {
|
||||
abilityStr.append(". ").append(extraDesc).append(". ");
|
||||
}
|
||||
abilityStr.append("(").append(inst.getReminderText()).append(")");
|
||||
if (!extra.isEmpty()) {
|
||||
abilityStr.append("| ").append(extra);
|
||||
}
|
||||
// instantiate attach ability
|
||||
final SpellAbility newSA = AbilityFactory.getAbility(abilityStr.toString(), card);
|
||||
newSA.setIntrinsic(intrinsic);
|
||||
|
||||
@@ -309,8 +309,9 @@ public class Cost implements Serializable {
|
||||
// Changes Cost by adding a Life Payment
|
||||
if (parse.startsWith("PayLife<")) {
|
||||
// PayLife<LifeCost>
|
||||
final String[] splitStr = abCostParse(parse, 1);
|
||||
return new CostPayLife(splitStr[0]);
|
||||
final String[] splitStr = abCostParse(parse, 2);
|
||||
final String description = splitStr.length > 1 ? splitStr[1] : null;
|
||||
return new CostPayLife(splitStr[0], description);
|
||||
}
|
||||
|
||||
if (parse.startsWith("PayEnergy<")) {
|
||||
@@ -908,7 +909,7 @@ public class Cost implements Serializable {
|
||||
} else if (part instanceof CostAddMana) {
|
||||
costParts.add(new CostAddMana(amount, part.getType(), part.getTypeDescription()));
|
||||
} else if (part instanceof CostPayLife) {
|
||||
costParts.add(new CostPayLife(amount));
|
||||
costParts.add(new CostPayLife(amount, part.getTypeDescription()));
|
||||
}
|
||||
toRemove.add(other);
|
||||
alreadyAdded = true;
|
||||
|
||||
@@ -37,8 +37,8 @@ public class CostPayLife extends CostPart {
|
||||
* @param amount
|
||||
* the amount
|
||||
*/
|
||||
public CostPayLife(final String amount) {
|
||||
this.setAmount(amount);
|
||||
public CostPayLife(final String amount, final String description) {
|
||||
super(amount, "card", description);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -52,7 +52,13 @@ public class CostPayLife extends CostPart {
|
||||
@Override
|
||||
public final String toString() {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append("Pay ").append(this.getAmount()).append(" Life");
|
||||
sb.append("Pay ");
|
||||
String desc = this.getTypeDescription();
|
||||
if (desc != null) {
|
||||
sb.append(desc);
|
||||
} else {
|
||||
sb.append(this.getAmount()).append(" Life");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
Name:Belt of Giant Strength
|
||||
ManaCost:1 G
|
||||
Types:Artifact Equipment
|
||||
S:Mode$ Continuous | Affected$ Creature.EquippedBy | SetPower$ 10 | SetToughness$ 10 | Description$ Equipped creature has base power and toughness 10/10.
|
||||
K:Equip:10:::ReduceCost$ X:This ability costs {X} less to activate where X is the power of the creature it targets.
|
||||
SVar:X:Targeted$CardPower
|
||||
Oracle:Equipped creature has base power and toughness 10/10.\nEquip {10}. This ability costs {X} less to activate where X is the power of the creature it targets.
|
||||
@@ -3,9 +3,9 @@ ManaCost:3
|
||||
Types:Legendary Artifact Equipment
|
||||
T:Mode$Phase | Phase$ BeginCombat | ValidPlayer$ You | Execute$ TrigChoose | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of combat on your turn, equipped creature or a creature you control named Vecna gets +X/+X until end of turn, where X is the number of cards in your hand.
|
||||
SVar:TrigChoose:DB$ ChooseCard | Choices$ Creature.EquippedBy,Creature.YouCtrl+namedVecna | SubAbility$ DBPump
|
||||
SVar:DBPump:DB$ Pump | Defined$ ChosenCard | NumAtt$ +X | NumDef$ +X | SubAbility$ DBCleanup
|
||||
SVar:DBPump:DB$ Pump | Defined$ ChosenCard | NumAtt$ +X | NumDef$ +X | Mandatory$ True | SubAbility$ DBCleanup
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearChosenCard$ True
|
||||
K:Equip:PayLife<X>
|
||||
K:Equip:PayLife<X/1 life for each card in your hand>
|
||||
K:Equip:2
|
||||
SVar:X:Count$CardsInYourHand
|
||||
DeckHints:Name$Eye of Vecna|The Book of Vile Darkness
|
||||
|
||||
6
forge-gui/res/cardsfolder/upcoming/leather_armor.txt
Normal file
6
forge-gui/res/cardsfolder/upcoming/leather_armor.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
Name:Leather Armor
|
||||
ManaCost:1
|
||||
Types:Artifact Equipment
|
||||
S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddToughness$ 1 | AddKeyword$ Ward:1 | Description$ Equipped creature gets +0/+1 and has ward {1}. (Whenever equipped creature becomes the target of a spell or ability an opponent controls, counter it unless that player pays {1}.)
|
||||
K:Equip:0:::ActivationLimit$ 1:Activate only once each turn
|
||||
Oracle:Equipped creature gets +0/+1 and has ward {1}. (Whenever equipped creature becomes the target of a spell or ability an opponent controls, counter it unless that player pays {1}.)\nEquip {0}. Activate only once each turn.
|
||||
7
forge-gui/res/cardsfolder/upcoming/plate_armor.txt
Normal file
7
forge-gui/res/cardsfolder/upcoming/plate_armor.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
Name:Plate Armor
|
||||
ManaCost:2 W
|
||||
Types:Artifact Equipment
|
||||
S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddPower$ 3 | AddToughness$ 3 | AddKeyword$ Ward:1 | Description$ Equipped creature gets +3/+3 and has ward {1}. (Whenever equipped creature becomes the target of a spell or ability an opponent controls, counter it unless that player pays {1}.)
|
||||
K:Equip:3:::ReduceCost$ Y:This ability costs {1} less to activate for each other Equipment you control
|
||||
SVar:Y:Count$Valid Equipment.YouCtrl+Other
|
||||
Oracle:Equipped creature gets +3/+3 and has ward {1}. (Whenever equipped creature becomes the target of a spell or ability an opponent controls, counter it unless that player pays {1}.)\nEquip {3}. This ability costs {1} less to activate for each other Equipment you control.
|
||||
Reference in New Issue
Block a user