Cards can now add extra information to be displayed in the card information window.

This commit is contained in:
marcins78@gmail.com
2012-01-27 14:59:05 +00:00
parent 47913af338
commit 2925ee270b
6 changed files with 32 additions and 0 deletions

View File

@@ -231,6 +231,11 @@ public abstract class AbstractLotroCardBlueprint implements LotroCardBlueprint {
return null;
}
@Override
public String getExtraDisplayableInformation(PhysicalCard self) {
return null;
}
@Override
public Direction getSiteDirection() {
throw new UnsupportedOperationException("This method should not be called on this card");

View File

@@ -197,6 +197,11 @@ public class SimpleLotroCardBlueprint implements LotroCardBlueprint {
return false;
}
@Override
public String getExtraDisplayableInformation(PhysicalCard self) {
return null;
}
@Override
public boolean isUnique() {
return false;

View File

@@ -56,6 +56,13 @@ public class Card11_050 extends AbstractPermanent {
return null;
}
@Override
public String getExtraDisplayableInformation(PhysicalCard self) {
if (self.getWhileInZoneData() != null)
return "Selected keyword is: " + ((Keyword) self.getWhileInZoneData()).getHumanReadable();
return null;
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.movesTo(game, effectResult, (Keyword) self.getWhileInZoneData())

View File

@@ -53,4 +53,11 @@ public class Card15_076 extends AbstractPermanent {
}
return null;
}
@Override
public String getExtraDisplayableInformation(PhysicalCard self) {
if (self.getWhileInZoneData() != null)
return "Random site name is: " + self.getWhileInZoneData();
return null;
}
}

View File

@@ -89,6 +89,8 @@ public interface LotroCardBlueprint {
public Direction getSiteDirection();
public String getExtraDisplayableInformation(PhysicalCard self);
public enum Direction {
LEFT, RIGHT
}

View File

@@ -132,6 +132,12 @@ public class LotroGameMediator {
sb.append("<br>" + GameUtils.getAppendedNames(stackedCards));
}
final String extraDisplayableInformation = card.getBlueprint().getExtraDisplayableInformation(card);
if (extraDisplayableInformation != null) {
sb.append("<br><b>Extra information:</b>");
sb.append("<br>" + extraDisplayableInformation);
}
sb.append("<br><br><b>Effective stats:</b>");
try {
int twilightCost = _lotroGame.getModifiersQuerying().getTwilightCost(_lotroGame.getGameState(), card, false);