mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Fabricate fix
This commit is contained in:
@@ -89,9 +89,6 @@ public class CharmAi extends SpellAbilityAi {
|
|||||||
// First pass using standard canPlayAi() for good choices
|
// First pass using standard canPlayAi() for good choices
|
||||||
for (AbilitySub sub : choices) {
|
for (AbilitySub sub : choices) {
|
||||||
sub.setActivatingPlayer(ai);
|
sub.setActivatingPlayer(ai);
|
||||||
sub.getRestrictions().setZone(sub.getParent().getRestrictions().getZone());
|
|
||||||
|
|
||||||
// TODO checks from MayPlay fail for subs currently
|
|
||||||
if (AiPlayDecision.WillPlay == aic.canPlaySa(sub)) {
|
if (AiPlayDecision.WillPlay == aic.canPlaySa(sub)) {
|
||||||
chosenList.add(sub);
|
chosenList.add(sub);
|
||||||
if (chosenList.size() == num) {
|
if (chosenList.size() == num) {
|
||||||
@@ -229,7 +226,6 @@ public class CharmAi extends SpellAbilityAi {
|
|||||||
} else {
|
} else {
|
||||||
// Standard canPlayAi()
|
// Standard canPlayAi()
|
||||||
sub.setActivatingPlayer(ai);
|
sub.setActivatingPlayer(ai);
|
||||||
sub.getRestrictions().setZone(sub.getParent().getRestrictions().getZone());
|
|
||||||
if (AiPlayDecision.WillPlay == aic.canPlaySa(sub)) {
|
if (AiPlayDecision.WillPlay == aic.canPlaySa(sub)) {
|
||||||
chosenList.add(sub);
|
chosenList.add(sub);
|
||||||
if (chosenList.size() == min) {
|
if (chosenList.size() == min) {
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ public final class AbilityFactory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (api == ApiType.Charm || api == ApiType.GenericChoice || api == ApiType.AssignGroup) {
|
if (api == ApiType.Charm || api == ApiType.GenericChoice || api == ApiType.AssignGroup) {
|
||||||
final String key = "Choices";
|
final String key = "Choices";
|
||||||
if (mapParams.containsKey(key)) {
|
if (mapParams.containsKey(key)) {
|
||||||
List<String> names = Lists.newArrayList(mapParams.get(key).split(","));
|
List<String> names = Lists.newArrayList(mapParams.get(key).split(","));
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class ChooseGenericEffect extends SpellAbilityEffect {
|
|||||||
List<SpellAbility> saToRemove = Lists.newArrayList();
|
List<SpellAbility> saToRemove = Lists.newArrayList();
|
||||||
|
|
||||||
for (SpellAbility saChoice : abilities) {
|
for (SpellAbility saChoice : abilities) {
|
||||||
if (!saChoice.getRestrictions().checkOtherRestrictions(host, saChoice, sa.getActivatingPlayer()) ) {
|
if (saChoice.getRestrictions() != null && !saChoice.getRestrictions().checkOtherRestrictions(host, saChoice, sa.getActivatingPlayer())) {
|
||||||
saToRemove.add(saChoice);
|
saToRemove.add(saChoice);
|
||||||
} else if (saChoice.hasParam("UnlessCost")) {
|
} else if (saChoice.hasParam("UnlessCost")) {
|
||||||
// generic check for if the cost can be paid
|
// generic check for if the cost can be paid
|
||||||
|
|||||||
@@ -1149,7 +1149,7 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
final String choose = "DB$ GenericChoice | AILogic$ " + name;
|
final String choose = "DB$ GenericChoice | AILogic$ " + name;
|
||||||
final String counter = "DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ " + n +
|
final String counter = "DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ " + n +
|
||||||
" | IsPresent$ Card.StrictlySelf | SpellDescription$ Put "
|
" | SpellDescription$ Put "
|
||||||
+ Lang.nounWithNumeral(n, "+1/+1 counter") + " on it.";
|
+ Lang.nounWithNumeral(n, "+1/+1 counter") + " on it.";
|
||||||
final String token = "DB$ Token | TokenAmount$ " + n + " | TokenScript$ c_1_1_a_servo | TokenOwner$ You "
|
final String token = "DB$ Token | TokenAmount$ " + n + " | TokenScript$ c_1_1_a_servo | TokenOwner$ You "
|
||||||
+ " | SpellDescription$ Create "
|
+ " | SpellDescription$ Create "
|
||||||
@@ -1160,7 +1160,11 @@ public class CardFactoryUtil {
|
|||||||
SpellAbility saChoose = AbilityFactory.getAbility(choose, card);
|
SpellAbility saChoose = AbilityFactory.getAbility(choose, card);
|
||||||
|
|
||||||
List<AbilitySub> list = Lists.newArrayList();
|
List<AbilitySub> list = Lists.newArrayList();
|
||||||
list.add((AbilitySub)AbilityFactory.getAbility(counter, card));
|
AbilitySub putCounter = (AbilitySub)AbilityFactory.getAbility(counter, card);
|
||||||
|
SpellAbilityRestriction restriction = new SpellAbilityRestriction();
|
||||||
|
restriction.setIsPresent("Card.StrictlySelf");
|
||||||
|
putCounter.setRestrictions(restriction);
|
||||||
|
list.add(putCounter);
|
||||||
list.add((AbilitySub)AbilityFactory.getAbility(token, card));
|
list.add((AbilitySub)AbilityFactory.getAbility(token, card));
|
||||||
saChoose.setAdditionalAbilityList("Choices", list);
|
saChoose.setAdditionalAbilityList("Choices", list);
|
||||||
saChoose.setIntrinsic(intrinsic);
|
saChoose.setIntrinsic(intrinsic);
|
||||||
|
|||||||
Reference in New Issue
Block a user