Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
Frenzied Goblin & Dauntless Onslaught
Moderator: CCGHQ Admins
Frenzied Goblin & Dauntless Onslaught
by Chakan » 25 Aug 2014, 23:08
I'm back again with more problems, shocker I know. The first card I'm having problems with is Frenzied Goblin. That cards ability is if you attack, you can spend 1 red mana to make a creature not be able to block for the turn. I've got it to a point where you can make a creature unable to block, but it doesn't cost anything and it doesn't prompt you if you want to do it, it should be a may ability. Here's what I have for that.
- Code: Select all
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Frenzied Goblin attacks, you may pay {R}. If you do, target creature can’t block this turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que le Gobelin hystérique attaque, vous pouvez payer {R}. Si vous faites ainsi, la créature ciblée ne peut pas bloquer ce tour-ci.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que el Trasgo frenético ataque, puedes pagar {R}. Si lo haces, la criatura objetivo no puede bloquear este turno.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn der Wildgewordene Goblin angreift, kannst du {R} bezahlen. Falls du dies tust, kann eine Kreatur deiner Wahl in diesem Zug nicht blocken.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta il Goblin Delirante attacca, puoi pagare {R}. Se lo fai, una creatura bersaglio non può bloccare in questo turno.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[激情のゴブリンが攻撃するたび、クリーチャー1体を対象とする。あなたは{R}を支払ってもよい。そうしたなら、このターン、それではブロックできない。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[광란한 고블린이 공격할 때마다, 당신은 {R}를 지불할 수 있다. 그렇게 한다면, 생물을 목표로 정한다. 그 생물은 이 턴에 방어할 수 없다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз, когда Неистовый Гоблин атакует, вы можете заплатить {R}. Если вы это делаете, целевое существо не может блокировать в этом ходу.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que Goblin Ensandecido ataca, você pode pagar {R}. Se fizer isso, a criatura alvo não poderá bloquear neste turno.]]></LOCALISED_TEXT>
<TRIGGER value="ATTACKING" simple_qualifier="self" />
<RESOLUTION_TIME_ACTION>
local player = EffectController()
if player ~= nil then
if player:CanPayResourceCost(1) then
player:BeginNewMultipleChoice()
player:AddMultipleChoiceAnswer( "UI_CONDITIONAL_QUESTION_YES" )
player:AddMultipleChoiceAnswer( "UI_CONDITIONAL_QUESTION_NO" )
player:AskMultipleChoiceQuestion( "OPTIONAL_ABILITY_QUESTION" )
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local player = EffectController()
if player ~= nil then
local result = player:GetMultipleChoiceResult()
if result ~= nil then
if result == 0 then
if player:CanPayResourceCost(1) then
player:PayResourceCost(1)
<TARGET tag="CARD_QUERY_CHOOSE_CREATURE_GAIN_CANT_BLOCK" definition="0" compartment="0" count="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
<CONTINUOUS_ACTION layer="6">
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local characteristics = target:GetCurrentCharacteristics()
characteristics:Bool_Set( CHARACTERISTIC_CANT_BLOCK, 1 )
end
</CONTINUOUS_ACTION>
<DURATION simple_duration="UntilEOT" />
<AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
</TRIGGERED_ABILITY>
<UTILITY_ABILITY resource_id="1">
<COST mana_cost="{R}" type="Mana" />
</UTILITY_ABILITY>
- Code: Select all
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Up to two target creatures each get +2/+2 until end of turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Jusqu’à deux créatures ciblées gagnent chacune +2/+2 jusqu’à la fin du tour.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Hasta dos criaturas objetivo obtienen +2/+2 cada una hasta el final del turno.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Bis zu zwei Kreaturen deiner Wahl erhalten +2/+2 bis zum Ende des Zuges.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Fino a due creature bersaglio prendono +2/+2 fino alla fine del turno.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[クリーチャーを最大2体まで対象とする。それらはターン終了時までそれぞれ+2/+2の修整を受ける。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[생물을 최대 두 개까지 목표로 정한다. 그 생물들은 턴종료까지 각각 +2/+2를 받는다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Не более двух целевых существ получают по +2/+2 до конца хода.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Até duas criaturas alvo recebem +2/+2 cada uma até o final do turno.]]></LOCALISED_TEXT>
<TARGET tag="CARD_QUERY_CHOOSE_CREATURE_TO_GET_2_2" definition="0" compartment="0" count="2" up_to="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
<CONTINUOUS_ACTION layer="7C">
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local characteristics = target:GetCurrentCharacteristics()
characteristics:Power_Add( 2 )
characteristics:Toughness_Add( 2 )
end
</CONTINUOUS_ACTION>
<DURATION simple_duration="UntilEOT" />
<AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ALLIED_ONLY" />
</SPELL_ABILITY>
Re: Frenzied Goblin & Dauntless Onslaught
by sweetLu » 25 Aug 2014, 23:17
For the Frenzied Goblin you are missing some stuff in the 2nd RTA. You'll need to add some "end"s for each if statement and you will have to close out the RTA with </RESOLUTION_TIME_ACTION>.
In Dauntless Onslaught is only giving one creature +2/+2 because you are not doing anything with the 2nd target in the continuous action. You give +2/+2 to the target stored in EffectDC():Get_Targets(0):Get_CardPtr(0). You will need to do the same with the target stored in EffectDC():Get_Targets(0):Get_CardPtr(1).
Try those fixes and let us know if it works. Don't feel bad for asking for help. We all were there at one point in time.
In Dauntless Onslaught is only giving one creature +2/+2 because you are not doing anything with the 2nd target in the continuous action. You give +2/+2 to the target stored in EffectDC():Get_Targets(0):Get_CardPtr(0). You will need to do the same with the target stored in EffectDC():Get_Targets(0):Get_CardPtr(1).
Try those fixes and let us know if it works. Don't feel bad for asking for help. We all were there at one point in time.
Re: Frenzied Goblin & Dauntless Onslaught
by thefiremind » 25 Aug 2014, 23:23
Frenzied Goblin: on the second RESOLUTION_TIME_ACTION, you have lots of "if" but none of them has its "end". This is a syntax error and should be reported on SCRIPT_LOG.TXT (inside the directory where DotP is installed) if you look at it after using the card, I recommend to do that when a card doesn't work because it will often point you in the right direction for spotting the bug.
Dauntless Onslaught: only one gets the buff because you are giving the buff to only one. EffectDC():Get_Targets(0):Get_CardPtr(0) contains the first card, while the second will be in EffectDC():Get_Targets(0):Get_CardPtr(1). The correct way to do this is to loop through the pointers inside the target chest and give the bonus to all of them (in this case you know there are two at most, so you'll just loop from 0 to 1).
Dauntless Onslaught: only one gets the buff because you are giving the buff to only one. EffectDC():Get_Targets(0):Get_CardPtr(0) contains the first card, while the second will be in EffectDC():Get_Targets(0):Get_CardPtr(1). The correct way to do this is to loop through the pointers inside the target chest and give the bonus to all of them (in this case you know there are two at most, so you'll just loop from 0 to 1).
- Code: Select all
<CONTINUOUS_ACTION layer="7C">
local targetDC = EffectDC():Get_Targets(0)
if targetDC ~= nil then
for i=0,1 do
local target = targetDC:Get_CardPtr(i)
if target ~= nil then
local characteristics = target:GetCurrentCharacteristics()
characteristics:Power_Add( 2 )
characteristics:Toughness_Add( 2 )
end
end
end
</CONTINUOUS_ACTION>
< 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: Frenzied Goblin & Dauntless Onslaught
by NeoAnderson » 26 Aug 2014, 00:08
Here you can find an example of implementation for this trigger :Chakan wrote:I'm back again with more problems, shocker I know. The first card I'm having problems with is Frenzied Goblin. That cards ability is if you attack, you can spend 1 red mana to make a creature not be able to block for the turn. I've got it to a point where you can make a creature unable to block, but it doesn't cost anything and it doesn't prompt you if you want to do it, it should be a may ability. Here's what I have for that.
- TRIGGER NOT WORKING | Open
- Code: Select all
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Frenzied Goblin attacks, you may pay {R}. If you do, target creature can’t block this turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que le Gobelin hystérique attaque, vous pouvez payer {R}. Si vous faites ainsi, la créature ciblée ne peut pas bloquer ce tour-ci.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que el Trasgo frenético ataque, puedes pagar {R}. Si lo haces, la criatura objetivo no puede bloquear este turno.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn der Wildgewordene Goblin angreift, kannst du {R} bezahlen. Falls du dies tust, kann eine Kreatur deiner Wahl in diesem Zug nicht blocken.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta il Goblin Delirante attacca, puoi pagare {R}. Se lo fai, una creatura bersaglio non può bloccare in questo turno.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[激情のゴブリンが攻撃するたび、クリーチャー1体を対象とする。あなたは{R}を支払ってもよい。そうしたなら、このターン、それではブロックできない。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[광란한 고블린이 공격할 때마다, 당신은 {R}를 지불할 수 있다. 그렇게 한다면, 생물을 목표로 정한다. 그 생물은 이 턴에 방어할 수 없다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз, когда Неистовый Гоблин атакует, вы можете заплатить {R}. Если вы это делаете, целевое существо не может блокировать в этом ходу.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que Goblin Ensandecido ataca, você pode pagar {R}. Se fizer isso, a criatura alvo não poderá bloquear neste turno.]]></LOCALISED_TEXT>
<TRIGGER value="ATTACKING" simple_qualifier="self" />
<RESOLUTION_TIME_ACTION>
local player = EffectController()
if player ~= nil then
if player:CanPayResourceCost(1) then
player:BeginNewMultipleChoice()
player:AddMultipleChoiceAnswer( "UI_CONDITIONAL_QUESTION_YES" )
player:AddMultipleChoiceAnswer( "UI_CONDITIONAL_QUESTION_NO" )
player:AskMultipleChoiceQuestion( "OPTIONAL_ABILITY_QUESTION" )
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local player = EffectController()
if player ~= nil then
local result = player:GetMultipleChoiceResult()
if result ~= nil then
if result == 0 then
if player:CanPayResourceCost(1) then
player:PayResourceCost(1)
<TARGET tag="CARD_QUERY_CHOOSE_CREATURE_GAIN_CANT_BLOCK" definition="0" compartment="0" count="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
<CONTINUOUS_ACTION layer="6">
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local characteristics = target:GetCurrentCharacteristics()
characteristics:Bool_Set( CHARACTERISTIC_CANT_BLOCK, 1 )
end
</CONTINUOUS_ACTION>
<DURATION simple_duration="UntilEOT" />
<AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
</TRIGGERED_ABILITY>
<UTILITY_ABILITY resource_id="1">
<COST mana_cost="{R}" type="Mana" />
</UTILITY_ABILITY>
- Code: Select all
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Frenzied Goblin attacks, you may pay {R}. If you do, target creature can’t block this turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que le Gobelin hystérique attaque, vous pouvez payer {R}. Si vous faites ainsi, la créature ciblée ne peut pas bloquer ce tour-ci.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que el Trasgo frenético ataque, puedes pagar {R}. Si lo haces, la criatura objetivo no puede bloquear este turno.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn der Wildgewordene Goblin angreift, kannst du {R} bezahlen. Falls du dies tust, kann eine Kreatur deiner Wahl in diesem Zug nicht blocken.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta il Goblin Delirante attacca, puoi pagare {R}. Se lo fai, una creatura bersaglio non può bloccare in questo turno.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[激情のゴブリンが攻撃するたび、クリーチャー1体を対象とする。あなたは{R}を支払ってもよい。そうしたなら、このターン、それではブロックできない。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[광란한 고블린이 공격할 때마다, 당신은 {R}를 지불할 수 있다. 그렇게 한다면, 생물을 목표로 정한다. 그 생물은 이 턴에 방어할 수 없다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз, когда Неистовый Гоблин атакует, вы можете заплатить {R}. Если вы это делаете, целевое существо не может блокировать в этом ходу.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que Goblin Ensandecido ataca, você pode pagar {R}. Se fizer isso, a criatura alvo não poderá bloquear neste turno.]]></LOCALISED_TEXT>
<TRIGGER value="ATTACKING" simple_qualifier="self" />
<RESOLUTION_TIME_ACTION>
local player = EffectController()
if player ~= nil then
if player:CanPayManaCost("{R}") then
player:BeginNewMultipleChoice()
player:AddMultipleChoiceAnswer( "UI_CONDITIONAL_QUESTION_NO" )
player:AddMultipleChoiceAnswer( "UI_CONDITIONAL_QUESTION_YES" )
player:AskMultipleChoiceQuestion( "OPTIONAL_ABILITY_QUESTION" )
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local player = EffectController()
if player ~= nil then
local result = player:GetMultipleChoiceResult()
if result == 1 then
player:PayManaCost("{R}")
local filter = ClearFilter()
local player = EffectController()
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
player:SetItemCount( 1 )
for i = 0, (1-1) do
player:SetItemPrompt(i, "CARD_QUERY_CHOOSE_CREATURE_GAIN_CANT_BLOCK" )
end
player:ChooseItems( EffectDC():Make_Targets(0) )
end
end
</RESOLUTION_TIME_ACTION>
<CONTINUOUS_ACTION layer="6">
local target = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local characteristics = target:GetCurrentCharacteristics()
characteristics:Bool_Set( CHARACTERISTIC_CANT_BLOCK, 1 )
end
</CONTINUOUS_ACTION>
<DURATION simple_duration="UntilEOT" />
<AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
</TRIGGERED_ABILITY>
May block is not needed if you use Multiple Choices question.
If you play with manual mana, there is another possibility, make this trigger as an activated ability with activation restrictions, this will make it more simple to use and it will not trigger any turn, but it will make the card a little bit less compliant to the original MTG one.
- Attachments
-
- Frenzied Goblin.rar
- Frenzied Goblin Card + TDX ART
- (348.19 KiB) Downloaded 206 times
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Frenzied Goblin & Dauntless Onslaught
by Chakan » 26 Aug 2014, 00:42
They look like silly mistakes to me on my behalf, but thanks for helping guys. I appreciate it.
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 33 guests