Commit 75823d67 authored by Chrono-Genex's avatar Chrono-Genex Committed by GitHub

fix Rare Metalmorph (#1586)

parent 820d1245
...@@ -43,45 +43,21 @@ function c12503902.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -43,45 +43,21 @@ function c12503902.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c12503902.filter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SelectTarget(tp,c12503902.filter,tp,LOCATION_MZONE,0,1,1,nil)
end end
function c12503902.tfilter1(c,tc)
return c:IsType(TYPE_SPELL) and c:IsHasCardTarget(tc)
end
function c12503902.operation(e,tp,eg,ep,ev,re,r,rp) function c12503902.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c12503902.filter(tc) and tc:IsRelateToEffect(e) then if c:IsRelateToEffect(e) and c12503902.filter(tc) and tc:IsRelateToEffect(e) then
c:SetCardTarget(tc) c:SetCardTarget(tc)
local g=Duel.GetMatchingGroup(c12503902.tfilter1,tp,LOCATION_SZONE,LOCATION_SZONE,nil,tc) local e1=Effect.CreateEffect(c)
if g:GetCount()>0 then e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
local sg,fid=g:GetMaxGroup(Card.GetFieldID) e1:SetRange(LOCATION_SZONE)
local e1=Effect.CreateEffect(c) e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetCondition(c12503902.discon2)
e1:SetRange(LOCATION_SZONE) e1:SetOperation(c12503902.disop2)
e1:SetTargetRange(LOCATION_SZONE,LOCATION_SZONE) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetCode(EFFECT_DISABLE) c:RegisterEffect(e1,true)
e1:SetCondition(c12503902.discon)
e1:SetTarget(c12503902.distg)
e1:SetLabel(fid)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1,true)
else
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_SZONE)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCondition(c12503902.discon2)
e1:SetOperation(c12503902.disop2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1,true)
end
end end
end end
function c12503902.discon(e)
return e:GetHandler():GetCardTargetCount()>0
end
function c12503902.distg(e,c)
return c:GetFieldID()<=e:GetLabel() and c:IsHasCardTarget(e:GetHandler():GetFirstCardTarget()) and c:IsType(TYPE_SPELL)
end
function c12503902.discon2(e,tp,eg,ep,ev,re,r,rp) function c12503902.discon2(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget() local tc=e:GetHandler():GetFirstCardTarget()
if not tc or not re:IsActiveType(TYPE_SPELL) or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end if not tc or not re:IsActiveType(TYPE_SPELL) or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment