mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
DamageDealAi: fixed for the AI is not the activator of the damage spell
might need some more AILogic.
This commit is contained in:
@@ -166,8 +166,14 @@ public class DamageDealAi extends DamageAiBase {
|
|||||||
//return null;
|
//return null;
|
||||||
}
|
}
|
||||||
final TargetRestrictions tgt = sa.getTargetRestrictions();
|
final TargetRestrictions tgt = sa.getTargetRestrictions();
|
||||||
|
final Player activator = sa.getActivatingPlayer();
|
||||||
final Card source = sa.getHostCard();
|
final Card source = sa.getHostCard();
|
||||||
List<Card> hPlay = CardLists.getValidCards(pl.getCardsIn(ZoneType.Battlefield), tgt.getValidTgts(), ai, source, sa);
|
final Game game = source.getGame();
|
||||||
|
List<Card> hPlay = CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield), tgt.getValidTgts(), activator, source, sa);
|
||||||
|
|
||||||
|
if (activator.equals(ai)) {
|
||||||
|
hPlay = CardLists.filterControlledBy(hPlay, pl);
|
||||||
|
}
|
||||||
|
|
||||||
final List<GameObject> objects = Lists.newArrayList(sa.getTargets().getTargets());
|
final List<GameObject> objects = Lists.newArrayList(sa.getTargets().getTargets());
|
||||||
if (sa.hasParam("TargetUnique")) {
|
if (sa.hasParam("TargetUnique")) {
|
||||||
@@ -193,7 +199,7 @@ public class DamageDealAi extends DamageAiBase {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Card targetCard = null;
|
Card targetCard = null;
|
||||||
if (pl.isOpponentOf(ai) && !killables.isEmpty()) {
|
if (pl.isOpponentOf(ai) && activator.equals(ai) && !killables.isEmpty()) {
|
||||||
if (sa.getTargetRestrictions().canTgtPlaneswalker()) {
|
if (sa.getTargetRestrictions().canTgtPlaneswalker()) {
|
||||||
targetCard = ComputerUtilCard.getBestPlaneswalkerAI(killables);
|
targetCard = ComputerUtilCard.getBestPlaneswalkerAI(killables);
|
||||||
}
|
}
|
||||||
@@ -209,7 +215,7 @@ public class DamageDealAi extends DamageAiBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!hPlay.isEmpty()) {
|
if (!hPlay.isEmpty()) {
|
||||||
if (pl.isOpponentOf(ai)) {
|
if (pl.isOpponentOf(ai) && activator.equals(ai)) {
|
||||||
if (sa.getTargetRestrictions().canTgtPlaneswalker()) {
|
if (sa.getTargetRestrictions().canTgtPlaneswalker()) {
|
||||||
targetCard = ComputerUtilCard.getBestPlaneswalkerAI(hPlay);
|
targetCard = ComputerUtilCard.getBestPlaneswalkerAI(hPlay);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user