Page 3 of 3

Re: MTGForge 10/07 (unofficial BETA) version

PostPosted: 12 Oct 2009, 02:39
by DennisBergkamp
He's talking about Breeding Pool, etc. ... I've fixed those in my local version.

Re: MTGForge 10/07 (unofficial BETA) version

PostPosted: 12 Oct 2009, 02:49
by zerker2000
Oh, the clearSpellAbility problem?

Re: MTGForge 10/07 (unofficial BETA) version

PostPosted: 12 Oct 2009, 03:04
by DennisBergkamp
Yeah, those I fixed with an added method in Card.java called clearSpellKeepManaAbility() (bit of a lame name, I know), which just does "spellAbility.clear()".

The whole Gemhide Sliver / Joiner Adept thing I got working through this hack:

SpellAbility.java:

Code: Select all
  public boolean isIntrinsic()
  {
     return type.equals("Intrinsic");
  }
  public boolean isExtrinsic()
  {
     return type.equals("Extrinsic");
  }
 
  public void setType(String s) //Extrinsic or Intrinsic:
  {
     type = s;
  }
Card.java

Code: Select all
 public void removeAllExtrinsicManaAbilities()
  {    
     //temp ArrayList, otherwise ConcurrentModificationExceptions occur:
     ArrayList<SpellAbility> saList = new ArrayList<SpellAbility>();
   
     for (SpellAbility var : manaAbility)
     {
        if(var.isExtrinsic())
           saList.add(var);
     }
     for (SpellAbility sa : saList)
     {
        removeSpellAbility(sa);
     }
  }
 
  public ArrayList<String> getIntrinsicManaAbilitiesDescriptions()
  {
     ArrayList<String> list = new ArrayList<String>();
     for (SpellAbility var : manaAbility)
     {
        if (var.isIntrinsic())
           list.add(var.toString());
     }
     return list;
  }
GameActionUtil.java:

Code: Select all
public static Command Gemhide_Sliver = new Command()
   {
      private static final long serialVersionUID = -2941784982910968772L;

      CardList gloriousAnthemList = new CardList();

      String[] keyword =
      { "tap: add B", "tap: add W", "tap: add G", "tap: add U", "tap: add R" };

      final void addMana(Card c)
      {
         
         for (int i = 0; i < keyword.length; i++){
            if (!c.getIntrinsicManaAbilitiesDescriptions().contains(keyword[i])) {
               //c.addExtrinsicKeyword(keyword[i]);
               SpellAbility mana = new Ability_Mana(c, keyword[i])
               {
                  private static final long serialVersionUID = -8909660504657778172L;               
               };
               mana.setType("Extrinsic");
               c.addSpellAbility(mana);
            }
         }
      }

      final void removeMana(Card c)
      {
         /*
         for (int i = 0; i < keyword.length; i++)
            c.removeExtrinsicKeyword(keyword[i]);
         */
         c.removeAllExtrinsicManaAbilities();
      }
.....
and

Code: Select all
public static Command Joiner_Adept = new Command()
   {
      private static final long serialVersionUID = -2543659953307485051L;

      CardList gloriousAnthemList = new CardList();

      String[] keyword =
      { "tap: add B", "tap: add W", "tap: add G", "tap: add U", "tap: add R" };

      final void addMana(Card c)
      {
         for (int i = 0; i < keyword.length; i++)
         {
            //don't add an extrinsic mana ability if the land can already has the same intrinsic mana ability
            //eg. "tap: add G"
            if (!c.getIntrinsicManaAbilitiesDescriptions().contains(keyword[i]))
            {
               //c.addExtrinsicKeyword(keyword[i]);
               SpellAbility mana = new Ability_Mana(c, keyword[i])
               {
                  private static final long serialVersionUID = 2384540533244132975L;            
               };
               
               mana.setType("Extrinsic");
               c.addSpellAbility(mana);
            }
         }
      }

      final void removeMana(Card c)
      {
         
         /*
         for (int i = 0; i < keyword.length; i++)
            c.removeExtrinsicKeyword(keyword[i]);
         */
         c.removeAllExtrinsicManaAbilities();
      }
...
Which is all very ugly :oops:
But it seems to work for all cases I've tested with Joiner Adept and Gemhide Sliver.

Re: MTGForge 10/07 (unofficial BETA) version

PostPosted: 12 Oct 2009, 03:09
by kingbob
By manlands I mean Ghitu Encampment and the other lands that become creatures from Urza's Legacy. For some reason they and the lands that "come into play tapped unless you pay 2 life" from Ravnica, don't contain the text "Add X to your mana pool"

Re: MTGForge 10/07 (unofficial BETA) version

PostPosted: 12 Oct 2009, 04:41
by zerker2000
Ouch, quite ugly :(. Seriously, wouldn't adding "boolean extrinsicUtopism=false;"(first name that comes to mind) and setExtrinsicUtopism(boolean){extrinsicUtopism = boolean;} to card, replacing card.getManaAbility with
Code: Select all
{
  ArrayList<Ability_Mana> res = new ArrayList<Ability_Mana>(abilityMana);
  if(extrinsicUtopism)
    for (char ch : ManaPool.colors.toCharArray())
      res.add(new Ability_Mana(this, "tap: add " + ch){});
  return res;
}
and putting appropriate setExtrinsicUtopisms in addMana and removeMana do the trick?

Re: MTGForge 10/07 (unofficial BETA) version

PostPosted: 12 Oct 2009, 05:39
by DennisBergkamp
Hmm, possibly, I don't know.
I don't understand completely, could you try this?

I tried a bunch of things that I thought should work, but I kept having to add more and more hacks to actually make it work :)

Re: MTGForge 10/07 (unofficial BETA) version

PostPosted: 12 Oct 2009, 06:14
by zerker2000
It's worked so far for me, what cases were you talking about? Edits are as follows:
Card.java
Code: Select all
<  public ArrayList<Ability_Mana> getManaAbility(){return new ArrayList<Ability_Mana>(manaAbility);}

>  boolean extrinsicBasics=false;
>  void setExtrinsicBasics(boolean value){extrinsicBasics = value;}

>  public ArrayList<Ability_Mana> getManaAbility()
>  {
>     ArrayList<Ability_Mana> res = new arrayList<Ability_Mana>(manaAbility);
>     if(extrinsicBasics)
>       for (char ch : ManaPool.colors.toCharArray())
>         res.add(new Ability_Mana(this, "tap: add " + ch){});
>     return res;
>  }
GameActionUtil 2x
Code: Select all
>      /*
      String[] keyword =
      { "tap: add B", "tap: add W", "tap: add G", "tap: add U", "tap: add R" };
>      */

      final void addMana(Card c)
      {
>         /*
         for (int i = 0; i < keyword.length; i++)
            c.addExtrinsicKeyword(keyword[i]);
>         */
>         c.setExtrinsicBasics(true);
      }

      final void removeMana(Card c)
      {
>         /*
         for (int i = 0; i < keyword.length; i++)
            c.removeExtrinsicKeyword(keyword[i]);
>         */
>         c.setExtrinsicBasics(false);
      }

Re: MTGForge 10/07 (unofficial BETA) version

PostPosted: 12 Oct 2009, 06:43
by DennisBergkamp
Nice! This seems to work alright, but there's still some funny stuff going on: there end up being some duplicate mana abilities (see screenshot), do you know an easy way around this?

The main problem I had when I was messing around with this, was that whenever the Joiner Adept would leave play, the original (intrinsic) mana ability of the land would disappear also.
Anyway, that all works fine in this case.

Re: MTGForge 10/07 (unofficial BETA) version

PostPosted: 12 Oct 2009, 20:28
by DennisBergkamp
By the way, I just realized that I might have compiled this version in 1.6 :oops:

The next will definitely be 1.5, did you guys have any trouble running this version?

Re: MTGForge 10/07 (unofficial BETA) version

PostPosted: 13 Oct 2009, 13:59
by cyclope
I can't run this version with my macbook and java 1.5...

I think i'll have to re-compile it with Eclipse...

Re: MTGForge 10/07 (unofficial BETA) version

PostPosted: 13 Oct 2009, 16:17
by Chris H.
cyclope wrote:I can't run this version with my macbook and java 1.5...

I think i'll have to re-compile it with Eclipse...
`
Hello, cyclope.

I use a recent model intel iMac with OS Snow Leopard.

I think that with a Mac you have to upgrade the OS to Snow Leopard (10.6) to get Java 1.6.

OS Leopard (10.5) and earlier are limited to java 1.42 and 1.5.

I would re-build the source and then upload a java 1.5 version of 10-07 for you and others but ...

it looks like Snow Leopard only includes java 1.6. What appears on my computer to be java 1.42 and 1.5 are hard links to the java 1.6 file. :(

Re: MTGForge 10/07 (unofficial BETA) version

PostPosted: 14 Oct 2009, 09:25
by nelyn
I would love to see this in a 1.5 compiled version.

Re: MTGForge 10/07 (unofficial BETA) version

PostPosted: 14 Oct 2009, 16:43
by DennisBergkamp
Nelyn,

Yes, this is entirely my fault... after Zerker updated his manapool code, I started a new project in Eclipse and imported his code. It defaulted to 1.6, and I completely missed this.
I set it to 1.5 now though, next version will definitely be in 1.5.

Re: MTGForge 10/07 (unofficial BETA) version

PostPosted: 14 Oct 2009, 17:03
by nelyn
Cool,

I look forward to the update.


Thanks again for keeping schleps like me entertained.