mirror of
https://github.com/correl/mage.git
synced 2025-04-07 17:00:08 -09:00
* Added possibility for choose method to deselect cards.
This commit is contained in:
parent
6853d68016
commit
944de8140c
2 changed files with 13 additions and 34 deletions
Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human
Mage.Sets/src/mage/sets/bornofthegods
|
@ -338,11 +338,8 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
options = new HashMap<>(1);
|
options = new HashMap<>(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target.getTargets().size() > 0) {
|
List<UUID> chosen = target.getTargets();
|
||||||
List<UUID> chosen = (List<UUID>)target.getTargets();
|
options.put("chosen", (Serializable)chosen);
|
||||||
options.put("chosen", (Serializable)chosen);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<UUID> choosable = new ArrayList<>();
|
List<UUID> choosable = new ArrayList<>();
|
||||||
for (UUID cardId : cards) {
|
for (UUID cardId : cards) {
|
||||||
if (target.canTarget(cardId, cards, game)) {
|
if (target.canTarget(cardId, cards, game)) {
|
||||||
|
@ -356,9 +353,13 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
waitForResponse(game);
|
waitForResponse(game);
|
||||||
if (response.getUUID() != null) {
|
if (response.getUUID() != null) {
|
||||||
if (target.canTarget(response.getUUID(), cards, game)) {
|
if (target.canTarget(response.getUUID(), cards, game)) {
|
||||||
target.add(response.getUUID(), game);
|
if (target.getTargets().contains(response.getUUID())) { // if already included remove it with
|
||||||
if(target.doneChosing()){
|
target.remove(response.getUUID());
|
||||||
return true;
|
} else {
|
||||||
|
target.add(response.getUUID(), game);
|
||||||
|
if (target.doneChosing()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -29,14 +29,11 @@ package mage.sets.bornofthegods;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.ContinuousEffectImpl;
|
import mage.abilities.effects.common.continious.BoostAllEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Layer;
|
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.Rarity;
|
import mage.constants.Rarity;
|
||||||
import mage.constants.SubLayer;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
@ -68,27 +65,19 @@ public class BileBlight extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class BileBlightEffect extends ContinuousEffectImpl {
|
class BileBlightEffect extends BoostAllEffect {
|
||||||
|
|
||||||
public BileBlightEffect() {
|
public BileBlightEffect() {
|
||||||
super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.UnboostCreature);
|
super(-3, -3, Duration.EndOfTurn);
|
||||||
staticText = "Target creature and all creatures with the same name as that creature get -3/-3 until end of turn";
|
staticText = "Target creature and all creatures with the same name as that creature get -3/-3 until end of turn";
|
||||||
}
|
}
|
||||||
|
|
||||||
public BileBlightEffect(final BileBlightEffect effect) {
|
|
||||||
super(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BileBlightEffect copy() {
|
|
||||||
return new BileBlightEffect(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Ability source, Game game) {
|
public void init(Ability source, Game game) {
|
||||||
super.init(source, game);
|
super.init(source, game);
|
||||||
|
|
||||||
if (this.affectedObjectsSet) {
|
if (this.affectedObjectsSet) {
|
||||||
|
this.objects.clear();
|
||||||
UUID permanentId = targetPointer.getFirst(game, source);
|
UUID permanentId = targetPointer.getFirst(game, source);
|
||||||
Permanent target = game.getPermanent(permanentId);
|
Permanent target = game.getPermanent(permanentId);
|
||||||
if (target != null) {
|
if (target != null) {
|
||||||
|
@ -101,15 +90,4 @@ class BileBlightEffect extends ContinuousEffectImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
for (Permanent perm : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
|
|
||||||
if (!this.affectedObjectsSet || objects.contains(perm.getId())) {
|
|
||||||
perm.addPower(-3);
|
|
||||||
perm.addToughness(-3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue