mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
added Academy Drake, Knight of Malice, Hexproof from White
This commit is contained in:
parent
ad8b046b05
commit
af83a34c64
6 changed files with 163 additions and 4 deletions
|
|
@ -51,13 +51,13 @@ import mage.target.common.TargetOpponent;
|
|||
public class Modes extends LinkedHashMap<UUID, Mode> {
|
||||
|
||||
private Mode currentMode; // the current mode of the selected modes
|
||||
private final ArrayList<UUID> selectedModes = new ArrayList<>();
|
||||
private final List<UUID> selectedModes = new ArrayList<>();
|
||||
private int minModes;
|
||||
private int maxModes;
|
||||
private TargetController modeChooser;
|
||||
private boolean eachModeMoreThanOnce; // each mode can be selected multiple times during one choice
|
||||
private boolean eachModeOnlyOnce; // state if each mode can be chosen only once as long as the source object exists
|
||||
private final LinkedHashMap<UUID, Mode> duplicateModes = new LinkedHashMap<>();
|
||||
private final Map<UUID, Mode> duplicateModes = new LinkedHashMap<>();
|
||||
private OptionalAdditionalModeSourceCosts optionalAdditionalModeSourceCosts = null; // only set if costs have to be paid
|
||||
private Filter maxModesFilter = null; // calculates the max number of available modes
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ public class Modes extends LinkedHashMap<UUID, Mode> {
|
|||
return null;
|
||||
}
|
||||
|
||||
public ArrayList<UUID> getSelectedModes() {
|
||||
public List<UUID> getSelectedModes() {
|
||||
return selectedModes;
|
||||
}
|
||||
|
||||
|
|
@ -292,7 +292,7 @@ public class Modes extends LinkedHashMap<UUID, Mode> {
|
|||
* @param source
|
||||
* @param game
|
||||
*/
|
||||
private void setAlreadySelectedModes(ArrayList<UUID> selectedModes, Ability source, Game game) {
|
||||
private void setAlreadySelectedModes(List<UUID> selectedModes, Ability source, Game game) {
|
||||
for (UUID modeId : selectedModes) {
|
||||
String key = getKey(source, game, modeId);
|
||||
game.getState().setValue(key, true);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
package mage.abilities.keyword;
|
||||
|
||||
import mage.abilities.MageSingleton;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.constants.Zone;
|
||||
|
||||
import java.io.ObjectStreamException;
|
||||
|
||||
/**
|
||||
* Hexproof from white (This creature or player can't be the target of white spells or abilities
|
||||
* your opponents control.)
|
||||
*
|
||||
* @author igoudt
|
||||
*/
|
||||
public class HexproofFromWhiteAbility extends SimpleStaticAbility implements MageSingleton {
|
||||
|
||||
private static final HexproofFromWhiteAbility instance;
|
||||
|
||||
static {
|
||||
instance = new HexproofFromWhiteAbility();
|
||||
}
|
||||
|
||||
private Object readResolve() throws ObjectStreamException {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static HexproofFromWhiteAbility getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
private HexproofFromWhiteAbility() {
|
||||
super(Zone.BATTLEFIELD, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HexproofFromWhiteAbility copy() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "hexproof from white";
|
||||
}
|
||||
}
|
||||
|
|
@ -955,6 +955,14 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
|
|||
}
|
||||
}
|
||||
|
||||
if (abilities.containsKey(HexproofFromWhiteAbility.getInstance().getId()) ) {
|
||||
if (game.getPlayer(this.getControllerId()).hasOpponent(sourceControllerId, game)
|
||||
&& !game.getContinuousEffects().asThough(this.getId(), AsThoughEffectType.HEXPROOF, sourceControllerId, game)
|
||||
&& source.getColor(game).isWhite()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasProtectionFrom(source, game)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue