Programming question
New decks and cards for Stainless Games' release
Moderator: CCGHQ Admins
6 posts
• Page 1 of 1
Programming question
by 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
, 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.
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

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

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...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: Programming question
by gopher » 17 Mar 2013, 10:09
Thank you very much for a so quick answerthefiremind 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.


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
by 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.
viewtopic.php?f=63&t=9803
read about the approximations I did, test the card, and have fun.

< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: Programming question
by gopher » 17 Mar 2013, 20:46
That's very nice of you, thanks a lotthefiremind 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.


G.
- gopher
- Posts: 11
- Joined: 17 Mar 2013, 08:41
- Has thanked: 0 time
- Been thanked: 0 time
Re: Programming question
by gopher » 20 Mar 2013, 15:09
Hello.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.
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

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>
Best,
G.
- gopher
- Posts: 11
- Joined: 17 Mar 2013, 08:41
- Has thanked: 0 time
- Been thanked: 0 time
6 posts
• Page 1 of 1
Return to Magic: The Gathering - Duels of the Planeswalkers
Who is online
Users browsing this forum: No registered users and 2 guests