It is currently 18 Apr 2024, 15:28
   
Text Size

Help with "Omniscience" [play nonland card without paying]

Moderator: CCGHQ Admins

Help with "Omniscience" [play nonland card without paying]

Postby Zambooo » 23 Jul 2012, 21:10

Here I am with another deal :)
I have some problem with Omniscience: the rules for this card say
"- If the card has X in its mana cost, you must choose 0 as its value."
so I cannot just reduce indefinitely the cost of all my cards. I tried to reduce the cost separately for each card, but I've realized I can't do like I did :roll:

Code: Select all
<?xml version='1.0'?>
<CARD_V2>
  <FILENAME text="OMNISCIENCE_288937" />
  <CARDNAME text="OMNISCIENCE" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Omniscience]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Onniscenza]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="288937" />
  <ARTID value="288937" />
  <ARTIST name="Jason Chan" />
  <CASTING_COST cost="{7}{U}{U}{U}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA["The things I once imagined would be my greatest achievements were only the first steps toward a future I can only begin to fathom."
Jace Beleren]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA["Le cose che sognavo un tempo sarebbero le mie conquiste più grandi, se non fossero solo i primi passi verso un futuro che riesco appena a intravedere."
Jace Beleren]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Enchantment" />
  <EXPANSION value="DPG" />
  <RARITY metaname="M" />
 
 <STATIC_ABILITY filter_zone="ZONE_HAND">
   <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[You may cast nonland cards from your hand without paying their mana costs.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Puoi lanciare carte non terra dalla tua mano senza pagare il loro costo di mana.]]></LOCALISED_TEXT>   
    <FILTER>
    local filteredCard = FilteredCard()
    local objectPlayer = Object():GetPlayer()
    return (FilteredCard():GetCardType():Test( CARD_TYPE_LAND ) == 0) and (FilteredCard():GetPlayer() == Object():GetPlayer()) and (FilteredCard() ~= nil and FilteredCard():GetZone() == ZONE_HAND)
    </FILTER>
    <CONTINUOUS_ACTION layer="6">
       if FilteredCard() ~= nil then
          FilteredCard():GetCurrentCharacteristics():GrantAbility(1)
       end
    </CONTINUOUS_ACTION>
 </STATIC_ABILITY>
 <UTILITY_ABILITY resource_id="1">
    <COST type="Mana" cost="{0}" qualifier="alternate" tag="ALTERNATE_COST_PAY_0" />
 </UTILITY_ABILITY>
 
  <HELP title="MORE_INFO_BADGE_TITLE_10" body="MORE_INFO_BADGE_BODY_10" zone="ZONE_ANY" />
  <AI_BASE_SCORE score="900" zone="ZONE_IN_PLAY" />
  <AI_BASE_SCORE score="1800" zone="ZONE_HAND" />
</CARD_V2>
Last edited by Zambooo on 24 Jul 2012, 12:43, edited 1 time in total.
User avatar
Zambooo
 
Posts: 242
Joined: 01 Jul 2012, 21:33
Has thanked: 19 times
Been thanked: 17 times

Re: Help with "Omniscience" [play nonland card without payin

Postby thefiremind » 23 Jul 2012, 21:42

I'm not sure if "without paying their mana costs" is perfectly equal to "paying {0} rather than paying their mana costs", but if it is, I would take inspiration from Archive Trap:
Code: Select all
  <STATIC_ABILITY filter_zone="ZONE_HAND">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[You may cast nonland cards from your hand without paying their mana costs.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Puoi lanciare carte non terra dalla tua mano senza pagare il loro costo di mana.]]></LOCALISED_TEXT>
    <FILTER>
    return FilteredCard() ~= nil and
    FilteredCard():GetCardType():Test( CARD_TYPE_LAND ) == 0 and
    FilteredCard():GetPlayer() == Object():GetPlayer()
    </FILTER>
    <CONTINUOUS_ACTION layer="6">
    if FilteredCard() ~= nil then
      FilteredCard():GetCurrentCharacteristics():GrantAbility(1)
    end
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
  <UTILITY_ABILITY resource_id="1">
    <COST type="Mana" cost="{0}" qualifier="alternate" tag="ALTERNATE_COST_PAY_0" />
  </UTILITY_ABILITY>
(EDIT: Removed some useless junk from the filter)
Last edited by thefiremind on 17 Jan 2013, 23:00, 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: 721 times

Re: Help with "Omniscience" [play nonland card without payin

Postby Zambooo » 24 Jul 2012, 11:33

Thanks for the suggestion, I'm gonna try it ;)
Well it actually worked but I got 3 option for the cost, its normal mana cost and two times "pay {0}". :?:
Okay maybe it's because I had two of it in play >.>
User avatar
Zambooo
 
Posts: 242
Joined: 01 Jul 2012, 21:33
Has thanked: 19 times
Been thanked: 17 times

Re: Help with "Omniscience" [play nonland card without payin

Postby thefiremind » 12 Aug 2012, 23:01

About the usage of the alternative costs, I want to add that I just coded Fist of Suns, and while paying {0} doesn't have any problem, if the alternative cost requires to actually pay some mana, we have to check by ourselves if it can be paid: the alternative cost doesn't imply it.

If I code Fist of Suns like this:
Code: Select all
  <STATIC_ABILITY filter_zone="ZONE_HAND">
    <FILTER>
    return FilteredCard() ~= nil and
    FilteredCard():GetPlayer() == EffectController() and
    FilteredCard():GetCardType():Test( CARD_TYPE_LAND ) == 0
    </FILTER>
    <CONTINUOUS_ACTION layer="6">
    if FilteredCard() ~= nil then
       FilteredCard():GetCurrentCharacteristics():GrantAbility(1)
    end
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
  <UTILITY_ABILITY resource_id="1">
    <COST type="Mana" cost="{W}{U}{B}{R}{G}" qualifier="alternate" tag="ALTERNATE_COST_PAY_WUBRG" />
  </UTILITY_ABILITY>
then I can choose the alternative cost even if I don't have enough mana, and if I make this choice, the spell will be cast for free.
With this little fix on the filter:
Code: Select all
    <FILTER>
    if EffectController():CanAfford("{W}{U}{B}{R}{G}") == 0 then
       return false
    else
       return FilteredCard() ~= nil and
       FilteredCard():GetPlayer() == EffectController() and
       FilteredCard():GetCardType():Test( CARD_TYPE_LAND ) == 0
    end
    </FILTER>
everything works OK.
< 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: 721 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 25 guests


Who is online

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

Login Form