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
Thoughtseize
Moderator: CCGHQ Admins
4 posts
• Page 1 of 1
Thoughtseize
by Persee » 24 Sep 2012, 16:18
Hello,
Here's the code :
Thx for help.
Here's the code :
- Code: Select all
<SPELL_ABILITY filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Target player reveals his or her hand. You choose a nonland card from it. That player discards that card. You lose 2 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Target player reveals his or her hand. You choose a nonland card from it. That player discards that card. You lose 2 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Target player reveals his or her hand. You choose a nonland card from it. That player discards that card. You lose 2 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Target player reveals his or her hand. You choose a nonland card from it. That player discards that card. You lose 2 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Target player reveals his or her hand. You choose a nonland card from it. That player discards that card. You lose 2 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Target player reveals his or her hand. You choose a nonland card from it. That player discards that card. You lose 2 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Target player reveals his or her hand. You choose a nonland card from it. That player discards that card. You lose 2 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Target player reveals his or her hand. You choose a nonland card from it. That player discards that card. You lose 2 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Target player reveals his or her hand. You choose a nonland card from it. That player discards that card. You lose 2 life.]]></LOCALISED_TEXT>
<TARGET_DEFINITION id="0">
local filter = Object():GetFilter()
filter:Clear()
filter:SetFilterType( FILTER_TYPE_PLAYERS )
filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(0)
</TARGET_DETERMINATION>
<PLAY_TIME_ACTION target_choosing="1">
EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_PLAYER", EffectDC():Make_Targets(0) )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local targetplayer = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
local player = EffectController()
local filter = Object():GetFilter()
if targetplayer ~= nil then
filter:Clear()
filter:NotTargetted()
filter:AddCardType( CARD_TYPE_LAND )
filter:AddExtra( FILTER_EXTRA_FLIP_CARD_TYPES )
filter:SetZone( ZONE_HAND )
filter:SetPlayer( targetplayer )
player:ChooseTarget( 1, "CARD_QUERY_CHOOSE_CARD_TO_DISCARD", EffectDC():Make_Targets(1) )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local targetplayer = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
local player = EffectController()
local targetcard = EffectDC():Get_Targets(1):Get_PlayerPtr(0)
if targetcard ~= nil then
targetcard:Discard()
else
if targetplayer ~= nil then
local filter = Object():GetFilter()
filter:Clear()
filter:NotTargetted()
filter:SetZone( ZONE_HAND )
filter:SetPlayer( targetplayer )
filter:May()
player:ChooseTarget( 2, "CARD_QUERY_LOOK_AT_CARDS", EffectDC():Make_Targets(2) )
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
EffectController():LoseLife(2)
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
Thx for help.
Re: Thoughtseize
by RiiakShiNal » 24 Sep 2012, 19:27
- Code: Select all
local targetcard = EffectDC():Get_Targets(1):Get_PlayerPtr(0)
- Code: Select all
local targetcard = EffectDC():Get_Targets(1):Get_CardPtr(0)
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2189
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: Thoughtseize
by RiiakShiNal » 25 Sep 2012, 18:27
You probably got concerned with other parts of the code and just missed it, it happens to all of us (which is why a second set of eyes helps).Persee wrote:I wonder how I could miss it.
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2189
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: Google [Bot] and 13 guests
