Commit 907f28a9 authored by nekrozar's avatar nekrozar Committed by DailyShana

fix Combination Attack (#460)

parent 9b688d23
...@@ -18,21 +18,23 @@ function c8964854.filter(c,e,tp) ...@@ -18,21 +18,23 @@ function c8964854.filter(c,e,tp)
return c:GetAttackAnnouncedCount()>0 and Duel.IsExistingMatchingCard(c8964854.eqfilter,tp,LOCATION_SZONE,0,1,nil,e,tp,c) return c:GetAttackAnnouncedCount()>0 and Duel.IsExistingMatchingCard(c8964854.eqfilter,tp,LOCATION_SZONE,0,1,nil,e,tp,c)
end end
function c8964854.eqfilter(c,e,tp,ec) function c8964854.eqfilter(c,e,tp,ec)
return c:IsStatus(STATUS_UNION) and c:GetEquipTarget()==ec and c:IsCanBeSpecialSummoned(e,0,tp,false,false) local op=c:GetOwner()
return c:IsStatus(STATUS_UNION) and c:GetEquipTarget()==ec
and Duel.GetLocationCount(op,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,op)
end end
function c8964854.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c8964854.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c8964854.filter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and c8964854.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.IsExistingTarget(c8964854.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
and Duel.IsExistingTarget(c8964854.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c8964854.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp) Duel.SelectTarget(tp,c8964854.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_SZONE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_SZONE)
end end
function c8964854.operation(e,tp,eg,ep,ev,re,r,rp) function c8964854.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then local op=tc:GetOwner()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.GetLocationCount(op,LOCATION_MZONE)>0 then
local g=Duel.GetMatchingGroup(c8964854.eqfilter,tp,LOCATION_SZONE,0,nil,e,tp,tc) local g=Duel.GetMatchingGroup(c8964854.eqfilter,tp,LOCATION_SZONE,0,nil,e,tp,tc)
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then if Duel.SpecialSummon(g,0,tp,op,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK) e1:SetCode(EFFECT_EXTRA_ATTACK)
......
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