Master Necro wrote:MC Brodie wrote:It looks like you are telling the card to tap before its actually on the battlefield. I think there is an official function for enters the battlefield tapped. Look at the official code for Diregraft Ghoul. You could copy most of that.
Yeah it's the same except for the additional trigger that is required because
Diregraf Ghoul is a creature that comes to the battlefield tapped and so he has:
- Code: Select all
<TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" pre_trigger="1" />
<RESOLUTION_TIME_ACTION>
if TriggerObject() ~= nil then
TriggerObject():Tap()
end
</RESOLUTION_TIME_ACTION>
But Blind obedience is an enchantment that makes the creatures and artefacts come to the battlefield tapped so it need an aditional:
- Code: Select all
<TRIGGER value="ZONECHANGE_TRANSITION" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" pre_trigger="1">
local tobj = TriggerObject()
return tobj ~= nil and tobj:GetCardType():Test(CARD_TYPE_CREATURE) and tobj:GetPlayer():GetTeam() ~= EffectController():GetTeam()
return tobj ~= nil and tobj:GetCardType():Test(CARD_TYPE_ARTIFACT) and tobj:GetPlayer():GetTeam() ~= EffectController():GetTeam()
</TRIGGER>
<RESOLUTION_TIME_ACTION>
if TriggerObject() ~= nil then
TriggerObject():Tap()
end
</RESOLUTION_TIME_ACTION>
Problem is it doesn't recognise the trigger and creatures and artefacts don't come to the battlefield tapped.
If it was an artifact, it would never return true. The first line with return would exit the code with either true or false and it would never reach the other one. Where the first trigger has
- Code: Select all
tobj:GetCardType():Test(CARD_TYPE_CREATURE)
it should use
- Code: Select all
( tobj:GetCardType():Test(CARD_TYPE_CREATURE) or tobj:GetCardType():Test(CARD_TYPE_ARTIFACT) )
Each thing inside the parentheses separated by or's should be evaluated, then if any of them are true, then that whole parenthesis section returns true.
As for why the creatures aren't entering the battlefield tapped, I'm not sure, but here's the working code I made for
Imposing Sovereign - Code: Select all
<TRIGGERED_ABILITY replacement_effect="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Creatures your opponents control enter the battlefield tapped.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_TRANSITION" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" pre_trigger="1">
return TriggerObject():GetCardType():Test( CARD_TYPE_CREATURE ) and TriggerObject():GetPlayer():GetTeam() ~= EffectSource():GetPlayer():GetTeam()
</TRIGGER>
<RESOLUTION_TIME_ACTION>
if TriggerObject() ~= nil then
TriggerObject():Tap()
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
So, simply adding the "or artifact" bit should make it work for yours. Try this:
- Code: Select all
<TRIGGERED_ABILITY replacement_effect="1">
<LOCALISED_TEXT...LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_TRANSITION" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" pre_trigger="1">
return ( TriggerObject():GetCardType():Test( CARD_TYPE_CREATURE ) or TriggerObject():GetCardType():Test( CARD_TYPE_ARTIFACT ) ) and TriggerObject():GetPlayer():GetTeam() ~= EffectSource():GetPlayer():GetTeam()
</TRIGGER>
<RESOLUTION_TIME_ACTION>
if TriggerObject() ~= nil then
TriggerObject():Tap()
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
The localized text needs replaced.