- The Siege cycle cards now visualize their chosen mode in the card detail panel.

This commit is contained in:
Agetian
2017-06-12 13:20:21 +00:00
parent de837d66f9
commit ea65d1de4d
10 changed files with 33 additions and 5 deletions

View File

@@ -53,6 +53,9 @@ public class ChooseGenericEffect extends SpellAbilityEffect {
boolean dontNotifySelf = sa.getParam("ShowChoice").equals("ExceptSelf");
p.getGame().getAction().nofityOfValue(sa, p, chosenValue, dontNotifySelf ? sa.getActivatingPlayer() : null);
}
if (sa.hasParam("SetChosenMode")) {
sa.getHostCard().setChosenMode(chosenValue);
}
p.getGame().fireEvent(new GameEventCardModeChosen(p, host.getName(), chosenValue, sa.hasParam("ShowChoice")));
AbilityUtils.resolve(chosenSA);
}

View File

@@ -223,6 +223,7 @@ public class Card extends GameEntity implements Comparable<Card> {
private int chosenNumber;
private Player chosenPlayer;
private Direction chosenDirection = null;
private String chosenMode = "";
private Card exiledWith = null;
@@ -1287,6 +1288,14 @@ public class Card extends GameEntity implements Comparable<Card> {
view.updateChosenDirection(this);
}
public String getChosenMode() {
return chosenMode;
}
public void setChosenMode(String mode) {
chosenMode = mode;
view.updateChosenMode(this);
}
// used for cards like Meddling Mage...
public final String getNamedCard() {
return namedCard;

View File

@@ -280,6 +280,13 @@ public class CardView extends GameEntityView {
set(TrackableProperty.ChosenDirection, c.getChosenDirection());
}
public String getChosenMode() {
return get(TrackableProperty.ChosenMode);
}
void updateChosenMode(Card c) {
set(TrackableProperty.ChosenMode, c.getChosenMode());
}
private String getRemembered() {
return get(TrackableProperty.Remembered);
}

View File

@@ -36,6 +36,7 @@ public enum TrackableProperty {
ChosenCards(TrackableTypes.CardViewCollectionType),
ChosenPlayer(TrackableTypes.PlayerViewType),
ChosenDirection(TrackableTypes.EnumType(Direction.class)),
ChosenMode(TrackableTypes.StringType),
Remembered(TrackableTypes.StringType),
NamedCard(TrackableTypes.StringType),
PlayerMayLook(TrackableTypes.PlayerViewCollectionType, false),