From 058b616fc733c3471eee196b15f5faaec71daa0f Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Thu, 6 Oct 2011 13:45:27 +0000 Subject: [PATCH] - "Hollowing of Isengard" now correctly discards itself upon use. - Playing attached permanents now can have twilight cost modified (as for example per "Fell Voice on the Air"). - Now the cards played on a site are finally correctly displayed if in Adventure Path (this time I actually tested it). --- .../java/com/gempukku/lotro/cards/AbstractAttachable.java | 2 +- .../lotro/cards/actions/AttachPermanentAction.java | 4 ++-- .../com/gempukku/lotro/cards/set3/isengard/Card3_054.java | 2 +- .../gemp-lotr-web/src/main/webapp/includes/changeLog.html | 5 +++++ gemp-lotr/gemp-lotr-web/src/main/webapp/js/jCardGroup.js | 8 ++++---- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/AbstractAttachable.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/AbstractAttachable.java index d6fe66744..be0934394 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/AbstractAttachable.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/AbstractAttachable.java @@ -93,7 +93,7 @@ public abstract class AbstractAttachable extends AbstractLotroCardBlueprint { } public AttachPermanentAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, Filter additionalAttachmentFilter, int twilightModifier) { - return new AttachPermanentAction(game, self, Filters.and(getFullValidTargetFilter(playerId, game, self), additionalAttachmentFilter), getAttachCostModifiers(playerId, game, self)); + return new AttachPermanentAction(game, self, Filters.and(getFullValidTargetFilter(playerId, game, self), additionalAttachmentFilter), getAttachCostModifiers(playerId, game, self), twilightModifier); } protected List getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) { diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/actions/AttachPermanentAction.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/actions/AttachPermanentAction.java index 1e1fbe743..4d781c360 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/actions/AttachPermanentAction.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/actions/AttachPermanentAction.java @@ -38,7 +38,7 @@ public class AttachPermanentAction extends AbstractCostToEffectAction { private Effect _discardCardEffect; private boolean _cardDiscarded; - public AttachPermanentAction(final LotroGame game, final PhysicalCard card, Filter filter, final Map attachCostModifiers) { + public AttachPermanentAction(final LotroGame game, final PhysicalCard card, Filter filter, final Map attachCostModifiers, final int twilightModifier) { _source = card; _removeCardEffect = new RemoveCardFromZoneEffect(card); @@ -49,7 +49,7 @@ public class AttachPermanentAction extends AbstractCostToEffectAction { protected void cardSelected(PhysicalCard target) { _putCardIntoPlayEffect = new AttachCardEffect(_source, target); - int modifier = 0; + int modifier = twilightModifier; for (Map.Entry filterIntegerEntry : attachCostModifiers.entrySet()) if (filterIntegerEntry.getKey().accepts(game.getGameState(), game.getModifiersQuerying(), target)) modifier += filterIntegerEntry.getValue(); diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set3/isengard/Card3_054.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set3/isengard/Card3_054.java index 57e548acc..0a5b938cd 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set3/isengard/Card3_054.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set3/isengard/Card3_054.java @@ -38,7 +38,7 @@ public class Card3_054 extends AbstractPermanent { if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), Phase.SHADOW, self, 0)) { ActivateCardAction action = new ActivateCardAction(self, Keyword.SHADOW); action.appendCost( - new DiscardCardsFromPlayEffect(self)); + new DiscardCardsFromPlayEffect(self, self)); action.appendEffect( new AddTwilightEffect(self, 3)); return Collections.singletonList(action); diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html b/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html index cf1f5847b..b6e8895dd 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html @@ -1,4 +1,9 @@
+6 Oct. 2011
+- "Hollowing of Isengard" now correctly discards itself upon use.
+- Playing attached permanents now can have twilight cost modified (as for example per "Fell Voice on the Air").
+- Now the cards played on a site are finally correctly displayed if in Adventure Path (this time I actually tested it). 
+
 5 Oct. 2011
 - Added timestamps to the chat messages in GameHall.
 - Multiple cards played on a site in adventure path should be now layed out correctly - all should be visible, rather
diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/jCardGroup.js b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/jCardGroup.js
index 3515fb56f..ed3b903bd 100644
--- a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/jCardGroup.js
+++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/jCardGroup.js
@@ -133,7 +133,7 @@ var AdvPathCardGroup = CardGroup.extend({
                 index++;
             } else {
                 for (var i = 0; i < cardData.attachedCards.length; i++) {
-                    this.layoutCard(cardData.attachedCards[0], x + i * (this.width - cardHeight) / (cardData.attachedCards.length - 1), y - (this.width - cardHeight) / 2, cardHeight, this.width, index);
+                    this.layoutCard(cardData.attachedCards[i], x + i * (this.width - cardHeight) / (cardData.attachedCards.length - 1), y - (this.width - cardHeight) / 2, cardHeight, this.width, index);
                     index++;
                 }
             }
@@ -208,7 +208,7 @@ var NormalCardGroup = CardGroup.extend({
             var cardWidth = cardData.getWidthForHeight(rowHeight);
             var attachmentWidths = 0;
             for (var i = 0; i < cardData.attachedCards.length; i++)
-                attachmentWidths += cardData.attachedCards[i].data("card").getWidthForHeight(this.height) * 0.2;
+                attachmentWidths += cardData.attachedCards[i].data("card").getWidthForHeight(rowHeight) * 0.2;
             var cardWidthWithAttachments = cardWidth + attachmentWidths;
             totalWidth += cardWidthWithAttachments;
             if (totalWidth > this.width) {
@@ -264,7 +264,7 @@ var NormalCardGroup = CardGroup.extend({
 
             var attachmentWidths = 0;
             for (var i = 0; i < cardData.attachedCards.length; i++)
-                attachmentWidths += cardData.attachedCards[i].data("card").getWidthForHeight(this.height) * 0.2;
+                attachmentWidths += cardData.attachedCards[i].data("card").getWidthForHeight(rowHeight) * 0.2;
             var cardWidthWithAttachments = cardWidth + attachmentWidths;
             if (x + cardWidthWithAttachments > this.width) {
                 row++;
@@ -273,7 +273,7 @@ var NormalCardGroup = CardGroup.extend({
             }
 
             for (var i = 0; i < cardData.attachedCards.length; i++) {
-                var attachedCardWidth = cardData.attachedCards[i].data("card").getWidthForHeight(this.height);
+                var attachedCardWidth = cardData.attachedCards[i].data("card").getWidthForHeight(rowHeight);
                 this.layoutCard(cardData.attachedCards[i], this.x + x, this.y + y, attachedCardWidth, rowHeight, index);
                 x += Math.floor(attachedCardWidth * 0.2);
                 index++;