mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
- Fixed AI for Tribute to the Wild.
This commit is contained in:
@@ -398,14 +398,17 @@ public class AbilityFactorySacrifice {
|
|||||||
tgt.resetTargets();
|
tgt.resetTargets();
|
||||||
if (AllZone.getHumanPlayer().canBeTargetedBy(sa)) {
|
if (AllZone.getHumanPlayer().canBeTargetedBy(sa)) {
|
||||||
tgt.addTarget(AllZone.getHumanPlayer());
|
tgt.addTarget(AllZone.getHumanPlayer());
|
||||||
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
|
||||||
final String defined = params.get("Defined");
|
final String defined = params.get("Defined");
|
||||||
if (defined == null) {
|
if (defined == null) {
|
||||||
// Self Sacrifice.
|
// Self Sacrifice.
|
||||||
} else if (defined.equals("Each")) {
|
} else if (defined.equals("Each")
|
||||||
|
|| (defined.equals("Opponent") && !sa.isTrigger())) {
|
||||||
// If Sacrifice hits both players:
|
// If Sacrifice hits both players:
|
||||||
// Only cast it if Human has the full amount of valid
|
// Only cast it if Human has the full amount of valid
|
||||||
// Only cast it if AI doesn't have the full amount of Valid
|
// Only cast it if AI doesn't have the full amount of Valid
|
||||||
@@ -424,6 +427,9 @@ public class AbilityFactorySacrifice {
|
|||||||
CardList humanList = AllZone.getHumanPlayer().getCardsIn(ZoneType.Battlefield);
|
CardList humanList = AllZone.getHumanPlayer().getCardsIn(ZoneType.Battlefield);
|
||||||
humanList = humanList.getValidCards(valid.split(","), sa.getActivatingPlayer(), sa.getSourceCard());
|
humanList = humanList.getValidCards(valid.split(","), sa.getActivatingPlayer(), sa.getSourceCard());
|
||||||
CardList computerList = AllZone.getComputerPlayer().getCardsIn(ZoneType.Battlefield);
|
CardList computerList = AllZone.getComputerPlayer().getCardsIn(ZoneType.Battlefield);
|
||||||
|
if (defined.equals("Opponent")) {
|
||||||
|
computerList = new CardList();
|
||||||
|
}
|
||||||
computerList = computerList.getValidCards(valid.split(","), sa.getActivatingPlayer(),
|
computerList = computerList.getValidCards(valid.split(","), sa.getActivatingPlayer(),
|
||||||
sa.getSourceCard());
|
sa.getSourceCard());
|
||||||
|
|
||||||
@@ -433,7 +439,6 @@ public class AbilityFactorySacrifice {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user