It is currently 05 Sep 2025, 03:02
   
Text Size

Formal Request Thread

Moderator: CCGHQ Admins

Re: Formal Request Thread

Postby Hacker85 » 22 Sep 2014, 17:04

i have Terror of Kruin Pass here but cant get the second ability to work "Each Werewolf you control can’t be blocked except by two or more creatures". tried a few things but didnt worked.
Code: Select all
   <TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_TRANSITION">
    <TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_ANY" from_zone="ZONE_BATTLEFIELD" />
    <RESOLUTION_TIME_ACTION>
    TFM_Transform().ResetTransformation()
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
 
  <STATIC_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Double strike]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Double initiative]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Daña dos veces.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Doppelschlag]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Doppio attacco]]></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[Golpe duplo]]></LOCALISED_TEXT>
    <INTRINSIC characteristic="CHARACTERISTIC_DOUBLE_STRIKE" />
  </STATIC_ABILITY>
  <STATIC_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Each Werewolf you control can’t be blocked except by two or more creatures.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Chaque loup-garou que vous contrôlez ne peut être bloqué excepté par deux créatures ou plus.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cada Licántropo que controlas no puede ser bloqueado excepto por dos o más criaturas.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Jeder Werwolf, den du kontrollierst, kann nicht geblockt werden, außer von zwei oder mehr Kreaturen.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogni Mannaro che controlli non può essere bloccato tranne che da due o più creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたがコントロールする各狼男は、2体以上のクリーチャーによってしかブロックされない。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Each Werewolf you control can’t be blocked except by two or more creatures.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый Вервольф под вашим контролем не может быть заблокирован менее чем двумя существами.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Cada Lobisomem que você controla só pode ser bloqueado por duas ou mais criaturas.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[每个由你操控的狼人都只能被两个或更多生物阻挡。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[每個由你操控的狼人都只能被兩個或更多生物阻擋。]]></LOCALISED_TEXT>
    <FILTER filter_id="0" reevaluates="1">
    local filter = ClearFilter()
    filter:Add( FE_CARD_INSTANCE, OP_NOT, EffectSource() )
    filter:Add( FE_SUBTYPE, OP_IS, CREATURE_TYPE_WEREWOLF )
   filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
    filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
    </FILTER>
   <CONTINUOUS_ACTION layer="8" filter_id="0">
       if FilteredCard() ~= nil then
         FilteredCard():GetCurrentCharacteristics():Bool_Set(CHARACTERISTIC_CANT_BE_BLOCKED_EXCEPT_BY_TWO_OR_MORE_CREATURES, 1)
       end
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
 
 <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of each upkeep, if a player cast two or more spells last turn, transform Terror of Kruin Pass.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Au début de chaque entretien, si un joueur a lancé au moins deux sorts au tour précédent, transformez la Terreur du Col de Kruin.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Al comienzo de cada mantenimiento, si un jugador lanzó dos o más hechizos en el último turno, transforma al Terror del Paso Kruin.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Transformiere zu Beginn jedes Versorgungssegments den Schrecken vom Kruinpass, falls ein Spieler im letzten Zug zwei oder mehr Zaubersprüche gewirkt hat.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[All’inizio di ogni mantenimento, se nell’ultimo turno un giocatore ha lanciato due o più magie, trasforma il Terrore di Passo Kruin.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[各アップキープの開始時に、直前のターンにいずれかのプレイヤーが2つ以上の呪文を唱えていた場合、クルーイン峡の恐怖を変身させる。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[At the beginning of each upkeep, if a player cast two or more spells last turn, transform Terror of Kruin Pass.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[В начале каждого шага поддержки, если в предыдущем ходу игрок разыграл не менее двух заклинаний, трансформируйте Грозу Круинского Перевала.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[No início de cada manutenção, se um jogador tiver conjurado duas ou mais mágicas no último turno, transforme Terror do Passo de Kruin.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[在每个维持开始时,若某牌手上回合施放了两个或更多咒语,转化克廉峡惧兽。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[在每個維持開始時,若某玩家上回合施放了兩個或更多咒語,轉化克廉峽懼獸。]]></LOCALISED_TEXT>
 <TRIGGER value="BEGINNING_OF_STEP">
    return MTG():GetStep() == STEP_UPKEEP
    </TRIGGER>
    <INTERVENING_IF ignore_resolution_check="1">
    return TFM_Transform().GetMoonCount() == 2
    </INTERVENING_IF>
    <RESOLUTION_TIME_ACTION>
    TFM_Transform().DoTransformation( EffectSource() )
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_ANY">
    <TRIGGER value="BEGINNING_OF_STEP">
    return MTG():GetStep() == STEP_CLEANUP
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    TFM_Transform().SaveMoonCount()
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
Hacker85
 
Posts: 31
Joined: 29 Mar 2014, 06:19
Has thanked: 3 times
Been thanked: 0 time

Re: Formal Request Thread

Postby thefiremind » 22 Sep 2014, 19:59

The reevaluates="1" has no use on static abilities, it's used when the buff is temporary and you want it to affect also permanents that enter the battlefield later. The FE_CARD_INSTANCE filter is wrong, the card doesn't say "Other Werewolf creatures" so it should affect itself too.

Other than that, the code is correct: the bug is in the game. Somehow the AI can cheat on attacking/blocking restrictions, and with transform cards it always happens, I don't know why.
< 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 » 22 Sep 2014, 20:03

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

Re: Formal Request Thread

Postby Hacker85 » 24 Sep 2014, 18:46

im making the Innistrad Set Cards which werent made from any other modders. ive done most of them now, but havent testet them. when i know they all work properly im going to share it.
but i need some help with some harder cards so maybe someone can help.
the missing cards are:
Back from the Brink (almost impossible)
Divine Reckoning
Runic Repetition
Stitcher’s Apprentice
Stony Silence (impossible)
some help would be nice :D
Hacker85
 
Posts: 31
Joined: 29 Mar 2014, 06:19
Has thanked: 3 times
Been thanked: 0 time

Re: Formal Request Thread

Postby Xander9009 » 24 Sep 2014, 19:47

Hacker85 wrote:im making the Innistrad Set Cards which werent made from any other modders. ive done most of them now, but havent testet them. when i know they all work properly im going to share it.
but i need some help with some harder cards so maybe someone can help.
the missing cards are:
Back from the Brink (almost impossible)
Divine Reckoning
Runic Repetition
Stitcher’s Apprentice
Stony Silence (impossible)
some help would be nice :D
Back from the Brink: It's probably not possible for a perfect card, but with a lot of work you might be able to approximate it.
Divine Reckoning | Open
Code: Select all
<RESOLUTION_TIME_ACTION repeating="1">
    local n = MTG():GetActionRepCount()
    local num_Players = MTG():GetNumberOfPlayers()
    if (n &lt; num_Players) then
       local player = MTG():GetNthPlayer(n)
       local filter = ClearFilter()
       filter:Add(FE_CONTROLLER, OP_IS, player)
       filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
       local numItemsToSacrifice = filter:Count() - EffectDC():Get_Int(0)
       player:SetItemCount( 1 )
       player:SetItemPrompt( 0, "CARD_QUERY_CHOOSE_CREATURE" )
       player:ChooseItems( EffectDC():Make_Targets(n+1) )
       return true
    else
       for i = 0, (num_Players-1) do
         local player = MTG():GetNthPlayer(n)
         local targetDC = EffectDC():Get_Targets(i+1)
         local filter = ClearFilter()
         filter:Add(FE_CONTROLLER, OP_IS, player)
         filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
         local Count = filter:EvaluateObjects()
         for i=0,(Count-1) do
            local Card = filter:GetNthEvaluatedObject(i)
            if Card ~= nil and Card ~= targetDC:Get_CardPtr(0) then
               Card:Destroy()
            end
         end
      end
      return false
   end
</RESOLUTION_TIME_ACTION>
Runic Repetition: I don't think we can target exiled cards.
Stitcher’s Apprentice | Open
Code: Select all
<ACTIVATED_ABILITY>
   <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{1}{U}, {T}: Put a 2/2 blue Homunculus creature token onto the battlefield, then sacrifice a creature.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{1}{U}, {T} : Mettez sur le champ de bataille un jeton de créature 2/2 bleue Homoncule, puis sacrifiez une créature.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{1}{U}, {T}: Pon en el campo de batalla una ficha de criatura Homúnculo azul 2/2, luego sacrifica una criatura.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{1}{U}, {T}: Bringe einen 2/2 blauen Homunkulus-Kreaturenspielstein ins Spiel und opfere dann eine Kreatur.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{1}{U}, {T}: Metti sul campo di battaglia una pedina creatura Omuncolo 2/2 blu, poi sacrifica una creatura.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{1}{U}, {T}:青の2/2のホムンクルス・クリーチャー・トークンを1体戦場に出し、その後クリーチャーを1体生け贄に捧げる。]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{1}{U}, {T}: Put a 2/2 blue Homunculus creature token onto the battlefield, then sacrifice a creature.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{1}{U}, {T}: положите на поле битвы одну фишку существа 2/2 синий Гомункул, затем пожертвуйте существо.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{1}{U}, {T}: Coloque no campo de batalha uma ficha de criatura azul 2/2 do tipo Homúnculo e depois sacrifique uma criatura.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[{1}{U},{T}:将一个2/2蓝色造妖衍生生物放进战场,然后牺牲一个生物。]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[{1}{U},{T}:將一個2/2藍色造妖衍生生物放進戰場,然後犧牲一個生物。]]></LOCALISED_TEXT>
   <COST mana_cost="{1}{U}" type="Mana" />
   <COST type="TapSelf" />
   <RESOLUTION_TIME_ACTION>
      MTG():PutTokensOntoBattlefield( "TOKEN_HOMUNCULUS_2_2_U_909017", 1, EffectController() )
   </RESOLUTION_TIME_ACTION>
   <RESOLUTION_TIME_ACTION>
      local filter = ClearFilter()
      local subfilter = filter:AddSubFilter_Or()
      filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
      filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
      EffectController():ChooseItem( "CARD_QUERY_CHOOSE_CREATURE_TO_SACRIFICE", EffectDC():Make_Targets(0) )
    </RESOLUTION_TIME_ACTION>
   <RESOLUTION_TIME_ACTION>
      if EffectDC() ~= nil then
         local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
         if target ~= nil then
            EffectController():Sacrifice( target )
         end
      end
    </RESOLUTION_TIME_ACTION>
</ACTIVATED_ABILITY>
<TOKEN_REGISTRATION reservation="1" type="TOKEN_HOMUNCULUS_2_2_U_909017" />
Code: Select all
<?xml version="1.0"?>
<CARD_V2 ExportVersion="1">
<FILENAME text="TOKEN_HOMUNCULUS_2_2_U_909017" />
   <CARDNAME text="HOMUNCULUS" />
   <TITLE>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[HOMUNCULUS]]></LOCALISED_TEXT>
   </TITLE>
   <ARTID value="909017" />
   <COLOUR value="U" />
   <ARTIST name="Unknown" />
   <CASTING_COST cost="" />
   <TYPE metaname="Creature" />
   <SUB_TYPE metaname="Homunculus" />
   <EXPANSION value="DPI" />
   <RARITY metaname="T" />
   <POWER value="2" />
   <TOUGHNESS value="2" />
   <TOKEN />
   <SFX text="COMBAT_CLAW_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
   <SFX text="COMBAT_CLAW_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>
Note that you should change all instances of 909017 in the above card and token to a unique number for your mod.
Stony Silence | Open
Code: Select all
<CONTINUOUS_ACTION layer="8">
local filter = ClearFilter()
filter:Add(FE_TYPE, OP_IS, CARD_TYPE_ARTIFACT)
local Count = filter:EvaluateObjects()
for i=0,(Count-1) do
   local CurrentArtifact = filter:GetNthEvaluatedObject(i)
   if CurrentArtifact ~= nil then
      CurrentArtifact:GetCurrentCharacteristics():Bool_Set( CHARACTERISTIC_CANT_USE_ACTIVATED_ABILITIES, 1 )
   end
end
</CONTINUOUS_ACTION>
I haven't tested any of these. Let me know if any need fixed and I'll take a look.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Formal Request Thread

Postby RiiakShiNal » 24 Sep 2014, 23:19

For Back from the Brink, the hardest part of coding this is correctly setting up the cost as you would need to go through all creatures in your graveyard, calculate the mana costs for all of them, limit those that can be selected based on what the user can actually pay at that time both for determining whether the ability can be activated and for targeting. As such this would probably have to be done as a lua filter on the target definition, but whether all the required operations can be done in a lua filter in a target definition is unknown. Someone who knows more about getting correct mana costs (such as someone who has worked on dual devotion) may be able to shed some more light on this.

For Runic Repetition while we may not be able to directly target exiled cards we could evaluate the exiled cards, put them into a chest and have the user pick from the chest. The issue will be limiting to only cards that have Flashback as you would need to implement some way to check if a card has that as there is no built in characteristic for Flashback (another situation where my custom characteristics could come in handy, but would require changing all cards with flashback to use them) or account for all possible cards with Flashback. As such this card may not be worth spending the time to code.
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Formal Request Thread

Postby CalT2410 » 25 Sep 2014, 00:18

Is it possible for cards like Hall of the Bandit Lord or Generator Servant to be coded? If so, thank you! (Also, if someone can code them and posts them as singular cards, can someone also explain how to install singular cards? I figured out the .wads and all from the big updates but I have yet to figure out where to put singular cards...)
CalT2410
 
Posts: 25
Joined: 23 Sep 2014, 06:07
Has thanked: 0 time
Been thanked: 0 time

Re: Formal Request Thread

Postby volrathxp » 25 Sep 2014, 00:27

CalT2410 wrote:Is it possible for cards like Hall of the Bandit Lord or Generator Servant to be coded? If so, thank you! (Also, if someone can code them and posts them as singular cards, can someone also explain how to install singular cards? I figured out the .wads and all from the big updates but I have yet to figure out where to put singular cards...)
Unfortunately, you can't determine what mana was used to cast something like that, and there's no way to reserve mana for specific kinds of spells, so these two are unable to be coded.
volrathxp
User avatar
volrathxp
 
Posts: 362
Joined: 23 Jul 2014, 17:34
Has thanked: 9 times
Been thanked: 17 times

Re: Formal Request Thread

Postby Xander9009 » 25 Sep 2014, 00:33

They're not possible as far as I know, but it would probably be relatively easy to get them close. Set up a trigger for enters/leaves the battlefield, check if it's a colorless mana token (must be using Riiak's manual mana functions), once it enters the battlefield, as long as not ALL of the colorless tokens leave the battlefield, up to 1 creature can gain haste for Hall of the Bandit Lord and up to 2 for Generator Servant. Once all colorless mana tokens have left the battlefield, even if you could have had more creatures gain haste, end the effect.

As for making single cards work, assuming you have RiiakShiNal's deck builder, go to tools and click setup custom data folder. Now in your game folder, you'll have a folder called "DATA_DLC_DECK_BUILDER_CUSTOM". Go into the subfolders until you find "CARDS". The card xml files go in there. In the same folder as "CARDS" is "ART_ASSETTS", and in that is "ILLUSTRATIONS". Put the images in there.

If you don't have the xml files, just the text, then paste it into notepad, and save it as xml and CHANGE THE ENCODING to utf-8.

If the images you have aren't already in tdx format, then you need use gibbed tools and drop the image onto "Tdx Convert Compressed.bat" after cropping it to the proper size (sorry, don't remember the size).
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Formal Request Thread

Postby volrathxp » 25 Sep 2014, 00:41

Xander9009 wrote:They're not possible as far as I know, but it would probably be relatively easy to get them close. Set up a trigger for enters/leaves the battlefield, check if it's a colorless mana token (must be using Riiak's manual mana functions), once it enters the battlefield, as long as not ALL of the colorless tokens leave the battlefield, up to 1 creature can gain haste for Hall of the Bandit Lord and up to 2 for Generator Servant. Once all colorless mana tokens have left the battlefield, even if you could have had more creatures gain haste, end the effect.

As for making single cards work, assuming you have RiiakShiNal's deck builder, go to tools and click setup custom data folder. Now in your game folder, you'll have a folder called "DATA_DLC_DECK_BUILDER_CUSTOM". Go into the subfolders until you find "CARDS". The card xml files go in there. In the same folder as "CARDS" is "ART_ASSETTS", and in that is "ILLUSTRATIONS". Put the images in there.

If you don't have the xml files, just the text, then paste it into notepad, and save it as xml and CHANGE THE ENCODING to utf-8.

If the images you have aren't already in tdx format, then you need use gibbed tools and drop the image onto "Tdx Convert Compressed.bat" after cropping it to the proper size (sorry, don't remember the size).
That may be as close as you could possibly get them, and even then I'm not totally sure. Would have to try it and test it a lot.
volrathxp
User avatar
volrathxp
 
Posts: 362
Joined: 23 Jul 2014, 17:34
Has thanked: 9 times
Been thanked: 17 times

Re: Formal Request Thread

Postby RiiakShiNal » 25 Sep 2014, 01:40

Actually you can get even closer with Hall of the Bandit Lord and Generator Servant. Because you can get the chest that contains the actual mana tokens produced by those cards if you use Manual Mana using RSN_GetProducedTokenChest() (which you could then take the pointers and store them into a more useful spot like the LinkedDC()). As such you can use a pretrigger delayed triggered ability to check tokens leaving the battlefield to see if it was tapped and it is one of the pointers that was in the token chest and then using another delayed trigger check the the next spell/ability played. If it is an ability then you simply mark saying the mana wasn't used for it's special purpose. If it was a spell then check to see if it met the conditions, if not mark as not useful, otherwise store that creature spell so that upon entering the battlefield (using yet another delayed trigger) you can add the appropriate haste ability. Once all stored tokens from the retrieved chest are nil (meaning they have been used) then you no longer need to continue checking. Additionally, you would probably also want to check for spell/ability resolved to see if the mana left due to some other effect (such as something that forces mana pools to be emptied or a poorly constructed card which forces permanents to be tapped that doesn't take invisible tokens into account). As a spell or ability resolving would usually mean that the mana was tapped for some other reason.

Granted it is still not an optimal solution but it is closer (and more reliable) than the previously suggested method (because it checks to see which mana was actually used). You would of course have to do a good bit of testing to make sure that DotP triggers in an appropriate manner. For example if SPELL_PLAYED triggers before the mana leaves the battlefield then it will become harder to detect properly and get right (but should generally still be workable).
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Formal Request Thread

Postby Xander9009 » 25 Sep 2014, 02:07

Riiak: what about the fact that we can't decide which mana gets used? For instance, say I tap a Generator Servant and an Orzhov Basilica, and I cast Adaptive Automaton and then Chronomaton. With an actual game, they'd both have haste. But depending on which sources of mana the game decides to use, yours wouldn't, would it? I mean, I'm not saying yours wouldn't possibly be more reliable, but I think I would handle fringe cases like that better. Also, I went ahead and coded it the way I was thinking because I didn't notice your post until I just popped in to post my code. Mine also has one limitation that I can easily spot: if you still have left-over colorless mana, you should be able to not give the creature haste (having saved that particular mana for some reason), but as it's coded, haste is granted in the order you cast creatures, even if you have enough colorless mana that you could theoretically have been saving it. (The only real situation I can think of where this could potentially be an issue is if you're hoarding mana with Kruphix, God of Horizons.)

Some Code | Open
Code: Select all
<ACTIVATED_ABILITY forced_skip="1">
   <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{T}: Add {1} to your mana pool.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{T} : Ajoutez {1} à votre réserve.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{T}: Agrega {1} a tu reserva de maná.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{T}: Erhöhe deinen Manavorrat um {1}.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{T}: Aggiungi {1} alla tua riserva di mana.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{T}:あなたのマナ・プールに{1}を加える。]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{T}: {1}를 당신의 마나풀에 담는다.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{T}: добавьте {1} в ваше хранилище маны.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{T}: Adicione {1} à sua reserva de mana.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[{T}:加{1}到你的法术力池中。]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[{T}:加{1}到你的魔法力池中。]]></LOCALISED_TEXT>
   <COST type="TapSelf" />
   <PLAY_TIME_ACTION>
      RSN_MarkManaAbilityStart()
   </PLAY_TIME_ACTION>
   <RESOLUTION_TIME_ACTION>
      RSN_Produce( "{1}", 1 )
      local delayDC = EffectDC():Make_Chest(1)
      local oDC = RSN_GetObjectDC( EffectSource() )
      oDC:Int_Inc(0, 1)
      MTG():CreateDelayedTrigger(0)
      MTG():CreateDelayedTrigger(1)
   </RESOLUTION_TIME_ACTION>
   <RESOLUTION_TIME_ACTION>
      RSN_EliminateExtraManaTokens()
      RSN_MarkManaAbilityEnd()
   </RESOLUTION_TIME_ACTION>
   <AI_AVAILABILITY window_step="upkeep" type="window" />
   <AI_AVAILABILITY window_step="main_1" window_turn="my_turn" type="window" />
   <AI_AVAILABILITY window_step="begin_combat" window_turn="their_turn" type="window" />
   <AI_AVAILABILITY window_step="declare_attackers" window_turn="their_turn" type="window" />
   <AI_AVAILABILITY window_step="declare_blockers" type="window" />
   <AI_AVAILABILITY window_step="main_2" window_turn="my_turn" type="window" />
   <AI_AVAILABILITY window_step="end_of_turn" type="window" />
   <AI_AVAILABILITY window_step="end_of_turn" window_turn="their_turn" type="window" />
   <AI_AVAILABILITY type="in_response" response_source="1" response_target="1" />
   <AI_AVAILABILITY type="in_response" response_source="1" />
   <AI_AVAILABILITY type="in_response" response_target="1" />
</ACTIVATED_ABILITY>
<TRIGGERED_ABILITY resource_id="0" forced_skip="1">
   <TRIGGER value="ZONECHANGE_END" simple_qualifier="objectyoucontrol" to_zone="ZONE_ANY" from_zone="ZONE_ANY">
      return TriggerObject():GetName() == "RSN_TOKEN_MANA_C"
   </TRIGGER>
   <RESOLUTION_TIME_ACTION>
      local oDC = RSN_GetObjectDC( EffectSource() )
      local filter = ClearFilter()
      filter:Add(FE_CARD_NAME, OP_IS, "RSN_TOKEN_MANA_C")
      filter:Add(FE_CONTROLLER, OP_IS, EffectController())
      local Count = filter:Count()
      if Count == 0 then
         MTG():RemoveDelayedTrigger(0)
         MTG():RemoveDelayedTrigger(1)
         MTG():RemoveDelayedTrigger(2)
         MTG():RemoveDelayedTrigger(3)
      end
      if Count &lt; oDC:Get_Int(0) then
         oDC:Set_Int(0, Count)
      end
   </RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY resource_id="1" forced_skip="1">
   <TRIGGER value="CONSIDERED_FOR_CAST" simple_qualifier="objectyoucontrol">
      local oDC = RSN_GetObjectDC( EffectSource() )
      if oDC:Get_Int(0) &gt; 0 then
         if TriggerObject():GetCardType():Test( CARD_TYPE_CREATURE ) then
            oDC:Set_CardPtr( 0, TriggerObject() )
            oDC:Protect_CardPtr(0)
            local filter = ClearFilter()
            filter:Add(FE_CARD_NAME, OP_IS, "RSN_TOKEN_MANA_C")
            filter:Add(FE_CONTROLLER, OP_IS, EffectController())
            local Count = filter:Count()
            oDC:Set_Int(1, Count)
            MTG():CreateDelayedTrigger( 2, oDC )
         end
      else
         MTG():RemoveDelayedTrigger(0)
         MTG():RemoveDelayedTrigger(1)
         MTG():RemoveDelayedTrigger(2)
         MTG():RemoveDelayedTrigger(3)
      end
      return false
   </TRIGGER>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY resource_id="2" forced_skip="1">
   <TRIGGER value="SPELL_PLAYED" simple_qualifier="objectyoucontrol">
      local oDC = RSN_GetObjectDC( EffectSource() )
      if oDC:Get_Int(0) &gt; 0 then
         if TriggerObject() == oDC:Get_CardPtr(0) then
            local filter = ClearFilter()
            filter:Add(FE_CARD_NAME, OP_IS, "RSN_TOKEN_MANA_C")
            filter:Add(FE_CONTROLLER, OP_IS, EffectController())
            local Count = filter:Count()
            if oDC:Get_Int(1) &gt; Count then
               MTG():CreateDelayedTrigger( 3, oDC )
               oDC:Int_Dec(0)
            end
         end
      else
         MTG():RemoveDelayedTrigger(0)
         MTG():RemoveDelayedTrigger(1)
         MTG():RemoveDelayedTrigger(2)
         MTG():RemoveDelayedTrigger(3)
      end
      return false
   </TRIGGER>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY resource_id="3">
   <TRIGGER value="ZONECHANGE_END" simple_qualifier="objectyoucontrol" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY">
      local oDC = RSN_GetObjectDC( EffectSource() )
      if TriggerObject() == oDC:Get_CardPtr(0) and TriggerObject():GetCardType():Test( CARD_TYPE_CREATURE ) then
         return true
      end
      return false
   </TRIGGER>
   <CONTINUOUS_ACTION layer="6">
      if TriggerObject() ~= nil and TriggerObject():GetCurrentCharacteristics() ~= nil then
         TriggerObject():GetCurrentCharacteristics():Bool_Set(CHARACTERISTIC_HASTE, 1)
      end
   </CONTINUOUS_ACTION>
   <DURATION>
      return TriggerObject() ~= nil
    </DURATION>
</TRIGGERED_ABILITY>
<STATIC_ABILITY>
   <CONTINUOUS_ACTION layer="0">
      RSN_ClearCanProduceMana()
      RSN_MarkCanProduceMana( "{1}" )
   </CONTINUOUS_ACTION>
   <CONTINUOUS_ACTION layer="8">
      local oCard = EffectSource()
      if (RSN_CheckSwitchToFallback( oCard )) then
         local oCharacteristics = oCard:GetCurrentCharacteristics()
         oCharacteristics:GrantAbility( 4 )
      end
   </CONTINUOUS_ACTION>
</STATIC_ABILITY>
<TRIGGERED_ABILITY forced_skip="1" replacement_effect="1">
   <TRIGGER value="BEGINNING_OF_STEP" pre_trigger="1" />
   <RESOLUTION_TIME_ACTION>
      RSN_ClearProducedMana()
   </RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<MANA_ABILITY resource_id="4">
   <COST type="TapSelf" />
   <PRODUCES amount="{1}" />
</MANA_ABILITY>
<TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_MANA_C" />
This hasn't been tested or debugged. It's almost guaranteed not to work OOTB. But it should be a good starting point. Also, it doesn't include the sacrifice or pay 3 life bits of the costs.

Also, this is set to only work with 1 mana. See "oDC:Int_Set(0, 1)"? Change that to "oDC:Int_Set(0, 2)" for it to work with the other card (and also change all of the mana production to produce 2, of course).
Last edited by Xander9009 on 25 Sep 2014, 13:55, edited 2 times in total.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Formal Request Thread

Postby Blue Ghost » 25 Sep 2014, 05:41

Are Curse of Chaos and Spinerock Knoll codeable? If so, does anyone have them made?
Blue Ghost
 
Posts: 52
Joined: 07 Apr 2013, 20:41
Has thanked: 6 times
Been thanked: 0 time

Re: Formal Request Thread

Postby thefiremind » 25 Sep 2014, 08:40

Blue Ghost wrote:Are Curse of Chaos and Spinerock Knoll codeable?
For Curse of Chaos, the hard part is to take 2HG into account. I made some research and found this:
http://www.mtgsalvation.com/forums/magi ... tia-in-2hg
So, attacking the team counts as attacking each one of the players (no matter who's the cursed one), while the attackers count as separate players. I would make an ATTACKERS_DECLARED trigger with replacement_effect="1" where you cycle through all the attackers and find those who belong to each player: when you find at least one attacking the cursed player's team, you create a delayed STATE_BASED_EFFECTS trigger that lets the attacking player discard and draw. It will appear as if the ATTACKERS_DECLARED trigger were triggering once for each player, which is exactly what should happen. I'll post some code later if nobody else does.

Spinerock Knoll can be made by copying from another hideaway card (I remember sumomole having at least one in his mod), and checking the amount of damage done to an opponent can be made by copying the bloodthirst code, with the exception of using Count rather than Test:
Code: Select all
...
   if interrogation:Count(INTERROGATE_DAMAGE_DEALT, INTERROGATE_THIS_TURN, 7) == 7 then
      -- play the card
   end
...
---------------------------
EDIT:
Curse of Chaos's triggered ability | Open
Code: Select all
  <TRIGGERED_ABILITY replacement_effect="1">
    -- Localised text omitted
    <TRIGGER value="ATTACKERS_DECLARED">
    local cursed = EffectSource() and EffectSource():GetParentPlayer()
    return cursed ~= nil and cursed:MyTurn() == false -- during cursed player's turn this is useless
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    local cursed = EffectSource():GetParentPlayer()
    for i=0,MTG():GetNumberOfPlayers()-1 do
       local player = MTG():GetNthPlayer(i)
       if player ~= nil then
          local filter = ClearFilter()
          filter:Add(FE_IS_ATTACKING, true)
          filter:Add(FE_CONTROLLER, OP_IS, player)
          local filter_count = filter:EvaluateObjects()
          for i=0,filter_count-1 do
             local attacker = filter:GetNthEvaluatedObject(i)
             if attacker:GetPlayerAttacked():GetTeam() == cursed:GetTeam() then
                local delayDC = EffectDC():Make_Chest(i)
                delayDC:Set_PlayerPtr(0, player)
                MTG():CreateDelayedTrigger(1, delayDC) -- create the "discard/draw" trigger for this player
                break
             end
          end
       end
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY resource_id="1">
    -- Repeat localised text here so that players can see what they are asked for with the MAY
    <CLEANUP fire_once="1" />
    <TRIGGER value="STATE_BASED_EFFECTS" />
    <RESOLUTION_TIME_ACTION>
    local player = EffectDC():Get_PlayerPtr(0)
    if player ~= nil then
       local filter = ClearFilter()
       filter:SetZone(ZONE_HAND, player)
       if filter:CountStopAt(1) == 1 then
          player:ChooseItems( "CARD_QUERY_CHOOSE_CARD_TO_DISCARD", EffectDC():Make_Targets(1) )
       end
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local player = EffectDC():Get_PlayerPtr(0)
    if player ~= nil then
       local target_card = EffectDC():Get_Targets(1) and EffectDC():Get_Targets(1):Get_CardPtr(0)
       if target_card ~= nil then
          target_card:Discard()
          return
       end
    end
    EffectDC():Free_Compartment(0) -- if we arrive here, somehow we didn't discard the card, so we won't draw
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local player = EffectDC():Get_PlayerPtr(0)
    if player ~= nil then
       player:DrawCards(1)
    end
    </RESOLUTION_TIME_ACTION>
    <MAY />
  </TRIGGERED_ABILITY>
Last edited by thefiremind on 25 Sep 2014, 19:02, edited 2 times 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: Formal Request Thread

Postby RiiakShiNal » 25 Sep 2014, 11:41

Xander9009 wrote:Riiak: what about the fact that we can't decide which mana gets used? For instance, say I tap a Generator Servant and an Orzhov Basilica, and I cast Adaptive Automaton and then Chronomaton. With an actual game, they'd both have haste. But depending on which sources of mana the game decides to use, yours wouldn't, would it? I mean, I'm not saying yours wouldn't possibly be more reliable, but I think I would handle fringe cases like that better. Also, I went ahead and coded it the way I was thinking because I didn't notice your post until I just popped in to post my code. Mine also has one limitation that I can easily spot: if you still have left-over colorless mana, you should be able to not give the creature haste (having saved that particular mana for some reason), but as it's coded, haste is granted in the order you cast creatures, even if you have enough colorless mana that you could theoretically have been saving it. (The only real situation I can think of where this could potentially be an issue is if you're hoarding mana with Kruphix, God of Horizons.)

Some Code | Open
Code: Select all
<ACTIVATED_ABILITY forced_skip="1">
   <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{T}: Add {1} to your mana pool.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{T} : Ajoutez {1} à votre réserve.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{T}: Agrega {1} a tu reserva de maná.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{T}: Erhöhe deinen Manavorrat um {1}.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{T}: Aggiungi {1} alla tua riserva di mana.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{T}:あなたのマナ・プールに{1}を加える。]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{T}: {1}를 당신의 마나풀에 담는다.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{T}: добавьте {1} в ваше хранилище маны.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{T}: Adicione {1} à sua reserva de mana.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[{T}:加{1}到你的法术力池中。]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[{T}:加{1}到你的魔法力池中。]]></LOCALISED_TEXT>
   <COST type="TapSelf" />
   <PLAY_TIME_ACTION>
      RSN_MarkManaAbilityStart()
   </PLAY_TIME_ACTION>
   <RESOLUTION_TIME_ACTION>
      RSN_Produce( "{1}", 1 )
      local delayDC = EffectDC():Make_Chest(1)
      local oDC = RSN_GetObjectDC( EffectSource() )
      oDC:Int_Set(0, 1)
      MTG():CreateDelayedTrigger(0)
      MTG():CreateDelayedTrigger(1)
   </RESOLUTION_TIME_ACTION>
   <RESOLUTION_TIME_ACTION>
      RSN_EliminateExtraManaTokens()
      RSN_MarkManaAbilityEnd()
   </RESOLUTION_TIME_ACTION>
   <AI_AVAILABILITY window_step="upkeep" type="window" />
   <AI_AVAILABILITY window_step="main_1" window_turn="my_turn" type="window" />
   <AI_AVAILABILITY window_step="begin_combat" window_turn="their_turn" type="window" />
   <AI_AVAILABILITY window_step="declare_attackers" window_turn="their_turn" type="window" />
   <AI_AVAILABILITY window_step="declare_blockers" type="window" />
   <AI_AVAILABILITY window_step="main_2" window_turn="my_turn" type="window" />
   <AI_AVAILABILITY window_step="end_of_turn" type="window" />
   <AI_AVAILABILITY window_step="end_of_turn" window_turn="their_turn" type="window" />
   <AI_AVAILABILITY type="in_response" response_source="1" response_target="1" />
   <AI_AVAILABILITY type="in_response" response_source="1" />
   <AI_AVAILABILITY type="in_response" response_target="1" />
</ACTIVATED_ABILITY>
<TRIGGERED_ABILITY resource_id="0" forced_skip="1">
   <TRIGGER value="ZONECHANGE_END" simple_qualifier="objectyoucontrol" to_zone="ZONE_ANY" from_zone="ZONE_ANY">
      return TriggerObject():GetName() == "RSN_TOKEN_MANA_C"
   </TRIGGER>
   <RESOLUTION_TIME_ACTION>
      local oDC = RSN_GetObjectDC( EffectSource() )
      local filter = ClearFilter()
      filter:Add(FE_CARD_NAME, OP_IS, "RSN_TOKEN_MANA_C")
      filter:Add(FE_CONTROLLER, OP_IS, EffectController())
      local Count = filter:Count()
      if Count == 0 then
         MTG():RemoveDelayedTrigger(0)
         MTG():RemoveDelayedTrigger(1)
         MTG():RemoveDelayedTrigger(2)
         MTG():RemoveDelayedTrigger(3)
      end
      if Count &lt; oDC:Get_Int(0) then
         oDC:Set_Int(0, Count)
      end
   </RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY resource_id="1" forced_skip="1">
   <TRIGGER value="CONSIDERED_FOR_CAST" simple_qualifier="objectyoucontrol">
      local oDC = RSN_GetObjectDC( EffectSource() )
      if oDC:Get_Int(0) &gt; 0 then
         if TriggerObject():GetCardType():Test( CARD_TYPE_CREATURE ) then
            oDC:Set_CardPtr( 0, TriggerObject() )
            oDC:Protect_CardPtr(0)
            local filter = ClearFilter()
            filter:Add(FE_CARD_NAME, OP_IS, "RSN_TOKEN_MANA_C")
            filter:Add(FE_CONTROLLER, OP_IS, EffectController())
            local Count = filter:Count()
            oDC:Set_Int(1, Count)
            MTG():CreateDelayedTrigger( 2, oDC )
         end
      else
         MTG():RemoveDelayedTrigger(0)
         MTG():RemoveDelayedTrigger(1)
         MTG():RemoveDelayedTrigger(2)
         MTG():RemoveDelayedTrigger(3)
      end
      return false
   </TRIGGER>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY resource_id="2" forced_skip="1">
   <TRIGGER value="SPELL_PLAYED" simple_qualifier="objectyoucontrol">
      local oDC = RSN_GetObjectDC( EffectSource() )
      if oDC:Get_Int(0) &gt; 0 then
         if TriggerObject() == oDC:Get_CardPtr(0) then
            local filter = ClearFilter()
            filter:Add(FE_CARD_NAME, OP_IS, "RSN_TOKEN_MANA_C")
            filter:Add(FE_CONTROLLER, OP_IS, EffectController())
            local Count = filter:Count()
            if oDC:Get_Int(1) &gt; Count then
               MTG():CreateDelayedTrigger( 3, oDC )
               oDC:Int_Dec(0)
            end
         end
      else
         MTG():RemoveDelayedTrigger(0)
         MTG():RemoveDelayedTrigger(1)
         MTG():RemoveDelayedTrigger(2)
         MTG():RemoveDelayedTrigger(3)
      end
      return false
   </TRIGGER>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY resource_id="3">
   <TRIGGER value="ZONECHANGE_END" simple_qualifier="objectyoucontrol" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY">
      local oDC = RSN_GetObjectDC( EffectSource() )
      if TriggerObject() == oDC:Get_CardPtr(0) and TriggerObject():GetCardType():Test( CARD_TYPE_CREATURE ) then
         return true
      end
      return false
   </TRIGGER>
   <CONTINUOUS_ACTION layer="6">
      if TriggerObject() ~= nil and TriggerObject():GetCurrentCharacteristics() ~= nil then
         TriggerObject():GetCurrentCharacteristics():Bool_Set(CHARACTERISTIC_HASTE, 1)
      end
   </CONTINUOUS_ACTION>
   <DURATION>
      return TriggerObject() ~= nil
    </DURATION>
</TRIGGERED_ABILITY>
<STATIC_ABILITY>
   <CONTINUOUS_ACTION layer="0">
      RSN_ClearCanProduceMana()
      RSN_MarkCanProduceMana( "{1}" )
   </CONTINUOUS_ACTION>
   <CONTINUOUS_ACTION layer="8">
      local oCard = EffectSource()
      if (RSN_CheckSwitchToFallback( oCard )) then
         local oCharacteristics = oCard:GetCurrentCharacteristics()
         oCharacteristics:GrantAbility( 0 )
      end
   </CONTINUOUS_ACTION>
</STATIC_ABILITY>
<TRIGGERED_ABILITY forced_skip="1" replacement_effect="1">
   <TRIGGER value="BEGINNING_OF_STEP" pre_trigger="1" />
   <RESOLUTION_TIME_ACTION>
      RSN_ClearProducedMana()
   </RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<MANA_ABILITY resource_id="0">
   <COST type="TapSelf" />
   <PRODUCES amount="{1}" />
</MANA_ABILITY>
<TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_MANA_C" />
This hasn't been tested or debugged. It's almost [b]guaranteed[/i] not to work OOTB. But it should be a good starting point. Also, it doesn't include the sacrifice or pay 3 life bits of the costs.

Also, this is set to only work with 1 mana. See "oDC:Int_Set(0, 1)"? Change that to "oDC:Int_Set(0, 2)" for it to work with the other card (and also change all of the mana production to produce 2, of course).
There are more problems with your method as for example if you use Generator Servant and then cast a Sol Ring which you then tapped so you could cast 3 copies of Arcbound Worker. Your method would give 2 of those Arcbound Workers haste even though only 1 should get it. The case here is that you aren't considering that the mana was used for something that isn't a creature.

Another problem you be if you manually produced a {W} mana and then used Generator Servant and cast in this order Soul Warden and 2 copies of Arcbound Worker the Soul Warden and 1 Arcbound Worker would get haste instead of the correct case where both Arcbound Workers would get haste. The problem here is that you aren't considering the case where the player casts a creature that doesn't colourless mana.

Another case would be if you used some of the colourless mana for an ability to say generate coloured mana to use to cast a spell (such as passing it into a Dimir Signet to then cast a Tidehollow Strix). You can have any amount of mana in the pool at any given time (up to 100 of each type as that is a hardcoded limit on tokens placed by the engine) as such any specific mana can be used for anything. For example if you are hoarding mana with Upwelling you aren't even guaranteed to use that mana in that turn it could be much later that you actually end up using it.

So in short yes, my method is more reliable and will behave better in most cases at the moment. Yes, it has issues with fringe cases where a user would want to save the mana and/or split it up to cast multiple creatures, but it behaves better in other cases where some of that mana would get used for some other reason such as increasing the amount of mana available, not using it for creatures without colourless mana, converting it to coloured mana, etc....
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

PreviousNext

Return to 2014

Who is online

Users browsing this forum: No registered users and 6 guests

Main Menu

User Menu

Our Partners


Who is online

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

Login Form