mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
* Desecration Demon - Made AI not using the sacrifice ability any more.
This commit is contained in:
parent
ea49be8f06
commit
93b968d92a
3 changed files with 8 additions and 10 deletions
|
@ -1064,7 +1064,7 @@ public class ComputerPlayer<T extends ComputerPlayer<T>> extends PlayerImpl<T> i
|
|||
// Be proactive! Always use abilities, the evaluation function will decide if it's good or not
|
||||
// Otherwise some abilities won't be used by AI like LoseTargetEffect that has "bad" outcome
|
||||
// but still is good when targets opponent
|
||||
return true;
|
||||
return !outcome.equals(Outcome.AIDontUseIt); // Added for Desecration Demon sacrifice ability
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -103,17 +103,15 @@ class DesecrationDemonEffect extends OneShotEffect<DesecrationDemonEffect> {
|
|||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, false);
|
||||
if (target.canChoose(opponent.getId(), game)) {
|
||||
if (opponent.chooseUse(Outcome.Detriment, new StringBuilder("Sacrifice a creature to tap ").append(descrationDemon.getName()).append("and put a +1/+1 counter on it?").toString(), game))
|
||||
if (opponent.chooseUse(Outcome.AIDontUseIt, new StringBuilder("Sacrifice a creature to tap ").append(descrationDemon.getName()).append("and put a +1/+1 counter on it?").toString(), game))
|
||||
{
|
||||
opponent.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
|
||||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.sacrifice(source.getId(), game);
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
game.informPlayers(new StringBuilder(opponent.getName()).append(" sacrifices ").append(permanent.getName()).append(" to tap ").append(descrationDemon.getName()).append(". A +1/+1 counter was put on it").toString());
|
||||
if (descrationDemon != null) {
|
||||
descrationDemon.tap(game);
|
||||
descrationDemon.addCounters(CounterType.P1P1.createInstance(), game);
|
||||
}
|
||||
descrationDemon.tap(game);
|
||||
descrationDemon.addCounters(CounterType.P1P1.createInstance(), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,9 +38,9 @@ public enum Outcome {
|
|||
Benefit(true),
|
||||
Detriment(false),
|
||||
Neutral(true),
|
||||
Removal(false);
|
||||
|
||||
private boolean good;
|
||||
Removal(false),
|
||||
AIDontUseIt(false);
|
||||
private final boolean good;
|
||||
private boolean canTargetAll;
|
||||
|
||||
Outcome(boolean good) {
|
||||
|
|
Loading…
Reference in a new issue