mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58: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
|
||||
for (AbilitySub sub : choices) {
|
||||
sub.setActivatingPlayer(ai);
|
||||
sub.getRestrictions().setZone(sub.getParent().getRestrictions().getZone());
|
||||
|
||||
// TODO checks from MayPlay fail for subs currently
|
||||
if (AiPlayDecision.WillPlay == aic.canPlaySa(sub)) {
|
||||
chosenList.add(sub);
|
||||
if (chosenList.size() == num) {
|
||||
@@ -229,7 +226,6 @@ public class CharmAi extends SpellAbilityAi {
|
||||
} else {
|
||||
// Standard canPlayAi()
|
||||
sub.setActivatingPlayer(ai);
|
||||
sub.getRestrictions().setZone(sub.getParent().getRestrictions().getZone());
|
||||
if (AiPlayDecision.WillPlay == aic.canPlaySa(sub)) {
|
||||
chosenList.add(sub);
|
||||
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";
|
||||
if (mapParams.containsKey(key)) {
|
||||
List<String> names = Lists.newArrayList(mapParams.get(key).split(","));
|
||||
|
||||
@@ -50,7 +50,7 @@ public class ChooseGenericEffect extends SpellAbilityEffect {
|
||||
List<SpellAbility> saToRemove = Lists.newArrayList();
|
||||
|
||||
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);
|
||||
} else if (saChoice.hasParam("UnlessCost")) {
|
||||
// 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 counter = "DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ " + n +
|
||||
" | IsPresent$ Card.StrictlySelf | SpellDescription$ Put "
|
||||
" | SpellDescription$ Put "
|
||||
+ Lang.nounWithNumeral(n, "+1/+1 counter") + " on it.";
|
||||
final String token = "DB$ Token | TokenAmount$ " + n + " | TokenScript$ c_1_1_a_servo | TokenOwner$ You "
|
||||
+ " | SpellDescription$ Create "
|
||||
@@ -1160,7 +1160,11 @@ public class CardFactoryUtil {
|
||||
SpellAbility saChoose = AbilityFactory.getAbility(choose, card);
|
||||
|
||||
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));
|
||||
saChoose.setAdditionalAbilityList("Choices", list);
|
||||
saChoose.setIntrinsic(intrinsic);
|
||||
|
||||
Reference in New Issue
Block a user