mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 12:22:10 -08:00
Fixed card number of Search Warrant and fixed NPE of ExchangeControlTargetEffect (still some issues left)
This commit is contained in:
parent
7cdacbc926
commit
9481e44ae2
2 changed files with 15 additions and 5 deletions
|
|
@ -45,7 +45,7 @@ import mage.target.TargetPlayer;
|
|||
public class SearchWarrant extends CardImpl<SearchWarrant> {
|
||||
|
||||
public SearchWarrant(UUID ownerId) {
|
||||
super(ownerId, 161, "Search Warrant", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{W}{U}");
|
||||
super(ownerId, 193, "Search Warrant", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{W}{U}");
|
||||
this.expansionSetCode = "RTR";
|
||||
|
||||
this.color.setBlue(true);
|
||||
|
|
|
|||
|
|
@ -114,26 +114,36 @@ public class ExchangeControlTargetEffect extends ContinuousEffectImpl<ExchangeCo
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
int countChangeControl = 0;
|
||||
if (this.lockedControllers != null) {
|
||||
for (UUID permanentId : targetPointer.getTargets(game, source)) {
|
||||
Permanent permanent = game.getPermanent(permanentId);
|
||||
if (permanent != null) {
|
||||
UUID controllerId = this.lockedControllers.get(permanent.getId());
|
||||
if (controllerId != null) {
|
||||
permanent.changeControllerId(controllerId, game);
|
||||
if(permanent.changeControllerId(controllerId, game)) {
|
||||
++countChangeControl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (withSource) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
UUID controllerId = this.lockedControllers.get(permanent.getId());
|
||||
if (controllerId != null) {
|
||||
permanent.changeControllerId(controllerId, game);
|
||||
if (permanent != null) {
|
||||
UUID controllerId = this.lockedControllers.get(permanent.getId());
|
||||
if (controllerId != null) {
|
||||
if (permanent.changeControllerId(controllerId, game)) {
|
||||
++countChangeControl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (countChangeControl == 2) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue