abTgtPTPump
Post MTG Forge Related Programming Questions Here
	Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
			16 posts
			 • Page 1 of 2 • 1, 2
		
	
abTgtPTPump
 by Rob Cashwalker » 26 Jun 2009, 02:10
by Rob Cashwalker » 26 Jun 2009, 02:10 
Permanents with the ability - 
{manacost/tap cost}: Target creature gets +p/+t until end of turn.
Flowstone Overseer
2 R R R
Creature Beast
no text
4/4
abTgtPTPump R R:+/-1
Ghost Warden
1 W
Creature Spirit
no text
1/1
abTgtPTPump T:+1/+1
Nantuko Disciple
3 G
Creature Insect Druid
no text
2/2
abTgtPTPump G T:+2/+2
			{manacost/tap cost}: Target creature gets +p/+t until end of turn.
Flowstone Overseer
2 R R R
Creature Beast
no text
4/4
abTgtPTPump R R:+/-1
Ghost Warden
1 W
Creature Spirit
no text
1/1
abTgtPTPump T:+1/+1
Nantuko Disciple
3 G
Creature Insect Druid
no text
2/2
abTgtPTPump G T:+2/+2
- Code: Select all
- private final int shouldAbTgtPTPumpCard(Card c)
 {
 ArrayList<String> a = c.getKeyword();
 for (int i = 0; i < a.size(); i++)
 if (a.get(i).toString().startsWith("abTgtPTPump"))
 return i;
 
 return -1;
 }
- Code: Select all
- while (shouldAbTgtPTPumpCard(card) != -1)
 {
 int n = shouldAbTgtPTPumpCard(card);
 if (n != -1)
 {
 String parse = card.getKeyword().get(n).toString();
 card.removeIntrinsicKeyword(parse);
 
 String k[] = parse.split(":");
 String pt[] = k[1].split("/");
 
 final int attack[] = new int[1];
 final int defense[] = new int[1];
 
 attack[0] = Integer.parseInt(pt[0].replace("+", ""));
 defense[0] = Integer.parseInt(pt[1].replace("+", ""));
 String tmpCost = k[0].substring(10);
 boolean tapCost = false;
 boolean tapOnlyCost = false;
 
 if (tmpCost.contains("T"))
 {
 tapCost = true;
 tmpCost = tmpCost.replace("T", "");
 tmpCost = tmpCost.trim();
 if (tmpCost.length() == 0)
 tapOnlyCost = true;
 }
 
 final String manaCost = tmpCost;
 
 String tmpDesc = new String();
 tmpDesc = "Target creature gets ";
 if (attack[0] > 0)
 tmpDesc = tmpDesc + "+" + attack[0];
 else
 tmpDesc = tmpDesc + attack[0];
 tmpDesc = tmpDesc + "/";
 if (defense[0] > 0)
 tmpDesc = tmpDesc + "+" + defense[0];
 else
 tmpDesc = tmpDesc + defense[0];
 tmpDesc = tmpDesc + " until end of turn.";
 final String Desc = tmpDesc;
 
 if (!tapCost)
 {
 final SpellAbility ability = new Ability_Activated(card, manaCost)
 {
 private static final long serialVersionUID = -845173064437485113L;
 
 public boolean canPlay()
 {
 if (CardFactoryUtil.canUseAbility(card) && AllZone.GameAction.isCardInPlay(card) &&
 !card.isFaceDown())
 return true;
 else
 return false;
 }
 public boolean canPlayAI()
 {
 CardList list = getAttackers();
 if (list.isEmpty())
 return false;
 else
 {
 if (list.get(0).getNetDefense() + defense[0] < 1)
 return false;
 Random r = new Random();
 if (r.nextFloat() <= Math.pow(.6667, card.getAbilityUsed()))
 {
 setTargetCard(list.get(0));
 return true;
 }
 else
 return false;
 }
 }//canPlayAI
 public CardList getAttackers()
 {
 Card[] c = ComputerUtil.getAttackers().getAttackers();
 CardList list = new CardList(c);
 
 return list;
 }//getAttacker
 public void resolve()
 {
 if (AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard()))
 {
 final Card[] creature = new Card[1];
 
 creature[0] = getTargetCard();
 creature[0].addTempAttackBoost(attack[0]);
 creature[0].addTempDefenseBoost(defense[0]);
 
 card.setAbilityUsed(card.getAbilityUsed()+1);
 
 final Command EOT = new Command()
 {
 private static final long serialVersionUID = 122944434978198700L;
 public void execute()
 {
 if (AllZone.GameAction.isCardInPlay(creature[0]))
 {
 creature[0].addTempAttackBoost(-attack[0]);
 creature[0].addTempDefenseBoost(-defense[0]);
 }
 }
 };//EOT
 AllZone.EndOfTurn.addUntil(EOT);
 }
 }//resolve
 };//ability
 ability.setDescription(manaCost+": "+Desc);
 ability.setStackDescription(Desc);
 ability.setBeforePayMana(CardFactoryUtil.input_targetCreature(ability));
 card.addSpellAbility(ability);
 }//!tapCost
 
 if (tapOnlyCost)
 {
 final SpellAbility ability = new Ability_Tap(card)
 {
 private static final long serialVersionUID = 6723777240105966031L;
 
 public boolean canPlay()
 {
 boolean sick = true;
 if (!card.hasSickness() || !card.isCreature())
 sick = false;
 if (card.isUntapped() && CardFactoryUtil.canUseAbility(card) &&
 AllZone.GameAction.isCardInPlay(card) && !sick && !card.isFaceDown())
 return true;
 else
 return false;
 }//canPlay
 public boolean canPlayAI()
 {
 CardList list = getAttackers();
 if (list.isEmpty())
 return false;
 else
 if (list.get(0).getNetDefense() + defense[0] < 1)
 return false;
 if (CardFactoryUtil.AI_doesCreatureAttack(card))
 return false;
 setTargetCard(list.get(0));
 return true;
 }//canPlayAI
 public CardList getAttackers()
 {
 Card[] c = ComputerUtil.getAttackers().getAttackers();
 CardList list = new CardList(c);
 list.remove(card);
 return list;
 }
 public void resolve()
 {
 if (AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard()))
 {
 final Card[] creature = new Card[1];
 
 creature[0] = getTargetCard();
 creature[0].addTempAttackBoost(attack[0]);
 creature[0].addTempDefenseBoost(defense[0]);
 
 final Command EOT = new Command()
 {
 private static final long serialVersionUID = -852905560563053752L;
 public void execute()
 {
 if (AllZone.GameAction.isCardInPlay(creature[0]))
 {
 creature[0].addTempAttackBoost(-attack[0]);
 creature[0].addTempDefenseBoost(-defense[0]);
 }
 }
 };//EOT
 AllZone.EndOfTurn.addUntil(EOT);
 }
 }//resolve
 };//ability
 ability.setDescription("tap: "+Desc);
 ability.setStackDescription(Desc);
 ability.setBeforePayMana(CardFactoryUtil.input_targetCreature_NoCost_TapAbility((Ability_Tap)ability));
 card.addSpellAbility(ability);
 }//tapOnlyCost
 
 if (!tapOnlyCost && tapCost)
 {
 final SpellAbility ability = new Ability_Tap(card, manaCost)
 {
 private static final long serialVersionUID = 2749576299299014851L;
 
 public boolean canPlay()
 {
 boolean sick = true;
 if (!card.hasSickness() || !card.isCreature())
 sick = false;
 if (card.isUntapped() && CardFactoryUtil.canUseAbility(card) &&
 AllZone.GameAction.isCardInPlay(card) && !sick && !card.isFaceDown())
 return true;
 else
 return false;
 }//canPlay
 public boolean canPlayAI()
 {
 CardList list = getAttackers();
 if (list.isEmpty())
 return false;
 else
 if (list.get(0).getNetDefense() + defense[0] < 1)
 return false;
 if (CardFactoryUtil.AI_doesCreatureAttack(card))
 return false;
 setTargetCard(list.get(0));
 return true;
 }//canPlayAI
 public CardList getAttackers()
 {
 Card[] c = ComputerUtil.getAttackers().getAttackers();
 CardList list = new CardList(c);
 list.remove(card);
 return list;
 }//getAttackers
 public void resolve()
 {
 if (AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard()))
 {
 final Card[] creature = new Card[1];
 
 creature[0] = getTargetCard();
 creature[0].addTempAttackBoost(attack[0]);
 creature[0].addTempDefenseBoost(defense[0]);
 
 final Command EOT = new Command()
 {
 private static final long serialVersionUID = 8179097336678296338L;
 public void execute()
 {
 if (AllZone.GameAction.isCardInPlay(creature[0]))
 {
 creature[0].addTempAttackBoost(-attack[0]);
 creature[0].addTempDefenseBoost(-defense[0]);
 }
 }
 };//EOT
 AllZone.EndOfTurn.addUntil(EOT);
 }
 }//resolve
 };//ability
 ability.setDescription(manaCost+ ", tap: "+Desc);
 ability.setStackDescription(Desc);
 ability.setBeforePayMana(CardFactoryUtil.input_targetCreature(ability));
 card.addSpellAbility(ability);
 }//!tapCost
 }
 }//while
The Force will be with you, Always.
		- 
				 
 Rob Cashwalker
- Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: abTgtPTPump
 by Chris H. » 26 Jun 2009, 16:55
by Chris H. » 26 Jun 2009, 16:55 
We currently have two cards in Forge that have explicit code, the Ghost Warden and the Kabuto Moth. Rob has posted the cards.txt entry for the Ghost Warden.
The cards.txt entry for the Kabuto Moth will be:
			
		The cards.txt entry for the Kabuto Moth will be:
- Code: Select all
- Kabuto Moth
 2 W
 Creature Spirit
 no text
 1/2
 Flying
 abTgtPTPump T:+1/+2
- 
				 
 Chris H.
- Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: abTgtPTPump
 by Sloth » 28 Jun 2009, 11:05
by Sloth » 28 Jun 2009, 11:05 
I don't know if one of you already added them but here are a few cards, that can be added to card.txt without special code in cardfactory:
			
				- Code: Select all
- Armorer Guildmage
 R
 Creature Human Wizard
 no text
 1/1
 abTgtPTPump B T:+1/+0
 abTgtPTPump G T:+0/+1
 Captive Flame
 2 R
 Enchantment
 no text
 abTgtPTPump R:+1/+0
 Crenellated Wall
 4
 Artifact Creature Wall
 no text
 0/4
 Defender
 abTgtPTPump T:+0/+4
 Dega Disciple
 W
 Creature Human Wizard
 no text
 1/1
 abTgtPTPump B T:-2/+0
 abTgtPTPump R T:+2/+0
 Ghitu War Cry
 2 R
 Enchantment
 no text
 abTgtPTPump R:+1/+0
 Ghosts of the Damned
 1 B B
 Creature Spirit
 no text
 0/2
 abTgtPTPump T:-1/+0
 Grandmother Sengir
 4 B
 Legendary Creature Human Wizard
 no text
 3/3
 abTgtPTPump 1 B T:-1/-1
 Icatian Priest
 W
 Creature Human Cleric
 no text
 1/1
 abTgtPTPump 1 W W:+1/+1
 Pradesh Gypsies
 2 G
 Creature Human Nomad
 no text
 1/1
 abTgtPTPump 1 G T:-2/+0
 Saltfield Recluse
 2 W
 Creature Human Rebel Cleric
 no text
 1/2
 abTgtPTPump T:-2/+0
 Shaper Guildmage
 U
 Creature Human Wizard
 no text
 1/1
 TgtKPump W T: First Strike
 abTgtPTPump B T:+1/+0
 Smokespew Invoker
 2 B
 Creature Zombie Mutant
 no text
 3/1
 abTgtPTPump 7 B:-3/-3
 Staff of Zegon
 4
 Artifact
 no text
 abTgtPTPump 3 T:-2/+0
 Thriss, Nantuko Primus
 5 G G
 Legendary Creature Insect Druid
 no text
 5/5
 abTgtPTPump G T:+5/+5
 Tower of Champions
 4
 Artifact
 no text
 abTgtPTPump 8 T:+6/+6
 Tuknir Deathlock
 R R G G
 Legendary Creature Human Wizard
 no text
 2/2
 Flying
 abTgtPTPump R G T:+2/+2
 Ursapine
 3 G G
 Creature Beast
 no text
 3/3
 abTgtPTPump G:+1/+1
 Wyluli Wolf
 1 G
 Creature Wolf
 no text
 1/1
 abTgtPTPump T:+1/+1
Last edited by Sloth on 29 Jun 2009, 12:32, edited 1 time in total.
					
				
			
		- 
				 
 Sloth
- Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: abTgtPTPump
 by Rob Cashwalker » 28 Jun 2009, 12:45
by Rob Cashwalker » 28 Jun 2009, 12:45 
Just a note, like the self-pump ability, it can't handle (the truth) -1 power. That would require a different AI to choose an opposing creature. Plus, that kind of effect more often than not is for use during combat, which the AI can't access yet.
			The Force will be with you, Always.
		- 
				 
 Rob Cashwalker
- Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: abTgtPTPump
 by Sloth » 29 Jun 2009, 12:42
by Sloth » 29 Jun 2009, 12:42 
Here is one more:
			
		- Code: Select all
- Ana Disciple
 G
 Creature Human Wizard
 no text
 1/1
 TgtKPump U T: Flying
 abTgtPTPump B T:-2/+0
- 
				 
 Sloth
- Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: abTgtPTPump
 by Chris H. » 31 Jul 2009, 20:20
by Chris H. » 31 Jul 2009, 20:20 
I was taking a look at the abTgtPTPump keyword. One of the cards using this keyword is the Flowstone Overseer which looks like this:
Flowstone Overseer
2 R R R
Creature Beast
no text
4/4
abTgtPTPump R R:+1/-1
The Forge text panel displays the string:
"p R R: Target creature gets +1/-1 until end of turn."
The code is recognizing the "abTgtPTPump" as a keyword. And the code is recognizing the "+1/-1" to the right of the colon as the pump data.
When it comes to parsing the {mana/T} cost, the code is apparently adding the last "p" of the abTgtPTPump keyword and the following space to the "R R" mana cost.
This may or may not be related to the problem of not being able to select a target before paying the activation cost.
			
		Flowstone Overseer
2 R R R
Creature Beast
no text
4/4
abTgtPTPump R R:+1/-1
The Forge text panel displays the string:
"p R R: Target creature gets +1/-1 until end of turn."
The code is recognizing the "abTgtPTPump" as a keyword. And the code is recognizing the "+1/-1" to the right of the colon as the pump data.
When it comes to parsing the {mana/T} cost, the code is apparently adding the last "p" of the abTgtPTPump keyword and the following space to the "R R" mana cost.
This may or may not be related to the problem of not being able to select a target before paying the activation cost.
- 
				 
 Chris H.
- Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: abTgtPTPump
 by Rob Cashwalker » 01 Aug 2009, 03:04
by Rob Cashwalker » 01 Aug 2009, 03:04 
Good catch Chris. Yep, there's a bug right here:
			- Code: Select all
- String tmpCost = k[0].substring(10);
The Force will be with you, Always.
		- 
				 
 Rob Cashwalker
- Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: abTgtPTPump
 by Chris H. » 01 Aug 2009, 11:04
by Chris H. » 01 Aug 2009, 11:04 
I put together a test deck with 3 Ghost Warden and 4 Mox Pearl and got the following in my console message:Rob Cashwalker wrote:Good catch Chris. Yep, there's a bug right here:abTgtPTPump is 11 characters, not 10. I haven't tried to figure out the targeting bug yet.
- Code: Select all
String tmpCost = k[0].substring(10);
- Code: Select all
- 8/1/09 6:51:36 AM [0x0-0x19019].com.apple.JarLauncher[135] at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
 8/1/09 6:54:29 AM [0x0-0x1b01b].com.apple.JarLauncher[144] SystemFlippers: didn't consume all data for long ID 0 (pBase = 0x100128b40, p = 0x100128b44, pEnd = 0x100128b48)
 8/1/09 6:54:29 AM [0x0-0x1b01b].com.apple.JarLauncher[144] SystemFlippers: didn't consume all data for long ID 0 (pBase = 0x10010f870, p = 0x10010f874, pEnd = 0x10010f878)
 8/1/09 6:54:29 AM [0x0-0x1b01b].com.apple.JarLauncher[144] SystemFlippers: didn't consume all data for long ID 0 (pBase = 0x10010f870, p = 0x10010f874, pEnd = 0x10010f878)
 8/1/09 6:55:07 AM [0x0-0x1b01b].com.apple.JarLauncher[144] size of commands: 98
 8/1/09 6:55:46 AM [0x0-0x1b01b].com.apple.JarLauncher[144] == Start add state effects ==
 8/1/09 6:55:46 AM [0x0-0x1b01b].com.apple.JarLauncher[144] == End add state effects ==
 8/1/09 6:55:46 AM [0x0-0x1b01b].com.apple.JarLauncher[144] number of cards in compy removed zone: 0
 8/1/09 6:55:46 AM [0x0-0x1b01b].com.apple.JarLauncher[144] number of cards in human removed zone: 0
 8/1/09 6:55:46 AM [0x0-0x1b01b].com.apple.JarLauncher[144] opponent has: Ghost Warden (6)
 8/1/09 6:55:46 AM [0x0-0x1b01b].com.apple.JarLauncher[144] opponent has: Ghost Warden (2)
 8/1/09 6:55:46 AM [0x0-0x1b01b].com.apple.JarLauncher[144] thinking, I just subtracted blue, cost is now: 2
 8/1/09 6:55:46 AM [0x0-0x1b01b].com.apple.JarLauncher[144] thinking, I just subtracted blue, cost is now:
 8/1/09 6:55:46 AM [0x0-0x1b01b].com.apple.JarLauncher[144] thinking, I just subtracted blue, cost is now:
 8/1/09 6:55:46 AM [0x0-0x1b01b].com.apple.JarLauncher[144] just subtracted blue, cost is now:
 8/1/09 6:55:48 AM [0x0-0x1b01b].com.apple.JarLauncher[144] == Start add state effects ==
 8/1/09 6:55:48 AM [0x0-0x1b01b].com.apple.JarLauncher[144] == End add state effects ==
 8/1/09 6:55:48 AM [0x0-0x1b01b].com.apple.JarLauncher[144] number of cards in compy removed zone: 0
 8/1/09 6:55:48 AM [0x0-0x1b01b].com.apple.JarLauncher[144] number of cards in human removed zone: 0
 8/1/09 6:55:51 AM [0x0-0x1b01b].com.apple.JarLauncher[144] opponent has: Steel Wall (35)
 8/1/09 6:55:51 AM [0x0-0x1b01b].com.apple.JarLauncher[144] opponent has: Phyrexian Walker (25)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] Exception in thread "AWT-EventQueue-0"
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] java.lang.RuntimeException: Mana_Part : checkMana() error, argument mana is invalid mana, mana - p
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at Mana_Part.checkSingleMana(Mana_Part.java:15)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at Mana_PartColor.<init>(Mana_PartColor.java:12)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at Mana_PayCost.split(Mana_PayCost.java:84)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at Mana_PayCost.<init>(Mana_PayCost.java:20)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at ManaCost.<init>(ManaCost.java:12)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at Input_PayManaCost.<init>(Input_PayManaCost.java:24)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at CardFactoryUtil$26.done(CardFactoryUtil.java:1210)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at CardFactoryUtil$26.selectCard(CardFactoryUtil.java:1197)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at GuiInput.selectCard(GuiInput.java:35)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at GuiDisplay3$13.mousePressed(GuiDisplay3.java:354)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.Component.processMouseEvent(Component.java:6298)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.Component.processEvent(Component.java:6066)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.Container.processEvent(Container.java:2085)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.Component.dispatchEventImpl(Component.java:4667)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.Container.dispatchEventImpl(Container.java:2143)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.Component.dispatchEvent(Component.java:4497)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4600)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4261)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4194)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.Container.dispatchEventImpl(Container.java:2129)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.Window.dispatchEventImpl(Window.java:2475)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.Component.dispatchEvent(Component.java:4497)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
 8/1/09 6:56:00 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: Mana_Part : checkMana() error, argument mana is invalid mana, mana - p
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at Mana_Part.checkSingleMana(Mana_Part.java:15)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at Mana_PartColor.<init>(Mana_PartColor.java:12)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at Mana_PayCost.split(Mana_PayCost.java:84)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at Mana_PayCost.<init>(Mana_PayCost.java:20)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at ManaCost.<init>(ManaCost.java:12)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at Input_PayManaCost.<init>(Input_PayManaCost.java:24)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at CardFactoryUtil$26.done(CardFactoryUtil.java:1210)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at CardFactoryUtil$26.selectCard(CardFactoryUtil.java:1197)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at GuiInput.selectCard(GuiInput.java:35)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at GuiDisplay3$13.mousePressed(GuiDisplay3.java:354)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.Component.processMouseEvent(Component.java:6298)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.Component.processEvent(Component.java:6066)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.Container.processEvent(Container.java:2085)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.Component.dispatchEventImpl(Component.java:4667)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.Container.dispatchEventImpl(Container.java:2143)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.Component.dispatchEvent(Component.java:4497)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4600)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4261)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4194)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.Container.dispatchEventImpl(Container.java:2129)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.Window.dispatchEventImpl(Window.java:2475)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.Component.dispatchEvent(Component.java:4497)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
 8/1/09 6:56:01 AM [0x0-0x1b01b].com.apple.JarLauncher[144] at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
- Code: Select all
- java.lang.RuntimeException: Mana_Part : checkMana() error, argument mana is invalid mana, mana - p

- 
				 
 Chris H.
- Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: abTgtPTPump
 by Chris H. » 09 Aug 2009, 02:20
by Chris H. » 09 Aug 2009, 02:20 
I have some great news for Rob and Dennis.Rob Cashwalker wrote:Good catch Chris. Yep, there's a bug right here:abTgtPTPump is 11 characters, not 10. I haven't tried to figure out the targeting bug yet.
- Code: Select all
String tmpCost = k[0].substring(10);
 
 I launched my copy of Eclipse (Mac version) and I used the instructions in message http://www.slightlymagic.net/forum/viewtopic.php?f=26&t=1093#p12845 to create a new project with the 07-31 source code.
I searched for and changed the 10 to an 11 and then spent several hours trying to figure out how I could create one large jar file.
 
 I tried one interesting option and ended up with many java class files. I found and started the one named "Gui_NewGame.class" and wow.
I went into the deck editor and created a test deck with Kabuto Moth and Mox Pearl. Played the deck and the card works as expected.
Your suggested fix takes care of both the mana/tap cost bug and the targeting bug. The two are related.

- 
				 
 Chris H.
- Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
- 
				 
 DennisBergkamp
- AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: abTgtPTPump
 by Rob Cashwalker » 09 Aug 2009, 16:07
by Rob Cashwalker » 09 Aug 2009, 16:07 
Good job Chris. So when are you going to code your first card?  
			
The Force will be with you, Always.
		- 
				 
 Rob Cashwalker
- Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: abTgtPTPump
 by Chris H. » 09 Aug 2009, 16:30
by Chris H. » 09 Aug 2009, 16:30 
I will look through the card data that was submitted by Sloth for additional cards that use this keyword.DennisBergkamp wrote:Haha, nice one ChrisI'll update this.
I will concentrate on those cards with a positive power pump and we will ignore the negative power pumps for the moment.
Later this week I will pm you the cards.txt data and the cards.pictures urls.

- 
				 
 Chris H.
- Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: abTgtPTPump
 by Chris H. » 09 Aug 2009, 16:40
by Chris H. » 09 Aug 2009, 16:40 
Rob Cashwalker wrote:Good job Chris. So when are you going to code your first card?
 
    
 Yeah, I can see that I still need to gain a lot of experience with Eclipse. I still have not figured out how to combine all of these multiple java class files into one large jar file.
 
 I am at this time looking at some of the files dealing with panels and text strings. There are a few things that I would like to try changing. I fear that my changes may not be for the better. We will see.
I am having fun. Not sure if my level of expertise will ever reach the point of coding keywords and/or cards.
- 
				 
 Chris H.
- Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: abTgtPTPump
 by Rob Cashwalker » 09 Aug 2009, 16:48
by Rob Cashwalker » 09 Aug 2009, 16:48 
I don't know how to do that yet either. Doesn't matter... that's what dennis is for.Chris H. wrote:Yeah, I can see that I still need to gain a lot of experience with Eclipse. I still have not figured out how to combine all of these multiple java class files into one large jar file.

That's one area I don't understand, so I steer clear. I looked at that stuff to see what it might take to create a dedicated mana pool panel.... I turned around immediately.I am at this time looking at some of the files dealing with panels and text strings. There are a few things that I would like to try changing. I fear that my changes may not be for the better. We will see.
Like I always say, it's all a mix-and-match game with existing code, and a few tweaks.I am having fun. Not sure if my level of expertise will ever reach the point of coding keywords and/or cards.
The Force will be with you, Always.
		- 
				 
 Rob Cashwalker
- Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: abTgtPTPump
 by DennisBergkamp » 10 Aug 2009, 09:35
by DennisBergkamp » 10 Aug 2009, 09:35 
File -> Export -> Java -> Runnable Jar File -> next. Then set your "Launch configuration" to GUI_NewGame and click finish. You do have to empty (copy them somewhere else temporarily) your pics folder and refresh your project, otherwise your JAR will be really big.Yeah, I can see that I still need to gain a lot of experience with Eclipse. I still have not figured out how to combine all of these multiple java class files into one large jar file.
- 
				 
 DennisBergkamp
- AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
			16 posts
			 • Page 1 of 2 • 1, 2
		
	
Who is online
Users browsing this forum: No registered users and 28 guests
