mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 20:11:59 -08:00
[TPR] Added Volrath's Curse and Crovax the Cursed.
This commit is contained in:
parent
4d7f1a05bf
commit
b79d6e64cf
6 changed files with 523 additions and 3 deletions
|
|
@ -32,7 +32,9 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.costs.CostImpl;
|
||||
import mage.constants.AbilityType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
|
@ -65,7 +67,11 @@ public class SacrificeTargetCost extends CostImpl {
|
|||
|
||||
@Override
|
||||
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
|
||||
if (targets.choose(Outcome.Sacrifice, controllerId, sourceId, game)) {
|
||||
UUID activator = controllerId;
|
||||
if (ability.getAbilityType().equals(AbilityType.ACTIVATED) || ability.getAbilityType().equals(AbilityType.SPECIAL_ACTION)) {
|
||||
activator = ((ActivatedAbilityImpl)ability).getActivatorId();
|
||||
}
|
||||
if (targets.choose(Outcome.Sacrifice, activator, sourceId, game)) {
|
||||
for (UUID targetId: targets.get(0).getTargets()) {
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent == null) {
|
||||
|
|
@ -83,10 +89,14 @@ public class SacrificeTargetCost extends CostImpl {
|
|||
|
||||
@Override
|
||||
public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) {
|
||||
if (!game.getPlayer(controllerId).canPaySacrificeCost()) {
|
||||
UUID activator = controllerId;
|
||||
if (ability.getAbilityType().equals(AbilityType.ACTIVATED)) {
|
||||
activator = ((ActivatedAbilityImpl)ability).getActivatorId();
|
||||
}
|
||||
if (!game.getPlayer(activator).canPaySacrificeCost()) {
|
||||
return false;
|
||||
}
|
||||
return targets.canChoose(controllerId, game);
|
||||
return targets.canChoose(activator, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue