Re: [REL] Riiak Shi Nal's DotP 2013 DLC - v1.2.1
Flameblast Dragon's ability isn't working, could someone fix it, please? First, the ability does no damage to the target whatever mana you've spent for it. And second, the mana cost for the ability is XR. The problem here is, that it should automatically use the red mana for the cost, then let you use all the mana available for the X. But it works slightly wrong. It lets you first spend all the mana avaliable for X and it doesn't care for the R mana cost of the ability. It just lets you spend one mana less than the maximum available, but it lets the last mana untapped (unused) and it doesn't even care for it beiing red. Here is the code.

- Code: Select all
<TRIGGERED_ABILITY LKI_shield_effect_source="1" filter_zone="ZONE_IN_PLAY" active_zone="ZONE_IN_PLAY">
<TRIGGER value="ATTACKING" simple_qualifier="self" />
<COST type="Mana" cost="{R}" qualifier="Conditional" />
<TARGET_DEFINITION id="0">
local filter = Object():GetFilter()
filter:Clear()
filter:SetFilterType( FILTER_TYPE_CARDS + FILTER_TYPE_PLAYERS )
filter:SetZone( ZONE_IN_PLAY )
filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
filter:AddCardType( CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(0)
</TARGET_DETERMINATION>
<PLAY_TIME_ACTION>
local nMaxAvailable = 1
while (EffectController():CanAfford( "{"..nMaxAvailable.."}{R}" ) == 1) do
nMaxAvailable = nMaxAvailable + 1
end
-- Will finish at max + 1 so we need to reduce by 1
nMaxAvailable = nMaxAvailable - 1
EffectController():BeginNewNumericalChoice()
EffectController():AddNumericalChoiceAnswer( nMaxAvailable )
EffectController():AskNumericalChoiceQuestion( "CARD_QUERY_CHOOSE_AMOUNT_DAMAGE" )
</PLAY_TIME_ACTION>
<PLAY_TIME_ACTION target_choosing="1">
EffectDC():Int_Set( 1, Object():GetNumericalChoiceResult() )
EffectController():TapLand( "{"..EffectDC():Int_Get( 1 ).."}" )
EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_DEAL_X_DAMAGE", EffectDC():Make_Targets(0) )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION conditional="if">
local Xvalue = EffectDC():Int_Get( 1 )
local target_creature = EffectDC():Get_Targets(0):Get_CardPtr(0)
local target_player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
if ( target_creature ~= nil ) then
target_creature:DealDamage(Xvalue, Object())
elseif ( target_player ~= nil ) then
target_player:DealDamage(Xvalue, Object())
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>