Implementing cards
Moderators: North, BetaSteward, noxx, jeffwadsworth, JayDi, TheElk801, LevelX, CCGHQ Admins
Implementing cards
by eljinete7 » 11 Aug 2014, 14:45
Hello. I send you one card I'd like to play in XMage. This is Cruel Bargain. I'm not familiar with Java or GitHub, so this is a card already implemented with other name (Infernal Contract) but with the same mechanic. I hope it is helpful.
Thanks for all your hard work in XMage.
(Sorry for my English).
Thanks for all your hard work in XMage.
(Sorry for my English).
- Attachments
-
- Portal-CruelBargain.java.txt
- (3.54 KiB) Downloaded 453 times
-
- VintageMasters-CruelBargain.java.txt
- (2.12 KiB) Downloaded 229 times
Re: Implementing cards
by eljinete7 » 11 Aug 2014, 16:21
Another one. Restless Dead from Mirage set.
- Attachments
-
- Mirage-RestlessDead.java.txt
- (2.72 KiB) Downloaded 217 times
Re: Implementing cards
by LevelX » 14 Aug 2014, 14:38
Hello eljinete7,
cards are added.
But normally we only need the specific adding ability/affects part, because the complete card frame is generated automically by a script.
So if you want to contribute further look at https://github.com/magefree/mage/wiki/Developer-Getting-Started.
There are some steps to use java + netbeans + XMage. Then you are perfectly equipped to contribute.
Manually create cards and copy code parts is always a pain.
If you try and have any questions feel free to ask here for help.
cards are added.
But normally we only need the specific adding ability/affects part, because the complete card frame is generated automically by a script.
So if you want to contribute further look at https://github.com/magefree/mage/wiki/Developer-Getting-Started.
There are some steps to use java + netbeans + XMage. Then you are perfectly equipped to contribute.
Manually create cards and copy code parts is always a pain.
If you try and have any questions feel free to ask here for help.
-
LevelX - DEVELOPER
- Posts: 1677
- Joined: 08 Dec 2011, 15:08
- Has thanked: 174 times
- Been thanked: 374 times
Re: Implementing cards
by eljinete7 » 29 Aug 2014, 17:46
This is my try for Culling the Weak from Exdous set, a card needed for some good Legacy decks. Correct it if necessary.
Sorry if don't use GitHub yet, but it's too difficult for me to use it just now.
Sorry if don't use GitHub yet, but it's too difficult for me to use it just now.
- Attachments
-
- Exodus-CullingTheWeak.java.txt
- (1.24 KiB) Downloaded 246 times
Re: Implementing cards
by jeffwadsworth » 05 Nov 2014, 15:46
Working on .Mana Reflection. This is a replacement effect, but apparently "Tapped_For_Mana" is not implemented for it. Is this the case?
- jeffwadsworth
- Super Tester Elite
- Posts: 1171
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 69 times
Re: Implementing cards
by LevelX » 05 Nov 2014, 16:12
I guess you have to replace "ADD_MANA" (because here you get the Mana object and can manipulate it) and check if the producing source was tapped before by using a watcher that checks and remembers the "Tapped_For_Mana" event.jeffwadsworth wrote:Working on .Mana Reflection. This is a replacement effect, but apparently "Tapped_For_Mana" is not implemented for it. Is this the case?
Ony a rough plan.
-
LevelX - DEVELOPER
- Posts: 1677
- Joined: 08 Dec 2011, 15:08
- Has thanked: 174 times
- Been thanked: 374 times
Re: Implementing cards
by jeffwadsworth » 10 Nov 2014, 15:57
Is there a way to get the cost information from a "ADD_MANA" event? I have tried a few techniques with no success. The watcher technique does not appear to cover every case, unfortunately.
- jeffwadsworth
- Super Tester Elite
- Posts: 1171
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 69 times
Re: Implementing cards
by LevelX » 10 Nov 2014, 16:42
Why did the watcher technique not work?jeffwadsworth wrote:Is there a way to get the cost information from a "ADD_MANA" event? I have tried a few techniques with no success. The watcher technique does not appear to cover every case, unfortunately.
Can you give an example?
-
LevelX - DEVELOPER
- Posts: 1677
- Joined: 08 Dec 2011, 15:08
- Has thanked: 174 times
- Been thanked: 374 times
Re: Implementing cards
by jeffwadsworth » 10 Nov 2014, 17:20
I erased the watcher code last week during testing of multiple variations, etc. Anyway, here is an example of a missed case:
Mana Reflection is played. A permanent is tapped for mana. The same permanent adds mana to the pool via counter removal, etc. The watcher will check and see that the permanent was tapped for mana that turn and double the second case.
Mana Reflection is played. A permanent is tapped for mana. The same permanent adds mana to the pool via counter removal, etc. The watcher will check and see that the permanent was tapped for mana that turn and double the second case.
- jeffwadsworth
- Super Tester Elite
- Posts: 1171
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 69 times
Re: Implementing cards
by LevelX » 10 Nov 2014, 17:40
But because mana effects don't go to the stack you can get always the last info (tapped_for_mana or not) from the watcher and clear the saved data of the watcher as you retrieve the info from watcher. So you can't get a wrong old information from the watcher.jeffwadsworth wrote:I erased the watcher code last week during testing of multiple variations, etc. Anyway, here is an example of a missed case:
Mana Reflection is played. A permanent is tapped for mana. The same permanent adds mana to the pool via counter removal, etc. The watcher will check and see that the permanent was tapped for mana that turn and double the second case.
-
LevelX - DEVELOPER
- Posts: 1677
- Joined: 08 Dec 2011, 15:08
- Has thanked: 174 times
- Been thanked: 374 times
Re: Implementing cards
by emerald000 » 10 Nov 2014, 19:00
I have a question about implementing Nahiri, the Lithomancer. How can I check that the Kor Soldier can be equipped by the chosen Equipment? In some weird cases, the Equipment might not be equipable (it turned into a creature for example). The only way I could find in the code was related to Auras and don't apply (checking the spell targets). So anything already exists?
EDIT: After some more looking around, I guess it doesn't exist. O-Naginata and Konda's Banner equipping restriction are implemented as EmptyEffect and checked only on its own Equip ability.
EDIT: After some more looking around, I guess it doesn't exist. O-Naginata and Konda's Banner equipping restriction are implemented as EmptyEffect and checked only on its own Equip ability.
-
emerald000 - Posts: 92
- Joined: 07 Jul 2014, 16:55
- Has thanked: 1 time
- Been thanked: 9 times
Re: Implementing cards
by LevelX » 10 Nov 2014, 20:46
It should be possible to get the target from the equip ability of the equipment and check if it canTarget() the creature it should be attached to.emerald000 wrote:I have a question about implementing Nahiri, the Lithomancer. How can I check that the Kor Soldier can be equipped by the chosen Equipment? In some weird cases, the Equipment might not be equipable (it turned into a creature for example). The only way I could find in the code was related to Auras and don't apply (checking the spell targets). So anything already exists?
EDIT: After some more looking around, I guess it doesn't exist. O-Naginata and Konda's Banner equipping restriction are implemented as EmptyEffect and checked only on its own Equip ability.
-
LevelX - DEVELOPER
- Posts: 1677
- Joined: 08 Dec 2011, 15:08
- Has thanked: 174 times
- Been thanked: 374 times
Re: Implementing cards
by emerald000 » 10 Nov 2014, 22:05
What if it lost its Equip ability? Gained another one? Also you should be able to attach through Shroud.LevelX wrote:It should be possible to get the target from the equip ability of the equipment and check if it canTarget() the creature it should be attached to.emerald000 wrote:I have a question about implementing Nahiri, the Lithomancer. How can I check that the Kor Soldier can be equipped by the chosen Equipment? In some weird cases, the Equipment might not be equipable (it turned into a creature for example). The only way I could find in the code was related to Auras and don't apply (checking the spell targets). So anything already exists?
EDIT: After some more looking around, I guess it doesn't exist. O-Naginata and Konda's Banner equipping restriction are implemented as EmptyEffect and checked only on its own Equip ability.
-
emerald000 - Posts: 92
- Joined: 07 Jul 2014, 16:55
- Has thanked: 1 time
- Been thanked: 9 times
Re: Implementing cards
by LevelX » 11 Nov 2014, 00:09
Than you can get the target from the card if you need it to check if the Equipment can be attached to the created token.emerald000 wrote:What if it lost its Equip ability?
You mean another EquipAbility?emerald000 wrote:Gained another one?
Which card does such a thing?
Than the Equipment probably copies all abilites from another Equipment, so it would be correct.
Copy the target and set notTarget = true before you check.emerald000 wrote:Also you should be able to attach through Shroud.
This will probably work in 99,9 % of all cases. So if we get aware of the 0,1 % case we can think how to solve it.
-
LevelX - DEVELOPER
- Posts: 1677
- Joined: 08 Dec 2011, 15:08
- Has thanked: 174 times
- Been thanked: 374 times
Re: Implementing cards
by emerald000 » 11 Nov 2014, 02:09
Puresteel Paladin lets you gain a second EquipAbility.
Also, the main problem I see with the current setup is that the equip restrictions aren't checked (as far as I know) on SBAs. I don't know how Auras are working, but it should be possible to use something quite similar, as they are extremely similar once on the battlefield. There is no rule distinction of enchant vs equip. (If you manage to get an Enchantment Artifact - Equipment Aura, the attached permanent will get both bonuses and can be moved around with the Equip ability.)
Also, the main problem I see with the current setup is that the equip restrictions aren't checked (as far as I know) on SBAs. I don't know how Auras are working, but it should be possible to use something quite similar, as they are extremely similar once on the battlefield. There is no rule distinction of enchant vs equip. (If you manage to get an Enchantment Artifact - Equipment Aura, the attached permanent will get both bonuses and can be moved around with the Equip ability.)
-
emerald000 - Posts: 92
- Joined: 07 Jul 2014, 16:55
- Has thanked: 1 time
- Been thanked: 9 times
17 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 9 guests