mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Added support for EnchantedPlayer to triggers and defined. Added EnchantedPlayerCtrl as a property test for cards
This commit is contained in:
@@ -4942,6 +4942,14 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
if (!getController().isPlayer(sourceController)) return false;
|
if (!getController().isPlayer(sourceController)) return false;
|
||||||
} else if (Property.startsWith("YouDontCtrl")) {
|
} else if (Property.startsWith("YouDontCtrl")) {
|
||||||
if (getController().isPlayer(sourceController)) return false;
|
if (getController().isPlayer(sourceController)) return false;
|
||||||
|
} else if (Property.startsWith("EnchantedPlayerCtrl")) {
|
||||||
|
Object o = source.getEnchanting();
|
||||||
|
if (o instanceof Player) {
|
||||||
|
if (!getController().isPlayer((Player) o)) return false;
|
||||||
|
}
|
||||||
|
else { // source not enchanting a player
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else if (Property.startsWith("YouOwn")) {
|
} else if (Property.startsWith("YouOwn")) {
|
||||||
if (!getOwner().isPlayer(sourceController)) return false;
|
if (!getOwner().isPlayer(sourceController)) return false;
|
||||||
} else if (Property.startsWith("YouDontOwn")) {
|
} else if (Property.startsWith("YouDontOwn")) {
|
||||||
|
|||||||
@@ -1515,6 +1515,13 @@ public class AbilityFactory {
|
|||||||
if (!players.contains(p)) {
|
if (!players.contains(p)) {
|
||||||
players.add(p);
|
players.add(p);
|
||||||
}
|
}
|
||||||
|
} else if (defined.equals("EnchantedPlayer")) {
|
||||||
|
Object o = sa.getSourceCard().getEnchanting();
|
||||||
|
if (o instanceof Player) {
|
||||||
|
if (!players.contains((Player) o)) {
|
||||||
|
players.add((Player) o);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (defined.equals("AttackingPlayer")) {
|
} else if (defined.equals("AttackingPlayer")) {
|
||||||
Player p = AllZone.getCombat().getAttackingPlayer();
|
Player p = AllZone.getCombat().getAttackingPlayer();
|
||||||
if (!players.contains(p)) {
|
if (!players.contains(p)) {
|
||||||
|
|||||||
@@ -466,6 +466,9 @@ public abstract class Trigger {
|
|||||||
if (v.equalsIgnoreCase("EnchantedController")) {
|
if (v.equalsIgnoreCase("EnchantedController")) {
|
||||||
return ((Player) o).isPlayer(srcCard.getEnchantingCard().getController());
|
return ((Player) o).isPlayer(srcCard.getEnchantingCard().getController());
|
||||||
}
|
}
|
||||||
|
if (v.equalsIgnoreCase("EnchantedPlayer")) {
|
||||||
|
return o.equals(srcCard.getEnchanting());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user