Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk
Morph tests
Moderator: CCGHQ Admins
Re: Morph tests
by braquio » 10 Sep 2014, 16:47
You'r right sorry, I'm definitely not very awake today.To test the reduced cost of normal cast you have to use card who reduces/increases cost of:
Creature spells / Blue Spell / Generic Spells
To test the reduced cost of Morph you have to use card who reduces/increases cost of :
Creature spells / Generic Spells
Example: Grand Arbiter Augustin IV
If you control it, only when you cast normal mode you should see a cost reduction
If it is controlled by opponent both mode normal and morph should cost 1 more.
The morphed spell isn't colourless, it is no colours. So spell who affect colourless will not work on it.
You can't be sure about this but thanks for trusting meYou are not drinked
____________________________________________________________________________________________________________________________
Braquio Dotp2014 DLC
Alternative Sealed Campaigns for DotP 2014
Braquio Dotp2014 DLC
Alternative Sealed Campaigns for DotP 2014
Re: Morph tests
by NeoAnderson » 10 Sep 2014, 16:59
About this issue you mentioned : When morphed creature go to graveyard there is a little lag.
WHat do you see exactly? Because i had a morphed creature died after combat, and i have seen no lag, but i have seen a grey token who was fired in the middle of the battlefield, this happens sometimes also with mana tokens... but no lag and the creature is put into graveyard face up.

NEXT STEP :
Now i have to figure how to store the source object ref, so when there are cards who need to know which source card is a facedown card, we can do it.
I am thinking to store the Object Ref into a EffectDC register and use a delayedDC that trigger when it enters onto battlefield facedown, then i copy the value into an objectDC so i can read it from other cards.
WHat do you see exactly? Because i had a morphed creature died after combat, and i have seen no lag, but i have seen a grey token who was fired in the middle of the battlefield, this happens sometimes also with mana tokens... but no lag and the creature is put into graveyard face up.
- If somoeone want to check how many card with morph ability there are in play here is an example : | Open
- Code: Select all
<RESOLUTION_TIME_ACTION>
local filter = ClearFilter()
filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
local numFilter = filter:EvaluateObjects()
local j = 0
for i = 0, (numFilter-1) do
local victim = filter:GetNthEvaluatedObject(i)
if victim ~= nil then
local cardAbility = RSN_Characteristics_GetInt( victim, NEO_CHARACTERISTIC_MORPH )
if cardAbility == 1 then
j = j + 1
EffectController():DisplayMessage(j.." : Card : "..victim:GetCardName())
end
end
end
</RESOLUTION_TIME_ACTION>
- This other one counts the number of facedown cards : | Open
- Code: Select all
<RESOLUTION_TIME_ACTION>
local filter = ClearFilter()
filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
local numFilter = filter:EvaluateObjects()
local j = 0
for i = 0, (numFilter-1) do
local victim = filter:GetNthEvaluatedObject(i)
if victim ~= nil then
local cardAbility = RSN_Characteristics_GetInt( victim, NEO_CHARACTERISTIC_FACEDOWN )
if cardAbility == 1 then
j = j + 1
end
end
end
EffectController():DisplayMessage("Number of facedown cards onto battlefield : "..j)
</RESOLUTION_TIME_ACTION>
You know what?? I am an innocent soul!braquio wrote:You can't be sure about this but thanks for trusting meYou are not drinked
NEXT STEP :
Now i have to figure how to store the source object ref, so when there are cards who need to know which source card is a facedown card, we can do it.
I am thinking to store the Object Ref into a EffectDC register and use a delayedDC that trigger when it enters onto battlefield facedown, then i copy the value into an objectDC so i can read it from other cards.
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Morph tests
by Kithkin » 10 Sep 2014, 17:51
When the AI casts a morph card, the card enters the battlefield face-up, and the human player can see it, even if AI decides to cast it face-down. This is a serious issue and needs to be solved.
Suggestion for German translation:
Suggestion for German translation:
- CARD_UI_TEXT | Open
- "Bezahle
und verwandele in:
Aphettonischer Alchimist

POWER/TOUGHNESS = 1/2
: Enttappe ein Artefakt oder eine Kreatur deiner Wahl."
Zusammenfassende Informationen der verborgenen Karte
Abbrechen
Wirke diesen Zauberspruch verdeckt und bezahle
-

Kithkin - Posts: 456
- Joined: 21 Feb 2014, 07:12
- Location: Cologne, GERMANY
- Has thanked: 11 times
- Been thanked: 56 times
Re: Morph tests
by thefiremind » 10 Sep 2014, 18:23
And my glass isn't half empty, it's half full.NeoAnderson wrote:The morphed spell isn't colourless, it is no colours.
By the way, this page states something very important: "An important change in Future Sight is that playing a spell face down works as though the card were already face down in your hand when you start to play it". Teferi, Mage of Zhalfir should let you play Lumithread Field, Whetwheel and Zoetic Cavern at instant speed if you play them face-down. On the other hand, Grid Monitor should prevent you from playing any morph card face-down.
Another interesting test would be Essence of the Wild.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-

thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: Morph tests
by NeoAnderson » 10 Sep 2014, 19:46
I don't remember which discussion i was reading about no colours and colourless, anyway i think you're right i have just search and it should be colourless. A weird thing is that inside dotp exsist also COLOUR_X i am trying to think what can be.thefiremind wrote:And my glass isn't half empty, it's half full.NeoAnderson wrote:The morphed spell isn't colourless, it is no colours.No, really, there's no difference.
By the way, this page states something very important: "An important change in Future Sight is that playing a spell face down works as though the card were already face down in your hand when you start to play it". Teferi, Mage of Zhalfir should let you play Lumithread Field, Whetwheel and Zoetic Cavern at instant speed if you play them face-down. On the other hand, Grid Monitor should prevent you from playing any morph card face-down.
Another interesting test would be Essence of the Wild.
About the cards you mentioned for the test we should try because as i remember should work, also for bestow works, because we manupilate the card type into prerequisite block, this means that when we try to activate the ability, the card change.
About Essence of the Wild i am already sure, it works because is a trigger ability that fires when the card enter onto battlefield(transition zone), so the modify is already done.
We only need to make stress test for casting timing.
Do you know if is possible to grant an ability, to an Object we don't control also setting we can use that ability?
I know is possible to set available to all players but what about to set available just to a particular player?
UPDATE : I made a test with Lumithread Field and Teferi, Mage of Zhalfir and it doesn't work the flash ability is not granted or at least the timing is too fast to update it so you still cannot cast it.
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Morph tests
by NeoAnderson » 11 Sep 2014, 21:02
thx for your support, now i am still thinking how to fix tye Human play, still not full working then i will check Ai behaviour. About the German translation, if we will figure how to fix all these issues, so we will make morph cards, you could help to translate some German txt.Kithkin wrote:When the AI casts a morph card, the card enters the battlefield face-up, and the human player can see it, even if AI decides to cast it face-down. This is a serious issue and needs to be solved.
Suggestion for German translation:
- CARD_UI_TEXT | Open
- "Bezahle
und verwandele in:
Aphettonischer Alchimist![]()
POWER/TOUGHNESS = 1/2: Enttappe ein Artefakt oder eine Kreatur deiner Wahl."
Zusammenfassende Informationen der verborgenen Karte
Abbrechen
Wirke diesen Zauberspruch verdeckt und bezahle
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Morph tests
by braquio » 11 Sep 2014, 21:25
I only saw a little lag one time when i attacked with morphed creature and its blocked by 2 creatures(morphed and one blocking die), so may be the lag was for the combat resolution, i dont think its very important so forget it.About this issue you mentioned : When morphed creature go to graveyard there is a little lag.
WHat do you see exactly? Because i had a morphed creature died after combat, and i have seen no lag, but i have seen a grey token who was fired in the middle of the battlefield, this happens sometimes also with mana tokens... but no lag and the creature is put into graveyard face up.
____________________________________________________________________________________________________________________________
Braquio Dotp2014 DLC
Alternative Sealed Campaigns for DotP 2014
Braquio Dotp2014 DLC
Alternative Sealed Campaigns for DotP 2014
Re: Morph tests
by NeoAnderson » 12 Sep 2014, 01:17
I think i have reached a dead point...
The card is still affected by issue when an effect is applied during the considering for cast timing..as like Teferi, Mage of Zhalfir..if i try to cast Lumithread Field, i cannot do it.
Unfortunately there isn't any trigger between Considered For Cast and Spell Played, so we have difficulties to modify the values before the Casting process is started.
I tried different ways, as like to face down the card with an activated abilities the cast it, but in this case we will other kind of problems, as like the fact that the facedown card has no cost, so it can be played for free (simple to workaround), other problems with spell who increase or decrease the cost, to be quick i can only says i have tried everything but when we found a workaround to fix a problem we make other problems to fix! It seems there isn't a full working solution...if someone have some ideas to test...
The card is still affected by issue when an effect is applied during the considering for cast timing..as like Teferi, Mage of Zhalfir..if i try to cast Lumithread Field, i cannot do it.
Unfortunately there isn't any trigger between Considered For Cast and Spell Played, so we have difficulties to modify the values before the Casting process is started.
I tried different ways, as like to face down the card with an activated abilities the cast it, but in this case we will other kind of problems, as like the fact that the facedown card has no cost, so it can be played for free (simple to workaround), other problems with spell who increase or decrease the cost, to be quick i can only says i have tried everything but when we found a workaround to fix a problem we make other problems to fix! It seems there isn't a full working solution...if someone have some ideas to test...
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Morph tests
by gorem2k » 12 Sep 2014, 19:48
hmmm, maybe create a Teferi, Mage of Zhalfir card that will grant flash ability to creatures AND these 3 non-creatures morph cards? I don't think it's possible to have an Enchantment in hand that counts as a Creature without having an actual Creature type on it.
Well, it's a bit tricky because the flash will allow to cast the Enchantment. I don't know then..
I think there's an option like ignore_timing or something like that we could set inside morph non-creature cards.
<AVAILABILITY ignore_timing="1">
check if there's a Teferi in play under your control.
if so, then return.
</AVAILABILITY>
NOTE: I'm really not sure about this ^^ just a noob idea
Oops, just realized that tag is only useable in UTILITY_ABILITY
Well, it's a bit tricky because the flash will allow to cast the Enchantment. I don't know then..
I think there's an option like ignore_timing or something like that we could set inside morph non-creature cards.
<AVAILABILITY ignore_timing="1">
check if there's a Teferi in play under your control.
if so, then return.
</AVAILABILITY>
NOTE: I'm really not sure about this ^^ just a noob idea
Oops, just realized that tag is only useable in UTILITY_ABILITY
Re: Morph tests
by NeoAnderson » 12 Sep 2014, 20:09
Tha real problem is that what we do in the prerequisite block of the alternative cost is what the game will consider when we cast the spell also if we cast it as normal cast.gorem2k wrote:hmmm, maybe create a Teferi, Mage of Zhalfir card that will grant flash ability to creatures AND these 3 non-creatures morph cards? I don't think it's possible to have an Enchantment in hand that counts as a Creature without having an actual Creature type on it.
Well, it's a bit tricky because the flash will allow to cast the Enchantment. I don't know then..
I think there's an option like ignore_timing or something like that we could set inside morph non-creature cards.
<AVAILABILITY ignore_timing="1">
check if there's a Teferi in play under your control.
if so, then return.
</AVAILABILITY>
NOTE: I'm really not sure about this ^^ just a noob idea
Oops, just realized that tag is only useable in UTILITY_ABILITY
When i used this trick with Bestow was ok because bestow card are always cast as Enchantment Creature.
Morph has a particular timing, it start in hand so when the spell is cast it is already morphed.
Now the situation is different we could have problems with cards who grant protection, reduce costs, or grant abilities to a certain type or subtype.
We have to choose a solution, or we keep problems with these cards or we can revert to a morph as activated ability with static cost, always 3., and we should keep the alternative cost in this way we could cast the card with morph when other spell grant the ability to play cards from other zone.
The problem is that we have to duplicate an activated ability for each zone, because active_zone ANY make the ability not useable.
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Morph tests
by braquio » 12 Sep 2014, 22:59
This is something similar as overload, isn't it? with same limitations when is casting from other zones of courseWe have to choose a solution, or we keep problems with these cards or we can revert to a morph as activated ability with static cost, always 3., and we should keep the alternative cost in this way we could cast the card with morph when other spell grant the ability to play cards from other zone.
The problem is that we have to duplicate an activated ability for each zone, because active_zone ANY make the ability not useable.
Why don't use a ResourceCost? and CastSpellUsingResourceCost instead an alternate ability with a fixed cost of 3? this make doable reduced cost abilities and of course Teferis isn't a problem with this(exactly the same as overload)
Yea i know that then playing morphed from other zones is an issue, but i think is better. Or i'm forgetting another interactions?
____________________________________________________________________________________________________________________________
Braquio Dotp2014 DLC
Alternative Sealed Campaigns for DotP 2014
Braquio Dotp2014 DLC
Alternative Sealed Campaigns for DotP 2014
Re: Morph tests
by braquio » 12 Sep 2014, 23:14
Or we can live with this interaction, are only a few cards. Teferi + 3 morph spells.
And dont crash game, only you cant use morphed like flash in that 3 cards. I think is not very serious.
EDIT i forget the interaction Grid Monitor + these 3 morphed cards. But anyway 2+3 cards itneractions is tolerable
And dont crash game, only you cant use morphed like flash in that 3 cards. I think is not very serious.
EDIT i forget the interaction Grid Monitor + these 3 morphed cards. But anyway 2+3 cards itneractions is tolerable
____________________________________________________________________________________________________________________________
Braquio Dotp2014 DLC
Alternative Sealed Campaigns for DotP 2014
Braquio Dotp2014 DLC
Alternative Sealed Campaigns for DotP 2014
Re: Morph tests
by braquio » 12 Sep 2014, 23:30
I have an idea, you tested something like this in Lumithread Field?:
- Code: Select all
<UTILITY_ABILITY qualifier="Alternate" active_zone="ZONE_HAND" >
<ABILITY_TEXT tag="MODE_CAST_MORPH_FACE_DOWN_PAY_3" />
<COST mana_cost="{3}" type="Mana" />
<COST type="Generic">
<PREREQUISITE>
local characteristics = Object():GetCurrentCharacteristics()
local card_type = characteristics:CardType_GetWritable()
card_type:Add( CARD_TYPE_CREATURE )
local sub_type = characteristics:SubType_GetWritable()
sub_type:ClearAllOfType( CARD_TYPE_CREATURE )
Object():GetCurrentCharacteristics():Colour_Get():Clear()
if EffectController():CanCastSpellForFree(Object())
card_type:Clear()
card_type:Add (CARD_TYPE_ENCHANTMENT)
return true
else
card_type:Clear()
card_type:Add (CARD_TYPE_ENCHANTMENT)
return false
end
</PREREQUISITE>
...
____________________________________________________________________________________________________________________________
Braquio Dotp2014 DLC
Alternative Sealed Campaigns for DotP 2014
Braquio Dotp2014 DLC
Alternative Sealed Campaigns for DotP 2014
Re: Morph tests
by NeoAnderson » 13 Sep 2014, 00:11
I understand what you say because i already tried before but timing is too quick and the game doesn't update the card status when considering it for casting, so... anyway your code is wrong should be something like.braquio wrote:I have an idea, you tested something like this in Lumithread Field?:i think the key could be in convert it in a creature before the check CanCastSpellForFree, then return to its normal type
- Code: Select all
<UTILITY_ABILITY qualifier="Alternate" active_zone="ZONE_HAND" >
<ABILITY_TEXT tag="MODE_CAST_MORPH_FACE_DOWN_PAY_3" />
<COST mana_cost="{3}" type="Mana" />
<COST type="Generic">
<PREREQUISITE>
local characteristics = Object():GetCurrentCharacteristics()
local card_type = characteristics:CardType_GetWritable()
card_type:Add( CARD_TYPE_CREATURE )
local sub_type = characteristics:SubType_GetWritable()
sub_type:ClearAllOfType( CARD_TYPE_CREATURE )
Object():GetCurrentCharacteristics():Colour_Get():Clear()
if EffectController():CanCastSpellForFree(Object())
card_type:Clear()
card_type:Add (CARD_TYPE_ENCHANTMENT)
return true
else
card_type:Clear()
card_type:Add (CARD_TYPE_ENCHANTMENT)
return false
end
</PREREQUISITE>
...
- Code: Select all
<UTILITY_ABILITY qualifier="Alternate" active_zone="ZONE_HAND" >
<ABILITY_TEXT tag="MODE_CAST_MORPH_FACE_DOWN_PAY_3" />
<COST mana_cost="{3}" type="Mana" />
<COST type="Generic">
<PREREQUISITE>
local characteristics = Object():GetCurrentCharacteristics()
local card_type = characteristics:CardType_GetWritable()
local sub_type = characteristics:SubType_GetWritable()
sub_type:ClearAllOfType( CARD_TYPE_ENCHANTMENT )
card_type:Clear()
card_type:Add( CARD_TYPE_CREATURE )
Object():GetCurrentCharacteristics():Colour_Get():Clear()
if EffectController():CanCastSpellForFree(Object()) then
card_type:Clear()
card_type:Add (CARD_TYPE_ENCHANTMENT)
Object():GetCurrentCharacteristics():Colour_Add(COLOUR_WHITE)
return true
else
card_type:Clear()
card_type:Add (CARD_TYPE_ENCHANTMENT)
Object():GetCurrentCharacteristics():Colour_Add(COLOUR_WHITE)
return false
end
</PREREQUISITE>
...
Last edited by NeoAnderson on 13 Sep 2014, 00:57, edited 1 time in total.
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Morph tests
by NeoAnderson » 13 Sep 2014, 00:20
I already tried CastSpellUsingResourceCost but the problem is that any resource cost is reduced or increase considering one effect, so if we leave it as white enchantment also when we cast it as morph colourless card the cost is reduced.braquio wrote:This is something similar as overload, isn't it? with same limitations when is casting from other zones of courseWe have to choose a solution, or we keep problems with these cards or we can revert to a morph as activated ability with static cost, always 3., and we should keep the alternative cost in this way we could cast the card with morph when other spell grant the ability to play cards from other zone.
The problem is that we have to duplicate an activated ability for each zone, because active_zone ANY make the ability not useable..
Why don't use a ResourceCost? and CastSpellUsingResourceCost instead an alternate ability with a fixed cost of 3? this make doable reduced cost abilities and of course Teferis isn't a problem with this(exactly the same as overload)
Yea i know that then playing morphed from other zones is an issue, but i think is better. Or i'm forgetting another interactions?
If we change the card into colourless creature, the cost reduction or increase have also effect on normal cast as white enchantment.
I also tried to add a resource cost into token card (thinking that when we morph into token before cast, if we pay a resource cost included into the copied card, it should refer to that card values) but it doesn'r work..
The worst thing is we are not able to access to realtime ManaCost and Effect while the cards are checked (considering for cast), so everything happend during that timing cannot be manipulated.
I am thinking to follow the static morph cost, also because is a payment of 3 mana, and cards that have conflict with this effect are surely less than other cards that can interact with the kind, and colours.
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Who is online
Users browsing this forum: No registered users and 9 guests