mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Keyword: add Adapt
This commit is contained in:
@@ -1054,7 +1054,11 @@ public class ComputerUtilCombat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ability.hasParam("Monstrosity") && blocker.isMonstrous()) {
|
if (ability.hasParam("Monstrosity") && blocker.isMonstrous()) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ability.hasParam("Adapt") && blocker.getCounters(CounterType.P1P1) > 0) {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ComputerUtilCost.canPayCost(ability, blocker.getController())) {
|
if (ComputerUtilCost.canPayCost(ability, blocker.getController())) {
|
||||||
@@ -1226,7 +1230,11 @@ public class ComputerUtilCombat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ability.hasParam("Monstrosity") && blocker.isMonstrous()) {
|
if (ability.hasParam("Monstrosity") && blocker.isMonstrous()) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ability.hasParam("Adapt") && blocker.getCounters(CounterType.P1P1) > 0) {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ComputerUtilCost.canPayCost(ability, blocker.getController())) {
|
if (ComputerUtilCost.canPayCost(ability, blocker.getController())) {
|
||||||
@@ -1444,7 +1452,11 @@ public class ComputerUtilCombat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ability.hasParam("Monstrosity") && attacker.isMonstrous()) {
|
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())) {
|
if (!ability.getPayCosts().hasTapCost() && ComputerUtilCost.canPayCost(ability, attacker.getController())) {
|
||||||
@@ -1677,7 +1689,11 @@ public class ComputerUtilCombat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ability.hasParam("Monstrosity") && attacker.isMonstrous()) {
|
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())) {
|
if (!ability.getPayCosts().hasTapCost() && ComputerUtilCost.canPayCost(ability, attacker.getController())) {
|
||||||
|
|||||||
@@ -311,6 +311,10 @@ public class CountersPutAi extends SpellAbilityAi {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sa.hasParam("Adapt") && source.getCounters(CounterType.P1P1) > 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO handle proper calculation of X values based on Cost
|
// TODO handle proper calculation of X values based on Cost
|
||||||
int amount = AbilityUtils.calculateAmount(source, amountStr, sa);
|
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.equals("Undaunted") || keyword.startsWith("Monstrosity") || keyword.startsWith("Embalm")
|
||||||
|| keyword.startsWith("Level up") || keyword.equals("Prowess") || keyword.startsWith("Eternalize")
|
|| keyword.startsWith("Level up") || keyword.equals("Prowess") || keyword.startsWith("Eternalize")
|
||||||
|| keyword.startsWith("Reinforce") || keyword.startsWith("Champion") || keyword.startsWith("Prowl")
|
|| 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.startsWith("Cycling") || keyword.startsWith("TypeCycling")) {
|
||||||
// keyword parsing takes care of adding a proper description
|
// keyword parsing takes care of adding a proper description
|
||||||
} else if (keyword.startsWith("CantBeBlockedByAmount")) {
|
} else if (keyword.startsWith("CantBeBlockedByAmount")) {
|
||||||
|
|||||||
@@ -3676,6 +3676,24 @@ public class CardFactoryUtil {
|
|||||||
inst.addSpellAbility(newSA);
|
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)) {
|
} else if (keyword.equals("Aftermath") && card.getCurrentStateName().equals(CardStateName.RightSplit)) {
|
||||||
// Aftermath does modify existing SA, and does not add new one
|
// Aftermath does modify existing SA, and does not add new one
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import forge.util.TextUtil;
|
|||||||
public enum Keyword {
|
public enum Keyword {
|
||||||
UNDEFINED(SimpleKeyword.class, false, ""),
|
UNDEFINED(SimpleKeyword.class, false, ""),
|
||||||
ABSORB(KeywordWithAmount.class, false, "If a source would deal damage to this creature, prevent %d of that damage."),
|
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."),
|
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."),
|
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."),
|
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