mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Some extra code in AttachAi to replace the previously removed code.
This commit is contained in:
@@ -1146,6 +1146,7 @@ public class AttachAi extends SpellAbilityAi {
|
|||||||
final List<String> keywords = new ArrayList<>();
|
final List<String> keywords = new ArrayList<>();
|
||||||
boolean grantingAbilities = false;
|
boolean grantingAbilities = false;
|
||||||
boolean grantingExtraBlock = false;
|
boolean grantingExtraBlock = false;
|
||||||
|
boolean grantingCantUntap = false;
|
||||||
|
|
||||||
for (final StaticAbility stAbility : attachSource.getStaticAbilities()) {
|
for (final StaticAbility stAbility : attachSource.getStaticAbilities()) {
|
||||||
final Map<String, String> stabMap = stAbility.getMapParams();
|
final Map<String, String> stabMap = stAbility.getMapParams();
|
||||||
@@ -1165,6 +1166,7 @@ public class AttachAi extends SpellAbilityAi {
|
|||||||
|
|
||||||
grantingAbilities |= stabMap.containsKey("AddAbility");
|
grantingAbilities |= stabMap.containsKey("AddAbility");
|
||||||
grantingExtraBlock |= stabMap.containsKey("CanBlockAmount") || stabMap.containsKey("CanBlockAny");
|
grantingExtraBlock |= stabMap.containsKey("CanBlockAmount") || stabMap.containsKey("CanBlockAny");
|
||||||
|
grantingCantUntap |= stabMap.containsKey("CantUntap");
|
||||||
|
|
||||||
String kws = stabMap.get("AddKeyword");
|
String kws = stabMap.get("AddKeyword");
|
||||||
if (kws != null) {
|
if (kws != null) {
|
||||||
@@ -1197,6 +1199,7 @@ public class AttachAi extends SpellAbilityAi {
|
|||||||
if (totToughness + totPower < 4 && (!keywords.isEmpty() || grantingExtraBlock)) {
|
if (totToughness + totPower < 4 && (!keywords.isEmpty() || grantingExtraBlock)) {
|
||||||
final int pow = totPower;
|
final int pow = totPower;
|
||||||
final boolean extraBlock = grantingExtraBlock;
|
final boolean extraBlock = grantingExtraBlock;
|
||||||
|
final boolean cantUntap = grantingCantUntap;
|
||||||
prefList = CardLists.filter(prefList, new Predicate<Card>() {
|
prefList = CardLists.filter(prefList, new Predicate<Card>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(final Card c) {
|
public boolean apply(final Card c) {
|
||||||
@@ -1215,6 +1218,9 @@ public class AttachAi extends SpellAbilityAi {
|
|||||||
if (extraBlock && CombatUtil.canBlock(c, true) && !c.canBlockAny()) {
|
if (extraBlock && CombatUtil.canBlock(c, true) && !c.canBlockAny()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (cantUntap && c.isTapped()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user