Fixing ally and siteNumber mishup.

This commit is contained in:
marcins78@gmail.com
2011-10-12 22:36:47 +00:00
parent b5c189a9e4
commit 831ae4aaf8
13 changed files with 59 additions and 38 deletions

View File

@@ -57,7 +57,7 @@ public class Card1_040 extends AbstractAlly {
if (effectResult.getType() == EffectResult.Type.START_OF_TURN) {
RequiredTriggerAction action = new RequiredTriggerAction(self);
action.appendEffect(
new HealCharactersEffect(self.getOwner(), Filters.and(Filters.type(CardType.ALLY), Filters.siteNumber(3), Filters.siteBlock(Block.FELLOWSHIP))));
new HealCharactersEffect(self.getOwner(), Filters.and(Filters.type(CardType.ALLY), Filters.isAllyHome(3, Block.FELLOWSHIP))));
return Collections.singletonList(action);
}

View File

@@ -53,7 +53,7 @@ public class Card1_045 extends AbstractAlly {
if (effectResult.getType() == EffectResult.Type.START_OF_TURN) {
RequiredTriggerAction action = new RequiredTriggerAction(self);
action.appendEffect(
new HealCharactersEffect(self.getOwner(), Filters.and(Filters.type(CardType.ALLY), Filters.siteNumber(6), Filters.siteBlock(Block.FELLOWSHIP))));
new HealCharactersEffect(self.getOwner(), Filters.and(Filters.type(CardType.ALLY), Filters.isAllyHome(6, Block.FELLOWSHIP))));
return Collections.singletonList(action);
}

View File

@@ -73,7 +73,7 @@ public class Card1_055 extends AbstractPermanent {
@Override
public Modifier getAlwaysOnModifier(PhysicalCard self) {
return new StrengthModifier(self, Filters.and(Filters.type(CardType.ALLY), Filters.siteNumber(6), Filters.siteBlock(Block.FELLOWSHIP)), 1);
return new StrengthModifier(self, Filters.and(Filters.type(CardType.ALLY), Filters.isAllyHome(6, Block.FELLOWSHIP)), 1);
}
private String[] opponentsHavingAtLeast7Cards(LotroGame game, String currentPlayer) {

View File

@@ -34,14 +34,14 @@ public class Card1_064 extends AbstractEvent {
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
return super.checkPlayRequirements(playerId, game, self, twilightModifier)
&& PlayConditions.canExert(self, game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.ELF), Filters.type(CardType.ALLY), Filters.siteNumber(3), Filters.siteBlock(Block.FELLOWSHIP));
&& PlayConditions.canExert(self, game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.ELF), Filters.type(CardType.ALLY), Filters.isAllyHome(3, Block.FELLOWSHIP));
}
@Override
public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, final PhysicalCard self, int twilightModifier) {
final PlayEventAction action = new PlayEventAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.race(Race.ELF), Filters.type(CardType.ALLY), Filters.siteNumber(3), Filters.siteBlock(Block.FELLOWSHIP)) {
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.race(Race.ELF), Filters.type(CardType.ALLY), Filters.isAllyHome(3, Block.FELLOWSHIP)) {
@Override
protected void forEachCardExertedCallback(PhysicalCard elfAlly) {
action.appendEffect(

View File

@@ -34,14 +34,14 @@ public class Card1_065 extends AbstractEvent {
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
return super.checkPlayRequirements(playerId, game, self, twilightModifier)
&& PlayConditions.canExert(self, game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.ELF), Filters.type(CardType.ALLY), Filters.siteNumber(6), Filters.siteBlock(Block.FELLOWSHIP));
&& PlayConditions.canExert(self, game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.ELF), Filters.type(CardType.ALLY), Filters.isAllyHome(6, Block.FELLOWSHIP));
}
@Override
public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, final PhysicalCard self, int twilightModifier) {
final PlayEventAction action = new PlayEventAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.race(Race.ELF), Filters.type(CardType.ALLY), Filters.siteNumber(6), Filters.siteBlock(Block.FELLOWSHIP)) {
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.race(Race.ELF), Filters.type(CardType.ALLY), Filters.isAllyHome(6, Block.FELLOWSHIP)) {
@Override
protected void forEachCardExertedCallback(PhysicalCard elfAlly) {
action.appendEffect(

View File

@@ -35,7 +35,7 @@ public class Card1_067 extends AbstractAlly {
}
private Filter getFilter(PhysicalCard self) {
return Filters.and(Filters.type(CardType.SITE), Filters.owner(self.getOwner()), Filters.siteNumber(3), Filters.siteBlock(Block.FELLOWSHIP));
return Filters.and(Filters.type(CardType.SITE), Filters.owner(self.getOwner()), Filters.siteNumber(6), Filters.siteBlock(Block.FELLOWSHIP));
}
private LotroCardBlueprint getCopied(LotroGame game, PhysicalCard self) {

View File

@@ -42,7 +42,7 @@ public class Card1_297 extends AbstractAlly {
action.appendCost(
new ExertCharactersEffect(self, self));
action.appendEffect(
new ChooseAndHealCharactersEffect(action, playerId, Filters.type(CardType.ALLY), Filters.race(Race.HOBBIT), Filters.not(Filters.sameCard(self)), Filters.siteNumber(1), Filters.siteBlock(Block.FELLOWSHIP)));
new ChooseAndHealCharactersEffect(action, playerId, Filters.type(CardType.ALLY), Filters.race(Race.HOBBIT), Filters.not(Filters.sameCard(self)), Filters.isAllyHome(1, Block.FELLOWSHIP)));
return Collections.singletonList(action);
}
return null;

View File

@@ -25,6 +25,6 @@ public class Card1_352 extends AbstractSite {
@Override
public Modifier getAlwaysOnModifier(PhysicalCard self) {
return new StrengthModifier(self, Filters.and(Filters.type(CardType.ALLY), Filters.siteNumber(6), Filters.siteBlock(Block.FELLOWSHIP)), 3);
return new StrengthModifier(self, Filters.and(Filters.type(CardType.ALLY), Filters.isAllyHome(6, Block.FELLOWSHIP)), 3);
}
}

View File

@@ -36,8 +36,7 @@ public class Card3_008 extends AbstractCompanion {
Filters.and(
Filters.culture(Culture.ELVEN),
Filters.type(CardType.ALLY),
Filters.siteNumber(3),
Filters.siteBlock(Block.FELLOWSHIP)
Filters.isAllyHome(3, Block.FELLOWSHIP)
), 3), -3));
}
}

View File

@@ -40,7 +40,7 @@ public class Card3_013 extends AbstractAlly {
if (effectResult.getType() == EffectResult.Type.START_OF_TURN) {
final OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose an ally", Filters.type(CardType.ALLY), Filters.siteNumber(3), Filters.siteBlock(Block.FELLOWSHIP)) {
new ChooseActiveCardEffect(self, playerId, "Choose an ally", Filters.type(CardType.ALLY), Filters.isAllyHome(3, Block.FELLOWSHIP)) {
@Override
protected void cardSelected(PhysicalCard ally) {
action.insertEffect(

View File

@@ -272,6 +272,17 @@ public class Filters {
};
}
public static Filter isAllyHome(final int siteNumber, final Block siteBlock) {
return Filters.and(
Filters.type(CardType.ALLY),
new Filter() {
@Override
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
return physicalCard.getBlueprint().isAllyAtHome(siteNumber, siteBlock);
}
});
}
public static Filter isAllyAtHome() {
return Filters.and(
Filters.type(CardType.ALLY),

View File

@@ -390,6 +390,38 @@ var GameAnimations = Class.extend({
this.game.chatBox.appendMessage(message, "warningMessage");
},
showSkirmishValues: function(skirmish) {
this.game.fpStrengthDiv.text(skirmish[0].getAttribute("fpStrength"));
this.game.shadowStrengthDiv.text(skirmish[0].getAttribute("shadowStrength"));
},
processDecision: function(decision) {
var decisionType = decision.getAttribute("type");
if (decisionType == "INTEGER") {
this.game.integerDecision(decision);
} else if (decisionType == "MULTIPLE_CHOICE") {
this.game.multipleChoiceDecision(decision);
} else if (decisionType == "ARBITRARY_CARDS") {
this.game.arbitraryCardsDecision(decision);
} else if (decisionType == "ACTION_CHOICE") {
this.game.actionChoiceDecision(decision);
} else if (decisionType == "CARD_ACTION_CHOICE") {
this.game.cardActionChoiceDecision(decision);
} else if (decisionType == "CARD_SELECTION") {
this.game.cardSelectionDecision(decision);
} else if (decisionType == "ASSIGN_MINIONS") {
this.game.assignMinionsDecision(decision);
}
},
updateGameState: function() {
var that = this;
setTimeout(
function() {
that.game.updateGameState();
}, 1000);
},
windowResized: function() {
var that = this;
$("#main").queue(

View File

@@ -532,10 +532,8 @@ var GempLotrGameUI = Class.extend({
this.layoutUI(false);
var skirmish = element.getElementsByTagName("skirmish");
if (skirmish.length > 0) {
this.fpStrengthDiv.text(skirmish[0].getAttribute("fpStrength"));
this.shadowStrengthDiv.text(skirmish[0].getAttribute("shadowStrength"));
}
if (skirmish.length > 0)
this.animations.showSkirmishValues(skirmish);
if (this.allPlayerIds != null) {
var clocks = element.getElementsByTagName("clocks")[0].getElementsByTagName("clock");
@@ -558,28 +556,9 @@ var GempLotrGameUI = Class.extend({
var decisions = element.getElementsByTagName("decision");
if (decisions.length == 1) {
var decision = decisions[0];
var decisionType = decision.getAttribute("type");
if (decisionType == "INTEGER") {
this.integerDecision(decision);
} else if (decisionType == "MULTIPLE_CHOICE") {
this.multipleChoiceDecision(decision);
} else if (decisionType == "ARBITRARY_CARDS") {
this.arbitraryCardsDecision(decision);
} else if (decisionType == "ACTION_CHOICE") {
this.actionChoiceDecision(decision);
} else if (decisionType == "CARD_ACTION_CHOICE") {
this.cardActionChoiceDecision(decision);
} else if (decisionType == "CARD_SELECTION") {
this.cardSelectionDecision(decision);
} else if (decisionType == "ASSIGN_MINIONS") {
this.assignMinionsDecision(decision);
}
this.animations.processDecision(decision);
} else {
var that = this;
setTimeout(
function() {
that.updateGameState();
}, 1000);
this.animations.updateGameState();
}
},