Fix for Baron triggering on playing Morph creatures

This commit is contained in:
Zzooouhh 2017-12-30 23:28:16 +01:00 committed by GitHub
parent c6d27bb3c9
commit 6a23a0f707
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -157,15 +157,17 @@ class BaronVonCountTriggeredAbility extends TriggeredAbilityImpl {
}
Integer doomNumber = (Integer) game.getState().getValue(mageObject.getId() + "_doom");
if (spell != null && sourcePermanent != null && mageObject != null && doomNumber > 0) {
String doomString = doomNumber.toString();
if (spell.getCard().getManaCost().getText().contains(doomString)
|| String.valueOf(spell.getPower().getBaseValue()).contains(doomString)
|| String.valueOf(spell.getToughness().getBaseValue()).contains(doomString)) {
return true;
} else {
for (String string : spell.getCard().getRules()) {
if (string.contains(doomString)) {
return true;
if (!spell.isFaceDown(game)) {
String doomString = doomNumber.toString();
if (spell.getCard().getManaCost().getText().contains(doomString)
|| String.valueOf(spell.getPower().getBaseValue()).contains(doomString)
|| String.valueOf(spell.getToughness().getBaseValue()).contains(doomString)) {
return true;
} else {
for (String string : spell.getCard().getRules()) {
if (string.contains(doomString)) {
return true;
}
}
}
}