mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28: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),
|
||||
|
||||
@@ -271,7 +271,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
public SpellAbility getAbilityToPlay(final Card hostCard, final List<SpellAbility> abilities,
|
||||
final ITriggerEvent triggerEvent) {
|
||||
// make sure another human player can't choose opponents cards just because he might see them
|
||||
if ((triggerEvent != null||GuiBase.getInterface().isLibgdxPort()) && !hostCard.isInPlay() && !hostCard.getOwner().equals(player) &&
|
||||
if (triggerEvent != null && !hostCard.isInPlay() && !hostCard.getOwner().equals(player) &&
|
||||
!hostCard.getController().equals(player) &&
|
||||
// If player cast Shaman's Trance, they can play spells from any Graveyard (if other effects allow it to be cast)
|
||||
(!player.hasKeyword("Shaman's Trance") || !hostCard.isInZone(ZoneType.Graveyard))) {
|
||||
@@ -283,9 +283,12 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
}
|
||||
}
|
||||
if (noPermission) {
|
||||
//simulate default activate action to show zoom so we don't give a hint that the selected card is a spell
|
||||
if (GuiBase.getInterface().isLibgdxPort())
|
||||
getGui().showZoom(hostCard.getView());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (!hostCard.getController().equals(player)) {
|
||||
if (!hostCard.getMayPlayPlayers().contains(player)) {
|
||||
getGui().showZoom(hostCard.getView());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user