mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Keyword: add Adapt
This commit is contained in:
@@ -1052,11 +1052,15 @@ public class ComputerUtilCombat {
|
||||
if (!ability.hasParam("CounterType") || !ability.getParam("CounterType").equals("P1P1")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (ability.hasParam("Monstrosity") && blocker.isMonstrous()) {
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (ability.hasParam("Adapt") && blocker.getCounters(CounterType.P1P1) > 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ComputerUtilCost.canPayCost(ability, blocker.getController())) {
|
||||
int pBonus = AbilityUtils.calculateAmount(ability.getHostCard(), ability.getParam("CounterNum"), ability);
|
||||
if (pBonus > 0) {
|
||||
@@ -1224,11 +1228,15 @@ public class ComputerUtilCombat {
|
||||
if (!ability.hasParam("CounterType") || !ability.getParam("CounterType").equals("P1P1")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (ability.hasParam("Monstrosity") && blocker.isMonstrous()) {
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (ability.hasParam("Adapt") && blocker.getCounters(CounterType.P1P1) > 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ComputerUtilCost.canPayCost(ability, blocker.getController())) {
|
||||
int tBonus = AbilityUtils.calculateAmount(ability.getHostCard(), ability.getParam("CounterNum"), ability);
|
||||
if (tBonus > 0) {
|
||||
@@ -1442,11 +1450,15 @@ public class ComputerUtilCombat {
|
||||
if (!ability.hasParam("CounterType") || !ability.getParam("CounterType").equals("P1P1")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (ability.hasParam("Monstrosity") && attacker.isMonstrous()) {
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (ability.hasParam("Adapt") && blocker.getCounters(CounterType.P1P1) > 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!ability.getPayCosts().hasTapCost() && ComputerUtilCost.canPayCost(ability, attacker.getController())) {
|
||||
int pBonus = AbilityUtils.calculateAmount(ability.getHostCard(), ability.getParam("CounterNum"), ability);
|
||||
if (pBonus > 0) {
|
||||
@@ -1675,11 +1687,15 @@ public class ComputerUtilCombat {
|
||||
if (!ability.hasParam("CounterType") || !ability.getParam("CounterType").equals("P1P1")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (ability.hasParam("Monstrosity") && attacker.isMonstrous()) {
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (ability.hasParam("Adapt") && blocker.getCounters(CounterType.P1P1) > 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!ability.getPayCosts().hasTapCost() && ComputerUtilCost.canPayCost(ability, attacker.getController())) {
|
||||
int tBonus = AbilityUtils.calculateAmount(ability.getHostCard(), ability.getParam("CounterNum"), ability);
|
||||
if (tBonus > 0) {
|
||||
|
||||
@@ -311,6 +311,10 @@ public class CountersPutAi extends SpellAbilityAi {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sa.hasParam("Adapt") && source.getCounters(CounterType.P1P1) > 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO handle proper calculation of X values based on Cost
|
||||
int amount = AbilityUtils.calculateAmount(source, amountStr, sa);
|
||||
|
||||
|
||||
@@ -1662,7 +1662,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
|| keyword.equals("Undaunted") || keyword.startsWith("Monstrosity") || keyword.startsWith("Embalm")
|
||||
|| keyword.startsWith("Level up") || keyword.equals("Prowess") || keyword.startsWith("Eternalize")
|
||||
|| keyword.startsWith("Reinforce") || keyword.startsWith("Champion") || keyword.startsWith("Prowl")
|
||||
|| keyword.startsWith("Amplify") || keyword.startsWith("Ninjutsu")
|
||||
|| keyword.startsWith("Amplify") || keyword.startsWith("Ninjutsu") || keyword.startsWith("Adapt")
|
||||
|| keyword.startsWith("Cycling") || keyword.startsWith("TypeCycling")) {
|
||||
// keyword parsing takes care of adding a proper description
|
||||
} else if (keyword.startsWith("CantBeBlockedByAmount")) {
|
||||
|
||||
@@ -3676,6 +3676,24 @@ public class CardFactoryUtil {
|
||||
inst.addSpellAbility(newSA);
|
||||
|
||||
}
|
||||
} else if (keyword.startsWith("Adapt")) {
|
||||
final String[] k = keyword.split(":");
|
||||
final String magnitude = k[1];
|
||||
final String manacost = k[2];
|
||||
|
||||
String desc = "Adapt " + magnitude;
|
||||
|
||||
String effect = "AB$ PutCounter | Cost$ " + manacost + " | ConditionPresent$ "
|
||||
+ "Card.Self+counters_EQ0_P1P1 | Adapt$ True | CounterNum$ " + magnitude
|
||||
+ " | CounterType$ P1P1 | StackDescription$ SpellDescription";
|
||||
|
||||
effect += "| SpellDescription$ " + desc + " (" + inst.getReminderText() + ")";
|
||||
|
||||
final SpellAbility sa = AbilityFactory.getAbility(effect, card);
|
||||
sa.setIntrinsic(intrinsic);
|
||||
|
||||
sa.setTemporary(!intrinsic);
|
||||
inst.addSpellAbility(sa);
|
||||
} else if (keyword.equals("Aftermath") && card.getCurrentStateName().equals(CardStateName.RightSplit)) {
|
||||
// Aftermath does modify existing SA, and does not add new one
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import forge.util.TextUtil;
|
||||
public enum Keyword {
|
||||
UNDEFINED(SimpleKeyword.class, false, ""),
|
||||
ABSORB(KeywordWithAmount.class, false, "If a source would deal damage to this creature, prevent %d of that damage."),
|
||||
ADAPT(KeywordWithCostAndAmount.class, false, "If this creature has no +1/+1 counters on it, put {%2$d:+1/+1 counter} on it."),
|
||||
AFFINITY(KeywordWithType.class, false, "This spell costs you {1} less to cast for each %s you control."),
|
||||
AFFLICT(KeywordWithAmount.class, false, "Whenever this creature becomes blocked, defending player loses %d life."),
|
||||
AFTERLIFE(KeywordWithAmount.class, false, "When this creature dies, create {%1$d:1/1 white and black Spirit creature token} with flying."),
|
||||
|
||||
8
forge-gui/res/cardsfolder/upcoming/aeromunculus.txt
Normal file
8
forge-gui/res/cardsfolder/upcoming/aeromunculus.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
Name:Aeromunculus
|
||||
ManaCost:1 G U
|
||||
Types:Creature Homunculus Mutant
|
||||
PT:2/3
|
||||
K:Flying
|
||||
K:Adapt:1:2 G U
|
||||
DeckHas:Ability$Counters
|
||||
Oracle:Flying\n{2}{G}{U}: Adapt 1. (If this creature has no +1/+1 counters on it, put a +1/+1 counter on it.)
|
||||
Reference in New Issue
Block a user