Card Development Questions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Card Development Questions
by Max mtg » 06 Jun 2013, 09:25
PreventDamage needs to be refactored into an effect with defined$ targets... moreover we should somehow be able to distibute prevention from simultaneous effects
Say, one has 2 Grizzly Bears, opponent casts Pyroclasm, in response Shining Shoal (X=2) and choose to prevent 1 damage on each
Say, one has 2 Grizzly Bears, opponent casts Pyroclasm, in response Shining Shoal (X=2) and choose to prevent 1 damage on each
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Card Development Questions
by moomarc » 06 Jun 2013, 15:34
Deciding which creature damage is prevented from should only occur when the damage would be prevented though, not when you cast Shining Shoal. Would be great if we could get that working though because it shouldn't be too difficult to get from there to proper redirection shields
-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: Card Development Questions
by Max mtg » 06 Jun 2013, 19:03
I've learned how it works. As damaging effect resolves the prevention effects apply - and this fact gives a hint, that at some point of time all damage to be applied by a Pyroclasm should be held in a buffer, when player who contols any prevention effects decides how to apply the latter. After that the damage is to be released and distributed among those to who it has been addressed.moomarc wrote:Deciding which creature damage is prevented from should only occur when the damage would be prevented though, not when you cast Shining Shoal. Would be great if we could get that working though because it shouldn't be too difficult to get from there to proper redirection shields
It's unlike current system when damage is just applied in a loop, see forge.card.ability.effects.DamageAllEffect.resolve(SpellAbility) for an example.
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Card Development Questions
by swordshine » 11 Jun 2013, 12:03

Last edited by timmermac on 11 Jun 2013, 12:52, edited 1 time in total.
Reason: Enabled mouseover
Reason: Enabled mouseover
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Card Development Questions
by friarsol » 11 Jun 2013, 13:07
That'll probably work fine. I think originally for this case I was picturing the CounterType to be listed as "Any" (Or maybe "Counter" so it looked similar to how hasProperty works). Which would set CounterType to null here, and then force the player to choose a valid Counter on a card during cost payment. But it may be easier to just create a new cost for this scenario so the current one doesn't bloat up.swordshine wrote::arrow: Power Conduit has a "Remove a counter" cost, which is very different from the existing "RemoveCounter" cost. Maybe we need write a new cost "RemoveAnyCounter<Num/Type/{TypeDescription}>"
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by swordshine » 11 Jun 2013, 14:30
I made AI only remove negative counters, maybe this's not good for Chisei, Heart of Oceans.friarsol wrote:That'll probably work fine. I think originally for this case I was picturing the CounterType to be listed as "Any" (Or maybe "Counter" so it looked similar to how hasProperty works). Which would set CounterType to null here, and then force the player to choose a valid Counter on a card during cost payment. But it may be easier to just create a new cost for this scenario so the current one doesn't bloat up.swordshine wrote::arrow: Power Conduit has a "Remove a counter" cost, which is very different from the existing "RemoveCounter" cost. Maybe we need write a new cost "RemoveAnyCounter<Num/Type/{TypeDescription}>"
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Card Development Questions
by swordshine » 13 Jun 2013, 10:52
I'm interested in Krark's Thumb. If I have three Krark's Thumb in play (when Mirror Gallery is in play), I can choose one of the eight results and ignore the others. Am I right?
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Card Development Questions
by Sloth » 13 Jun 2013, 11:42
Yes (since the order of flipping doesn't matter).swordshine wrote:I'm interested in Krark's Thumb. If I have three Krark's Thumb in play (when Mirror Gallery is in play), I can choose one of the eight results and ignore the others. Am I right?
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by swordshine » 14 Jun 2013, 08:15
I looked into the code for Archive Trap in ChangeZone effect. Current code cannot work with Bribery and the activating player is not always the one who searched the library.
- Code: Select all
if(origin.contains(ZoneType.Library) && !sa.hasParam("NoLooking")) {
sa.getActivatingPlayer().incLibrarySearched();
}
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Card Development Questions
by Max mtg » 21 Jun 2013, 21:46
Just added keywords to restrict a custom number of blockers.
Already implemented Pathrazer of Ulamog and Gorilla Berserkers.
Could not add Guile and Phyrexian Colossus because their scripts are more complex. Please check if they are scriptable now.
Already implemented Pathrazer of Ulamog and Gorilla Berserkers.
Could not add Guile and Phyrexian Colossus because their scripts are more complex. Please check if they are scriptable now.
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Card Development Questions
by friarsol » 21 Jun 2013, 21:58
Sloth, is there enough AI in there now for these cards to be scripted? I know the reason they weren't added before wasn't due to the complexity of the script, but the complexity of the AI needed to support them.Max mtg wrote:Just added keywords to restrict a custom number of blockers.
Already implemented Pathrazer of Ulamog and Gorilla Berserkers.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Max mtg » 21 Jun 2013, 22:25
Never heard of poor AI support being a reason not to implement a card.
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Card Development Questions
by friarsol » 21 Jun 2013, 23:04
Not very many cards are affected by it. I'm not talking about the AI not being able to play the card. I'm talking about the AI illegally playing against this card.Max mtg wrote:Never heard of poor AI support being a reason not to implement a card.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by swordshine » 22 Jun 2013, 01:07
I confirm AI cannot make good decisions when I attack with cards like Phyrexian Colossus. I set AI's life to 8, gave ai three creatures, but ai didn't block.friarsol wrote:Not very many cards are affected by it. I'm not talking about the AI not being able to play the card. I'm talking about the AI illegally playing against this card.Max mtg wrote:Never heard of poor AI support being a reason not to implement a card.
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Card Development Questions
by swordshine » 22 Jun 2013, 03:38
Added both Guile and Phyrexian Colossus. We need some improvements of attacking/blocking ai.Max mtg wrote:Just added keywords to restrict a custom number of blockers.
Already implemented Pathrazer of Ulamog and Gorilla Berserkers.
Could not add Guile and Phyrexian Colossus because their scripts are more complex. Please check if they are scriptable now.
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Who is online
Users browsing this forum: No registered users and 42 guests