Commit cdfbd563 authored by nekrozar's avatar nekrozar Committed by DailyShana

fix Destiny Mirage (#655)

parent 9012137a
......@@ -11,7 +11,7 @@ function c15294090.initial_effect(c)
c:RegisterEffect(e1)
end
function c15294090.cfilter(c,tp)
return c:IsSetCard(0xc008) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:GetPreviousControler()==tp
return c:IsPreviousSetCard(0xc008) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp
end
function c15294090.condition(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT)~=0 and rp~=tp and eg:IsExists(c15294090.cfilter,1,nil,tp)
......@@ -21,16 +21,15 @@ function c15294090.spfilter(c,e,tp)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c15294090.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c15294090.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,PLAYER_ALL,LOCATION_GRAVE)
local g=Duel.GetMatchingGroup(c15294090.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,e,tp)
if chk==0 then return g:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>=g:GetCount() end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
end
function c15294090.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c15294090.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,e,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c15294090.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,ft,nil,e,tp)
if g:GetCount()~=0 then
if ft<=0 or ft<g:GetCount() or (g:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133)) then return end
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
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