mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- For now, make the controller->getController() change local to Exert (to fix exerting a stolen creature). Reverted other cases for now since they didn't seem to cause problems but might have had a negative impact on checking LKI controller in hasProperty.
This commit is contained in:
@@ -3893,19 +3893,19 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("YouCtrl")) {
|
||||
if (!getController().equals(sourceController)) {
|
||||
if (!controller.equals(sourceController)) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("YouDontCtrl")) {
|
||||
if (getController().equals(sourceController)) {
|
||||
if (controller.equals(sourceController)) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("OppCtrl")) {
|
||||
if (!getController().getOpponents().contains(sourceController)) {
|
||||
if (!controller.getOpponents().contains(sourceController)) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("ChosenCtrl")) {
|
||||
if (!getController().equals(source.getChosenPlayer())) {
|
||||
if (!controller.equals(source.getChosenPlayer())) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("DefenderCtrl")) {
|
||||
@@ -3916,11 +3916,11 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
if (!source.hasRemembered()) {
|
||||
return false;
|
||||
}
|
||||
if (getGame().getCombat().getDefendingPlayerRelatedTo((Card) source.getFirstRemembered()) != getController()) {
|
||||
if (getGame().getCombat().getDefendingPlayerRelatedTo((Card) source.getFirstRemembered()) != controller) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (getGame().getCombat().getDefendingPlayerRelatedTo(source) != getController()) {
|
||||
if (getGame().getCombat().getDefendingPlayerRelatedTo(source) != controller) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -3928,13 +3928,13 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
if (!game.getPhaseHandler().inCombat()) {
|
||||
return false;
|
||||
}
|
||||
if (!getGame().getCombat().isPlayerAttacked(getController())) {
|
||||
if (!getGame().getCombat().isPlayerAttacked(controller)) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("EnchantedPlayerCtrl")) {
|
||||
final Object o = source.getEnchanting();
|
||||
if (o instanceof Player) {
|
||||
if (!getController().equals(o)) {
|
||||
if (!controller.equals(o)) {
|
||||
return false;
|
||||
}
|
||||
} else { // source not enchanting a player
|
||||
@@ -3943,14 +3943,14 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
} else if (property.startsWith("EnchantedControllerCtrl")) {
|
||||
final Object o = source.getEnchanting();
|
||||
if (o instanceof Card) {
|
||||
if (!getController().equals(((Card) o).getController())) {
|
||||
if (!controller.equals(((Card) o).getController())) {
|
||||
return false;
|
||||
}
|
||||
} else { // source not enchanting a card
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("RememberedPlayer")) {
|
||||
Player p = property.endsWith("Ctrl") ? getController() : getOwner();
|
||||
Player p = property.endsWith("Ctrl") ? controller : getOwner();
|
||||
if (!source.hasRemembered()) {
|
||||
final Card newCard = game.getCardState(source);
|
||||
for (final Object o : newCard.getRemembered()) {
|
||||
@@ -3972,12 +3972,12 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
} else if (property.startsWith("nonRememberedPlayerCtrl")) {
|
||||
if (!source.hasRemembered()) {
|
||||
final Card newCard = game.getCardState(source);
|
||||
if (newCard.isRemembered(getController())) {
|
||||
if (newCard.isRemembered(controller)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (source.isRemembered(getController())) {
|
||||
if (source.isRemembered(controller)) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.equals("TargetedPlayerCtrl")) {
|
||||
@@ -3985,7 +3985,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
final SpellAbility saTargeting = sa.getSATargetingPlayer();
|
||||
if (saTargeting != null) {
|
||||
for (final Player p : saTargeting.getTargets().getTargetPlayers()) {
|
||||
if (!getController().equals(p)) {
|
||||
if (!controller.equals(p)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -3997,23 +3997,23 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
final List<SpellAbility> sas = AbilityUtils.getDefinedSpellAbilities(source, "Targeted", sa);
|
||||
for (final Card c : cards) {
|
||||
final Player p = c.getController();
|
||||
if (!getController().equals(p)) {
|
||||
if (!controller.equals(p)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (final SpellAbility s : sas) {
|
||||
final Player p = s.getHostCard().getController();
|
||||
if (!getController().equals(p)) {
|
||||
if (!controller.equals(p)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (property.startsWith("ActivePlayerCtrl")) {
|
||||
if (!game.getPhaseHandler().isPlayerTurn(getController())) {
|
||||
if (!game.getPhaseHandler().isPlayerTurn(controller)) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("NonActivePlayerCtrl")) {
|
||||
if (game.getPhaseHandler().isPlayerTurn(getController())) {
|
||||
if (game.getPhaseHandler().isPlayerTurn(controller)) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("YouOwn")) {
|
||||
@@ -4046,24 +4046,24 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
}
|
||||
} else if (property.startsWith("ControlledBy")) {
|
||||
final String valid = property.substring(13);
|
||||
if (!getController().isValid(valid, sourceController, source, spellAbility)) {
|
||||
if (!controller.isValid(valid, sourceController, source, spellAbility)) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("OwnerDoesntControl")) {
|
||||
if (getOwner().equals(getController())) {
|
||||
if (getOwner().equals(controller)) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("ControllerControls")) {
|
||||
final String type = property.substring(18);
|
||||
if (type.startsWith("AtLeastAsMany")) {
|
||||
String realType = type.split("AtLeastAsMany")[1];
|
||||
CardCollectionView cards = CardLists.getType(getController().getCardsIn(ZoneType.Battlefield), realType);
|
||||
CardCollectionView cards = CardLists.getType(controller.getCardsIn(ZoneType.Battlefield), realType);
|
||||
CardCollectionView yours = CardLists.getType(sourceController.getCardsIn(ZoneType.Battlefield), realType);
|
||||
if (cards.size() < yours.size()) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
final CardCollectionView cards = getController().getCardsIn(ZoneType.Battlefield);
|
||||
final CardCollectionView cards = controller.getCardsIn(ZoneType.Battlefield);
|
||||
if (CardLists.getType(cards, type).isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
@@ -4735,7 +4735,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
} else {
|
||||
p = sourceController;
|
||||
}
|
||||
if (p == null || !getController().equals(game.getNextPlayerAfter(p, direction))) {
|
||||
if (p == null || !controller.equals(game.getNextPlayerAfter(p, direction))) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("sharesTypeWith")) {
|
||||
@@ -4886,11 +4886,11 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("controllerWasDealtCombatDamageByThisTurn")) {
|
||||
if (!source.getDamageHistory().getThisTurnCombatDamaged().contains(getController())) {
|
||||
if (!source.getDamageHistory().getThisTurnCombatDamaged().contains(controller)) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("controllerWasDealtDamageByThisTurn")) {
|
||||
if (!source.getDamageHistory().getThisTurnDamaged().contains(getController())) {
|
||||
if (!source.getDamageHistory().getThisTurnDamaged().contains(controller)) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("wasDealtDamageThisTurn")) {
|
||||
@@ -4906,7 +4906,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("attackedLastTurn")) {
|
||||
return getDamageHistory().getCreatureAttackedLastTurnOf(getController());
|
||||
return getDamageHistory().getCreatureAttackedLastTurnOf(controller);
|
||||
} else if (property.startsWith("blockedThisTurn")) {
|
||||
if (!getDamageHistory().getCreatureBlockedThisTurn()) {
|
||||
return false;
|
||||
@@ -4924,7 +4924,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("notAttackedLastTurn")) {
|
||||
return !getDamageHistory().getCreatureAttackedLastTurnOf(getController());
|
||||
return !getDamageHistory().getCreatureAttackedLastTurnOf(controller);
|
||||
} else if (property.startsWith("notBlockedThisTurn")) {
|
||||
if (getDamageHistory().getCreatureBlockedThisTurn()) {
|
||||
return false;
|
||||
@@ -5217,7 +5217,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
|
||||
String valid = property.split(" ")[1];
|
||||
for(Card c : getBlockedThisTurn()) {
|
||||
if (c.isValid(valid, getController(), source, spellAbility)) {
|
||||
if (c.isValid(valid, this.getController(), source, spellAbility)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -5228,7 +5228,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
}
|
||||
String valid = property.split(" ")[1];
|
||||
for(Card c : getBlockedByThisTurn()) {
|
||||
if (c.isValid(valid, getController(), source, spellAbility)) {
|
||||
if (c.isValid(valid, this.getController(), source, spellAbility)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user