Difference between revisions of "DotP 2014: Manual Mana Functions"
RiiakShiNal (Talk | contribs) (→Change History) |
RiiakShiNal (Talk | contribs) (→Change History) |
||
Line 722: | Line 722: | ||
== Change History == | == Change History == | ||
+ | * v2.2 | ||
+ | ** Changed the order attribute to give it higher priority than the 3 deck packs. | ||
+ | ** Added the 12 new lands from Deck Packs 2 & 3 (Deck Pack 1 did not include any new basic lands). | ||
+ | *** 4 new Islands (ISLAND_373735, ISLAND_373736, ISLAND_373737, ISLAND_373738) | ||
+ | *** 4 new Mountains (MOUNTAIN_373739, MOUNTAIN_373740, MOUNTAIN_373741, MOUNTAIN_373742) | ||
+ | *** 4 new Plains (PLAINS_373743, PLAINS_373744, PLAINS_373745, PLAINS_373746) | ||
* v2.1 | * v2.1 | ||
** Changed the order attribute to try and give it higher priority than the expansion. | ** Changed the order attribute to try and give it higher priority than the expansion. |
Revision as of 15:58, 11 February 2014
This mod is designed to overcome some of the limitations of the mana system in DotP 2014 by changing to a manual mana tapping system with mana tokens. This will update all basic lands included with the game to allow for manual tapping for mana.
Contents
- 1 Requirements
- 2 Installation
- 3 Improvements over Auto-Tapping
- 4 Limitations of the Manual Mana Tapping Method
- 5 Items Included
- 5.1 Cards
- 5.2 Constants - RSN_MANA.LOL
- 5.3 Functions - RSN_MANA.LOL
- 5.3.1 RSN_CheckProducedColour
- 5.3.2 RSN_CheckSwitchToFallback
- 5.3.3 RSN_ClearCanProduceMana
- 5.3.4 RSN_ClearProducedMana
- 5.3.5 RSN_CountColourManaInPlayerPool
- 5.3.6 RSN_CountProducedColours
- 5.3.7 RSN_EliminateExtraManaTokens
- 5.3.8 RSN_EmptyPlayerManaPool
- 5.3.9 RSN_FireManaTrigger
- 5.3.10 RSN_GetCanProduceMana
- 5.3.11 RSN_GetFirstProducibleColour
- 5.3.12 RSN_GetLastProducedColour
- 5.3.13 RSN_GetProducedColourByIndex
- 5.3.14 RSN_GetProducedTokenChest
- 5.3.15 RSN_MarkCanProduceColour
- 5.3.16 RSN_MarkCanProduceColourOfAnyTypeOtherLandPlayerControls
- 5.3.17 RSN_MarkCanProduceMana
- 5.3.18 RSN_MarkManaAbilityEnd
- 5.3.19 RSN_MarkManaAbilityStart
- 5.3.20 RSN_Produce
- 5.3.21 RSN_ProduceForPlayer
- 5.3.22 RSN_ProduceForPlayerNoTrigger
- 5.3.23 RSN_ProduceNoTrigger
- 5.3.24 RSN_UsedManaAbility
- 5.4 Text Permanent - D14_8192_MANA_TEXT.XML
- 6 Change History
- 7 Download
Requirements
Installation
Just drop the wad into the DotP 2014 game directory and you're done.
Improvements over Auto-Tapping
- Allows to tap a land for mana, untap it (using another ability like Arbor Elf's), and tap it again to get more mana than would be possible using Auto-Tapping.
- Allows for cards like Mana Flare, Exotic Orchard, and Reflecting Pool to be made.
- Allows for putting mana into a fake mana pool to be used with cards like Omnath, Locus of Mana.
- Allows for relatively easily creating cards that can produce multiple colours of mana.
- Allows for special lands to not try and use the mana they can produce themselves for another one of their abilities (like Blinkmoth Nexus).
- Allows abilities that produce more than a single mana to be used for casting multiple spells instead of just a single spell. For example using a Sol Ring to cast an Arcbound Worker and a Basilisk Collar. This is not possible with Auto-Tapping.
- Allows the player to select specifically what mana they want to use to cast something by requiring they tap it first rather than being forced to use Colourless mana from a special land or creature when they would prefer to use basic land. This requires workarounds to work with Auto-Tapping.
- Allows the player to use mana sources they prefer to use over the sources the game wants to use. For example you have 2 basic Plains that came into play first and an Abandoned Outpost that came into play later and you want to cast a White Knight, under the Auto-Tapping method the game would tap the Abandoned Outpost and one Plains instead of allowing the player to tap both basic Plains and leave the Abandoned Outpost open for some other use.
- Allows for cards with multiple different mana abilities to be used properly at the player's discretion rather than the game trying to use multiple abilities on the card that all require tapping and producing mana for free (despite the rules).
- Allows for effects like Shizuko, Caller of Autumn where mana can be generated then selectively remain in the "mana pool" until a preset time (like end of turn) or to remain indefinitely (until used).
Limitations of the Manual Mana Tapping Method
- Auto-Tap for basic lands is still present because if the Basic super-type is removed the game will crash.
- If something shuts down activated abilities then the manual tapping method will also be shut-down. Non-basic cards I have made will switch to using a built-in MANA_ABILITY as a fall back in this case (if such a fall back is possible).
- Cards like Signets (Azorius Signet, Selesnya Signet, etc...) will simply cease to function if activated abilities are shutdown due to limitations of MANA_ABILITY.
- Cards like Mana Flare can only function properly with the fake mana abilities because the trigger BECAME_TAPPED_FOR_MANA appears to require manual firing (as such I have not added code to specifically check for basic lands in the trigger).
- For triggered abilities that require mana like Miracle, mana must be tapped and available before trying to use the ability.
- AI does not fully understand how to use manual tapping and will sometimes tap land pointlessly or not generate the colour of mana it needs from multi-colour lands.
Items Included
Cards
- FOREST_357833
- FOREST_357834
- FOREST_357835
- FOREST_357836
- FOREST_357837
- FOREST_357838
- FOREST_357839
- FOREST_357840
- FOREST_357841
- FOREST_357842
- FOREST_357843
- FOREST_357844
- FOREST_357964
- FOREST_357965
- FOREST_357966
- FOREST_357968
- FOREST_357969
- FOREST_357970
- FOREST_357971
- FOREST_357972
- FOREST_357973
- FOREST_357979
- FOREST_369819
- FOREST_369820
- ISLAND_357809
- ISLAND_357810
- ISLAND_357811
- ISLAND_357812
- ISLAND_357813
- ISLAND_357814
- ISLAND_357815
- ISLAND_357816
- ISLAND_357817
- ISLAND_357819
- ISLAND_357934
- ISLAND_357935
- ISLAND_357939
- ISLAND_357940
- ISLAND_357941
- ISLAND_357943
- ISLAND_369824
- ISLAND_369825
- MOUNTAIN_357797
- MOUNTAIN_357798
- MOUNTAIN_357799
- MOUNTAIN_357800
- MOUNTAIN_357801
- MOUNTAIN_357802
- MOUNTAIN_357803
- MOUNTAIN_357804
- MOUNTAIN_357805
- MOUNTAIN_357806
- MOUNTAIN_357807
- MOUNTAIN_357808
- MOUNTAIN_357947
- MOUNTAIN_357954
- MOUNTAIN_357955
- MOUNTAIN_357956
- MOUNTAIN_357957
- MOUNTAIN_357958
- MOUNTAIN_357959
- MOUNTAIN_357960
- MOUNTAIN_357961
- MOUNTAIN_357962
- MOUNTAIN_357963
- MOUNTAIN_369827
- MOUNTAIN_369830
- PLAINS_357845
- PLAINS_357846
- PLAINS_357847
- PLAINS_357848
- PLAINS_357849
- PLAINS_357850
- PLAINS_357851
- PLAINS_357852
- PLAINS_357853
- PLAINS_357854
- PLAINS_357855
- PLAINS_357856
- PLAINS_357924
- PLAINS_357925
- PLAINS_357926
- PLAINS_357927
- PLAINS_357928
- PLAINS_357929
- PLAINS_357930
- PLAINS_357931
- PLAINS_357932
- PLAINS_357933
- PLAINS_357981
- PLAINS_357982
- PLAINS_357983
- PLAINS_369832
- PLAINS_369833
- RSN_TOKEN_MANA_B - Black Mana Token
- RSN_TOKEN_MANA_C - Colourless Mana Token
- RSN_TOKEN_MANA_G - Green Mana Token
- RSN_TOKEN_MANA_R - Red Mana Token
- RSN_TOKEN_MANA_U - Blue Mana Token
- RSN_TOKEN_MANA_W - White Mana Token
- SWAMP_357821
- SWAMP_357822
- SWAMP_357823
- SWAMP_357824
- SWAMP_357825
- SWAMP_357826
- SWAMP_357827
- SWAMP_357828
- SWAMP_357829
- SWAMP_357830
- SWAMP_357831
- SWAMP_357832
- SWAMP_357944
- SWAMP_357946
- SWAMP_357948
- SWAMP_357951
- SWAMP_357952
- SWAMP_357953
- SWAMP_369837
- SWAMP_369838
Constants - RSN_MANA.LOL
- RSN_REGISTER_MANA_COLOUR_PRODUCED = 8192001
- RSN_REGISTER_MANA_TOKEN_CHEST = 8192002
- RSN_REGISTER_MARK_MANA_ABILITY = 8192003
- RSN_REGISTER_MARK_CAN_PRODUCE = 8192004
- RSN_REGISTER_MARK_LAST_PRODUCED = 8192005
- RSN_REGISTER_MARK_EXTRA_MANA_TOKENS = 8192006
- RSN_REGISTER_TOKENS_PRODUCED = 8192008
Functions - RSN_MANA.LOL
- RSN_CheckProducedColour( oCard, nColour )
- RSN_CheckSwitchToFallback( oCard )
- RSN_ClearCanProduceMana()
- RSN_ClearProducedMana()
- RSN_CountColourManaInPlayerPool( nColour, oPlayer )
- RSN_CountProducedColours( oCard )
- RSN_EliminateExtraManaTokens()
- RSN_EmptyPlayerManaPool( oPlayer )
- RSN_FireManaTrigger()
- RSN_GetCanProduceMana( oCard, nColour )
- RSN_GetFirstProducibleColour( oCard )
- RSN_GetLastProducedColour()
- RSN_GetProducedColourByIndex( oCard, nIndex )
- RSN_GetProducedTokenChest()
- RSN_MarkCanProduceColour( nColour )
- RSN_MarkCanProduceColourOfAnyTypeOtherLandPlayerControls( oPlayer )
- RSN_MarkCanProduceMana( sMana )
- RSN_MarkManaAbilityEnd()
- RSN_MarkManaAbilityStart()
- RSN_Produce( sMana, nAmount, bDoNotMark )
- RSN_ProduceForPlayer( sMana, nAmount, oPlayer, bDoNotMark )
- RSN_ProduceForPlayerNoTrigger( sMana, nAmount, oPlayer, bDoNotMark )
- RSN_ProduceNoTrigger( sMana, nAmount, bDoNotMark )
- RSN_UsedManaAbility( oCard )
RSN_CheckProducedColour
This function is used to check to see if a card actually produced a mana of a colour (COLOUR_COLOURLESS is valid). This is used by Mana Flare to enable or disable multiple choice items based on the mana a land produced.
Parameters:
- oCard - The card to check for produced mana.
- nColour - The colour to ask if it was produced (COLOUR_COLOURLESS is valid).
Returns:
- true - If the card actually produced a mana of that colour.
- false - All other cases.
Usage Example:
From Mana Flare:
<RESOLUTION_TIME_ACTION> EffectDC():Int_Set( 1, -1 ) local oCard = TriggerObjectLKI() if (oCard ~= nil) then local nCount = RSN_CountProducedColours( oCard ) if (nCount == 0) then -- Do nothing because no mana was produced. elseif (nCount == 1) then EffectDC():Int_Set( 1, RSN_GetProducedColourByIndex( oCard, 0 ) ) else local oPlayer = oCard:GetPlayer() if (oPlayer ~= nil) then oPlayer:BeginNewMultipleChoice() oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_C", (RSN_CheckProducedColour( oCard, COLOUR_COLOURLESS ) > 0) ) oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_W", (RSN_CheckProducedColour( oCard, COLOUR_WHITE ) > 0) ) oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_U", (RSN_CheckProducedColour( oCard, COLOUR_BLUE ) > 0) ) oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_B", (RSN_CheckProducedColour( oCard, COLOUR_BLACK ) > 0) ) oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_R", (RSN_CheckProducedColour( oCard, COLOUR_RED ) > 0) ) oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_G", (RSN_CheckProducedColour( oCard, COLOUR_GREEN ) > 0) ) oPlayer:AskMultipleChoiceQuestion( "MODE_CHOOSE_ONE", oCard ) end end end </RESOLUTION_TIME_ACTION>
RSN_CheckSwitchToFallback
This is used to make coding regular MANA_ABILITY fallbacks for cards easier and more unified by handling all the checks to see if any given card should switch to the fallback ability if one exists for it.
Parameters:
- oCard - The card that should be checked to see if a fallback ability should be enabled.
Returns:
- true - The card in question should enable the fallback MANA_ABILITY if it has one.
- false - The card in question should not enable the fallback MANA_ABILITY.
Usage Example:
<CONTINUOUS_ACTION layer="8"> local oCard = EffectSource() if (RSN_CheckSwitchToFallback( oCard )) then oCharacteristics:GrantAbility( 0 ) end </CONTINUOUS_ACTION>
RSN_ClearCanProduceMana
This is used to clear the register that holds what colours of mana it is possible for a card to produce and should be cleared at the beginning of state based effects before marking of what the card can produce, so that if a card was able to produce more colours than it can now the register is properly set.
Parameters: None.
Returns: None.
Usage Example:
<STATIC_ABILITY> <CONTINUOUS_ACTION layer="0"> RSN_ClearCanProduceMana() RSN_MarkCanProduceMana( "{R}{G}" ) </CONTINUOUS_ACTION> </STATIC_ABILITY>
RSN_ClearProducedMana
Used to clear the data chest that holds what mana a card produced that step. This function should be used at the end of every step.
Parameters: None.
Returns: None.
Usage Example:
<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>
RSN_CountColourManaInPlayerPool
This function can be used to count the amount of mana in a player's fake mana pool without having to know the names of the mana tokens. This does not count how much mana is potentially available.
Parameters:
- nColour - The colour to count (COLOUR_COLOURLESS is valid).
- oPlayer - The player whose mana pool to check.
Returns:
- Integer - A number with the count of the current mana in the player's mana pool.
Usage Example:
To count how much green mana is in the effect controller's mana pool:
local nCount = RSN_CountColourManaInPlayerPool( COLOUR_GREEN, EffectController() )
RSN_CountProducedColours
This function counts the number of colours of mana a card has produced this step. It is currently used in Mana Flare to see whether it should ask the player which colour of mana to produce in the case that more that one mana was produced.
Parameters:
- oCard - Card to query for how many colours of mana it produced this step.
Returns:
- Integer - A number telling how many colours were produced (COLOUR_COLOURLESS is counted here despite lacking an actual colour), if no mana was produced this step it will return 0.
Usage Example:
From Mana Flare:
<RESOLUTION_TIME_ACTION> EffectDC():Int_Set( 1, -1 ) local oCard = TriggerObjectLKI() if (oCard ~= nil) then local nCount = RSN_CountProducedColours( oCard ) if (nCount == 0) then -- Do nothing because no mana was produced. elseif (nCount == 1) then EffectDC():Int_Set( 1, RSN_GetProducedColourByIndex( oCard, 0 ) ) else local oPlayer = oCard:GetPlayer() if (oPlayer ~= nil) then oPlayer:BeginNewMultipleChoice() oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_C", (RSN_CheckProducedColour( oCard, COLOUR_COLOURLESS ) > 0) ) oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_W", (RSN_CheckProducedColour( oCard, COLOUR_WHITE ) > 0) ) oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_U", (RSN_CheckProducedColour( oCard, COLOUR_BLUE ) > 0) ) oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_B", (RSN_CheckProducedColour( oCard, COLOUR_BLACK ) > 0) ) oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_R", (RSN_CheckProducedColour( oCard, COLOUR_RED ) > 0) ) oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_G", (RSN_CheckProducedColour( oCard, COLOUR_GREEN ) > 0) ) oPlayer:AskMultipleChoiceQuestion( "MODE_CHOOSE_ONE", oCard ) end end end </RESOLUTION_TIME_ACTION>
RSN_EliminateExtraManaTokens
This function is used to eliminate extra mana tokens that are created as a result of effects like Parallel Lives and Doubling Season. Since these tokens are a work-around for an actual mana pool this is necessary since Parallel Lives and Doubling Season are not supposed to change the amount mana produced.
Note: This function must be used in a separate action from the action in which the mana tokens are created.
Parameters: None.
Returns: None.
Usage Example:
<RESOLUTION_TIME_ACTION> RSN_EliminateExtraManaTokens() RSN_MarkManaAbilityEnd() </RESOLUTION_TIME_ACTION>
RSN_EmptyPlayerManaPool
This function can be used to remove all mana tokens from a player (by tapping them, they will automatically exile themselves once tapped). This could be used for effects that say empty that player's mana pool or empty all mana pools without having to know all the token names or referencing them directly.
Parameters:
- oPlayer - The player whose mana pool should be emptied.
Returns: None.
Usage Example:
RSN_EmptyPlayerManaPool( oOpponent )
RSN_FireManaTrigger
This is a convenience function for triggering BECAME_TAPPED_FOR_MANA in case you would call RSN_Produce() or RSN_ProduceForPlayer() multiple times you can now easily replace it with RSN_ProduceNoTrigger() or RSN_ProduceForPlayerNoTrigger() then after all the mana has been produced you can call RSN_FireManaTrigger() to only trigger BECAME_TAPPED_FOR_MANA once instead of multiple times. Or if you prefer you could just use the single line from this function to trigger the event instead.
Parameters: None.
Returns: None.
Usage Example:
RSN_FireManaTrigger()
RSN_GetCanProduceMana
This function is used to ask a card if it can produce a specific colour of mana.
Parameters:
- oCard - The card to check to see if it can produce a colour.
- nColour - The colour to check to see if it can be produced.
Returns:
- true - The card can produce the specified colour of mana.
- false - All other cases.
Usage Example:
if (RSN_GetCanProduceMana( oLand, COLOUR_RED )) then -- Do something end
RSN_GetFirstProducibleColour
This is used to get a producible colour from a card to use as a default for special cards like Exotic Orchard and Reflecting Pool for the fall back method in case the activated abilities of the card are shut down.
Parameters:
- oCard - The card to get the first producible colour from.
Returns:
- COLOUR_* constant - Will return a Colour constant if the card is capable of producing a colour of mana (checked from what the card reports as it can produce).
- -1 - If the card can't produce mana or it does not report that it can produce mana then the function will return -1.
Usage Example:
local nDefaultColour = RSN_GetFirstProducibleColour( oCard )
RSN_GetLastProducedColour
This is primarily used by multi-coloured lands to get the last colour they produced to determine what colour should be produced by the fall back method if their activated abilities get shut down.
Parameters: None.
Returns:
- COLOUR_* constant - Will always return a valid colour constant, in the case that it has not yet produced mana it will return COLOUR_COLOURLESS which can be checked to then change to a default.
Usage Example:
From Dimir Guildgate:
<CONTINUOUS_ACTION layer="8"> local nDefaultColour = COLOUR_BLUE local oCard = EffectSource() if (oCard ~= nil) then local oCharacteristics = oCard:GetCurrentCharacteristics() if (((oCharacteristics ~= nil) and (oCharacteristics:Bool_Get( CHARACTERISTIC_CANT_USE_ACTIVATED_ABILITIES ))) or (EffectController():GetCurrentCharacteristics():Bool_Get( PLAYER_CHARACTERISTIC_CANT_ACTIVATE_NONMANA_ABILITIES ))) then local nColour = RSN_GetLastProducedColour() if (nColour ~= COLOUR_COLOURLESS) then oCharacteristics:GrantAbility( nColour ) else oCharacteristics:GrantAbility( nDefaultColour ) end end end </CONTINUOUS_ACTION>
RSN_GetProducedColourByIndex
This is used to read what colour mana a card produced in the order it produced it (within a step). This is currently used by Mana Flare to automatically produce a colour of mana if a valid source produced only one colour. This should be used in conjunction with RSN_CountProducedColours to make sure the return is valid.
Parameters:
- oCard - The card to check what was produced on.
- nIndex - The index to check to see what colour was produced (0-indexed).
Returns:
- COLOUR_* - Will always return a valid colour constant even if no mana was produced this step (in that case it will return COLOUR_COLOURLESS).
Usage Example:
From Mana Flare:
<RESOLUTION_TIME_ACTION> EffectDC():Int_Set( 1, -1 ) local oCard = TriggerObjectLKI() if (oCard ~= nil) then local nCount = RSN_CountProducedColours( oCard ) if (nCount == 0) then -- Do nothing because no mana was produced. elseif (nCount == 1) then EffectDC():Int_Set( 1, RSN_GetProducedColourByIndex( oCard, 0 ) ) else local oPlayer = oCard:GetPlayer() if (oPlayer ~= nil) then oPlayer:BeginNewMultipleChoice() oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_C", (RSN_CheckProducedColour( oCard, COLOUR_COLOURLESS ) > 0) ) oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_W", (RSN_CheckProducedColour( oCard, COLOUR_WHITE ) > 0) ) oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_U", (RSN_CheckProducedColour( oCard, COLOUR_BLUE ) > 0) ) oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_B", (RSN_CheckProducedColour( oCard, COLOUR_BLACK ) > 0) ) oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_R", (RSN_CheckProducedColour( oCard, COLOUR_RED ) > 0) ) oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_G", (RSN_CheckProducedColour( oCard, COLOUR_GREEN ) > 0) ) oPlayer:AskMultipleChoiceQuestion( "MODE_CHOOSE_ONE", oCard ) end end end </RESOLUTION_TIME_ACTION>
RSN_GetProducedTokenChest
This is used to get a data chest that contains pointers to the mana tokens produced by this card. The chest is stored in the EffectDC() meaning it is only valid inside of the effect. If you want the pointers to be available to other effects you will need to move them into a chest that will persist into the other effect(s) such as LinkedDC() or RSN_ObjectDC().
Parameters: None.
Returns: Data chest containing Card Pointers to all the mana tokens produced in this effect up to this point. Pointers start at register 0 and go up sequentially until you hit a nil.
Usage Example:
From Shizuko, Caller of Autumn:
<RESOLUTION_TIME_ACTION> if (TriggerPlayer() ~= nil) then RSN_ProduceForPlayerNoTrigger( "{G}", 3, TriggerPlayer() ) local oTokens = RSN_GetProducedTokenChest() local oChest = LinkedDC():Make_Chest( 0 ) for i = 0, 2 do oChest:Set_CardPtr( i, oTokens:Get_CardPtr( i ) ) end end </RESOLUTION_TIME_ACTION>
RSN_MarkCanProduceColour
This is used to mark what colour of mana it is possible for a card to produce so that other cards can read and use this information like Exotic Orchard and Reflecting Pool. This is an alternative to using string tokens like RSN_MarkCanProduceMana does, but has the same overall effect.
Parameters:
- nColour - A colour constant (COLOUR_*) that defines the colour (or COLOUR_COLOURLESS) of mana that this card can produce.
Returns: None.
Usage Examples:
To specify a card can produce Blue and Black mana:
<STATIC_ABILITY> <CONTINUOUS_ACTION layer="0"> RSN_ClearCanProduceMana() RSN_MarkCanProduceColour( COLOUR_BLUE ) RSN_MarkCanProduceColour( COLOUR_BLACK ) </CONTINUOUS_ACTION> </STATIC_ABILITY>
To specify a card can produce Colourless mana:
<STATIC_ABILITY> <CONTINUOUS_ACTION layer="0"> RSN_ClearCanProduceMana() RSN_MarkCanProduceColour( COLOUR_COLOURLESS ) </CONTINUOUS_ACTION> </STATIC_ABILITY>
RSN_MarkCanProduceColourOfAnyTypeOtherLandPlayerControls
This is mainly used to reduce the amount of code in Exotic Orchard and Reflecting Pool as they both rely on colours of other lands controlled by one or more players. This will essentially check each land a player owns (other than the EffectSource) and query it for it's colours then mark the EffectSource as being able to produce those colours. This does include Colourless even though technically it is not a colour.
Parameters:
- oPlayer - The player whose lands should be checked.
Returns: None.
Usage Example:
From Reflecting Pool:
<TRIGGERED_ABILITY forced_skip="1" replacement_effect="1"> <TRIGGER value="ZONECHANGE_END" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY"> -- Since we only care about lands for checking what we can produce. return ((TriggerObject() ~= nil) and (TriggerObject():GetCardType():Test( CARD_TYPE_LAND ))) </TRIGGER> <RESOLUTION_TIME_ACTION> RSN_ClearCanProduceMana() -- Look through my other lands to see what this can produce. RSN_MarkCanProduceColourOfAnyTypeOtherLandPlayerControls( EffectController() ) </RESOLUTION_TIME_ACTION> </TRIGGERED_ABILITY>
RSN_MarkCanProduceMana
This is used to mark what mana it is possible for a card to produce so that other cards can read and use this information like Exotic Orchard and Reflecting Pool.
Note: I looked through all 841 cards on Gatherer and the only cards for which this actually seems to be necessary is lands it is not required on other cards, though it may be recommended as we do not know what cards WotC will create in the future.
Parameters:
- sMana - A string indicating what types of mana can be produced (token order is not important). This will accept any single colour token ({B}, {G}, {R}, {U}, {W}) and colourless tokens from {1} to {16}.
Returns: None.
Usage Examples:
A swamp would use it like this:
<STATIC_ABILITY> <CONTINUOUS_ACTION layer="0"> RSN_ClearCanProduceMana() RSN_MarkCanProduceMana( "{B}" ) </CONTINUOUS_ACTION> </STATIC_ABILITY>
A Dimir Guildgate would use it like this:
<STATIC_ABILITY> <CONTINUOUS_ACTION layer="0"> RSN_ClearCanProduceMana() RSN_MarkCanProduceMana( "{U}{B}" ) </CONTINUOUS_ACTION> </STATIC_ABILITY>
An Abandoned Outpost would look like this (even though it normally only produces {W} it's second ability would allow it to produce any colour):
<STATIC_ABILITY> <CONTINUOUS_ACTION layer="0"> RSN_ClearCanProduceMana() RSN_MarkCanProduceMana( "{B}{G}{R}{U}{W}" ) </CONTINUOUS_ACTION> </STATIC_ABILITY>
RSN_MarkManaAbilityEnd
This marks the end of a fake mana ability after everything has been completed so that any other activated abilities that are used on the card will trigger other effects properly. Should be the last function call in a fake mana ability.
Note: All fake mana activated abilities should be set with forced_skip="1" because mana abilities are not supposed to be able to be responded to.
Parameters: None.
Returns: None.
Usage Example:
<RESOLUTION_TIME_ACTION> RSN_EliminateExtraManaTokens() RSN_MarkManaAbilityEnd() </RESOLUTION_TIME_ACTION>
RSN_MarkManaAbilityStart
This marks the beginning of a fake mana ability and this should be used in a PLAY_TIME_ACTION for activated abilities so that it is set soon enough to be available for other cards to check in TRIGGERED_ABILITIES.
Note: All fake mana activated abilities should be set with forced_skip="1" because mana abilities are not supposed to be able to be responded to.
Parameters: None.
Returns: None.
Usage Example:
<PLAY_TIME_ACTION> RSN_MarkManaAbilityStart() </PLAY_TIME_ACTION>
RSN_Produce
This function is basically a wrapper for RSN_ProduceForPlayer but always produces for the controller of the effect. Will fire TRIGGER_BECAME_TAPPED_FOR_MANA once finished producing mana tokens if at least 1 mana token was produced.
Parameters:
- sMana - A string indicating the type(s) of mana to produce (token order is not important). This will accept any single colour token ({B}, {G}, {R}, {U}, {W}) and colourless tokens from {1} to {16}.
- nAmount - The number of times the mana string should be produced.
- bDoNotMark - (optional) A boolean as to whether not to mark what mana was produced so it will not create an object data chest if it does not need to.
Returns: None.
Usage Examples:
To produce a single Black mana:
RSN_Produce( "{B}", 1 )
To produce both a Blue and a Black Mana (total 2 mana):
RSN_Produce( "{U}{B}", 1 )
To produce an amount of Green mana equal to the value stored in numElves:
RSN_Produce( "{G}", numElves )
RSN_ProduceForPlayer
This function is the main non-internal function for mana production and will take in a string indicating what to produce, the number of times that should be produced (amount), the player for who it should be produced, and whether or not to mark that mana was produced in the object's data chest (for example you may not want to create a data chest for single use non-land tokens or spells). Will fire TRIGGER_BECAME_TAPPED_FOR_MANA once finished producing mana tokens if at least 1 mana token was produced.
Parameters:
- sMana - A string indicating the type(s) of mana to produce (token order is not important). This will accept any single colour token ({B}, {G}, {R}, {U}, {W}) and colourless tokens from {1} to {16}.
- nAmount - The number of times the mana string should be produced.
- oPlayer - The player to produce the mana for.
- bDoNotMark - (optional) A boolean as to whether not to mark what mana was produced so it will not create an object data chest if it does not need to.
Returns: None.
Usage Examples:
To produce a Black mana for the controller of the object that triggered the effect:
RSN_ProduceForPlayer( "{B}", 1, TriggerObject():GetController() )
To produce both a Blue and a Black mana (total 2 mana) for the Effect Controller:
RSN_ProduceForPlayer( "{U}{B}", 1, EffectController() )
To produce an amount of Green mana equal to the value stored in numElves for the Effect Controller:
RSN_ProduceForPlayer( "{G}", numElves, EffectController() )
RSN_ProduceForPlayerNoTrigger
This function is an alternative non-internal function for mana production and will take in a string indicating what to produce, the number of times that should be produced (amount), the player for who it should be produced, and whether or not to mark that mana was produced in the object's data chest (for example you may not want to create a data chest for single use non-land tokens or spells). Will NOT fire TRIGGER_BECAME_TAPPED_FOR_MANA once finished producing mana tokens, this is useful for cards that don't tap to produce mana for players other than the EffectController() like Shizuko, Caller of Autumn or Mana Flare.
Parameters:
- sMana - A string indicating the type(s) of mana to produce (token order is not important). This will accept any single colour token ({B}, {G}, {R}, {U}, {W}) and colourless tokens from {1} to {16}.
- nAmount - The number of times the mana string should be produced.
- oPlayer - The player to produce the mana for.
- bDoNotMark - (optional) A boolean as to whether not to mark what mana was produced so it will not create an object data chest if it does not need to.
Returns: None.
Usage Examples:
To produce a Black mana for the controller of the object that triggered the effect:
RSN_ProduceForPlayerNoTrigger( "{B}", 1, TriggerObject():GetController() )
To produce both a Blue and a Black mana (total 2 mana) for the Effect Controller:
RSN_ProduceForPlayerNoTrigger( "{U}{B}", 1, EffectController() )
To produce an amount of Green mana equal to the value stored in numElves for the Effect Controller:
RSN_ProduceForPlayerNoTrigger( "{G}", numElves, EffectController() )
RSN_ProduceNoTrigger
This function is basically a wrapper for RSN_ProduceForPlayerNoTrigger but always produces for the controller of the effect. Will NOT fire TRIGGER_BECAME_TAPPED_FOR_MANA once finished producing mana tokens, this is useful for cards like Altar of Shadows or Basal Sliver which have mana effects that do not cause the card to be tapped to produce mana.
Parameters:
- sMana - A string indicating the type(s) of mana to produce (token order is not important). This will accept any single colour token ({B}, {G}, {R}, {U}, {W}) and colourless tokens from {1} to {16}.
- nAmount - The number of times the mana string should be produced.
- bDoNotMark - (optional) A boolean as to whether not to mark what mana was produced so it will not create an object data chest if it does not need to.
Returns: None.
Usage Examples:
To produce a single Black mana:
RSN_ProduceNoTrigger( "{B}", 1 )
To produce both a Blue and a Black Mana (total 2 mana):
RSN_ProduceNoTrigger( "{U}{B}", 1 )
To produce an amount of Green mana equal to the value stored in numElves:
RSN_ProduceNoTrigger( "{G}", numElves )
RSN_UsedManaAbility
This function is used to check if the activated ability currently being used on the specified card is a fake mana ability. It was made so that when Burning-Tree Shaman's ability checks to see if it should do damage to a player it doesn't trigger for the fake mana abilities.
Parameters:
- oCard - The card object that is being checked to see if a fake mana ability was used.
Returns:
- true - If the card is currently using a fake mana ability marked with RSN_MarkManaAbilityStart().
- false - In all other circumstances.
Usage Example: (from Burning-Tree Shaman)
<TRIGGER value="ACTIVATED_ABILITY_PLAYED"> if (TriggerObject() ~= nil) then -- We only want to trigger if the player used an ability that isn't a -- mana ability (we consider a fake mana ability a mana ability). if (RSN_UsedManaAbility( TriggerObject() )) then return false else return true end end -- If we don't have the TriggerObject then we can't assign damage so just don't trigger. return false </TRIGGER>
Text Permanent - D14_8192_MANA_TEXT.XML
- RSN_MODE_PRODUCE_B - Generic string for "Add {B} to your mana pool."
- RSN_MODE_PRODUCE_BB - Generic string for "Add {B}{B} to your mana pool."
- RSN_MODE_PRODUCE_BBB - Generic string for "Add {B}{B}{B} to your mana pool."
- RSN_MODE_PRODUCE_C - Generic string for "Add {1} to your mana pool."
- RSN_MODE_PRODUCE_G - Generic string for "Add {G} to your mana pool."
- RSN_MODE_PRODUCE_GG - Generic string for "Add {G}{G} to your mana pool."
- RSN_MODE_PRODUCE_GGG - Generic string for "Add {G}{G}{G} to your mana pool."
- RSN_MODE_PRODUCE_R - Generic string for "Add {R} to your mana pool."
- RSN_MODE_PRODUCE_RR - Generic string for "Add {R}{R} to your mana pool."
- RSN_MODE_PRODUCE_RRR - Generic string for "Add {R}{R}{R} to your mana pool."
- RSN_MODE_PRODUCE_U - Generic string for "Add {U} to your mana pool."
- RSN_MODE_PRODUCE_UU - Generic string for "Add {U}{U} to your mana pool."
- RSN_MODE_PRODUCE_UUU - Generic string for "Add {U}{U}{U} to your mana pool."
- RSN_MODE_PRODUCE_W - Generic string for "Add {W} to your mana pool."
- RSN_MODE_PRODUCE_WW - Generic string for "Add {W}{W} to your mana pool."
- RSN_MODE_PRODUCE_WWW - Generic string for "Add {W}{W}{W} to your mana pool."
Change History
- v2.2
- Changed the order attribute to give it higher priority than the 3 deck packs.
- Added the 12 new lands from Deck Packs 2 & 3 (Deck Pack 1 did not include any new basic lands).
- 4 new Islands (ISLAND_373735, ISLAND_373736, ISLAND_373737, ISLAND_373738)
- 4 new Mountains (MOUNTAIN_373739, MOUNTAIN_373740, MOUNTAIN_373741, MOUNTAIN_373742)
- 4 new Plains (PLAINS_373743, PLAINS_373744, PLAINS_373745, PLAINS_373746)
- v2.1
- Changed the order attribute to try and give it higher priority than the expansion.
- v2.0
- Added the 10 new basic lands from the DotP 2014 Expansion.
- Added Chinese localizations to the items contained here (Tokens still just use English text, but they are invisible anyway so who really cares).
- Added functions to produce mana, but not trigger BECAME_TAPPED_FOR_MANA for cards that don't become tapped when producing mana.
- Added functions to keep track of the actual mana tokens produced so that the effect can get that list and use it for something (like Shizuko, Caller of Autumn to prevent mana tokens selectively from being removed until end of turn).
- Added a function to make checking whether a fallback should be enabled or not easier (this also takes into account more than what my previous implementation of fallbacks looked at, fixes some bugs).
- Fixed a couple of bugs where mana tokens could be produced for the wrong player (since nobody reported this I assume no-one else noticed them).
- v1.0 - Initial Release