RiiakShiNal wrote:I see at least one problem here:
You aren't considering that you went over the max amount they can pay by

. Say a player has
Kessig Wolf Run, 2
Forest and 2
Mountain, your code will say that the max they can afford for

is 3 because the
Kessig Wolf Run isn't tapped yet (which you have accounted for), but it will then go through the loop until max_mana = 3 and max_mana_string = "{1}{1}{1}{1}{R}{G}" which will be outside what can be paid (even counting the
Kessig Wolf Run). After the loop, but before you setup the Numeric question you need to reduce max_mana by 1 (standard off-by-one error).
The highlight may still end up wrong, but it should still work.
You are right, I miss something, now it seems work fine, thank you, thefiremind, and Xander9009.

EDIT:
RiiakShiNal wrote:Edit: Personally, I would code
Kessig Wolf Run using my manual mana functions as then this wouldn't be an issue.
Yes, I use your manual mana functions in a lot of cards, but if I can I still want to avoid it, for the players click each time is too much trouble.
Some other interesting things, when I code
Restore Balance, if I use
- Code: Select all
<TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_ANY">
<TRIGGER value="CONSIDERED_FOR_CAST" simple_qualifier="self" pre_trigger="1" />
<RESOLUTION_TIME_ACTION>
if TriggerObject() ~= nil then
TriggerObject():IncreaseCost( 25 )
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
and
- Code: Select all
<AVAILABILITY>
return (Object():GetCurrentCharacteristics():Bool_Get( CHARACTERISTIC_FLASH ) or EffectController():IsSorceryTime()) and Object():CanBePlayed( EffectController() )
</AVAILABILITY>
, I can't play its suspend ability even if I can pay

, when I remove Object():CanBePlayed( EffectController() ), suspend ability can be paly, EffectController():CastSpellForFree(Object()) is the same, but when I change the considered for cast ability to this:
- Code: Select all
<TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_ANY">
<TRIGGER value="CONSIDERED_FOR_CAST" simple_qualifier="self" pre_trigger="1" />
</TRIGGERED_ABILITY>
, the card still can't be paly ,but the suspend ability with Object():CanBePlayed( EffectController() ) can be play, I don't know why.
When I code
Gilded Lotus, I use
- Code: Select all
<MANA_ABILITY resource_id="1">
<PRODUCES amount="{W}{W}{W}" />
</MANA_ABILITY>
, it is always preferred to be tapped no matter what color be chosen, even if I have other colors land, but when I use
- Code: Select all
<MANA_ABILITY resource_id="1">
<PRODUCES amount="{W}" />
<PRODUCES amount="{W}" />
<PRODUCES amount="{W}" />
</MANA_ABILITY>
I can keep it untapped and use other colors land.
