It is currently 20 May 2025, 21:26
   
Text Size

Card Development Questions

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: Card Development Questions

Postby 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
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

Postby 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
User avatar
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

Postby Max mtg » 06 Jun 2013, 19:03

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
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.

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

Postby swordshine » 11 Jun 2013, 12:03

: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}>"
Last edited by timmermac on 11 Jun 2013, 12:52, edited 1 time in total.
Reason: Enabled mouseover
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

Re: Card Development Questions

Postby friarsol » 11 Jun 2013, 13:07

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}>"
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.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby swordshine » 11 Jun 2013, 14:30

friarsol wrote:
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}>"
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.
I made AI only remove negative counters, maybe this's not good for Chisei, Heart of Oceans.
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

Re: Card Development Questions

Postby 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

Postby Sloth » 13 Jun 2013, 11:42

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?
Yes (since the order of flipping doesn't matter).
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Card Development Questions

Postby 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();
        }
I'll modify it after the new "Can't search library" mechanism sets up.
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

Re: Card Development Questions

Postby 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.
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

Postby friarsol » 21 Jun 2013, 21:58

Max mtg wrote:Just added keywords to restrict a custom number of blockers.
Already implemented Pathrazer of Ulamog and Gorilla Berserkers.
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.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby 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

Postby friarsol » 21 Jun 2013, 23:04

Max mtg wrote:Never heard of poor AI support being a reason not to implement a card.
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.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby swordshine » 22 Jun 2013, 01:07

friarsol wrote:
Max mtg wrote:Never heard of poor AI support being a reason not to implement a card.
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.
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.
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

Re: Card Development Questions

Postby swordshine » 22 Jun 2013, 03:38

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.
Added both Guile and Phyrexian Colossus. We need some improvements of attacking/blocking ai.
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 42 guests


Who is online

In total there are 42 users online :: 0 registered, 0 hidden and 42 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 42 guests

Login Form