Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers New MTG Cards and Decks (2010, 2012, 2013, 2014, 2015, Magic Duels) 2014
Khans of Tarkir (102/254) Last Updated 9/21/14
Moderator: CCGHQ Admins
Re: Khans of Tarkir (102/254) Last Updated 9/21/14
by RiiakShiNal » 23 Sep 2014, 10:39
Yeah, that's pretty much it, the only difference being the manager would add a STATIC_ABILITY that would add the characteristic (if the manager directly adds the characteristic then the characteristic would get added even if the card loses all abilities which is not what you want as the manager should never lose it's abilities).Xander9009 wrote:If I understand you right, this would work essentially the same as any other characteristic using your CC functions.And that's pretty much it, right? Just make sure the layers are working such that the characteristic is being being added, then the ability-removal effect is removing it? And in this case, just checking that a card has the characteristic would tell us if abilities are active or not?
- Add the custom manager to your function so it's created at the start of the game.
- That manager would add this 'Abilities Active' characteristic to each permanent controlled by its controller (and since each player has a manager, this covers all permanents)
Hopefully that's just rephrasing what you said, because that's my goal (if I can properly rephrase, I probably understand it haha).
Just remember working with layers like this can get tricky. If I remember correctly to get it working properly the ability has to be granted on layer 6 (standard for granting abilities to other cards also where LoseAllAbilities() is assigned and takes effect) then the granted ability needs to add the characteristic on a higher layer (for example 7A or higher) otherwise the characteristic doesn't get granted (because the ability doesn't exist until layer 6 gets processed). Then checking the characteristic (if done from a CONTINUOUS_ACTION) should be done from an even higher layer like layer 8 (needs to be done on a different layer to ensure that it had a chance to be set before trying to check it).
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: Khans of Tarkir (102/254) Last Updated 9/21/14
by Xander9009 » 23 Sep 2014, 15:33
When you say I'll have to check on layer 8, I hope you just mean that if the checking is done in a continuous action, then it needs to be layer 8; and that if the checking is done in a resolution action, or some other action, then it'll be okay? Or do I just need to test it (which I'm going to do anyway)?
Anyway, I've got the token set up and it's working, it seems. Here's the code.
In addition to the above, a LOL file is needed with "ABILITIES_ACTIVE = 909001" or some other number. Then, each card which will need to check for active abilities (meaning all cards with delve) need
Anyway, I've got the token set up and it's working, it seems. Here's the code.
- Manager Token | Open
- Code: Select all
<?xml version="1.0"?>
<CARD_V2 ExportVersion="1">
<FILENAME text="ABILITIES_ACTIVE_MANAGER" />
<CARDNAME text="ABILITIES_ACTIVE_MANAGER" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[ABILITIES ACTIVE MANAGER]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[ABILITIES ACTIVE MANAGER]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[ABILITIES ACTIVE MANAGER]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[ABILITIES ACTIVE MANAGER]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[ABILITIES ACTIVE MANAGER]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[ABILITIES ACTIVE MANAGER]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[ABILITIES ACTIVE MANAGER]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[ABILITIES ACTIVE MANAGER]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[ABILITIES ACTIVE MANAGER]]></LOCALISED_TEXT>
</TITLE>
<ARTID value="0" />
<ARTIST name="None" />
<CASTING_COST cost="" />
<EXPANSION value="MANAGER_TOKENS" />
<RARITY metaname="T" />
<!-- Shroud so it can't be targeted. -->
<STATIC_ABILITY>
<INTRINSIC characteristic="CHARACTERISTIC_SHROUD" />
</STATIC_ABILITY>
<!-- Indestructible so it can't be destroyed. -->
<STATIC_ABILITY>
<INTRINSIC characteristic="CHARACTERISTIC_INDESTRUCTIBLE" />
</STATIC_ABILITY>
<!-- Protection from everything to prevent unwanted removal. -->
<STATIC_ABILITY>
<CONTINUOUS_ACTION layer="0">
if (EffectSource() ~= nil) then
local oFilter = ClearFilter()
local oSubfilter = oFilter:AddSubFilter_Or()
oSubfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ARTIFACT )
oSubfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
oSubfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ENCHANTMENT )
oSubfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_INSTANT )
oSubfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
oSubfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PHENOMENON )
oSubfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PLANE )
oSubfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PLANESWALKER )
oSubfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_SCHEME )
oSubfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_SORCERY )
EffectSource():Protection()
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<!-- Now we have extra abilities for those characteristics which are built into this manager. -->
<!-- In other words these are the functions that make the custom characteristics actually do something. -->
<STATIC_ABILITY>
<FILTER filter_id="0">
local filter = ClearFilter()
local subfilter = filter:AddSubFilter_Or()
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ARTIFACT )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ENCHANTMENT )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PLANESWALKER )
filter:Add( FE_CONTROLLER, OP_IS, EffectController())
</FILTER>
<CONTINUOUS_ACTION layer="6" filter_id="0">
if FilteredCard() ~= nil then
local characteristics = FilteredCard():GetCurrentCharacteristics()
characteristics:GrantAbility(0)
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<STATIC_ABILITY resource_id="0">
<CONTINUOUS_ACTION layer="7A">
if EffectSource() ~= nil then
EffectSource():GetCurrentCharacteristics():GrantAbility(1)
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<STATIC_ABILITY resource_id="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Abilities are active]]></LOCALISED_TEXT>
<CONTINUOUS_ACTION layer="7A">
RSN_Characteristics_Set( EffectSource(), ABILITIES_ACTIVE, 1 )
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
</CARD_V2>
In addition to the above, a LOL file is needed with "ABILITIES_ACTIVE = 909001" or some other number. Then, each card which will need to check for active abilities (meaning all cards with delve) need
- create tokens | Open
- Code: Select all
<TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_CHARACTERISTIC_MANAGER" />
<TOKEN_REGISTRATION reservation="1" type="ABILITIES_ACTIVE_MANAGER" />
<TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_HAND">
<TRIGGER value="BEGINNING_OF_STEP">
return ((MTG():GetStep() == STEP_UPKEEP) and (MTG():GetTurnNumber() == 0))
</TRIGGER>
<RESOLUTION_TIME_ACTION>
RSN_Characteristics_CreateManagers("ABILITIES_ACTIVE_MANAGER")
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_LIBRARY">
<TRIGGER value="BEGINNING_OF_STEP">
return ((MTG():GetStep() == STEP_UPKEEP) and (MTG():GetTurnNumber() == 0))
</TRIGGER>
<RESOLUTION_TIME_ACTION>
RSN_Characteristics_CreateManagers("ABILITIES_ACTIVE_MANAGER")
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
- Code: Select all
if SomeCard ~= nil and RSN_Characteristics_Get( SomeCard, ABILITIES_ACTIVE ) then
--Do something
end
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Khans of Tarkir (102/254) Last Updated 9/21/14
by NeoAnderson » 23 Sep 2014, 15:44
I just made a list of the possible interaction cards with the mana cost :
There are many functions to write...
- List cost manipulation cards | Open
- Urza's Incubator CREATURE CHOSEN TYPE LESS 2 ALL
Arcane Melee INSTANT - SORCERY LESS 2 ALL
Urza's Filter MULTICOLORED SPELLS LESS 2 ALL
Spellwild Ouphe SPELL TARGETTING LESS 2 ALL
Helm of Awakening SPELLS LESS 1 ALL
Herald of War ANGEL - HUMAN LESS X YOU
Long-Forgotten Gohei ARCANE LESS 1 YOU
Etherium Sculptor ARTIFACT LESS 1 YOU
Hero of Iroas AURA LESS 1 YOU
Krosan Warchief BEAST LESS 1 YOU
Jet Medallion BLACK LESS 1 YOU
Thunderscape Familiar BLACK - GREEN LESS 1 YOU
Sapphire Medallion BLUE LESS 1 YOU
Nightscape Familiar BLUE - RED LESS 1 YOU
Brago's Favor CHOOSEN NAME LESS 1 YOU
Council of the Absolute CHOOSEN NAME LESS 2 YOU
Edgewalker CLERIC LESS WB YOU
Eye of Ugin COLORLESS ELDRAZI LESS 2 YOU
Heartless Summoning CREATURE LESS 2 YOU
Planar Gate CREATURE LESS 2 YOU
Animar, Soul of Elements CREATURE LESS X YOU
Rakdos, Lord of Riots CREATURE LESS X YOU
Krosan Drover CREATURE MANA COST 6H LESS 2 YOU
Mistform Warchief CREATURE SHARE TYPE LESS 1 YOU
Centaur Omenreader CREATURE WITH CONDITION LESS 2 YOU
Warden of Evos Isle CREATURE WITH FLYING LESS 1 YOU
Dragonspeaker Shaman DRAGON LESS 2 YOU
Brighthearth Banneret ELEMENTAL - WARRIOR LESS 1 YOU
Dream Chisel FACE DOWN LESS 1 YOU
Stinkdrinker Daredevil GIANT LESS 2 YOU
Goblin Warchief GOBLIN LESS 1 YOU
Frogtosser Banneret GOBLIN - ROGUE LESS 1 YOU
Emerald Medallion GREEN LESS 1 YOU
Sunscape Familiar GREEN - BLUE LESS 1 YOU
Mana Matrix INSTANT - ENCHANTMENT LESS 2 YOU
Goblin Electromancer INSTANT - SORCERY LESS 1 YOU
Battlefield Thaumaturge INSTANT - SORCERY LESS X YOU
Ballyrush Banneret KITHKIN - SOLDIER LESS 1 YOU
Stonybrook Banneret MERFOLK - WIZARD LESS 1 YOU
Ragemonger MINOTAUR LESS BR YOU
Blood Funnel NON - CREATURE LESS 2 YOU
Ruby Medallion RED LESS 1 YOU
Thornscape Familiar RED - WHITE LESS 1 YOU
Semblance Anvil SHARED TYPE LESS 2 YOU
Daru Warchief SOLDIER LESS 1 YOU
Stone Calendar SPELL LESS 1 YOU
Locket of Yesterdays SPELL LESS X YOU
Bosk Banneret TREEFOLK - SHAMAN LESS 1 YOU
Cloud Key TYPE CHOSEN LESS 1 YOU
Pearl Medallion WHITE LESS 1 YOU
Stormscape Familiar WHITE- BLACK LESS 1 YOU
Grand Arbiter Augustin IV WHITE OR BLUE LESS 1 YOU
Undead Warchief ZOMBIE LESS 1 YOU
Alabaster Leech WHITE MORE W YOU
Andradite Leech BLACK MORE B YOU
Aura of Silence ARTIFACT - ENCHANTMENT MORE 2 OPP
Chill RED MORE 2 ALL
Defense Grid SPELL DURING OTHER TURNS MORE 3 ALL
Derelor BLACK MORE B YOU
Feroz's Ban CREATURE MORE 2 ALL
Gloom WHITE MORE 3 ALL
Glowrider NON - CREATURE MORE 1 ALL
Grand Arbiter Augustin IV SPELL MORE 1 OPP
High Seas CREATURE RED - GREEN MORE 1 ALL
Hum of the Radix ARTIFACT MORE X ALL
Irini Sengir ENCHANTMENT - GREEN - WHITE MORE 2 ALL
Jade Leech GREEN MORE G YOU
Lodestone Golem NON ARTIFACT MORE 1 ALL
Ruby Leech RED MORE R YOU
Sapphire Leech BLUE MORE U YOU
Sphere of Resistance SPELLS MORE 1 ALL
Squeeze SORCERY MORE 3 ALL
Thalia, Guardian of Thraben NON - CREATURE MORE 1 ALL
Thorn of Amethyst NON - CREATURE MORE 1 ALL
There are many functions to write...
Last edited by NeoAnderson on 23 Sep 2014, 16:00, edited 2 times in total.
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Khans of Tarkir (102/254) Last Updated 9/21/14
by Xander9009 » 23 Sep 2014, 15:53
Was my list not good enough for you? lol (Joking)NeoAnderson wrote:I just made a list of the possible interaction cards with the mana cost
...
To understand the meaning just read it as : CARDNAME - SPELL WHO CHANGES COST - AMOUNT - WHO IS CONSIDERED FOR CAST.
There are many functions to write...
Anyway, I'll see about turning our lists into a function. Something I've never done, so I can't guarantee anything.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Khans of Tarkir (102/254) Last Updated 9/21/14
by NeoAnderson » 23 Sep 2014, 16:01
ahahahah I made it because i would double check with my functions used for facedown cost manipulation.Xander9009 wrote:Was my list not good enough for you? lol (Joking)NeoAnderson wrote:I just made a list of the possible interaction cards with the mana cost
...
To understand the meaning just read it as : CARDNAME - SPELL WHO CHANGES COST - AMOUNT - WHO IS CONSIDERED FOR CAST.
There are many functions to write...
Anyway, I'll see about turning our lists into a function. Something I've never done, so I can't guarantee anything.
Anyway :
I think this whould be used inside the function when we check for increase or decrease costs..it should be an internal operation not visible for the end user.Xander9009 wrote:Then, elsewhere on the card, you should be able to check a given permanent for the characteristic with
- Code: Select all
if SomeCard ~= nil and RSN_Characteristics_Get( SomeCard, ABILITIES_ACTIVE ) then
--Do something
end
Probably the best way to face the problem is to create a structured chest were we store the increasind and decreasing values.
something like...
- Chest structure : | Open
- 1 White Creature INC
2 White Creature DEC
3 Blue Creature INC
4 Blue Creature DEC
5 Black Creature INC
6 Black Creature DEC
7 Red Creature INC
8 Red Creature DEC
9 Green Creature INC
10 Green Creature DEC
11 Colourless Creature INC
12 Colourless Creature DEC
13 White Enchantment INC
14 White Enchantment DEC
15 Blue Enchantment INC
16 Blue Enchantment DEC
17 Black Enchantment INC
18 Black Enchantment DEC
19 Red Enchantment INC
20 Red Enchantment DEC
21 Green Enchantment INC
22 Green Enchantment DEC
23 Colourless Enchantment INC
24 Colourless Enchantment DEC
25 White Sorcery INC
26 White Sorcery DEC
27 Blue Sorcery INC
28 Blue Sorcery DEC
29 Black Sorcery INC
30 Black Sorcery DEC
31 Red Sorcery INC
32 Red Sorcery DEC
33 Green Sorcery INC
34 Green Sorcery DEC
35 Colourless Sorcery INC
36 Colourless Sorcery DEC
37 White Instant INC
38 White Instant DEC
39 Blue Instant INC
40 Blue Instant DEC
41 Black Instant INC
42 Black Instant DEC
43 Red Instant INC
44 Red Instant DEC
45 Green Instant INC
46 Green Instant DEC
47 Colourless Instant INC
48 Colourless Instant DEC
49 White Artifact INC
50 White Artifact DEC
51 Blue Artifact INC
52 Blue Artifact DEC
53 Black Artifact INC
54 Black Artifact DEC
55 Red Artifact INC
56 Red Artifact DEC
57 Green Artifact INC
58 Green Artifact DEC
59 Colourless Artifact INC
60 Colourless Artifact DEC
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Khans of Tarkir (102/254) Last Updated 9/21/14
by Xander9009 » 23 Sep 2014, 16:13
You're missing a few, such as all, non-creature, and the types without considering color (like from Squeeze). Those are easy enough to add, though. However, I wonder if it's necessary to have an INC and a DEC for each one. Also, with this implementation, how are you planning to check for cost changes based on controller, again, like with Squeeze? Are you thinking of maintaining a check for each player?NeoAnderson wrote:I think this whould be used inside the function when we check for increase or decrease costs..it should be an internal operation not visible for the end user.[/code]This was meant as a general thing. Any card that needs to check if a card's abilities are active can do it this way. However, for the Delve ability specifically, yeah, I'll put inside the function.Xander9009 wrote:Then, elsewhere on the card, you should be able to check a given permanent for the characteristic with
- Code: Select all
if SomeCard ~= nil and RSN_Characteristics_Get( SomeCard, ABILITIES_ACTIVE ) then
--Do something
endNeoAnderson wrote:Probably the best way to face the problem is to create a structured chest were we store the increasind and decreasing values.
something like...
- Chest structure : | Open
- 1 White Creature INC
2 White Creature DEC
3 Blue Creature INC
4 Blue Creature DEC
5 Black Creature INC
6 Black Creature DEC
7 Red Creature INC
8 Red Creature DEC
9 Green Creature INC
10 Green Creature DEC
11 Colourless Creature INC
12 Colourless Creature DEC
13 White Enchantment INC
14 White Enchantment DEC
15 Blue Enchantment INC
16 Blue Enchantment DEC
17 Black Enchantment INC
18 Black Enchantment DEC
19 Red Enchantment INC
20 Red Enchantment DEC
21 Green Enchantment INC
22 Green Enchantment DEC
23 Colourless Enchantment INC
24 Colourless Enchantment DEC
25 White Sorcery INC
26 White Sorcery DEC
27 Blue Sorcery INC
28 Blue Sorcery DEC
29 Black Sorcery INC
30 Black Sorcery DEC
31 Red Sorcery INC
32 Red Sorcery DEC
33 Green Sorcery INC
34 Green Sorcery DEC
35 Colourless Sorcery INC
36 Colourless Sorcery DEC
37 White Instant INC
38 White Instant DEC
39 Blue Instant INC
40 Blue Instant DEC
41 Black Instant INC
42 Black Instant DEC
43 Red Instant INC
44 Red Instant DEC
45 Green Instant INC
46 Green Instant DEC
47 Colourless Instant INC
48 Colourless Instant DEC
49 White Artifact INC
50 White Artifact DEC
51 Blue Artifact INC
52 Blue Artifact DEC
53 Black Artifact INC
54 Black Artifact DEC
55 Red Artifact INC
56 Red Artifact DEC
57 Green Artifact INC
58 Green Artifact DEC
59 Colourless Artifact INC
60 Colourless Artifact DEC
We could update the related value when we make the check inside the functions, and we should pass just the info about the spell we want to cast (Colour, Type)
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Khans of Tarkir (102/254) Last Updated 9/21/14
by NeoAnderson » 23 Sep 2014, 16:29
It is necessary to check for each player because not all the effect involve all the players..so should be a player data chest for each player.Xander9009 wrote:You're missing a few, such as all, non-creature, and the types without considering color (like from Squeeze). Those are easy enough to add, though. However, I wonder if it's necessary to have an INC and a DEC for each one. Also, with this implementation, how are you planning to check for cost changes based on controller, again, like with Squeeze? Are you thinking of maintaining a check for each player?
About the type Squeeze will update the follow values :
25 White Sorcery INC + 3
27 Blue Sorcery INC + 3
29 Black Sorcery INC + 3
31 Red Sorcery INC + 3
33 Green Sorcery INC + 3
35 Colourless Sorcery INC + 3
Now supposing you are going to cast a black sorcery you will retrieve the value from chest :
local inc = chest:Get_Int(29)
local dec = chest:Get_Int(30)
Final value = cost + inc - dec
Anyway about your token manager i think you can make one Trigger ability to create the token just replacing ZONE_HAND and ZONE_LIBRARY with one trigger with ZONE_ANY, should work anyway.
Confirmed it works with zone ANY but you have to set the trigger ability to create the token manager only once. Now it create the token for each instance of card who has the code.
Try with something like :
- Code: Select all
<TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_CHARACTERISTIC_MANAGER" />
<TOKEN_REGISTRATION reservation="1" type="ABILITIES_ACTIVE_MANAGER" />
<TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_ANY">
<TRIGGER value="BEGINNING_OF_STEP">
if ((MTG():GetStep() == STEP_UPKEEP) and (MTG():GetTurnNumber() == 0)) then
local chest = EffectController():PlayerDataChest():Get_Chest(8100512)
if chest ~= nil then
return false
else
local chest = EffectController():PlayerDataChest():Make_Chest(8100512)
return true
end
end
</TRIGGER>
<RESOLUTION_TIME_ACTION>
RSN_Characteristics_CreateManagers("ABILITIES_ACTIVE_MANAGER")
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Khans of Tarkir (102/254) Last Updated 9/21/14
by Xander9009 » 23 Sep 2014, 18:38
The creation of the token is controlled by Riiak's manager token creation function, which is supposed to trigger for every card, but will only create the token once. As for the two triggers, I have it like because that's exactly what Riiak posted when exmplaining how to make a custom characteristic here. It might work that way as well, but it works as is, so I'm not worried about it.
For the rest, I don't think that will work. First reason is that Frogtosser Banneret only reduces the cost of Arms Dealer by , not by , but Grand Arbiter Augustin IV reduces the cost of Ascended Lawmage by 2. The other problem is that even if we fix that, it would still require pulling out all relevant info from the card. Because of this, I don't see why we shouldn't just check them directly.
I've already got 95% of the function done. It just needs a few cards finished. Could someone check two in particular? Locket of Yesterdays and Rakdos, Lord of Riots. They're all in alphabetical order (and separated by cards that affect you, cards that affect opponents, then cards that affect everyone). For Locket of Yesterdays, I copied it from TFM's Locket card, but it seems to me the name check should use sName instead of oTarget.
EDIT:
I fixed a couple of mistakes. I had single = sign where I should have had doubles, I missed Defense Grid Hum of the Radix, and one cards where I had to count cards, I was incorrectly returning the positive result of that count rather than making it negative.
Also, I ran through the list you made, Neo, and checked mine against yours as well (it's how I noticed the two I was missing) and they all should be correct now (assuming Rakdos and the Locket that I asked about are right). This doesn't include spells that change depending on their targets.
Once I get some input on whether or not this is otherwise correct, I'll add in the ability to count colored mana.
EDIT2:
Also, I've attempted to make it so the one function can easily be used to get either the total cost change on a card or the cost change from a particular other card. It's the very first section, with "If oModifier == nil". It's supposed to iterate through all permanents on the battlefield and return the total at the end. It should work, but I'm not certain yet. I'm hoping it works because we will almost always just need the total change, and that's easy to do with just a single function that also performs the iterating. (Hopefully lua can nest a function inside itself...)
EDIT3:
Fixed a few more bugs/typos. It now should be possible to call it with just a single parameter, the card whose cost needs checked, and you should get back an integer telling you how much it's being changed. Note that for this to work, you must have the active-abilities-checking stuff from a few posts back. However, I've put the constant in the lol file code above, so you don't need that bit. Just make sure to add the token creation code to any cards with Delve, and then call
For the rest, I don't think that will work. First reason is that Frogtosser Banneret only reduces the cost of Arms Dealer by , not by , but Grand Arbiter Augustin IV reduces the cost of Ascended Lawmage by 2. The other problem is that even if we fix that, it would still require pulling out all relevant info from the card. Because of this, I don't see why we shouldn't just check them directly.
I've already got 95% of the function done. It just needs a few cards finished. Could someone check two in particular? Locket of Yesterdays and Rakdos, Lord of Riots. They're all in alphabetical order (and separated by cards that affect you, cards that affect opponents, then cards that affect everyone). For Locket of Yesterdays, I copied it from TFM's Locket card, but it seems to me the name check should use sName instead of oTarget.
- | Open
- Code: Select all
ABILITIES_ACTIVE = 909001
GetColorlessCostModification = function(oTarget, oModifier, bRecurse = true)
-- Returns an integer number for how much oModifier modifies oTarget's colorless mana most
if ( oTarget == nil ) then
return 0
end
if ( oModifier == nil and bRecurse ) then
local iMod = 0
local filter = ClearFilter()
local subfilter = filter:AddSubFilter_Or()
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ARTIFACT )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ENCHANTMENT )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PLANESWALKER )
local Count = filter:Count()
for i=0,(Count-1) do
iMod = iMod + GetColorlessCostModification = function(oTarget, filter:GetNthEvaluatedObject(i), false)
end
return iMod
end
if ( oModifier ~= nil and RSN_Characteristics_Get( oModifier, ABILITIES_ACTIVE ) then
local sName = oModifier:GetCardName()
local bYours = ( oModifier:GetController() == oTarget:GetController() )
if ( bYours ) then
if ( sName == "ANIMAR_SOUL_OF_ELEMENTS" and oTarget:GetCardType():Test(CARD_TYPE_CREATURE) ) then
return oModifier:CountCounters(MTG():PlusOnePlusOneCounters())*-1
elseif ( sName == "BALLYRUSH_BANNERET" and ( oTarget:GetSubType():Test(CREATURE_TYPE_KITHKIN) or oTarget:GetSubType():Test(CREATURE_TYPE_SOLDIER) ) ) then
return -1
elseif ( sName == "BLOOD_FUNNEL" and ( oTarget:GetCardType():Test(CARD_TYPE_CREATURE) == false ) ) then
return -2
elseif ( sName == "BOSK_BANNERET" and ( oTarget:GetSubType():Test(CREATURE_TYPE_TREEFOLK) or oTarget:GetSubType():Test(CREATURE_TYPE_SHAMAN) ) ) then
return -1
elseif ( sName == "BRIGHTHEARTH_BANNERET" and ( oTarget:GetSubType():Test(CREATURE_TYPE_ELEMENTAL) or oTarget:GetSubType():Test(CREATURE_TYPE_WARRIOR) ) ) then
return -1
elseif ( sName == "CENTAUR_OMENREADER" and oModifier:IsTapped() and oTarget:GetCardType():Test(CARD_TYPE_CREATURE) ) then
return -2
-- elseif ( sName == "CLOUD_KEY" and !!!CHOSEN_TYPE!!!) then
-- return -1
-- elseif ( sN=ame = "COUNCIL_OF_THE_ABSOLUTE" and !!!CHOSEN_NAME!!!) then
-- return -2
elseif ( sNam=e = "DARU_WARCHIEF" and oTarget:GetSubType():Test(CREATURE_TYPE_SOLDIER) ) then
return -1
elseif ( sName == "DRAGONSPEAKER_SHAMAN" and oTarget:GetSubType():Test(CREATURE_TYPE_DRAGON) ) then
return -2
-- elseif ( sName == "DREAM_CHISEL" and oTarget:GetCardType():Test(CARD_TYPE_CREATURE) and !!!FACE_DOWN!!! ) then
-- return -1
elseif ( sName == "EMERALD_MEDALLION" and oTarget:GetColour():Test(COLOUR_GREEN) ) then
return -1
elseif ( sName == "ETHERIUM_SCULPTOR" and oTarget:GetCardType():Test(CARD_TYPE_ARTIFACT) ) then
return -1
elseif ( sName == "EYE_OF_UGIN" and oTarget:GetSubType():Test(GetColour():Test(COLOUR_COLOURLESS) and oTarget:GetSubType():Test(CREATURE_TYPE_ELDRAZI) ) ) then
return -2
elseif ( sName == "FROGTOSSER_BANNERET" and ( oTarget:GetSubType():Test(CREATURE_TYPE_GOBLIN) or oTarget:GetSubType():Test(CREATURE_TYPE_ROGUE) ) ) then
return -1
elseif ( sName == "GOBLIN_ELECTROMANCER" and ( oTarget:GetCardType():Test(CARD_TYPE_INSTANT) or oTarget:GetCardType():Test(CARD_TYPE_SORCERY) ) ) then
return -1
elseif ( sName == "GOBLIN_WARCHIEF" and oTarget:GetSubType():Test(CREATURE_TYPE_GOBLIN) ) then
return -1
elseif ( sName == "GRAND_ARBITER_AUGUSTIN_IV" and oTarget:GetColour():Test(COLOUR_BLUE) and oTarget:GetColour():Test(COLOUR_WHITE) ) then
return -2
elseif ( sName == "GRAND_ARBITER_AUGUSTIN_IV" and oTarget:GetColour():Test(COLOUR_BLUE) ) then
return -1
elseif ( sName == "GRAND_ARBITER_AUGUSTIN_IV" and oTarget:GetColour():Test(COLOUR_WHITE) ) then
return -1
elseif ( sName == "HEARTLESS_SUMMONING" and oTarget:GetCardType():Test(CARD_TYPE_CREATURE) ) then
return -2
elseif ( sName == "HERALD_OF_WAR" and ( oTarget:GetSubType():Test(CREATURE_TYPE_ANGEL) or oTarget:GetSubType():Test(CREATURE_TYPE_HUMAN) ) ) then
return oModifier:CountCounters(MTG():PlusOnePlusOneCounters())*-1
elseif ( sName == "HERO_OF_IROAS" and oTarget:GetSubType():Test(ENCHANTMENT_TYPE_AURA) ) then
return -1
elseif ( sName == "JET_MEDALLION" and oTarget:GetColour():Test(COLOUR_BLACK) ) then
return -1
elseif ( sName == "KROSAN_DROVER" and oTarget:GetCardType():Test(CARD_TYPE_CREATURE) and oTarget:GetConvertedManaCost() >= 6 ) then
return -2
elseif ( sName == "KROSAN_WARCHIEF" and oTarget:GetSubType():Test(CREATURE_TYPE_BEAST) ) then
return -1
elseif ( sName == "LOCKET_OF_YESTERDAYS" ) then
local filter = ClearFilter()
filter:Add(FE_CARD_NAME, OP_IS, oTarget:GetCardName())
filter:Add(FE_CARD_INSTANCE, OP_NOT, oTarget)
filter:SetZone( ZONE_GRAVEYARD, EffectController() )
return filter:Count()*-1
-- elseif ( sName == "LONG_FORGOTTEN_GOHEI" and !!!SUBTYPE_ARCANE!!! ) then
-- return -1
elseif ( sName == "MANA_MATRIX" and ( oTarget:GetCardType():Test(CARD_TYPE_INSTANT) or oTarget:GetCardType():Test(CARD_TYPE_ENCHANTMENT) ) ) then
return -2
-- elseif ( sName == "MISTFORM_WARCHIEF" and oTarget:GetCardType():Test(CARD_TYPE_CREATURE) and !!!SHARES_A_TYPE_WITH_oModifier!!!) then
-- return -1
elseif ( sName == "MYCOSYNTH_GOLEM" and oTarget:GetCardType():Test(CARD_TYPE_ARTIFACT) and oTarget:GetCardType():Test(CARD_TYPE_CREATURE) ) then
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_ARTIFACT )
filter:Add( FE_CONTROLLER, OP_IS, oTarget:GetController() )
return filter:Count()*-1
elseif ( sName == "NIGHTSCAPE_FAMILIAR" and ( oTarget:GetColour():Test(COLOUR_BLUE) or oTarget:GetColour():Test(COLOUR_RED) ) ) then
return -1
elseif ( sName == "PEARL_MEDALLION" and oTarget:GetColour():Test(COLOUR_WHITE) ) then
return -1
elseif ( sName == "PLANAR_GATE" and oTarget:GetCardType():Test(CARD_TYPE_CREATURE) ) then
return -2
elseif ( sName == "RAKDOS_LORD_OF_RIOTS" and oTarget:GetCardType():Test(CARD_TYPE_CREATURE)) then
local num_starting_players = MTG():GetNumberOfStartingPlayers()
local life_lost = 0
for i=0,(num_starting_players-1) do
local player = MTG():GetNthStartingPlayer(i)
if (player ~= nil and player:GetTeam() ~= EffectController():GetTeam()) then
local interrogation = MTG():ClearInterrogationQuery()
interrogation:SetPlayer(player)
life_lost = life_lost + interrogation:Count( INTERROGATE_LIFE_LOST, INTERROGATE_THIS_TURN )
end
end
return life_lost*-1
elseif ( sName == "RUBY_MEDALLION" and oTarget:GetColour():Test(COLOUR_RED) ) then
return -1
elseif ( sName == "SAPPHIRE_MEDALLION" and oTarget:GetColour():Test(COLOUR_BLUE) ) then
return -1
-- elseif ( sName == "SEMBLANCE_ANVIL" and !!!SHARES_TYPE_WITH_EXILED_CARD!!! ) then
-- return -2
elseif ( sName == "STINKDRINKER_DAREDEVIL" and oTarget:GetSubType():Test(CREATURE_TYPE_GIANT) ) then
return -2
elseif ( sName == "STONE_CALENDAR" ) then
return -1
elseif ( sName == "STONYBROOK_BANNERET" and ( oTarget:GetSubType():Test(CREATURE_TYPE_MERFOLK) or oTarget:GetSubType():Test(CREATURE_TYPE_WIZARD) ) ) then
return -1
elseif ( sName == "STORMSCAPE_FAMILIAR" and ( oTarget:GetColour():Test(COLOUR_WHITE) or oTarget:GetColour():Test(COLOUR_BLACK) ) ) then
return -1
elseif ( sName == "SUNSCAPE_FAMILIAR" and ( oTarget:GetColour():Test(COLOUR_GREEN) or oTarget:GetColour():Test(COLOUR_BLUE) ) ) then
return -1
elseif ( sName == "THORNSCAPE_FAMILIAR" and ( oTarget:GetColour():Test(COLOUR_RED) or oTarget:GetColour():Test(COLOUR_WHITE) ) ) then
return -1
elseif ( sName == "THUNDERSCAPE_FAMILIAR" and ( oTarget:GetColour():Test(COLOUR_BLACK) or oTarget:GetColour():Test(COLOUR_GREEN) ) ) then
return -1
elseif ( sName == "UNDEAD_WARCHIEF" and oTarget:GetSubType():Test(CREATURE_TYPE_ZOMBIE) ) then
return -1
elseif ( sName == "WARDEN_OF_EVOS_ISLE" and oTarget:GetCardType():Test(CARD_TYPE_CREATURE) and oTarget:GetCurrentCharacteristics():Test(CHARACTERISTIC_FLYING) ) then
return -1
end
else
if ( sName == "AURA_OF_SILENCE" and ( oTarget:GetCardType():Test(CARD_TYPE_ARTIFACT) or oTarget:GetCardType():Test(CARD_TYPE_ENCHANTMENT) ) ) then
return 2
elseif ( sName == "GRAND_ARBITER_AUGUSTIN_IV" ) then
return 1
end
end
if ( sName == "ARCANE_MELEE" and ( oTarget:GetCardType():Test(CARD_TYPE_INSTANT) or oTarget:GetCardType():Test(CARD_TYPE_SORCERY) ) ) then
return -2
elseif ( sName == "CHILL" and oTarget:GetColour():Test(COLOUR_RED) ) then
return 2
elseif ( sName == "DEFENSE_GRID" and ( oTarget:GetController():MyTurn() == False ) )
return 3
elseif ( sName == "FEROZS_BAN" and oTarget:GetCardType():Test(CARD_TYPE_CREATURE) ) then
return 2
elseif ( sName == "GLOOM" and oTarget:GetColour():Test(COLOUR_WHITE) ) then
return 3
elseif ( sName == "GLOWRIDER" and ( oTarget:GetCardType():Test(CARD_TYPE_CREATURE) == false ) ) then
return 1
elseif ( sName == "HELM_OF_AWAKENING" ) then
return -1
elseif ( sName == "HIGH_SEAS" and oTarget:GetCardType():Test(CARD_TYPE_CREATURE) and ( oTarget:GetColour():Test(COLOUR_RED) or oTarget:GetColour():Test(COLOUR_GREEN) ) ) then
return 1
elseif ( sName == "HUM_OF_THE_RADIX" and oTarget:GetCardType():Test(CARD_TYPE_ARTIFACT) ) then
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_ARTIFACT )
filter:Add( FE_CONTROLLER, OP_IS, oTarget:GetController() )
return filter:Count()
elseif ( sName == "IRINI_SENGIR" and oTarget:GetCardType():Test(CARD_TYPE_ENCHANTMENT) and ( oTarget:GetColour():Test(COLOUR_GREEN) or oTarget:GetColour():Test(COLOUR_WHITE) ) ) then
return 2
elseif ( sName == "LODESTONE_GOLEM" and ( oTarget:GetCardType():Test(CARD_TYPE_ARTIFACT) == false ) ) then
return 1
elseif ( sName == "SPHERE_OF_RESISTANCE" ) then
return 1
elseif ( sName == "SQUEEZE" and oTarget:GetCardType():Test(CARD_TYPE_SORCERY) ) then
return 3
elseif ( sName == "THALIA_GUARDIAN_OF_THRABEN" and ( oTarget:GetCardType():Test(CARD_TYPE_CREATURE) == false ) ) then
return 1
elseif ( sName == "THORN_OF_AMETHYST" and ( oTarget:GetCardType():Test(CARD_TYPE_CREATURE) == false ) ) then
return 1
elseif ( sName == "URZAS_FILTER" and oTarget:GetColour():GetNumColours() > 1 ) then
return -2
-- elseif ( sName == "URZAS_INCUBATOR" and !!!CHOSEN_SUBTYPE!!! ) then
return -2
end
else
return 0
end
end
- Long-Forgotten Gohei requires the spell to be an Arcane spell, but I don't see Arcane listed as a subtype in the decompiled lol contents wiki page.
- Council of the Absolute, Cloud Key, and Semblance Anvil use the card's information, and I don't know how to access it (if it even can be).
- Mistform Warchief requires that the card shares a subtype with it; I can probably manage that, but I haven't yet put in the effort for it.
- Dream Chisel works for casting face-down... Don't know how to work with that. That's up to you Neo.
EDIT:
I fixed a couple of mistakes. I had single = sign where I should have had doubles, I missed Defense Grid Hum of the Radix, and one cards where I had to count cards, I was incorrectly returning the positive result of that count rather than making it negative.
Also, I ran through the list you made, Neo, and checked mine against yours as well (it's how I noticed the two I was missing) and they all should be correct now (assuming Rakdos and the Locket that I asked about are right). This doesn't include spells that change depending on their targets.
Once I get some input on whether or not this is otherwise correct, I'll add in the ability to count colored mana.
EDIT2:
Also, I've attempted to make it so the one function can easily be used to get either the total cost change on a card or the cost change from a particular other card. It's the very first section, with "If oModifier == nil". It's supposed to iterate through all permanents on the battlefield and return the total at the end. It should work, but I'm not certain yet. I'm hoping it works because we will almost always just need the total change, and that's easy to do with just a single function that also performs the iterating. (Hopefully lua can nest a function inside itself...)
EDIT3:
Fixed a few more bugs/typos. It now should be possible to call it with just a single parameter, the card whose cost needs checked, and you should get back an integer telling you how much it's being changed. Note that for this to work, you must have the active-abilities-checking stuff from a few posts back. However, I've put the constant in the lol file code above, so you don't need that bit. Just make sure to add the token creation code to any cards with Delve, and then call
- Code: Select all
local CostChange = GetColorlessCostModification(SomeCard)
Last edited by Xander9009 on 23 Sep 2014, 22:00, edited 1 time in total.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Khans of Tarkir (102/254) Last Updated 9/21/14
by NeoAnderson » 23 Sep 2014, 20:38
1. About the token manager, i know that it should be created just once, but with your trigger i csn see the ability granted once for each instance of the card.
2. About the list i have removed cards who counts spells that are targetting...
3. About cards who ask to name a card or a type, i don't think we can access to that information without modify these cards to support this function.
4. Would be better to check if the abilities are enabled inside this function.
5. Facedown is a RSN_Characteristics so is easy to check. Anyway it is not needed to add this check because is already included in my function for facedown cast. You will not have any delve with facedown.
6. About Radkos i made that count inside my morph functions you can check with that.
7. To check all the cards onto battlefield you can make another function who cycle the Object with cards onto battlefield calling this function.
8. I think you have to change some uppercase to lower case because Lua is case sensitive so Else or End are not the same of else and end..
9. About Locket of Yesterdays i think it should be :
11. Animar, Soul of Elements and Herald of War should return a negative value..
Anyway i will check later your code..
2. About the list i have removed cards who counts spells that are targetting...
3. About cards who ask to name a card or a type, i don't think we can access to that information without modify these cards to support this function.
4. Would be better to check if the abilities are enabled inside this function.
5. Facedown is a RSN_Characteristics so is easy to check. Anyway it is not needed to add this check because is already included in my function for facedown cast. You will not have any delve with facedown.
6. About Radkos i made that count inside my morph functions you can check with that.
7. To check all the cards onto battlefield you can make another function who cycle the Object with cards onto battlefield calling this function.
- Code: Select all
UpdateColourlessCostValue = function(oTarget)
local filter = ClearFilter()
local subfilter = filter:AddSubFilter_Or()
subfi[code][/code]lter:Add( FE_TYPE, OP_IS, CARD_TYPE_ARTIFACT )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ENCHANTMENT )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PLANESWALKER )
local Count = filter:Count()
local iMod = 0
for i=0,(Count-1) do
iMod = iMod + GetColorlessCostModification(oTarget, filter:GetNthEvaluatedObject(i))
end
return iMod
end
- Code: Select all
UpdateColourlessCostValue = function(oTarget)
local filter = ClearFilter()
local subfilter = filter:AddSubFilter_Or()
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ARTIFACT )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ENCHANTMENT )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PLANESWALKER )
local Count = filter:Count()
local iMod = 0
for i=0,(Count-1) do
local Card = filter:GetNthEvaluatedObject(i)
if Card ~= nil and RSN_Characteristics_Get( Card, ABILITIES_ACTIVE ) then
iMod = iMod + GetColorlessCostModification(oTarget, Card)
end
end
return iMod
end
8. I think you have to change some uppercase to lower case because Lua is case sensitive so Else or End are not the same of else and end..
9. About Locket of Yesterdays i think it should be :
- Code: Select all
elseif ( sName == "LOCKET_OF_YESTERDAYS" ) then
local filter = ClearFilter()
filter:Add(FE_CARD_NAME, OP_IS, oTarget:GetCardName())
filter:Add(FE_CARD_INSTANCE, OP_NOT, oTarget)
filter:SetZone( ZONE_GRAVEYARD, EffectController() )
11. Animar, Soul of Elements and Herald of War should return a negative value..
Anyway i will check later your code..
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Khans of Tarkir (102/254) Last Updated 9/21/14
by Xander9009 » 23 Sep 2014, 21:54
1. No matter how many cards you have with the token creating code, only one is made per player, and each token only grants to permanents you control, so it'll never double up. I may still be misunderstanding you, though.NeoAnderson wrote:1. About the token manager, i know that it should be created just once, but with your trigger i csn see the ability granted once for each instance of the card.
2. About the list i have removed cards who counts spells that are targetting...
3. About cards who ask to name a card or a type, i don't think we can access to that information without modify these cards to support this function.
4. Would be better to check if the abilities are enabled inside this function.
5. Facedown is a RSN_Characteristics so is easy to check. Anyway it is not needed to add this check because is already included in my function for facedown cast. You will not have any delve with facedown.
6. About Radkos i made that count inside my morph functions you can check with that.
7. To check all the cards onto battlefield you can make another function who cycle the Object with cards onto battlefield calling this function.7B. If you follow my suggestion from point 4 we could use something like :
- Code: Select all
UpdateColourlessCostValue = function(oTarget)
local filter = ClearFilter()
local subfilter = filter:AddSubFilter_Or()
subfi[code][/code]lter:Add( FE_TYPE, OP_IS, CARD_TYPE_ARTIFACT )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ENCHANTMENT )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PLANESWALKER )
local Count = filter:Count()
local iMod = 0
for i=0,(Count-1) do
iMod = iMod + GetColorlessCostModification(oTarget, filter:GetNthEvaluatedObject(i))
end
return iMod
endIn this way we compare only with cards with enabled abilities.
- Code: Select all
UpdateColourlessCostValue = function(oTarget)
local filter = ClearFilter()
local subfilter = filter:AddSubFilter_Or()
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ARTIFACT )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ENCHANTMENT )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PLANESWALKER )
local Count = filter:Count()
local iMod = 0
for i=0,(Count-1) do
local Card = filter:GetNthEvaluatedObject(i)
if Card ~= nil and RSN_Characteristics_Get( SomeCard, ABILITIES_ACTIVE ) then
iMod = iMod + GetColorlessCostModification(oTarget, Card)
end
end
return iMod
end
8. I think you have to change some uppercase to lower case because Lua is case sensitive so Else or End are not the same of else and end..
9. About Locket of Yesterdays i think it should be :10. Urza's Incubator is wrong it check for chosen type...
- Code: Select all
elseif ( sName == "LOCKET_OF_YESTERDAYS" ) then
local filter = ClearFilter()
filter:Add(FE_CARD_NAME, OP_IS, oTarget:GetCardName())
filter:Add(FE_CARD_INSTANCE, OP_NOT, oTarget)
filter:SetZone( ZONE_GRAVEYARD, EffectController() )
11. Animar, Soul of Elements and Herald of War should return a negative value..
Anyway i will check later your code..
3.That's what I was thinking. I was just hoping someone else could prove me wrong. I can accept it not working with 3 cards, though.
4. I was already planning to have that check done inside the function (I might not have been clear on that point), I just hadn't gotten there yet. It's in it now. I just meant that the code I posted is how one would normally check, perhaps in another ability that needs to know.
5. Alright. Do you happen to remember off-hand what you called it or should I just look in your lol file?
6. I copied the vanilla game's Rakdos, Lord of Riots so it SHOULD work. I'm just paranoid. I'll get around to testing soon anyway.
7. I could, but I rather like having just one function which can easily, logically, and simply handle both situations because it's VERY rare that we'll be calling it for a specific card's interaction with another specific card. Call with one parameter: checks total cost change; call with two parameters: checks particular cost change. I'm pretty sure I have it right now (I'm updating the code in my post as I find things that need changed).
7B. I am following that suggestion (I was even already going to haha). I put it immediately before checking the name, though because of the fact that I still currently have them as a single function.
8. I didn't know Lua was case sensitive, but I actually already DID change them all because I was annoyed that Notepad++ wasn't highlighting them correctly lol.
9. See, that's what I was thinking, but as I said (I think I did... might not have), how I have it is how TFM coded the card. I'm going to test that one specifically and find out which it is. Since we're both in agreement, I went ahead and changed it. We'll see once I can test it if it's right or wrong.
10. My bad. It's not correctly not doing anything haha (thanks to point 3).
11. I caught those two before you posted. Sorry, I just didn't update the code on here quickly enough.
For checking my code later: Okay, cool. 95% of it is repetition and doesn't really need checked. Just the first bit and the overall structure, as well as possibly the non-normal ones.
It's in a working state now as far as I can tell. So, Tajahn, if you want to post your Delve code, I'll incorporate this when I can and test it, otherwise, the code in my post where I explain how to do it will have everything for you to test it.
EDIT:
I've attached a zip with everything that SHOULD be needed to test this. Make sure you move ABILITIES_ACTIVE_MANAGER.xml and GetColorlessCostModification.LOL where they should go (CARDS and FUNCTIONS) and add the token creation code in the last file to your delve cards. Once you do,
- Code: Select all
local CostChange = GetColorlessCostModification(SomeCard)
- Attachments
-
- GetColorlessCostModification.zip
- (3.81 KiB) Downloaded 233 times
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Khans of Tarkir (102/254) Last Updated 9/21/14
by NeoAnderson » 23 Sep 2014, 22:34
5. NEO_CHARACTERISTIC_FACEDOWN and NEO_CHARACTERISTIC_MORPH, but you probably need only the first.
6. I think you have to revise the code because Lua doesn't accept some declarations...i get script error
UPDATE: The modify version i am using seems to works now it is only to test, (i have splitted into 2 functions) but the end user just call the first one with the card to evaluate.
There is an issue i am encountering about RSN FAKE ACTIVE_ABILITIES, it always return 0 (false) the test text is displayed on the cards, but the value is not retrieved, i tried also different layers, also to use Object() instead of EffectSource() but it doesn't change.
6. I think you have to revise the code because Lua doesn't accept some declarations...i get script error
- Code: Select all
[lua] [string "Content\Functions\GetColorlessCostModification.LOL"]:3: ')' expected near '=' [lua] lua_dofile error parsing file Content\Functions\GetColorlessCostModification.LOL
UPDATE: The modify version i am using seems to works now it is only to test, (i have splitted into 2 functions) but the end user just call the first one with the card to evaluate.
There is an issue i am encountering about RSN FAKE ACTIVE_ABILITIES, it always return 0 (false) the test text is displayed on the cards, but the value is not retrieved, i tried also different layers, also to use Object() instead of EffectSource() but it doesn't change.
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Khans of Tarkir (102/254) Last Updated 9/21/14
by RiiakShiNal » 23 Sep 2014, 23:07
Layers don't make sense unless you are talking about CONTINUOUS_ACTIONs as nothing else uses them. A RESOLUTION_TIME_ACTION or a PLAY_TIME_ACTION occurs between evaluating STATE_BASED_EFFECTS and each evaluation will run through all CONTINUOUS_ACTIONs for all layers so no need to worry about layer for checking except on CONTINUOUS_ACTIONs.
I can confirm that RSN_Characteristics_CreateManagers() will only ever create one of each passed in token manager for each player regardless of how many times it is called. However, since there is no checking for effects that increase the number of tokens (i.e. Doubling Season) it should always be done right when the game starts (beginning of turn 0). It first checks to see if the token manager exists, if it already exists then it does nothing, if not then it creates the token manager (the code for that is relatively simple).
Edit:
I can confirm that RSN_Characteristics_CreateManagers() will only ever create one of each passed in token manager for each player regardless of how many times it is called. However, since there is no checking for effects that increase the number of tokens (i.e. Doubling Season) it should always be done right when the game starts (beginning of turn 0). It first checks to see if the token manager exists, if it already exists then it does nothing, if not then it creates the token manager (the code for that is relatively simple).
Edit:
I can look into this later, but it may not be until this weekend as I don't have much time outside of work during the week.NeoAnderson wrote:There is an issue i am encountering about RSN FAKE ACTIVE_ABILITIES, it always return 0 (false) the test text is displayed on the cards, but the value is not retrieved, i tried also different layers, also to use Object() instead of EffectSource() but it doesn't change.
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: Khans of Tarkir (102/254) Last Updated 9/21/14
by NeoAnderson » 23 Sep 2014, 23:13
If you have take a look to Xander code, i can tell to you that i have 2 instances of card that uses that code, and the text ACTIVE ABILITIES is displayed 2 time, when i changed the trigger checking a chest to trigger just once it is reduce to 1.RiiakShiNal wrote:Layers don't make sense unless you are talking about CONTINUOUS_ACTIONs as nothing else uses them. A RESOLUTION_TIME_ACTION or a PLAY_TIME_ACTION occurs between evaluating STATE_BASED_EFFECTS and each evaluation will run through all CONTINUOUS_ACTIONs for all layers so no need to worry about layer for checking except on CONTINUOUS_ACTIONs.
I can confirm that RSN_Characteristics_CreateManagers() will only ever create one of each passed in token manager for each player regardless of how many times it is called. However, since there is no checking for effects that increase the number of tokens (i.e. Doubling Season) it should always be done right when the game starts (beginning of turn 0). It first checks to see if the token manager exists, if it already exists then it does nothing, if not then it creates the token manager (the code for that is relatively simple).
Anyway this is not the main problem, now i would understand why, RSN Characteristic always return 0.
I removed the first ability who grant the ability that set the characteristic to 1, and i directly granted the ability that sets the value to 1, and i always retrieve 1, also if the card losesallabilities, probably because lose all abilities works on lower layers.
Anyway the text disappear but the value still remain 1.
Any suggestion???
Thanks i hope to find a solution before, if we don't any help will be appreciated!RiiakShiNal wrote:I can look into this later, but it may not be until this weekend as I don't have much time outside of work during the week.
Last edited by NeoAnderson on 23 Sep 2014, 23:22, edited 2 times in total.
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Khans of Tarkir (102/254) Last Updated 9/21/14
by RiiakShiNal » 23 Sep 2014, 23:20
I'll have to look into this later, as I don't have much time on weekdays.NeoAnderson wrote:If you have take a look to Xander code, i can tell to you that i have 2 instances of card that uses that code, and the text ACTIVE ABILITIES is displayed 2 time, when i changed the trigger checking a chest to trigger just once it is reduce to 1.
If you set the fake characteristic directly from the token manager then it will always be set because the token manager is never losing it's abilities (I did say this earlier). It has to be done from a granted ability because LoseAllAbilities() will remove granted abilities and real characteristics, but it will not clear data chests (it definitely won't clear ObjectDC chests as those are actually stored in the DuelDataChest() area and not on the card itself).NeoAnderson wrote:Anyway this is not the main problem, now i would understand why, RSN Characteristic always return 0.
I removed the first ability who grant the ability that set the characteristic to 1, and i directly granted the ability that sets the value to 1, and i always retrieve 1, also if the card losesallabilities, probably because lose all abilities works on lower layers.
Anyway the text disappear but the value still remain 1.
Any suggestion???
As to why it is currently always returning 0 for you I don't currently know and will have to go through the code in detail which means it is going to have to wait until I have time (probably over a weekend).
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: Khans of Tarkir (102/254) Last Updated 9/21/14
by NeoAnderson » 23 Sep 2014, 23:23
Thanks Riiak but i have solved, i just reset the value to 0 before to grant the ability, so when it loses the granted ability the value will be set to 0 by the manager.RiiakShiNal wrote:If you set the fake characteristic directly from the token manager then it will always be set because the token manager is never losing it's abilities (I did say this earlier). It has to be done from a granted ability because LoseAllAbilities() will remove granted abilities and real characteristics, but it will not clear data chests (it definitely won't clear ObjectDC chests as those are actually stored in the DuelDataChest() area and not on the card itself).
As to why it is currently always returning 0 for you I don't currently know and will have to go through the code in detail which means it is going to have to wait until I have time (probably over a weekend).
Update : I have found a solution, tested and it works.
- ABILITIES ACTIVE MANAGER NEO REV 1.0 | Open
- Code: Select all
<?xml version="1.0"?>
<CARD_V2 ExportVersion="1">
<FILENAME text="ABILITIES_ACTIVE_MANAGER" />
<CARDNAME text="ABILITIES_ACTIVE_MANAGER" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[ABILITIES ACTIVE MANAGER]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[ABILITIES ACTIVE MANAGER]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[ABILITIES ACTIVE MANAGER]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[ABILITIES ACTIVE MANAGER]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[ABILITIES ACTIVE MANAGER]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[ABILITIES ACTIVE MANAGER]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[ABILITIES ACTIVE MANAGER]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[ABILITIES ACTIVE MANAGER]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[ABILITIES ACTIVE MANAGER]]></LOCALISED_TEXT>
</TITLE>
<ARTID value="0" />
<ARTIST name="None" />
<CASTING_COST cost="" />
<EXPANSION value="MANAGER_TOKENS" />
<RARITY metaname="T" />
<!-- Shroud so it can't be targeted. -->
<STATIC_ABILITY>
<INTRINSIC characteristic="CHARACTERISTIC_SHROUD" />
</STATIC_ABILITY>
<!-- Indestructible so it can't be destroyed. -->
<STATIC_ABILITY>
<INTRINSIC characteristic="CHARACTERISTIC_INDESTRUCTIBLE" />
</STATIC_ABILITY>
<!-- Protection from everything to prevent unwanted removal. -->
<STATIC_ABILITY>
<CONTINUOUS_ACTION layer="0">
if (EffectSource() ~= nil) then
local oFilter = ClearFilter()
local oSubfilter = oFilter:AddSubFilter_Or()
oSubfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ARTIFACT )
oSubfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
oSubfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ENCHANTMENT )
oSubfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_INSTANT )
oSubfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
oSubfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PHENOMENON )
oSubfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PLANE )
oSubfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PLANESWALKER )
oSubfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_SCHEME )
oSubfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_SORCERY )
EffectSource():Protection()
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<!-- Now we have extra abilities for those characteristics which are built into this manager. -->
<!-- In other words these are the functions that make the custom characteristics actually do something. -->
<STATIC_ABILITY>
<FILTER filter_id="0">
local filter = ClearFilter()
local subfilter = filter:AddSubFilter_Or()
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ARTIFACT )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ENCHANTMENT )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PLANESWALKER )
filter:Add( FE_CONTROLLER, OP_IS, EffectController())
</FILTER>
<CONTINUOUS_ACTION layer="6" filter_id="0">
if FilteredCard() ~= nil then
local characteristics = FilteredCard():GetCurrentCharacteristics()
RSN_Characteristics_Set( FilteredCard(), ABILITIES_ACTIVE, 0 )
characteristics:GrantAbility(1)
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<STATIC_ABILITY resource_id="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Abilities are active]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Abilities are active]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Abilities are active]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Abilities are active]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Abilities are active]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Abilities are active]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Abilities are active]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Abilities are active]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Abilities are active]]></LOCALISED_TEXT>
<CONTINUOUS_ACTION layer="7A">
RSN_Characteristics_Set( EffectSource(), ABILITIES_ACTIVE, 1 )
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
</CARD_V2>
- TRIGGER TO CREATE THE MANAGER | Open
- Code: Select all
<TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_CHARACTERISTIC_MANAGER" />
<TOKEN_REGISTRATION reservation="1" type="ABILITIES_ACTIVE_MANAGER" />
<TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_ANY">
<TRIGGER value="BEGINNING_OF_STEP">
if ((MTG():GetStep() == STEP_UPKEEP) and (MTG():GetTurnNumber() == 0)) then
local chest = EffectController():PlayerDataChest():Get_Chest(8100512)
if chest ~= nil then
return false
else
local chest = EffectController():PlayerDataChest():Make_Chest(8100512)
return true
end
end
</TRIGGER>
<RESOLUTION_TIME_ACTION>
RSN_Characteristics_CreateManagers("ABILITIES_ACTIVE_MANAGER")
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
56 posts
• Page 3 of 4 • 1, 2, 3, 4
Who is online
Users browsing this forum: No registered users and 15 guests