Commit 06fc1e9e authored by Fluorohydride's avatar Fluorohydride

Merge pull request #744 from salix5/patch

fix: multiple target
parents 753f47eb 4ffbf42a
...@@ -23,32 +23,45 @@ function c21007444.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -23,32 +23,45 @@ function c21007444.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function c21007444.activate(e,tp,eg,ep,ev,re,r,rp) function c21007444.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e) local sg0=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()==0 then return end local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local tg=sg:GetFirst() local sg=nil
while tg do if sg0:GetCount()==0 or ft<=0 then return end
if Duel.SpecialSummonStep(tg,0,tp,tp,false,false,POS_FACEUP_ATTACK) then if ft<sg0:GetCount() then
tg:RegisterFlagEffect(21007444,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=sg0:FilterSelect(tp,c21007444.filter,ft,ft,nil,e,tp)
else
sg=sg0:Clone()
end
if sg:GetCount()>0 then
local tg=sg:GetFirst()
local fid=e:GetHandler():GetFieldID()
while tg do
if Duel.SpecialSummonStep(tg,0,tp,tp,false,false,POS_FACEUP_ATTACK) then
tg:RegisterFlagEffect(21007444,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1,fid)
end
tg=sg:GetNext()
end end
tg=sg:GetNext() Duel.SpecialSummonComplete()
sg:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetOperation(c21007444.desop)
e1:SetLabel(fid)
e1:SetLabelObject(sg)
Duel.RegisterEffect(e1,tp)
end end
Duel.SpecialSummonComplete()
sg:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetOperation(c21007444.desop)
e1:SetLabelObject(sg)
Duel.RegisterEffect(e1,tp)
end end
function c21007444.desfilter(c) function c21007444.desfilter(c,fid)
return c:GetFlagEffect(21007444)>0 return c:GetFlagEffect(21007444)==fid
end end
function c21007444.desop(e,tp,eg,ep,ev,re,r,rp) function c21007444.desop(e,tp,eg,ep,ev,re,r,rp)
local sg=e:GetLabelObject() local sg=e:GetLabelObject()
local dg=sg:Filter(c21007444.desfilter,nil) local dg=sg:Filter(c21007444.desfilter,nil,e:GetLabel())
sg:DeleteGroup() sg:DeleteGroup()
if dg:GetCount()>0 then if dg:GetCount()>0 then
local tg1=dg:GetFirst() local tg1=dg:GetFirst()
......
...@@ -48,21 +48,36 @@ end ...@@ -48,21 +48,36 @@ end
function c22842214.eqop(e,tp,eg,ep,ev,re,r,rp) function c22842214.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if c:IsFacedown() or not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<g:GetCount() then return end local tg0=g:Filter(Card.IsRelateToEffect,nil,e)
local tc=g:GetFirst() local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
while tc do if tg0:GetCount()==0 or ft<=0 then return end
Duel.Equip(tp,tc,c,false,true) if c:IsFaceup() and c:IsRelateToEffect(e) then
tc:RegisterFlagEffect(22842214,RESET_EVENT+0x1fe0000,0,0) local tg=nil
local e1=Effect.CreateEffect(c) if ft<tg0:GetCount() then
e1:SetType(EFFECT_TYPE_SINGLE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
e1:SetCode(EFFECT_EQUIP_LIMIT) tg=tg0:FilterSelect(tp,c22842214.filter,ft,ft,nil)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE) else
e1:SetReset(RESET_EVENT+0x1fe0000) tg=tg0:Clone()
e1:SetValue(c22842214.eqlimit) end
tc:RegisterEffect(e1) if tg:GetCount()>0 then
tc=g:GetNext() local tc=tg:GetFirst()
while tc do
Duel.Equip(tp,tc,c,false,true)
tc:RegisterFlagEffect(22842214,RESET_EVENT+0x1fe0000,0,0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c22842214.eqlimit)
tc:RegisterEffect(e1)
tc=tg:GetNext()
end
Duel.EquipComplete()
end
else
Duel.SendtoGrave(tg0,REASON_EFFECT)
end end
Duel.EquipComplete()
end end
function c22842214.eqfilter(c,ec) function c22842214.eqfilter(c,ec)
return c:GetFlagEffect(22842214)~=0 and c:IsHasCardTarget(ec) and not c:IsStatus(STATUS_DESTROY_CONFIRMED) return c:GetFlagEffect(22842214)~=0 and c:IsHasCardTarget(ec) and not c:IsStatus(STATUS_DESTROY_CONFIRMED)
......
...@@ -66,15 +66,8 @@ end ...@@ -66,15 +66,8 @@ end
function c66957584.spop(e,tp,eg,ep,ev,re,r,rp) function c66957584.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 then return end if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 then return end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e) local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()==0 then return end if sg:GetCount()==0 or ft<sg:GetCount() then return end
if ft>=g:GetCount() then Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg2=sg:Select(tp,ft,ft,nil)
Duel.SpecialSummon(sg2,0,tp,tp,false,false,POS_FACEUP)
end
end end
--インフェルニティ·ミラージュ --インフェルニティミラージュ
function c86197239.initial_effect(c) function c86197239.initial_effect(c)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
......
--スクラップ·サーチャー --スクラップサーチャー
function c92901944.initial_effect(c) function c92901944.initial_effect(c)
--special summon --special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -26,7 +26,7 @@ function c92901944.cfilter(c,tp) ...@@ -26,7 +26,7 @@ function c92901944.cfilter(c,tp)
and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)
end end
function c92901944.spcon(e,tp,eg,ep,ev,re,r,rp) function c92901944.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c92901944.cfilter,1,e:GetHandler(),tp) return eg:IsExists(c92901944.cfilter,1,e:GetHandler(),tp) and not eg:IsContains(e:GetHandler())
end end
function c92901944.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c92901944.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
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