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 NeoAnderson » 24 Sep 2014, 00:22
Now i would approach to make a Delve approximation but i am thinking we need to make a choice, because of Delve definition it isn't an additional cost or an alternative cost, but the only way to make it properly works is to implement as alternative cost.
Another way could be to implement as activated ability but in this case we will lose the possibility to use from other zone like exile, graveyard, library.....
Theoretically we should be able to cast Delve + Flashback and i am not sure we can do it.
Honestly i am not sure which could be the best solution...
Another way could be to implement as activated ability but in this case we will lose the possibility to use from other zone like exile, graveyard, library.....
Theoretically we should be able to cast Delve + Flashback and i am not sure we can do it.
Honestly i am not sure which could be the best solution...
- 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 » 24 Sep 2014, 01:04
I hadn't yet tested it. I noticed a number of issues but I think I got them all fixed, along with splitting it into two functions. However, I still can't manage a test which confirms a change in cost. How did you manage that Neo? (Note: I AM using the two pieces of code you just posted.) I'm not getting any errors, it but the cost function always return 0. Since you didn't post the code cut up into 2 functions, I'll post my version.
That leads to a useful question: how do you guys debug your code? Because the only way I know to do it is to put in something like GainLife(VariableToDebug). That's really clunky, though. Is there a better way?
EDIT:
NVM. If you've got it, Neo, that's good enough for me. As for which would be better, I would go with whichever is most reliable. Alternative should be acceptable.
That leads to a useful question: how do you guys debug your code? Because the only way I know to do it is to put in something like GainLife(VariableToDebug). That's really clunky, though. Is there a better way?
- | Open
- Code: Select all
ABILITIES_ACTIVE = 909001
GetColorlessCostModification = function(oTarget)
-- Returns an integer number for how much oModifier modifies oTarget's colorless mana most
if ( oTarget == nil ) then
return 0
end
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
local oModifier = filter:GetNthEvaluatedObject(i)
if ( oModifier ~= nil and ( oModifier ~= oTarget ) and RSN_Characteristics_Get( oModifier, ABILITIES_ACTIVE ) ) then
iMod = iMod + GetColorlessCostModificationTargeted(oTarget, oModifier)
end
end
return iMod
end
GetColorlessCostModificationTargeted = function(oTarget, oModifier)
if ( oTarget == nil or oModifier == nil or ( RSN_Characteristics_Get( oModifier, ABILITIES_ACTIVE ) == false ) ) then
return 0
end
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 ( sName == "COUNCIL_OF_THE_ABSOLUTE" and !!!CHOSEN_NAME!!!) then
-- return -2
elseif ( sName == "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 ) ) then
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
end
EDIT:
NVM. If you've got it, Neo, that's good enough for me. As for which would be better, I would go with whichever is most reliable. Alternative should be acceptable.
_______________________________
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 » 24 Sep 2014, 06:00
To test my code i am using 2 modded cards who let me know to force many situations, and i use one of them to build custom abilities for particular tests. For this function i used the follow ability :Xander9009 wrote:I hadn't yet tested it. I noticed a number of issues but I think I got them all fixed, along with splitting it into two functions. However, I still can't manage a test which confirms a change in cost. How did you manage that Neo? (Note: I AM using the two pieces of code you just posted.) I'm not getting any errors, it but the cost function always return 0. Since you didn't post the code cut up into 2 functions, I'll post my version.
That leads to a useful question: how do you guys debug your code? Because the only way I know to do it is to put in something like GainLife(VariableToDebug). That's really clunky, though. Is there a better way?
EDIT:
NVM. If you've got it, Neo, that's good enough for me. As for which would be better, I would go with whichever is most reliable. Alternative should be acceptable.
- ABILITY TO CHECK TARGET COST CHANGE | Open
- Code: Select all
<ACTIVATED_ABILITY forced_skip="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{0}, : TEST COST MODIFY.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{0}, : TEST COST MODIFY.]]></LOCALISED_TEXT>
<COST mana_cost="{0}" type="Mana" />
<TARGET tag="CARD_QUERY_CHOOSE_CARD" definition="0" compartment="0" count="1" />
<TARGET_DEFINITION 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 )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
local oTarget = EffectDC():Get_Targets(0):Get_CardPtr(0)
if (oTarget ~= nil) then
local CostChange = UpdateColourlessCostValue(oTarget)
EffectController():DisplayMessage(CostChange)
end
</RESOLUTION_TIME_ACTION>
</ACTIVATED_ABILITY>
- ABILITY TO CHECK ACTIVE ABILITIES STATUS | Open
- Code: Select all
<ACTIVATED_ABILITY forced_skip="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{0}, : TEST ABILITIES.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{0}, : TEST ABILITIES.]]></LOCALISED_TEXT>
<COST mana_cost="{0}" type="Mana" />
<TARGET tag="CARD_QUERY_CHOOSE_CARD" definition="0" compartment="0" count="1" />
<TARGET_DEFINITION 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 )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
local oTarget = EffectDC():Get_Targets(0):Get_CardPtr(0)
if (oTarget ~= nil) then
local value = RSN_Characteristics_GetInt( oTarget, NEO_ABILITIES_ACTIVE )
EffectController():DisplayMessage(value)
end
</RESOLUTION_TIME_ACTION>
</ACTIVATED_ABILITY>
2. Before to choose Alternative cost or Activated ability i want to make some tests, to understand if there is a way to take a decision before the cost of the spell is payed when we normally attempt to cast it.
3. I post here also the modified function so if you need you can compare
- UpdateColourlessCostValue | Open
- 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:EvaluateObjects()
local iMod = 0
for i=0,(Count-1) do
local Card = filter:GetNthEvaluatedObject(i)
if Card ~= nil and RSN_Characteristics_GetInt( Card, NEO_ABILITIES_ACTIVE ) == 1 then
iMod = iMod + GetColorlessCostModification(oTarget, Card)
end
end
return iMod
end
GetColorlessCostModification = function(oTarget, oModifier)
-- Returns an integer number for how much oModifier modifies oTarget's colorless mana most
if oModifier ~= nil then
local sName = oModifier:GetCardName()
local CostChange = 0
if oModifier:GetController() == oTarget:GetController() then
if ( sName == "ANIMAR_SOUL_OF_ELEMENTS" and oTarget:GetCardType():Test(CARD_TYPE_CREATURE) ) then
return -(oModifier:CountCounters(MTG():PlusOnePlusOneCounters()))
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 == "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 == "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()))
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 == "MANA_MATRIX" and ( oTarget:GetCardType():Test(CARD_TYPE_INSTANT) or oTarget:GetCardType():Test(CARD_TYPE_ENCHANTMENT) ) ) then
return -2
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 == "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 ) ) then
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
end
end
return 0
end
- COSTANTS DECLARATION | Open
- Code: Select all
NEO_ABILITIES_ACTIVE = 5850004
NEO_CHEST_AAM = 5850005
- 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 » 24 Sep 2014, 13:43
Ironically, I saw Display Message and considered using it. For whatever reason, I figured it was probably only going to work with strings and not numbers and decided against trying it. Anyway, I've got your script put in, but the checking ability is still returning 0 even when it should be returning 1 (and yes, I'm using your fixed version of the manager). I'll mess with it some today, but I'll be mostly focused on getting the tokens ready in the Community Wad (I have about 50 pictures left to do and every single token I could find will be available in a standard format ).
_______________________________
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 » 24 Sep 2014, 16:00
1. About the DisplayMessage function you can pass everything you want strings or numbers, or both concatenating the values.Xander9009 wrote:Ironically, I saw Display Message and considered using it. For whatever reason, I figured it was probably only going to work with strings and not numbers and decided against trying it. Anyway, I've got your script put in, but the checking ability is still returning 0 even when it should be returning 1 (and yes, I'm using your fixed version of the manager). I'll mess with it some today, but I'll be mostly focused on getting the tokens ready in the Community Wad (I have about 50 pictures left to do and every single token I could find will be available in a standard format ).
Example:
- Code: Select all
local value = 1
EffectController():DisplayMessage("The result is : "..value)
- Code: Select all
The result is : 1
3. I would continue the discussion about Delve mechanic into a dedicated topic, so i opened a topic into programming talk, i also made the first approximation, follow the link and let to discess there. DELVE TOPIC
- 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 Tejahn » 24 Sep 2014, 19:47
I'm glad to hear of the progress that's been made for Delve. I'll be sure to build a few decks and test the mechanic. Also, I've uploaded the Mardu deck. It's brutally efficient and mulligans very well if needed. You'll always have a high chance of a quick victory.
EDIT: I re-uploaded the Mardu deck to include the Vampire token created by Sorin.
EDIT: I re-uploaded the Mardu deck to include the Vampire token created by Sorin.
Re: Khans of Tarkir (102/254) Last Updated 9/21/14
by volrathxp » 27 Sep 2014, 20:30
Your Sarkhan is missing the second half of his emblem (the part about discarding your hand at the end of turn). Right now it has you just drawing 2 additional.
Edit: Also, how are you accounting for the fact that new Sarkhan isn't in the planeswalker name set? Same for Sorin. The PLW Mod functions includes a NameSet function that lists every planeswalker name, to account for specific cards and interactions. New Sarkhan and Sorin will need to be added to this file.
Edit: Also, how are you accounting for the fact that new Sarkhan isn't in the planeswalker name set? Same for Sorin. The PLW Mod functions includes a NameSet function that lists every planeswalker name, to account for specific cards and interactions. New Sarkhan and Sorin will need to be added to this file.
volrathxp
Re: Khans of Tarkir (102/254) Last Updated 9/21/14
by Tejahn » 27 Sep 2014, 23:58
Thanks for the report volrathxp! Could you post the code for Sarkhan's emblem? I'll update it with the proper code. Also, if you could do the same for the NameSet functions for the Planeswalkers that would be great.
EDIT: I didn't bother with the NameSet functions because I was waiting on thefiremind to update the Planeswalker Mod to include the new Sarkhan and Sorin.
EDIT: I didn't bother with the NameSet functions because I was waiting on thefiremind to update the Planeswalker Mod to include the new Sarkhan and Sorin.
Re: Khans of Tarkir (102/254) Last Updated 9/21/14
by volrathxp » 28 Sep 2014, 02:56
Yeah, I think that's for the best in the long run.Tejahn wrote:Thanks for the report volrathxp! Could you post the code for Sarkhan's emblem? I'll update it with the proper code. Also, if you could do the same for the NameSet functions for the Planeswalkers that would be great.
EDIT: I didn't bother with the NameSet functions because I was waiting on thefiremind to update the Planeswalker Mod to include the new Sarkhan and Sorin.
volrathxp
Re: Khans of Tarkir (102/254) Last Updated 9/21/14
by fallenangle » 28 Sep 2014, 20:33
I got Sarkhan's Emblem to work. Here's the code I used. There's probably a more elegant way to do it, but I'm only a novice coder, so I don't know. At any rate, here's the code for his ultimate:
Edit: I found that I accidentally had an old copy of the PLW.LOL in my functions folder. Deleting it did the trick, and now everything works just as it should. All of the new Sarkhan's and Sorin's abilities work properly, and they add and subtract loyalty counters, use abilities, and go to the graveyard when they have no loyalty counters just as they should. I will try to upload my working, updated PLW.wad to the Planeswalkers topic. That should give people a chance to have all of the Planeswalkers available in one place.
- Code: Select all
<ACTIVATED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[[-6]: You get an emblem with “At the beginning of your draw step, draw two additional cards” and “At the beginning of your end step, discard your hand.”]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[-6 : Vous gagnez un emblème avec « Au début de votre étape de pioche, piochez deux cartes supplémentaires » et « Au début de votre étape de fin, défaussez-vous de votre main. »]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[–6: Obtienes un emblema con “Al comienzo de tu paso de robar, roba dos cartas adicionales” y “Al comienzo de tu paso final, descarta tu mano”.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[−6: Du erhältst ein Emblem mit „Ziehe zu Beginn deines Ziehsegments zwei zusätzliche Karten” und „Wirf zu Beginn deines Endsegments alle Karten aus deiner Hand ab.”]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[−6: Ottieni un emblema con “All’inizio della tua acquisizione, pesca due carte addizionali” e “All’inizio della tua sottofase finale, scarta la tua mano”.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[-6:あなたは「あなたのドロー・ステップの開始時に、カードを追加で2枚引く。」と「あなたの終了ステップの開始時に、あなたは手札を捨てる。」を持つ紋章を得る。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[-6: 당신은 “당신의 뽑기단 시작에, 카드 두 장을 추가로 뽑는다.”와 “당신의 종료단 시작에, 당신의 손을 버린다.”를 가진 휘장을 받는다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[−6: вы получаете эмблему со способностями «В начале вашего шага взятия карты возьмите две дополнительные карты» и «В начале вашего заключительного шага сбросьте вашу руку».]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[−6: Você ganha um emblema com “No início da sua etapa de compra, compre dois cards adicionais” e “No início da sua etapa final, descarte a sua mão.”]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[-6:你获得具有「在你的抓牌步骤开始时,额外抓两张牌」与「在你的结束步骤开始时,弃掉你的手牌」的徽记。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[-6:你獲得具有「在你的抽牌步驟開始時,額外抽兩張牌」與「在你的結束步驟開始時,棄掉你的手牌」的徽記。]]></LOCALISED_TEXT>
<AVAILABILITY sorcery_time="1" />
<COST type="RemoveCountersSelf" amount="6" counter_type="Loyalty" />
<RESOLUTION_TIME_ACTION>
MTG():CreateDelayedTrigger(1, nil)
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
MTG():CreateDelayedTrigger(2, nil)
</RESOLUTION_TIME_ACTION>
</ACTIVATED_ABILITY>
<TRIGGERED_ABILITY resource_id="1">
<CLEANUP>
return EffectController() == nil
</CLEANUP>
<TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller">
return MTG():GetStep() == STEP_UPKEEP
</TRIGGER>
<RESOLUTION_TIME_ACTION>
if TriggerPlayer() ~= nil then
TriggerPlayer():DrawCards(2)
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY resource_id="2">
<CLEANUP>
return EffectController() == nil
</CLEANUP>
<TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller">
return MTG():GetStep() == STEP_END_OF_TURN
</TRIGGER>
<RESOLUTION_TIME_ACTION>
EffectController():DiscardHand()
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
Edit: I found that I accidentally had an old copy of the PLW.LOL in my functions folder. Deleting it did the trick, and now everything works just as it should. All of the new Sarkhan's and Sorin's abilities work properly, and they add and subtract loyalty counters, use abilities, and go to the graveyard when they have no loyalty counters just as they should. I will try to upload my working, updated PLW.wad to the Planeswalkers topic. That should give people a chance to have all of the Planeswalkers available in one place.
- fallenangle
- Posts: 319
- Joined: 20 Jul 2013, 02:31
- Has thanked: 73 times
- Been thanked: 41 times
Re: Khans of Tarkir (102/254) Last Updated 9/21/14
by Tejahn » 29 Sep 2014, 18:31
Thanks for the code fallenangle! And I see you've already updated everything on the Planeswalker thread. Kudos!
56 posts
• Page 4 of 4 • 1, 2, 3, 4
Who is online
Users browsing this forum: No registered users and 14 guests