mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- Huge update to network play
- Updated protocol: now used everywhere for type checking - No more locks between server and client: client no longer expects any replies - More code reuse - Fixed issue with location of multiple abilities selection popup menu - Improved stability; actual games should now be possible - Other updates - Mobile version player panel now uses same code as desktop - Remove automatic "view all cards" cheat in hotseat (no longer necessary) - Code cleanup
This commit is contained in:
@@ -26,10 +26,6 @@ import forge.util.FCollectionView;
|
||||
public class GameView extends TrackableObject {
|
||||
private static final long serialVersionUID = 8522884512960961528L;
|
||||
|
||||
/*private final TrackableIndex<CardView> cards = new TrackableIndex<CardView>();
|
||||
private final TrackableIndex<PlayerView> players = new TrackableIndex<PlayerView>();
|
||||
private final TrackableIndex<SpellAbilityView> spellAbilities = new TrackableIndex<SpellAbilityView>();
|
||||
private final TrackableIndex<StackItemView> stackItems = new TrackableIndex<StackItemView>();*/
|
||||
private final TrackableCollection<PlayerView> players;
|
||||
private CombatView combatView;
|
||||
private final transient Game game; //TODO: Remove this when possible before network support added
|
||||
|
||||
@@ -720,7 +720,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
||||
if (sas.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
SpellAbility tgtSA = decider.getController().getAbilityToPlay(sas);
|
||||
SpellAbility tgtSA = decider.getController().getAbilityToPlay(tgtCard, sas);
|
||||
if (!decider.getController().confirmAction(tgtSA, null, "Do you want to play " + tgtCard + "?")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
package forge.game.ability.effects;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import forge.StaticData;
|
||||
import forge.card.CardStateName;
|
||||
import forge.card.CardRulesPredicates;
|
||||
import forge.card.CardStateName;
|
||||
import forge.game.Game;
|
||||
import forge.game.ability.AbilityUtils;
|
||||
import forge.game.ability.SpellAbilityEffect;
|
||||
@@ -23,11 +28,6 @@ import forge.item.PaperCard;
|
||||
import forge.util.Aggregates;
|
||||
import forge.util.Lang;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PlayEffect extends SpellAbilityEffect {
|
||||
@Override
|
||||
protected String getStackDescription(SpellAbility sa) {
|
||||
@@ -160,13 +160,13 @@ public class PlayEffect extends SpellAbilityEffect {
|
||||
}
|
||||
Card original = tgtCard;
|
||||
if (sa.hasParam("CopyCard")) {
|
||||
Zone zone = tgtCard.getZone();
|
||||
final Zone zone = tgtCard.getZone();
|
||||
tgtCard = Card.fromPaperCard(tgtCard.getPaperCard(), sa.getActivatingPlayer());
|
||||
|
||||
tgtCard.setToken(true);
|
||||
tgtCard.setZone(zone);
|
||||
if (zone != null) {
|
||||
zone.add(tgtCard);
|
||||
zone.add(tgtCard);
|
||||
}
|
||||
|
||||
if (useEncoded) {
|
||||
@@ -197,7 +197,7 @@ public class PlayEffect extends SpellAbilityEffect {
|
||||
}
|
||||
|
||||
// only one mode can be used
|
||||
SpellAbility tgtSA = sa.getActivatingPlayer().getController().getAbilityToPlay(sas);
|
||||
SpellAbility tgtSA = sa.getActivatingPlayer().getController().getAbilityToPlay(tgtCard, sas);
|
||||
boolean noManaCost = sa.hasParam("WithoutManaCost");
|
||||
if (noManaCost) {
|
||||
tgtSA = tgtSA.copyWithNoManaCost();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package forge.game.player;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
|
||||
import forge.game.card.Card;
|
||||
@@ -10,7 +11,9 @@ import forge.game.zone.ZoneType;
|
||||
* Stores information to reveal cards after a delay unless those cards can be
|
||||
* revealed in the same dialog as cards being selected
|
||||
*/
|
||||
public class DelayedReveal {
|
||||
public class DelayedReveal implements Serializable {
|
||||
private static final long serialVersionUID = 5516713460440436615L;
|
||||
|
||||
private final Collection<CardView> cards;
|
||||
private final ZoneType zone;
|
||||
private final PlayerView owner;
|
||||
|
||||
@@ -90,8 +90,8 @@ public abstract class PlayerController {
|
||||
public Player getPlayer() { return player; }
|
||||
public LobbyPlayer getLobbyPlayer() { return lobbyPlayer; }
|
||||
|
||||
public final SpellAbility getAbilityToPlay(List<SpellAbility> abilities) { return getAbilityToPlay(abilities, null); }
|
||||
public abstract SpellAbility getAbilityToPlay(List<SpellAbility> abilities, ITriggerEvent triggerEvent);
|
||||
public final SpellAbility getAbilityToPlay(final Card hostCard, final List<SpellAbility> abilities) { return getAbilityToPlay(hostCard, abilities, null); }
|
||||
public abstract SpellAbility getAbilityToPlay(Card hostCard, List<SpellAbility> abilities, ITriggerEvent triggerEvent);
|
||||
|
||||
//public abstract void playFromSuspend(Card c);
|
||||
public abstract void playSpellAbilityForFree(SpellAbility copySA, boolean mayChoseNewTargets);
|
||||
|
||||
@@ -375,6 +375,8 @@ public class PlayerView extends GameEntityView {
|
||||
}
|
||||
public String getDetails() {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
builder.append(getName());
|
||||
builder.append('\n');
|
||||
for (final String detailsPart : getDetailsList()) {
|
||||
builder.append(detailsPart);
|
||||
builder.append('\n');
|
||||
|
||||
Reference in New Issue
Block a user