It is currently 18 Jun 2025, 22:45
   
Text Size

Programming question

New decks and cards for Stainless Games' release

Moderator: CCGHQ Admins

Programming question

Postby gopher » 17 Mar 2013, 09:10

Hi people.

First, thank yo so much for the availability and the quality of your programming work, I really enjoy playing dotp modding decks for a couple of months :D, and especially making my decks and cards.

Looking at your code, I've learned how to write some simple cards (I hope to share them someday) like the funny Ovinomancer, Thawing Glaciers or Soratami Rainshaper, but I'm completely stuck with the Offering feature of the Patron of the Moon card as I can't find such a feature implying tests and maths in previously released cards, and as I'm really far from being a real programmer...

How would you code that ?

Thank you very much in advance,

Gopher.
gopher
 
Posts: 11
Joined: 17 Mar 2013, 08:41
Has thanked: 0 time
Been thanked: 0 time

Re: Programming question

Postby thefiremind » 17 Mar 2013, 09:34

Don't feel discouraged for not being able to code the offering mechanic: there's no way to code it 100% properly. There are probably some ways to get close to it, but I never tried. I guess there would be the same problems as convoke, more or less. With these functions you could retrieve the mana cost of the Moonfolks you control (luckily there are no Moonfolks with hybrid or phyrexian mana, because my functions don't work with them), which is required for sure... what to do next, well, I have to think a bit about it. :wink:

EDIT: Now that I think about it, there's a problem that could be hard to solve: if you have a Sapphire Medallion or similar cards, there's no way to retrieve the current total cost decrease and apply it to the Patron after doing the math about the Moonfolk.
Last edited by thefiremind on 17 Mar 2013, 10:18, edited 1 time in total.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Programming question

Postby gopher » 17 Mar 2013, 10:09

thefiremind wrote: With these functions you could retrieve the mana cost of the Moonfolks you control [...] which is required for sure... what to do next, well, I have to think a bit about it. :wink:
Thank you very much for a so quick answer :D I'm looking at the code of these functions right now, it's enlightening but there are so many intricated things to do for this Offering mechanism that it seems yet far beyond my limited skills... I'm thinking a lot about it, anyway :D

EDIT : Searching for already written code, I've found Conclave Equenaut for example, in RiiakShiNal Data_DLC_8192 (not offering but convoke). Maybe can it be of a help, but it's the longest and most complicated code I've seen in cards so far...


G.
gopher
 
Posts: 11
Joined: 17 Mar 2013, 08:41
Has thanked: 0 time
Been thanked: 0 time

Re: Programming question

Postby thefiremind » 17 Mar 2013, 19:46

I opened a topic in Programming Talk with my current solution for the offering mechanic:
viewtopic.php?f=63&t=9803
read about the approximations I did, test the card, and have fun. :D
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Programming question

Postby gopher » 17 Mar 2013, 20:46

thefiremind wrote:I opened a topic in Programming Talk with my current solution for the offering mechanic:
viewtopic.php?f=63&t=9803
read about the approximations I did, test the card, and have fun. :D
That's very nice of you, thanks a lot :). I'm running out of time tonight, I'll test it and read your code more carefully tomorrow. Thanks again and keep on the good work :D

G.
gopher
 
Posts: 11
Joined: 17 Mar 2013, 08:41
Has thanked: 0 time
Been thanked: 0 time

Re: Programming question

Postby gopher » 20 Mar 2013, 15:09

thefiremind wrote:I opened a topic in Programming Talk with my current solution for the offering mechanic:
viewtopic.php?f=63&t=9803
read about the approximations I did, test the card, and have fun. :D
Hello.

I've taken the time to study your code and test the "Patron of the moon" which works great. I can't say I understand all the details of your code but at least it's a great programming lesson :D I really didn't realized when asking this question that it could be so complex to implement that, I was just hoping some explanations about some tests and maths... Thanks again for all this work.

I'd have another question if I may, about Amulet of Vigor, speaking of Landfall decks. I've just coded the ability regarding the lands, not all permanent types, and it seems that the artifact activates itself anytime I play a land, would there be a cleaner way to code this, especially when the card will test creatures, artifacts and so on ?

Code: Select all
 <TRIGGERED_ABILITY  filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever a permanent enters the battlefield tapped and under your control, untap it.]]></LOCALISED_TEXT>
    <TRIGGER value="ZONECHANGE_END" simple_qualifier="objectyoucontrol" to_zone="ZONE_IN_PLAY" >
<!--      return TriggerObject():ComesIntoPlayTapped() -->
    return TriggerObject():GetCardType():Test( CARD_TYPE_LAND ) ~= 0
    </TRIGGER>

    <TARGET_DEFINITION id="0">
    local filter = Object():GetFilter()
    filter:Clear()
    filter:AddCardType( CARD_TYPE_LAND )
    filter:SetZone( ZONE_IN_PLAY )
    filter:AddExtra( FILTER_EXTRA_LAND_TAPPED )
    filter:SetHint( HINT_ENEMY, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
    return AtLeastOneTargetFromDefinition(0)
    </TARGET_DETERMINATION> 
    <RESOLUTION_TIME_ACTION>
    if TriggerObject() ~= nil then
       TriggerObject():Untap()
    end

    </RESOLUTION_TIME_ACTION>
Finally, Patron of the moon + Meloku + Amulet of Vigor is a little hard to play, but a very effective and funny combination when one has the chance to encounter and play those cards.

Best,

G.
gopher
 
Posts: 11
Joined: 17 Mar 2013, 08:41
Has thanked: 0 time
Been thanked: 0 time


Return to Magic: The Gathering - Duels of the Planeswalkers

Who is online

Users browsing this forum: No registered users and 2 guests

Main Menu

User Menu

Our Partners


Who is online

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

Login Form