I haven't tested this, but try this. The code for getting the least toughness is based on Neo's KTK function.
- Code: Select all
<RESOLUTION_TIME_ACTION>
local Player = EffectController()
local Min_Toughness = 0
local filter = ClearFilter()
filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
filter:Add(FE_CONTROLLER, OP_IS, Player)
local filter_count = filter:EvaluateObjects()
if filter_count > 0 then
for i=0, filter_count-1 do
local creature = filter:GetNthEvaluatedObject(i)
if creature ~= nil then
local Toughness = creature:GetCurrentCharacteristics():Toughness_Get()
if Toughness < Min_Toughness then
Min_Toughness = Toughness
end
end
end
end
filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_CONTROLLER, OP_IS, Player )
filter:Add( FE_TOUGHNESS, OP_EQUALS, Min_Toughness )
filter_count = filter:EvaluateObjects()
if filter_count > 1 then
Player:ChooseItem( "CARD_QUERY_CHOOSE_CREATURE_TO_GET_PLUS1_PLUS1_COUNTER", EffectDC():Make_Targets(0) )
elseif filter_count = 1 then
filter:GetNthEvaluatedObject(0):Make_Targets(0)
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local Target_Creature = EffectDC():Get_Targets(0):Get_CardPtr(0)
if Target_Creature ~= nil then
Target_Creature:AddCounters( MTG():PlusOnePlusOneCounters() , 1 ) --Change 1 to Bolster number
end
</RESOLUTION_TIME_ACTION>
If it ends up getting you close enough, great. If not, let me know, and I'll test it out and see if I can make it work.
EDIT: Just noticed your release thread in which you mention you completed it.
Sorry, I'm still getting caught up on what I've missed haha.