Page 1 of 4

Masticore

PostPosted: 13 Feb 2010, 19:37
by zen
Hi Everyone,
This is my debut onto the Forge seen, so be gentile please. Anyways, I'm trying to implement Masticore and need a little help with the discard part.
I dropped this first bit into cards.txt

Masticore
4
Artifact Creature Masticore
During your upkeep discard a card at random or sacrafice Masticore.
4/4
RegenerateMe:2
abDamageC 2:1


and the following into GameActionUtil.java:

I added 'upkeep_Masticore();' into the UpkeepEffects like so:

public static void executeUpkeepEffects(){ upkeep_Masticore(); }

and the rest down below:

private static void upkeep_Masticore()
{
final String player = AllZone.Phase.getActivePlayer();
PlayerZone playZone = AllZone.getZone(Constant.Zone.Play, player);

CardList list = new CardList(playZone.getCards());
list = list.getName("Masticore");

Ability ability;
for (int i = 0; i < list.size(); i++)
{
ability = new Ability(list.get(i), "0")
{
public void resolve()
{
AllZone.GameAction.discardRandom(player);
}
};// Ability
ability.setStackDescription(player + "discards a card at random");

AllZone.Stack.add(ability);
}// for
}//upkeep_Masticore

Any help with the discarding bit would be great. I tried to simplify his effect by just having him making you discard every upkeep, but even that hasn't worked so far.

Re: Masticore

PostPosted: 13 Feb 2010, 19:58
by Marek14
"Sacrifice", not "sacrafice"...

Also, Masticore does NOT make you discard at random.

Re: Masticore

PostPosted: 13 Feb 2010, 20:16
by zen
Right, thanks. Even so, I think I'm really having problems compiling in eclipse. Is there a thread on that somewhere?

Re: Masticore

PostPosted: 13 Feb 2010, 20:18
by DennisBergkamp
Zen,

Yes, what Marek said.
Anyway, Masticore is a bit of a tricky card. But it should be doable, you're putting the code in the right place (upkeep_Masticore() in GameActionUtil.java).

First of all, you'll need to use GameAction.discard(String player, int numDiscard) instead of discardRandom.

To help you in the right direction, have a look at the code of Drekavac found in CardFactory_Creature.java (starting around line 2770).
After all what needs to happen is that Masticore has to be sacrificed unless a card is discarded.

Re: Masticore

PostPosted: 13 Feb 2010, 20:22
by DennisBergkamp
What happens when you try compiling?

I'm guessing you need to add some of the libraries to your Build Path.
These libraries should be in /res/lib.

Add them to your build path by:
Right clicking your project in the Package Explorer -> Build Path -> Add External Archives, now just add all of the JARs found in /res/lib.

Re: Masticore

PostPosted: 14 Feb 2010, 08:09
by zen
Thanks for the help on the discard code. I'll definitely use that.

As for the compiling, I think I could use some guidance on compiling forge in eclipse.

Re: Masticore

PostPosted: 14 Feb 2010, 11:26
by Chris H.
Is zen downloading the most recent version of Forge. The most recent version is r377 located at:

https://cardforge.googlecode.com/svn


The /res/lib/ folder should contain:

google-collect-1.0.jar
jdom-1.0.jar
jl1.0.1.jar
jsr305.jar
napkinlaf-1.2.jar
napkinlaf-swingset-1.2.jar
nimrodlf.jar
substance.jar

Re: Masticore

PostPosted: 14 Feb 2010, 12:34
by zen
Hi Chris H.
I just downloaded forge 01-01 from:
http://forge-card-game.googlecode.com/f ... -forge.zip

there was only a single file in the res/lib folder:
jl1.0.1.jar

I tried clicking on Chris' link, but it asks for a username and password.. I tried loging into google code first too, but this didn't seem to help. How do I get a user/pass?

Re: Masticore

PostPosted: 14 Feb 2010, 13:19
by DennisBergkamp
Zen,

What you will need is Subclipse (a plugin for Eclipse), to grab the latest stuff from the SVN. I just installed it again recently on my Linux machine, and I think I ended up grabbing version 1.6.

Check this website for instructions: http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA

AFTER installing subclipse, in Eclipse, hit File -> Import -> Other -> Checkout projects from SVN -> Next. Then Create New Repository Location -> Next.
Use "https://cardforge.googlecode.com/svn" as the location. It should then fetch the remote directories on that location, select the "src" directory to check out.

Re: Masticore

PostPosted: 14 Feb 2010, 15:59
by Chris H.
If I remember correctly, Subversion is also needed. I think that Subversion is included with many *nix variants.

It looks like I installed Subversion 1.6.6 on my Mac along with the Subclipse 1.6.5 plugin. :)

Re: Masticore

PostPosted: 14 Feb 2010, 21:23
by zen
Thanks for the help thusfar Dennis and Chris. I downloaded SVN 1.6.9 and Subclipse 1.6.7 and installed them. Next I followed Dennis' suggestion of:

hit File -> Import -> Other -> Checkout projects from SVN -> Next. Then Create New Repository Location -> Next.
Use "https://cardforge.googlecode.com/svn"

It says "Pending" for a minute or so, and then I get an error message on the "Checkout from SVN" screen saying "Unable to load default SVN Client". This happens right before it seems like I should select the 'src' directory to checkout. Could the problem be with me not having permissions to access the SVN site? I emailed mtgrares already, asking him to add me as a contributor to the site. Any ideas?

Re: Masticore

PostPosted: 14 Feb 2010, 21:41
by zen
Why is the source code so hard to come by? It came default with the earlier versions of Forge I believe

Re: Masticore

PostPosted: 15 Feb 2010, 00:01
by silly freak
zen, i agree with you. i think the source should be available even without SVN; we should include it again in the releases, hear me dennis? (at least as a separate download) but also think of it this way: the SVN allows you to have the latest sources even when the last beta was a month ago.

for your problem: this sounds like your SVN client was not found or is not compatible. look in window/preferences for your subclipse setup, maybe that gives you some hints. if not, first try to use SVN on the commandline. there's a mass of tutorials on the web on how to do that. another tip: try http instead of https for anonymous access. maybe the error was with your authentication?

Re: Masticore

PostPosted: 15 Feb 2010, 00:27
by DennisBergkamp
Hm, yeah it might be a good thing as a separate download, I will do so the next Beta release.

Re: Masticore

PostPosted: 15 Feb 2010, 00:43
by zen
Thanks for the tips Silly Freak,
I'm thinking the problem is with my access. Do you guys have special permissions to the https://cardforge.googlecode.com/svn site?

Is there a way to determine if Subclipse is playing nicely with SVN or not?