Conspire mechanic
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
9 posts
• Page 1 of 1
Conspire mechanic
by moomarc » 21 Sep 2012, 14:23
Firstly, Thanks Sloth for the OACosts setup. It made life a whole lot easier.
Anyway, I've got conspire all coded up and all the cards scripted, including multiple instances of conspire. It also plays nicely with kickers so thanks again Sloth.
There's just two small things that need fixing. Firstly the spell can't be cancelled once it asks you to start tapping, although if you tap 1 creature then have no others that share a color with the conspire card then the spell is cancelled (the tapped creature won't untap though even though the refund part of tapXType seems like it should untap it).
The second issue is that spells that get Conspire from Wort, the Raidmother don't trigger properly. You're able to choose to pay the conspire cost, and you actually pay the tap cost, but the trigger that checks whether you paid the conspire cost doesn't fire. [EDIT: Managed to fix this by using the player keyword "Each red or green instant or sorcery spell you cast has conspire."]
[EDIT2: Then again maybe not...]
Anyway, I've got conspire all coded up and all the cards scripted, including multiple instances of conspire. It also plays nicely with kickers so thanks again Sloth.
There's just two small things that need fixing. Firstly the spell can't be cancelled once it asks you to start tapping, although if you tap 1 creature then have no others that share a color with the conspire card then the spell is cancelled (the tapped creature won't untap though even though the refund part of tapXType seems like it should untap it).
The second issue is that spells that get Conspire from Wort, the Raidmother don't trigger properly. You're able to choose to pay the conspire cost, and you actually pay the tap cost, but the trigger that checks whether you paid the conspire cost doesn't fire. [EDIT: Managed to fix this by using the player keyword "Each red or green instant or sorcery spell you cast has conspire."]
[EDIT2: Then again maybe not...]
-Marc
-

moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Conspire mechanic
by moomarc » 22 Sep 2012, 12:51
Urgh! Just realised that the way I had the actual Conspire trigger was all wrong and that's what was causing the problem with pumped conspire. I was adding it via CardFactoryUtil with the other postfactory keywords if the card had the keyword Conspire, so cards getting it via a static pump weren't getting the trigger and copy ability added.
Try number 4...
Try number 4...
-Marc
-

moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Conspire mechanic
by Sloth » 22 Sep 2012, 19:08
Does this work now?moomarc wrote:There's just two small things that need fixing. Firstly the spell can't be cancelled once it asks you to start tapping, although if you tap 1 creature then have no others that share a color with the conspire card then the spell is cancelled (the tapped creature won't untap though even though the refund part of tapXType seems like it should untap it).
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Conspire mechanic
by moomarc » 22 Sep 2012, 21:43
I can cancel the spell at any time now, so that aspect is working perfectly. Unfortunately if you cancel after tapping one of the creatures it won't be untapped. But that's alright. Mostly I wanted to be able to cancel it if selected accidentally (I tend to just click OK which automatically selects the oac). The checking whether you can pay the oac is also working almost perfectly. It checks each cost separately rather than the total, but that's more than enough for general use so I wouldn't bother trying to take it further. Thanks for the great work!
Unfortunately I'm away for the next few days so won't be able to take it further just yet, but I got a bit further with working out the kinks.
Unfortunately I'm away for the next few days so won't be able to take it further just yet, but I got a bit further with working out the kinks.
-Marc
-

moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Conspire mechanic
by moomarc » 10 Nov 2012, 15:52
Finally got time to get back to this. I've implemented all the basic Conspire cards, so now I just need to try get it working for multiple instances of conspire as can happen with Wort, the Raidmother.
I've made some initial changes to my code so that Card.java can check against different conspire mechanics but came across a strange situation when testing it. I think Sloth would be most likely to spot the problem, but if anyone can help it would be appreciated. The attached picture shows the adjusted OAC code for Conspire and the game screen where you can see each instance of Conspire listed separately then two instances of the 1st instance listed at the top
Any ideas on why this is happening?
There's also a second situation I've come across. If a spell was conspired, then is later returned to your hand and cast without conspiring, the conspire trigger still goes off. How do I clear optional additional costs paid once the spell has resolved?
I've made some initial changes to my code so that Card.java can check against different conspire mechanics but came across a strange situation when testing it. I think Sloth would be most likely to spot the problem, but if anyone can help it would be appreciated. The attached picture shows the adjusted OAC code for Conspire and the game screen where you can see each instance of Conspire listed separately then two instances of the 1st instance listed at the top
Any ideas on why this is happening?There's also a second situation I've come across. If a spell was conspired, then is later returned to your hand and cast without conspiring, the conspire trigger still goes off. How do I clear optional additional costs paid once the spell has resolved?
-Marc
-

moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Conspire mechanic
by Sloth » 10 Nov 2012, 22:29
I understand why you are seeing this, but i don't really understand what you want to see here. It's basically working as expected: You have four choices:moomarc wrote:I've made some initial changes to my code so that Card.java can check against different conspire mechanics but came across a strange situation when testing it. I think Sloth would be most likely to spot the problem, but if anyone can help it would be appreciated. The attached picture shows the adjusted OAC code for Conspire and the game screen where you can see each instance of Conspire listed separately then two instances of the 1st instance listed at the topAny ideas on why this is happening?
1. Use both instances of Conspire,
2. Use only the first one,
3. Use only the second one,
4. Don't use Conspire.
What do you want the numbering to look like?
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Conspire mechanic
by moomarc » 11 Nov 2012, 08:24
Sorry, I apparently wasn't very clear. What I was expecting was the top option to show (Conspire [1])(Conspire [2]) instead of (Conspire[1])(Conspire[1]). That way I could in theory get Card.java to check for either similar to how Kicker checks for multiple kicker costs. (I'm still trying to figure out the exact logic for that side but keep hitting a wall for the cornercase scenario with Mirror Gallery and more than one Wort, the Raidmother).
-Marc
-

moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Conspire mechanic
by Sloth » 13 Nov 2012, 20:42
This should be fixed now, but i wonder if it isn't better to check for conspire directly on the sa with a new "Conspire" parameter in the SpellCast trigger.moomarc wrote:There's also a second situation I've come across. If a spell was conspired, then is later returned to your hand and cast without conspiring, the conspire trigger still goes off. How do I clear optional additional costs paid once the spell has resolved?
I have no real idea how to fix Wort, the Raidmother though.
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Conspire mechanic
by moomarc » 13 Nov 2012, 21:02
Well 10 out of 11 conspire-related cards isn't too bad. The hacky solution for Wort would be easy: add a new OAC Conspire2. Then there's no duplicates, unless there's a Mirror Gallery Wort scenario. One day we'll figure it out.Sloth wrote:This should be fixed now, but i wonder if it isn't better to check for conspire directly on the sa with a new "Conspire" parameter in the SpellCast trigger.moomarc wrote:There's also a second situation I've come across. If a spell was conspired, then is later returned to your hand and cast without conspiring, the conspire trigger still goes off. How do I clear optional additional costs paid once the spell has resolved?
I have no real idea how to fix Wort, the Raidmother though.
With regards to whether to create a param in SpellCast, I'll leave that up to you. I'm not good enough to see the most optimal way to code something; I'll just try get it in there with some relatively clean code (or what looks clean to me at least
-Marc
-

moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 11 guests