mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- CheckStyle.
This commit is contained in:
@@ -678,17 +678,18 @@ public class CardFactorySorceries {
|
||||
else if (cardName.equals("Donate")) {
|
||||
final Target t2 = new Target(card, "Select target Player", "Player".split(","));
|
||||
class DrawbackDonate extends AbilitySub {
|
||||
public DrawbackDonate(final Card ca,final Target t) {
|
||||
super(ca,t);
|
||||
public DrawbackDonate(final Card ca, final Target t) {
|
||||
super(ca, t);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AbilitySub getCopy() {
|
||||
AbilitySub res = new DrawbackDonate(getSourceCard(),getTarget() == null ? null : new Target(getTarget()));
|
||||
CardFactoryUtil.copySpellAbility(this,res);
|
||||
AbilitySub res = new DrawbackDonate(getSourceCard(),
|
||||
getTarget() == null ? null : new Target(getTarget()));
|
||||
CardFactoryUtil.copySpellAbility(this, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
private static final long serialVersionUID = 4618047889933691050L;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -845,11 +845,12 @@ public class CardFactoryUtil {
|
||||
final Cost cost = new Cost(sourceCard, manaCost, true);
|
||||
class AbilityUnearth extends AbilityActivated {
|
||||
public AbilityUnearth(final Card ca, final Cost co, final Target t) {
|
||||
super(ca,co,t);
|
||||
super(ca, co, t);
|
||||
}
|
||||
|
||||
|
||||
public AbilityActivated getCopy() {
|
||||
AbilityActivated res = new AbilityUnearth(getSourceCard(),getPayCosts(),getTarget() == null ? null : new Target(getTarget()));
|
||||
AbilityActivated res = new AbilityUnearth(getSourceCard(),
|
||||
getPayCosts(), getTarget() == null ? null : new Target(getTarget()));
|
||||
CardFactoryUtil.copySpellAbility(this, res);
|
||||
final SpellAbilityRestriction restrict = new SpellAbilityRestriction();
|
||||
restrict.setZone(ZoneType.Graveyard);
|
||||
@@ -857,7 +858,7 @@ public class CardFactoryUtil {
|
||||
res.setRestrictions(restrict);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
private static final long serialVersionUID = -5633945565395478009L;
|
||||
|
||||
@Override
|
||||
@@ -879,7 +880,7 @@ public class CardFactoryUtil {
|
||||
}
|
||||
}
|
||||
final AbilityActivated unearth = new AbilityUnearth(sourceCard, cost, null);
|
||||
|
||||
|
||||
final SpellAbilityRestriction restrict = new SpellAbilityRestriction();
|
||||
restrict.setZone(ZoneType.Graveyard);
|
||||
restrict.setSorcerySpeed(true);
|
||||
@@ -917,8 +918,9 @@ public class CardFactoryUtil {
|
||||
@Override
|
||||
public boolean canPlay() {
|
||||
//Lands do not have SpellPermanents.
|
||||
if(sourceCard.isLand()) {
|
||||
return (AllZone.getZoneOf(sourceCard).is(ZoneType.Hand) || sourceCard.hasKeyword("May be played") ) && PhaseHandler.canCastSorcery(sourceCard.getController());
|
||||
if (sourceCard.isLand()) {
|
||||
return (AllZone.getZoneOf(sourceCard).is(ZoneType.Hand) || sourceCard.hasKeyword("May be played"))
|
||||
&& PhaseHandler.canCastSorcery(sourceCard.getController());
|
||||
}
|
||||
else {
|
||||
return sourceCard.getSpellPermanent().canPlay();
|
||||
@@ -1064,16 +1066,17 @@ public class CardFactoryUtil {
|
||||
final Cost abCost = new Cost(sourceCard, transmuteCost, true);
|
||||
class AbilityTransmute extends AbilityActivated {
|
||||
public AbilityTransmute(final Card ca, final Cost co, final Target t) {
|
||||
super(ca,co,t);
|
||||
super(ca, co, t);
|
||||
}
|
||||
|
||||
|
||||
public AbilityActivated getCopy() {
|
||||
AbilityActivated res = new AbilityTransmute(getSourceCard(),getPayCosts(),getTarget() == null ? null : new Target(getTarget()));
|
||||
AbilityActivated res = new AbilityTransmute(getSourceCard(),
|
||||
getPayCosts(), getTarget() == null ? null : new Target(getTarget()));
|
||||
CardFactoryUtil.copySpellAbility(this, res);
|
||||
res.getRestrictions().setZone(ZoneType.Hand);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
private static final long serialVersionUID = -4960704261761785512L;
|
||||
|
||||
@Override
|
||||
@@ -1115,7 +1118,7 @@ public class CardFactoryUtil {
|
||||
}
|
||||
}
|
||||
final SpellAbility transmute = new AbilityTransmute(sourceCard, abCost, null);
|
||||
|
||||
|
||||
final StringBuilder sbDesc = new StringBuilder();
|
||||
sbDesc.append("Transmute (").append(abCost.toString());
|
||||
sbDesc.append("Search your library for a card with the same converted mana cost as this card, reveal it, ");
|
||||
@@ -1209,15 +1212,16 @@ public class CardFactoryUtil {
|
||||
"Creature.YouCtrl".split(","));
|
||||
class AbilityEquip extends AbilityActivated {
|
||||
public AbilityEquip(final Card ca, final Cost co, final Target t) {
|
||||
super(ca,co,t);
|
||||
super(ca, co, t);
|
||||
}
|
||||
|
||||
|
||||
public AbilityActivated getCopy() {
|
||||
AbilityActivated res = new AbilityEquip(getSourceCard(),getPayCosts(),getTarget() == null ? null : new Target(getTarget()));
|
||||
AbilityActivated res = new AbilityEquip(getSourceCard(),
|
||||
getPayCosts(), getTarget() == null ? null : new Target(getTarget()));
|
||||
CardFactoryUtil.copySpellAbility(this, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
private static final long serialVersionUID = -4960704261761785512L;
|
||||
|
||||
@Override
|
||||
@@ -1300,7 +1304,7 @@ public class CardFactoryUtil {
|
||||
} // getCreature()
|
||||
}
|
||||
final SpellAbility equip = new AbilityEquip(sourceCard, abCost, target); // equip ability
|
||||
|
||||
|
||||
String costDesc = abCost.toString();
|
||||
// get rid of the ": " at the end
|
||||
costDesc = costDesc.substring(0, costDesc.length() - 2);
|
||||
@@ -3925,37 +3929,37 @@ public class CardFactoryUtil {
|
||||
to.setStaticAbilityStrings(from.getStaticAbilityStrings());
|
||||
|
||||
}
|
||||
|
||||
public static void copySpellAbility(SpellAbility from,SpellAbility to) {
|
||||
|
||||
public static void copySpellAbility(SpellAbility from, SpellAbility to) {
|
||||
to.setDescription(from.getDescription());
|
||||
to.setStackDescription(from.getDescription());
|
||||
if(from.getAbilityFactory() != null) {
|
||||
if (from.getAbilityFactory() != null) {
|
||||
to.setAbilityFactory(new AbilityFactory(from.getAbilityFactory()));
|
||||
}
|
||||
if(from.getSubAbility() != null) {
|
||||
if (from.getSubAbility() != null) {
|
||||
to.setSubAbility(from.getSubAbility().getCopy());
|
||||
}
|
||||
if(from.getRestrictions() != null) {
|
||||
if (from.getRestrictions() != null) {
|
||||
to.setRestrictions(from.getRestrictions());
|
||||
}
|
||||
if(from.getConditions() != null) {
|
||||
if (from.getConditions() != null) {
|
||||
to.setConditions(from.getConditions());
|
||||
}
|
||||
|
||||
for(String sVar : from.getSVars()) {
|
||||
|
||||
for (String sVar : from.getSVars()) {
|
||||
to.setSVar(sVar, from.getSVar(sVar));
|
||||
}
|
||||
}
|
||||
|
||||
public static void correctAbilityChainSourceCard(final SpellAbility sa, final Card card)
|
||||
{
|
||||
|
||||
public static void correctAbilityChainSourceCard(final SpellAbility sa, final Card card) {
|
||||
|
||||
sa.setSourceCard(card);
|
||||
if(sa.getAbilityFactory() != null)
|
||||
{
|
||||
if (sa.getAbilityFactory() != null) {
|
||||
|
||||
sa.getAbilityFactory().setHostCard(card);
|
||||
}
|
||||
if(sa.getSubAbility() != null)
|
||||
{
|
||||
if (sa.getSubAbility() != null) {
|
||||
|
||||
correctAbilityChainSourceCard(sa.getSubAbility(), card);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,9 +48,9 @@ public class Cost {
|
||||
public final ArrayList<CostPart> getCostParts() {
|
||||
return this.costParts;
|
||||
}
|
||||
|
||||
|
||||
private SpellAbility assocSA = null;
|
||||
|
||||
|
||||
public void setSpellAbility(final SpellAbility sa) {
|
||||
assocSA = sa;
|
||||
}
|
||||
|
||||
@@ -73,14 +73,14 @@ public abstract class AbilityActivated extends SpellAbility implements java.io.S
|
||||
if ((tgt != null) && tgt.doesTarget()) {
|
||||
this.setTarget(tgt);
|
||||
}
|
||||
|
||||
|
||||
this.getPayCosts().setSpellAbility(this);
|
||||
}
|
||||
|
||||
public abstract AbilityActivated getCopy();/* {
|
||||
|
||||
public abstract AbilityActivated getCopy(); /* {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean canPlay() {
|
||||
|
||||
@@ -74,10 +74,10 @@ public class AbilityMana extends AbilityActivated implements java.io.Serializabl
|
||||
public AbilityMana(final Card sourceCard, final String parse, final String produced) {
|
||||
this(sourceCard, parse, produced, 1);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AbilityActivated getCopy() {
|
||||
AbilityActivated res = new AbilityMana(getSourceCard(),getPayCosts(),getManaProduced());
|
||||
AbilityActivated res = new AbilityMana(getSourceCard(), getPayCosts(), getManaProduced());
|
||||
CardFactoryUtil.copySpellAbility(this, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public abstract class AbilitySub extends SpellAbility implements java.io.Seriali
|
||||
* @return a boolean.
|
||||
*/
|
||||
public abstract boolean chkAIDrawback();
|
||||
|
||||
|
||||
public abstract AbilitySub getCopy();
|
||||
|
||||
/** {@inheritDoc} */
|
||||
|
||||
@@ -127,17 +127,17 @@ public abstract class SpellAbility {
|
||||
};
|
||||
|
||||
private CardList tappedForConvoke = new CardList();
|
||||
|
||||
private HashMap<String,String> sVars = new HashMap<String,String>();
|
||||
|
||||
|
||||
private HashMap<String, String> sVars = new HashMap<String, String>();
|
||||
|
||||
public final String getSVar(final String name) {
|
||||
return sVars.get(name) != null ? sVars.get(name) : "";
|
||||
}
|
||||
|
||||
|
||||
public final void setSVar(final String name, final String value) {
|
||||
sVars.put(name,value);
|
||||
sVars.put(name, value);
|
||||
}
|
||||
|
||||
|
||||
public Set<String> getSVars() {
|
||||
return sVars.keySet();
|
||||
}
|
||||
|
||||
@@ -397,9 +397,9 @@ public class StaticAbility {
|
||||
if (mode.equals("ETBTapped")) {
|
||||
return StaticAbilityETBTapped.applyETBTappedAbility(this, card);
|
||||
}
|
||||
|
||||
|
||||
if (mode.equals("GainAbilitiesOf")) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -79,7 +79,7 @@ public class StaticAbilityContinuous {
|
||||
String[] removeTypes = null;
|
||||
String addColors = null;
|
||||
String[] addTriggers = null;
|
||||
ArrayList<SpellAbility> addFullAbs = null;
|
||||
ArrayList<SpellAbility> addFullAbs = null;
|
||||
boolean removeAllAbilities = false;
|
||||
boolean removeSuperTypes = false;
|
||||
boolean removeCardTypes = false;
|
||||
@@ -217,30 +217,30 @@ public class StaticAbilityContinuous {
|
||||
}
|
||||
addTriggers = sVars;
|
||||
}
|
||||
|
||||
|
||||
if (params.containsKey("GainsAbilitiesOf")) {
|
||||
final String[] valids = params.get("GainsAbilitiesOf").split(",");
|
||||
ArrayList<ZoneType> validZones = new ArrayList<ZoneType>();
|
||||
validZones.add(ZoneType.Battlefield);
|
||||
if(params.containsKey("GainsAbilitiesOfZones")) {
|
||||
if (params.containsKey("GainsAbilitiesOfZones")) {
|
||||
validZones.clear();
|
||||
for(String s : params.get("GainsAbilitiesOfZones").split(",")) {
|
||||
for (String s : params.get("GainsAbilitiesOfZones").split(",")) {
|
||||
validZones.add(ZoneType.smartValueOf(s));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CardList cardsIGainedAbilitiesFrom = AllZoneUtil.getCardsIn(validZones);
|
||||
cardsIGainedAbilitiesFrom = cardsIGainedAbilitiesFrom.getValidCards(valids, hostCard.getController(), hostCard);
|
||||
|
||||
if(cardsIGainedAbilitiesFrom.size() > 0)
|
||||
{
|
||||
|
||||
if (cardsIGainedAbilitiesFrom.size() > 0) {
|
||||
|
||||
addFullAbs = new ArrayList<SpellAbility>();
|
||||
|
||||
for(Card c : cardsIGainedAbilitiesFrom) {
|
||||
for(SpellAbility sa : c.getSpellAbilities()) {
|
||||
if(sa instanceof AbilityActivated) {
|
||||
SpellAbility newSA = ((AbilityActivated)sa).getCopy();
|
||||
if(newSA == null) {
|
||||
|
||||
for (Card c : cardsIGainedAbilitiesFrom) {
|
||||
for (SpellAbility sa : c.getSpellAbilities()) {
|
||||
if (sa instanceof AbilityActivated) {
|
||||
SpellAbility newSA = ((AbilityActivated) sa).getCopy();
|
||||
if (newSA == null) {
|
||||
System.out.println("Uh-oh...");
|
||||
}
|
||||
newSA.setType("Temporary");
|
||||
@@ -330,9 +330,9 @@ public class StaticAbilityContinuous {
|
||||
affectedCard.setSVar(name, actualSVar);
|
||||
}
|
||||
}
|
||||
|
||||
if(addFullAbs != null) {
|
||||
for(final SpellAbility ab : addFullAbs) {
|
||||
|
||||
if (addFullAbs != null) {
|
||||
for (final SpellAbility ab : addFullAbs) {
|
||||
affectedCard.addSpellAbility(ab);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -768,23 +768,23 @@ public final class GuiDisplayUtil {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void devModeBreakpoint() {
|
||||
List<Player> Players = AllZone.getPlayersInGame();
|
||||
|
||||
|
||||
Combat CombatHandler = AllZone.getCombat();
|
||||
|
||||
|
||||
TriggerHandler Triggers = AllZone.getTriggerHandler();
|
||||
|
||||
|
||||
InputControl InputHandler = AllZone.getInputControl();
|
||||
|
||||
|
||||
ReplacementHandler Replacements = AllZone.getReplacementHandler();
|
||||
|
||||
|
||||
StaticEffects StaticHandler = AllZone.getStaticEffects();
|
||||
|
||||
|
||||
List<PlayerZone> Zones = new ArrayList<PlayerZone>();
|
||||
for(Player p : Players)
|
||||
{
|
||||
for (Player p : Players) {
|
||||
|
||||
Zones.add(p.getZone(ZoneType.Ante));
|
||||
Zones.add(p.getZone(ZoneType.Battlefield));
|
||||
Zones.add(p.getZone(ZoneType.Command));
|
||||
@@ -795,7 +795,7 @@ public final class GuiDisplayUtil {
|
||||
Zones.add(p.getZone(ZoneType.Sideboard));
|
||||
Zones.add(p.getZone(ZoneType.Stack));
|
||||
}
|
||||
|
||||
|
||||
//Set a breakpoint on the following statement
|
||||
System.out.println("Manual Breakpoint");
|
||||
}
|
||||
|
||||
@@ -110,13 +110,13 @@ public enum VSubmenuQuestData implements IVSubmenu {
|
||||
group2.add(radClassic);
|
||||
radClassic.setSelected(true);
|
||||
*/
|
||||
|
||||
|
||||
// TODO: Convert this to non-hardcoded info
|
||||
cbxFormat.removeAllItems();
|
||||
cbxFormat.addItem("Standard");
|
||||
cbxFormat.addItem("Extended");
|
||||
cbxFormat.addItem("Modern");
|
||||
|
||||
|
||||
final ActionListener preconListener = new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent actionEvent) {
|
||||
@@ -164,12 +164,12 @@ public enum VSubmenuQuestData implements IVSubmenu {
|
||||
radPreconStart.addActionListener(preconListener);
|
||||
radCompleteStart.setSelected(true);
|
||||
cbxPrecon.setEnabled(false);
|
||||
|
||||
|
||||
radMedium.setEnabled(true);
|
||||
// Fantasy box is Enabled by Default
|
||||
boxFantasy.setSelected(true);
|
||||
boxFantasy.setEnabled(true);
|
||||
|
||||
|
||||
final JPanel pnlOptions = new JPanel();
|
||||
pnlOptions.setOpaque(false);
|
||||
pnlOptions.setLayout(new MigLayout("insets 0, gap 0"));
|
||||
@@ -292,7 +292,7 @@ public enum VSubmenuQuestData implements IVSubmenu {
|
||||
public String getPrecon() {
|
||||
return (String) cbxPrecon.getSelectedItem();
|
||||
}
|
||||
|
||||
|
||||
/** @return {@link java.lang.String} */
|
||||
public String getFormat() {
|
||||
return (String) cbxFormat.getSelectedItem();
|
||||
|
||||
Reference in New Issue
Block a user