mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
- CheckStyle.
This commit is contained in:
@@ -678,14 +678,15 @@ public class CardFactorySorceries {
|
|||||||
else if (cardName.equals("Donate")) {
|
else if (cardName.equals("Donate")) {
|
||||||
final Target t2 = new Target(card, "Select target Player", "Player".split(","));
|
final Target t2 = new Target(card, "Select target Player", "Player".split(","));
|
||||||
class DrawbackDonate extends AbilitySub {
|
class DrawbackDonate extends AbilitySub {
|
||||||
public DrawbackDonate(final Card ca,final Target t) {
|
public DrawbackDonate(final Card ca, final Target t) {
|
||||||
super(ca,t);
|
super(ca, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AbilitySub getCopy() {
|
public AbilitySub getCopy() {
|
||||||
AbilitySub res = new DrawbackDonate(getSourceCard(),getTarget() == null ? null : new Target(getTarget()));
|
AbilitySub res = new DrawbackDonate(getSourceCard(),
|
||||||
CardFactoryUtil.copySpellAbility(this,res);
|
getTarget() == null ? null : new Target(getTarget()));
|
||||||
|
CardFactoryUtil.copySpellAbility(this, res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -845,11 +845,12 @@ public class CardFactoryUtil {
|
|||||||
final Cost cost = new Cost(sourceCard, manaCost, true);
|
final Cost cost = new Cost(sourceCard, manaCost, true);
|
||||||
class AbilityUnearth extends AbilityActivated {
|
class AbilityUnearth extends AbilityActivated {
|
||||||
public AbilityUnearth(final Card ca, final Cost co, final Target t) {
|
public AbilityUnearth(final Card ca, final Cost co, final Target t) {
|
||||||
super(ca,co,t);
|
super(ca, co, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AbilityActivated getCopy() {
|
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);
|
CardFactoryUtil.copySpellAbility(this, res);
|
||||||
final SpellAbilityRestriction restrict = new SpellAbilityRestriction();
|
final SpellAbilityRestriction restrict = new SpellAbilityRestriction();
|
||||||
restrict.setZone(ZoneType.Graveyard);
|
restrict.setZone(ZoneType.Graveyard);
|
||||||
@@ -917,8 +918,9 @@ public class CardFactoryUtil {
|
|||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
//Lands do not have SpellPermanents.
|
//Lands do not have SpellPermanents.
|
||||||
if(sourceCard.isLand()) {
|
if (sourceCard.isLand()) {
|
||||||
return (AllZone.getZoneOf(sourceCard).is(ZoneType.Hand) || sourceCard.hasKeyword("May be played") ) && PhaseHandler.canCastSorcery(sourceCard.getController());
|
return (AllZone.getZoneOf(sourceCard).is(ZoneType.Hand) || sourceCard.hasKeyword("May be played"))
|
||||||
|
&& PhaseHandler.canCastSorcery(sourceCard.getController());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return sourceCard.getSpellPermanent().canPlay();
|
return sourceCard.getSpellPermanent().canPlay();
|
||||||
@@ -1064,11 +1066,12 @@ public class CardFactoryUtil {
|
|||||||
final Cost abCost = new Cost(sourceCard, transmuteCost, true);
|
final Cost abCost = new Cost(sourceCard, transmuteCost, true);
|
||||||
class AbilityTransmute extends AbilityActivated {
|
class AbilityTransmute extends AbilityActivated {
|
||||||
public AbilityTransmute(final Card ca, final Cost co, final Target t) {
|
public AbilityTransmute(final Card ca, final Cost co, final Target t) {
|
||||||
super(ca,co,t);
|
super(ca, co, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AbilityActivated getCopy() {
|
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);
|
CardFactoryUtil.copySpellAbility(this, res);
|
||||||
res.getRestrictions().setZone(ZoneType.Hand);
|
res.getRestrictions().setZone(ZoneType.Hand);
|
||||||
return res;
|
return res;
|
||||||
@@ -1209,11 +1212,12 @@ public class CardFactoryUtil {
|
|||||||
"Creature.YouCtrl".split(","));
|
"Creature.YouCtrl".split(","));
|
||||||
class AbilityEquip extends AbilityActivated {
|
class AbilityEquip extends AbilityActivated {
|
||||||
public AbilityEquip(final Card ca, final Cost co, final Target t) {
|
public AbilityEquip(final Card ca, final Cost co, final Target t) {
|
||||||
super(ca,co,t);
|
super(ca, co, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AbilityActivated getCopy() {
|
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);
|
CardFactoryUtil.copySpellAbility(this, res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -3926,36 +3930,36 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void copySpellAbility(SpellAbility from,SpellAbility to) {
|
public static void copySpellAbility(SpellAbility from, SpellAbility to) {
|
||||||
to.setDescription(from.getDescription());
|
to.setDescription(from.getDescription());
|
||||||
to.setStackDescription(from.getDescription());
|
to.setStackDescription(from.getDescription());
|
||||||
if(from.getAbilityFactory() != null) {
|
if (from.getAbilityFactory() != null) {
|
||||||
to.setAbilityFactory(new AbilityFactory(from.getAbilityFactory()));
|
to.setAbilityFactory(new AbilityFactory(from.getAbilityFactory()));
|
||||||
}
|
}
|
||||||
if(from.getSubAbility() != null) {
|
if (from.getSubAbility() != null) {
|
||||||
to.setSubAbility(from.getSubAbility().getCopy());
|
to.setSubAbility(from.getSubAbility().getCopy());
|
||||||
}
|
}
|
||||||
if(from.getRestrictions() != null) {
|
if (from.getRestrictions() != null) {
|
||||||
to.setRestrictions(from.getRestrictions());
|
to.setRestrictions(from.getRestrictions());
|
||||||
}
|
}
|
||||||
if(from.getConditions() != null) {
|
if (from.getConditions() != null) {
|
||||||
to.setConditions(from.getConditions());
|
to.setConditions(from.getConditions());
|
||||||
}
|
}
|
||||||
|
|
||||||
for(String sVar : from.getSVars()) {
|
for (String sVar : from.getSVars()) {
|
||||||
to.setSVar(sVar, from.getSVar(sVar));
|
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);
|
sa.setSourceCard(card);
|
||||||
if(sa.getAbilityFactory() != null)
|
if (sa.getAbilityFactory() != null) {
|
||||||
{
|
|
||||||
sa.getAbilityFactory().setHostCard(card);
|
sa.getAbilityFactory().setHostCard(card);
|
||||||
}
|
}
|
||||||
if(sa.getSubAbility() != null)
|
if (sa.getSubAbility() != null) {
|
||||||
{
|
|
||||||
correctAbilityChainSourceCard(sa.getSubAbility(), card);
|
correctAbilityChainSourceCard(sa.getSubAbility(), card);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public abstract class AbilityActivated extends SpellAbility implements java.io.S
|
|||||||
this.getPayCosts().setSpellAbility(this);
|
this.getPayCosts().setSpellAbility(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract AbilityActivated getCopy();/* {
|
public abstract AbilityActivated getCopy(); /* {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public class AbilityMana extends AbilityActivated implements java.io.Serializabl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AbilityActivated getCopy() {
|
public AbilityActivated getCopy() {
|
||||||
AbilityActivated res = new AbilityMana(getSourceCard(),getPayCosts(),getManaProduced());
|
AbilityActivated res = new AbilityMana(getSourceCard(), getPayCosts(), getManaProduced());
|
||||||
CardFactoryUtil.copySpellAbility(this, res);
|
CardFactoryUtil.copySpellAbility(this, res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,14 +128,14 @@ public abstract class SpellAbility {
|
|||||||
|
|
||||||
private CardList tappedForConvoke = new CardList();
|
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) {
|
public final String getSVar(final String name) {
|
||||||
return sVars.get(name) != null ? sVars.get(name) : "";
|
return sVars.get(name) != null ? sVars.get(name) : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setSVar(final String name, final String value) {
|
public final void setSVar(final String name, final String value) {
|
||||||
sVars.put(name,value);
|
sVars.put(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<String> getSVars() {
|
public Set<String> getSVars() {
|
||||||
|
|||||||
@@ -222,9 +222,9 @@ public class StaticAbilityContinuous {
|
|||||||
final String[] valids = params.get("GainsAbilitiesOf").split(",");
|
final String[] valids = params.get("GainsAbilitiesOf").split(",");
|
||||||
ArrayList<ZoneType> validZones = new ArrayList<ZoneType>();
|
ArrayList<ZoneType> validZones = new ArrayList<ZoneType>();
|
||||||
validZones.add(ZoneType.Battlefield);
|
validZones.add(ZoneType.Battlefield);
|
||||||
if(params.containsKey("GainsAbilitiesOfZones")) {
|
if (params.containsKey("GainsAbilitiesOfZones")) {
|
||||||
validZones.clear();
|
validZones.clear();
|
||||||
for(String s : params.get("GainsAbilitiesOfZones").split(",")) {
|
for (String s : params.get("GainsAbilitiesOfZones").split(",")) {
|
||||||
validZones.add(ZoneType.smartValueOf(s));
|
validZones.add(ZoneType.smartValueOf(s));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -232,15 +232,15 @@ public class StaticAbilityContinuous {
|
|||||||
CardList cardsIGainedAbilitiesFrom = AllZoneUtil.getCardsIn(validZones);
|
CardList cardsIGainedAbilitiesFrom = AllZoneUtil.getCardsIn(validZones);
|
||||||
cardsIGainedAbilitiesFrom = cardsIGainedAbilitiesFrom.getValidCards(valids, hostCard.getController(), hostCard);
|
cardsIGainedAbilitiesFrom = cardsIGainedAbilitiesFrom.getValidCards(valids, hostCard.getController(), hostCard);
|
||||||
|
|
||||||
if(cardsIGainedAbilitiesFrom.size() > 0)
|
if (cardsIGainedAbilitiesFrom.size() > 0) {
|
||||||
{
|
|
||||||
addFullAbs = new ArrayList<SpellAbility>();
|
addFullAbs = new ArrayList<SpellAbility>();
|
||||||
|
|
||||||
for(Card c : cardsIGainedAbilitiesFrom) {
|
for (Card c : cardsIGainedAbilitiesFrom) {
|
||||||
for(SpellAbility sa : c.getSpellAbilities()) {
|
for (SpellAbility sa : c.getSpellAbilities()) {
|
||||||
if(sa instanceof AbilityActivated) {
|
if (sa instanceof AbilityActivated) {
|
||||||
SpellAbility newSA = ((AbilityActivated)sa).getCopy();
|
SpellAbility newSA = ((AbilityActivated) sa).getCopy();
|
||||||
if(newSA == null) {
|
if (newSA == null) {
|
||||||
System.out.println("Uh-oh...");
|
System.out.println("Uh-oh...");
|
||||||
}
|
}
|
||||||
newSA.setType("Temporary");
|
newSA.setType("Temporary");
|
||||||
@@ -331,8 +331,8 @@ public class StaticAbilityContinuous {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(addFullAbs != null) {
|
if (addFullAbs != null) {
|
||||||
for(final SpellAbility ab : addFullAbs) {
|
for (final SpellAbility ab : addFullAbs) {
|
||||||
affectedCard.addSpellAbility(ab);
|
affectedCard.addSpellAbility(ab);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -783,8 +783,8 @@ public final class GuiDisplayUtil {
|
|||||||
StaticEffects StaticHandler = AllZone.getStaticEffects();
|
StaticEffects StaticHandler = AllZone.getStaticEffects();
|
||||||
|
|
||||||
List<PlayerZone> Zones = new ArrayList<PlayerZone>();
|
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.Ante));
|
||||||
Zones.add(p.getZone(ZoneType.Battlefield));
|
Zones.add(p.getZone(ZoneType.Battlefield));
|
||||||
Zones.add(p.getZone(ZoneType.Command));
|
Zones.add(p.getZone(ZoneType.Command));
|
||||||
|
|||||||
Reference in New Issue
Block a user