It is currently 19 Apr 2024, 15:34
   
Text Size

Dragon Presence Cards

Post MTG Forge Related Programming Questions Here

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

Re: Dragon Presence Cards

Postby Agetian » 16 May 2015, 05:15

The addition of Dragon Presence cards allows to add all five DTK intro packs to Forge. I went ahead and committed the quest mode precons in r29399. EDIT: Also added Landslide Charge DTK event deck (r29401).

I also see Commune with Lava is now in - great job, Sol, thanks! Is there any hard stopper for Hedonist's Trove? I thought about it a little bit yesterday but found it too complex for my skills (the absence of similar mechanics in already scripted cards doesn't help either :( ), although the fact that it's roughly based around the exile mechanic somewhat reminiscent of Commune with Lava makes me feel a little bit optimistic about it :) [Side note: it looks like Hedonist's Trove only appears in 1 deck in MTGDecks.net converted decklists, so it's not a popular tournament card after all].



- Agetian
Agetian
Programmer
 
Posts: 3471
Joined: 14 Mar 2011, 05:58
Has thanked: 676 times
Been thanked: 561 times

Re: Dragon Presence Cards

Postby friarsol » 16 May 2015, 13:43

Agetian wrote:Is there any hard stopper for Hedonist's Trove? I thought about it a little bit yesterday but found it too complex for my skills (the absence of similar mechanics in already scripted cards doesn't help either :( ), although the fact that it's roughly based around the exile mechanic somewhat reminiscent of Commune with Lava makes me feel a little bit optimistic about it :) [Side note: it looks like Hedonist's Trove only appears in 1 deck in MTGDecks.net converted decklists, so it's not a popular tournament card after all].
It's kinda similar to Yawgmoth's Will, but with exiling things first. I was suggesting this originally, but never tested it. I think swordshine said it didn't work with somethings, so I didn't look into it too much.

Prototype | Open
# Exile Graveyard
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigExile | TriggerDescription$ When CARDNAME enters the battlefield, exile all cards from target player's graveyard.
SVar:TrigExile:DB$ ChangeZoneAll | ValidTgts$ Opponent | Origin$ Graveyard | Destination$ Exile | ChangeType$ Card | RememberChanged$ True
# Crucible of Worlds
S:Mode$ Continuous | Affected$ Land.IsRemembered | AffectedZone$ Exile | MayPlay$ True | Description$ You may play land cards exiled with CARDNAME.
# Grant Casting
S:Mode$ Continuous | Affected$ Card.nonLand+IsRemembered | AffectedZone$ Exile | MayPlay$ True | CheckSVar$ CastFromTrove | Description$ You may cast nonland cards exiled with CARDNAME. You can't cast more than one spell this way each turn.
SVar:CastFromTrove:Number$1
# Tracking
T:Mode$ SpellCast | ValidCard$ Card.IsRemembered | ValidActivatingPlayer$ You | Execute$ SetTrove | TriggerZones$ Battlefield | Static$ True
SVar:SetTrove:DB$ StoreSVar | SVar$ CastFromTrove | Type$ Number | Expression$ 0
T:Mode$ Phase | Phase$ Cleanup | ValidPlayer$ Player | Execute$ ResetTrove | TriggerZones$ Battlefield | Static$ True
SVar:ResetTrove:DB$ StoreSVar | SVar$ CastFromTrove | Type$ Number | Expression$ 1
# Clearing Cards
T:Mode$ ChangesZone | Origin$ Exile | Destination$ Any | ValidCard$ Card.IsRemembered | Execute$ TrigClear
SVar:TrigClear:DB$ Cleanup | ForgetDefined$ TriggeredCard
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Dragon Presence Cards

Postby Agetian » 16 May 2015, 15:03

Ok, thanks for the info!

- Agetian
Agetian
Programmer
 
Posts: 3471
Joined: 14 Mar 2011, 05:58
Has thanked: 676 times
Been thanked: 561 times

Re: Dragon Presence Cards

Postby friarsol » 16 May 2015, 16:21

Ahhh just looked through the Spoiler thread. It seems that the case was Misthollow Griffin. I'm not sure if that's a strong enough corner case here.

Hedonist's Trove (exiles the Griffin), opponent Confiscate s your Trove. Then casts Griffin (here an opponent should get an option whether to cast the Griffin through the Trove, or cast it through it's native ability.) When casting natively, it shouldn't count for your once per turn for the Trove.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Dragon Presence Cards

Postby Agetian » 16 May 2015, 17:15

Hmm yeah that looks like a rather rare and unusual corner case to me as well...

- Agetian
Agetian
Programmer
 
Posts: 3471
Joined: 14 Mar 2011, 05:58
Has thanked: 676 times
Been thanked: 561 times

Re: Dragon Presence Cards

Postby excessum » 06 Jun 2015, 23:27

Other than Scaleguard Sentinels, the AI does not seem to receive the bonus effect from the "reveal" clause of the dragon presence cards. The bonus for dragons on the battlefield does seem to work though.
excessum
 
Posts: 177
Joined: 21 Oct 2013, 02:30
Has thanked: 0 time
Been thanked: 19 times

Re: Dragon Presence Cards

Postby Agetian » 07 Jun 2015, 05:14

excessum wrote:Other than Scaleguard Sentinels, the AI does not seem to receive the bonus effect from the "reveal" clause of the dragon presence cards. The bonus for dragons on the battlefield does seem to work though.
This seems to be related to the fact that for some reason the check at SpellAbilityCondition.java:229 (isOptionalCostPaid, in particular) fails - the spell ability that is being tested does not have its GenericCost filled when the AI casts the spell and reveals a dragon (so, the optional costs array is empty). :/ Does anyone have an idea why that might be happening?

- Agetian
Agetian
Programmer
 
Posts: 3471
Joined: 14 Mar 2011, 05:58
Has thanked: 676 times
Been thanked: 561 times

Re: Dragon Presence Cards

Postby Agetian » 07 Jun 2015, 15:29

Ok, I tried to fix the issue with the Dragon Presence cards when they're used by the AI in the "reveal a dragon from hand" mode. I was successful in making Foul-Tongue Invocation work correctly. Orator of Ojutai, Silumgar's Scorn and Scaleguard Sentinels seem to work fine as they are (at least in multiple tests that I ran...), I don't remember if I had to change anything about Silumgar's Scorn to make it work.

Draconic Roar is a bit of a hit-or-miss... I was able to make it work in some cases but not in all cases. There's a strange bug somewhere deep in the code (I got lost tracing the code tbh) that causes the SubAbility to lose its target information and paidcosts information when the AI casts the spell. If that happens (and it seems to happen when the AI tries to cast Draconic Roar in its main phase), the game is unable to identify that the dragon presence reveal was used via "ConditionDragonPresence$ True" (because paycosts info is lost). It correctly identifies that the spell was cast with dragon presence reveal using the new method I implemented but it still fails to target the card's controller (because the target info was lost). No idea how and where that happens, but if anyone is willing to tackle this, here's a test case that clearly demonstrates the issue (the AI will try to cast Draconic Roar in its main phase every time, the thing is, it won't always reveal a dragon, but it'll reveal it often enough):

TEST CASE: AI MAKES SPELLABILITY LOSE TARGETING INFO | Open
Code: Select all
humanlife=4
ailife=24
activeplayer=ai
activephase=UPKEEP
humancardsinhand=Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Dragonlord Atarka
humancardsinlibrary=Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain
humancardsingraveyard=Abbey Gargoyles;Aboroth;Abattoir Ghoul;Go for the Throat;Abattoir Ghoul;Mountain;Mountain
humancardsinplay=Mountain;Mountain;Abattoir Ghoul|SummonSick:True
humancardsinexile=
humancardsincommand=
aicardsinhand=Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Dragonlord Atarka;Draconic Roar
aicardsinlibrary=Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain;Mountain
aicardsingraveyard=Foul-Tongue Invocation;Mountain;Forest;Mountain;Foul-Tongue Invocation;Draconic Roar;Dragonlord Atarka;Draconic Roar
aicardsinplay=Swamp;Swamp;Mountain;Forest;Mountain
aicardsinexile=
aicardsincommand=
When the AI casts Draconic Roar in its upkeep, things seem to go smoothly and the targeting information is retained, thus the AI gets the bonus correctly. Weird. [Notice that paycosts info is still lost in the subability, thus the "ConditionDragonPresence$ True" approach doesn't work either].

- Agetian
Agetian
Programmer
 
Posts: 3471
Joined: 14 Mar 2011, 05:58
Has thanked: 676 times
Been thanked: 561 times

Previous

Return to Developer's Corner

Who is online

Users browsing this forum: KeithOvart and 89 guests


Who is online

In total there are 90 users online :: 1 registered, 0 hidden and 89 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: KeithOvart and 89 guests

Login Form