mirror of
https://github.com/correl/mage.git
synced 2025-03-17 01:06:26 -09:00
Fix simple issues in target specification
This commit is contained in:
parent
3aa480cef8
commit
67194253e4
4 changed files with 6 additions and 63 deletions
|
@ -75,7 +75,8 @@ public class DwarvenLandslide extends CardImpl {
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof SpellAbility) {
|
if (ability instanceof SpellAbility) {
|
||||||
if (KickedCondition.getInstance().apply(game, ability)) {
|
if (KickedCondition.getInstance().apply(game, ability)) {
|
||||||
getSpellAbility().addTarget(new TargetLandPermanent(new FilterLandPermanent("land (Kicker)")));
|
ability.getTargets().clear();
|
||||||
|
getSpellAbility().addTarget(new TargetLandPermanent(2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,16 +50,7 @@ public class BloodFeud extends CardImpl {
|
||||||
|
|
||||||
// Target creature fights another target creature.
|
// Target creature fights another target creature.
|
||||||
this.getSpellAbility().addEffect(new FightTargetsEffect());
|
this.getSpellAbility().addEffect(new FightTargetsEffect());
|
||||||
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent(2));
|
||||||
TargetCreaturePermanent target = new TargetCreaturePermanent();
|
|
||||||
target.setTargetTag(1);
|
|
||||||
this.getSpellAbility().addTarget(target);
|
|
||||||
|
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature to fight");
|
|
||||||
filter.add(new AnotherTargetPredicate(2));
|
|
||||||
TargetCreaturePermanent target2 = new TargetCreaturePermanent(filter);
|
|
||||||
target2.setTargetTag(2);
|
|
||||||
this.getSpellAbility().addTarget(target2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BloodFeud(final BloodFeud card) {
|
public BloodFeud(final BloodFeud card) {
|
||||||
|
|
|
@ -75,7 +75,8 @@ public class RushingRiver extends CardImpl {
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof SpellAbility && KickedCondition.getInstance().apply(game, ability)) {
|
if (ability instanceof SpellAbility && KickedCondition.getInstance().apply(game, ability)) {
|
||||||
ability.addTarget(new TargetOtherNonlandPermanent(new FilterNonlandPermanent("another target nonland permanent")));
|
ability.getTargets().clear();
|
||||||
|
ability.addTarget(new TargetNonlandPermanent(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -89,27 +90,3 @@ public class RushingRiver extends CardImpl {
|
||||||
return new RushingRiver(this);
|
return new RushingRiver(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class TargetOtherNonlandPermanent extends TargetNonlandPermanent {
|
|
||||||
|
|
||||||
public TargetOtherNonlandPermanent(FilterNonlandPermanent filter) {
|
|
||||||
super(filter);
|
|
||||||
}
|
|
||||||
|
|
||||||
public TargetOtherNonlandPermanent(final TargetOtherNonlandPermanent target) {
|
|
||||||
super(target);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) {
|
|
||||||
if (source.getTargets().get(0).getTargets().contains(id)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return super.canTarget(controllerId, id, source, game);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TargetOtherNonlandPermanent copy() {
|
|
||||||
return new TargetOtherNonlandPermanent(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -56,8 +56,7 @@ public class DissensionInTheRanks extends CardImpl {
|
||||||
|
|
||||||
// Target blocking creature fights another target blocking creature.
|
// Target blocking creature fights another target blocking creature.
|
||||||
this.getSpellAbility().addEffect(new FightTargetsEffect());
|
this.getSpellAbility().addEffect(new FightTargetsEffect());
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent(2, 2, filter, false));
|
||||||
this.getSpellAbility().addTarget(new DissensionInTheRanksTarget(filter));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,28 +69,3 @@ public class DissensionInTheRanks extends CardImpl {
|
||||||
return new DissensionInTheRanks(this);
|
return new DissensionInTheRanks(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class DissensionInTheRanksTarget extends TargetCreaturePermanent {
|
|
||||||
|
|
||||||
public DissensionInTheRanksTarget(FilterCreaturePermanent filter) {
|
|
||||||
super(1, 1, filter, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public DissensionInTheRanksTarget(final DissensionInTheRanksTarget target) {
|
|
||||||
super(target);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) {
|
|
||||||
if (source.getTargets().get(0).getTargets().contains(id)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return super.canTarget(controllerId, id, source, game);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DissensionInTheRanksTarget copy() {
|
|
||||||
return new DissensionInTheRanksTarget(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue