too much lag
by BetaSteward
Moderators: North, BetaSteward, noxx, jeffwadsworth, JayDi, TheElk801, LevelX, CCGHQ Admins
too much lag
by BiasedDice » 15 Nov 2014, 04:56
too much lag
Last edited by BiasedDice on 28 Feb 2015, 23:07, edited 1 time in total.
- BiasedDice
- Posts: 17
- Joined: 15 Nov 2014, 04:45
- Has thanked: 0 time
- Been thanked: 0 time
Re: About how cards are implemented
by LevelX » 15 Nov 2014, 11:35
I added AEther Rift to Xmage (just for you).
Each card is a java class. The Java program (XMage in this case) itself runs already in a sand box.
So every card is a java object and uses the classes and methods from the XMage framework to make it work by the rules.
Therefore you have to write java code to implement cards.
Here as example the AEther Rift class
Each card is a java class. The Java program (XMage in this case) itself runs already in a sand box.
So every card is a java object and uses the classes and methods from the XMage framework to make it work by the rules.
Therefore you have to write java code to implement cards.
Here as example the AEther Rift class
- Code: Select all
public class AEtherRift extends CardImpl {
public AEtherRift(UUID ownerId) {
super(ownerId, 227, "AEther Rift", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}{G}");
this.expansionSetCode = "INV";
this.color.setRed(true);
this.color.setGreen(true);
// At the beginning of your upkeep, discard a card at random. If you discard a creature card this way, return it from your graveyard to the battlefield unless any player pays 5 life.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AEtherRiftEffect(), TargetController.YOU, false));
}
public AEtherRift(final AEtherRift card) {
super(card);
}
@Override
public AEtherRift copy() {
return new AEtherRift(this);
}
}
class AEtherRiftEffect extends OneShotEffect {
public AEtherRiftEffect() {
super(Outcome.Benefit);
this.staticText = "discard a card at random. If you discard a creature card this way, return it from your graveyard to the battlefield unless any player pays 5 life";
}
public AEtherRiftEffect(final AEtherRiftEffect effect) {
super(effect);
}
@Override
public AEtherRiftEffect copy() {
return new AEtherRiftEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Card card = controller.discardOne(true, source, game);
if (card != null && card.getCardType().contains(CardType.CREATURE)) {
Effect returnEffect = new ReturnFromGraveyardToBattlefieldTargetEffect();
returnEffect.setTargetPointer(new FixedTarget(card.getId()));
Effect doEffect = new DoUnlessAnyPlayerPaysEffect(returnEffect, new PayLifeCost(5),
"Pay 5 life to prevent " + card.getLogName() + " to return from graveyard to battlefield?");
return doEffect.apply(game, source);
}
return true;
}
return false;
}
}
-
LevelX - DEVELOPER
- Posts: 1677
- Joined: 08 Dec 2011, 15:08
- Has thanked: 174 times
- Been thanked: 374 times
Re: About how cards are implemented
by kleedrac » 26 Nov 2014, 06:39
Has it ever been considered to allow users to implement cards and submit our classes to you for inclusion?
- kleedrac
- Posts: 23
- Joined: 10 Oct 2014, 04:14
- Has thanked: 0 time
- Been thanked: 0 time
Re: About how cards are implemented
by emerald000 » 26 Nov 2014, 07:38
We are gladly accepting any help for the development. You might want to check https://github.com/magefree/mage/wiki/D ... ng-Started to get started.
If you have any questions, you can post on the developers subforum and we'll be glad to help.
If you have any questions, you can post on the developers subforum and we'll be glad to help.
-
emerald000 - Posts: 92
- Joined: 07 Jul 2014, 16:55
- Has thanked: 1 time
- Been thanked: 9 times
Re: About how cards are implemented
by kleedrac » 27 Nov 2014, 06:11
One more quick question - can existing cards be revised? I've got a Marrow-Gnawer commander deck I can't use because it contains several Relentless Rats (which is legal) but would I have to put that in the card or the rules for commander?
- kleedrac
- Posts: 23
- Joined: 10 Oct 2014, 04:14
- Has thanked: 0 time
- Been thanked: 0 time
Re: About how cards are implemented
by LevelX » 27 Nov 2014, 13:29
I'm not sure if I got your problem correctly.kleedrac wrote:One more quick question - can existing cards be revised? I've got a Marrow-Gnawer commander deck I can't use because it contains several Relentless Rats (which is legal) but would I have to put that in the card or the rules for commander?
The legality of a deck is checked with classes in the package mage.deck of the project "Mage Deck Constructed".
There is a class Commander.java and a class "Commander Duel.java" that do the format check for the Commander formats.
E.g. the check that a commander deck can have multiple Relentless Rats or Shadowborn Apostle is already implemented there.
So I don't understand why you can't use your deck.
-
LevelX - DEVELOPER
- Posts: 1677
- Joined: 08 Dec 2011, 15:08
- Has thanked: 174 times
- Been thanked: 374 times
too much lag
by BiasedDice » 27 Nov 2014, 23:38
too much lag
Last edited by BiasedDice on 28 Feb 2015, 23:07, edited 1 time in total.
- BiasedDice
- Posts: 17
- Joined: 15 Nov 2014, 04:45
- Has thanked: 0 time
- Been thanked: 0 time
Re: About how cards are implemented
by kleedrac » 30 Nov 2014, 00:30
The specific error I get is as follows;LevelX wrote:I'm not sure if I got your problem correctly.kleedrac wrote:One more quick question - can existing cards be revised? I've got a Marrow-Gnawer commander deck I can't use because it contains several Relentless Rats (which is legal) but would I have to put that in the card or the rules for commander?
The legality of a deck is checked with classes in the package mage.deck of the project "Mage Deck Constructed".
There is a class Commander.java and a class "Commander Duel.java" that do the format check for the Commander formats.
E.g. the check that a commander deck can have multiple Relentless Rats or Shadowborn Apostle is already implemented there.
So I don't understand why you can't use your deck.
You(Kleedrac) have an invalid deck for the selected Commander format.
Commander: Commander invalide (Marrow-Gnawer)
Select a deck that is appropriate for the selected format and try again!
I always assumed it was an error stemming from the number of Relentless Rats but evidently it doesn't think I'm allowed to use Marrow-Gnawer as a commander! What would cause this?
-update-
To answer my own question it would appear that xmage is incorrectly thinking Marrow-Gnawer isn't legendary - he's being bounced as my commander! If I have time in the coming week I'll make that my first git fix (unless you guys get to it first)
- kleedrac
- Posts: 23
- Joined: 10 Oct 2014, 04:14
- Has thanked: 0 time
- Been thanked: 0 time
Re: About how cards are implemented
by fireshoes » 01 Dec 2014, 03:52
Correct, it does not list Marrow-Gnawer as Legendary in the tooltips.
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 174 guests