mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Update check
This commit is contained in:
@@ -254,7 +254,8 @@ public class PlayEffect extends SpellAbilityEffect {
|
||||
if (sa.hasParam("ShowCardToActivator")) {
|
||||
game.getAction().revealTo(tgtCard, activator);
|
||||
}
|
||||
|
||||
if (singleOption && sa.getTargetCard() == null)
|
||||
sa.setTargetCard(tgtCard);// show card to play rathern than showing the source card
|
||||
if (singleOption && !controller.getController().confirmAction(sa, null, Localizer.getInstance().getMessage("lblDoYouWantPlayCard", CardTranslation.getTranslatedName(tgtCard.getName())))) {
|
||||
if (wasFaceDown) {
|
||||
tgtCard.turnFaceDownNoUpdate();
|
||||
@@ -304,6 +305,7 @@ public class PlayEffect extends SpellAbilityEffect {
|
||||
|
||||
if (!sa.hasParam("CastFaceDown")) {
|
||||
// only one mode can be used
|
||||
tgtCard.setMayPlay(sa.getActivatingPlayer(), true, null, false, true, null);
|
||||
tgtSA = sa.getActivatingPlayer().getController().getAbilityToPlay(tgtCard, sas);
|
||||
} else {
|
||||
// For Illusionary Mask effect
|
||||
|
||||
@@ -3337,6 +3337,13 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public final List<Player> getMayPlayPlayers() {
|
||||
List<Player> result = Lists.newArrayList();
|
||||
for (CardPlayOption o : mayPlay.values()) {
|
||||
result.add(o.getPlayer());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public final void setMayPlay(final Player player, final boolean withoutManaCost, final Cost altManaCost, final boolean withFlash, final boolean grantZonePermissions, final StaticAbility sta) {
|
||||
this.mayPlay.put(sta, new CardPlayOption(player, sta, withoutManaCost, altManaCost, withFlash, grantZonePermissions));
|
||||
}
|
||||
|
||||
@@ -477,7 +477,10 @@ public class CardView extends GameEntityView {
|
||||
void updateNamedCard2(Card c) {
|
||||
set(TrackableProperty.NamedCard2, c.getNamedCard2());
|
||||
}
|
||||
|
||||
public boolean getMayPlayPlayers(PlayerView pv) {
|
||||
TrackableCollection<PlayerView> col = get(TrackableProperty.MayPlayPlayers);
|
||||
return col != null && col.contains(pv);
|
||||
}
|
||||
public boolean mayPlayerLook(PlayerView pv) {
|
||||
TrackableCollection<PlayerView> col = get(TrackableProperty.PlayerMayLook);
|
||||
return col != null && col.contains(pv);
|
||||
@@ -877,6 +880,11 @@ public class CardView extends GameEntityView {
|
||||
updateZoneText(c);
|
||||
updateDamage(c);
|
||||
|
||||
if (c.getMayPlayPlayers().isEmpty())
|
||||
set(TrackableProperty.MayPlayPlayers, null);
|
||||
else
|
||||
set(TrackableProperty.MayPlayPlayers, PlayerView.getCollection(c.getMayPlayPlayers()));
|
||||
|
||||
if (c.getIntensity(false) > 0) {
|
||||
updateIntensity(c);
|
||||
}
|
||||
|
||||
@@ -73,6 +73,7 @@ public enum TrackableProperty {
|
||||
NamedCard(TrackableTypes.StringType),
|
||||
NamedCard2(TrackableTypes.StringType),
|
||||
PlayerMayLook(TrackableTypes.PlayerViewCollectionType, FreezeMode.IgnoresFreeze),
|
||||
MayPlayPlayers(TrackableTypes.PlayerViewCollectionType, FreezeMode.IgnoresFreeze),
|
||||
EntityAttachedTo(TrackableTypes.GameEntityViewType),
|
||||
EncodedCards(TrackableTypes.CardViewCollectionType),
|
||||
UntilLeavesBattlefield(TrackableTypes.CardViewCollectionType),
|
||||
|
||||
Reference in New Issue
Block a user