Page 1 of 1

Incantus Online Card Editor

PostPosted: 20 Nov 2009, 18:52
by mtgrares
Incantus, another great program that lets you play against other people over the Internet, has a marvelous online card editor that lets people submit and test new cards, which is here. Incantus is written in Python and supports over 6,000 cards (which is insane). The Incantus forum is here on slightlymagic.net

To give you a taste of how Incantus does things, here is the code for Royal Assassin and Shock.

Code: Select all
name = 'Royal Assassin'
cardnum = 0
expansion = ''
types = characteristic('Creature')
supertypes = no_characteristic()
subtypes = characteristic('Assassin', 'Human')
cost = '1BB'
color = characteristic('B')
power = 1
toughness = 1
text = ['T: Destroy target tapped creature.']

play_spell = play_permanent()

#################################

@activated(txt=text[0])
def ability():
    def effects(controller, source):
        cost = yield TapCost()
        target = yield Target(isCreature.with_condition(lambda c: c.tapped))
        target.destroy()
        yield
    return effects
abilities.add(ability)
Code: Select all
name = 'Shock'
cardnum = 0
expansion = ''
types = characteristic('Instant')
supertypes = no_characteristic()
subtypes = no_characteristic()
cost = 'R'
color = characteristic('R')
text = ['Shock deals 2 damage to target creature or player.']

#################################

@play_instant()
def effects(controller, source):
    cost = yield source.cost
    target = yield Target(isCreatureOrPlayer)
    source.deal_damage(target, 2)
    yield
play_spell = effects

Re: Incantus Online Card Editor

PostPosted: 21 Nov 2009, 08:46
by Huggybaby
It's really unbelievable how simple card code for Incantus is. It's quite beautiful.

Re: Incantus Online Card Editor

PostPosted: 23 Nov 2009, 03:40
by frwololo
I still think Wagic is better for simple cards, here are royal assassin and shock:

Code: Select all
[card]
text={T}: Destroy target tapped creature.
id=129708
auto={T}:destroy target(creature[tapped])
name=Royal Assassin
rarity=R
type=Creature
mana={1}{B}{B}
power=1
subtype=Human Assassin
toughness=1
[/card]
Code: Select all
[card]
text=Shock deals 2 damage to target creature or player.
target=creature,player
auto=Damage:2
id=129732
name=Shock
rarity=C
type=Instant
mana={R}
[/card]
My system has its limits compared to real code, so Incantus is better for complex effects, but Wagic is by far the easiest system around here for simple cards such as shock and Royal assassin.

Re: Incantus Online Card Editor

PostPosted: 23 Nov 2009, 06:12
by Huggybaby
I guess it doesn't get any simpler than that! Even us non-coders can understand it. :)

Re: Incantus Online Card Editor

PostPosted: 25 Nov 2009, 21:07
by mtgrares
Thanks for the card code frwololo. Sometime in the near future for my blog, I'm going to try to show the code for Shock and Royal Assassin for Wagic, MagicWars, Incantus, and Forge.

Re: Incantus Online Card Editor

PostPosted: 26 Nov 2009, 05:17
by Incantus
Hi frwololo,

Not to get into a pissing match ;) , but I take issue with the statement that card code for wagic is simpler. It may look simpler, but having a true programming language helps with consistency. Your examples for Royal Assassin and Shock demonstrate this: there are 2 different ways of declaring a target (in Royal Assassin the target is defined as part of the auto keyword, and in Shock it's a separate line.) It's not clear when you would use which option. Whereas using a programming language can make it easy to enforce when the target is defined, and for Incantus the card code gets back a target object which represents either the player or card that is targeted. What I mean to say is that leaning to create simple cards makes it easy to ramp up to more difficult cards (since the structure is the same).

Re: Incantus Online Card Editor

PostPosted: 26 Nov 2009, 08:59
by frwololo
Incantus: couldn't agree more. I think I've said it before, I believe your system is best in the long run, and Wagic can get quite insane for pretty complicated cards.

although it makes sense to me that the targets are coded differently for a spell and for an ability, we have lots of issues because of such choices I made early in the development process.

Re: Incantus Online Card Editor

PostPosted: 29 Nov 2009, 17:49
by learyt
how do i register on incantus card editor??
can i download cards from incantus and play with them on FORGE?

Re: Incantus Online Card Editor

PostPosted: 30 Nov 2009, 00:40
by frwololo
learyt wrote:can i download cards from incantus and play with them on FORGE?
That would be cool, but the answer is obviously no :|

Re: Incantus Online Card Editor

PostPosted: 30 Nov 2009, 14:33
by learyt
i was looking arround and theres many proyect Forge,incantus, Magma, just to name a few. But nome of them is compatible. i know that is asking to much but it would be amazing if all the programers worked on 1 big proyect.

im starting on this and im reading a lot maybe i can help with little things.

Re: Incantus Online Card Editor

PostPosted: 01 Dec 2009, 04:24
by frwololo
Unfortunately we all have different goals, this is why we all have our own program

For example:
Magma only works on Windows.
Incantus doesn't have an AI.
Forge uses too much power for it to run on a PSP.
Wagic can only be played with a keyboard or a gamepad, not with a mouse.

etc...

At first I wanted to work on forge and port it to the PSP. Then I realized that there is no easy way to run a java application on the PSP. And even If I had managed to do it, it would have been too slow and the screen layout wasn't adapted at all for a small screen.

Edit: the multiplicity of projects is good: There is some kind of friendly competition between us. Seeing games such as Magma or Incantus implementing thousands of card was a great motivation for me (and for Forge as well, I believe). We share algorithms and knowledge, so it's not like we're all in our "closed" world.
Also, if one of us gets shut down by WotC, there'll still be alternatives. So having the choice is good :D

Re: Incantus Online Card Editor

PostPosted: 01 Dec 2009, 13:58
by learyt
i tried them all and the best are forge and wargic witch its really fast.
manalink its really good but the cards limit cap is 2000 and there's no way to change that

thank you for all the work guys

Re: Incantus Online Card Editor

PostPosted: 01 Dec 2009, 16:51
by Marek14
learyt wrote:i tried them all and the best are forge and wargic witch its really fast.
manalink its really good but the cards limit cap is 2000 and there's no way to change that

thank you for all the work guys
Have you tried BotArena? Probably the best in AI terms, but the superior AI comes with slow-thinking computer.

Re: Incantus Online Card Editor

PostPosted: 02 Dec 2009, 17:55
by learyt
i searched for botarena in their page but it's no longer abeilable

Re: Incantus Online Card Editor

PostPosted: 02 Dec 2009, 19:12
by Marek14
learyt wrote:i searched for botarena in their page but it's no longer available
You just have to know where to search :) Try the Botarena section here, there should be a way to get there. I assure you, it's still being worked on.