mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- CheckStyle.
This commit is contained in:
@@ -678,14 +678,15 @@ 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
@@ -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,11 +1066,12 @@ 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;
|
||||
@@ -1209,11 +1212,12 @@ 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;
|
||||
}
|
||||
@@ -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.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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public abstract class AbilityActivated extends SpellAbility implements java.io.S
|
||||
this.getPayCosts().setSpellAbility(this);
|
||||
}
|
||||
|
||||
public abstract AbilityActivated getCopy();/* {
|
||||
public abstract AbilityActivated getCopy(); /* {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ public class AbilityMana extends AbilityActivated implements java.io.Serializabl
|
||||
|
||||
@Override
|
||||
public AbilityActivated getCopy() {
|
||||
AbilityActivated res = new AbilityMana(getSourceCard(),getPayCosts(),getManaProduced());
|
||||
AbilityActivated res = new AbilityMana(getSourceCard(), getPayCosts(), getManaProduced());
|
||||
CardFactoryUtil.copySpellAbility(this, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -128,14 +128,14 @@ 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() {
|
||||
|
||||
@@ -222,9 +222,9 @@ public class StaticAbilityContinuous {
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -232,15 +232,15 @@ public class StaticAbilityContinuous {
|
||||
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");
|
||||
@@ -331,8 +331,8 @@ public class StaticAbilityContinuous {
|
||||
}
|
||||
}
|
||||
|
||||
if(addFullAbs != null) {
|
||||
for(final SpellAbility ab : addFullAbs) {
|
||||
if (addFullAbs != null) {
|
||||
for (final SpellAbility ab : addFullAbs) {
|
||||
affectedCard.addSpellAbility(ab);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -783,8 +783,8 @@ public final class GuiDisplayUtil {
|
||||
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));
|
||||
|
||||
Reference in New Issue
Block a user