Adding new cards with Groovy
by ubeefx
Moderators: ubeefx, beholder, melvin, ShawnieBoy, Lodici, CCGHQ Admins
Re: Adding new cards with Groovy
by hong yie » 22 Mar 2014, 05:18
can this ability cost implemented in groovy code yet?
- tap an untapped creature
- tap <n> untapped <creature type>
- tap an untapped creature
- tap <n> untapped <creature type>
-
hong yie - Programmer
- Posts: 216
- Joined: 10 Mar 2013, 06:44
- Location: Jakarta
- Has thanked: 75 times
- Been thanked: 9 times
Re: Adding new cards with Groovy
by melvin » 22 Mar 2014, 09:18
"Tap an untapped creature you control" has been implemented for next release. The later will have to wait till we integrate cost parsing with effect parsing.hong yie wrote:can this ability cost implemented in groovy code yet?
- tap an untapped creature
- tap <n> untapped <creature type>

Magarena/scripts/Bramblesnap.txt
- Code: Select all
name=Bramblesnap
url=http://magiccards.info/query?q=%21bramblesnap
image=http://mtgimage.com/card/bramblesnap.jpg
value=3.723
rarity=U
type=Creature
subtype=Elemental
cost={1}{G}
pt=1/1
ability=trample;\
cost Tap an untapped creature you control: SN gets +1/+1 until end of turn.
timing=main
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: Adding new cards with Groovy
by melvin » 22 Mar 2014, 13:38
Uses 'Sacrifice another creature' cost that is supported in the next release.

Magarena/scripts/Corpse_Blockade.txt

Magarena/scripts/Corpse_Blockade.txt
- Code: Select all
name=Corpse Blockade
url=http://magiccards.info/query?q=%21corpse%20blockade
image=http://mtgimage.com/card/corpse%20blockade.jpg
value=3.723
rarity=C
type=Creature
subtype=Zombie
cost={2}{B}
pt=1/4
ability=defender;\
cost Sacrifice another creature: SN gains deathtouch until end of turn.
timing=main
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: Adding new cards with Groovy
by jerichopumpkin » 26 Mar 2014, 22:14
I was wondering, which enchantment subtypes are missing right now?
I think World Enchantment is not supported, but what about Auras targeting a player? Because I would like to script Curses and World Enchantments if possible...
I think World Enchantment is not supported, but what about Auras targeting a player? Because I would like to script Curses and World Enchantments if possible...
- jerichopumpkin
- Posts: 212
- Joined: 12 Sep 2013, 11:21
- Has thanked: 19 times
- Been thanked: 13 times
Re: Adding new cards with Groovy
by ShawnieBoy » 27 Mar 2014, 16:13
Both of them are missing right now, but I could see World Enchantments being implemented. Slight variation on the Legendary rule. I'll have a look.
-
ShawnieBoy - Programmer
- Posts: 601
- Joined: 02 Apr 2012, 22:42
- Location: UK
- Has thanked: 80 times
- Been thanked: 50 times
Re: Adding new cards with Groovy
by ShawnieBoy » 27 Mar 2014, 16:26
Oh, ok then - The World rule is already in there. Go for it 
The main part of Enchant Player is there, just needs to actually hit the battlefield instead of being literally attached to the player

The main part of Enchant Player is there, just needs to actually hit the battlefield instead of being literally attached to the player

-
ShawnieBoy - Programmer
- Posts: 601
- Joined: 02 Apr 2012, 22:42
- Location: UK
- Has thanked: 80 times
- Been thanked: 50 times
Re: Adding new cards with Groovy
by frank » 28 Mar 2014, 18:25
and here I thought, Enchant Player was a post-it like attachement to player's forehead... glad you made that one clear 
oh, I loved unglued... Bureaucracy - best card ever! (which isn't an Enchant Player... but Volrath's Motion Sensor is. But less fun)

oh, I loved unglued... Bureaucracy - best card ever! (which isn't an Enchant Player... but Volrath's Motion Sensor is. But less fun)
Re: Adding new cards with Groovy
by ShawnieBoy » 28 Mar 2014, 20:26
I'm a big fan of unglued too Volrath's Motion Sensor, Handcuffs and Deadhead was my favouritefrank wrote:and here I thought, Enchant Player was a post-it like attachement to player's forehead... glad you made that one clear
oh, I loved unglued... Bureaucracy - best card ever! (which isn't an Enchant Player... but Volrath's Motion Sensor is. But less fun)

-
ShawnieBoy - Programmer
- Posts: 601
- Joined: 02 Apr 2012, 22:42
- Location: UK
- Has thanked: 80 times
- Been thanked: 50 times
Re: Adding new cards with Groovy
by hong yie » 29 Mar 2014, 11:33
"Whenever a player cycles a card.." trigger
is available yet?
is available yet?
-
hong yie - Programmer
- Posts: 216
- Joined: 10 Mar 2013, 06:44
- Location: Jakarta
- Has thanked: 75 times
- Been thanked: 9 times
Re: Adding new cards with Groovy
by ShawnieBoy » 29 Mar 2014, 15:21
Unfortunately no
I've been wanting to get the gempalms in for a while.

-
ShawnieBoy - Programmer
- Posts: 601
- Joined: 02 Apr 2012, 22:42
- Location: UK
- Has thanked: 80 times
- Been thanked: 50 times
Re: Adding new cards with Groovy
by ShawnieBoy » 10 Apr 2014, 19:01
The next release will allow you to do such wonders as this 

Magarena/scripts/Paleoloth.txt


Magarena/scripts/Paleoloth.txt
- Code: Select all
name=Paleoloth
url=http://www.magiccards.info/query?q=%21paleoloth
image=http://mtgimage.com/card/paleoloth.jpg
value=3.046
rarity=R
type=Creature
subtype=Beast
cost={4}{G}{G}
pt=5/5
ability=Whenever another creature with power 5 or greater enters the battlefield under your control, you may return target creature card from your graveyard to your hand.
timing=main
-
ShawnieBoy - Programmer
- Posts: 601
- Joined: 02 Apr 2012, 22:42
- Location: UK
- Has thanked: 80 times
- Been thanked: 50 times
Re: Adding new cards with Groovy
by frank » 10 Apr 2014, 22:42
I'd say quite impressive. Congratulations.
say, is there a way to remove a type from a permanent? Like, taking the artifact away from an artifact creature?
edit: ah nevermind.
return flags^MagicType.Artifact.getMask();
did the trick
say, is there a way to remove a type from a permanent? Like, taking the artifact away from an artifact creature?
edit: ah nevermind.
return flags^MagicType.Artifact.getMask();
did the trick
Re: Adding new cards with Groovy
by frank » 11 Apr 2014, 09:28
What's the difference between NEG_Target... POS_TARGET... and TARGET... ?
Re: Adding new cards with Groovy
by ShawnieBoy » 11 Apr 2014, 11:15
They are hints for the AI. Some spells/effects can target any permanent but have an effect that can be viewed as Positive or Negative.frank wrote:What's the difference between NEG_Target... POS_TARGET... and TARGET... ?
So for example 'Destroy target Elf' would be NEG_TARGET_ELF
But 'Destroy target Elf you don't control' would be TARGET_ELF_OPPONENT_CONTROLS
(Don't use these, they're just for example)
These are mainly seen on enchantments, so "You gain enchanted <whatever>" would need a Neg_Target hint, otherwise the AI might target it's own permanents.
Essentially NEG_TARGET will only target opponents permanents, POS_TARGET will only target players permanents, and TARGET will target either.
Normally these have no effect for the Player, they are only for the AI, unless the 'Remove unusual target choices.' option is selected in the Settings (which I think may be default, but I always remove it). Then the targeting hints are enforced on the player as well.
Hope that makes sense

-
ShawnieBoy - Programmer
- Posts: 601
- Joined: 02 Apr 2012, 22:42
- Location: UK
- Has thanked: 80 times
- Been thanked: 50 times
Who is online
Users browsing this forum: No registered users and 3 guests