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
Formal Request Thread
Moderator: CCGHQ Admins
-
Scion of Darkness - Posts: 235
- Joined: 27 Aug 2012, 13:14
- Has thanked: 17 times
- Been thanked: 23 times
Re: Formal Request Thread
by Master Necro » 04 Jul 2013, 08:45
Thanks I've put it it the top post in case anyone else needs that.kevlahnota wrote:By giving them CHARACTERISTIC_MUST_ATTACK_EACH_TURN attribute:
- Code: Select all
<STATIC_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Goblin creatures attacks each turn if able.]]></LOCALISED_TEXT>
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_SUBTYPE, OP_IS, CREATURE_TYPE_GOBLIN )
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
</FILTER>
<CONTINUOUS_ACTION layer="8" filter_id="0">
if FilteredCard() ~= nil then
local characteristics = FilteredCard():GetCurrentCharacteristics()
characteristics:Bool_Set( CHARACTERISTIC_MUST_ATTACK_EACH_TURN, 1 )
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>Master Necro wrote:Quick question, how do I code "Goblin creatures attack each turn if able." on an Enchantment card?
-
Master Necro - Posts: 259
- Joined: 24 Apr 2013, 18:25
- Has thanked: 83 times
- Been thanked: 21 times
Dredge
by sumomole » 04 Jul 2013, 09:44
Dredge N (If you would draw a card, instead you may put exactly N cards from the top of your library into your graveyard. If you do, return this card from your graveyard to your hand. Otherwise, draw a card.)
- DREDGE_62.LOL | Open
- Code: Select all
PLAYER_UTILITY_COMPARTMENT_ID_DREDGE = -2627
DredgeCardAndValue = function(object)
local amount = 0
if object:GetCardName() == "GRAVESHELL_SCARAB" then
amount = 1
elseif object:GetCardName() == "DAKMOR_SALVAGE" or object:GetCardName() == "GOLGARI_BROWNSCALE" or object:GetCardName() == "MOLDERVINE_CLOAK" or object:GetCardName() == "NECROPLASM" or object:GetCardName() == "NIGHTMARE_VOID" then
amount = 2
elseif object:GetCardName() == "DARKBLAST" or object:GetCardName() == "GREATER_MOSSDOG" or object:GetCardName() == "LIFE_FROM_THE_LOAM" or object:GetCardName() == "SHAMBLING_SHELL" then
amount = 3
elseif object:GetCardName() == "GOLGARI_THUG" then
amount = 4
elseif object:GetCardName() == "STINKWEED_IMP" then
amount = 5
elseif object:GetCardName() == "GOLGARI_GRAVETROLL" then
amount = 6
end
return amount
end
DredgeAbilityTrigger = function(player)
local serial_obj = 0
local serial_so = 1000
local filter = ClearFilter()
filter:SetZone( ZONE_GRAVEYARD, player )
local total = filter:EvaluateObjects()
if total > 0 then
for i=0,total-1 do
local card = filter:GetNthEvaluatedObject(i)
if card ~= nil and DredgeCardAndValue(card) > 0 then
if card == Object() then
serial_obj = i
elseif serial_so > i then
serial_so = i
end
end
end
end
if serial_so > serial_obj and player:PlayerDataChest():Int_Get( PLAYER_UTILITY_COMPARTMENT_ID_DREDGE ) == 0 then
return true
end
return false
end
DredgeAbilityChoice = function(player)
MTG():ClearFilterMark()
local filter = ClearFilter()
filter:SetZone( ZONE_GRAVEYARD, EffectController() )
local total = filter:EvaluateObjects()
if total > 0 then
for i=0,total-1 do
local card = filter:GetNthEvaluatedObject(i)
if card ~= nil and DredgeCardAndValue(card) > 0 then
card:MarkForFilter()
end
end
end
filter:SetMarkedObjectsOnly()
player:ChooseItem( "CARD_QUERY_CHOOSE_A_CARD_TO_RETURN_TO_YOUR_HAND", EffectDC():Make_Targets(0), QUERY_FLAG_MAY )
end
DredgeAbilityResolve = function(player)
local target = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local dredge_value = DredgeCardAndValue(target)
target:PutInHand()
player:MillCards( dredge_value )
else
player:PlayerDataChest():Int_Set( PLAYER_UTILITY_COMPARTMENT_ID_DREDGE, 1 )
end
end
DredgeAbilityDraw = function(player)
if player:PlayerDataChest():Int_Get( PLAYER_UTILITY_COMPARTMENT_ID_DREDGE ) == 1 then
player:DrawCard()
player:PlayerDataChest():Int_Set( PLAYER_UTILITY_COMPARTMENT_ID_DREDGE, 0 )
end
end
- Dredge N | Open
- Code: Select all
<TRIGGERED_ABILITY replacement_query="1" active_zone="ZONE_GRAVEYARD">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Dredge N]]></LOCALISED_TEXT>
<TRIGGER value="DREW_CARD" simple_qualifier="controller" pre_trigger="1">
if DredgeAbilityTrigger(EffectController()) then
MTG():OverrideEvent()
return true
end
return false
</TRIGGER>
<RESOLUTION_TIME_ACTION>
DredgeAbilityChoice(EffectController())
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
DredgeAbilityResolve(EffectController())
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
DredgeAbilityDraw(EffectController())
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
- Retrace | Open
- Code: Select all
<UTILITY_ABILITY qualifier="Retrace" active_zone="ZONE_GRAVEYARD">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Retrace]]></LOCALISED_TEXT>
<COST type="Discard" definition="0" compartment="2" query_tag="CARD_QUERY_CHOOSE_A_LAND_TO_DISCARD" item_count="1" />
<COST_DEFINITION id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
</COST_DEFINITION>
</UTILITY_ABILITY>
- Shelldock Isle | Open
- Code: Select all
<TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_TRANSITION">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Hideaway]]></LOCALISED_TEXT>
<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>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY linked_ability_group="1">
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<RESOLUTION_TIME_ACTION>
local i = 0
local queryDC = EffectDC():Make_Chest(1)
for i = 0,(3) do
local card = EffectController():Library_GetNth( i )
if card ~= nil then
queryDC:Set_CardPtr(i, card)
end
end
EffectController():ChooseItemFromDC( "CARD_QUERY_CHOOSE_CARD_TO_EXILE_FACE_DOWN", queryDC, EffectDC():Make_Targets(0) )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
local source = EffectSource()
if target ~= nil then
if source ~= nil then
LinkedDC():Set_CardPtr(0, target)
LinkedDC():Protect_CardPtr(0)
end
target:ExileFaceDown()
end
for i = 0,(3) do
local card = EffectDC():Get_Chest(1):Get_CardPtr(i)
if card ~= nil then
card:PutOnBottomOfLibrary()
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = LinkedDC():Get_CardPtr(0)
local source = EffectSource()
if target ~= nil and source ~= nil then
target:NailOnto(source)
end
</RESOLUTION_TIME_ACTION>
<CONTINUOUS_ACTION layer="8">
local target = LinkedDC():Get_CardPtr(0)
local source = EffectSource()
if target ~= nil and source ~= nil then
local characteristics = target:GetCurrentCharacteristics()
characteristics:CanLookAtWhileFaceDown( source:GetPlayer() )
end
</CONTINUOUS_ACTION>
<DURATION>
return (LinkedDC():Get_CardPtr(0) == nil or EffectSource() == nil)
</DURATION>
<AUTO_SKIP no_effect_source="1" />
</TRIGGERED_ABILITY>
<ACTIVATED_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{U}, {T}: You may play the exiled card without paying its mana cost if a library has twenty or fewer cards in it.]]></LOCALISED_TEXT>
<COST mana_cost="{U}" type="Mana" />
<COST type="TapSelf" />
<AVAILABILITY>
return EffectController():CanPayManaCost("{U}{U}")
</AVAILABILITY>
<RESOLUTION_TIME_ACTION>
local spellToCast = LinkedDC():Get_CardPtr(0)
if spellToCast ~= nil and EffectController():CanCastSpellForFree( spellToCast ) then
local num_Players = MTG():GetNumberOfPlayers()
for i = 0, (num_Players-1) do
local player = MTG():GetNthPlayer(i)
if player ~= nil and player:Library_Count() < 21 then
EffectController():CastSpellForFree(spellToCast)
break
end
end
end
</RESOLUTION_TIME_ACTION>
<MAY />
</ACTIVATED_ABILITY>
Last edited by sumomole on 04 Jul 2013, 10:00, edited 1 time in total.
-
sumomole - Programmer
- Posts: 611
- Joined: 07 Jun 2011, 08:34
- Has thanked: 51 times
- Been thanked: 234 times
Re: Formal Request Thread
by thefiremind » 04 Jul 2013, 09:51
Retrace might be natively supported by DotP2014: when I looked into the executable there was not only Replicate, but also Retrace. Could you make some tests with qualifier="Retrace" and nothing else inside the ability (except for the text of course)?
In the meanwhile, I updated my DotP2013 madness and here's the result:
In case someone wonders why I repeated the localised text twice, it's because the first one will be displayed on the card, while the second will be displayed below the query when asking whether to cast or not.
In the meanwhile, I updated my DotP2013 madness and here's the result:
- Code: Select all
<TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_HAND">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Madness {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Folie {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Demencia {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Wahnsinn {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Follia {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[マッドネス {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Madness {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Бешенство {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Loucura {B}]]></LOCALISED_TEXT>
<TRIGGER value="DISCARD" simple_qualifier="self" pre_trigger="1">
if EffectController():CanCastSpellUsingResourceCost( TriggerObject(), 0 ) then
local delayDC = EffectDC():Make_Chest(1)
delayDC:Set_CardPtr( 0, TriggerObject() )
MTG():CreateDelayedTrigger(1, delayDC)
end
return false
</TRIGGER>
</TRIGGERED_ABILITY>
<UTILITY_ABILITY resource_id="0">
<COST mana_cost="{B}" type="Mana" />
</UTILITY_ABILITY>
<TRIGGERED_ABILITY replacement_effect="1" resource_id="1">
<CLEANUP fire_once="1" />
<TRIGGER value="ZONECHANGE_CONSIDERED" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_HAND" pre_trigger="1">
if TriggerObject() == EffectDC():Get_CardPtr(0) then
MTG():OverrideEvent()
local delayDC = EffectDC():Make_Chest(1)
delayDC:Set_CardPtr( 0, TriggerObject() )
delayDC:Protect_CardPtr(0)
MTG():CreateDelayedTrigger(2, delayDC)
TriggerObject():Exile()
return true
end
return false
</TRIGGER>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY qualifier="Alternate" active_zone="ZONE_EXILE" resource_id="2">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Madness {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Folie {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Demencia {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Wahnsinn {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Follia {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[マッドネス {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Madness {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Бешенство {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Loucura {B}]]></LOCALISED_TEXT>
<CLEANUP fire_once="1" />
<TRIGGER value="ZONECHANGE_END" to_zone="ZONE_EXILE" from_zone="ZONE_HAND">
return TriggerObject() == EffectDC():Get_CardPtr(0)
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local controller = EffectController()
if controller ~= nil and TriggerObject() ~= nil then
controller:BeginNewMultipleChoice()
controller:AddMultipleChoiceAnswer( "UI_CONDITIONAL_QUESTION_YES", controller:CanCastSpellUsingResourceCost( TriggerObject(), 0 ) )
controller:AddMultipleChoiceAnswer("UI_CONDITIONAL_QUESTION_NO")
controller:AskMultipleChoiceQuestion( "OPTIONAL_ABILITY_QUESTION", TriggerObject() )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local controller = EffectController()
if controller ~= nil and TriggerObject() ~= nil then
if controller:GetMultipleChoiceResult() == 0 then
controller:CastSpellUsingResourceCost( TriggerObject(), 0 )
else
TriggerObject():PutInGraveyard()
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
In case someone wonders why I repeated the localised text twice, it's because the first one will be displayed on the card, while the second will be displayed below the query when asking whether to cast or not.
< 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: 721 times
Re: Formal Request Thread
by sumomole » 04 Jul 2013, 09:59
EDIT1: Forecast isn't a simple ability, it has different effects on different cards, and its cost({X}, Reveal from hand) is very easy for everyone.
And I changed "Normal_Cast" to "Retrace", maybe it looks easier to understand.
There's nothing different, we still need to code additional cost to discard a land card.thefiremind wrote:Retrace might be natively supported by DotP2014: when I looked into the executable there was not only Replicate, but also Retrace. Could you make some tests with qualifier="Retrace" and nothing else inside the ability (except for the text of course)?
And I changed "Normal_Cast" to "Retrace", maybe it looks easier to understand.
-
sumomole - Programmer
- Posts: 611
- Joined: 07 Jun 2011, 08:34
- Has thanked: 51 times
- Been thanked: 234 times
Re: Dredge
by Master Necro » 04 Jul 2013, 10:25
sumomole wrote:Dredge N (If you would draw a card, instead you may put exactly N cards from the top of your library into your graveyard. If you do, return this card from your graveyard to your hand. Otherwise, draw a card.)
- DREDGE_62.LOL | Open
- Code: Select all
PLAYER_UTILITY_COMPARTMENT_ID_DREDGE = -2627
DredgeCardAndValue = function(object)
local amount = 0
if object:GetCardName() == "GRAVESHELL_SCARAB" then
amount = 1
elseif object:GetCardName() == "DAKMOR_SALVAGE" or object:GetCardName() == "GOLGARI_BROWNSCALE" or object:GetCardName() == "MOLDERVINE_CLOAK" or object:GetCardName() == "NECROPLASM" or object:GetCardName() == "NIGHTMARE_VOID" then
amount = 2
elseif object:GetCardName() == "DARKBLAST" or object:GetCardName() == "GREATER_MOSSDOG" or object:GetCardName() == "LIFE_FROM_THE_LOAM" or object:GetCardName() == "SHAMBLING_SHELL" then
amount = 3
elseif object:GetCardName() == "GOLGARI_THUG" then
amount = 4
elseif object:GetCardName() == "STINKWEED_IMP" then
amount = 5
elseif object:GetCardName() == "GOLGARI_GRAVETROLL" then
amount = 6
end
return amount
end
DredgeAbilityTrigger = function(player)
local serial_obj = 0
local serial_so = 1000
local filter = ClearFilter()
filter:SetZone( ZONE_GRAVEYARD, player )
local total = filter:EvaluateObjects()
if total > 0 then
for i=0,total-1 do
local card = filter:GetNthEvaluatedObject(i)
if card ~= nil and DredgeCardAndValue(card) > 0 then
if card == Object() then
serial_obj = i
elseif serial_so > i then
serial_so = i
end
end
end
end
if serial_so > serial_obj and player:PlayerDataChest():Int_Get( PLAYER_UTILITY_COMPARTMENT_ID_DREDGE ) == 0 then
return true
end
return false
end
DredgeAbilityChoice = function(player)
MTG():ClearFilterMark()
local filter = ClearFilter()
filter:SetZone( ZONE_GRAVEYARD, EffectController() )
local total = filter:EvaluateObjects()
if total > 0 then
for i=0,total-1 do
local card = filter:GetNthEvaluatedObject(i)
if card ~= nil and DredgeCardAndValue(card) > 0 then
card:MarkForFilter()
end
end
end
filter:SetMarkedObjectsOnly()
player:ChooseItem( "CARD_QUERY_CHOOSE_A_CARD_TO_RETURN_TO_YOUR_HAND", EffectDC():Make_Targets(0), QUERY_FLAG_MAY )
end
DredgeAbilityResolve = function(player)
local target = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local dredge_value = DredgeCardAndValue(target)
target:PutInHand()
player:MillCards( dredge_value )
else
player:PlayerDataChest():Int_Set( PLAYER_UTILITY_COMPARTMENT_ID_DREDGE, 1 )
end
end
DredgeAbilityDraw = function(player)
if player:PlayerDataChest():Int_Get( PLAYER_UTILITY_COMPARTMENT_ID_DREDGE ) == 1 then
player:DrawCard()
player:PlayerDataChest():Int_Set( PLAYER_UTILITY_COMPARTMENT_ID_DREDGE, 0 )
end
endRetrace (You may cast this card from your graveyard by discarding a land card in addition to paying its other costs.)
- Dredge N | Open
- Code: Select all
<TRIGGERED_ABILITY replacement_query="1" active_zone="ZONE_GRAVEYARD">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Dredge N]]></LOCALISED_TEXT>
<TRIGGER value="DREW_CARD" simple_qualifier="controller" pre_trigger="1">
if DredgeAbilityTrigger(EffectController()) then
MTG():OverrideEvent()
return true
end
return false
</TRIGGER>
<RESOLUTION_TIME_ACTION>
DredgeAbilityChoice(EffectController())
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
DredgeAbilityResolve(EffectController())
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
DredgeAbilityDraw(EffectController())
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>Hideaway (This land enters the battlefield tapped. When it does, look at the top four cards of your library, exile one face down, then put the rest on the bottom of your library.)
- Retrace | Open
- Code: Select all
<UTILITY_ABILITY qualifier="Retrace" active_zone="ZONE_GRAVEYARD">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Retrace]]></LOCALISED_TEXT>
<COST type="Discard" definition="0" compartment="2" query_tag="CARD_QUERY_CHOOSE_A_LAND_TO_DISCARD" item_count="1" />
<COST_DEFINITION id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
</COST_DEFINITION>
</UTILITY_ABILITY>
- Shelldock Isle | Open
- Code: Select all
<TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_TRANSITION">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Hideaway]]></LOCALISED_TEXT>
<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>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY linked_ability_group="1">
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<RESOLUTION_TIME_ACTION>
local i = 0
local queryDC = EffectDC():Make_Chest(1)
for i = 0,(3) do
local card = EffectController():Library_GetNth( i )
if card ~= nil then
queryDC:Set_CardPtr(i, card)
end
end
EffectController():ChooseItemFromDC( "CARD_QUERY_CHOOSE_CARD_TO_EXILE_FACE_DOWN", queryDC, EffectDC():Make_Targets(0) )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
local source = EffectSource()
if target ~= nil then
if source ~= nil then
LinkedDC():Set_CardPtr(0, target)
LinkedDC():Protect_CardPtr(0)
end
target:ExileFaceDown()
end
for i = 0,(3) do
local card = EffectDC():Get_Chest(1):Get_CardPtr(i)
if card ~= nil then
card:PutOnBottomOfLibrary()
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = LinkedDC():Get_CardPtr(0)
local source = EffectSource()
if target ~= nil and source ~= nil then
target:NailOnto(source)
end
</RESOLUTION_TIME_ACTION>
<CONTINUOUS_ACTION layer="8">
local target = LinkedDC():Get_CardPtr(0)
local source = EffectSource()
if target ~= nil and source ~= nil then
local characteristics = target:GetCurrentCharacteristics()
characteristics:CanLookAtWhileFaceDown( source:GetPlayer() )
end
</CONTINUOUS_ACTION>
<DURATION>
return (LinkedDC():Get_CardPtr(0) == nil or EffectSource() == nil)
</DURATION>
<AUTO_SKIP no_effect_source="1" />
</TRIGGERED_ABILITY>
<ACTIVATED_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{U}, {T}: You may play the exiled card without paying its mana cost if a library has twenty or fewer cards in it.]]></LOCALISED_TEXT>
<COST mana_cost="{U}" type="Mana" />
<COST type="TapSelf" />
<AVAILABILITY>
return EffectController():CanPayManaCost("{U}{U}")
</AVAILABILITY>
<RESOLUTION_TIME_ACTION>
local spellToCast = LinkedDC():Get_CardPtr(0)
if spellToCast ~= nil and EffectController():CanCastSpellForFree( spellToCast ) then
local num_Players = MTG():GetNumberOfPlayers()
for i = 0, (num_Players-1) do
local player = MTG():GetNthPlayer(i)
if player ~= nil and player:Library_Count() < 21 then
EffectController():CastSpellForFree(spellToCast)
break
end
end
end
</RESOLUTION_TIME_ACTION>
<MAY />
</ACTIVATED_ABILITY>
Updated the first post.thefiremind wrote:Retrace might be natively supported by DotP2014: when I looked into the executable there was not only Replicate, but also Retrace. Could you make some tests with qualifier="Retrace" and nothing else inside the ability (except for the text of course)?
In the meanwhile, I updated my DotP2013 madness and here's the result:This is for Big Game Hunter, of course you need to change all "B" costs to the appropriate cost for other cards.
- Code: Select all
<TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_HAND">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Madness {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Folie {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Demencia {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Wahnsinn {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Follia {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[マッドネス {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Madness {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Бешенство {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Loucura {B}]]></LOCALISED_TEXT>
<TRIGGER value="DISCARD" simple_qualifier="self" pre_trigger="1">
if EffectController():CanCastSpellUsingResourceCost( TriggerObject(), 0 ) then
local delayDC = EffectDC():Make_Chest(1)
delayDC:Set_CardPtr( 0, TriggerObject() )
MTG():CreateDelayedTrigger(1, delayDC)
end
return false
</TRIGGER>
</TRIGGERED_ABILITY>
<UTILITY_ABILITY resource_id="0">
<COST mana_cost="{B}" type="Mana" />
</UTILITY_ABILITY>
<TRIGGERED_ABILITY replacement_effect="1" resource_id="1">
<CLEANUP fire_once="1" />
<TRIGGER value="ZONECHANGE_CONSIDERED" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_HAND" pre_trigger="1">
if TriggerObject() == EffectDC():Get_CardPtr(0) then
MTG():OverrideEvent()
local delayDC = EffectDC():Make_Chest(1)
delayDC:Set_CardPtr( 0, TriggerObject() )
delayDC:Protect_CardPtr(0)
MTG():CreateDelayedTrigger(2, delayDC)
TriggerObject():Exile()
return true
end
return false
</TRIGGER>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY qualifier="Alternate" active_zone="ZONE_EXILE" resource_id="2">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Madness {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Folie {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Demencia {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Wahnsinn {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Follia {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[マッドネス {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Madness {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Бешенство {B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Loucura {B}]]></LOCALISED_TEXT>
<CLEANUP fire_once="1" />
<TRIGGER value="ZONECHANGE_END" to_zone="ZONE_EXILE" from_zone="ZONE_HAND">
return TriggerObject() == EffectDC():Get_CardPtr(0)
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local controller = EffectController()
if controller ~= nil and TriggerObject() ~= nil then
controller:BeginNewMultipleChoice()
controller:AddMultipleChoiceAnswer( "UI_CONDITIONAL_QUESTION_YES", controller:CanCastSpellUsingResourceCost( TriggerObject(), 0 ) )
controller:AddMultipleChoiceAnswer("UI_CONDITIONAL_QUESTION_NO")
controller:AskMultipleChoiceQuestion( "OPTIONAL_ABILITY_QUESTION", TriggerObject() )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local controller = EffectController()
if controller ~= nil and TriggerObject() ~= nil then
if controller:GetMultipleChoiceResult() == 0 then
controller:CastSpellUsingResourceCost( TriggerObject(), 0 )
else
TriggerObject():PutInGraveyard()
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
In case someone wonders why I repeated the localised text twice, it's because the first one will be displayed on the card, while the second will be displayed below the query when asking whether to cast or not.
-
Master Necro - Posts: 259
- Joined: 24 Apr 2013, 18:25
- Has thanked: 83 times
- Been thanked: 21 times
Re: Formal Request Thread
by sumomole » 04 Jul 2013, 10:42
Untested
Detain a permanent. (Until your next turn, that permanent can't attack or block and its activated abilities can't be activated.)
Detain a permanent. (Until your next turn, that permanent can't attack or block and its activated abilities can't be activated.)
- Lyev Skyknight | Open
- Code: Select all
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[When Lyev Skyknight enters the battlefield, detain target nonland permanent an opponent controls.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<TARGET tag="CARD_QUERY_CHOOSE_PERMANENT_TO_DETAIN" definition="0" compartment="0" count="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:Add( FE_IS_PERMANENT, true )
filter:Add( FE_TYPE, OP_NOT, CARD_TYPE_LAND )
filter:Add( FE_TEAM, OP_NOT, EffectController():GetTeam() )
</TARGET_DEFINITION>
<CONTINUOUS_ACTION layer="8">
local detainCard = EffectDC():Get_Targets(0):Get_CardPtr(0)
if detainCard ~= nil then
local characteristics = detainCard:GetCurrentCharacteristics()
characteristics:Bool_Set( CHARACTERISTIC_CANT_ATTACK, 1 )
characteristics:Bool_Set( CHARACTERISTIC_CANT_BLOCK, 1 )
characteristics:Bool_Set( CHARACTERISTIC_CANT_USE_ACTIVATED_ABILITIES, 1 )
end
</CONTINUOUS_ACTION>
<DURATION>
return (EffectController():MyTurn() ~= 0 and MTG():GetStep() == STEP_UNTAP) or EffectController() == nil
</DURATION>
<AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
</TRIGGERED_ABILITY>
- Brightflame | Open
- Code: Select all
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[|Radiance| — Brightflame deals X damage to target creature and each other creature that shares a color with it. You gain life equal to the damage dealt this way.]]></LOCALISED_TEXT>
<SFX text="GLOBAL_MAGMA_PLAY" />
<TARGET tag="CARD_QUERY_CHOOSE_CREATURE_DEAL_X_DAMAGE_RADIANCE" definition="0" compartment="0" count="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_LUA_CONDITION, 1, EffectController(), EffectDC())
</FILTER>
<FILTER_CONDITION id="1">
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if FilteredCard() ~= nil and target ~= nil and FilteredCard():GetColour():TestAny(target:GetColour()) then
return true
else
return false
end
</FILTER_CONDITION>
<RESOLUTION_TIME_ACTION filter_id="0">
if FilteredCard() ~= nil then
EffectSourceLKI():DealDamageTo( GetEffectX(), FilteredCard() )
end
local damage_dealt = EffectSourceLKI():GetLastDamageAmountDealt()
EffectController():GainLife(damage_dealt)
</RESOLUTION_TIME_ACTION>
<AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
</SPELL_ABILITY>
Last edited by sumomole on 04 Jul 2013, 11:22, edited 1 time in total.
-
sumomole - Programmer
- Posts: 611
- Joined: 07 Jun 2011, 08:34
- Has thanked: 51 times
- Been thanked: 234 times
Re: Formal Request Thread
by thefiremind » 04 Jul 2013, 11:20
Since now we can skip steps (even if I haven't tried yet, and I'm not sure how to skip the untap since there's no previous step in the same turn where we can call SkipStep ), I'd code "Until your next turn" differently: inside the ability you save the turn number:
- Code: Select all
EffectDC():Set_Int( 1, MTG():GetTurnNumber() )
- Code: Select all
return EffectController():MyTurn() and MTG():GetTurnNumber() > EffectDC():Get_Int(1)
< 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: 721 times
Re: Formal Request Thread
by sumomole » 04 Jul 2013, 11:26
I have tried SkipStep, but I failed, SkipStep(STEP_UNTAP) and SkipStep(STEP_UNTAP, player) are wrong, I don't know what is the correct format.thefiremind wrote:Since now we can skip steps (even if I haven't tried yet, and I'm not sure how to skip the untap since there's no previous step in the same turn where we can call SkipStep ), I'd code "Until your next turn" differently: inside the ability you save the turn number
-
sumomole - Programmer
- Posts: 611
- Joined: 07 Jun 2011, 08:34
- Has thanked: 51 times
- Been thanked: 234 times
Re: Formal Request Thread
by NEMESiS » 04 Jul 2013, 13:28
For those of you that code cards with Detain can you please add reminder text to the cards being Detained? It would be very helpful to tell what is being Detained, I know I had thefiremind help me add it to my cards by adding:
- Code: Select all
characteristics:GrantAbility(9)
- Code: Select all
<STATIC_ABILITY resource_id="9">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Detained]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Detained]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Detained]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Detained]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Detained]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Detained]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Detained]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Detained]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Detained]]></LOCALISED_TEXT>
</STATIC_ABILITY>
-
NEMESiS - Posts: 460
- Joined: 03 Jan 2013, 04:02
- Location: Pools of Becoming
- Has thanked: 70 times
- Been thanked: 21 times
Re: Formal Request Thread
by damienx45 » 04 Jul 2013, 14:46
hey firemind does dotp 2014 have support for level up cards this time around or are level ups still out of reach for the game?
Re: Formal Request Thread
by thefiremind » 04 Jul 2013, 14:56
I successfully made level up cards both on DotP2012 and DotP2013, and I can make them on DotP2014 too... we can't have the level up frame, but the functionality has always been relatively easy to achieve.damienx45 wrote:hey firemind does dotp 2014 have support for level up cards this time around or are level ups still out of reach for the game?
< 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: 721 times
Re: Formal Request Thread
by damienx45 » 04 Jul 2013, 15:10
cool i wanted to know so i could try to code nirkana cutthroat.
Re: Formal Request Thread
by thefiremind » 04 Jul 2013, 15:15
I tried to code Eon Hub like this:sumomole wrote:I have tried SkipStep, but I failed, SkipStep(STEP_UNTAP) and SkipStep(STEP_UNTAP, player) are wrong, I don't know what is the correct format.
- Code: Select all
<TRIGGERED_ABILITY replacement_effect="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Players skip their upkeep steps.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Les joueurs passent leurs étapes d’entretien.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Los jugadores se saltan sus pasos de mantenimiento.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Spieler übergehen ihre Versorgungssegmente.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[I giocatori saltano il loro mantenimento.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[プレイヤーはアップキープ・ステップをとばす。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Players skip their upkeep steps.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Players skip their upkeep steps.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Os jogadores pulam suas etapas de manutenção.]]></LOCALISED_TEXT>
<TRIGGER value="BEGINNING_OF_PLAYERS_STEP" pre_trigger="1">
return MTG():GetStep() == STEP_UPKEEP
</TRIGGER>
<RESOLUTION_TIME_ACTION>
MTG():SkipStep()
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
Actually, in my test I was using BEGINNING_OF_STEP, but that probably was making it trigger twice (not that it matters much).
< 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: 721 times
Who is online
Users browsing this forum: No registered users and 41 guests