Merge branch 'master' into 'master'

Attempt to fix FightAi for Back for More.

See merge request core-developers/forge!5497
This commit is contained in:
Michael Kamensky
2021-10-05 04:06:50 +00:00
3 changed files with 9 additions and 2 deletions

View File

@@ -60,8 +60,13 @@ public class FightAi extends SpellAbilityAi {
// assumes the triggered card belongs to the ai
if (sa.hasParam("Defined")) {
CardCollection fighter1List = AbilityUtils.getDefinedCards(source, sa.getParam("Defined"), sa);
if ("ChosenAsTgt".equals(sa.getParam("AILogic")) && sa.getRootAbility().getTargetCard() != null) {
if (fighter1List.isEmpty()) {
fighter1List.add(sa.getRootAbility().getTargetCard());
}
}
if (fighter1List.isEmpty()) {
return true;
return true; // FIXME: shouldn't this return "false" if nothing found?
}
Card fighter1 = fighter1List.get(0);
for (Card humanCreature : humCreatures) {

View File

@@ -154,12 +154,14 @@ public class Main {
public void restart() {
if (RestartUtil.prepareForRestart()) {
Gdx.app.exit();
System.exit(0);
}
}
@Override
public void exit() {
Gdx.app.exit(); //can just use Gdx.app.exit for desktop
System.exit(0);
}
@Override

View File

@@ -3,6 +3,6 @@ ManaCost:4 B G
Types:Instant
A:SP$ ChangeZone | Cost$ 4 B G | Origin$ Graveyard | Destination$ Battlefield | TgtPrompt$ Choose target creature card in your graveyard | ValidTgts$ Creature.YouOwn | SubAbility$ DBImmediateTrigger | StackDescription$ SpellDescription | SpellDescription$ Return target creature card from your graveyard to the battlefield. When you do, it fights up to one target creature you don't control. (Each deals damage equal to its power to the other.)
SVar:DBImmediateTrigger:DB$ ImmediateTrigger | RememberObjects$ Targeted | Execute$ DBFight | Secondary$ True | TriggerDescription$ When you do, it fights up to one target creature you don't control. (Each deals damage equal to its power to the other.)
SVar:DBFight:DB$ Fight | Defined$ DelayTriggerRemembered | ValidTgts$ Creature.YouDontCtrl | TargetMin$ 0 | TargetMax$ 1 | TgtPrompt$ Choose up to one target creature you don't control | StackDescription$ None
SVar:DBFight:DB$ Fight | Defined$ DelayTriggerRemembered | ValidTgts$ Creature.YouDontCtrl | TargetMin$ 0 | TargetMax$ 1 | AILogic$ ChosenAsTgt | TgtPrompt$ Choose up to one target creature you don't control | StackDescription$ None
DeckHas:Ability$Graveyard
Oracle:Return target creature card from your graveyard to the battlefield. When you do, it fights up to one target creature you don't control. (Each deals damage equal to its power to the other.)