mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
* Fireblast - Fixed that a wrong text was shown for the land sacrifice. Also that the spell was wrongly marked as castable also if only one mountain was on the battlefield.
This commit is contained in:
parent
c15719b36b
commit
185f56a7da
2 changed files with 16 additions and 12 deletions
|
|
@ -51,7 +51,9 @@ public class SacrificeTargetCost extends CostImpl {
|
|||
public SacrificeTargetCost(TargetControlledPermanent target) {
|
||||
this.addTarget(target);
|
||||
target.setNotTarget(true); // sacrifice is never targeted
|
||||
this.text = "sacrifice " + (target.getTargetName().startsWith("an") || target.getTargetName().startsWith("a ") ? "" : "a ") + target.getTargetName();
|
||||
this.text = "sacrifice "
|
||||
+ ((target.getNumberOfTargets() != 1 || (target.getTargetName().startsWith("an") || target.getTargetName().startsWith("a ")))
|
||||
? "" : "a ") + target.getTargetName();
|
||||
target.setTargetName(target.getTargetName() + " (to sacrifice)");
|
||||
}
|
||||
|
||||
|
|
@ -101,13 +103,16 @@ public class SacrificeTargetCost extends CostImpl {
|
|||
}
|
||||
|
||||
int validTargets = 0;
|
||||
int neededtargets = targets.get(0).getNumberOfTargets();
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(((TargetControlledPermanent) targets.get(0)).getFilter(), controllerId, game)) {
|
||||
if (game.getPlayer(activator).canPaySacrificeCost(permanent, sourceId, controllerId, game)) {
|
||||
validTargets++;
|
||||
if (validTargets >= neededtargets) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return validTargets > 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue