It is currently 20 Jul 2025, 14:15
   
Text Size

Formal Request Thread

Moderator: CCGHQ Admins

Re: Formal Request Thread

Postby thefiremind » 06 May 2014, 08:56

tomy0619lee wrote:Firestorm
Here's how I would attempt to code it: set the number of targets to the minimum number between the possible targets (sum players and creatures) and the cards you have in your hand (minus 1, which is Firestorm itself). The caster will be free to choose any number of targets within that number, and after that, you can retrieve the Count() of the target chest in order to decide how many cards the caster must discard.
Code: Select all
  <UTILITY_ABILITY qualifier="Additional">
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[As an additional cost to cast Firestorm, discard X cards.]]></LOCALISED_TEXT>
    <COST type="generic">
      <PREREQUISITE>
      return true -- the target part should be enough to check the prerequisites
      </PREREQUISITE>
      <RESOLUTION_TIME_ACTION>
      local player = EffectController()
      local count = EffectDC():Get_Targets(0):Count()
      local filter = ClearFilter()
      filter:SetZone(ZONE_HAND, player)
      filter:Add( FE_CARD_INSTANCE, OP_NOT, EffectSource() )
      target:SetItemCount(count)
      for i=0,count-1 do
         player:SetItemPrompt(i, "CARD_QUERY_CHOOSE_CARD_TO_DISCARD")
      end
      player:ChooseItems( EffectDC():Make_Targets(1) )
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
      local count = EffectDC():Get_Targets(0):Count()
      for i=0,count-1 do
         local target_card = EffectDC():Get_Targets(1):Get_CardPtr(i)
         if target_card ~= nil then
            target_card:Discard()
         end
      end
      </RESOLUTION_TIME_ACTION>
    </COST>
  </UTILITY_ABILITY>

  <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Firestorm deals X damage to each of X target creatures and/or players.]]></LOCALISED_TEXT>
    <SFX text="TARGET_FIREBALL_PLAY" />
    <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:SetFilterType(FILTER_TYPE_CARDS + FILTER_TYPE_PLAYERS)
    filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
    </TARGET_DEFINITION>
    <TARGET tag="CARD_QUERY_CHOOSE_DEAL_X_DAMAGE" definition="0" compartment="0" up_to="1">
    Object():LoadTargetDefinition(0) -- this should automatically load the filter defined in the target definition, if it still works as DotP2013
    local max_targets = Object():GetFilter():Count()
    local max_discards = EffectController():Hand_Count() - 1
    if max_discards &lt; max_targets then
       max_targets = max_discards
    end
    MTG():SetTargetCount(max_targets)
    </TARGET>
...
I'm not sure if this works exactly as I wrote it, but I'm sure you got the idea.
About the X damage, I think you can still read it from EffectDC():Get_Targets(0):Count() (if you look at Summoning Trap it seems that Count() doesn't shrink when pointers get wiped), but in case it doesn't work, you can always save it elsewhere inside the COST code.

tomy0619lee wrote:Last thing: should Firestorm be countered if any of X targets are no longer valid? e.g. if X == 3 and one of the targets is sacrificed while Firestorm is on stack, should Firestorm be countered?
No, the spell gets countered if there are no legal targets at all. As long as there's at least one that is still targettable, the spell works. The engine takes care of that automatically.
< 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: Formal Request Thread

Postby NEMESiS » 06 May 2014, 13:19

Is Stranglehold possible this time around? If so I would like to request it. Also Colfenor's Urn. Thanks!
Last edited by NEMESiS on 06 May 2014, 16:02, edited 1 time in total.
User avatar
NEMESiS
 
Posts: 460
Joined: 03 Jan 2013, 04:02
Location: Pools of Becoming
Has thanked: 70 times
Been thanked: 21 times

Re: Formal Request Thread

Postby Hacker85 » 06 May 2014, 15:16

hi im now trying to make Akroma, Angel of Fury and i need help with the Morph ability is it even possible to code? if yes maybe someone can help me with that.
and it seems like i did a mistake with Borderland Behemoth he just get one +4 counter.
| Open
<STATIC_ABILITY active_zone="ZONE_ANY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Nightmare’s power and toughness are each equal to the number of Swamps you control.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[La force et l'endurance du Cheval de cauchemar sont chacune égales au nombre de marais que vous contrôlez.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Tanto la fuerza como la resistencia de la Pesadilla son iguales al número de pantanos que controles.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Stärke und Widerstandskraft des Nachtmahrs sind gleich der Anzahl an Sümpfen, die du kontrollierst.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[La forza e la costituzione dell’Incubo sono pari al numero di Paludi che controlli.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[夢魔のパワーとタフネスは、それぞれあなたがコントロールする沼の総数に等しい。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[나이트메어의 공격력과 방어력은 각각 당신이 조종하는 늪의 수와 같다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Сила и выносливость Кошмара равны количеству Болот под вашим контролем.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[O poder e a resistência de Pesadelo são ambos iguais ao número de Pântanos que você controla.]]></LOCALISED_TEXT>
<CONTINUOUS_ACTION layer="7A">
if EffectSource() ~= nil then
local characteristics = EffectSource():GetCurrentCharacteristics()
local filter = ClearFilter()

filter:Add( FE_SUBTYPE, OP_IS, LAND_TYPE_SWAMP )
filter:Add( FE_CONTROLLER, OP_IS, EffectController())
local total = filter:Count()

characteristics:Power_Set( total )
characteristics:Toughness_Set( total )
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>


Another edit also trying Urza´s Incubator but something seems wrong with the second ability
| Open
<TRIGGERED_ABILITY replacement_query="1" linked_ability_group="1" active_zone="ZONE_TRANSITION">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[As Urza’s Incubator enters the battlefield, choose a creature type.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[As Urza’s Incubator enters the battlefield, choose a creature type.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[As Urza’s Incubator enters the battlefield, choose a creature type.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[As Urza’s Incubator enters the battlefield, choose a creature type.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Mentre l’Incubatrice di Urza entra nel campo di battaglia, scegli un tipo di creatura.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[As Urza’s Incubator enters the battlefield, choose a creature type.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[As Urza’s Incubator enters the battlefield, choose a creature type.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[As Urza’s Incubator enters the battlefield, choose a creature type.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[As Urza’s Incubator enters the battlefield, choose a creature type.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" />
<RESOLUTION_TIME_ACTION>
local zone
local player
S_CountCreatureTypes(zone, player)
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
local player = EffectController()
return S_ChooseCreatureType(player)
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
LinkedDC():Set_Int(0, S_ChosenCreatureType())
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
MTG():MessageAllPlayers( "CARD_QUERY_CREATURE_TYPE_"..S_ChosenCreatureType()-1000 )
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<STATIC_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Creature spells of the chosen type cost {2} less to cast.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Creature spells of the chosen type cost {2} less to cast.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Creature spells of the chosen type cost {2} less to cast.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Creature spells of the chosen type cost {2} less to cast.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Le magie creatura del tipo scelto costano {2} in meno per essere lanciate.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Creature spells of the chosen type cost {2} less to cast.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Creature spells of the chosen type cost {2} less to cast.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Creature spells of the chosen type cost {2} less to cast.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Creature spells of the chosen type cost {2} less to cast.]]></LOCALISED_TEXT>
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_SUBTYPE, OP_IS, LinkedDC():Get_Int(0) )
</FILTER>
<CONTINUOUS_ACTION layer="7C" filter_id="0">
if FilteredCard() ~= nil then
FilteredObject():DecreaseCost( 2 )
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<AI_BASE_SCORE score="900" zone="ZONE_BATTLEFIELD" />
</CARD_V2>
Hacker85
 
Posts: 31
Joined: 29 Mar 2014, 06:19
Has thanked: 3 times
Been thanked: 0 time

Re: Formal Request Thread

Postby MC Brodie » 06 May 2014, 21:56

Hacker85 wrote:hi im now trying to make Akroma, Angel of Fury and i need help with the Morph ability is it even possible to code? if yes maybe someone can help me with that.
and it seems like i did a mistake with Borderland Behemoth he just get one +4 counter.
| Open
<STATIC_ABILITY active_zone="ZONE_ANY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Nightmare’s power and toughness are each equal to the number of Swamps you control.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[La force et l'endurance du Cheval de cauchemar sont chacune égales au nombre de marais que vous contrôlez.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Tanto la fuerza como la resistencia de la Pesadilla son iguales al número de pantanos que controles.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Stärke und Widerstandskraft des Nachtmahrs sind gleich der Anzahl an Sümpfen, die du kontrollierst.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[La forza e la costituzione dell’Incubo sono pari al numero di Paludi che controlli.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[夢魔のパワーとタフネスは、それぞれあなたがコントロールする沼の総数に等しい。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[나이트메어의 공격력과 방어력은 각각 당신이 조종하는 늪의 수와 같다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Сила и выносливость Кошмара равны количеству Болот под вашим контролем.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[O poder e a resistência de Pesadelo são ambos iguais ao número de Pântanos que você controla.]]></LOCALISED_TEXT>
<CONTINUOUS_ACTION layer="7A">
if EffectSource() ~= nil then
local characteristics = EffectSource():GetCurrentCharacteristics()
local filter = ClearFilter()

filter:Add( FE_SUBTYPE, OP_IS, LAND_TYPE_SWAMP )
filter:Add( FE_CONTROLLER, OP_IS, EffectController())
local total = filter:Count()

characteristics:Power_Set( total )
characteristics:Toughness_Set( total )
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>


Another edit also trying Urza´s Incubator but something seems wrong with the second ability
| Open
<TRIGGERED_ABILITY replacement_query="1" linked_ability_group="1" active_zone="ZONE_TRANSITION">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[As Urza’s Incubator enters the battlefield, choose a creature type.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[As Urza’s Incubator enters the battlefield, choose a creature type.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[As Urza’s Incubator enters the battlefield, choose a creature type.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[As Urza’s Incubator enters the battlefield, choose a creature type.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Mentre l’Incubatrice di Urza entra nel campo di battaglia, scegli un tipo di creatura.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[As Urza’s Incubator enters the battlefield, choose a creature type.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[As Urza’s Incubator enters the battlefield, choose a creature type.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[As Urza’s Incubator enters the battlefield, choose a creature type.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[As Urza’s Incubator enters the battlefield, choose a creature type.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" />
<RESOLUTION_TIME_ACTION>
local zone
local player
S_CountCreatureTypes(zone, player)
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
local player = EffectController()
return S_ChooseCreatureType(player)
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
LinkedDC():Set_Int(0, S_ChosenCreatureType())
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
MTG():MessageAllPlayers( "CARD_QUERY_CREATURE_TYPE_"..S_ChosenCreatureType()-1000 )
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<STATIC_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Creature spells of the chosen type cost {2} less to cast.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Creature spells of the chosen type cost {2} less to cast.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Creature spells of the chosen type cost {2} less to cast.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Creature spells of the chosen type cost {2} less to cast.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Le magie creatura del tipo scelto costano {2} in meno per essere lanciate.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Creature spells of the chosen type cost {2} less to cast.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Creature spells of the chosen type cost {2} less to cast.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Creature spells of the chosen type cost {2} less to cast.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Creature spells of the chosen type cost {2} less to cast.]]></LOCALISED_TEXT>
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_SUBTYPE, OP_IS, LinkedDC():Get_Int(0) )
</FILTER>
<CONTINUOUS_ACTION layer="7C" filter_id="0">
if FilteredCard() ~= nil then
FilteredObject():DecreaseCost( 2 )
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<AI_BASE_SCORE score="900" zone="ZONE_BATTLEFIELD" />
</CARD_V2>
Unfortunately morph is not possible.

I'd help with your Borderland Behemoth if I could but the code you posted is for Nightmare so I'm unsure of what's wrong.

Urza's Incubator is in my mod here. I'm confused enough trying to figure out sumo's "choose a type" functions so I figured it would be easier to just show you a working version instead.

A tip for the future, put your code inside a code block after the spoilers. It will maintain the indentations that way.

Also, whoever asked for Wonder, here it is if you haven't figured it out yet.

Wonder | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="WONDER_376591" />
  <CARDNAME text="WONDER" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Wonder]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[L’Émerveillement]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Maravilla]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Das Wunder]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[La Meraviglia]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[不可思議]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Wonder]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Wonder]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Wonder]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="376591" />
  <ARTID value="376591" />
  <ARTIST name="Rebecca Guay" />
  <CASTING_COST cost="{3}{U}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“The awestruck birds gazed at Wonder. Slowly, timidly, they rose into the air.”
—Scroll of Beginnings]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[« Les oiseaux interloqués regardèrent l’Émerveillement. Lentement, timidement, ils s’élevèrent dans les airs. »
—Le Parchemin des Commencements]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“Las aves temerosas contemplaron a la Maravilla. Despacio, tímidamente, se elevaron”.—Pergamino del comienzo]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[„Vor Ehrfurcht erstarrt blickten die Vögel auf das Wunder. Langsam und vorsichtig erhoben sie sich in die Lüfte.”
—Schriften der Schöpfung]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[“Gli uccelli atterriti fissarono La Meraviglia. Lentamente, timidamente, si levarono in cielo.”
—Pergamena delle Origini]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「鳥たちは畏敬の眼差しで不可思議を見つめた。やがてゆっくり、こわごわと、彼らは空に舞い立った。」
――始まりの書]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[“The awestruck birds gazed at Wonder. Slowly, timidly, they rose into the air.”
—Scroll of Beginnings]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[“The awestruck birds gazed at Wonder. Slowly, timidly, they rose into the air.”
—Scroll of Beginnings]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“The awestruck birds gazed at Wonder. Slowly, timidly, they rose into the air.”
—Scroll of Beginnings]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Incarnation" />
  <EXPANSION value="C13" />
  <RARITY metaname="U" />
  <POWER value="2" />
  <TOUGHNESS value="2" />
  <STATIC_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Flying]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Vol]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Vuela.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Fliegend]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Volare]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[飛行]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[비행]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Полет]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Voar]]></LOCALISED_TEXT>
    <INTRINSIC characteristic="CHARACTERISTIC_FLYING" />
  </STATIC_ABILITY>
  <STATIC_ABILITY active_zone="ZONE_GRAVEYARD">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[As long as Wonder is in your graveyard and you control an Island, creatures you control have flying.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[As long as Wonder is in your graveyard and you control an Island, creatures you control have flying.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Mientras la Maravilla esté en tu cementerio y controles una isla, las criaturas que controlas tienen la habilidad de volar.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[As long as Wonder is in your graveyard and you control an Island, creatures you control have flying.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta viene lanciata una magia, neutralizzala se una carta con lo stesso nome è in un cimitero o se un permanente non pedina con lo stesso nome è sul campo di battaglia.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[As long as Wonder is in your graveyard and you control an Island, creatures you control have flying.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[As long as Wonder is in your graveyard and you control an Island, creatures you control have flying.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[As long as Wonder is in your graveyard and you control an Island, creatures you control have flying.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[As long as Wonder is in your graveyard and you control an Island, creatures you control have flying.]]></LOCALISED_TEXT>
      <FILTER filter_id="0">
    local filter = ClearFilter()
    filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
    filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
    </FILTER>
      <CONTINUOUS_ACTION layer="6" filter_id="0">
    if FilteredCard() ~= nil then
       local filter = ClearFilter()
       filter:Add(FE_SUBTYPE, OP_IS, LAND_TYPE_ISLAND)
       filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
       if filter:CountStopAt(1) == 1 then
          FilteredCard():GetCurrentCharacteristics():Bool_Set(CHARACTERISTIC_FLYING, 1)
       end
    end
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
  <HELP title="MORE_INFO_BADGE_TITLE_10" body="MORE_INFO_BADGE_BODY_10" zone="ZONE_ANY" />
  <SFX text="COMBAT_BLUNT_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_BLUNT_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
   <AI_BASE_SCORE score="-150" zone="ZONE_HAND" />
   <AI_BASE_SCORE score="-150" zone="ZONE_BATTLEFIELD" />
   <AI_BASE_SCORE score="450" zone="ZONE_GRAVEYARD" />
</CARD_V2>
Edit - Nemesis, as far as I know determining which turn is a player's extra turn is impossible without coding something into every card that grants an extra turn. I'd imagine the the same could be said about searching libraries.

Edit 2 - Nemesis, for your Praetor's Counsel you may need to protect the pointer to the EffectSource() before you exile it incase your opponent finds a way to cast the spell. It may work without doing that but I'm not sure. Try adding this before you exile:

EffectDC():Protect_CardPtr(COMPARTMENT_ID_EFFECT_SOURCE)
-----------------------------------------------------------------------
Song of the Day: 46 and 2 (cover)
MC Brodie
 
Posts: 310
Joined: 01 Jun 2013, 00:10
Has thanked: 44 times
Been thanked: 34 times

Re: Formal Request Thread

Postby NEMESiS » 07 May 2014, 00:39

Why am I getting this error message from my Praetor's Counsel?

Code: Select all
[lua] [string "PRAETORS_COUNSEL_21403412_TITLE (RESOLUTION_TIME_ACTION)~0x000008d5"]:3: attempt to call method 'SetResolutionZone' (a nil value)
[lua] [string "PRAETORS_COUNSEL_21403412_TITLE (RESOLUTION_TIME_ACTION)~0x000008d5"]:3: attempt to call method 'SetResolutionZone' (a nil value)
Here is my code:

Code: Select all
 <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Return all cards from your graveyard to your hand. Exile Praetor’s Counsel. You have no maximum hand size for the rest of the game.]]></LOCALISED_TEXT>
    <SFX text="GLOBAL_WARP_PLAY" />
    <RESOLUTION_TIME_ACTION>
    EffectController():MoveLocalZone( ZONE_GRAVEYARD, ZONE_HAND )
    Object():SetResolutionZone( ZONE_REMOVED_FROM_GAME )
    </RESOLUTION_TIME_ACTION>
    <CONTINUOUS_ACTION layer="8">
    EffectController():GetCurrentCharacteristics():Bool_Set( PLAYER_CHARACTERISTIC_NO_HAND_LIMIT, 1 )
    </CONTINUOUS_ACTION>
    <DURATION>
    return EffectController() == nil
    </DURATION>
    <RESOLUTION_TIME_ACTION>
      if EffectSource() ~= nil then
       EffectSource():Exile()
      end
    </RESOLUTION_TIME_ACTION>
  </SPELL_ABILITY>
the card seems to work fine though...

EDIT: I will try that MC Brodie
User avatar
NEMESiS
 
Posts: 460
Joined: 03 Jan 2013, 04:02
Location: Pools of Becoming
Has thanked: 70 times
Been thanked: 21 times

Re: Formal Request Thread

Postby RiiakShiNal » 07 May 2014, 02:53

NEMESiS wrote:Why am I getting this error message from my Praetor's Counsel?

Code: Select all
[lua] [string "PRAETORS_COUNSEL_21403412_TITLE (RESOLUTION_TIME_ACTION)~0x000008d5"]:3: attempt to call method 'SetResolutionZone' (a nil value)
[lua] [string "PRAETORS_COUNSEL_21403412_TITLE (RESOLUTION_TIME_ACTION)~0x000008d5"]:3: attempt to call method 'SetResolutionZone' (a nil value)
...

the card seems to work fine though...
SetResolutionZone() is not a valid function in DotP 2014 (at least not on card objects). The reason the card still works is because your call to it is the last call in a block (therefore when it errors out the block had already finished everything else it was supposed to do) and you exile the card (EffectSource()) in a later RESOLUTION_TIME_ACTION.
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Formal Request Thread

Postby Hacker85 » 08 May 2014, 14:59

oh sorry copied the wrong text here is the Borderland Behemoth
| Open
<STATIC_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Borderland Behemoth gets +4/+4 for each other Giant you control.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Le Béhémoth des frontières gagne +4/+4 pour chaque autre géant que vous contrôlez.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[El Behemot fronterizo obtiene +4/+4 por cada otro Gigante que controles.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Der Grenzlandbehemoth erhält +4/+4 für jeden anderen Riesen, den du kontrollierst.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Il Behemoth delle Terre di Confine prende +4/+4 per ogni altro Gigante che controlli.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[国境地帯のビヒモスは、あなたがコントロールする他の巨人1つにつき+4/+4の修整を受ける。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Borderland Behemoth gets +4/+4 for each other Giant you control.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Приграничное Чудище получает +4/+4 за каждого другого Гиганта под вашим контролем.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Behemoth da Fronteira recebe +4/+4 para cada outro Gigante que você controla.]]></LOCALISED_TEXT>
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_CARD_INSTANCE, OP_IS, EffectSource() )
filter:Add( FE_SUBTYPE, OP_IS, CREATURE_TYPE_GIANT )
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
</FILTER>

<CONTINUOUS_ACTION layer="7C" filter_id="0">
if FilteredCard() ~= nil then
local characteristics = FilteredCard():GetCurrentCharacteristics()
characteristics:Power_Add( 4 )
characteristics:Toughness_Add( 4 )
end
</CONTINUOUS_ACTION>
Hacker85
 
Posts: 31
Joined: 29 Mar 2014, 06:19
Has thanked: 3 times
Been thanked: 0 time

Re: Formal Request Thread

Postby MC Brodie » 08 May 2014, 15:44

Well there are multiple reasons why your code isn't working as you expect. Your current code basically says "If this card is a creature and a giant it gets +4/+4." Try changing these things:

-First you need to correct your filter. You are suppose to be filtering for "other" giants. So change OP_IS to OP_NOT in the FE_CARD_INSTANCE line.

-Now you need to count the number permanents that match this filter criteria and save it in a chest. I think it would be easier to do the filtering in a resolution time action instead of a filter block. Then to store the information in a chest try:
EffectDC():Set_Int(0, filter:Count() )

-In your continuous action you are only applying the buff to the effect source so replace FiletedCard() with EffectSource(). Then the buff you are applying is 4 multiplied by your count you stored in the data chest earlier.

If any of that actually makes sense, does it help? I haven't done any modding in ages
-----------------------------------------------------------------------
Song of the Day: 46 and 2 (cover)
MC Brodie
 
Posts: 310
Joined: 01 Jun 2013, 00:10
Has thanked: 44 times
Been thanked: 34 times

Re: Formal Request Thread

Postby RiiakShiNal » 08 May 2014, 15:58

Hacker85 wrote:oh sorry copied the wrong text here is the Borderland Behemoth
| Open
<STATIC_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Borderland Behemoth gets +4/+4 for each other Giant you control.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Le Béhémoth des frontières gagne +4/+4 pour chaque autre géant que vous contrôlez.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[El Behemot fronterizo obtiene +4/+4 por cada otro Gigante que controles.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Der Grenzlandbehemoth erhält +4/+4 für jeden anderen Riesen, den du kontrollierst.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Il Behemoth delle Terre di Confine prende +4/+4 per ogni altro Gigante che controlli.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[国境地帯のビヒモスは、あなたがコントロールする他の巨人1つにつき+4/+4の修整を受ける。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Borderland Behemoth gets +4/+4 for each other Giant you control.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Приграничное Чудище получает +4/+4 за каждого другого Гиганта под вашим контролем.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Behemoth da Fronteira recebe +4/+4 para cada outro Gigante que você controla.]]></LOCALISED_TEXT>
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_CARD_INSTANCE, OP_IS, EffectSource() )
filter:Add( FE_SUBTYPE, OP_IS, CREATURE_TYPE_GIANT )
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
</FILTER>

<CONTINUOUS_ACTION layer="7C" filter_id="0">
if FilteredCard() ~= nil then
local characteristics = FilteredCard():GetCurrentCharacteristics()
characteristics:Power_Add( 4 )
characteristics:Toughness_Add( 4 )
end
</CONTINUOUS_ACTION>
Much of what MC Brodie said is accurate, but you would not use a RESOLUTION_TIME_ACTION here (doesn't make sense for this card) and there is no need to store the count (everything is done in one block):
Corrected block | Open
Code: Select all
<CONTINUOUS_ACTION layer="7C">
  if (EffectSource() ~= nil) then
    local filter = ClearFilter()
    filter:Add( FE_CARD_INSTANCE, OP_NOT, EffectSource() )
    filter:Add( FE_SUBTYPE, OP_IS, CREATURE_TYPE_GIANT )
    filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
    local count = filter:Count()
    local characteristics = EffectSource():GetCurrentCharacteristics()
    characteristics:Power_Add( 4 * count )
    characteristics:Toughness_Add( 4 * count )
  end
</CONTINUOUS_ACTION>
Edit: Applied the fix thefiremind mentioned (removed the creature check from the filter).
Last edited by RiiakShiNal on 08 May 2014, 20:27, edited 1 time in total.
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Formal Request Thread

Postby thefiremind » 08 May 2014, 16:05

MC Brodie wrote:FiletedCard
It sounds like some sort of dish... :lol:
Jokes aside, I wouldn't use any FILTER block here: the bonus is granted to EffectSource only, so it just needs to count the other Giants in the CONTINUOUS_ACTION and then apply the bonus, like RiiakShiNal did. It needs one more fix, though: the card says "for each other Giant", not "for each other Giant creature", so you shouldn't filter creatures because Favor of the Mighty would also count for the bonus.
< 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: Formal Request Thread

Postby Hacker85 » 08 May 2014, 19:01

ok thanks guys
Hacker85
 
Posts: 31
Joined: 29 Mar 2014, 06:19
Has thanked: 3 times
Been thanked: 0 time

Re: Formal Request Thread

Postby MC Brodie » 08 May 2014, 23:29

RiiakShiNal wrote:Much of what MC Brodie said is accurate, but you would not use a RESOLUTION_TIME_ACTION here (doesn't make sense for this card) and there is no need to store the count (everything is done in one block):
That's good to know. For some reason in a similar circumstance (I can't remember the exact scenario) the card wouldn't function correctly unless I did the calculation in an RTA instead on an all inclusive CA.

thefiremind wrote:
MC Brodie wrote:FiletedCard
It sounds like some sort of dish... :lol:
:lol: New phone, new autocorrect problems. Lunch is too short to proofread. Expect more typos to come. At least it wasn't as bad as what I sent my co-worker.
-----------------------------------------------------------------------
Song of the Day: 46 and 2 (cover)
MC Brodie
 
Posts: 310
Joined: 01 Jun 2013, 00:10
Has thanked: 44 times
Been thanked: 34 times

Re: Formal Request Thread

Postby RiiakShiNal » 09 May 2014, 12:16

MC Brodie wrote:That's good to know. For some reason in a similar circumstance (I can't remember the exact scenario) the card wouldn't function correctly unless I did the calculation in an RTA instead on an all inclusive CA.
You're probably thinking about a spell (SPELL_ABILITY) or permanent (ACTIVATED_ABILITY/TRIGGERED_ABILITY) that says give +X/+X to a target creature based on some number of cards on the battlefield. In that case the number for X would be locked in during a RESOLUTION_TIME_ACTION (and would need to be stored in the EffectDC()) then used in a separate CONTINUOUS_ACTION to actually be applied to the target creature. However, for a STATIC_ABILITY the amount is continuously recalculated thus you do the count during the CONTINUOUS_ACTION.
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Formal Request Thread

Postby tomy0619lee » 09 May 2014, 17:11

| Open
thefiremind wrote:
tomy0619lee wrote:Firestorm
Here's how I would attempt to code it: set the number of targets to the minimum number between the possible targets (sum players and creatures) and the cards you have in your hand (minus 1, which is Firestorm itself). The caster will be free to choose any number of targets within that number, and after that, you can retrieve the Count() of the target chest in order to decide how many cards the caster must discard.
Code: Select all
  <UTILITY_ABILITY qualifier="Additional">
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[As an additional cost to cast Firestorm, discard X cards.]]></LOCALISED_TEXT>
    <COST type="generic">
      <PREREQUISITE>
      return true -- the target part should be enough to check the prerequisites
      </PREREQUISITE>
      <RESOLUTION_TIME_ACTION>
      local player = EffectController()
      local count = EffectDC():Get_Targets(0):Count()
      local filter = ClearFilter()
      filter:SetZone(ZONE_HAND, player)
      filter:Add( FE_CARD_INSTANCE, OP_NOT, EffectSource() )
      target:SetItemCount(count)
      for i=0,count-1 do
         player:SetItemPrompt(i, "CARD_QUERY_CHOOSE_CARD_TO_DISCARD")
      end
      player:ChooseItems( EffectDC():Make_Targets(1) )
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
      local count = EffectDC():Get_Targets(0):Count()
      for i=0,count-1 do
         local target_card = EffectDC():Get_Targets(1):Get_CardPtr(i)
         if target_card ~= nil then
            target_card:Discard()
         end
      end
      </RESOLUTION_TIME_ACTION>
    </COST>
  </UTILITY_ABILITY>

  <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Firestorm deals X damage to each of X target creatures and/or players.]]></LOCALISED_TEXT>
    <SFX text="TARGET_FIREBALL_PLAY" />
    <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:SetFilterType(FILTER_TYPE_CARDS + FILTER_TYPE_PLAYERS)
    filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
    </TARGET_DEFINITION>
    <TARGET tag="CARD_QUERY_CHOOSE_DEAL_X_DAMAGE" definition="0" compartment="0" up_to="1">
    Object():LoadTargetDefinition(0) -- this should automatically load the filter defined in the target definition, if it still works as DotP2013
    local max_targets = Object():GetFilter():Count()
    local max_discards = EffectController():Hand_Count() - 1
    if max_discards &lt; max_targets then
       max_targets = max_discards
    end
    MTG():SetTargetCount(max_targets)
    </TARGET>
...
I'm not sure if this works exactly as I wrote it, but I'm sure you got the idea.
About the X damage, I think you can still read it from EffectDC():Get_Targets(0):Count() (if you look at Summoning Trap it seems that Count() doesn't shrink when pointers get wiped), but in case it doesn't work, you can always save it elsewhere inside the COST code.

tomy0619lee wrote:Last thing: should Firestorm be countered if any of X targets are no longer valid? e.g. if X == 3 and one of the targets is sacrificed while Firestorm is on stack, should Firestorm be countered?
No, the spell gets countered if there are no legal targets at all. As long as there's at least one that is still targettable, the spell works. The engine takes care of that automatically.
A belated thanks Firemind. I'll test it soon.

Tomy

Edit: Firemind, the code taught me quite a bit about code mechanics in dotp 2014. Thanks for that.
tomy0619lee
 
Posts: 13
Joined: 11 Mar 2013, 03:38
Has thanked: 3 times
Been thanked: 1 time

Re: Formal Request Thread

Postby thefiremind » 15 May 2014, 11:17

This is one of the previews from the Vintage Masters online set, and it actually comes from the next "real" expansion, Conspiracy:
Image
I like the idea of the dethrone mechanic, so I tried to code it the best possible way:
Code: Select all
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Dethrone]]></LOCALISED_TEXT>
    <TRIGGER value="ATTACKING" simple_qualifier="self">
    local defender_life = EffectSource():GetPlayerAttacked():GetLifeTotal()
    for i=0,MTG():GetNumberOfPlayers()-1 do
       if MTG():GetNthPlayer(i):GetLifeTotal() &gt; defender_life then
          return false
       end
    end
    return true
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
       EffectSource():AddCounters( MTG():PlusOnePlusOneCounters(), 1 )
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
The trigger returns false as soon as it finds a player who has more life than the defending player; if that never happens, it returns true.
Feel free to code your own Marchesa with this. :)
< 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

PreviousNext

Return to 2014

Who is online

Users browsing this forum: No registered users and 8 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 8 users online :: 0 registered, 0 hidden and 8 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 8 guests

Login Form