Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
Does the COLOUR_X constant work somehow?
Moderator: CCGHQ Admins
Does the COLOUR_X constant work somehow?
by thefiremind » 16 Feb 2013, 00:19
I was trying to code Frontline Medic, happy to see that there's a constant called COLOUR_X. I thought it was a "virtual" color given to cards that have in their mana costs. So I made this target definition:
Am I missing something, or COLOUR_X doesn't work at all?
Just in case someone has the same big idea as I had, the following code doesn't work either:
- Code: Select all
<TARGET_DEFINITION id="0">
local filter = Object():GetFilter()
filter:Clear()
filter:SetZone( ZONE_STACK )
filter:SetStackObjectType( STACK_OBJECT_CARD )
filter:AddColour( COLOUR_X )
filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
</TARGET_DEFINITION>
Am I missing something, or COLOUR_X doesn't work at all?
Just in case someone has the same big idea as I had, the following code doesn't work either:
- Code: Select all
<TARGET_DEFINITION id="0">
MTG():ClearFilterMarkedObjectsInZone( ZONE_STACK )
local filter = Object():GetFilter()
filter:Clear()
filter:SetZone( ZONE_STACK )
filter:SetStackObjectType( STACK_OBJECT_CARD )
local filter_count = filter:EvaluateObjects()
for i=0,filter_count-1 do
local candidate = filter:GetNthEvaluatedObject(i)
local chest = candidate:GetDataChest()
if chest ~= nil and chest:Get_Int( COMPARTMENT_ID_X ) > 0 then
candidate:MarkForFilter()
end
end
filter:SetMarkedObjectsOnly()
filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
</TARGET_DEFINITION>
< 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: Does the COLOUR_X constant work somehow?
by RiiakShiNal » 16 Feb 2013, 02:08
It would not surprise me if COLOUR_X does not work at all, much like COLOUR_COLOURLESS doesn't work and we have to test for each colour to make sure a card is or is not colourless.
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: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 10 guests